You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: specification.json
+2-17Lines changed: 2 additions & 17 deletions
Original file line number
Diff line number
Diff line change
@@ -266,25 +266,10 @@
266
266
{
267
267
"id": "Requirement 2.10",
268
268
"machine_id": "requirement_2_10",
269
-
"content": "The provider interface MAY define a `context transformer` method or function, which can be optionally implemented in order to transform the `evaluation context` prior to flag value resolution.",
269
+
"content": "The provider interface MAY define a `provider hook` mechanism which can be optionally implemented in order to add `hook` instances to the client.",
270
270
"RFC 2119 keyword": "MAY",
271
271
"children": []
272
272
},
273
-
{
274
-
"id": "Condition 2.11",
275
-
"machine_id": "condition_2_11",
276
-
"content": "The implementation language supports generics (or an equivalent feature).",
277
-
"RFC 2119 keyword": null,
278
-
"children": [
279
-
{
280
-
"id": "Conditional Requirement 2.11.1",
281
-
"machine_id": "conditional_requirement_2_11_1",
282
-
"content": "If the implementation includes a `context transformer`, the provider SHOULD accept a generic argument (or use an equivalent language feature) indicating the type of the transformed context. If such type information is supplied, more accurate type information can be supplied in the flag resolution methods.",
283
-
"RFC 2119 keyword": "SHOULD",
284
-
"children": []
285
-
}
286
-
]
287
-
},
288
273
{
289
274
"id": "Requirement 3.1.1",
290
275
"machine_id": "requirement_3_1_1",
@@ -451,7 +436,7 @@
451
436
{
452
437
"id": "Requirement 4.4.2",
453
438
"machine_id": "requirement_4_4_2",
454
-
"content": "Hooks MUST be evaluated in the following order: - before: API, Client, Invocation- after: Invocation, Client, API - error (if applicable): Invocation, Client, API - finally: Invocation, Client, API",
439
+
"content": "Hooks MUST be evaluated in the following order: - before: API, Client, Invocation, Provider - after: Provider, Invocation, Client, API - error (if applicable): Provider, Invocation, Client, API - finally: Provider, Invocation, Client, API",
Feature flag management systems often define structures representing arbitrary contextual data pertaining to the runtime, user, or application. The context transformer defines a simple interface to transform the OpenFeature `evaluation context` to such a structure, mapping values appropriately.
117
-
118
-
See [evaluation context](./03-evaluation-context.md).
116
+
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.
119
117
120
118
##### Requirement 2.10
121
119
122
-
> The provider interface **MAY** define a `context transformer` method or function, which can be optionally implemented in order to transform the `evaluation context` prior to flag value resolution.
123
-
124
-
The OpenFeature `client` might apply the transformer function before passing the returned value (the `transformed context`) to the provider resolution methods, thus allowing the provider implementation to avoid implementing and calling such transformation logic repeatedly in flag value resolution methods.
> The provider interface **MAY** define a `provider hook` mechanism which can be optionally implemented in order to add `hook` instances to the client.
134
121
135
-
//...
136
-
}
137
122
```
138
-
139
-
See [evaluation context](./03-evaluation-context.md), [flag evaluation](./01-flag-evaluation.md#flag-evaluation).
140
-
141
-
##### Condition 2.11
142
-
143
-
> The implementation language supports generics (or an equivalent feature).
144
-
145
-
###### Conditional Requirement 2.11.1
146
-
147
-
> If the implementation includes a `context transformer`, the provider **SHOULD** accept a generic argument (or use an equivalent language feature) indicating the type of the transformed context.
148
-
>
149
-
> If such type information is supplied, more accurate type information can be supplied in the flag resolution methods.
150
-
151
-
```typescript
152
-
// an example implementation in a language supporting interfaces, classes, and generics
153
-
// T represents a generic argument for the type of the transformed context
0 commit comments