Protocol Documentation
flagd/evaluation/v1/evaluation.proto
Flag evaluation API
This proto forms the basis of a flag-evaluation API. It supports single and bulk evaluation RPCs, and flags of various types, as well as establishing a stream for getting notifications about changes in a flag definition. It supports the inclusion of a "context" with each evaluation, which may contain arbitrary attributes relevant to flag evaluation.
AnyFlag
A variant type flag response.
Field | Type | Label | Description |
---|---|---|---|
reason | string | The reason for the given return value, see https://openfeature.dev/docs/specification/types#resolution-details | |
variant | string | The variant name of the returned flag value. | |
bool_value | bool | ||
string_value | string | ||
double_value | double | ||
object_value | google.protobuf.Struct |
EventStreamRequest
Empty stream request body
EventStreamResponse
Response body for the EventStream stream response
Field | Type | Label | Description |
---|---|---|---|
type | string | String key indicating the type of event that is being received, for example, provider_ready or configuration_change | |
data | google.protobuf.Struct | Object structure for use when sending relevant metadata to provide context to the event. Can be left unset when it is not required. |
ResolveAllRequest
Request body for bulk flag evaluation, used by the ResolveAll rpc.
Field | Type | Label | Description |
---|---|---|---|
context | google.protobuf.Struct | Object structure describing the EvaluationContext used in the flag evaluation, see https://openfeature.dev/docs/reference/concepts/evaluation-context |
ResolveAllResponse
Response body for bulk flag evaluation, used by the ResolveAll rpc.
Field | Type | Label | Description |
---|---|---|---|
flags | ResolveAllResponse.FlagsEntry | repeated | Object structure describing the evaluated flags for the provided context. |
ResolveAllResponse.FlagsEntry
Field | Type | Label | Description |
---|---|---|---|
key | string | ||
value | AnyFlag |
ResolveBooleanRequest
Request body for boolean flag evaluation, used by the ResolveBoolean rpc.
Field | Type | Label | Description |
---|---|---|---|
flag_key | string | Flag key of the requested flag. | |
context | google.protobuf.Struct | Object structure describing the EvaluationContext used in the flag evaluation, see https://openfeature.dev/docs/reference/concepts/evaluation-context |
ResolveBooleanResponse
Response body for boolean flag evaluation. used by the ResolveBoolean rpc.
Field | Type | Label | Description |
---|---|---|---|
value | bool | The response value of the boolean flag evaluation, will be unset in the case of error. | |
reason | string | The reason for the given return value, see https://openfeature.dev/docs/specification/types#resolution-details | |
variant | string | The variant name of the returned flag value. | |
metadata | google.protobuf.Struct | Metadata for this evaluation |
ResolveFloatRequest
Request body for float flag evaluation, used by the ResolveFloat rpc.
Field | Type | Label | Description |
---|---|---|---|
flag_key | string | Flag key of the requested flag. | |
context | google.protobuf.Struct | Object structure describing the EvaluationContext used in the flag evaluation, see https://openfeature.dev/docs/reference/concepts/evaluation-context |
ResolveFloatResponse
Response body for float flag evaluation. used by the ResolveFloat rpc.
Field | Type | Label | Description |
---|---|---|---|
value | double | The response value of the float flag evaluation, will be empty in the case of error. | |
reason | string | The reason for the given return value, see https://openfeature.dev/docs/specification/types#resolution-details | |
variant | string | The variant name of the returned flag value. | |
metadata | google.protobuf.Struct | Metadata for this evaluation |
ResolveIntRequest
Request body for int flag evaluation, used by the ResolveInt rpc.
Field | Type | Label | Description |
---|---|---|---|
flag_key | string | Flag key of the requested flag. | |
context | google.protobuf.Struct | Object structure describing the EvaluationContext used in the flag evaluation, see https://openfeature.dev/docs/reference/concepts/evaluation-context |
ResolveIntResponse
Response body for int flag evaluation. used by the ResolveInt rpc.
Field | Type | Label | Description |
---|---|---|---|
value | int64 | The response value of the int flag evaluation, will be unset in the case of error. | |
reason | string | The reason for the given return value, see https://openfeature.dev/docs/specification/types#resolution-details | |
variant | string | The variant name of the returned flag value. | |
metadata | google.protobuf.Struct | Metadata for this evaluation |
ResolveObjectRequest
Request body for object flag evaluation, used by the ResolveObject rpc.
Field | Type | Label | Description |
---|---|---|---|
flag_key | string | Flag key of the requested flag. | |
context | google.protobuf.Struct | Object structure describing the EvaluationContext used in the flag evaluation, see https://openfeature.dev/docs/reference/concepts/evaluation-context |
ResolveObjectResponse
Response body for object flag evaluation. used by the ResolveObject rpc.
Field | Type | Label | Description |
---|---|---|---|
value | google.protobuf.Struct | The response value of the object flag evaluation, will be unset in the case of error. |
NOTE: This structure will need to be decoded from google/protobuf/struct.proto before it is returned to the SDK | | reason | string | | The reason for the given return value, see https://openfeature.dev/docs/specification/types#resolution-details | | variant | string | | The variant name of the returned flag value. | | metadata | google.protobuf.Struct | | Metadata for this evaluation |
ResolveStringRequest
Request body for string flag evaluation, used by the ResolveString rpc.
Field | Type | Label | Description |
---|---|---|---|
flag_key | string | Flag key of the requested flag. | |
context | google.protobuf.Struct | Object structure describing the EvaluationContext used in the flag evaluation, see https://openfeature.dev/docs/reference/concepts/evaluation-context |
ResolveStringResponse
Response body for string flag evaluation. used by the ResolveString rpc.
Field | Type | Label | Description |
---|---|---|---|
value | string | The response value of the string flag evaluation, will be unset in the case of error. | |
reason | string | The reason for the given return value, see https://openfeature.dev/docs/specification/types#resolution-details | |
variant | string | The variant name of the returned flag value. | |
metadata | google.protobuf.Struct | Metadata for this evaluation |
Service
Service defines the exposed rpcs of flagd
Method Name | Request Type | Response Type | Description |
---|---|---|---|
ResolveAll | ResolveAllRequest | ResolveAllResponse | |
ResolveBoolean | ResolveBooleanRequest | ResolveBooleanResponse | |
ResolveString | ResolveStringRequest | ResolveStringResponse | |
ResolveFloat | ResolveFloatRequest | ResolveFloatResponse | |
ResolveInt | ResolveIntRequest | ResolveIntResponse | |
ResolveObject | ResolveObjectRequest | ResolveObjectResponse | |
EventStream | EventStreamRequest | EventStreamResponse stream |
flagd/sync/v1/sync.proto
Flag definition sync API
This proto defines a simple API to synchronize a feature flag definition. It supports establishing a stream for getting notifications about changes in a flag definition.
FetchAllFlagsRequest
FetchAllFlagsRequest is the request to fetch all flags. Clients send this request as the client in order to resync their internal state
Field | Type | Label | Description |
---|---|---|---|
provider_id | string | Optional: A unique identifier for clients initiating the request. The server implementations may utilize this identifier to uniquely identify, validate(ex:- enforce authentication/authorization) and filter flag configurations that it can expose to this request. This field is intended to be optional. However server implementations may enforce it. ex:- provider_id: flagd-weatherapp-sidecar | |
selector | string | Optional: A selector for the flag configuration request. The server implementation may utilize this to select flag configurations from a collection, select the source of the flag or combine this to any desired underlying filtering mechanism. ex:- selector: 'source=database,app=weatherapp' |
FetchAllFlagsResponse
FetchAllFlagsResponse is the server response containing feature flag configurations
Field | Type | Label | Description |
---|---|---|---|
flag_configuration | string | flagd feature flag configuration. Must be validated to schema - https://raw.githubusercontent.com/open-feature/schemas/main/json/flagd-definitions.json |
GetMetadataRequest
GetMetadataRequest is the request for retrieving metadata from the sync service
GetMetadataResponse
GetMetadataResponse contains metadata from the sync service
Field | Type | Label | Description |
---|---|---|---|
metadata | google.protobuf.Struct |
SyncFlagsRequest
SyncFlagsRequest is the request initiating the server-streaming rpc. Implementations of Flagd providers and Flagd itself send this request, acting as the client.
Field | Type | Label | Description |
---|---|---|---|
provider_id | string | Optional: A unique identifier for flagd(grpc client) initiating the request. The server implementations may utilize this identifier to uniquely identify, validate(ex:- enforce authentication/authorization) and filter flag configurations that it can expose to this request. This field is intended to be optional. However server implementations may enforce it. ex:- provider_id: flagd-weatherapp-sidecar | |
selector | string | Optional: A selector for the flag configuration request. The server implementation may utilize this to select flag configurations from a collection, select the source of the flag or combine this to any desired underlying filtering mechanism. ex:- selector: 'source=database,app=weatherapp' |
SyncFlagsResponse
SyncFlagsResponse is the server response containing feature flag configurations and the state
Field | Type | Label | Description |
---|---|---|---|
flag_configuration | string | flagd feature flag configuration. Must be validated to schema - https://raw.githubusercontent.com/open-feature/schemas/main/json/flagd-definitions.json |
FlagSyncService
FlagService implements a server streaming to provide realtime flag configurations
Method Name | Request Type | Response Type | Description |
---|---|---|---|
SyncFlags | SyncFlagsRequest | SyncFlagsResponse stream | |
FetchAllFlags | FetchAllFlagsRequest | FetchAllFlagsResponse | |
GetMetadata | GetMetadataRequest | GetMetadataResponse |