diff --git a/README.md b/README.md index f066ea8e25..971e0b6124 100644 --- a/README.md +++ b/README.md @@ -37,7 +37,7 @@

- Documentation | + Documentation | Features | Values | Integration | @@ -144,12 +144,13 @@ Checkout the [integration docs](https://flipt.io/docs/integration/) for more inf Flipt is equipped with a fully functional REST API. In fact, the Flipt UI is completely backed by this same API. This means that anything that can be done in the Flipt UI can also be done via the REST API. -The [Flipt REST API](https://flipt.io/docs/api/) can also be used with any language that can make HTTP requests. +The [Flipt REST API](https://www.flipt.io/docs/reference/overview) can also be used with any language that can make HTTP requests. ### Official REST Client Libraries - [Node/TypeScript](https://github.com/flipt-io/flipt-node) - [Java](https://github.com/flipt-io/flipt-java) +- [Rust](https://github.com/flipt-io/flipt-rust) :exclamation: Offical REST clients in more languages coming soon. @@ -204,13 +205,9 @@ The server code is licensed under the [GPL 3.0 License](https://spdx.org/license See [LICENSE](LICENSE). -## Sponsors - -If you use Flipt at your company, please consider [becoming a sponsor](https://github.com/sponsors/markphelps) today. - ## Community -For help and discussion around Flipt, feature flag best practices, and more, join us on [Discord](https://discord.gg/kRhEqG2TEZ). +For help and discussion around Flipt, feature flag best practices, and more, join us on [Discord](https://www.flipt.io/discord). ## Feedback diff --git a/buf.gen.yaml b/buf.gen.yaml index 03f5f8c809..e59921f62f 100644 --- a/buf.gen.yaml +++ b/buf.gen.yaml @@ -17,8 +17,3 @@ plugins: - paths=source_relative - grpc_api_configuration=rpc/flipt/flipt.yaml strategy: all - - name: openapiv2 - out: swagger - opt: - - grpc_api_configuration=rpc/flipt/flipt.yaml - strategy: all diff --git a/codecov.yml b/codecov.yml index 3868696cc1..dac86e495d 100644 --- a/codecov.yml +++ b/codecov.yml @@ -3,5 +3,4 @@ ignore: - "rpc/flipt/flipt.pb.*" - "examples" - "ui" - - "swagger" - "_tools" diff --git a/internal/cmd/http.go b/internal/cmd/http.go index 188ae0be5c..3b565ffe52 100644 --- a/internal/cmd/http.go +++ b/internal/cmd/http.go @@ -19,7 +19,6 @@ import ( "go.flipt.io/flipt/internal/gateway" "go.flipt.io/flipt/internal/info" "go.flipt.io/flipt/rpc/flipt" - "go.flipt.io/flipt/swagger" "go.flipt.io/flipt/ui" "go.uber.org/zap" "google.golang.org/grpc" @@ -109,9 +108,6 @@ func NewHTTPServer( }) if cfg.UI.Enabled { - s := http.FS(swagger.Docs) - r.Mount("/docs", http.StripPrefix("/docs/", http.FileServer(s))) - u, err := fs.Sub(ui.UI, "dist") if err != nil { return nil, fmt.Errorf("mounting UI: %w", err) diff --git a/swagger/auth/auth.swagger.json b/swagger/auth/auth.swagger.json deleted file mode 100644 index 06b83c13ba..0000000000 --- a/swagger/auth/auth.swagger.json +++ /dev/null @@ -1,531 +0,0 @@ -{ - "swagger": "2.0", - "info": { - "title": "Flipt Authentication APIs", - "version": "latest", - "contact": { - "name": "Flipt Team", - "url": "https://github.com/flipt-io/flipt", - "email": "dev@flipt.io" - }, - "license": { - "name": "MIT License", - "url": "https://github.com/flipt-io/flipt/blob/main/rpc/flipt/LICENSE" - } - }, - "tags": [ - { - "name": "PublicAuthenticationService" - }, - { - "name": "AuthenticationService" - }, - { - "name": "AuthenticationMethodTokenService" - }, - { - "name": "AuthenticationMethodOIDCService" - } - ], - "schemes": [ - "http", - "https" - ], - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "paths": { - "/auth/v1/method": { - "get": { - "description": "List all available authentication methods", - "operationId": "list_authentication_methods", - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "$ref": "#/definitions/authListAuthenticationMethodsResponse" - } - }, - "401": { - "description": "Request could not be authenticated (authentication required).", - "schema": { - "$ref": "#/definitions/rpcStatus" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "$ref": "#/definitions/rpcStatus" - } - } - }, - "tags": [ - "authentication" - ] - } - }, - "/auth/v1/method/oidc/{provider}/authorize": { - "get": { - "description": "Generate OIDC authorize URL", - "operationId": "authorize_url", - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "$ref": "#/definitions/authAuthorizeURLResponse" - } - }, - "401": { - "description": "Request could not be authenticated (authentication required).", - "schema": { - "$ref": "#/definitions/rpcStatus" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "$ref": "#/definitions/rpcStatus" - } - } - }, - "parameters": [ - { - "name": "provider", - "in": "path", - "required": true, - "type": "string" - }, - { - "name": "state", - "in": "query", - "required": false, - "type": "string" - } - ], - "tags": [ - "authentication authentication_method oidc" - ] - } - }, - "/auth/v1/method/oidc/{provider}/callback": { - "get": { - "description": "OIDC callback operation", - "operationId": "callback", - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "$ref": "#/definitions/authCallbackResponse" - } - }, - "401": { - "description": "Request could not be authenticated (authentication required).", - "schema": { - "$ref": "#/definitions/rpcStatus" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "$ref": "#/definitions/rpcStatus" - } - } - }, - "parameters": [ - { - "name": "provider", - "in": "path", - "required": true, - "type": "string" - }, - { - "name": "code", - "in": "query", - "required": false, - "type": "string" - }, - { - "name": "state", - "in": "query", - "required": false, - "type": "string" - } - ], - "tags": [ - "authentication authentication_method oidc" - ] - } - }, - "/auth/v1/method/token": { - "post": { - "description": "Create authentication token", - "operationId": "create", - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "$ref": "#/definitions/authCreateTokenResponse" - } - }, - "401": { - "description": "Request could not be authenticated (authentication required).", - "schema": { - "$ref": "#/definitions/rpcStatus" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "$ref": "#/definitions/rpcStatus" - } - } - }, - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/authCreateTokenRequest" - } - } - ], - "tags": [ - "authentication authentication_method token" - ] - } - }, - "/auth/v1/self": { - "get": { - "description": "Get Authentication for current authenticated context", - "operationId": "get_self", - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "$ref": "#/definitions/authAuthentication" - } - }, - "401": { - "description": "Request could not be authenticated (authentication required).", - "schema": { - "$ref": "#/definitions/rpcStatus" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "$ref": "#/definitions/rpcStatus" - } - } - }, - "tags": [ - "authentication" - ] - } - }, - "/auth/v1/tokens": { - "get": { - "description": "List Authentication instances", - "operationId": "list_authentications", - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "$ref": "#/definitions/authListAuthenticationsResponse" - } - }, - "401": { - "description": "Request could not be authenticated (authentication required).", - "schema": { - "$ref": "#/definitions/rpcStatus" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "$ref": "#/definitions/rpcStatus" - } - } - }, - "parameters": [ - { - "name": "method", - "in": "query", - "required": false, - "type": "string", - "enum": [ - "METHOD_NONE", - "METHOD_TOKEN", - "METHOD_OIDC" - ], - "default": "METHOD_NONE" - }, - { - "name": "limit", - "in": "query", - "required": false, - "type": "integer", - "format": "int32" - }, - { - "name": "pageToken", - "in": "query", - "required": false, - "type": "string" - } - ], - "tags": [ - "authentication" - ] - } - }, - "/auth/v1/tokens/{id}": { - "get": { - "description": "Get Authentication by ID", - "operationId": "get_authentication", - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "$ref": "#/definitions/authAuthentication" - } - }, - "401": { - "description": "Request could not be authenticated (authentication required).", - "schema": { - "$ref": "#/definitions/rpcStatus" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "$ref": "#/definitions/rpcStatus" - } - } - }, - "parameters": [ - { - "name": "id", - "in": "path", - "required": true, - "type": "string" - } - ], - "tags": [ - "authentication" - ] - }, - "delete": { - "description": "Delete Authentication by ID", - "operationId": "delete_authentication", - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object", - "properties": {} - } - }, - "401": { - "description": "Request could not be authenticated (authentication required).", - "schema": { - "$ref": "#/definitions/rpcStatus" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "$ref": "#/definitions/rpcStatus" - } - } - }, - "parameters": [ - { - "name": "id", - "in": "path", - "required": true, - "type": "string" - } - ], - "tags": [ - "authentication" - ] - } - } - }, - "definitions": { - "authAuthentication": { - "type": "object", - "properties": { - "id": { - "type": "string" - }, - "method": { - "$ref": "#/definitions/authMethod" - }, - "expiresAt": { - "type": "string", - "format": "date-time" - }, - "createdAt": { - "type": "string", - "format": "date-time" - }, - "updatedAt": { - "type": "string", - "format": "date-time" - }, - "metadata": { - "type": "object", - "additionalProperties": { - "type": "string" - } - } - } - }, - "authAuthorizeURLResponse": { - "type": "object", - "properties": { - "authorizeUrl": { - "type": "string" - } - } - }, - "authCallbackResponse": { - "type": "object", - "properties": { - "clientToken": { - "type": "string" - }, - "authentication": { - "$ref": "#/definitions/authAuthentication" - } - } - }, - "authCreateTokenRequest": { - "type": "object", - "properties": { - "name": { - "type": "string" - }, - "description": { - "type": "string" - }, - "expiresAt": { - "type": "string", - "format": "date-time" - } - }, - "required": [ - "name", - "description" - ] - }, - "authCreateTokenResponse": { - "type": "object", - "properties": { - "clientToken": { - "type": "string" - }, - "authentication": { - "$ref": "#/definitions/authAuthentication" - } - } - }, - "authListAuthenticationMethodsResponse": { - "type": "object", - "properties": { - "methods": { - "type": "array", - "items": { - "$ref": "#/definitions/authMethodInfo" - } - } - } - }, - "authListAuthenticationsResponse": { - "type": "object", - "properties": { - "authentications": { - "type": "array", - "items": { - "$ref": "#/definitions/authAuthentication" - } - }, - "nextPageToken": { - "type": "string" - } - } - }, - "authMethod": { - "type": "string", - "enum": [ - "METHOD_NONE", - "METHOD_TOKEN", - "METHOD_OIDC" - ], - "default": "METHOD_NONE" - }, - "authMethodInfo": { - "type": "object", - "properties": { - "method": { - "$ref": "#/definitions/authMethod" - }, - "enabled": { - "type": "boolean" - }, - "sessionCompatible": { - "type": "boolean" - } - } - }, - "protobufAny": { - "type": "object", - "properties": { - "@type": { - "type": "string" - } - }, - "additionalProperties": {} - }, - "rpcStatus": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "format": "int32" - }, - "message": { - "type": "string" - }, - "details": { - "type": "array", - "items": { - "$ref": "#/definitions/protobufAny" - } - } - } - } - }, - "securityDefinitions": { - "ClientTokenBearer": { - "type": "apiKey", - "name": "Authorization", - "in": "header" - } - }, - "security": [ - { - "ClientTokenBearer": [] - } - ], - "externalDocs": { - "description": "Flipt Docs", - "url": "https://www.flipt.io/docs" - } -} diff --git a/swagger/embed.go b/swagger/embed.go deleted file mode 100644 index 44824ee6ce..0000000000 --- a/swagger/embed.go +++ /dev/null @@ -1,6 +0,0 @@ -package swagger - -import "embed" - -//go:embed flipt.swagger.json index.html -var Docs embed.FS diff --git a/swagger/flipt.swagger.json b/swagger/flipt.swagger.json deleted file mode 100644 index 902eceed4b..0000000000 --- a/swagger/flipt.swagger.json +++ /dev/null @@ -1,1852 +0,0 @@ -{ - "swagger": "2.0", - "info": { - "title": "Flipt API", - "version": "latest", - "contact": { - "name": "Flipt Team", - "url": "https://github.com/flipt-io/flipt", - "email": "dev@flipt.io" - }, - "license": { - "name": "MIT License", - "url": "https://github.com/flipt-io/flipt/blob/main/rpc/flipt/LICENSE" - } - }, - "tags": [ - { - "name": "Flipt" - } - ], - "schemes": [ - "http", - "https" - ], - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "paths": { - "/api/v1/batch-evaluate": { - "post": { - "description": "Batch Evaluate", - "operationId": "batchEvaluate", - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "$ref": "#/definitions/fliptBatchEvaluationResponse" - } - }, - "401": { - "description": "Request could not be authenticated (authentication required).", - "schema": { - "$ref": "#/definitions/rpcStatus" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "$ref": "#/definitions/rpcStatus" - } - } - }, - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/fliptBatchEvaluationRequest" - } - } - ], - "tags": [ - "evaluate" - ] - } - }, - "/api/v1/evaluate": { - "post": { - "description": "Evaluate", - "operationId": "evaluate", - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "$ref": "#/definitions/fliptEvaluationResponse" - } - }, - "401": { - "description": "Request could not be authenticated (authentication required).", - "schema": { - "$ref": "#/definitions/rpcStatus" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "$ref": "#/definitions/rpcStatus" - } - } - }, - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/fliptEvaluationRequest" - } - } - ], - "tags": [ - "evaluate" - ] - } - }, - "/api/v1/flags": { - "get": { - "description": "List Flags", - "operationId": "listFlags", - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "$ref": "#/definitions/fliptFlagList" - } - }, - "401": { - "description": "Request could not be authenticated (authentication required).", - "schema": { - "$ref": "#/definitions/rpcStatus" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "$ref": "#/definitions/rpcStatus" - } - } - }, - "parameters": [ - { - "name": "limit", - "in": "query", - "required": false, - "type": "integer", - "format": "int32" - }, - { - "name": "offset", - "in": "query", - "required": false, - "type": "integer", - "format": "int32" - }, - { - "name": "pageToken", - "in": "query", - "required": false, - "type": "string" - } - ], - "tags": [ - "flags" - ] - }, - "post": { - "description": "Create Flag", - "operationId": "createFlag", - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "$ref": "#/definitions/fliptFlag" - } - }, - "401": { - "description": "Request could not be authenticated (authentication required).", - "schema": { - "$ref": "#/definitions/rpcStatus" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "$ref": "#/definitions/rpcStatus" - } - } - }, - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/fliptCreateFlagRequest" - } - } - ], - "tags": [ - "flags" - ] - } - }, - "/api/v1/flags/{flagKey}/rules": { - "get": { - "description": "List Rules", - "operationId": "listRules", - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "$ref": "#/definitions/fliptRuleList" - } - }, - "401": { - "description": "Request could not be authenticated (authentication required).", - "schema": { - "$ref": "#/definitions/rpcStatus" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "$ref": "#/definitions/rpcStatus" - } - } - }, - "parameters": [ - { - "name": "flagKey", - "in": "path", - "required": true, - "type": "string" - }, - { - "name": "limit", - "in": "query", - "required": false, - "type": "integer", - "format": "int32" - }, - { - "name": "offset", - "in": "query", - "required": false, - "type": "integer", - "format": "int32" - }, - { - "name": "pageToken", - "in": "query", - "required": false, - "type": "string" - } - ], - "tags": [ - "rules" - ] - }, - "post": { - "description": "Create Rule", - "operationId": "createRule", - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "$ref": "#/definitions/fliptRule" - } - }, - "401": { - "description": "Request could not be authenticated (authentication required).", - "schema": { - "$ref": "#/definitions/rpcStatus" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "$ref": "#/definitions/rpcStatus" - } - } - }, - "parameters": [ - { - "name": "flagKey", - "in": "path", - "required": true, - "type": "string" - }, - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "type": "object", - "properties": { - "segmentKey": { - "type": "string" - }, - "rank": { - "type": "integer", - "format": "int32" - } - }, - "required": [ - "segmentKey", - "rank" - ] - } - } - ], - "tags": [ - "rules" - ] - } - }, - "/api/v1/flags/{flagKey}/rules/order": { - "put": { - "description": "Order Rules", - "operationId": "orderRules", - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object", - "properties": {} - } - }, - "401": { - "description": "Request could not be authenticated (authentication required).", - "schema": { - "$ref": "#/definitions/rpcStatus" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "$ref": "#/definitions/rpcStatus" - } - } - }, - "parameters": [ - { - "name": "flagKey", - "in": "path", - "required": true, - "type": "string" - }, - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "type": "object", - "properties": { - "ruleIds": { - "type": "array", - "items": { - "type": "string" - } - } - }, - "required": [ - "ruleIds" - ] - } - } - ], - "tags": [ - "rules" - ] - } - }, - "/api/v1/flags/{flagKey}/rules/{id}": { - "get": { - "description": "Get Rule", - "operationId": "getRule", - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "$ref": "#/definitions/fliptRule" - } - }, - "401": { - "description": "Request could not be authenticated (authentication required).", - "schema": { - "$ref": "#/definitions/rpcStatus" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "$ref": "#/definitions/rpcStatus" - } - } - }, - "parameters": [ - { - "name": "flagKey", - "in": "path", - "required": true, - "type": "string" - }, - { - "name": "id", - "in": "path", - "required": true, - "type": "string" - } - ], - "tags": [ - "rules" - ] - }, - "delete": { - "description": "Delete Rule", - "operationId": "deleteRule", - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object", - "properties": {} - } - }, - "401": { - "description": "Request could not be authenticated (authentication required).", - "schema": { - "$ref": "#/definitions/rpcStatus" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "$ref": "#/definitions/rpcStatus" - } - } - }, - "parameters": [ - { - "name": "flagKey", - "in": "path", - "required": true, - "type": "string" - }, - { - "name": "id", - "in": "path", - "required": true, - "type": "string" - } - ], - "tags": [ - "rules" - ] - }, - "put": { - "description": "Update Rule", - "operationId": "updateRule", - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "$ref": "#/definitions/fliptRule" - } - }, - "401": { - "description": "Request could not be authenticated (authentication required).", - "schema": { - "$ref": "#/definitions/rpcStatus" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "$ref": "#/definitions/rpcStatus" - } - } - }, - "parameters": [ - { - "name": "flagKey", - "in": "path", - "required": true, - "type": "string" - }, - { - "name": "id", - "in": "path", - "required": true, - "type": "string" - }, - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "type": "object", - "properties": { - "segmentKey": { - "type": "string" - } - }, - "required": [ - "segmentKey" - ] - } - } - ], - "tags": [ - "rules" - ] - } - }, - "/api/v1/flags/{flagKey}/rules/{ruleId}/distributions": { - "post": { - "description": "Create Distribution", - "operationId": "createDistribution", - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "$ref": "#/definitions/fliptDistribution" - } - }, - "401": { - "description": "Request could not be authenticated (authentication required).", - "schema": { - "$ref": "#/definitions/rpcStatus" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "$ref": "#/definitions/rpcStatus" - } - } - }, - "parameters": [ - { - "name": "flagKey", - "in": "path", - "required": true, - "type": "string" - }, - { - "name": "ruleId", - "in": "path", - "required": true, - "type": "string" - }, - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "type": "object", - "properties": { - "variantId": { - "type": "string" - }, - "rollout": { - "type": "number", - "format": "float" - } - }, - "required": [ - "variantId", - "rollout" - ] - } - } - ], - "tags": [ - "distributions" - ] - } - }, - "/api/v1/flags/{flagKey}/rules/{ruleId}/distributions/{id}": { - "delete": { - "description": "Delete Distribution", - "operationId": "deleteDistribution", - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object", - "properties": {} - } - }, - "401": { - "description": "Request could not be authenticated (authentication required).", - "schema": { - "$ref": "#/definitions/rpcStatus" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "$ref": "#/definitions/rpcStatus" - } - } - }, - "parameters": [ - { - "name": "flagKey", - "in": "path", - "required": true, - "type": "string" - }, - { - "name": "ruleId", - "in": "path", - "required": true, - "type": "string" - }, - { - "name": "id", - "in": "path", - "required": true, - "type": "string" - }, - { - "name": "variantId", - "in": "query", - "required": true, - "type": "string" - } - ], - "tags": [ - "distributions" - ] - }, - "put": { - "description": "Update Distribution", - "operationId": "updateDistribution", - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "$ref": "#/definitions/fliptDistribution" - } - }, - "401": { - "description": "Request could not be authenticated (authentication required).", - "schema": { - "$ref": "#/definitions/rpcStatus" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "$ref": "#/definitions/rpcStatus" - } - } - }, - "parameters": [ - { - "name": "flagKey", - "in": "path", - "required": true, - "type": "string" - }, - { - "name": "ruleId", - "in": "path", - "required": true, - "type": "string" - }, - { - "name": "id", - "in": "path", - "required": true, - "type": "string" - }, - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "type": "object", - "properties": { - "variantId": { - "type": "string" - }, - "rollout": { - "type": "number", - "format": "float" - } - }, - "required": [ - "variantId", - "rollout" - ] - } - } - ], - "tags": [ - "distributions" - ] - } - }, - "/api/v1/flags/{flagKey}/variants": { - "post": { - "description": "Create Variant", - "operationId": "createVariant", - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "$ref": "#/definitions/fliptVariant" - } - }, - "401": { - "description": "Request could not be authenticated (authentication required).", - "schema": { - "$ref": "#/definitions/rpcStatus" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "$ref": "#/definitions/rpcStatus" - } - } - }, - "parameters": [ - { - "name": "flagKey", - "in": "path", - "required": true, - "type": "string" - }, - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "type": "object", - "properties": { - "key": { - "type": "string" - }, - "name": { - "type": "string" - }, - "description": { - "type": "string" - }, - "attachment": { - "type": "string" - } - }, - "required": [ - "key" - ] - } - } - ], - "tags": [ - "variants" - ] - } - }, - "/api/v1/flags/{flagKey}/variants/{id}": { - "delete": { - "description": "Delete Variant", - "operationId": "deleteVariant", - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object", - "properties": {} - } - }, - "401": { - "description": "Request could not be authenticated (authentication required).", - "schema": { - "$ref": "#/definitions/rpcStatus" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "$ref": "#/definitions/rpcStatus" - } - } - }, - "parameters": [ - { - "name": "flagKey", - "in": "path", - "required": true, - "type": "string" - }, - { - "name": "id", - "in": "path", - "required": true, - "type": "string" - } - ], - "tags": [ - "variants" - ] - }, - "put": { - "description": "Update Variant", - "operationId": "updateVariant", - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "$ref": "#/definitions/fliptVariant" - } - }, - "401": { - "description": "Request could not be authenticated (authentication required).", - "schema": { - "$ref": "#/definitions/rpcStatus" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "$ref": "#/definitions/rpcStatus" - } - } - }, - "parameters": [ - { - "name": "flagKey", - "in": "path", - "required": true, - "type": "string" - }, - { - "name": "id", - "in": "path", - "required": true, - "type": "string" - }, - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "type": "object", - "properties": { - "key": { - "type": "string" - }, - "name": { - "type": "string" - }, - "description": { - "type": "string" - }, - "attachment": { - "type": "string" - } - }, - "required": [ - "key" - ] - } - } - ], - "tags": [ - "variants" - ] - } - }, - "/api/v1/flags/{key}": { - "get": { - "description": "Get Flag", - "operationId": "getFlag", - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "$ref": "#/definitions/fliptFlag" - } - }, - "401": { - "description": "Request could not be authenticated (authentication required).", - "schema": { - "$ref": "#/definitions/rpcStatus" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "$ref": "#/definitions/rpcStatus" - } - } - }, - "parameters": [ - { - "name": "key", - "in": "path", - "required": true, - "type": "string" - } - ], - "tags": [ - "flags" - ] - }, - "delete": { - "description": "Delete Flag", - "operationId": "deleteFlag", - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object", - "properties": {} - } - }, - "401": { - "description": "Request could not be authenticated (authentication required).", - "schema": { - "$ref": "#/definitions/rpcStatus" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "$ref": "#/definitions/rpcStatus" - } - } - }, - "parameters": [ - { - "name": "key", - "in": "path", - "required": true, - "type": "string" - } - ], - "tags": [ - "flags" - ] - }, - "put": { - "description": "Update Flag", - "operationId": "updateFlag", - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "$ref": "#/definitions/fliptFlag" - } - }, - "401": { - "description": "Request could not be authenticated (authentication required).", - "schema": { - "$ref": "#/definitions/rpcStatus" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "$ref": "#/definitions/rpcStatus" - } - } - }, - "parameters": [ - { - "name": "key", - "in": "path", - "required": true, - "type": "string" - }, - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "type": "object", - "properties": { - "name": { - "type": "string" - }, - "description": { - "type": "string" - }, - "enabled": { - "type": "boolean" - } - }, - "required": [ - "name" - ] - } - } - ], - "tags": [ - "flags" - ] - } - }, - "/api/v1/segments": { - "get": { - "description": "List Segments", - "operationId": "listSegments", - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "$ref": "#/definitions/fliptSegmentList" - } - }, - "401": { - "description": "Request could not be authenticated (authentication required).", - "schema": { - "$ref": "#/definitions/rpcStatus" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "$ref": "#/definitions/rpcStatus" - } - } - }, - "parameters": [ - { - "name": "limit", - "in": "query", - "required": false, - "type": "integer", - "format": "int32" - }, - { - "name": "offset", - "in": "query", - "required": false, - "type": "integer", - "format": "int32" - }, - { - "name": "pageToken", - "in": "query", - "required": false, - "type": "string" - } - ], - "tags": [ - "segments" - ] - }, - "post": { - "description": "Create Segment", - "operationId": "createSegment", - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "$ref": "#/definitions/fliptSegment" - } - }, - "401": { - "description": "Request could not be authenticated (authentication required).", - "schema": { - "$ref": "#/definitions/rpcStatus" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "$ref": "#/definitions/rpcStatus" - } - } - }, - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/fliptCreateSegmentRequest" - } - } - ], - "tags": [ - "segments" - ] - } - }, - "/api/v1/segments/{key}": { - "get": { - "description": "Get Segment", - "operationId": "getSegment", - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "$ref": "#/definitions/fliptSegment" - } - }, - "401": { - "description": "Request could not be authenticated (authentication required).", - "schema": { - "$ref": "#/definitions/rpcStatus" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "$ref": "#/definitions/rpcStatus" - } - } - }, - "parameters": [ - { - "name": "key", - "in": "path", - "required": true, - "type": "string" - } - ], - "tags": [ - "segments" - ] - }, - "delete": { - "description": "Delete Segment", - "operationId": "deleteSegment", - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object", - "properties": {} - } - }, - "401": { - "description": "Request could not be authenticated (authentication required).", - "schema": { - "$ref": "#/definitions/rpcStatus" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "$ref": "#/definitions/rpcStatus" - } - } - }, - "parameters": [ - { - "name": "key", - "in": "path", - "required": true, - "type": "string" - } - ], - "tags": [ - "segments" - ] - }, - "put": { - "description": "Update Segment", - "operationId": "updateSegment", - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "$ref": "#/definitions/fliptSegment" - } - }, - "401": { - "description": "Request could not be authenticated (authentication required).", - "schema": { - "$ref": "#/definitions/rpcStatus" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "$ref": "#/definitions/rpcStatus" - } - } - }, - "parameters": [ - { - "name": "key", - "in": "path", - "required": true, - "type": "string" - }, - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "type": "object", - "properties": { - "name": { - "type": "string" - }, - "description": { - "type": "string" - }, - "matchType": { - "$ref": "#/definitions/fliptMatchType" - } - }, - "required": [ - "name" - ] - } - } - ], - "tags": [ - "segments" - ] - } - }, - "/api/v1/segments/{segmentKey}/constraints": { - "post": { - "description": "Create Constraint", - "operationId": "createConstraint", - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "$ref": "#/definitions/fliptConstraint" - } - }, - "401": { - "description": "Request could not be authenticated (authentication required).", - "schema": { - "$ref": "#/definitions/rpcStatus" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "$ref": "#/definitions/rpcStatus" - } - } - }, - "parameters": [ - { - "name": "segmentKey", - "in": "path", - "required": true, - "type": "string" - }, - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "type": "object", - "properties": { - "type": { - "$ref": "#/definitions/fliptComparisonType" - }, - "property": { - "type": "string" - }, - "operator": { - "type": "string" - }, - "value": { - "type": "string" - } - }, - "required": [ - "type", - "property", - "operator" - ] - } - } - ], - "tags": [ - "constraints" - ] - } - }, - "/api/v1/segments/{segmentKey}/constraints/{id}": { - "delete": { - "description": "Delete Constraint", - "operationId": "deleteConstraint", - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object", - "properties": {} - } - }, - "401": { - "description": "Request could not be authenticated (authentication required).", - "schema": { - "$ref": "#/definitions/rpcStatus" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "$ref": "#/definitions/rpcStatus" - } - } - }, - "parameters": [ - { - "name": "segmentKey", - "in": "path", - "required": true, - "type": "string" - }, - { - "name": "id", - "in": "path", - "required": true, - "type": "string" - } - ], - "tags": [ - "constraints" - ] - }, - "put": { - "description": "Update Constraint", - "operationId": "updateConstraint", - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "$ref": "#/definitions/fliptConstraint" - } - }, - "401": { - "description": "Request could not be authenticated (authentication required).", - "schema": { - "$ref": "#/definitions/rpcStatus" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "$ref": "#/definitions/rpcStatus" - } - } - }, - "parameters": [ - { - "name": "segmentKey", - "in": "path", - "required": true, - "type": "string" - }, - { - "name": "id", - "in": "path", - "required": true, - "type": "string" - }, - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "type": "object", - "properties": { - "type": { - "$ref": "#/definitions/fliptComparisonType" - }, - "property": { - "type": "string" - }, - "operator": { - "type": "string" - }, - "value": { - "type": "string" - } - }, - "required": [ - "type", - "property", - "operator" - ] - } - } - ], - "tags": [ - "constraints" - ] - } - } - }, - "definitions": { - "fliptBatchEvaluationRequest": { - "type": "object", - "properties": { - "requestId": { - "type": "string" - }, - "requests": { - "type": "array", - "items": { - "$ref": "#/definitions/fliptEvaluationRequest" - } - }, - "excludeNotFound": { - "type": "boolean" - } - }, - "required": [ - "requests" - ] - }, - "fliptBatchEvaluationResponse": { - "type": "object", - "properties": { - "requestId": { - "type": "string" - }, - "responses": { - "type": "array", - "items": { - "$ref": "#/definitions/fliptEvaluationResponse" - } - }, - "requestDurationMillis": { - "type": "number", - "format": "double" - } - } - }, - "fliptComparisonType": { - "type": "string", - "enum": [ - "UNKNOWN_COMPARISON_TYPE", - "STRING_COMPARISON_TYPE", - "NUMBER_COMPARISON_TYPE", - "BOOLEAN_COMPARISON_TYPE" - ], - "default": "UNKNOWN_COMPARISON_TYPE" - }, - "fliptConstraint": { - "type": "object", - "properties": { - "id": { - "type": "string" - }, - "segmentKey": { - "type": "string" - }, - "type": { - "$ref": "#/definitions/fliptComparisonType" - }, - "property": { - "type": "string" - }, - "operator": { - "type": "string" - }, - "value": { - "type": "string" - }, - "createdAt": { - "type": "string", - "format": "date-time" - }, - "updatedAt": { - "type": "string", - "format": "date-time" - } - } - }, - "fliptCreateFlagRequest": { - "type": "object", - "properties": { - "key": { - "type": "string" - }, - "name": { - "type": "string" - }, - "description": { - "type": "string" - }, - "enabled": { - "type": "boolean" - } - }, - "required": [ - "key", - "name" - ] - }, - "fliptCreateSegmentRequest": { - "type": "object", - "properties": { - "key": { - "type": "string" - }, - "name": { - "type": "string" - }, - "description": { - "type": "string" - }, - "matchType": { - "$ref": "#/definitions/fliptMatchType" - } - }, - "required": [ - "key", - "name" - ] - }, - "fliptDistribution": { - "type": "object", - "properties": { - "id": { - "type": "string" - }, - "ruleId": { - "type": "string" - }, - "variantId": { - "type": "string" - }, - "rollout": { - "type": "number", - "format": "float" - }, - "createdAt": { - "type": "string", - "format": "date-time" - }, - "updatedAt": { - "type": "string", - "format": "date-time" - } - } - }, - "fliptEvaluationReason": { - "type": "string", - "enum": [ - "UNKNOWN_EVALUATION_REASON", - "FLAG_DISABLED_EVALUATION_REASON", - "FLAG_NOT_FOUND_EVALUATION_REASON", - "MATCH_EVALUATION_REASON", - "ERROR_EVALUATION_REASON" - ], - "default": "UNKNOWN_EVALUATION_REASON" - }, - "fliptEvaluationRequest": { - "type": "object", - "properties": { - "requestId": { - "type": "string" - }, - "flagKey": { - "type": "string" - }, - "entityId": { - "type": "string" - }, - "context": { - "type": "object", - "additionalProperties": { - "type": "string" - } - } - }, - "required": [ - "flagKey", - "entityId" - ] - }, - "fliptEvaluationResponse": { - "type": "object", - "properties": { - "requestId": { - "type": "string" - }, - "entityId": { - "type": "string" - }, - "requestContext": { - "type": "object", - "additionalProperties": { - "type": "string" - } - }, - "match": { - "type": "boolean" - }, - "flagKey": { - "type": "string" - }, - "segmentKey": { - "type": "string" - }, - "timestamp": { - "type": "string", - "format": "date-time" - }, - "value": { - "type": "string" - }, - "requestDurationMillis": { - "type": "number", - "format": "double" - }, - "attachment": { - "type": "string" - }, - "reason": { - "$ref": "#/definitions/fliptEvaluationReason" - } - } - }, - "fliptFlag": { - "type": "object", - "properties": { - "key": { - "type": "string" - }, - "name": { - "type": "string" - }, - "description": { - "type": "string" - }, - "enabled": { - "type": "boolean" - }, - "createdAt": { - "type": "string", - "format": "date-time" - }, - "updatedAt": { - "type": "string", - "format": "date-time" - }, - "variants": { - "type": "array", - "items": { - "$ref": "#/definitions/fliptVariant" - } - } - } - }, - "fliptFlagList": { - "type": "object", - "properties": { - "flags": { - "type": "array", - "items": { - "$ref": "#/definitions/fliptFlag" - } - }, - "nextPageToken": { - "type": "string" - }, - "totalCount": { - "type": "integer", - "format": "int32" - } - } - }, - "fliptMatchType": { - "type": "string", - "enum": [ - "ALL_MATCH_TYPE", - "ANY_MATCH_TYPE" - ], - "default": "ALL_MATCH_TYPE" - }, - "fliptRule": { - "type": "object", - "properties": { - "id": { - "type": "string" - }, - "flagKey": { - "type": "string" - }, - "segmentKey": { - "type": "string" - }, - "distributions": { - "type": "array", - "items": { - "$ref": "#/definitions/fliptDistribution" - } - }, - "rank": { - "type": "integer", - "format": "int32" - }, - "createdAt": { - "type": "string", - "format": "date-time" - }, - "updatedAt": { - "type": "string", - "format": "date-time" - } - } - }, - "fliptRuleList": { - "type": "object", - "properties": { - "rules": { - "type": "array", - "items": { - "$ref": "#/definitions/fliptRule" - } - }, - "nextPageToken": { - "type": "string" - }, - "totalCount": { - "type": "integer", - "format": "int32" - } - } - }, - "fliptSegment": { - "type": "object", - "properties": { - "key": { - "type": "string" - }, - "name": { - "type": "string" - }, - "description": { - "type": "string" - }, - "createdAt": { - "type": "string", - "format": "date-time" - }, - "updatedAt": { - "type": "string", - "format": "date-time" - }, - "constraints": { - "type": "array", - "items": { - "$ref": "#/definitions/fliptConstraint" - } - }, - "matchType": { - "$ref": "#/definitions/fliptMatchType" - } - } - }, - "fliptSegmentList": { - "type": "object", - "properties": { - "segments": { - "type": "array", - "items": { - "$ref": "#/definitions/fliptSegment" - } - }, - "nextPageToken": { - "type": "string" - }, - "totalCount": { - "type": "integer", - "format": "int32" - } - } - }, - "fliptVariant": { - "type": "object", - "properties": { - "id": { - "type": "string" - }, - "flagKey": { - "type": "string" - }, - "key": { - "type": "string" - }, - "name": { - "type": "string" - }, - "description": { - "type": "string" - }, - "createdAt": { - "type": "string", - "format": "date-time" - }, - "updatedAt": { - "type": "string", - "format": "date-time" - }, - "attachment": { - "type": "string" - } - } - }, - "protobufAny": { - "type": "object", - "properties": { - "@type": { - "type": "string" - } - }, - "additionalProperties": {} - }, - "rpcStatus": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "format": "int32" - }, - "message": { - "type": "string" - }, - "details": { - "type": "array", - "items": { - "$ref": "#/definitions/protobufAny" - } - } - } - } - }, - "securityDefinitions": { - "ClientTokenBearer": { - "type": "apiKey", - "name": "Authorization", - "in": "header" - } - }, - "security": [ - { - "ClientTokenBearer": [] - } - ], - "externalDocs": { - "description": "Flipt Docs", - "url": "https://www.flipt.io/docs" - } -} diff --git a/swagger/index.html b/swagger/index.html deleted file mode 100644 index e32261fc81..0000000000 --- a/swagger/index.html +++ /dev/null @@ -1,18 +0,0 @@ - - - - Flipt API - - - - - - - - - diff --git a/ui/src/components/Nav.vue b/ui/src/components/Nav.vue index b6d2d4daf3..91c50a0deb 100644 --- a/ui/src/components/Nav.vue +++ b/ui/src/components/Nav.vue @@ -47,7 +47,7 @@ API { "/api": `http://${host}:${port}`, "/auth": `http://${host}:${port}`, "/meta": `http://${host}:${port}`, - "/docs": `http://${host}:${port}`, }, }, };