Skip to content

Commit

Permalink
feat: Add allFlagMetadata to client
Browse files Browse the repository at this point in the history
Signed-off-by: Max VelDink <[email protected]>
  • Loading branch information
maxveldink authored and Kavindu-Dodan committed Feb 23, 2024
1 parent 906ed81 commit 72b496f
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 2 deletions.
9 changes: 8 additions & 1 deletion specification.json
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,13 @@
"RFC 2119 keyword": "MUST",
"children": []
},
{
"id": "Requirement 1.2.3",
"machine_id": "requirement_1_2_3",
"content": "The client interface MUST define a `allFlagMetadata` member or accessor, returning a collection of flag metadata from the provider.",
"RFC 2119 keyword": "MUST",
"children": []
},
{
"id": "Condition 1.3.1",
"machine_id": "condition_1_3_1",
Expand Down Expand Up @@ -361,7 +368,7 @@
{
"id": "Requirement 2.1.2",
"machine_id": "requirement_2_1_2",
"content": "The provider `metadata` member or accessor MAY define an `allFlagMetadata` field or accessor of type collection of [flag_metadata](../types.md",
"content": "The provider MAY define an `allFlagMetadata` field or accessor of type collection of [flag_metadata](../types.md",
"RFC 2119 keyword": "MAY",
"children": []
},
Expand Down
12 changes: 11 additions & 1 deletion specification/sections/01-flag-evaluation.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ This function not only sets the provider, but ensures that the provider is ready
// default provider
OpenFeatureAPI.getInstance().setProviderAndWait(myprovider); // this method blocks until the provider is ready or in error
// client uses the default provider
Client client = OpenFeatureAPI.getInstance().getClient();
Client client = OpenFeatureAPI.getInstance().getClient();

// provider associated with domain-1
OpenFeatureAPI.getInstance().setProviderAndWait('domain-1', myprovider); // this method blocks until the provider is ready or in error
Expand Down Expand Up @@ -171,6 +171,16 @@ client.getMetadata().getDomain(); // "domain-1"
In previous drafts, this property was called `name`.
For backwards compatibility, implementations should consider `name` an alias to `domain`.

#### Requirement 1.2.3

> The client interface **MUST** define a `allFlagMetadata` member or accessor, returning a collection of flag metadata from the provider.
```typescript
client.getAllFlagMetadata() // [{"key": "featureA", "type": "boolean"}, {"key": "featureB", "type": "string"}]
```

This may return an empty collection if the provider does not implement the `allFlagMetadata` member or accessor.

### 1.3. Flag Evaluation

[![hardening](https://img.shields.io/static/v1?label=Status&message=hardening&color=yellow)](https://github.com/open-feature/spec/tree/main/specification#hardening)
Expand Down

0 comments on commit 72b496f

Please sign in to comment.