diff --git a/.codacy.yaml b/.codacy.yaml new file mode 100644 index 00000000000..efae7d4f515 --- /dev/null +++ b/.codacy.yaml @@ -0,0 +1,3 @@ +--- +exclude_paths: + - "chaoscenter/web/src/api/auth/**" diff --git a/chaoscenter/authentication/api/docs/docs.go b/chaoscenter/authentication/api/docs/docs.go index 0eae1f5c439..72808deae4f 100644 --- a/chaoscenter/authentication/api/docs/docs.go +++ b/chaoscenter/authentication/api/docs/docs.go @@ -56,6 +56,35 @@ const docTemplate = `{ } } }, + "/capabilities": { + "get": { + "description": "Returns capabilities that can be leveraged by frontend services to toggle certain features.", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "CapabilitiesRouter" + ], + "summary": "Get capabilities of Auth Server.", + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/response.CapabilitiesResponse" + } + }, + "500": { + "description": "Internal Server Error", + "schema": { + "$ref": "#/definitions/response.ErrServerError" + } + } + } + } + }, "/create_project": { "post": { "description": "Create a new project.", @@ -1085,6 +1114,19 @@ const docTemplate = `{ } } }, + "response.CapabilitiesResponse": { + "type": "object", + "properties": { + "dex": { + "type": "object", + "properties": { + "enabled": { + "type": "boolean" + } + } + } + } + }, "response.ErrInvalidCredentials": { "type": "object", "properties": { @@ -1159,7 +1201,7 @@ const docTemplate = `{ }, "message": { "type": "string", - "example": "The authorization server encountered an unexpected condition that prevented it from fulfi" + "example": "The authorization server encountered an unexpected condition that prevented it from fulfilling the request" } } }, diff --git a/chaoscenter/authentication/api/docs/swagger.json b/chaoscenter/authentication/api/docs/swagger.json index dfc9e26d63c..a18297f0916 100644 --- a/chaoscenter/authentication/api/docs/swagger.json +++ b/chaoscenter/authentication/api/docs/swagger.json @@ -46,6 +46,35 @@ } } }, + "/capabilities": { + "get": { + "description": "Returns capabilities that can be leveraged by frontend services to toggle certain features.", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "CapabilitiesRouter" + ], + "summary": "Get capabilities of Auth Server.", + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/response.CapabilitiesResponse" + } + }, + "500": { + "description": "Internal Server Error", + "schema": { + "$ref": "#/definitions/response.ErrServerError" + } + } + } + } + }, "/create_project": { "post": { "description": "Create a new project.", @@ -1075,6 +1104,19 @@ } } }, + "response.CapabilitiesResponse": { + "type": "object", + "properties": { + "dex": { + "type": "object", + "properties": { + "enabled": { + "type": "boolean" + } + } + } + } + }, "response.ErrInvalidCredentials": { "type": "object", "properties": { @@ -1149,7 +1191,7 @@ }, "message": { "type": "string", - "example": "The authorization server encountered an unexpected condition that prevented it from fulfi" + "example": "The authorization server encountered an unexpected condition that prevented it from fulfilling the request" } } }, diff --git a/chaoscenter/authentication/api/docs/swagger.yaml b/chaoscenter/authentication/api/docs/swagger.yaml index 8fcb13cc30c..57a58954e60 100644 --- a/chaoscenter/authentication/api/docs/swagger.yaml +++ b/chaoscenter/authentication/api/docs/swagger.yaml @@ -12,6 +12,14 @@ definitions: userID: type: string type: object + response.CapabilitiesResponse: + properties: + dex: + properties: + enabled: + type: boolean + type: object + type: object response.ErrInvalidCredentials: properties: code: @@ -65,7 +73,7 @@ definitions: type: integer message: example: The authorization server encountered an unexpected condition that - prevented it from fulfi + prevented it from fulfilling the request type: string type: object response.ErrStrictPasswordPolicyViolation: @@ -176,6 +184,26 @@ paths: summary: Accept invitaion. tags: - ProjectRouter + /capabilities: + get: + consumes: + - application/json + description: Returns capabilities that can be leveraged by frontend services + to toggle certain features. + produces: + - application/json + responses: + "200": + description: OK + schema: + $ref: '#/definitions/response.CapabilitiesResponse' + "500": + description: Internal Server Error + schema: + $ref: '#/definitions/response.ErrServerError' + summary: Get capabilities of Auth Server. + tags: + - CapabilitiesRouter /create_project: post: consumes: diff --git a/chaoscenter/authentication/api/handlers/doc.go b/chaoscenter/authentication/api/handlers/doc.go index bc4c123abf0..7163177974b 100644 --- a/chaoscenter/authentication/api/handlers/doc.go +++ b/chaoscenter/authentication/api/handlers/doc.go @@ -25,6 +25,12 @@ type UserResponse struct { DeactivatedAt *int64 `bson:"deactivated_at,omitempty" json:"deactivatedAt,omitempty"` } +type CapabilitiesResponse struct { + Dex struct { + Enabled bool `json:"enabled"` + } `json:"dex"` +} + type MessageResponse struct { Message string } diff --git a/chaoscenter/authentication/api/handlers/rest/capabilities_handler.go b/chaoscenter/authentication/api/handlers/rest/capabilities_handler.go new file mode 100644 index 00000000000..9fea792b8c5 --- /dev/null +++ b/chaoscenter/authentication/api/handlers/rest/capabilities_handler.go @@ -0,0 +1,25 @@ +package rest + +import ( + "github.com/gin-gonic/gin" + response "github.com/litmuschaos/litmus/chaoscenter/authentication/api/handlers" + "github.com/litmuschaos/litmus/chaoscenter/authentication/pkg/utils" +) + +// GetCapabilities godoc +// +// @Summary Get capabilities of Auth Server. +// @Description Returns capabilities that can be leveraged by frontend services to toggle certain features. +// @Tags CapabilitiesRouter +// @Accept json +// @Produce json +// @Failure 500 {object} response.ErrServerError +// @Success 200 {object} response.CapabilitiesResponse{} +// @Router /capabilities [get] +func GetCapabilities() gin.HandlerFunc { + return func(c *gin.Context) { + capabilities := new(response.CapabilitiesResponse) + capabilities.Dex.Enabled = utils.DexEnabled + c.JSON(200, capabilities) + } +} diff --git a/chaoscenter/authentication/api/handlers/rest/capabilities_handler_test.go b/chaoscenter/authentication/api/handlers/rest/capabilities_handler_test.go new file mode 100644 index 00000000000..8149614b1d9 --- /dev/null +++ b/chaoscenter/authentication/api/handlers/rest/capabilities_handler_test.go @@ -0,0 +1,47 @@ +package rest_test + +import ( + "encoding/json" + "net/http" + "net/http/httptest" + "testing" + + response "github.com/litmuschaos/litmus/chaoscenter/authentication/api/handlers" + "github.com/litmuschaos/litmus/chaoscenter/authentication/api/handlers/rest" + "github.com/litmuschaos/litmus/chaoscenter/authentication/pkg/utils" + "github.com/stretchr/testify/assert" +) + +func TestCapabilities(t *testing.T) { + + testcases := []struct { + Name string + DexEnabled bool + }{ + { + Name: "Dex Enabled", + DexEnabled: true, + }, + { + Name: "Dex Disabled", + DexEnabled: false, + }, + } + + for _, test := range testcases { + test := test + t.Run(test.Name, func(t *testing.T) { + w := httptest.NewRecorder() + ctx := GetTestGinContext(w) + utils.DexEnabled = test.DexEnabled + + rest.GetCapabilities()(ctx) + capa := response.CapabilitiesResponse{} + err := json.Unmarshal(w.Body.Bytes(), &capa) + + assert.Nil(t, err) + assert.Equal(t, test.DexEnabled, capa.Dex.Enabled) + assert.Equal(t, http.StatusOK, w.Code) + }) + } +} diff --git a/chaoscenter/authentication/api/main.go b/chaoscenter/authentication/api/main.go index e47526debdc..7b297bdca02 100644 --- a/chaoscenter/authentication/api/main.go +++ b/chaoscenter/authentication/api/main.go @@ -170,6 +170,7 @@ func runRestServer(applicationService services.ApplicationService) { routes.MiscRouter(app, applicationService) routes.UserRouter(app, applicationService) routes.ProjectRouter(app, applicationService) + routes.CapabilitiesRouter(app) log.Infof("Listening and serving HTTP on %s", utils.Port) err := app.Run(utils.Port) diff --git a/chaoscenter/authentication/api/routes/capabilities_router.go b/chaoscenter/authentication/api/routes/capabilities_router.go new file mode 100644 index 00000000000..5cb44826670 --- /dev/null +++ b/chaoscenter/authentication/api/routes/capabilities_router.go @@ -0,0 +1,12 @@ +package routes + +import ( + "github.com/litmuschaos/litmus/chaoscenter/authentication/api/handlers/rest" + + "github.com/gin-gonic/gin" +) + +// CapabilitiesRouter creates all the required routes for exposing capabilities. +func CapabilitiesRouter(router *gin.Engine) { + router.GET("/capabilities", rest.GetCapabilities()) +} diff --git a/chaoscenter/authentication/go.mod b/chaoscenter/authentication/go.mod index 2e1db325401..21c5b944920 100644 --- a/chaoscenter/authentication/go.mod +++ b/chaoscenter/authentication/go.mod @@ -6,14 +6,14 @@ require ( github.com/coreos/go-oidc/v3 v3.1.0 github.com/gin-contrib/cors v1.3.1 github.com/gin-gonic/gin v1.9.1 - github.com/golang-jwt/jwt v3.2.1+incompatible - github.com/golang/protobuf v1.5.4 + github.com/golang-jwt/jwt v3.2.2+incompatible + github.com/golang/protobuf v1.5.3 github.com/google/uuid v1.6.0 github.com/kelseyhightower/envconfig v1.4.0 github.com/sirupsen/logrus v1.9.3 - github.com/stretchr/testify v1.8.4 - github.com/swaggo/swag v1.16.2 - go.mongodb.org/mongo-driver v1.13.1 + github.com/stretchr/testify v1.9.0 + github.com/swaggo/swag v1.16.3 + go.mongodb.org/mongo-driver v1.14.0 golang.org/x/crypto v0.21.0 golang.org/x/oauth2 v0.16.0 google.golang.org/grpc v1.61.0 @@ -24,13 +24,13 @@ require ( github.com/KyleBanks/depth v1.2.1 // indirect github.com/bytedance/sonic v1.9.1 // indirect github.com/chenzhuoyu/base64x v0.0.0-20221115062448-fe3a3abad311 // indirect - github.com/davecgh/go-spew v1.1.1 // indirect + github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect github.com/gabriel-vasile/mimetype v1.4.2 // indirect github.com/gin-contrib/sse v0.1.0 // indirect - github.com/go-openapi/jsonpointer v0.20.0 // indirect - github.com/go-openapi/jsonreference v0.20.2 // indirect - github.com/go-openapi/spec v0.20.9 // indirect - github.com/go-openapi/swag v0.22.4 // indirect + github.com/go-openapi/jsonpointer v0.21.0 // indirect + github.com/go-openapi/jsonreference v0.21.0 // indirect + github.com/go-openapi/spec v0.21.0 // indirect + github.com/go-openapi/swag v0.23.0 // indirect github.com/go-playground/locales v0.14.1 // indirect github.com/go-playground/universal-translator v0.18.1 // indirect github.com/go-playground/validator/v10 v10.14.0 // indirect @@ -38,7 +38,7 @@ require ( github.com/golang/snappy v0.0.1 // indirect github.com/josharian/intern v1.0.0 // indirect github.com/json-iterator/go v1.1.12 // indirect - github.com/klauspost/compress v1.13.6 // indirect + github.com/klauspost/compress v1.17.0 // indirect github.com/klauspost/cpuid/v2 v2.2.4 // indirect github.com/leodido/go-urn v1.2.4 // indirect github.com/mailru/easyjson v0.7.7 // indirect @@ -46,10 +46,10 @@ require ( github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect github.com/modern-go/reflect2 v1.0.2 // indirect github.com/montanaflynn/stats v0.0.0-20171201202039-1bf9dbcd8cbe // indirect - github.com/pelletier/go-toml/v2 v2.0.8 // indirect - github.com/pmezard/go-difflib v1.0.0 // indirect + github.com/pelletier/go-toml/v2 v2.1.1 // indirect + github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect github.com/rogpeppe/go-internal v1.12.0 // indirect - github.com/stretchr/objx v0.5.0 // indirect + github.com/stretchr/objx v0.5.2 // indirect github.com/twitchyliquid64/golang-asm v0.15.1 // indirect github.com/ugorji/go/codec v1.2.11 // indirect github.com/xdg-go/pbkdf2 v1.0.0 // indirect @@ -57,13 +57,13 @@ require ( github.com/xdg-go/stringprep v1.0.4 // indirect github.com/youmark/pkcs8 v0.0.0-20181117223130-1be2e3e5546d // indirect golang.org/x/arch v0.3.0 // indirect - golang.org/x/net v0.21.0 // indirect - golang.org/x/sync v0.5.0 // indirect + golang.org/x/net v0.22.0 // indirect + golang.org/x/sync v0.6.0 // indirect golang.org/x/sys v0.18.0 // indirect golang.org/x/text v0.14.0 // indirect - golang.org/x/tools v0.13.0 // indirect + golang.org/x/tools v0.19.0 // indirect google.golang.org/appengine v1.6.8 // indirect - google.golang.org/genproto/googleapis/rpc v0.0.0-20231106174013-bbf56f31fb17 // indirect - gopkg.in/square/go-jose.v2 v2.5.1 // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20231120223509-83a465c0220f // indirect + gopkg.in/square/go-jose.v2 v2.6.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect ) diff --git a/chaoscenter/authentication/go.sum b/chaoscenter/authentication/go.sum index 71bc5fd805a..7ccd088bf24 100644 --- a/chaoscenter/authentication/go.sum +++ b/chaoscenter/authentication/go.sum @@ -9,10 +9,10 @@ github.com/chenzhuoyu/base64x v0.0.0-20221115062448-fe3a3abad311 h1:qSGYFH7+jGhD github.com/chenzhuoyu/base64x v0.0.0-20221115062448-fe3a3abad311/go.mod h1:b583jCggY9gE99b6G5LEC39OIiVsWj+R97kbl5odCEk= github.com/coreos/go-oidc/v3 v3.1.0 h1:6avEvcdvTa1qYsOZ6I5PRkSYHzpTNWgKYmaJfaYbrRw= github.com/coreos/go-oidc/v3 v3.1.0/go.mod h1:rEJ/idjfUyfkBit1eI1fvyr+64/g9dcKpAm8MJMesvo= -github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1VwoXQT9A3Wy9MM3WgvqSxFWenqJduM= +github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/gabriel-vasile/mimetype v1.4.2 h1:w5qFW6JKBz9Y393Y4q372O9A7cUSequkh1Q7OhCmWKU= github.com/gabriel-vasile/mimetype v1.4.2/go.mod h1:zApsH/mKG4w07erKIaJPFiX0Tsq9BFQgN3qGY5GnNgA= github.com/gin-contrib/cors v1.3.1 h1:doAsuITavI4IOcd0Y19U4B+O0dNWihRyX//nn4sEmgA= @@ -22,21 +22,14 @@ github.com/gin-contrib/sse v0.1.0/go.mod h1:RHrZQHXnP2xjPF+u1gW/2HnVO7nvIa9PG3Gm github.com/gin-gonic/gin v1.5.0/go.mod h1:Nd6IXA8m5kNZdNEHMBd93KT+mdY3+bewLgRvmCsR2Do= github.com/gin-gonic/gin v1.9.1 h1:4idEAncQnU5cB7BeOkPtxjfCSye0AAm1R0RVIqJ+Jmg= github.com/gin-gonic/gin v1.9.1/go.mod h1:hPrL7YrpYKXt5YId3A/Tnip5kqbEAP+KLuI3SUcPTeU= -github.com/go-openapi/jsonpointer v0.19.3/go.mod h1:Pl9vOtqEWErmShwVjC8pYs9cog34VGT37dQOVbmoatg= -github.com/go-openapi/jsonpointer v0.19.5/go.mod h1:Pl9vOtqEWErmShwVjC8pYs9cog34VGT37dQOVbmoatg= -github.com/go-openapi/jsonpointer v0.19.6/go.mod h1:osyAmYz/mB/C3I+WsTTSgw1ONzaLJoLCyoi6/zppojs= -github.com/go-openapi/jsonpointer v0.20.0 h1:ESKJdU9ASRfaPNOPRx12IUyA1vn3R9GiE3KYD14BXdQ= -github.com/go-openapi/jsonpointer v0.20.0/go.mod h1:6PGzBjjIIumbLYysB73Klnms1mwnU4G3YHOECG3CedA= -github.com/go-openapi/jsonreference v0.20.0/go.mod h1:Ag74Ico3lPc+zR+qjn4XBUmXymS4zJbYVCZmcgkasdo= -github.com/go-openapi/jsonreference v0.20.2 h1:3sVjiK66+uXK/6oQ8xgcRKcFgQ5KXa2KvnJRumpMGbE= -github.com/go-openapi/jsonreference v0.20.2/go.mod h1:Bl1zwGIM8/wsvqjsOQLJ/SH+En5Ap4rVB5KVcIDZG2k= -github.com/go-openapi/spec v0.20.9 h1:xnlYNQAwKd2VQRRfwTEI0DcK+2cbuvI/0c7jx3gA8/8= -github.com/go-openapi/spec v0.20.9/go.mod h1:2OpW+JddWPrpXSCIX8eOx7lZ5iyuWj3RYR6VaaBKcWA= -github.com/go-openapi/swag v0.19.5/go.mod h1:POnQmlKehdgb5mhVOsnJFsivZCEZ/vjK9gh66Z9tfKk= -github.com/go-openapi/swag v0.19.15/go.mod h1:QYRuS/SOXUCsnplDa677K7+DxSOj6IPNl/eQntq43wQ= -github.com/go-openapi/swag v0.22.3/go.mod h1:UzaqsxGiab7freDnrUUra0MwWfN/q7tE4j+VcZ0yl14= -github.com/go-openapi/swag v0.22.4 h1:QLMzNJnMGPRNDCbySlcj1x01tzU8/9LTTL9hZZZogBU= -github.com/go-openapi/swag v0.22.4/go.mod h1:UzaqsxGiab7freDnrUUra0MwWfN/q7tE4j+VcZ0yl14= +github.com/go-openapi/jsonpointer v0.21.0 h1:YgdVicSA9vH5RiHs9TZW5oyafXZFc6+2Vc1rr/O9oNQ= +github.com/go-openapi/jsonpointer v0.21.0/go.mod h1:IUyH9l/+uyhIYQ/PXVA41Rexl+kOkAPDdXEYns6fzUY= +github.com/go-openapi/jsonreference v0.21.0 h1:Rs+Y7hSXT83Jacb7kFyjn4ijOuVGSvOdF2+tg1TRrwQ= +github.com/go-openapi/jsonreference v0.21.0/go.mod h1:LmZmgsrTkVg9LG4EaHeY8cBDslNPMo06cago5JNLkm4= +github.com/go-openapi/spec v0.21.0 h1:LTVzPc3p/RzRnkQqLRndbAzjY0d0BCL72A6j3CdL9ZY= +github.com/go-openapi/spec v0.21.0/go.mod h1:78u6VdPw81XU44qEWGhtr982gJ5BWg2c0I5XwVMotYk= +github.com/go-openapi/swag v0.23.0 h1:vsEVJDUo2hPJ2tu0/Xc+4noaxyEffXNIs3cOULZ+GrE= +github.com/go-openapi/swag v0.23.0/go.mod h1:esZ8ITTYEsH1V2trKHjAN8Ai7xHb8RV+YSZ577vPjgQ= github.com/go-playground/assert/v2 v2.2.0 h1:JvknZsQTYeFEAhQwI4qEt9cyV5ONwRHC+lYKSsYSR8s= github.com/go-playground/locales v0.12.1/go.mod h1:IUMDtCfWo/w/mtMfIE/IG2K+Ey3ygWanZIBtBW0W2TM= github.com/go-playground/locales v0.14.1 h1:EWaQ/wswjilfKLTECiXz7Rh+3BjFhfDFKv/oXslEjJA= @@ -48,18 +41,17 @@ github.com/go-playground/validator/v10 v10.14.0 h1:vgvQWe3XCz3gIeFDm/HnTIbj6UGmg github.com/go-playground/validator/v10 v10.14.0/go.mod h1:9iXMNT7sEkjXb0I+enO7QXmzG6QCsPWY4zveKFVRSyU= github.com/goccy/go-json v0.10.2 h1:CrxCmQqYDkv1z7lO7Wbh2HN93uovUHgrECaO5ZrCXAU= github.com/goccy/go-json v0.10.2/go.mod h1:6MelG93GURQebXPDq3khkgXZkazVtN9CRI+MGFi0w8I= -github.com/golang-jwt/jwt v3.2.1+incompatible h1:73Z+4BJcrTC+KczS6WvTPvRGOp1WmfEP4Q1lOd9Z/+c= -github.com/golang-jwt/jwt v3.2.1+incompatible/go.mod h1:8pz2t5EyA70fFQQSrl6XZXzqecmYZeUEB8OUGHkxJ+I= +github.com/golang-jwt/jwt v3.2.2+incompatible h1:IfV12K8xAKAnZqdXVzCZ+TOjboZ2keLg81eXfW3O+oY= +github.com/golang-jwt/jwt v3.2.2+incompatible/go.mod h1:8pz2t5EyA70fFQQSrl6XZXzqecmYZeUEB8OUGHkxJ+I= github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= -github.com/golang/protobuf v1.5.4 h1:i7eJL8qZTpSEXOPTxNKhASYpMn+8e5Q6AdndVa1dWek= -github.com/golang/protobuf v1.5.4/go.mod h1:lnTiLA8Wa4RWRcIUkrtSVa5nRhsEGBg48fD6rSs7xps= +github.com/golang/protobuf v1.5.3 h1:KhyjKVUg7Usr/dYsdSqoFveMYd5ko72D+zANwlG1mmg= +github.com/golang/protobuf v1.5.3/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= github.com/golang/snappy v0.0.1 h1:Qgr9rKW7uDUkrbSmQeiDsGa8SjGyCOGtuasMWwvp2P4= github.com/golang/snappy v0.0.1/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= @@ -72,24 +64,19 @@ github.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnr github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo= github.com/kelseyhightower/envconfig v1.4.0 h1:Im6hONhd3pLkfDFsbRgu68RDNkGF1r3dvMUtDTo2cv8= github.com/kelseyhightower/envconfig v1.4.0/go.mod h1:cccZRl6mQpaq41TPp5QxidR+Sa3axMbJDNb//FQX6Gg= -github.com/klauspost/compress v1.13.6 h1:P76CopJELS0TiO2mebmnzgWaajssP/EszplttgQxcgc= -github.com/klauspost/compress v1.13.6/go.mod h1:/3/Vjq9QcHkK5uEr5lBEmyoZ1iFhe47etQ6QUkpK6sk= +github.com/klauspost/compress v1.17.0 h1:Rnbp4K9EjcDuVuHtd0dgA4qNuv9yKDYKK1ulpJwgrqM= +github.com/klauspost/compress v1.17.0/go.mod h1:ntbaceVETuRiXiv4DpjP66DpAtAGkEQskQzEyD//IeE= github.com/klauspost/cpuid/v2 v2.0.9/go.mod h1:FInQzS24/EEf25PyTYn52gqo7WaD8xa0213Md/qVLRg= github.com/klauspost/cpuid/v2 v2.2.4 h1:acbojRNwl3o09bUq+yDCtZFc1aiwaAAxtcn8YkZXnvk= github.com/klauspost/cpuid/v2 v2.2.4/go.mod h1:RVVoqg1df56z8g3pUjL/3lE5UfnlrJX8tyFgg4nqhuY= github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= -github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= -github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= github.com/leodido/go-urn v1.1.0/go.mod h1:+cyI34gQWZcE1eQU7NVgKkkzdXDQHr1dBMtdAPozLkw= github.com/leodido/go-urn v1.2.4 h1:XlAE/cm/ms7TE/VMVoduSpNBoyc2dOxHs5MZSwAN63Q= github.com/leodido/go-urn v1.2.4/go.mod h1:7ZrI8mTSeBSHl/UaRyKQW1qZeMgak41ANeCNaVckg+4= -github.com/mailru/easyjson v0.0.0-20190614124828-94de47d64c63/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= -github.com/mailru/easyjson v0.0.0-20190626092158-b2ccc519800e/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= -github.com/mailru/easyjson v0.7.6/go.mod h1:xzfreul335JAWq5oZzymOObrkdz5UnU4kGfJJLY9Nlc= github.com/mailru/easyjson v0.7.7 h1:UGYAvKxe3sBsEDzO8ZeWOSlIQfWFlxbzLZe7hwFURr0= github.com/mailru/easyjson v0.7.7/go.mod h1:xzfreul335JAWq5oZzymOObrkdz5UnU4kGfJJLY9Nlc= github.com/mattn/go-isatty v0.0.9/go.mod h1:YNRxwqDuOph6SZLI9vUUz6OYw3QyUt7WiY2yME+cCiQ= @@ -103,33 +90,33 @@ github.com/modern-go/reflect2 v1.0.2 h1:xBagoLtFs94CBntxluKeaWgTMpvLxC4ur3nMaC9G github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk= github.com/montanaflynn/stats v0.0.0-20171201202039-1bf9dbcd8cbe h1:iruDEfMl2E6fbMZ9s0scYfZQ84/6SPL6zC8ACM2oIL0= github.com/montanaflynn/stats v0.0.0-20171201202039-1bf9dbcd8cbe/go.mod h1:wL8QJuTMNUDYhXwkmfOly8iTdp5TEcJFWZD2D7SIkUc= -github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno= -github.com/pelletier/go-toml/v2 v2.0.8 h1:0ctb6s9mE31h0/lhu+J6OPmVeDxJn+kYnJc2jZR9tGQ= -github.com/pelletier/go-toml/v2 v2.0.8/go.mod h1:vuYfssBdrU2XDZ9bYydBu6t+6a6PYNcZljzZR9VXg+4= -github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= +github.com/pelletier/go-toml/v2 v2.1.1 h1:LWAJwfNvjQZCFIDKWYQaM62NcYeYViCmWIwmOStowAI= +github.com/pelletier/go-toml/v2 v2.1.1/go.mod h1:tJU2Z3ZkXwnxa4DPO899bsyIoywizdUvyaeZurnPPDc= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 h1:Jamvg5psRIccs7FGNTlIRMkT8wgtp5eCXdBlqhYGL6U= +github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/rogpeppe/go-internal v1.12.0 h1:exVL4IDcn6na9z1rAb56Vxr+CgyK3nn3O+epU5NdKM8= github.com/rogpeppe/go-internal v1.12.0/go.mod h1:E+RYuTGaKKdloAfM02xzb0FW3Paa99yedzYV+kq4uf4= github.com/sirupsen/logrus v1.9.3 h1:dueUQJ1C2q9oE3F7wvmSGAaVtTmUizReu6fjN8uqzbQ= github.com/sirupsen/logrus v1.9.3/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw= -github.com/stretchr/objx v0.5.0 h1:1zr/of2m5FGMsad5YfcqgdqdWrIhu+EBEJRhR1U7z/c= github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo= +github.com/stretchr/objx v0.5.2 h1:xuMeJ0Sdp5ZMRXx/aWO6RZxdr3beISkG5/G/aIRr3pY= +github.com/stretchr/objx v0.5.2/go.mod h1:FRsXN1f5AsAjCGJKqEizvkpNtU+EGNCLh3NxZ/8L+MA= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA= -github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= github.com/stretchr/testify v1.8.2/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= -github.com/stretchr/testify v1.8.3/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= -github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk= github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= -github.com/swaggo/swag v1.16.2 h1:28Pp+8DkQoV+HLzLx8RGJZXNGKbFqnuvSbAAtoxiY04= -github.com/swaggo/swag v1.16.2/go.mod h1:6YzXnDcpr0767iOejs318CwYkCQqyGer6BizOg03f+E= +github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg= +github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= +github.com/swaggo/swag v1.16.3 h1:PnCYjPCah8FK4I26l2F/KQ4yz3sILcVUN3cTlBFA9Pg= +github.com/swaggo/swag v1.16.3/go.mod h1:DImHIuOFXKpMFAQjcC7FG4m3Dg4+QuUgUzJmKjI/gRk= github.com/twitchyliquid64/golang-asm v0.15.1 h1:SU5vSMR7hnwNxj24w34ZyCi/FmDZTkS4MhqMhdFk5YI= github.com/twitchyliquid64/golang-asm v0.15.1/go.mod h1:a1lVb/DtPvCB8fslRZhAngC2+aY1QWCk3Cedj/Gdt08= github.com/ugorji/go v1.1.7/go.mod h1:kZn38zHttfInRq0xu/PH0az30d+z6vm202qpg1oXVMw= @@ -145,40 +132,37 @@ github.com/xdg-go/stringprep v1.0.4/go.mod h1:mPGuuIYwz7CmR2bT9j4GbQqutWS1zV24gi github.com/youmark/pkcs8 v0.0.0-20181117223130-1be2e3e5546d h1:splanxYIlg+5LfHAM6xpdFEAYOk8iySO56hMFq6uLyA= github.com/youmark/pkcs8 v0.0.0-20181117223130-1be2e3e5546d/go.mod h1:rHwXgn7JulP+udvsHwJoVG1YGAP6VLg4y9I5dyZdqmA= github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY= -go.mongodb.org/mongo-driver v1.13.1 h1:YIc7HTYsKndGK4RFzJ3covLz1byri52x0IoMB0Pt/vk= -go.mongodb.org/mongo-driver v1.13.1/go.mod h1:wcDf1JBCXy2mOW0bWHwO/IOYqdca1MPCwDtFu/Z9+eo= +go.mongodb.org/mongo-driver v1.14.0 h1:P98w8egYRjYe3XDjxhYJagTokP/H6HzlsnojRgZRd80= +go.mongodb.org/mongo-driver v1.14.0/go.mod h1:Vzb0Mk/pa7e6cWw85R4F/endUC3u0U9jGcNU603k65c= golang.org/x/arch v0.0.0-20210923205945-b76863e36670/go.mod h1:5om86z9Hs0C8fWVUuoMHwpExlXzs5Tkyp9hOrfG7pp8= golang.org/x/arch v0.3.0 h1:02VY4/ZcO/gBOH6PUaoiptASxtXU10jazRCP865E97k= golang.org/x/arch v0.3.0/go.mod h1:5om86z9Hs0C8fWVUuoMHwpExlXzs5Tkyp9hOrfG7pp8= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= -golang.org/x/crypto v0.0.0-20220622213112-05595931fe9d/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= golang.org/x/crypto v0.21.0 h1:X31++rzVUdKhX5sWmSOFZxx8UW/ldWx55cbf08iNAMA= golang.org/x/crypto v0.21.0/go.mod h1:0BP7YvVV9gBbVKyeTG0Gyn+gZm94bibOW5BjDEYAOMs= golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= -golang.org/x/mod v0.12.0 h1:rmsUpXtvNzj340zd98LZ4KntptpfRHwpFOHG188oHXc= +golang.org/x/mod v0.16.0 h1:QX4fJ0Rr5cPQCF7O9lh9Se4pmwfwskqZfq5moyldzic= golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200505041828-1ed23360d12c/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= -golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= -golang.org/x/net v0.21.0 h1:AQyQV4dYCvJ7vGmJyKki9+PBdyvhkSd8EIx/qb0AYv4= -golang.org/x/net v0.21.0/go.mod h1:bIjVDfnllIU7BJ2DNgfnXvpSvtn8VRwhlsaeUTyUS44= +golang.org/x/net v0.22.0 h1:9sGLhx7iRIHEiX0oAJ3MRZMUCElJgy7Br1nO+AMN3Tc= +golang.org/x/net v0.22.0/go.mod h1:JKghWKKOSdJwpW2GEx0Ja7fmaKnMsbu+MWVZTokSYmg= golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.16.0 h1:aDkGMBSYxElaoP81NpoUoz2oo2R2wHdZpGToUxfyQrQ= golang.org/x/oauth2 v0.16.0/go.mod h1:hqZ+0LWXsiVoZpeld6jVt06P3adbS2Uu911W1SsJv2o= golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.5.0 h1:60k92dhOjHxJkrqnwsfl8KuaHbn/5dl0lUPUklKo3qE= -golang.org/x/sync v0.5.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= +golang.org/x/sync v0.6.0 h1:5BMeUDZ7vkXGfEr1x9B4bRcTH4lpkTkpdh0T/J+qjbQ= +golang.org/x/sync v0.6.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190813064441-fde4db37ae7a/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220704084225-05e143d24a9e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= @@ -191,24 +175,22 @@ golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9sn golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= golang.org/x/text v0.3.8/go.mod h1:E6s5w1FMmriuDzIBO73fBruAKo1PCIq6d2Q6DHfQ8WQ= -golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= golang.org/x/text v0.14.0 h1:ScX5w1eTa3QqT8oi6+ziP7dTV1S2+ALU0bI+0zXKWiQ= golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= -golang.org/x/tools v0.13.0 h1:Iey4qkscZuv0VvIt8E0neZjtPVQFSc870HQ448QgEmQ= -golang.org/x/tools v0.13.0/go.mod h1:HvlwmtVNQAhOuCjW7xxvovg8wbNq7LwfXh/k7wXUl58= +golang.org/x/tools v0.19.0 h1:tfGCXNR1OsFG+sVdLAitlpjAvD/I6dHDKnYrpEZUHkw= +golang.org/x/tools v0.19.0/go.mod h1:qoJWxmGSIBmAeriMx19ogtrEPrGtDbPK634QFIcLAhc= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= google.golang.org/appengine v1.6.8 h1:IhEN5q69dyKagZPYMSdIjS2HqprW324FRQZJcGqPAsM= google.golang.org/appengine v1.6.8/go.mod h1:1jJ3jBArFh5pcgW8gCtRJnepW8FzD1V44FJffLiz/Ds= -google.golang.org/genproto/googleapis/rpc v0.0.0-20231106174013-bbf56f31fb17 h1:Jyp0Hsi0bmHXG6k9eATXoYtjd6e2UzZ1SCn/wIupY14= -google.golang.org/genproto/googleapis/rpc v0.0.0-20231106174013-bbf56f31fb17/go.mod h1:oQ5rr10WTTMvP4A36n8JpR1OrO1BEiV4f78CneXZxkA= +google.golang.org/genproto/googleapis/rpc v0.0.0-20231120223509-83a465c0220f h1:ultW7fxlIvee4HYrtnaRPon9HpEgFk5zYpmfMgtKB5I= +google.golang.org/genproto/googleapis/rpc v0.0.0-20231120223509-83a465c0220f/go.mod h1:L9KNLi232K1/xB6f7AlSX692koaRnKaWSR0stBki0Yc= google.golang.org/grpc v1.61.0 h1:TOvOcuXn30kRao+gfcvsebNEa5iZIiLkisYEkf7R7o0= google.golang.org/grpc v1.61.0/go.mod h1:VUbo7IFqmF1QtCAstipjG0GIoq49KvMe9+h1jFLBNJs= google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= @@ -217,18 +199,14 @@ google.golang.org/protobuf v1.33.0 h1:uNO2rsAINq/JlFpSdYEKIZ0uKD/R9cpdv0T+yoGwGm google.golang.org/protobuf v1.33.0/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= -gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= gopkg.in/go-playground/assert.v1 v1.2.1/go.mod h1:9RXL0bg/zibRAgZUYszZSwO/z8Y/a8bDuhia5mkpMnE= gopkg.in/go-playground/validator.v9 v9.29.1/go.mod h1:+c9/zcJMFNgbLvly1L1V+PpxWdVbfP1avr/N00E2vyQ= -gopkg.in/square/go-jose.v2 v2.5.1 h1:7odma5RETjNHWJnR32wx8t+Io4djHE1PqxCFx3iiZ2w= gopkg.in/square/go-jose.v2 v2.5.1/go.mod h1:M9dMgbHiYLoDGQrXy7OpJDJWiKiU//h+vD76mk0e1AI= +gopkg.in/square/go-jose.v2 v2.6.0 h1:NGk74WTnPKBNUhNzQX7PYcTLUjoq7mzKk2OKbvwk2iI= +gopkg.in/square/go-jose.v2 v2.6.0/go.mod h1:M9dMgbHiYLoDGQrXy7OpJDJWiKiU//h+vD76mk0e1AI= gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= -gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -gopkg.in/yaml.v3 v3.0.0-20200615113413-eeeca48fe776/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= rsc.io/pdf v0.1.1/go.mod h1:n8OzWcQ6Sp37PL01nO98y4iUCRdTGarVfzxY20ICaU4= diff --git a/chaoscenter/web/config/oats.config.ts b/chaoscenter/web/config/oats.config.ts index 85c1e5eeaf5..5c59fca3574 100644 --- a/chaoscenter/web/config/oats.config.ts +++ b/chaoscenter/web/config/oats.config.ts @@ -9,7 +9,7 @@ function normalizePath(url: string): string { export default defineConfig({ services: { auth: { - url: 'https://raw.githubusercontent.com/litmuschaos/litmus/master/mkdocs/docs/auth/v3.0.0/auth-api.json', + file: '../../mkdocs/docs/auth/v3.0.0/auth-api.json', output: 'src/api/auth', transformer(spec) { return { diff --git a/chaoscenter/web/src/api/auth/hooks/useGetCapabilitiesQuery.ts b/chaoscenter/web/src/api/auth/hooks/useGetCapabilitiesQuery.ts new file mode 100644 index 00000000000..0a365c47212 --- /dev/null +++ b/chaoscenter/web/src/api/auth/hooks/useGetCapabilitiesQuery.ts @@ -0,0 +1,35 @@ +/* eslint-disable */ +// This code is autogenerated using @harnessio/oats-cli. +// Please do not modify this code directly. +import { useQuery, UseQueryOptions } from '@tanstack/react-query'; + +import type { CapabilitiesResponse } from '../schemas/CapabilitiesResponse'; +import { fetcher, FetcherOptions } from 'services/fetcher'; + +export type GetCapabilitiesOkResponse = CapabilitiesResponse; + +export type GetCapabilitiesErrorResponse = unknown; + +export interface GetCapabilitiesProps extends Omit, 'url'> {} + +export function getCapabilities(props: GetCapabilitiesProps): Promise { + return fetcher({ + url: `/auth/capabilities`, + method: 'GET', + ...props + }); +} + +/** + * Returns capabilities that can be leveraged by frontend services to toggle certain features. + */ +export function useGetCapabilitiesQuery( + props: GetCapabilitiesProps, + options?: Omit, 'queryKey' | 'queryFn'> +) { + return useQuery( + ['getCapabilities'], + ({ signal }) => getCapabilities({ ...props, signal }), + options + ); +} diff --git a/chaoscenter/web/src/api/auth/index.ts b/chaoscenter/web/src/api/auth/index.ts index 2a8e8aadcfc..a221645dfd0 100644 --- a/chaoscenter/web/src/api/auth/index.ts +++ b/chaoscenter/web/src/api/auth/index.ts @@ -45,6 +45,12 @@ export type { GetApiTokensQueryPathParams } from './hooks/useGetApiTokensQuery'; export { getApiTokens, useGetApiTokensQuery } from './hooks/useGetApiTokensQuery'; +export type { + GetCapabilitiesErrorResponse, + GetCapabilitiesOkResponse, + GetCapabilitiesProps +} from './hooks/useGetCapabilitiesQuery'; +export { getCapabilities, useGetCapabilitiesQuery } from './hooks/useGetCapabilitiesQuery'; export type { GetOwnerProjectsErrorResponse, GetOwnerProjectsOkResponse, @@ -200,12 +206,14 @@ export type { UpdateStateProps, UpdateStateRequestBody } from './hooks/useUpdateStateMutation'; + export { updateState, useUpdateStateMutation } from './hooks/useUpdateStateMutation'; export type { UsersErrorResponse, UsersOkResponse, UsersProps } from './hooks/useUsersQuery'; export { useUsersQuery, users } from './hooks/useUsersQuery'; export type { DeclineInvitationBodyRequestBody } from './requestBodies/DeclineInvitationBodyRequestBody'; export type { ActionBy } from './schemas/ActionBy'; export type { ApiToken } from './schemas/ApiToken'; +export type { CapabilitiesResponse } from './schemas/CapabilitiesResponse'; export type { CreateApiTokenResponse } from './schemas/CreateApiTokenResponse'; export type { ErrorModel } from './schemas/ErrorModel'; export type { GetApiTokensResponse } from './schemas/GetApiTokensResponse'; diff --git a/chaoscenter/web/src/api/auth/schemas/CapabilitiesResponse.ts b/chaoscenter/web/src/api/auth/schemas/CapabilitiesResponse.ts new file mode 100644 index 00000000000..565d78b0375 --- /dev/null +++ b/chaoscenter/web/src/api/auth/schemas/CapabilitiesResponse.ts @@ -0,0 +1,9 @@ +/* eslint-disable */ +// This code is autogenerated using @harnessio/oats-cli. +// Please do not modify this code directly. + +export interface CapabilitiesResponse { + dex?: { + enabled?: boolean; + }; +} diff --git a/chaoscenter/web/src/controllers/Login/LoginPage.tsx b/chaoscenter/web/src/controllers/Login/LoginPage.tsx index e068c7a7bd7..0798d7fdb5a 100644 --- a/chaoscenter/web/src/controllers/Login/LoginPage.tsx +++ b/chaoscenter/web/src/controllers/Login/LoginPage.tsx @@ -3,7 +3,7 @@ import { useHistory } from 'react-router-dom'; import { useToaster } from '@harnessio/uicore'; import jwtDecode from 'jwt-decode'; import LoginPageView from '@views/Login'; -import { useLoginMutation } from '@api/auth'; +import { useLoginMutation, useGetCapabilitiesQuery } from '@api/auth'; import { setUserDetails } from '@utils'; import { normalizePath } from '@routes/RouteDefinitions'; import type { DecodedTokenType, PermissionGroup } from '@models'; @@ -17,6 +17,8 @@ const LoginController: React.FC = () => { const dexProjectID = searchParams.get('projectID'); const dexProjectRole = searchParams.get('projectRole') as PermissionGroup; + const capabilities = useGetCapabilitiesQuery({}); + React.useEffect(() => { if (dexToken && dexProjectID && dexProjectRole) { const accountID = (jwtDecode(dexToken) as DecodedTokenType).uid; @@ -44,7 +46,7 @@ const LoginController: React.FC = () => { } ); - return ; + return ; }; export default LoginController; diff --git a/chaoscenter/web/src/strings/strings.en.yaml b/chaoscenter/web/src/strings/strings.en.yaml index 7ad016b8cd8..d9966852ad6 100644 --- a/chaoscenter/web/src/strings/strings.en.yaml +++ b/chaoscenter/web/src/strings/strings.en.yaml @@ -1011,6 +1011,7 @@ showLess: ' Show less' showingAll: Showing all showingLastRuns: Showing last 50 runs only signIn: Sign In +signInWithDex: Login With Single Sign-On signOut: Sign Out singleRun: Single Run source: Source diff --git a/chaoscenter/web/src/strings/types.ts b/chaoscenter/web/src/strings/types.ts index 19e3cd4f964..ff172fca95b 100644 --- a/chaoscenter/web/src/strings/types.ts +++ b/chaoscenter/web/src/strings/types.ts @@ -852,6 +852,7 @@ export interface StringsMap { 'showingAll': unknown 'showingLastRuns': unknown 'signIn': unknown + 'signInWithDex': unknown 'signOut': unknown 'singleRun': unknown 'source': unknown diff --git a/chaoscenter/web/src/views/Login/LoginPage.tsx b/chaoscenter/web/src/views/Login/LoginPage.tsx index 2e0e79d2175..8011834cf9c 100644 --- a/chaoscenter/web/src/views/Login/LoginPage.tsx +++ b/chaoscenter/web/src/views/Login/LoginPage.tsx @@ -6,7 +6,7 @@ import { Form } from 'formik'; import type { UseMutateFunction } from '@tanstack/react-query'; import AuthLayout from '@components/AuthLayout/AuthLayout'; import { useStrings } from '@strings'; -import type { ErrorModel, LoginMutationProps, LoginResponse } from '@api/auth'; +import type { ErrorModel, LoginMutationProps, LoginResponse, GetCapabilitiesOkResponse } from '@api/auth'; import PassowrdInput from '@components/PasswordInput'; import UserNameInput from '@components/UserNameInput'; @@ -18,9 +18,10 @@ interface LoginForm { interface LoginPageViewProps { handleLogin: UseMutateFunction, unknown>; loading: boolean; + capabilities?: GetCapabilitiesOkResponse; } -export default function LoginPageView({ handleLogin, loading }: LoginPageViewProps): React.ReactElement { +export const LoginPageView = ({ handleLogin, loading, capabilities }: LoginPageViewProps): React.ReactElement => { const { getString } = useStrings(); return ( @@ -66,6 +67,20 @@ export default function LoginPageView({ handleLogin, loading }: LoginPageViewPro + {capabilities?.dex?.enabled && ( + + )} ); -} +}; diff --git a/chaoscenter/web/src/views/Login/__tests__/LoginPage.test.tsx b/chaoscenter/web/src/views/Login/__tests__/LoginPage.test.tsx index 74929d9e08b..c021d411f42 100644 --- a/chaoscenter/web/src/views/Login/__tests__/LoginPage.test.tsx +++ b/chaoscenter/web/src/views/Login/__tests__/LoginPage.test.tsx @@ -3,7 +3,7 @@ import '@testing-library/jest-dom'; import { render, screen } from '@testing-library/react'; import userEvent from '@testing-library/user-event'; import { TestWrapper } from 'utils/testUtils'; -import LoginPageView from '../LoginPage'; +import { LoginPageView } from '../LoginPage'; const mockHandleLogin = jest.fn(); @@ -36,4 +36,34 @@ describe('LoginPageView', () => { expect(usernameInput.value).toBe(undefined); expect(passwordInput.value).toBe(undefined); }); + + test('With Dex Login Disabled', async () => { + const capabilitiesWithDexDisabled = { + dex: { + enabled: false, + }, + }; + + render( + + + + ); + const dexLoginButton = screen.queryByRole('button', { name: 'signInWithDex' }); + expect(dexLoginButton).not.toBeInTheDocument(); + }); + test('With Dex Login Enabled', async () => { + const capabilitiesWithDexEnabled = { + dex: { + enabled: true, + }, + }; + render( + + + + ); + const dexLoginButton = screen.queryByRole('button', { name: 'signInWithDex' }); + expect(dexLoginButton).toBeInTheDocument(); + }); }); diff --git a/chaoscenter/web/src/views/Login/index.ts b/chaoscenter/web/src/views/Login/index.ts index 4b11de7b50c..7f012ef9117 100644 --- a/chaoscenter/web/src/views/Login/index.ts +++ b/chaoscenter/web/src/views/Login/index.ts @@ -1,3 +1,3 @@ -import LoginPageView from './LoginPage'; +import { LoginPageView } from './LoginPage'; export default LoginPageView; diff --git a/mkdocs/docs/auth/v3.0.0/auth-api.json b/mkdocs/docs/auth/v3.0.0/auth-api.json index 441449d1b36..193ef16e292 100644 --- a/mkdocs/docs/auth/v3.0.0/auth-api.json +++ b/mkdocs/docs/auth/v3.0.0/auth-api.json @@ -1,13 +1,40 @@ { "swagger": "2.0", "host": "localhost:3000", - "schemes": ["https", "http"], + "schemes": [ + "https", + "http" + ], "info": { "title": "Litmus Portal Authentication API", "version": "2.7.0", "description": "Litmus Portal Authentication APIs are used to authenticate the identity of a user and to perform several user-specific tasks like:\n
  • Update Profile
  • \n
  • Change Password
  • \n
  • Reset Password
  • \n
  • Create new users etc.
  • \n" }, "paths": { + "/capabilities": { + "get": { + "description": "Returns capabilities that can be leveraged by frontend services to toggle certain features.", + "operationId": "getCapabilities", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "CapabilitiesRouter" + ], + "summary": "Get capabilities of Auth Server.", + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/CapabilitiesResponse" + } + } + } + } + }, "/status": { "get": { "description": "This API is used to check the status of the server.", @@ -31,7 +58,9 @@ } }, "parameters": [], - "produces": ["application/json"] + "produces": [ + "application/json" + ] } }, "/login": { @@ -71,7 +100,10 @@ "in": "body", "schema": { "type": "object", - "required": ["username", "password"], + "required": [ + "username", + "password" + ], "properties": { "username": { "type": "string" @@ -87,8 +119,12 @@ } } ], - "consumes": ["application/json"], - "produces": ["application/json"] + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ] } }, "/logout": { @@ -100,7 +136,7 @@ "description": "OK", "examples": { "application/json": { - "message":"successfully logged out" + "message": "successfully logged out" } }, "schema": { @@ -120,8 +156,12 @@ } } }, - "consumes": ["application/json"], - "produces": ["application/json"] + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ] } }, "/token/{user_id}": { @@ -170,7 +210,9 @@ "type": "string" } ], - "produces": ["application/json"] + "produces": [ + "application/json" + ] } }, "/create_token": { @@ -183,7 +225,7 @@ "examples": { "application/json": { "accessToken": "eyJhbGciOiJIUzUxMiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE2OTI1MTEzMTIsInJvbGUiOiJhZG1pbiIsInVpZCI6IjIzZDY5M2I5LWJhZTQtNDA3Ni05Y2Q1LWViZDM5NDljOThkNiIsInVzZXJuYW1lIjoiYWRtaW4ifQ.4-bvGu8iVlrn6N7aHZQl6xKk4Nl-EPoeCO4euO8cGg0PigxYJGeyHy70cC9hgFvjc2_BVskuvjhK3-auOT6llA", - "type": "Bearer" + "type": "Bearer" } }, "schema": { @@ -209,7 +251,11 @@ "in": "body", "schema": { "type": "object", - "required": ["user_id", "name", "days_until_expiration"], + "required": [ + "user_id", + "name", + "days_until_expiration" + ], "properties": { "user_id": { "type": "string" @@ -229,8 +275,12 @@ } } ], - "consumes": ["application/json"], - "produces": ["application/json"] + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ] } }, "/remove_token": { @@ -268,7 +318,9 @@ "in": "body", "schema": { "type": "object", - "required": ["token"], + "required": [ + "token" + ], "properties": { "token": { "type": "string" @@ -280,8 +332,12 @@ } } ], - "consumes": ["application/json"], - "produces": ["application/json"] + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ] } }, "/users": { @@ -309,7 +365,9 @@ } }, "parameters": [], - "produces": ["application/json"] + "produces": [ + "application/json" + ] } }, "/get_user/{user_id}": { @@ -343,7 +401,9 @@ "type": "string" } ], - "produces": ["application/json"] + "produces": [ + "application/json" + ] } }, "/update/password": { @@ -374,7 +434,11 @@ "in": "body", "schema": { "type": "object", - "required": ["username", "oldPassword", "newPassword"], + "required": [ + "username", + "oldPassword", + "newPassword" + ], "properties": { "username": { "type": "string" @@ -394,8 +458,12 @@ } } ], - "consumes": ["application/json"], - "produces": ["application/json"] + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ] } }, "/create_user": { @@ -427,7 +495,11 @@ "schema": { "type": "object", "properties": { - "required": ["username", "password", "role"], + "required": [ + "username", + "password", + "role" + ], "username": { "type": "string" }, @@ -454,8 +526,12 @@ } } ], - "consumes": ["application/json"], - "produces": ["application/json"] + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ] } }, "/reset/password": { @@ -486,7 +562,11 @@ "in": "body", "schema": { "type": "object", - "required": ["username", "oldPassword", "newPassword"], + "required": [ + "username", + "oldPassword", + "newPassword" + ], "properties": { "username": { "type": "string" @@ -505,8 +585,12 @@ } } ], - "consumes": ["application/json"], - "produces": ["application/json"] + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ] } }, "/update/details": { @@ -552,8 +636,12 @@ } } ], - "consumes": ["application/json"], - "produces": ["application/json"] + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ] } }, "/update/state": { @@ -584,7 +672,10 @@ "in": "body", "schema": { "type": "object", - "required": ["username", "isDeactivate"], + "required": [ + "username", + "isDeactivate" + ], "properties": { "username": { "type": "string" @@ -600,8 +691,12 @@ } } ], - "consumes": ["application/json"], - "produces": ["application/json"] + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ] } }, "/create_project": { @@ -647,7 +742,9 @@ "in": "body", "schema": { "type": "object", - "required": ["projectName"], + "required": [ + "projectName" + ], "properties": { "projectName": { "type": "string" @@ -659,8 +756,12 @@ } } ], - "consumes": ["application/json"], - "produces": ["application/json"] + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ] } }, "/get_project/{project_id}": { @@ -713,7 +814,9 @@ "type": "string" } ], - "produces": ["application/json"] + "produces": [ + "application/json" + ] } }, "/get_user_with_project/{username}": { @@ -771,7 +874,9 @@ "type": "string" } ], - "produces": ["application/json"] + "produces": [ + "application/json" + ] } }, "/list_projects": { @@ -817,7 +922,9 @@ } }, "parameters": [], - "produces": ["application/json"] + "produces": [ + "application/json" + ] } }, "/get_projects_stats": { @@ -852,7 +959,9 @@ } }, "parameters": [], - "produces": ["application/json"] + "produces": [ + "application/json" + ] } }, "/update_project_name": { @@ -883,7 +992,10 @@ "in": "body", "schema": { "type": "object", - "required": ["projectID", "projectName"], + "required": [ + "projectID", + "projectName" + ], "properties": { "projectID": { "type": "string" @@ -899,8 +1011,12 @@ } } ], - "consumes": ["application/json"], - "produces": ["application/json"] + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ] } }, "/send_invitation": { @@ -940,7 +1056,11 @@ "in": "body", "schema": { "type": "object", - "required": ["projectID", "userID", "role"], + "required": [ + "projectID", + "userID", + "role" + ], "properties": { "projectID": { "type": "string" @@ -950,7 +1070,11 @@ }, "role": { "type": "string", - "enum": ["Owner", "Editor", "Viewer"] + "enum": [ + "Owner", + "Editor", + "Viewer" + ] } }, "example": { @@ -961,8 +1085,12 @@ } } ], - "consumes": ["application/json"], - "produces": ["application/json"] + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ] } }, "/accept_invitation": { @@ -993,7 +1121,10 @@ "in": "body", "schema": { "type": "object", - "required": ["projectID", "userID"], + "required": [ + "projectID", + "userID" + ], "properties": { "projectID": { "type": "string" @@ -1009,8 +1140,12 @@ } } ], - "consumes": ["application/json"], - "produces": ["application/json"] + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ] } }, "/decline_invitation": { @@ -1041,7 +1176,10 @@ "in": "body", "schema": { "type": "object", - "required": ["projectID", "userID"], + "required": [ + "projectID", + "userID" + ], "properties": { "projectID": { "type": "string" @@ -1057,8 +1195,12 @@ } } ], - "consumes": ["application/json"], - "produces": ["application/json"] + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ] } }, "/remove_invitation": { @@ -1089,7 +1231,10 @@ "in": "body", "schema": { "type": "object", - "required": ["projectID", "userID"], + "required": [ + "projectID", + "userID" + ], "properties": { "projectID": { "type": "string" @@ -1105,8 +1250,12 @@ } } ], - "consumes": ["application/json"], - "produces": ["application/json"] + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ] } }, "/leave_project": { @@ -1138,7 +1287,10 @@ "schema": { "type": "object", "properties": { - "required": ["projectID", "userID"], + "required": [ + "projectID", + "userID" + ], "projectID": { "type": "string" }, @@ -1153,8 +1305,12 @@ } } ], - "consumes": ["application/json"], - "produces": ["application/json"] + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ] } }, "/get_owner_projects": { @@ -1178,7 +1334,9 @@ } }, "parameters": [], - "produces": ["application/json"] + "produces": [ + "application/json" + ] } }, "/list_invitations_with_filters/{invitation_state}": { @@ -1208,10 +1366,17 @@ "description": "state of the invitation", "in": "path", "type": "string", - "enum": ["Accepted", "Pending", "Declined", "Exited"] + "enum": [ + "Accepted", + "Pending", + "Declined", + "Exited" + ] } ], - "produces": ["application/json"] + "produces": [ + "application/json" + ] } }, "/get_project_role/{project_id}": { @@ -1245,7 +1410,9 @@ "type": "string" } ], - "produces": ["application/json"] + "produces": [ + "application/json" + ] } }, "/get_project_members/{project_id}/{state}": { @@ -1306,10 +1473,16 @@ "description": "state of the invitation", "in": "path", "type": "string", - "enum": ["accepted", "not_accepted", "all"] + "enum": [ + "accepted", + "not_accepted", + "all" + ] } ], - "produces": ["application/json"] + "produces": [ + "application/json" + ] } }, "/invite_users/{project_id}": { @@ -1341,11 +1514,26 @@ "type": "string" } ], - "produces": ["application/json"] + "produces": [ + "application/json" + ] } } }, "definitions": { + "CapabilitiesResponse": { + "type": "object", + "properties": { + "dex": { + "type": "object", + "properties": { + "enabled": { + "type": "boolean" + } + } + } + } + }, "ErrorModel": { "type": "object", "properties": { @@ -1445,12 +1633,12 @@ } }, "RemoveApiTokenResponse": { - "type": "object", - "properties": { - "message": { - "type": "string" - } + "type": "object", + "properties": { + "message": { + "type": "string" } + } }, "ActionBy": { "type": "object", @@ -1468,7 +1656,12 @@ }, "User": { "type": "object", - "required": ["userID", "username", "role", "isRemoved"], + "required": [ + "userID", + "username", + "role", + "isRemoved" + ], "properties": { "userID": { "type": "string" @@ -1510,7 +1703,12 @@ }, "ProjectMember": { "type": "object", - "required": ["userID", "username", "invitation", "role"], + "required": [ + "userID", + "username", + "invitation", + "role" + ], "properties": { "userID": { "type": "string" @@ -1526,11 +1724,20 @@ }, "role": { "type": "string", - "enum": ["Owner", "Editor", "Viewer"] + "enum": [ + "Owner", + "Editor", + "Viewer" + ] }, "invitation": { "type": "string", - "enum": ["Accepted", "Pending", "Declined", "Exited"] + "enum": [ + "Accepted", + "Pending", + "Declined", + "Exited" + ] }, "joinedAt": { "type": "string" @@ -1554,7 +1761,11 @@ }, "invitationRole": { "type": "string", - "enum": ["Owner", "Editor", "Viewer"] + "enum": [ + "Owner", + "Editor", + "Viewer" + ] }, "projectOwner": { "$ref": "#/definitions/ProjectMember" @@ -1563,7 +1774,11 @@ }, "Project": { "type": "object", - "required": ["projectID", "name", "members"], + "required": [ + "projectID", + "name", + "members" + ], "properties": { "updatedBy": { "$ref": "#/definitions/ActionBy" @@ -1616,4 +1831,4 @@ ] } } -} +} \ No newline at end of file