refactor: 收口 Admin 会话与授权边界
This commit is contained in:
1 parent
0788480ce3
commit
4ef4be2071
67 files changed
+1890
-392
No files matched your search
+39
-10
@@ -122,15 +122,30 @@ paths:
|
||||
$ref: "#/components/schemas/AdminLogin"
|
||||
responses:
|
||||
"201":
|
||||
description: Admin session token
|
||||
description: Admin session created; the access token is set as an HttpOnly cookie
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: "#/components/schemas/AdminTokenResponse"
|
||||
$ref: "#/components/schemas/AdminLoginSession"
|
||||
/admin/session/current:
|
||||
get:
|
||||
operationId: getAdminSession
|
||||
security:
|
||||
- cookieAuth: []
|
||||
- bearerAuth: []
|
||||
responses:
|
||||
"200":
|
||||
description: Current admin session
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: "#/components/schemas/AdminSession"
|
||||
/admin/session/logout:
|
||||
post:
|
||||
operationId: logoutAdmin
|
||||
security: [bearerAuth: []]
|
||||
security:
|
||||
- cookieAuth: []
|
||||
- bearerAuth: []
|
||||
responses:
|
||||
"201":
|
||||
description: Admin session revoked
|
||||
@@ -256,6 +271,10 @@ components:
|
||||
bearerAuth:
|
||||
type: http
|
||||
scheme: bearer
|
||||
cookieAuth:
|
||||
type: apiKey
|
||||
in: cookie
|
||||
name: admin_session
|
||||
parameters:
|
||||
BookingId:
|
||||
in: path
|
||||
@@ -353,13 +372,23 @@ components:
|
||||
required: [loggedOut]
|
||||
properties:
|
||||
loggedOut: { type: boolean, enum: [true] }
|
||||
AdminTokenResponse:
|
||||
allOf:
|
||||
- $ref: "#/components/schemas/TokenResponse"
|
||||
- type: object
|
||||
required: [displayName]
|
||||
properties:
|
||||
displayName: { type: string }
|
||||
AdminSession:
|
||||
type: object
|
||||
required: [authenticated, displayName, mustChangePassword, role, platformTemplateRole]
|
||||
properties:
|
||||
authenticated: { type: boolean, enum: [true] }
|
||||
displayName: { type: string }
|
||||
mustChangePassword: { type: boolean }
|
||||
role: { type: string }
|
||||
platformTemplateRole: { type: string, enum: [none, template_admin] }
|
||||
AdminLoginSession:
|
||||
type: object
|
||||
required: [displayName, mustChangePassword, role, platformTemplateRole]
|
||||
properties:
|
||||
displayName: { type: string }
|
||||
mustChangePassword: { type: boolean }
|
||||
role: { type: string }
|
||||
platformTemplateRole: { type: string, enum: [none, template_admin] }
|
||||
UpdateBookingStatus:
|
||||
type: object
|
||||
required: [status]
|
||||
|
||||
Reference in new issue
Block a user