From 54948fec32dea4fb3c2972266987693767182c08 Mon Sep 17 00:00:00 2001 From: Mark Phelps <209477+markphelps@users.noreply.github.com> Date: Wed, 7 Aug 2024 15:23:42 -0400 Subject: [PATCH] chore: use openapi doc from Flipt repo; add OFREP docs Signed-off-by: Mark Phelps <209477+markphelps@users.noreply.github.com> --- integration/openfeature.mdx | 12 + mint.json | 9 + openapi.yaml | 2225 --------------------- reference/openfeature/configuration.mdx | 14 + reference/openfeature/flag-evaluation.mdx | 19 + reference/openfeature/overview.mdx | 28 + reference/overview.mdx | 2 +- 7 files changed, 83 insertions(+), 2226 deletions(-) delete mode 100644 openapi.yaml create mode 100644 reference/openfeature/configuration.mdx create mode 100644 reference/openfeature/flag-evaluation.mdx create mode 100644 reference/openfeature/overview.mdx diff --git a/integration/openfeature.mdx b/integration/openfeature.mdx index 9511020..1921d2f 100644 --- a/integration/openfeature.mdx +++ b/integration/openfeature.mdx @@ -77,3 +77,15 @@ We currently provide the following OpenFeature providers: > Need a client in another language? Let us know! + +## Remote Evaluation Protocol + +The OpenFeature Remote Evaluation Protocol (OFREP) is an API specification for feature flagging that allows the use of generic providers to connect to any feature flag management systems that support the protocol. + +Flipt is one of the early adopters of the OFREP protocol and has implemented the protocol in its API. + +The OFREP protocol is still in the early stages of development, so the specification is subject to change. + +The API documentation for the OFREP protocol implementation in Flipt is available in the [OpenFeature Remote Evaluation](/reference/openfeature/overview) API documentation. + +For more information on the OFREP protocol, see the [OpenFeature Remote Evaluation Protocol](https://github.com/open-feature/protocol) repository on GitHub. \ No newline at end of file diff --git a/mint.json b/mint.json index 32ba530..31275a6 100644 --- a/mint.json +++ b/mint.json @@ -14,6 +14,7 @@ "mode": "simple" } }, + "openapi": "https://raw.githubusercontent.com/flipt-io/flipt/main/openapi.yaml", "favicon": "/favicon.svg", "colors": { "primary": "#7C3AED", @@ -307,6 +308,14 @@ "reference/evaluation/batch-evaluation" ] }, + { + "group": "OpenFeature Evaluation", + "pages": [ + "reference/openfeature/overview", + "reference/openfeature/configuration", + "reference/openfeature/flag-evaluation" + ] + }, { "group": "Namespaces", "pages": [ diff --git a/openapi.yaml b/openapi.yaml deleted file mode 100644 index a7127f0..0000000 --- a/openapi.yaml +++ /dev/null @@ -1,2225 +0,0 @@ -openapi: 3.0.1 -info: - title: api - version: 1.46.0 -paths: - /evaluate/v1/boolean: - post: - operationId: EvaluationService.boolean - tags: - - EvaluationService - parameters: [] - responses: - "200": - description: "" - content: - application/json: - schema: - $ref: "#/components/schemas/BooleanEvaluationResponse" - security: &ref_0 - - BearerAuth: [] - requestBody: - required: true - content: - application/json: - schema: - $ref: "#/components/schemas/EvaluationRequest" - /evaluate/v1/variant: - post: - operationId: EvaluationService.variant - tags: - - EvaluationService - parameters: [] - responses: - "200": - description: "" - content: - application/json: - schema: - $ref: "#/components/schemas/VariantEvaluationResponse" - security: *ref_0 - requestBody: - required: true - content: - application/json: - schema: - $ref: "#/components/schemas/EvaluationRequest" - /evaluate/v1/batch: - post: - operationId: EvaluationService.batch - tags: - - EvaluationService - parameters: [] - responses: - "200": - description: "" - content: - application/json: - schema: - $ref: "#/components/schemas/BatchEvaluationResponse" - security: *ref_0 - requestBody: - required: true - content: - application/json: - schema: - $ref: "#/components/schemas/BatchEvaluationRequest" - /auth/v1/method/kubernetes/serviceaccount: - post: - operationId: AuthMethodK8SService.verifyServiceAccount - tags: - - AuthMethodK8SService - parameters: [] - responses: - "200": - description: "" - content: - application/json: - schema: - $ref: "#/components/schemas/AuthenticationToken" - requestBody: - required: true - content: - application/json: - schema: - type: object - properties: - serviceAccountToken: - type: string - required: - - serviceAccountToken - /auth/v1/method/oidc/{provider}/authorize: - get: - operationId: AuthMethodOIDCService.authorizeURL - tags: - - AuthMethodOIDCService - parameters: - - name: provider - in: path - required: true - schema: - type: string - - name: state - in: query - required: true - schema: - type: string - responses: - "200": - description: "" - content: - application/json: - schema: - $ref: "#/components/schemas/AuthMethodOIDCAuthorizeURLResponse" - /auth/v1/method/oidc/{provider}/callback: - get: - operationId: AuthMethodOIDCService.callback - tags: - - AuthMethodOIDCService - parameters: - - name: provider - in: path - required: true - schema: - type: string - - name: code - in: query - required: true - schema: - type: string - - name: state - in: query - required: true - schema: - type: string - responses: - "200": - description: "" - content: - application/json: - schema: - $ref: "#/components/schemas/AuthMethodOIDCCallbackResponse" - /auth/v1/method/token: - post: - operationId: AuthMethodTokenService.createToken - tags: - - AuthMethodTokenService - parameters: [] - responses: - "200": - description: "" - content: - application/json: - schema: - $ref: "#/components/schemas/AuthenticationToken" - security: *ref_0 - requestBody: - required: true - content: - application/json: - schema: - type: object - properties: - name: - type: string - namespaceKey: - type: string - description: - type: string - expiresAt: - type: string - format: date-time - required: - - name - - description - /auth/v1/tokens: - get: - operationId: AuthService.listTokens - tags: - - AuthService - parameters: [] - responses: - "200": - description: "" - content: - application/json: - schema: - $ref: "#/components/schemas/AuthenticationList" - security: *ref_0 - /auth/v1/tokens/{id}: - get: - operationId: AuthService.getToken - tags: - - AuthService - parameters: - - name: id - in: path - required: true - schema: - type: string - responses: - "200": - description: "" - content: - application/json: - schema: - $ref: "#/components/schemas/Authentication" - security: *ref_0 - delete: - operationId: AuthService.deleteToken - tags: - - AuthService - parameters: - - name: id - in: path - required: true - schema: - type: string - responses: - "204": - description: "" - security: *ref_0 - /auth/v1/self: - get: - operationId: AuthService.getSelf - tags: - - AuthService - parameters: [] - responses: - "200": - description: "" - content: - application/json: - schema: - $ref: "#/components/schemas/Authentication" - security: *ref_0 - /auth/v1/self/expire: - put: - operationId: AuthService.expireSelf - tags: - - AuthService - parameters: [] - responses: - "204": - description: "" - security: *ref_0 - requestBody: - required: true - content: - application/json: - schema: - type: object - properties: - expiresAt: - type: string - format: date-time - /api/v1/namespaces/{namespaceKey}/segments/{segmentKey}/constraints: - post: - operationId: ConstraintsService.create - tags: - - ConstraintsService - parameters: - - name: namespaceKey - in: path - required: true - schema: - type: string - - name: segmentKey - in: path - required: true - schema: - type: string - responses: - "200": - description: "" - content: - application/json: - schema: - $ref: "#/components/schemas/Constraint" - security: *ref_0 - requestBody: - required: true - content: - application/json: - schema: - $ref: "#/components/schemas/ConstraintCreateRequest" - /api/v1/namespaces/{namespaceKey}/segments/{segmentKey}/constraints/{id}: - delete: - operationId: ConstraintsService.delete - tags: - - ConstraintsService - parameters: - - name: namespaceKey - in: path - required: true - schema: - type: string - - name: segmentKey - in: path - required: true - schema: - type: string - - name: id - in: path - required: true - schema: - type: string - responses: - "204": - description: "" - security: *ref_0 - put: - operationId: ConstraintsService.update - tags: - - ConstraintsService - parameters: - - name: namespaceKey - in: path - required: true - schema: - type: string - - name: segmentKey - in: path - required: true - schema: - type: string - - name: id - in: path - required: true - schema: - type: string - responses: - "204": - description: "" - security: *ref_0 - requestBody: - required: true - content: - application/json: - schema: - $ref: "#/components/schemas/ConstraintUpdateRequest" - /api/v1/namespaces/{namespaceKey}/flags/{flagKey}/rules/{ruleId}/distributions: - post: - operationId: DistributionsService.create - tags: - - DistributionsService - parameters: - - name: namespaceKey - in: path - required: true - schema: - type: string - - name: flagKey - in: path - required: true - schema: - type: string - - name: ruleId - in: path - required: true - schema: - type: string - responses: - "200": - description: "" - content: - application/json: - schema: - $ref: "#/components/schemas/Distribution" - security: *ref_0 - requestBody: - required: true - content: - application/json: - schema: - $ref: "#/components/schemas/DistributionCreateRequest" - /api/v1/namespaces/{namespaceKey}/flags/{flagKey}/rules/{ruleId}/distributions/{id}: - delete: - operationId: DistributionsService.delete - tags: - - DistributionsService - parameters: - - name: namespaceKey - in: path - required: true - schema: - type: string - - name: flagKey - in: path - required: true - schema: - type: string - - name: ruleId - in: path - required: true - schema: - type: string - - name: id - in: path - required: true - schema: - type: string - - name: variantId - in: query - required: true - schema: - type: string - responses: - "204": - description: "" - security: *ref_0 - put: - operationId: DistributionsService.update - tags: - - DistributionsService - parameters: - - name: namespaceKey - in: path - required: true - schema: - type: string - - name: flagKey - in: path - required: true - schema: - type: string - - name: ruleId - in: path - required: true - schema: - type: string - - name: id - in: path - required: true - schema: - type: string - responses: - "200": - description: "" - content: - application/json: - schema: - $ref: "#/components/schemas/Distribution" - security: *ref_0 - requestBody: - required: true - content: - application/json: - schema: - $ref: "#/components/schemas/DistributionUpdateRequest" - /api/v1/namespaces/{namespaceKey}/evaluate: - post: - operationId: EvaluateService.evaluate - tags: - - EvaluateService - parameters: - - name: namespaceKey - in: path - required: true - schema: - type: string - responses: - "200": - description: "" - content: - application/json: - schema: - $ref: "#/components/schemas/EvaluationResponse" - security: *ref_0 - requestBody: - required: true - content: - application/json: - schema: - $ref: "#/components/schemas/EvaluationRequest" - /api/v1/namespaces/{namespaceKey}/batch-evaluate: - post: - operationId: EvaluateService.batchEvaluate - tags: - - EvaluateService - parameters: - - name: namespaceKey - in: path - required: true - schema: - type: string - responses: - "200": - description: "" - content: - application/json: - schema: - $ref: "#/components/schemas/BatchEvaluationResponse" - security: *ref_0 - requestBody: - required: true - content: - application/json: - schema: - $ref: "#/components/schemas/BatchEvaluationRequest" - /api/v1/namespaces/{namespaceKey}/flags: - get: - operationId: FlagsService.list - tags: - - FlagsService - parameters: - - name: namespaceKey - in: path - required: true - schema: - type: string - - name: limit - in: query - required: false - schema: - type: integer - - name: offset - in: query - required: false - schema: - type: integer - - name: pageToken - in: query - required: false - schema: - type: string - - name: reference - in: query - required: false - schema: - type: string - responses: - "200": - description: "" - content: - application/json: - schema: - $ref: "#/components/schemas/FlagList" - security: *ref_0 - post: - operationId: FlagsService.create - tags: - - FlagsService - parameters: - - name: namespaceKey - in: path - required: true - schema: - type: string - responses: - "200": - description: "" - content: - application/json: - schema: - $ref: "#/components/schemas/Flag" - security: *ref_0 - requestBody: - required: true - content: - application/json: - schema: - $ref: "#/components/schemas/FlagCreateRequest" - /api/v1/namespaces/{namespaceKey}/flags/{key}: - get: - operationId: FlagsService.get - tags: - - FlagsService - parameters: - - name: namespaceKey - in: path - required: true - schema: - type: string - - name: key - in: path - required: true - schema: - type: string - - name: reference - in: query - required: false - schema: - type: string - responses: - "200": - description: "" - content: - application/json: - schema: - $ref: "#/components/schemas/Flag" - security: *ref_0 - delete: - operationId: FlagsService.delete - tags: - - FlagsService - parameters: - - name: namespaceKey - in: path - required: true - schema: - type: string - - name: key - in: path - required: true - schema: - type: string - responses: - "204": - description: "" - security: *ref_0 - put: - operationId: FlagsService.update - tags: - - FlagsService - parameters: - - name: namespaceKey - in: path - required: true - schema: - type: string - - name: key - in: path - required: true - schema: - type: string - responses: - "200": - description: "" - content: - application/json: - schema: - $ref: "#/components/schemas/Flag" - security: *ref_0 - requestBody: - required: true - content: - application/json: - schema: - $ref: "#/components/schemas/FlagUpdateRequest" - /api/v1/namespaces: - get: - operationId: NamespacesService.list - tags: - - NamespacesService - parameters: - - name: limit - in: query - required: false - schema: - type: integer - - name: offset - in: query - required: false - schema: - type: integer - - name: pageToken - in: query - required: false - schema: - type: string - - name: reference - in: query - required: false - schema: - type: string - responses: - "200": - description: "" - content: - application/json: - schema: - $ref: "#/components/schemas/NamespaceList" - security: *ref_0 - post: - operationId: NamespacesService.create - tags: - - NamespacesService - parameters: [] - responses: - "200": - description: "" - content: - application/json: - schema: - $ref: "#/components/schemas/Namespace" - security: *ref_0 - requestBody: - required: true - content: - application/json: - schema: - $ref: "#/components/schemas/NamespaceCreateRequest" - /api/v1/namespaces/{key}: - get: - operationId: NamespacesService.get - tags: - - NamespacesService - parameters: - - name: key - in: path - required: true - schema: - type: string - - name: reference - in: query - required: false - schema: - type: string - responses: - "200": - description: "" - content: - application/json: - schema: - $ref: "#/components/schemas/Namespace" - security: *ref_0 - delete: - operationId: NamespacesService.delete - tags: - - NamespacesService - parameters: - - name: key - in: path - required: true - schema: - type: string - responses: - "204": - description: "" - security: *ref_0 - put: - operationId: NamespacesService.update - tags: - - NamespacesService - parameters: - - name: key - in: path - required: true - schema: - type: string - responses: - "200": - description: "" - content: - application/json: - schema: - $ref: "#/components/schemas/Namespace" - security: *ref_0 - requestBody: - required: true - content: - application/json: - schema: - $ref: "#/components/schemas/NamespaceUpdateRequest" - /api/v1/namespaces/{namespaceKey}/flags/{flagKey}/rollouts: - get: - operationId: RolloutsService.list - tags: - - RolloutsService - parameters: - - name: namespaceKey - in: path - required: true - schema: - type: string - - name: flagKey - in: path - required: true - schema: - type: string - - name: limit - in: query - required: false - schema: - type: integer - - name: offset - in: query - required: false - schema: - type: integer - - name: pageToken - in: query - required: false - schema: - type: string - - name: reference - in: query - required: false - schema: - type: string - responses: - "200": - description: "" - content: - application/json: - schema: - $ref: "#/components/schemas/RolloutList" - security: *ref_0 - post: - operationId: RolloutsService.create - tags: - - RolloutsService - parameters: - - name: namespaceKey - in: path - required: true - schema: - type: string - - name: flagKey - in: path - required: true - schema: - type: string - responses: - "200": - description: "" - content: - application/json: - schema: - $ref: "#/components/schemas/Rollout" - security: *ref_0 - requestBody: - required: true - content: - application/json: - schema: - $ref: "#/components/schemas/RolloutCreateRequest" - /api/v1/namespaces/{namespaceKey}/flags/{flagKey}/rollouts/order: - put: - operationId: RolloutsService.order - tags: - - RolloutsService - parameters: - - name: namespaceKey - in: path - required: true - schema: - type: string - - name: flagKey - in: path - required: true - schema: - type: string - responses: - "204": - description: "" - security: *ref_0 - requestBody: - required: true - content: - application/json: - schema: - $ref: "#/components/schemas/RolloutOrderRequest" - /api/v1/namespaces/{namespaceKey}/flags/{flagKey}/rollouts/{id}: - get: - operationId: RolloutsService.get - tags: - - RolloutsService - parameters: - - name: namespaceKey - in: path - required: true - schema: - type: string - - name: flagKey - in: path - required: true - schema: - type: string - - name: id - in: path - required: true - schema: - type: string - - name: reference - in: query - required: false - schema: - type: string - responses: - "200": - description: "" - content: - application/json: - schema: - $ref: "#/components/schemas/Rollout" - security: *ref_0 - delete: - operationId: RolloutsService.delete - tags: - - RolloutsService - parameters: - - name: namespaceKey - in: path - required: true - schema: - type: string - - name: flagKey - in: path - required: true - schema: - type: string - - name: id - in: path - required: true - schema: - type: string - responses: - "204": - description: "" - security: *ref_0 - put: - operationId: RolloutsService.update - tags: - - RolloutsService - parameters: - - name: namespaceKey - in: path - required: true - schema: - type: string - - name: flagKey - in: path - required: true - schema: - type: string - - name: id - in: path - required: true - schema: - type: string - responses: - "204": - description: "" - security: *ref_0 - requestBody: - required: true - content: - application/json: - schema: - $ref: "#/components/schemas/RolloutUpdateRequest" - /api/v1/namespaces/{namespaceKey}/flags/{flagKey}/rules: - get: - operationId: RulesService.list - tags: - - RulesService - parameters: - - name: namespaceKey - in: path - required: true - schema: - type: string - - name: flagKey - in: path - required: true - schema: - type: string - - name: limit - in: query - required: false - schema: - type: integer - - name: offset - in: query - required: false - schema: - type: integer - - name: pageToken - in: query - required: false - schema: - type: string - - name: reference - in: query - required: false - schema: - type: string - responses: - "200": - description: "" - content: - application/json: - schema: - $ref: "#/components/schemas/RuleList" - security: *ref_0 - post: - operationId: RulesService.create - tags: - - RulesService - parameters: - - name: namespaceKey - in: path - required: true - schema: - type: string - - name: flagKey - in: path - required: true - schema: - type: string - responses: - "200": - description: "" - content: - application/json: - schema: - $ref: "#/components/schemas/Rule" - security: *ref_0 - requestBody: - required: true - content: - application/json: - schema: - $ref: "#/components/schemas/RuleCreateRequest" - /api/v1/namespaces/{namespaceKey}/flags/{flagKey}/rules/order: - put: - operationId: RulesService.order - tags: - - RulesService - parameters: - - name: namespaceKey - in: path - required: true - schema: - type: string - - name: flagKey - in: path - required: true - schema: - type: string - responses: - "204": - description: "" - security: *ref_0 - requestBody: - required: true - content: - application/json: - schema: - $ref: "#/components/schemas/RuleOrderRequest" - /api/v1/namespaces/{namespaceKey}/flags/{flagKey}/rules/{id}: - get: - operationId: RulesService.get - tags: - - RulesService - parameters: - - name: namespaceKey - in: path - required: true - schema: - type: string - - name: flagKey - in: path - required: true - schema: - type: string - - name: id - in: path - required: true - schema: - type: string - - name: reference - in: query - required: false - schema: - type: string - responses: - "200": - description: "" - content: - application/json: - schema: - $ref: "#/components/schemas/Rule" - security: *ref_0 - delete: - operationId: RulesService.delete - tags: - - RulesService - parameters: - - name: namespaceKey - in: path - required: true - schema: - type: string - - name: flagKey - in: path - required: true - schema: - type: string - - name: id - in: path - required: true - schema: - type: string - responses: - "204": - description: "" - security: *ref_0 - put: - operationId: RulesService.update - tags: - - RulesService - parameters: - - name: namespaceKey - in: path - required: true - schema: - type: string - - name: flagKey - in: path - required: true - schema: - type: string - - name: id - in: path - required: true - schema: - type: string - responses: - "204": - description: "" - security: *ref_0 - requestBody: - required: true - content: - application/json: - schema: - $ref: "#/components/schemas/RuleUpdateRequest" - /api/v1/namespaces/{namespaceKey}/segments: - get: - operationId: SegmentsService.list - tags: - - SegmentsService - parameters: - - name: namespaceKey - in: path - required: true - schema: - type: string - - name: limit - in: query - required: false - schema: - type: integer - - name: offset - in: query - required: false - schema: - type: integer - - name: pageToken - in: query - required: false - schema: - type: string - - name: reference - in: query - required: false - schema: - type: string - responses: - "200": - description: "" - content: - application/json: - schema: - $ref: "#/components/schemas/SegmentList" - security: *ref_0 - post: - operationId: SegmentsService.create - tags: - - SegmentsService - parameters: - - name: namespaceKey - in: path - required: true - schema: - type: string - responses: - "200": - description: "" - content: - application/json: - schema: - $ref: "#/components/schemas/Segment" - security: *ref_0 - requestBody: - required: true - content: - application/json: - schema: - $ref: "#/components/schemas/SegmentCreateRequest" - /api/v1/namespaces/{namespaceKey}/segments/{key}: - get: - operationId: SegmentsService.get - tags: - - SegmentsService - parameters: - - name: namespaceKey - in: path - required: true - schema: - type: string - - name: key - in: path - required: true - schema: - type: string - - name: reference - in: query - required: false - schema: - type: string - responses: - "200": - description: "" - content: - application/json: - schema: - $ref: "#/components/schemas/Segment" - security: *ref_0 - delete: - operationId: SegmentsService.delete - tags: - - SegmentsService - parameters: - - name: namespaceKey - in: path - required: true - schema: - type: string - - name: key - in: path - required: true - schema: - type: string - responses: - "204": - description: "" - security: *ref_0 - put: - operationId: SegmentsService.update - tags: - - SegmentsService - parameters: - - name: namespaceKey - in: path - required: true - schema: - type: string - - name: key - in: path - required: true - schema: - type: string - responses: - "200": - description: "" - content: - application/json: - schema: - $ref: "#/components/schemas/Segment" - security: *ref_0 - requestBody: - required: true - content: - application/json: - schema: - $ref: "#/components/schemas/SegmentUpdateRequest" - /api/v1/namespaces/{namespaceKey}/flags/{flagKey}/variants: - post: - operationId: VariantsService.create - tags: - - VariantsService - parameters: - - name: namespaceKey - in: path - required: true - schema: - type: string - - name: flagKey - in: path - required: true - schema: - type: string - responses: - "200": - description: "" - content: - application/json: - schema: - $ref: "#/components/schemas/Variant" - security: *ref_0 - requestBody: - required: true - content: - application/json: - schema: - $ref: "#/components/schemas/VariantCreateRequest" - /api/v1/namespaces/{namespaceKey}/flags/{flagKey}/variants/{id}: - delete: - operationId: VariantsService.delete - tags: - - VariantsService - parameters: - - name: namespaceKey - in: path - required: true - schema: - type: string - - name: flagKey - in: path - required: true - schema: - type: string - - name: id - in: path - required: true - schema: - type: string - responses: - "204": - description: "" - security: *ref_0 - put: - operationId: VariantsService.update - tags: - - VariantsService - parameters: - - name: namespaceKey - in: path - required: true - schema: - type: string - - name: flagKey - in: path - required: true - schema: - type: string - - name: id - in: path - required: true - schema: - type: string - responses: - "200": - description: "" - content: - application/json: - schema: - $ref: "#/components/schemas/Variant" - security: *ref_0 - requestBody: - required: true - content: - application/json: - schema: - $ref: "#/components/schemas/VariantUpdateRequest" -components: - schemas: - EvaluationRequest: - type: object - properties: - requestId: - type: string - namespaceKey: - type: string - flagKey: - type: string - entityId: - type: string - context: - type: object - additionalProperties: - type: string - reference: - type: string - required: - - namespaceKey - - flagKey - - entityId - - context - EvaluationResponseType: - type: string - enum: - - VARIANT_EVALUATION_RESPONSE_TYPE - - BOOLEAN_EVALUATION_RESPONSE_TYPE - - ERROR_EVALUATION_RESPONSE_TYPE - EvaluationResponse: - type: object - properties: - type: - $ref: "#/components/schemas/EvaluationResponseType" - booleanResponse: - $ref: "#/components/schemas/BooleanEvaluationResponse" - variantResponse: - $ref: "#/components/schemas/VariantEvaluationResponse" - errorResponse: - $ref: "#/components/schemas/ErrorEvaluationResponse" - required: - - type - ErrorEvaluationResponse: - type: object - properties: - flagKey: - type: string - namespaceKey: - type: string - reason: - $ref: "#/components/schemas/ErrorEvaluationReason" - required: - - flagKey - - namespaceKey - - reason - BooleanEvaluationResponse: - type: object - properties: - requestId: - type: string - flagKey: - type: string - enabled: - type: boolean - timestamp: - type: string - format: date-time - requestDurationMillis: - type: number - format: double - reason: - $ref: "#/components/schemas/EvaluationReason" - required: - - requestId - - flagKey - - enabled - - timestamp - - requestDurationMillis - - reason - VariantEvaluationResponse: - type: object - properties: - requestId: - type: string - match: - type: boolean - flagKey: - type: string - segmentKeys: - type: array - items: - type: string - variantKey: - type: string - variantAttachment: - type: string - timestamp: - type: string - format: date-time - requestDurationMillis: - type: number - format: double - reason: - $ref: "#/components/schemas/EvaluationReason" - required: - - requestId - - match - - flagKey - - segmentKeys - - variantKey - - variantAttachment - - timestamp - - requestDurationMillis - - reason - EvaluationReason: - type: string - enum: - - UNKNOWN_EVALUATION_REASON - - FLAG_DISABLED_EVALUATION_REASON - - MATCH_EVALUATION_REASON - - DEFAULT_EVALUATION_REASON - ErrorEvaluationReason: - type: string - enum: - - UNKNOWN_ERROR_EVALUATION_REASON - - NOT_FOUND_ERROR_EVALUATION_REASON - BatchEvaluationRequest: - type: object - properties: - requestId: - type: string - requests: - type: array - items: - $ref: "#/components/schemas/EvaluationRequest" - reference: - type: string - required: - - requests - BatchEvaluationResponse: - type: object - properties: - requestId: - type: string - responses: - type: array - items: - $ref: "#/components/schemas/EvaluationResponse" - requestDurationMillis: - type: number - format: double - required: - - requestId - - responses - - requestDurationMillis - AuthMethodOIDCAuthorizeURLResponse: - type: object - properties: - authorizeUrl: - type: string - required: - - authorizeUrl - AuthMethodOIDCCallbackResponse: - type: object - properties: - authentication: - $ref: "#/components/schemas/Authentication" - required: - - authentication - AuthenticationMethod: - type: string - enum: - - METHOD_NONE - - METHOD_TOKEN - - METHOD_OIDC - - METHOD_KUBERNETES - - METHOD_JWT - description: The default is METHOD_NONE - Authentication: - type: object - properties: - id: - type: string - method: - $ref: "#/components/schemas/AuthenticationMethod" - createdAt: - type: string - format: date-time - updatedAt: - type: string - format: date-time - expiresAt: - type: string - format: date-time - metadata: - type: object - additionalProperties: - type: string - required: - - id - - method - - createdAt - - updatedAt - - metadata - AuthenticationList: - type: object - properties: - authentications: - type: array - items: - $ref: "#/components/schemas/Authentication" - nextPageToken: - type: string - required: - - authentications - - nextPageToken - AuthenticationToken: - type: object - properties: - clientToken: - type: string - authentication: - $ref: "#/components/schemas/Authentication" - required: - - clientToken - - authentication - CommonsPageable: - type: object - properties: - nextPageToken: - type: string - totalCount: - type: integer - ConstraintComparisonType: - type: string - enum: - - UNKNOWN_COMPARISON_TYPE - - STRING_COMPARISON_TYPE - - NUMBER_COMPARISON_TYPE - - BOOLEAN_COMPARISON_TYPE - - DATETIME_COMPARISON_TYPE - description: The default is UNKNOWN_COMPARISON_TYPE - Constraint: - type: object - properties: - id: - type: string - namespaceKey: - type: string - segmentKey: - type: string - type: - $ref: "#/components/schemas/ConstraintComparisonType" - property: - type: string - operator: - type: string - value: - type: string - description: - type: string - createdAt: - type: string - format: date-time - updatedAt: - type: string - format: date-time - required: - - id - - namespaceKey - - segmentKey - - type - - property - - operator - - value - - description - - createdAt - - updatedAt - ConstraintCreateRequest: - type: object - properties: - type: - $ref: "#/components/schemas/ConstraintComparisonType" - property: - type: string - operator: - type: string - value: - type: string - description: - type: string - required: - - type - - property - - operator - ConstraintUpdateRequest: - type: object - properties: - type: - $ref: "#/components/schemas/ConstraintComparisonType" - property: - type: string - operator: - type: string - value: - type: string - description: - type: string - required: - - type - - property - - operator - Distribution: - type: object - properties: - id: - type: string - ruleId: - type: string - variantId: - type: string - rollout: - type: number - format: double - createdAt: - type: string - format: date-time - updatedAt: - type: string - format: date-time - required: - - id - - ruleId - - variantId - - rollout - - createdAt - - updatedAt - DistributionCreateRequest: - type: object - properties: - variantId: - type: string - rollout: - type: number - format: double - required: - - variantId - - rollout - DistributionUpdateRequest: - type: object - properties: - variantId: - type: string - rollout: - type: number - format: double - required: - - variantId - - rollout - FlagList: - type: object - properties: - flags: - type: array - items: - $ref: "#/components/schemas/Flag" - nextPageToken: - type: string - totalCount: - type: integer - required: - - flags - - nextPageToken - - totalCount - Flag: - type: object - properties: - namespaceKey: - type: string - 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: "#/components/schemas/Variant" - type: - $ref: "#/components/schemas/FlagType" - defaultVariant: - $ref: "#/components/schemas/Variant" - required: - - namespaceKey - - key - - name - - description - - enabled - - createdAt - - updatedAt - - variants - - type - FlagType: - type: string - enum: - - VARIANT_FLAG_TYPE - - BOOLEAN_FLAG_TYPE - FlagCreateRequest: - type: object - properties: - key: - type: string - name: - type: string - description: - type: string - enabled: - type: boolean - type: - $ref: "#/components/schemas/FlagType" - required: - - key - - name - - type - FlagUpdateRequest: - type: object - properties: - name: - type: string - description: - type: string - enabled: - type: boolean - defaultVariantId: - type: string - required: - - name - NamespaceList: - type: object - properties: - namespaces: - type: array - items: - $ref: "#/components/schemas/Namespace" - nextPageToken: - type: string - totalCount: - type: integer - required: - - namespaces - - nextPageToken - - totalCount - Namespace: - type: object - properties: - key: - type: string - name: - type: string - description: - type: string - protected: - type: boolean - createdAt: - type: string - format: date-time - updatedAt: - type: string - format: date-time - required: - - key - - name - - description - - protected - - createdAt - - updatedAt - NamespaceCreateRequest: - type: object - properties: - key: - type: string - name: - type: string - description: - type: string - required: - - key - - name - NamespaceUpdateRequest: - type: object - properties: - name: - type: string - description: - type: string - required: - - name - RolloutList: - type: object - properties: - rollouts: - type: array - items: - $ref: "#/components/schemas/Rollout" - nextPageToken: - type: string - totalCount: - type: integer - required: - - rollouts - - nextPageToken - - totalCount - Rollout: - type: object - properties: - id: - type: string - namespaceKey: - type: string - flagKey: - type: string - type: - $ref: "#/components/schemas/RolloutType" - rank: - type: integer - description: - type: string - createdAt: - type: string - format: date-time - updatedAt: - type: string - format: date-time - segment: - $ref: "#/components/schemas/RolloutSegment" - threshold: - $ref: "#/components/schemas/RolloutThreshold" - required: - - id - - namespaceKey - - flagKey - - type - - rank - - description - - createdAt - - updatedAt - RolloutSegmentOperator: - type: string - enum: - - OR_SEGMENT_OPERATOR - - AND_SEGMENT_OPERATOR - RolloutType: - type: string - enum: - - UNKNOWN_ROLLOUT_TYPE - - SEGMENT_ROLLOUT_TYPE - - THRESHOLD_ROLLOUT_TYPE - RolloutSegment: - type: object - properties: - segmentKey: - type: string - segmentKeys: - type: array - items: - type: string - segmentOperator: - $ref: "#/components/schemas/RolloutSegmentOperator" - value: - type: boolean - required: - - segmentKey - - value - RolloutThreshold: - type: object - properties: - percentage: - type: number - format: double - value: - type: boolean - required: - - percentage - - value - RolloutCreateRequest: - type: object - properties: - rank: - type: integer - description: - type: string - segment: - $ref: "#/components/schemas/RolloutSegment" - threshold: - $ref: "#/components/schemas/RolloutThreshold" - required: - - rank - RolloutUpdateRequest: - type: object - properties: - description: - type: string - segment: - $ref: "#/components/schemas/RolloutSegment" - threshold: - $ref: "#/components/schemas/RolloutThreshold" - RolloutOrderRequest: - type: object - properties: - rolloutIds: - type: array - items: - type: string - required: - - rolloutIds - RuleList: - type: object - properties: - rules: - type: array - items: - $ref: "#/components/schemas/Rule" - nextPageToken: - type: string - totalCount: - type: integer - required: - - rules - - nextPageToken - - totalCount - RuleSegmentOperator: - type: string - enum: - - OR_SEGMENT_OPERATOR - - AND_SEGMENT_OPERATOR - Rule: - type: object - properties: - id: - type: string - namespaceKey: - type: string - flagKey: - type: string - segmentKey: - type: string - segmentKeys: - type: array - items: - type: string - segmentOperator: - $ref: "#/components/schemas/RuleSegmentOperator" - distributions: - type: array - items: - $ref: "#/components/schemas/Distribution" - rank: - type: integer - createdAt: - type: string - format: date-time - updatedAt: - type: string - format: date-time - required: - - id - - namespaceKey - - flagKey - - segmentKey - - segmentOperator - - distributions - - rank - - createdAt - - updatedAt - RuleCreateRequest: - type: object - properties: - segmentKey: - type: string - segmentKeys: - type: array - items: - type: string - segmentOperator: - $ref: "#/components/schemas/RuleSegmentOperator" - rank: - type: integer - required: - - segmentKey - - rank - RuleOrderRequest: - type: object - properties: - ruleIds: - type: array - items: - type: string - required: - - ruleIds - RuleUpdateRequest: - type: object - properties: - segmentKey: - type: string - segmentKeys: - type: array - items: - type: string - segmentOperator: - $ref: "#/components/schemas/RuleSegmentOperator" - required: - - segmentKey - SegmentList: - type: object - properties: - segments: - type: array - items: - $ref: "#/components/schemas/Segment" - nextPageToken: - type: string - totalCount: - type: integer - required: - - segments - - nextPageToken - - totalCount - Segment: - type: object - properties: - namespaceKey: - type: string - 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: "#/components/schemas/Constraint" - matchType: - $ref: "#/components/schemas/SegmentMatchType" - required: - - namespaceKey - - key - - name - - description - - createdAt - - updatedAt - - constraints - - matchType - SegmentMatchType: - type: string - enum: - - ALL_MATCH_TYPE - - ANY_MATCH_TYPE - SegmentCreateRequest: - type: object - properties: - key: - type: string - name: - type: string - description: - type: string - matchType: - $ref: "#/components/schemas/SegmentMatchType" - required: - - key - - name - - description - - matchType - SegmentUpdateRequest: - type: object - properties: - name: - type: string - description: - type: string - matchType: - $ref: "#/components/schemas/SegmentMatchType" - required: - - name - - description - - matchType - Variant: - type: object - properties: - id: - type: string - namespaceKey: - 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 - required: - - id - - namespaceKey - - flagKey - - key - - name - - description - - createdAt - - updatedAt - - attachment - VariantCreateRequest: - type: object - properties: - key: - type: string - name: - type: string - description: - type: string - attachment: - type: string - required: - - key - VariantUpdateRequest: - type: object - properties: - key: - type: string - name: - type: string - description: - type: string - attachment: - type: string - required: - - key - securitySchemes: - BearerAuth: - type: http - scheme: bearer -servers: - - url: https://try.flipt.io diff --git a/reference/openfeature/configuration.mdx b/reference/openfeature/configuration.mdx new file mode 100644 index 0000000..0b343e5 --- /dev/null +++ b/reference/openfeature/configuration.mdx @@ -0,0 +1,14 @@ +--- +title: "Configuration" +openapi: "GET /ofrep/v1/configuration" +--- + + + +```bash cURL +curl --request GET \ + --url https://try.flipt.io/ofrep/v1/configuration \ + --header 'Accept: application/json' +``` + + \ No newline at end of file diff --git a/reference/openfeature/flag-evaluation.mdx b/reference/openfeature/flag-evaluation.mdx new file mode 100644 index 0000000..57674a5 --- /dev/null +++ b/reference/openfeature/flag-evaluation.mdx @@ -0,0 +1,19 @@ +--- +title: "Flag Evaluation" +openapi: "POST /ofrep/v1/evaluate/flags/{key}" +--- + + + +```bash cURL +curl --request POST \ + --url https://try.flipt.io/ofrep/v1/evaluate/flags/ \ + --header 'Content-Type: application/json' \ + --header 'Accept: application/json' \ + --header 'X-Flipt-Namespace: ' \ + --data '{ + "context": {}, +}' +``` + + diff --git a/reference/openfeature/overview.mdx b/reference/openfeature/overview.mdx new file mode 100644 index 0000000..0a5cfb2 --- /dev/null +++ b/reference/openfeature/overview.mdx @@ -0,0 +1,28 @@ +--- +title: Overview +--- + +OpenFeature Remote Evaluation Protocol (OFREP) is an API specification for feature flagging that allows the use of generic providers to connect to any feature flag management systems that supports the protocol. + +Currently, OFREP is still in the early stages of development so the specification is subject to change. Flipt is one of the early adopters of the OFREP protocol and has implemented the protocol in its API. + +For more information on the OFREP protocol, see the [OpenFeature Remote Evaluation Protocol](https://github.com/open-feature/protocol) repository on GitHub. + +## Endpoints + +The OFREP protocol is implemented in the Flipt API. The following endpoints are available: + +- [Configuration](/reference/openfeature/configuration) - Supplies information about the remote flag management system to set up the OpenFeature SDK providers. +- [Single Flag Evaluation](/reference/openfeature/flag-evaluation) - Called by the server providers to perform single flag evaluation. + + +## Providers + +Providers are the entities that implement the OFREP protocol from the caller. Providers are responsible for evaluating feature flags and returning the results to the client. + +Current providers include: + +- [Go](https://github.com/open-feature/go-sdk-contrib/tree/main/providers/ofrep) +- [JS Server](https://github.com/open-feature/js-sdk-contrib/tree/main/libs/providers/ofrep) +- [JS Web](https://github.com/open-feature/js-sdk-contrib/tree/main/libs/providers/ofrep-web) + diff --git a/reference/overview.mdx b/reference/overview.mdx index 22d68bb..96eb3e2 100644 --- a/reference/overview.mdx +++ b/reference/overview.mdx @@ -8,7 +8,7 @@ The Flipt UI is completely backed by this same API. This means that anything tha The Flipt REST API can also be used with any language that can make HTTP requests. -The latest version of the REST API is fully documented using the [OpenAPI v3 specification](https://github.com/flipt-io/flipt-openapi). +The latest version of the REST API is fully documented using the [OpenAPI v3 specification](https://raw.githubusercontent.com/flipt-io/flipt/main/openapi.yaml). ## Authentication