Skip to content

Commit

Permalink
feat: adds allFlagKeys to provider metadata
Browse files Browse the repository at this point in the history
Signed-off-by: Max VelDink <[email protected]>
  • Loading branch information
maxveldink committed Feb 14, 2024
1 parent 2c36abd commit 828f143
Show file tree
Hide file tree
Showing 3 changed files with 50 additions and 0 deletions.
22 changes: 22 additions & 0 deletions specification.json
Original file line number Diff line number Diff line change
Expand Up @@ -294,6 +294,28 @@
"RFC 2119 keyword": "MUST",
"children": []
},
{
"id": "Requirement 2.1.2",
"machine_id": "requirement_2_1_2",
"content": "The provider `metadata` member or accessor MAY define an `allFlagKeys` field or accessor of type collection of strings, which identifies all available flag keys in the provider.",
"RFC 2119 keyword": "MAY",
"children": []
},
{
"id": "Condition 2.1.3",
"machine_id": "condition_2_1_3",
"content": "The implementing language has an asynchronous support.",
"RFC 2119 keyword": null,
"children": [
{
"id": "Conditional Requirement 2.1.3.1",
"machine_id": "conditional_requirement_2_1_3_1",
"content": "The accessor for `allFlagKeys` SHOULD be asynchronous.",
"RFC 2119 keyword": "SHOULD",
"children": []
}
]
},
{
"id": "Requirement 2.2.1",
"machine_id": "requirement_2_2_1",
Expand Down
16 changes: 16 additions & 0 deletions specification/sections/02-providers.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,22 @@ Providers are the "translator" between the flag evaluation calls made in applica
provider.getMetadata().getName(); // "my-custom-provider"
```

#### Requirement 2.1.2

> The provider `metadata` member or accessor **MAY** define an `allFlagKeys` field or accessor of type collection of strings, which identifies all available flag keys in the provider.
```typescript
provider.getMetadata().getAllFlagKeys(); // ['featureA', 'featureB']
```

#### Condition 2.1.3

> The implementing language has an asynchronous support.
##### Conditional Requirement 2.1.3.1

> The accessor for `allFlagKeys` **SHOULD** be asynchronous.
### 2.2 Flag Value Resolution

`Providers` are implementations of the `feature provider` interface, which may wrap vendor SDKs, REST API clients, or otherwise resolve flag values from the runtime environment.
Expand Down
12 changes: 12 additions & 0 deletions specification/types.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,10 @@ A numeric value of unspecified type or size. Implementation languages may furthe

Structured data, presented however is idiomatic in the implementation language, such as JSON or YAML.

### Collection

A list or series of similar data types, presented however is idiomatic in the implementation language.

### Datetime

A language primitive for representing a date and time, optionally including timezone information. If no timezone is specified, the date and time will be treated as UTC.
Expand Down Expand Up @@ -124,6 +128,14 @@ A structure which supports definition of arbitrary properties, with keys of type

This structure is populated by a provider for use by an [Application Author](./glossary.md#application-author) via the [Evaluation API](./glossary.md#evaluation-api) or an [Application Integrator](./glossary.md#application-integrator) via [hooks](./sections/04-hooks.md).

### Provider Metadata

A structure which carries information about the provider.
In addition to the defined metadata fields below, arbitrary information can be stored here unique to the provider.

`name` is a required key with a string value.
`allFlagKeys` is an optional key with a collection of string value.

### Provider Status

An enumeration of possible provider states.
Expand Down

0 comments on commit 828f143

Please sign in to comment.