diff --git a/controllers/account.go b/controllers/account.go index 4a1d535c35c7..42c24387e5c0 100644 --- a/controllers/account.go +++ b/controllers/account.go @@ -238,7 +238,7 @@ func (c *ApiController) Signup() { // @Param post_logout_redirect_uri query string false "post_logout_redirect_uri" // @Param state query string false "state" // @Success 200 {object} controllers.Response The Response object -// @router /logout [get,post] +// @router /logout [post] func (c *ApiController) Logout() { // https://openid.net/specs/openid-connect-rpinitiated-1_0-final.html accessToken := c.Input().Get("id_token_hint") @@ -454,6 +454,7 @@ func (c *ApiController) GetUserinfo2() { // @Tag Login API // @Title GetCaptcha // @router /api/get-captcha [get] +// @Success 200 {object} object.Userinfo The Response object func (c *ApiController) GetCaptcha() { applicationId := c.Input().Get("applicationId") isCurrentProvider := c.Input().Get("isCurrentProvider") diff --git a/controllers/auth.go b/controllers/auth.go index df3bb25aeefc..6b7c3b5bea51 100644 --- a/controllers/auth.go +++ b/controllers/auth.go @@ -887,6 +887,7 @@ func (c *ApiController) HandleSamlLogin() { // @Tag HandleOfficialAccountEvent API // @Title HandleOfficialAccountEvent // @router /api/webhook [POST] +// @Success 200 {object} object.Userinfo The Response object func (c *ApiController) HandleOfficialAccountEvent() { respBytes, err := ioutil.ReadAll(c.Ctx.Request.Body) if err != nil { @@ -917,6 +918,7 @@ func (c *ApiController) HandleOfficialAccountEvent() { // @Tag GetWebhookEventType API // @Title GetWebhookEventType // @router /api/get-webhook-event [GET] +// @Success 200 {object} object.Userinfo The Response object func (c *ApiController) GetWebhookEventType() { lock.Lock() defer lock.Unlock() @@ -964,6 +966,7 @@ func (c *ApiController) GetCaptchaStatus() { // @Tag Callback API // @Description Get Login Error Counts // @router /api/Callback [post] +// @Success 200 {object} object.Userinfo The Response object func (c *ApiController) Callback() { code := c.GetString("code") state := c.GetString("state") diff --git a/controllers/enforcer.go b/controllers/enforcer.go index 544374db74c4..542bb1b1f560 100644 --- a/controllers/enforcer.go +++ b/controllers/enforcer.go @@ -71,7 +71,7 @@ func (c *ApiController) GetEnforcers() { // @Tag Enforcer API // @Description get enforcer // @Param id query string true "The id ( owner/name ) of enforcer" -// @Success 200 {object} object +// @Success 200 {object} object.Enforcer // @router /get-enforcer [get] func (c *ApiController) GetEnforcer() { id := c.Input().Get("id") @@ -99,7 +99,7 @@ func (c *ApiController) GetEnforcer() { // @Description update enforcer // @Param id query string true "The id ( owner/name ) of enforcer" // @Param enforcer body object true "The enforcer object" -// @Success 200 {object} object +// @Success 200 {object} object.Enforcer // @router /update-enforcer [post] func (c *ApiController) UpdateEnforcer() { id := c.Input().Get("id") @@ -120,7 +120,7 @@ func (c *ApiController) UpdateEnforcer() { // @Tag Enforcer API // @Description add enforcer // @Param enforcer body object true "The enforcer object" -// @Success 200 {object} object +// @Success 200 {object} object.Enforcer // @router /add-enforcer [post] func (c *ApiController) AddEnforcer() { enforcer := object.Enforcer{} @@ -139,7 +139,7 @@ func (c *ApiController) AddEnforcer() { // @Tag Enforcer API // @Description delete enforcer // @Param body body object.Enforce true "The enforcer object" -// @Success 200 {object} object +// @Success 200 {object} object.Enforcer // @router /delete-enforcer [post] func (c *ApiController) DeleteEnforcer() { var enforcer object.Enforcer diff --git a/controllers/link.go b/controllers/link.go index aa4c81ae55e3..b2ddeee4611d 100644 --- a/controllers/link.go +++ b/controllers/link.go @@ -26,8 +26,10 @@ type LinkForm struct { } // Unlink ... -// @router /unlink [post] // @Tag Login API +// @Title Unlink +// @router /unlink [post] +// @Success 200 {object} object.Userinfo The Response object func (c *ApiController) Unlink() { user, ok := c.RequireSignedInUser() if !ok { diff --git a/controllers/user.go b/controllers/user.go index 1df6d8a3b088..c76c2f29987a 100644 --- a/controllers/user.go +++ b/controllers/user.go @@ -510,6 +510,7 @@ func (c *ApiController) SetPassword() { // @Title CheckUserPassword // @router /check-user-password [post] // @Tag User API +// @Success 200 {object} object.Userinfo The Response object func (c *ApiController) CheckUserPassword() { var user object.User err := json.Unmarshal(c.Ctx.Input.RequestBody, &user) @@ -580,6 +581,7 @@ func (c *ApiController) GetUserCount() { // @Title AddUserKeys // @router /add-user-keys [post] // @Tag User API +// @Success 200 {object} object.Userinfo The Response object func (c *ApiController) AddUserKeys() { var user object.User err := json.Unmarshal(c.Ctx.Input.RequestBody, &user) diff --git a/controllers/verification.go b/controllers/verification.go index 8498a88750ff..bbef208a72b7 100644 --- a/controllers/verification.go +++ b/controllers/verification.go @@ -39,6 +39,7 @@ const ( // @Title SendVerificationCode // @Tag Verification API // @router /send-verification-code [post] +// @Success 200 {object} object.Userinfo The Response object func (c *ApiController) SendVerificationCode() { var vform form.VerificationForm err := c.ParseForm(&vform) @@ -229,6 +230,7 @@ func (c *ApiController) SendVerificationCode() { // @Title VerifyCaptcha // @Tag Verification API // @router /verify-captcha [post] +// @Success 200 {object} object.Userinfo The Response object func (c *ApiController) VerifyCaptcha() { var vform form.VerificationForm err := c.ParseForm(&vform) @@ -271,6 +273,7 @@ func (c *ApiController) VerifyCaptcha() { // @Tag Account API // @Title ResetEmailOrPhone // @router /api/reset-email-or-phone [post] +// @Success 200 {object} object.Userinfo The Response object func (c *ApiController) ResetEmailOrPhone() { user, ok := c.RequireSignedInUser() if !ok { @@ -365,6 +368,7 @@ func (c *ApiController) ResetEmailOrPhone() { // @Tag Verification API // @Title VerifyCode // @router /api/verify-code [post] +// @Success 200 {object} object.Userinfo The Response object func (c *ApiController) VerifyCode() { var authForm form.AuthForm err := json.Unmarshal(c.Ctx.Input.RequestBody, &authForm) diff --git a/controllers/webauthn.go b/controllers/webauthn.go index 52de20139052..e421a5c46fc3 100644 --- a/controllers/webauthn.go +++ b/controllers/webauthn.go @@ -146,7 +146,7 @@ func (c *ApiController) WebAuthnSigninBegin() { } // WebAuthnSigninFinish -// @Title WebAuthnSigninBegin +// @Title WebAuthnSigninFinish // @Tag Login API // @Description WebAuthn Login Flow 2nd stage // @Param body body protocol.CredentialAssertionResponse true "authenticator assertion Response" diff --git a/swagger/swagger.json b/swagger/swagger.json index df14350c13a4..c028b23d574f 100644 --- a/swagger/swagger.json +++ b/swagger/swagger.json @@ -153,7 +153,7 @@ "200": { "description": "", "schema": { - "$ref": "#/definitions/object" + "$ref": "#/definitions/object.Enforcer" } } } @@ -439,34 +439,6 @@ } } }, - "/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": [ @@ -675,7 +647,15 @@ "tags": [ "User API" ], - "operationId": "ApiController.AddUserkeys" + "operationId": "ApiController.AddUserKeys", + "responses": { + "200": { + "description": "The Response object", + "schema": { + "$ref": "#/definitions/object.Userinfo" + } + } + } } }, "/api/add-webhook": { @@ -706,12 +686,37 @@ } } }, + "/api/api/Callback": { + "post": { + "tags": [ + "Callback API" + ], + "description": "Get Login Error Counts", + "operationId": "ApiController.Callback", + "responses": { + "200": { + "description": "The Response object", + "schema": { + "$ref": "#/definitions/object.Userinfo" + } + } + } + } + }, "/api/api/get-captcha": { "get": { "tags": [ "Login API" ], - "operationId": "ApiController.GetCaptcha" + "operationId": "ApiController.GetCaptcha", + "responses": { + "200": { + "description": "The Response object", + "schema": { + "$ref": "#/definitions/object.Userinfo" + } + } + } } }, "/api/api/get-captcha-status": { @@ -745,7 +750,15 @@ "tags": [ "GetWebhookEventType API" ], - "operationId": "ApiController.GetWebhookEventType" + "operationId": "ApiController.GetWebhookEventType", + "responses": { + "200": { + "description": "The Response object", + "schema": { + "$ref": "#/definitions/object.Userinfo" + } + } + } } }, "/api/api/reset-email-or-phone": { @@ -753,7 +766,15 @@ "tags": [ "Account API" ], - "operationId": "ApiController.ResetEmailOrPhone" + "operationId": "ApiController.ResetEmailOrPhone", + "responses": { + "200": { + "description": "The Response object", + "schema": { + "$ref": "#/definitions/object.Userinfo" + } + } + } } }, "/api/api/send-email": { @@ -798,6 +819,34 @@ } } }, + "/api/api/send-notification": { + "post": { + "tags": [ + "Service API" + ], + "description": "This API is not for Casdoor frontend to call, it is for Casdoor SDKs.", + "operationId": "ApiController.SendNotification", + "parameters": [ + { + "in": "body", + "name": "from", + "description": "Details of the notification request", + "required": true, + "schema": { + "$ref": "#/definitions/controllers.NotificationForm" + } + } + ], + "responses": { + "200": { + "description": "object", + "schema": { + "$ref": "#/definitions/Response" + } + } + } + } + }, "/api/api/send-sms": { "post": { "tags": [ @@ -845,7 +894,15 @@ "tags": [ "Verification API" ], - "operationId": "ApiController.VerifyCode" + "operationId": "ApiController.VerifyCode", + "responses": { + "200": { + "description": "The Response object", + "schema": { + "$ref": "#/definitions/object.Userinfo" + } + } + } } }, "/api/api/webhook": { @@ -853,7 +910,15 @@ "tags": [ "HandleOfficialAccountEvent API" ], - "operationId": "ApiController.HandleOfficialAccountEvent" + "operationId": "ApiController.HandleOfficialAccountEvent", + "responses": { + "200": { + "description": "The Response object", + "schema": { + "$ref": "#/definitions/object.Userinfo" + } + } + } } }, "/api/batch-enforce": { @@ -934,7 +999,15 @@ "tags": [ "User API" ], - "operationId": "ApiController.CheckUserPassword" + "operationId": "ApiController.CheckUserPassword", + "responses": { + "200": { + "description": "The Response object", + "schema": { + "$ref": "#/definitions/object.Userinfo" + } + } + } } }, "/api/delete-adapter": { @@ -1043,7 +1116,7 @@ "200": { "description": "", "schema": { - "$ref": "#/definitions/object" + "$ref": "#/definitions/object.Enforcer" } } } @@ -1948,7 +2021,7 @@ "200": { "description": "", "schema": { - "$ref": "#/definitions/object" + "$ref": "#/definitions/object.Enforcer" } } } @@ -1983,60 +2056,60 @@ } } }, - "/api/get-global-providers": { + "/api/get-global-certs": { "get": { "tags": [ - "Provider API" + "Cert API" ], - "description": "get Global providers", - "operationId": "ApiController.GetGlobalProviders", + "description": "get globle certs", + "operationId": "ApiController.GetGlobalCerts", "responses": { "200": { "description": "The Response object", "schema": { "type": "array", "items": { - "$ref": "#/definitions/object.Provider" + "$ref": "#/definitions/object.Cert" } } } } } }, - "/api/get-global-users": { + "/api/get-global-providers": { "get": { "tags": [ - "User API" + "Provider API" ], - "description": "get global users", - "operationId": "ApiController.GetGlobalUsers", + "description": "get Global providers", + "operationId": "ApiController.GetGlobalProviders", "responses": { "200": { "description": "The Response object", "schema": { "type": "array", "items": { - "$ref": "#/definitions/object.User" + "$ref": "#/definitions/object.Provider" } } } } } }, - "/api/get-global-certs": { + "/api/get-global-users": { "get": { "tags": [ - "Cert API" + "User API" ], - "description": "get globle certs", - "operationId": "ApiController.GetGlobalCerts", + "description": "get global users", + "operationId": "ApiController.GetGlobalUsers", "responses": { "200": { "description": "The Response object", "schema": { "type": "array", "items": { - "$ref": "#/definitions/object.Cert" + "$ref": "#/definitions/object.User" } } } @@ -2739,68 +2812,6 @@ } } }, - "/api/get-records": { - "get": { - "tags": [ - "Record API" - ], - "description": "get all records", - "operationId": "ApiController.GetRecords", - "parameters": [ - { - "in": "query", - "name": "pageSize", - "description": "The size of each page", - "required": true, - "type": "string" - }, - { - "in": "query", - "name": "p", - "description": "The number of the page", - "required": true, - "type": "string" - } - ], - "responses": { - "200": { - "description": "The Response object", - "schema": { - "$ref": "#/definitions/object.Record" - } - } - } - } - }, - "/api/get-records-filter": { - "post": { - "tags": [ - "Record API" - ], - "description": "get records by filter", - "operationId": "ApiController.GetRecordsByFilter", - "parameters": [ - { - "in": "body", - "name": "filter", - "description": "filter Record message", - "required": true, - "schema": { - "type": "string" - }, - "type": "string" - } - ], - "responses": { - "200": { - "description": "The Response object", - "schema": { - "$ref": "#/definitions/object.Record" - } - } - } - } - }, "/api/get-resource": { "get": { "tags": [ @@ -3662,65 +3673,6 @@ } } }, - "/api/login/oauth/access_token": { - "post": { - "tags": [ - "Token API" - ], - "description": "get OAuth access token", - "operationId": "ApiController.GetOAuthToken", - "parameters": [ - { - "in": "query", - "name": "grant_type", - "description": "OAuth grant type", - "required": true, - "type": "string" - }, - { - "in": "query", - "name": "client_id", - "description": "OAuth client id", - "required": true, - "type": "string" - }, - { - "in": "query", - "name": "client_secret", - "description": "OAuth client secret", - "required": true, - "type": "string" - }, - { - "in": "query", - "name": "code", - "description": "OAuth code", - "required": true, - "type": "string" - } - ], - "responses": { - "200": { - "description": "The Response object", - "schema": { - "$ref": "#/definitions/object.TokenWrapper" - } - }, - "400": { - "description": "The Response object", - "schema": { - "$ref": "#/definitions/object.TokenError" - } - }, - "401": { - "description": "The Response object", - "schema": { - "$ref": "#/definitions/object.TokenError" - } - } - } - } - }, "/api/login/oauth/introspect": { "post": { "description": "The introspection endpoint is an OAuth 2.0 endpoint that takes a", @@ -3829,41 +3781,6 @@ } }, "/api/logout": { - "get": { - "tags": [ - "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", - "schema": { - "$ref": "#/definitions/controllers.Response" - } - } - } - }, "post": { "tags": [ "Login API" @@ -4012,7 +3929,15 @@ "tags": [ "Verification API" ], - "operationId": "ApiController.SendVerificationCode" + "operationId": "ApiController.SendVerificationCode", + "responses": { + "200": { + "description": "The Response object", + "schema": { + "$ref": "#/definitions/object.Userinfo" + } + } + } } }, "/api/set-password": { @@ -4142,7 +4067,16 @@ "post": { "tags": [ "Login API" - ] + ], + "operationId": "ApiController.Unlink", + "responses": { + "200": { + "description": "The Response object", + "schema": { + "$ref": "#/definitions/object.Userinfo" + } + } + } } }, "/api/update-adapter": { @@ -4279,7 +4213,7 @@ "200": { "description": "", "schema": { - "$ref": "#/definitions/object" + "$ref": "#/definitions/object.Enforcer" } } } @@ -5019,7 +4953,15 @@ "tags": [ "Verification API" ], - "operationId": "ApiController.VerifyCaptcha" + "operationId": "ApiController.VerifyCaptcha", + "responses": { + "200": { + "description": "The Response object", + "schema": { + "$ref": "#/definitions/object.Userinfo" + } + } + } } }, "/api/webauthn/signin/begin": { @@ -5061,7 +5003,7 @@ "Login API" ], "description": "WebAuthn Login Flow 2nd stage", - "operationId": "ApiController.WebAuthnSigninBegin", + "operationId": "ApiController.WebAuthnSigninFinish", "parameters": [ { "in": "body", @@ -5127,17 +5069,68 @@ } } } + }, + "/apiapi/login/oauth/access_token": { + "post": { + "tags": [ + "Token API" + ], + "description": "get OAuth access token", + "operationId": "ApiController.GetOAuthToken", + "parameters": [ + { + "in": "query", + "name": "grant_type", + "description": "OAuth grant type", + "required": true, + "type": "string" + }, + { + "in": "query", + "name": "client_id", + "description": "OAuth client id", + "required": true, + "type": "string" + }, + { + "in": "query", + "name": "client_secret", + "description": "OAuth client secret", + "required": true, + "type": "string" + }, + { + "in": "query", + "name": "code", + "description": "OAuth code", + "required": true, + "type": "string" + } + ], + "responses": { + "200": { + "description": "The Response object", + "schema": { + "$ref": "#/definitions/object.TokenWrapper" + } + }, + "400": { + "description": "The Response object", + "schema": { + "$ref": "#/definitions/object.TokenError" + } + }, + "401": { + "description": "The Response object", + "schema": { + "$ref": "#/definitions/object.TokenError" + } + } + } + } } }, "definitions": { - "1183.0xc000639290.false": { - "title": "false", - "type": "object" - }, - "1217.0xc0006392c0.false": { - "title": "false", - "type": "object" - }, "LaravelResponse": { "title": "LaravelResponse", "type": "object" @@ -5186,15 +5179,30 @@ } } }, + "controllers.NotificationForm": { + "title": "NotificationForm", + "type": "object", + "properties": { + "content": { + "type": "string" + } + } + }, "controllers.Response": { "title": "Response", "type": "object", "properties": { "data": { - "$ref": "#/definitions/1183.0xc000639290.false" + "additionalProperties": { + "description": "support string, struct or []struct", + "type": "string" + } }, "data2": { - "$ref": "#/definitions/1217.0xc0006392c0.false" + "additionalProperties": { + "description": "support string, struct or []struct", + "type": "string" + } }, "msg": { "type": "string" @@ -5240,10 +5248,6 @@ "title": "object", "type": "object" }, - "object.\u0026{197049 0xc000a2cd50 false}": { - "title": "\u0026{197049 0xc000a2cd50 false}", - "type": "object" - }, "object.AccountItem": { "title": "AccountItem", "type": "object", @@ -5294,12 +5298,12 @@ "table": { "type": "string" }, - "tableNamePrefix": { - "type": "string" - }, "type": { "type": "string" }, + "useSameDb": { + "type": "boolean" + }, "user": { "type": "string" } @@ -5315,6 +5319,9 @@ "cert": { "type": "string" }, + "certPublicKey": { + "type": "string" + }, "clientId": { "type": "string" }, @@ -5342,6 +5349,9 @@ "enablePassword": { "type": "boolean" }, + "enableSamlC14n10": { + "type": "boolean" + }, "enableSamlCompress": { "type": "boolean" }, @@ -5386,6 +5396,12 @@ "homepageUrl": { "type": "string" }, + "invitationCodes": { + "type": "array", + "items": { + "type": "string" + } + }, "logo": { "type": "string" }, @@ -5420,6 +5436,12 @@ "type": "integer", "format": "int64" }, + "samlAttributes": { + "type": "array", + "items": { + "$ref": "#/definitions/object.SamlItem" + } + }, "samlReplyUrl": { "type": "string" }, @@ -5462,19 +5484,12 @@ "title": "CasbinRequest", "type": "array", "items": { - "$ref": "#/definitions/object.\u0026{197049 0xc000a2cd50 false}" } }, "object.Cert": { "title": "Cert", "type": "object", "properties": { - "authorityPublicKey": { - "type": "string" - }, - "authorityRootPublicKey": { - "type": "string" - }, "bitSize": { "type": "integer", "format": "int64" @@ -5943,6 +5958,9 @@ "defaultAvatar": { "type": "string" }, + "defaultPassword": { + "type": "string" + }, "displayName": { "type": "string" }, @@ -5968,6 +5986,9 @@ "masterPassword": { "type": "string" }, + "masterVerificationCode": { + "type": "string" + }, "mfaItems": { "type": "array", "items": { @@ -6101,6 +6122,9 @@ "state": { "$ref": "#/definitions/pp.PaymentState" }, + "successUrl": { + "type": "string" + }, "tag": { "type": "string" }, @@ -6149,6 +6173,12 @@ "effect": { "type": "string" }, + "groups": { + "type": "array", + "items": { + "type": "string" + } + }, "isEnabled": { "type": "boolean" }, @@ -6221,14 +6251,22 @@ "owner": { "type": "string" }, - "pricePerMonth": { - "type": "number", - "format": "double" + "paymentProviders": { + "type": "array", + "items": { + "type": "string" + } + }, + "period": { + "type": "string" }, - "pricePerYear": { + "price": { "type": "number", "format": "double" }, + "product": { + "type": "string" + }, "role": { "type": "string" } @@ -6241,12 +6279,6 @@ "application": { "type": "string" }, - "approveTime": { - "type": "string" - }, - "approver": { - "type": "string" - }, "createdTime": { "type": "string" }, @@ -6271,12 +6303,6 @@ "type": "string" } }, - "state": { - "type": "string" - }, - "submitter": { - "type": "string" - }, "trialDuration": { "type": "integer", "format": "int64" @@ -6498,9 +6524,6 @@ "title": "ProviderItem", "type": "object", "properties": { - "alertType": { - "type": "string" - }, "canSignIn": { "type": "boolean" }, @@ -6524,51 +6547,8 @@ }, "rule": { "type": "string" - } - } - }, - "object.Record": { - "title": "Record", - "type": "object", - "properties": { - "action": { - "type": "string" - }, - "clientIp": { - "type": "string" - }, - "createdTime": { - "type": "string" - }, - "extendedUser": { - "$ref": "#/definitions/object.User" - }, - "id": { - "type": "integer", - "format": "int64" - }, - "isTriggered": { - "type": "boolean" - }, - "method": { - "type": "string" }, - "name": { - "type": "string" - }, - "object": { - "type": "string" - }, - "organization": { - "type": "string" - }, - "owner": { - "type": "string" - }, - "requestUri": { - "type": "string" - }, - "user": { + "signupGroup": { "type": "string" } } @@ -6641,6 +6621,12 @@ "type": "string" } }, + "groups": { + "type": "array", + "items": { + "type": "string" + } + }, "isEnabled": { "type": "boolean" }, @@ -6664,13 +6650,34 @@ } } }, + "object.SamlItem": { + "title": "SamlItem", + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "nameformat": { + "type": "string" + }, + "value": { + "type": "string" + } + } + }, "object.SignupItem": { "title": "SignupItem", "type": "object", "properties": { + "label": { + "type": "string" + }, "name": { "type": "string" }, + "placeholder": { + "type": "string" + }, "prompted": { "type": "boolean" }, @@ -6689,12 +6696,6 @@ "title": "Subscription", "type": "object", "properties": { - "approveTime": { - "type": "string" - }, - "approver": { - "type": "string" - }, "createdTime": { "type": "string" }, @@ -6704,41 +6705,53 @@ "displayName": { "type": "string" }, - "duration": { - "type": "integer", - "format": "int64" - }, - "endDate": { + "endTime": { "type": "string", "format": "datetime" }, - "isEnabled": { - "type": "boolean" - }, "name": { "type": "string" }, "owner": { "type": "string" }, + "payment": { + "type": "string" + }, + "period": { + "type": "string" + }, "plan": { "type": "string" }, - "startDate": { + "pricing": { + "type": "string" + }, + "startTime": { "type": "string", "format": "datetime" }, "state": { - "type": "string" - }, - "submitter": { - "type": "string" + "$ref": "#/definitions/object.SubscriptionState" }, "user": { "type": "string" } } }, + "object.SubscriptionState": { + "title": "SubscriptionState", + "type": "string", + "enum": [ + "SubStatePending = \"Pending\"", + "SubStateError = \"Error\"", + "SubStateSuspended = \"Suspended\"", + "SubStateActive = \"Active\"", + "SubStateUpcoming = \"Upcoming\"", + "SubStateExpired = \"Expired\"" + ], + "example": "Pending" + }, "object.Syncer": { "title": "Syncer", "type": "object", @@ -6786,6 +6799,9 @@ "type": "integer", "format": "int64" }, + "sslMode": { + "type": "string" + }, "syncInterval": { "type": "integer", "format": "int64" @@ -6863,6 +6879,9 @@ "accessToken": { "type": "string" }, + "accessTokenHash": { + "type": "string" + }, "application": { "type": "string" }, @@ -6898,6 +6917,9 @@ "refreshToken": { "type": "string" }, + "refreshTokenHash": { + "type": "string" + }, "scope": { "type": "string" }, @@ -6989,6 +7011,9 @@ "azuread": { "type": "string" }, + "azureadb2c": { + "type": "string" + }, "baidu": { "type": "string" }, @@ -7064,6 +7089,9 @@ "eveonline": { "type": "string" }, + "externalId": { + "type": "string" + }, "facebook": { "type": "string" }, @@ -7415,6 +7443,9 @@ "email": { "type": "string" }, + "email_verified": { + "type": "boolean" + }, "groups": { "type": "array", "items": { diff --git a/swagger/swagger.yml b/swagger/swagger.yml index 628d992087cc..b1a019d35c1f 100644 --- a/swagger/swagger.yml +++ b/swagger/swagger.yml @@ -102,7 +102,7 @@ paths: "200": description: "" schema: - $ref: '#/definitions/object' + $ref: '#/definitions/object.Enforcer' /api/add-group: post: tags: @@ -283,24 +283,6 @@ 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: @@ -436,7 +418,12 @@ paths: post: tags: - User API - operationId: ApiController.AddUserkeys + operationId: ApiController.AddUserKeys + responses: + "200": + description: The Response object + schema: + $ref: '#/definitions/object.Userinfo' /api/add-webhook: post: tags: @@ -455,11 +442,27 @@ paths: description: The Response object schema: $ref: '#/definitions/controllers.Response' + /api/api/Callback: + post: + tags: + - Callback API + description: Get Login Error Counts + operationId: ApiController.Callback + responses: + "200": + description: The Response object + schema: + $ref: '#/definitions/object.Userinfo' /api/api/get-captcha: get: tags: - Login API operationId: ApiController.GetCaptcha + responses: + "200": + description: The Response object + schema: + $ref: '#/definitions/object.Userinfo' /api/api/get-captcha-status: get: tags: @@ -482,11 +485,21 @@ paths: tags: - GetWebhookEventType API operationId: ApiController.GetWebhookEventType + responses: + "200": + description: The Response object + schema: + $ref: '#/definitions/object.Userinfo' /api/api/reset-email-or-phone: post: tags: - Account API operationId: ApiController.ResetEmailOrPhone + responses: + "200": + description: The Response object + schema: + $ref: '#/definitions/object.Userinfo' /api/api/send-email: post: tags: @@ -515,6 +528,24 @@ paths: description: object schema: $ref: '#/definitions/Response' + /api/api/send-notification: + post: + tags: + - Service API + description: This API is not for Casdoor frontend to call, it is for Casdoor SDKs. + operationId: ApiController.SendNotification + parameters: + - in: body + name: from + description: Details of the notification request + required: true + schema: + $ref: '#/definitions/controllers.NotificationForm' + responses: + "200": + description: object + schema: + $ref: '#/definitions/Response' /api/api/send-sms: post: tags: @@ -548,11 +579,21 @@ paths: tags: - Verification API operationId: ApiController.VerifyCode + responses: + "200": + description: The Response object + schema: + $ref: '#/definitions/object.Userinfo' /api/api/webhook: post: tags: - HandleOfficialAccountEvent API operationId: ApiController.HandleOfficialAccountEvent + responses: + "200": + description: The Response object + schema: + $ref: '#/definitions/object.Userinfo' /api/batch-enforce: post: tags: @@ -606,6 +647,11 @@ paths: tags: - User API operationId: ApiController.CheckUserPassword + responses: + "200": + description: The Response object + schema: + $ref: '#/definitions/object.Userinfo' /api/delete-adapter: post: tags: @@ -677,7 +723,7 @@ paths: "200": description: "" schema: - $ref: '#/definitions/object' + $ref: '#/definitions/object.Enforcer' /api/delete-group: post: tags: @@ -1265,7 +1311,7 @@ paths: "200": description: "" schema: - $ref: '#/definitions/object' + $ref: '#/definitions/object.Enforcer' /api/get-enforcers: get: tags: @@ -1285,6 +1331,19 @@ paths: type: array items: $ref: '#/definitions/object.Enforcer' + /api/get-global-certs: + get: + tags: + - Cert API + description: get globle certs + operationId: ApiController.GetGlobalCerts + responses: + "200": + description: The Response object + schema: + type: array + items: + $ref: '#/definitions/object.Cert' /api/get-global-providers: get: tags: @@ -1311,19 +1370,6 @@ paths: type: array items: $ref: '#/definitions/object.User' - /api/get-global-certs: - get: - tags: - - Cert API - description: get globle certs - operationId: ApiController.GetGlobalCerts - responses: - "200": - description: The Response object - schema: - type: array - items: - $ref: '#/definitions/object.Cert' /api/get-group: get: tags: @@ -1779,47 +1825,6 @@ paths: type: array items: $ref: '#/definitions/object.Provider' - /api/get-records: - get: - tags: - - Record API - description: get all records - operationId: ApiController.GetRecords - parameters: - - in: query - name: pageSize - description: The size of each page - required: true - type: string - - in: query - name: p - description: The number of the page - required: true - type: string - responses: - "200": - description: The Response object - schema: - $ref: '#/definitions/object.Record' - /api/get-records-filter: - post: - tags: - - Record API - description: get records by filter - operationId: ApiController.GetRecordsByFilter - parameters: - - in: body - name: filter - description: filter Record message - required: true - schema: - type: string - type: string - responses: - "200": - description: The Response object - schema: - $ref: '#/definitions/object.Record' /api/get-resource: get: tags: @@ -2387,46 +2392,6 @@ paths: description: The Response object schema: $ref: '#/definitions/controllers.Response' - /api/login/oauth/access_token: - post: - tags: - - Token API - description: get OAuth access token - operationId: ApiController.GetOAuthToken - parameters: - - in: query - name: grant_type - description: OAuth grant type - required: true - type: string - - in: query - name: client_id - description: OAuth client id - required: true - type: string - - in: query - name: client_secret - description: OAuth client secret - required: true - type: string - - in: query - name: code - description: OAuth code - required: true - type: string - responses: - "200": - description: The Response object - schema: - $ref: '#/definitions/object.TokenWrapper' - "400": - description: The Response object - schema: - $ref: '#/definitions/object.TokenError' - "401": - description: The Response object - schema: - $ref: '#/definitions/object.TokenError' /api/login/oauth/introspect: post: description: The introspection endpoint is an OAuth 2.0 endpoint that takes a @@ -2500,29 +2465,6 @@ paths: schema: $ref: '#/definitions/object.TokenError' /api/logout: - get: - tags: - - 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 - schema: - $ref: '#/definitions/controllers.Response' post: tags: - Login API @@ -2620,6 +2562,11 @@ paths: tags: - Verification API operationId: ApiController.SendVerificationCode + responses: + "200": + description: The Response object + schema: + $ref: '#/definitions/object.Userinfo' /api/set-password: post: tags: @@ -2706,6 +2653,12 @@ paths: post: tags: - Login API + operationId: ApiController.Unlink + responses: + "200": + description: The Response object + schema: + $ref: '#/definitions/object.Userinfo' /api/update-adapter: post: tags: @@ -2797,7 +2750,7 @@ paths: "200": description: "" schema: - $ref: '#/definitions/object' + $ref: '#/definitions/object.Enforcer' /api/update-group: post: tags: @@ -3283,6 +3236,11 @@ paths: tags: - Verification API operationId: ApiController.VerifyCaptcha + responses: + "200": + description: The Response object + schema: + $ref: '#/definitions/object.Userinfo' /api/webauthn/signin/begin: get: tags: @@ -3310,7 +3268,7 @@ paths: tags: - Login API description: WebAuthn Login Flow 2nd stage - operationId: ApiController.WebAuthnSigninBegin + operationId: ApiController.WebAuthnSigninFinish parameters: - in: body name: body @@ -3352,13 +3310,47 @@ paths: description: '"The Response object"' schema: $ref: '#/definitions/controllers.Response' + /apiapi/login/oauth/access_token: + post: + tags: + - Token API + description: get OAuth access token + operationId: ApiController.GetOAuthToken + parameters: + - in: query + name: grant_type + description: OAuth grant type + required: true + type: string + - in: query + name: client_id + description: OAuth client id + required: true + type: string + - in: query + name: client_secret + description: OAuth client secret + required: true + type: string + - in: query + name: code + description: OAuth code + required: true + type: string + responses: + "200": + description: The Response object + schema: + $ref: '#/definitions/object.TokenWrapper' + "400": + description: The Response object + schema: + $ref: '#/definitions/object.TokenError' + "401": + description: The Response object + schema: + $ref: '#/definitions/object.TokenError' definitions: - 1183.0xc000639290.false: - title: "false" - type: object - 1217.0xc0006392c0.false: - title: "false" - type: object LaravelResponse: title: LaravelResponse type: object @@ -3393,14 +3385,24 @@ definitions: type: string title: type: string + controllers.NotificationForm: + title: NotificationForm + type: object + properties: + content: + type: string controllers.Response: title: Response type: object properties: data: - $ref: '#/definitions/1183.0xc000639290.false' + additionalProperties: + description: support string, struct or []struct + type: string data2: - $ref: '#/definitions/1217.0xc0006392c0.false' + additionalProperties: + description: support string, struct or []struct + type: string msg: type: string name: @@ -3430,9 +3432,6 @@ definitions: object: title: object type: object - object.&{197049 0xc000a2cd50 false}: - title: '&{197049 0xc000a2cd50 false}' - type: object object.AccountItem: title: AccountItem type: object @@ -3468,10 +3467,10 @@ definitions: format: int64 table: type: string - tableNamePrefix: - type: string type: type: string + useSameDb: + type: boolean user: type: string object.Application: @@ -3482,6 +3481,8 @@ definitions: type: string cert: type: string + certPublicKey: + type: string clientId: type: string clientSecret: @@ -3500,6 +3501,8 @@ definitions: type: boolean enablePassword: type: boolean + enableSamlC14n10: + type: boolean enableSamlCompress: type: boolean enableSignUp: @@ -3530,6 +3533,10 @@ definitions: type: string homepageUrl: type: string + invitationCodes: + type: array + items: + type: string logo: type: string name: @@ -3553,6 +3560,10 @@ definitions: refreshExpireInHours: type: integer format: int64 + samlAttributes: + type: array + items: + $ref: '#/definitions/object.SamlItem' samlReplyUrl: type: string signinHtml: @@ -3581,15 +3592,11 @@ definitions: title: CasbinRequest type: array items: - $ref: '#/definitions/object.&{197049 0xc000a2cd50 false}' + $ref: '#/definitions/object.CasbinRequest' object.Cert: title: Cert type: object properties: - authorityPublicKey: - type: string - authorityRootPublicKey: - type: string bitSize: type: integer format: int64 @@ -3905,6 +3912,8 @@ definitions: type: string defaultAvatar: type: string + defaultPassword: + type: string displayName: type: string enableSoftDeletion: @@ -3922,6 +3931,8 @@ definitions: type: string masterPassword: type: string + masterVerificationCode: + type: string mfaItems: type: array items: @@ -4011,6 +4022,8 @@ definitions: type: string state: $ref: '#/definitions/pp.PaymentState' + successUrl: + type: string tag: type: string type: @@ -4043,6 +4056,10 @@ definitions: type: string effect: type: string + groups: + type: array + items: + type: string isEnabled: type: boolean model: @@ -4091,12 +4108,17 @@ definitions: type: string owner: type: string - pricePerMonth: - type: number - format: double - pricePerYear: + paymentProviders: + type: array + items: + type: string + period: + type: string + price: type: number format: double + product: + type: string role: type: string object.Pricing: @@ -4105,10 +4127,6 @@ definitions: properties: application: type: string - approveTime: - type: string - approver: - type: string createdTime: type: string description: @@ -4125,10 +4143,6 @@ definitions: type: array items: type: string - state: - type: string - submitter: - type: string trialDuration: type: integer format: int64 @@ -4278,8 +4292,6 @@ definitions: title: ProviderItem type: object properties: - alertType: - type: string canSignIn: type: boolean canSignUp: @@ -4296,36 +4308,7 @@ definitions: $ref: '#/definitions/object.Provider' rule: type: string - object.Record: - title: Record - type: object - properties: - action: - type: string - clientIp: - type: string - createdTime: - type: string - extendedUser: - $ref: '#/definitions/object.User' - id: - type: integer - format: int64 - isTriggered: - type: boolean - method: - type: string - name: - type: string - object: - type: string - organization: - type: string - owner: - type: string - requestUri: - type: string - user: + signupGroup: type: string object.Resource: title: Resource @@ -4374,6 +4357,10 @@ definitions: type: array items: type: string + groups: + type: array + items: + type: string isEnabled: type: boolean name: @@ -4388,12 +4375,26 @@ definitions: type: array items: type: string + object.SamlItem: + title: SamlItem + type: object + properties: + name: + type: string + nameformat: + type: string + value: + type: string object.SignupItem: title: SignupItem type: object properties: + label: + type: string name: type: string + placeholder: + type: string prompted: type: boolean required: @@ -4406,39 +4407,45 @@ definitions: title: Subscription type: object properties: - approveTime: - type: string - approver: - type: string createdTime: type: string description: type: string displayName: type: string - duration: - type: integer - format: int64 - endDate: + endTime: type: string format: datetime - isEnabled: - type: boolean name: type: string owner: type: string + payment: + type: string + period: + type: string plan: type: string - startDate: + pricing: + type: string + startTime: type: string format: datetime state: - type: string - submitter: - type: string + $ref: '#/definitions/object.SubscriptionState' user: type: string + object.SubscriptionState: + title: SubscriptionState + type: string + enum: + - SubStatePending = "Pending" + - SubStateError = "Error" + - SubStateSuspended = "Suspended" + - SubStateActive = "Active" + - SubStateUpcoming = "Upcoming" + - SubStateExpired = "Expired" + example: Pending object.Syncer: title: Syncer type: object @@ -4472,6 +4479,8 @@ definitions: port: type: integer format: int64 + sslMode: + type: string syncInterval: type: integer format: int64 @@ -4524,6 +4533,8 @@ definitions: properties: accessToken: type: string + accessTokenHash: + type: string application: type: string code: @@ -4548,6 +4559,8 @@ definitions: type: string refreshToken: type: string + refreshTokenHash: + type: string scope: type: string tokenType: @@ -4609,6 +4622,8 @@ definitions: type: string azuread: type: string + azureadb2c: + type: string baidu: type: string battlenet: @@ -4659,6 +4674,8 @@ definitions: type: boolean eveonline: type: string + externalId: + type: string facebook: type: string firstName: @@ -4894,6 +4911,8 @@ definitions: type: string email: type: string + email_verified: + type: boolean groups: type: array items: