Skip to content

Commit

Permalink
Update based on review comments.
Browse files Browse the repository at this point in the history
Provider interface must add hook mechanism.
Make wording clearer.
Ensure Provider is listed alongside other hook registrars.

Signed-off-by: Justin Abrahms <jabrahms@ebay.com>
  • Loading branch information
justinabrahms committed Aug 4, 2022
1 parent 678e492 commit 946be25
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions specification.json
Original file line number Diff line number Diff line change
Expand Up @@ -266,8 +266,8 @@
{
"id": "Requirement 2.10",
"machine_id": "requirement_2_10",
"content": "The provider interface MAY define a `provider hook` mechanism which can be optionally implemented in order to add `hook` instances to the client.",
"RFC 2119 keyword": "MAY",
"content": "The provider interface MUST define a `provider hook` mechanism which can be optionally implemented in order to add `hook` instances to the client.",
"RFC 2119 keyword": "MUST",
"children": []
},
{
Expand Down Expand Up @@ -443,7 +443,7 @@
{
"id": "Requirement 4.4.1",
"machine_id": "requirement_4_4_1",
"content": "The API, Client and invocation MUST have a method for registering hooks which accepts `flag evaluation options`",
"content": "The API, Client, Provider, and invocation MUST have a method for registering hooks.",
"RFC 2119 keyword": "MUST",
"children": []
},
Expand Down
4 changes: 2 additions & 2 deletions specification/sections/02-providers.md
Original file line number Diff line number Diff line change
Expand Up @@ -113,11 +113,11 @@ ResolutionDetails<MyStruct> resolveStructureValue(string flagKey, MyStruct defau

#### Provider hooks

Feature flag management systems often need to transform the context structures the user provides or generally address lifecycle concerns. A `provider hook` exposes a mechanism for providers to register [`Hooks`](./04-hooks.md) to tap into various stages of the flag evaluation lifecycle.
A `provider hook` exposes a mechanism for `providers` to register [`hooks`](./04-hooks.md) to tap into various stages of the flag evaluation lifecycle. As one example, feature flag management systems often need to transform the context structures the user provides.

##### Requirement 2.10

> The provider interface **MAY** define a `provider hook` mechanism which can be optionally implemented in order to add `hook` instances to the client.
> The provider interface **MUST** define a `provider hook` mechanism which can be optionally implemented in order to add `hook` instances to the client.
```
class MyProvider implements Provider {
Expand Down
2 changes: 1 addition & 1 deletion specification/sections/04-hooks.md
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ EvaluationContext | void before(HookContext, HookHints);

#### Requirement 4.4.1

> The API, Client and invocation **MUST** have a method for registering hooks which accepts `flag evaluation options`
> The API, Client, Provider, and invocation **MUST** have a method for registering hooks.
```js
OpenFeature.addHooks(new Hook1());
Expand Down

0 comments on commit 946be25

Please sign in to comment.