feat: end-user log out (#1356)

This commit is contained in:
Yaodong Yu
2023-01-17 22:57:05 +08:00
committed by GitHub
parent 0021226a60
commit 5d9b17542f
20 changed files with 816 additions and 201 deletions

View File

@ -275,6 +275,34 @@
}
}
},
"/api/add-record": {
"post": {
"tags": [
"Record API"
],
"description": "add a record",
"operationId": "ApiController.AddRecord",
"parameters": [
{
"in": "body",
"name": "body",
"description": "The details of the record",
"required": true,
"schema": {
"$ref": "#/definitions/object.Record"
}
}
],
"responses": {
"200": {
"description": "The Response object",
"schema": {
"$ref": "#/definitions/controllers.Response"
}
}
}
}
},
"/api/add-resource": {
"post": {
"tags": [
@ -431,6 +459,14 @@
"operationId": "ApiController.GetCaptcha"
}
},
"/api/api/get-webhook-event": {
"get": {
"tags": [
"GetWebhookEventType API"
],
"operationId": "ApiController.GetWebhookEventType"
}
},
"/api/api/reset-email-or-phone": {
"post": {
"tags": [
@ -523,6 +559,14 @@
}
}
},
"/api/api/webhook": {
"post": {
"tags": [
"HandleOfficialAccountEvent API"
],
"operationId": "ApiController.HandleOfficialAccountEvent"
}
},
"/api/buy-product": {
"post": {
"tags": [
@ -840,6 +884,35 @@
}
}
},
"/api/delete-session": {
"post": {
"tags": [
"Session API"
],
"description": "Delete session by userId",
"operationId": "ApiController.DeleteSession",
"parameters": [
{
"in": "query",
"name": "ID",
"description": "The ID(owner/name) of user.",
"required": true,
"type": "string"
}
],
"responses": {
"200": {
"description": "The Response object",
"schema": {
"type": "array",
"items": {
"type": "string"
}
}
}
}
}
},
"/api/delete-syncer": {
"post": {
"tags": [
@ -1133,6 +1206,32 @@
}
}
},
"/api/get-default-application": {
"get": {
"tags": [
"Organization API"
],
"description": "get default application",
"operationId": "ApiController.GetDefaultApplication",
"parameters": [
{
"in": "query",
"name": "id",
"description": "organization id",
"required": true,
"type": "string"
}
],
"responses": {
"200": {
"description": "The Response object",
"schema": {
"$ref": "#/definitions/Response"
}
}
}
}
},
"/api/get-email-and-phone": {
"post": {
"tags": [
@ -1166,6 +1265,26 @@
}
}
},
"/api/get-global-providers": {
"get": {
"tags": [
"Provider API"
],
"description": "get Global providers",
"operationId": "ApiController.GetGlobalProviders",
"responses": {
"200": {
"description": "The Response object",
"schema": {
"type": "array",
"items": {
"$ref": "#/definitions/object.Provider"
}
}
}
}
}
},
"/api/get-global-users": {
"get": {
"tags": [
@ -1459,6 +1578,55 @@
}
}
},
"/api/get-permissions-by-role": {
"get": {
"tags": [
"Permission API"
],
"description": "get permissions by role",
"operationId": "ApiController.GetPermissionsByRole",
"parameters": [
{
"in": "query",
"name": "id",
"description": "The id of the role",
"required": true,
"type": "string"
}
],
"responses": {
"200": {
"description": "The Response object",
"schema": {
"type": "array",
"items": {
"$ref": "#/definitions/object.Permission"
}
}
}
}
}
},
"/api/get-permissions-by-submitter": {
"get": {
"tags": [
"Permission API"
],
"description": "get permissions by submitter",
"operationId": "ApiController.GetPermissionsBySubmitter",
"responses": {
"200": {
"description": "The Response object",
"schema": {
"type": "array",
"items": {
"$ref": "#/definitions/object.Permission"
}
}
}
}
}
},
"/api/get-product": {
"get": {
"tags": [
@ -1631,6 +1799,20 @@
}
}
},
"/api/get-release": {
"get": {
"tags": [
"System API"
],
"description": "get local github repo's latest release version info",
"operationId": "ApiController.GitRepoVersion",
"responses": {
"200": {
"description": "{string} local latest version hash of casdoor"
}
}
}
},
"/api/get-resource": {
"get": {
"tags": [
@ -1702,6 +1884,35 @@
}
}
},
"/api/get-sessions": {
"get": {
"tags": [
"Session API"
],
"description": "Get organization user sessions",
"operationId": "ApiController.GetSessions",
"parameters": [
{
"in": "query",
"name": "owner",
"description": "The organization name",
"required": true,
"type": "string"
}
],
"responses": {
"200": {
"description": "The Response object",
"schema": {
"type": "array",
"items": {
"type": "string"
}
}
}
}
}
},
"/api/get-sorted-users": {
"get": {
"tags": [
@ -1799,6 +2010,32 @@
}
}
},
"/api/get-system-info": {
"get": {
"tags": [
"System API"
],
"description": "get user's system info",
"operationId": "ApiController.GetSystemInfo",
"parameters": [
{
"in": "query",
"name": "id",
"description": "The id of the user",
"required": true,
"type": "string"
}
],
"responses": {
"200": {
"description": "The Response object",
"schema": {
"$ref": "#/definitions/object.SystemInfo"
}
}
}
}
},
"/api/get-token": {
"get": {
"tags": [
@ -2360,45 +2597,6 @@
}
}
},
"/api/login/oauth/logout": {
"get": {
"tags": [
"Token API"
],
"description": "delete token by AccessToken",
"operationId": "ApiController.TokenLogout",
"parameters": [
{
"in": "query",
"name": "id_token_hint",
"description": "id_token_hint",
"required": true,
"type": "string"
},
{
"in": "query",
"name": "post_logout_redirect_uri",
"description": "post_logout_redirect_uri",
"type": "string"
},
{
"in": "query",
"name": "state",
"description": "state",
"required": true,
"type": "string"
}
],
"responses": {
"200": {
"description": "The Response object",
"schema": {
"$ref": "#/definitions/controllers.Response"
}
}
}
}
},
"/api/login/oauth/refresh_token": {
"post": {
"tags": [
@ -2471,6 +2669,26 @@
],
"description": "logout the current user",
"operationId": "ApiController.Logout",
"parameters": [
{
"in": "query",
"name": "id_token_hint",
"description": "id_token_hint",
"type": "string"
},
{
"in": "query",
"name": "post_logout_redirect_uri",
"description": "post_logout_redirect_uri",
"type": "string"
},
{
"in": "query",
"name": "state",
"description": "state",
"type": "string"
}
],
"responses": {
"200": {
"description": "The Response object",
@ -2486,6 +2704,26 @@
],
"description": "logout the current user",
"operationId": "ApiController.Logout",
"parameters": [
{
"in": "query",
"name": "id_token_hint",
"description": "id_token_hint",
"type": "string"
},
{
"in": "query",
"name": "post_logout_redirect_uri",
"description": "post_logout_redirect_uri",
"type": "string"
},
{
"in": "query",
"name": "state",
"description": "state",
"type": "string"
}
],
"responses": {
"200": {
"description": "The Response object",
@ -3267,11 +3505,11 @@
}
},
"definitions": {
"2200.0xc0003f8480.false": {
"2268.0xc0000f9650.false": {
"title": "false",
"type": "object"
},
"2235.0xc0003f84b0.false": {
"2302.0xc0000f9680.false": {
"title": "false",
"type": "object"
},
@ -3316,6 +3554,15 @@
"autoSignin": {
"type": "boolean"
},
"captchaToken": {
"type": "string"
},
"captchaType": {
"type": "string"
},
"clientSecret": {
"type": "string"
},
"code": {
"type": "string"
},
@ -3389,10 +3636,10 @@
"type": "object",
"properties": {
"data": {
"$ref": "#/definitions/2200.0xc0003f8480.false"
"$ref": "#/definitions/2268.0xc0000f9650.false"
},
"data2": {
"$ref": "#/definitions/2235.0xc0003f84b0.false"
"$ref": "#/definitions/2302.0xc0000f9680.false"
},
"msg": {
"type": "string"
@ -3491,9 +3738,15 @@
"displayName": {
"type": "string"
},
"enableAutoSignin": {
"type": "boolean"
},
"enableCodeSignin": {
"type": "boolean"
},
"enableLinkWithEmail": {
"type": "boolean"
},
"enablePassword": {
"type": "boolean"
},
@ -3516,6 +3769,19 @@
"forgetUrl": {
"type": "string"
},
"formBackgroundUrl": {
"type": "string"
},
"formCss": {
"type": "string"
},
"formOffset": {
"type": "integer",
"format": "int64"
},
"formSideHtml": {
"type": "string"
},
"grantTypes": {
"type": "array",
"items": {
@ -3556,6 +3822,9 @@
"type": "integer",
"format": "int64"
},
"samlReplyUrl": {
"type": "string"
},
"signinHtml": {
"type": "string"
},
@ -3689,6 +3958,24 @@
}
}
},
"object.ManagedAccount": {
"title": "ManagedAccount",
"type": "object",
"properties": {
"application": {
"type": "string"
},
"password": {
"type": "string"
},
"signinUrl": {
"type": "string"
},
"username": {
"type": "string"
}
}
},
"object.Model": {
"title": "Model",
"type": "object",
@ -3726,6 +4013,9 @@
"type": "string"
}
},
"end_session_endpoint": {
"type": "string"
},
"grant_types_supported": {
"type": "array",
"items": {
@ -3801,6 +4091,9 @@
"createdTime": {
"type": "string"
},
"defaultApplication": {
"type": "string"
},
"defaultAvatar": {
"type": "string"
},
@ -3813,9 +4106,19 @@
"favicon": {
"type": "string"
},
"initScore": {
"type": "integer",
"format": "int64"
},
"isProfilePublic": {
"type": "boolean"
},
"languages": {
"type": "array",
"items": {
"type": "string"
}
},
"masterPassword": {
"type": "string"
},
@ -3943,12 +4246,27 @@
"type": "string"
}
},
"adapter": {
"type": "string"
},
"approveTime": {
"type": "string"
},
"approver": {
"type": "string"
},
"createdTime": {
"type": "string"
},
"displayName": {
"type": "string"
},
"domains": {
"type": "array",
"items": {
"type": "string"
}
},
"effect": {
"type": "string"
},
@ -3979,6 +4297,12 @@
"type": "string"
}
},
"state": {
"type": "string"
},
"submitter": {
"type": "string"
},
"users": {
"type": "array",
"items": {
@ -3997,6 +4321,9 @@
"currency": {
"type": "string"
},
"description": {
"type": "string"
},
"detail": {
"type": "string"
},
@ -4016,6 +4343,12 @@
"type": "number",
"format": "double"
},
"providerObjs": {
"type": "array",
"items": {
"$ref": "#/definitions/object.Provider"
}
},
"providers": {
"type": "array",
"items": {
@ -4090,6 +4423,9 @@
"customUserInfoUrl": {
"type": "string"
},
"disableSsl": {
"type": "boolean"
},
"displayName": {
"type": "string"
},
@ -4126,6 +4462,9 @@
"owner": {
"type": "string"
},
"pathPrefix": {
"type": "string"
},
"port": {
"type": "integer",
"format": "int64"
@ -4133,6 +4472,9 @@
"providerUrl": {
"type": "string"
},
"receiver": {
"type": "string"
},
"regionId": {
"type": "string"
},
@ -4172,11 +4514,17 @@
"name": {
"type": "string"
},
"owner": {
"type": "string"
},
"prompted": {
"type": "boolean"
},
"provider": {
"$ref": "#/definitions/object.Provider"
},
"rule": {
"type": "string"
}
}
},
@ -4233,6 +4581,12 @@
"displayName": {
"type": "string"
},
"domains": {
"type": "array",
"items": {
"type": "string"
}
},
"isEnabled": {
"type": "boolean"
},
@ -4345,6 +4699,10 @@
}
}
},
"object.SystemInfo": {
"title": "SystemInfo",
"type": "object"
},
"object.TableColumn": {
"title": "TableColumn",
"type": "object",
@ -4605,15 +4963,27 @@
"lastSigninTime": {
"type": "string"
},
"lastSigninWrongTime": {
"type": "string"
},
"ldap": {
"type": "string"
},
"line": {
"type": "string"
},
"linkedin": {
"type": "string"
},
"location": {
"type": "string"
},
"managedAccounts": {
"type": "array",
"items": {
"$ref": "#/definitions/object.ManagedAccount"
}
},
"name": {
"type": "string"
},
@ -4669,6 +5039,10 @@
"type": "integer",
"format": "int64"
},
"signinWrongTimes": {
"type": "integer",
"format": "int64"
},
"signupApplication": {
"type": "string"
},
@ -4687,9 +5061,6 @@
"type": {
"type": "string"
},
"unionId": {
"type": "string"
},
"updatedTime": {
"type": "string"
},

View File

@ -177,6 +177,24 @@ paths:
description: The Response object
schema:
$ref: '#/definitions/controllers.Response'
/api/add-record:
post:
tags:
- Record API
description: add a record
operationId: ApiController.AddRecord
parameters:
- in: body
name: body
description: The details of the record
required: true
schema:
$ref: '#/definitions/object.Record'
responses:
"200":
description: The Response object
schema:
$ref: '#/definitions/controllers.Response'
/api/add-resource:
post:
tags:
@ -277,6 +295,11 @@ paths:
tags:
- Login API
operationId: ApiController.GetCaptcha
/api/api/get-webhook-event:
get:
tags:
- GetWebhookEventType API
operationId: ApiController.GetWebhookEventType
/api/api/reset-email-or-phone:
post:
tags:
@ -338,6 +361,11 @@ paths:
description: object
schema:
$ref: '#/definitions/Response'
/api/api/webhook:
post:
tags:
- HandleOfficialAccountEvent API
operationId: ApiController.HandleOfficialAccountEvent
/api/buy-product:
post:
tags:
@ -542,6 +570,25 @@ paths:
description: The Response object
schema:
$ref: '#/definitions/controllers.Response'
/api/delete-session:
post:
tags:
- Session API
description: Delete session by userId
operationId: ApiController.DeleteSession
parameters:
- in: query
name: ID
description: The ID(owner/name) of user.
required: true
type: string
responses:
"200":
description: The Response object
schema:
type: array
items:
type: string
/api/delete-syncer:
post:
tags:
@ -734,6 +781,23 @@ paths:
type: array
items:
$ref: '#/definitions/object.Cert'
/api/get-default-application:
get:
tags:
- Organization API
description: get default application
operationId: ApiController.GetDefaultApplication
parameters:
- in: query
name: id
description: organization id
required: true
type: string
responses:
"200":
description: The Response object
schema:
$ref: '#/definitions/Response'
/api/get-email-and-phone:
post:
tags:
@ -756,6 +820,19 @@ paths:
description: The Response object
schema:
$ref: '#/definitions/controllers.Response'
/api/get-global-providers:
get:
tags:
- Provider API
description: get Global providers
operationId: ApiController.GetGlobalProviders
responses:
"200":
description: The Response object
schema:
type: array
items:
$ref: '#/definitions/object.Provider'
/api/get-global-users:
get:
tags:
@ -947,6 +1024,38 @@ paths:
type: array
items:
$ref: '#/definitions/object.Permission'
/api/get-permissions-by-role:
get:
tags:
- Permission API
description: get permissions by role
operationId: ApiController.GetPermissionsByRole
parameters:
- in: query
name: id
description: The id of the role
required: true
type: string
responses:
"200":
description: The Response object
schema:
type: array
items:
$ref: '#/definitions/object.Permission'
/api/get-permissions-by-submitter:
get:
tags:
- Permission API
description: get permissions by submitter
operationId: ApiController.GetPermissionsBySubmitter
responses:
"200":
description: The Response object
schema:
type: array
items:
$ref: '#/definitions/object.Permission'
/api/get-product:
get:
tags:
@ -1060,6 +1169,15 @@ paths:
description: The Response object
schema:
$ref: '#/definitions/object.Record'
/api/get-release:
get:
tags:
- System API
description: get local github repo's latest release version info
operationId: ApiController.GitRepoVersion
responses:
"200":
description: '{string} local latest version hash of casdoor'
/api/get-resource:
get:
tags:
@ -1106,6 +1224,25 @@ paths:
type: array
items:
$ref: '#/definitions/object.Role'
/api/get-sessions:
get:
tags:
- Session API
description: Get organization user sessions
operationId: ApiController.GetSessions
parameters:
- in: query
name: owner
description: The organization name
required: true
type: string
responses:
"200":
description: The Response object
schema:
type: array
items:
type: string
/api/get-sorted-users:
get:
tags:
@ -1170,6 +1307,23 @@ paths:
type: array
items:
$ref: '#/definitions/object.Syncer'
/api/get-system-info:
get:
tags:
- System API
description: get user's system info
operationId: ApiController.GetSystemInfo
parameters:
- in: query
name: id
description: The id of the user
required: true
type: string
responses:
"200":
description: The Response object
schema:
$ref: '#/definitions/object.SystemInfo'
/api/get-token:
get:
tags:
@ -1544,32 +1698,6 @@ paths:
description: The Response object
schema:
$ref: '#/definitions/object.TokenError'
/api/login/oauth/logout:
get:
tags:
- Token API
description: delete token by AccessToken
operationId: ApiController.TokenLogout
parameters:
- in: query
name: id_token_hint
description: id_token_hint
required: true
type: string
- in: query
name: post_logout_redirect_uri
description: post_logout_redirect_uri
type: string
- in: query
name: state
description: state
required: true
type: string
responses:
"200":
description: The Response object
schema:
$ref: '#/definitions/controllers.Response'
/api/login/oauth/refresh_token:
post:
tags:
@ -1620,6 +1748,19 @@ paths:
- Login API
description: logout the current user
operationId: ApiController.Logout
parameters:
- in: query
name: id_token_hint
description: id_token_hint
type: string
- in: query
name: post_logout_redirect_uri
description: post_logout_redirect_uri
type: string
- in: query
name: state
description: state
type: string
responses:
"200":
description: The Response object
@ -1630,6 +1771,19 @@ paths:
- Login API
description: logout the current user
operationId: ApiController.Logout
parameters:
- in: query
name: id_token_hint
description: id_token_hint
type: string
- in: query
name: post_logout_redirect_uri
description: post_logout_redirect_uri
type: string
- in: query
name: state
description: state
type: string
responses:
"200":
description: The Response object
@ -2139,10 +2293,10 @@ paths:
schema:
$ref: '#/definitions/Response'
definitions:
2200.0xc0003f8480.false:
2268.0xc0000f9650.false:
title: "false"
type: object
2235.0xc0003f84b0.false:
2302.0xc0000f9680.false:
title: "false"
type: object
Response:
@ -2174,6 +2328,12 @@ definitions:
type: string
autoSignin:
type: boolean
captchaToken:
type: string
captchaType:
type: string
clientSecret:
type: string
code:
type: string
email:
@ -2223,9 +2383,9 @@ definitions:
type: object
properties:
data:
$ref: '#/definitions/2200.0xc0003f8480.false'
$ref: '#/definitions/2268.0xc0000f9650.false'
data2:
$ref: '#/definitions/2235.0xc0003f84b0.false'
$ref: '#/definitions/2302.0xc0000f9680.false'
msg:
type: string
name:
@ -2291,8 +2451,12 @@ definitions:
type: string
displayName:
type: string
enableAutoSignin:
type: boolean
enableCodeSignin:
type: boolean
enableLinkWithEmail:
type: boolean
enablePassword:
type: boolean
enableSamlCompress:
@ -2308,6 +2472,15 @@ definitions:
format: int64
forgetUrl:
type: string
formBackgroundUrl:
type: string
formCss:
type: string
formOffset:
type: integer
format: int64
formSideHtml:
type: string
grantTypes:
type: array
items:
@ -2335,6 +2508,8 @@ definitions:
refreshExpireInHours:
type: integer
format: int64
samlReplyUrl:
type: string
signinHtml:
type: string
signinUrl:
@ -2424,6 +2599,18 @@ definitions:
type: string
username:
type: string
object.ManagedAccount:
title: ManagedAccount
type: object
properties:
application:
type: string
password:
type: string
signinUrl:
type: string
username:
type: string
object.Model:
title: Model
type: object
@ -2450,6 +2637,8 @@ definitions:
type: array
items:
type: string
end_session_endpoint:
type: string
grant_types_supported:
type: array
items:
@ -2500,6 +2689,8 @@ definitions:
$ref: '#/definitions/object.AccountItem'
createdTime:
type: string
defaultApplication:
type: string
defaultAvatar:
type: string
displayName:
@ -2508,8 +2699,15 @@ definitions:
type: boolean
favicon:
type: string
initScore:
type: integer
format: int64
isProfilePublic:
type: boolean
languages:
type: array
items:
type: string
masterPassword:
type: string
name:
@ -2595,10 +2793,20 @@ definitions:
type: array
items:
type: string
adapter:
type: string
approveTime:
type: string
approver:
type: string
createdTime:
type: string
displayName:
type: string
domains:
type: array
items:
type: string
effect:
type: string
isEnabled:
@ -2619,6 +2827,10 @@ definitions:
type: array
items:
type: string
state:
type: string
submitter:
type: string
users:
type: array
items:
@ -2631,6 +2843,8 @@ definitions:
type: string
currency:
type: string
description:
type: string
detail:
type: string
displayName:
@ -2644,6 +2858,10 @@ definitions:
price:
type: number
format: double
providerObjs:
type: array
items:
$ref: '#/definitions/object.Provider'
providers:
type: array
items:
@ -2694,6 +2912,8 @@ definitions:
type: string
customUserInfoUrl:
type: string
disableSsl:
type: boolean
displayName:
type: string
domain:
@ -2718,11 +2938,15 @@ definitions:
type: string
owner:
type: string
pathPrefix:
type: string
port:
type: integer
format: int64
providerUrl:
type: string
receiver:
type: string
regionId:
type: string
signName:
@ -2749,10 +2973,14 @@ definitions:
type: boolean
name:
type: string
owner:
type: string
prompted:
type: boolean
provider:
$ref: '#/definitions/object.Provider'
rule:
type: string
object.Record:
title: Record
type: object
@ -2790,6 +3018,10 @@ definitions:
type: string
displayName:
type: string
domains:
type: array
items:
type: string
isEnabled:
type: boolean
name:
@ -2864,6 +3096,9 @@ definitions:
type: string
user:
type: string
object.SystemInfo:
title: SystemInfo
type: object
object.TableColumn:
title: TableColumn
type: object
@ -3040,12 +3275,20 @@ definitions:
type: string
lastSigninTime:
type: string
lastSigninWrongTime:
type: string
ldap:
type: string
line:
type: string
linkedin:
type: string
location:
type: string
managedAccounts:
type: array
items:
$ref: '#/definitions/object.ManagedAccount'
name:
type: string
okta:
@ -3083,6 +3326,9 @@ definitions:
score:
type: integer
format: int64
signinWrongTimes:
type: integer
format: int64
signupApplication:
type: string
slack:
@ -3095,8 +3341,6 @@ definitions:
type: string
type:
type: string
unionId:
type: string
updatedTime:
type: string
webauthnCredentials: