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
+5-5Lines changed: 5 additions & 5 deletions
Original file line number
Diff line number
Diff line change
@@ -38,7 +38,7 @@
38
38
{
39
39
"id": "Requirement 1.1.3",
40
40
"machine_id": "requirement_1_1_3",
41
-
"content": "The `API` MUST provide a function to bind a given `provider` to one or more client `name`s. If the client-name already has a bound provider, it is overwritten with the new mapping.",
41
+
"content": "The `API` MUST provide a function to bind a given `provider` to one or more clients using a `domain`. If the domain already has a bound provider, it is overwritten with the new mapping.",
42
42
"RFC 2119 keyword": "MUST",
43
43
"children": []
44
44
},
@@ -59,7 +59,7 @@
59
59
{
60
60
"id": "Requirement 1.1.6",
61
61
"machine_id": "requirement_1_1_6",
62
-
"content": "The `API` MUST provide a function for creating a `client` which accepts the following options: - name (optional): A logical string identifier for the client.",
62
+
"content": "The `API` MUST provide a function for creating a `client` which accepts the following options: - domain (optional): A logical string identifier for binding clients to provider.",
63
63
"RFC 2119 keyword": "MUST",
64
64
"children": []
65
65
},
@@ -80,7 +80,7 @@
80
80
{
81
81
"id": "Requirement 1.2.2",
82
82
"machine_id": "requirement_1_2_2",
83
-
"content": "The client interface MUST define a `metadata` member or accessor, containing an immutable `name` field or accessor of type string, which corresponds to the `name` value supplied during client creation.",
83
+
"content": "The client interface MUST define a `metadata` member or accessor, containing an immutable `domain` field or accessor of type string, which corresponds to the `domain` value supplied during client creation.",
84
84
"RFC 2119 keyword": "MUST",
85
85
"children": []
86
86
},
@@ -523,14 +523,14 @@
523
523
{
524
524
"id": "Conditional Requirement 3.2.2.3",
525
525
"machine_id": "conditional_requirement_3_2_2_3",
526
-
"content": "The API MUST have a method for setting `evaluation context` for a provider bound to a named client.",
526
+
"content": "The API MUST have a method for setting `evaluation context` for a `domain`.",
527
527
"RFC 2119 keyword": "MUST",
528
528
"children": []
529
529
},
530
530
{
531
531
"id": "Conditional Requirement 3.2.2.4",
532
532
"machine_id": "conditional_requirement_3_2_2_4",
533
-
"content": "The API MUST have a a mechanism to manage `evaluation context` for an associated name.",
533
+
"content": "The API MUST have a mechanism to manage `evaluation context` for an associated `domain`.",
-[Evaluating Flag Values](#evaluating-flag-values)
@@ -107,7 +108,9 @@ A source-of-truth for flag values and rules. Flag management systems may include
107
108
108
109
An SDK-compliant implementation which resolves flag values from a particular flag management system, allowing the use of the [Evaluation API](./sections/01-flag-evaluation.md#13-flag-evaluation) as an abstraction for the system in question.
109
110
110
-
Providers can be used in two ways. Client-specific providers are active for specific clients, based on their name. The default provider is used if there are no client-specific mappings setup.
111
+
### Domain
112
+
113
+
An identifier which logically binds clients with providers, allowing for multiple providers to be used simultaneously within a single application.
Copy file name to clipboardExpand all lines: specification/sections/01-flag-evaluation.md
+41-22Lines changed: 41 additions & 22 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -31,28 +31,29 @@ It's important that multiple instances of the `API` not be active, so that state
31
31
OpenFeature.setProvider(newMyProvider());
32
32
```
33
33
34
-
This provider is used if a client is not bound to a specific provider through its name.
34
+
The example above sets the default provider.
35
+
This provider is used if a client is not bound to a specific provider via a [domain](../glossary.md#domain).
35
36
36
-
See [provider](./02-providers.md), [creating clients](#creating-clients).
37
+
See [provider](./02-providers.md), [creating clients](#creating-clients) for details.
37
38
38
39
#### Requirement 1.1.2.2
39
40
40
41
> The `provider mutator` function **MUST** invoke the `initialize` function on the newly registered provider before using it to resolve flag values.
41
42
42
43
Application authors can await the newly set `provider's` readiness using the `PROVIDER_READY` event.
43
-
Provider instances which are already active (because they have been bound to other `names` or otherwise) need not be initialized again.
44
+
Provider instances which are already active (because they have been bound to another `domain` or otherwise) need not be initialized again.
44
45
The `provider's` readiness can state can be determined from its `status` member/accessor.
45
46
46
-
See [event handlers and initialization](./05-events.md#event-handlers-and-initialization), [provider initialization](./02-providers.md#24-initialization).
47
+
See [event handlers and initialization](./05-events.md#event-handlers-and-initialization), [provider initialization](./02-providers.md#24-initialization), [domain](../glossary.md#domain) for details.
47
48
48
49
#### Requirement 1.1.2.3
49
50
50
51
> The `provider mutator` function **MUST** invoke the `shutdown` function on the previously registered provider once it's no longer being used to resolve flag values.
51
52
52
53
When a provider is no longer in use, it should be disposed of using its `shutdown` mechanism.
53
-
Provider instances which are bound to multiple names won't be shut down until the last binding is removed.
54
+
Provider instances which are bound to multiple `domains` won't be shut down until the last binding is removed.
54
55
55
-
see:[shutdown](./02-providers.md#25-shutdown), [setting a provider](#setting-a-provider)
56
+
see [shutdown](./02-providers.md#25-shutdown), [setting a provider](#setting-a-provider), [domain](../glossary.md#domain) for details.
56
57
57
58
#### Requirement 1.1.2.4
58
59
@@ -61,28 +62,30 @@ see: [shutdown](./02-providers.md#25-shutdown), [setting a provider](#setting-a-
61
62
This function not only sets the provider, but ensures that the provider is ready (or in error) before returning or settling.
62
63
63
64
```java
64
-
// default client
65
+
// default provider
65
66
OpenFeatureAPI.getInstance().setProviderAndWait(myprovider); // this method blocks until the provider is ready or in error
Though it's possible to use [events](./05-events.md) to await provider readiness, such functions can make things simpler for `application authors` and `integrators`.
74
77
75
78
#### Requirement 1.1.3
76
79
77
-
> The `API`**MUST** provide a function to bind a given `provider` to one or more client `name`s. If the client-name already has a bound provider, it is overwritten with the new mapping.
80
+
> The `API`**MUST** provide a function to bind a given `provider` to one or more clients using a `domain`. If the domain already has a bound provider, it is overwritten with the new mapping.
Named clients can be associated with a particular provider by supplying a matching name when the provider is set.
86
+
Clients can be associated with a particular provider by supplying a matching `domain`` when the provider is set.
84
87
85
-
See [creating clients](#creating-clients).
88
+
See [creating clients](#creating-clients), [domain](../glossary.md#domain) for details.
86
89
87
90
#### Requirement 1.1.4
88
91
@@ -104,25 +107,38 @@ See [hooks](./04-hooks.md) for details.
104
107
OpenFeature.getProviderMetadata();
105
108
```
106
109
107
-
See [provider](./02-providers.md) for details.
110
+
It's possible to access provider metadata using a `domain`.
111
+
If a provider has not be registered under the requested domain, the default provider metadata is returned.
112
+
113
+
```typescript
114
+
// example provider accessor
115
+
OpenFeature.getProviderMetadata("domain-1");
116
+
```
117
+
118
+
See [provider](./02-providers.md), [domain](../glossary.md#domain) for details.
108
119
109
120
### Creating clients
110
121
111
122
#### Requirement 1.1.6
112
123
113
124
> The `API`**MUST** provide a function for creating a `client` which accepts the following options:
114
125
>
115
-
> -name (optional): A logical string identifier for the client.
126
+
> -domain (optional): A logical string identifier for binding clients to provider.
116
127
117
128
```java
118
129
// example client creation and retrieval
119
-
OpenFeature.getClient("my-named-client");
130
+
OpenFeature.getClient();
120
131
```
121
132
122
-
The name is a logical identifier for the client which may be associated with a particular provider by the application integrator.
123
-
If a client name is not bound to a particular provider, the client is associated with the default provider.
133
+
It's possible to create a client that is associated with a `domain`.
134
+
The client will use a provider in the same `domain` if one exists, otherwise, the default provide is used.
124
135
125
-
See [setting a provider](#setting-a-provider) for details.
136
+
```java
137
+
// example client creation and retrieval using a domain
138
+
OpenFeature.getClient("domain-1");
139
+
```
140
+
141
+
See [setting a provider](#setting-a-provider), [domain](../glossary.md#domain) for details.
126
142
127
143
#### Requirement 1.1.7
128
144
@@ -145,12 +161,15 @@ See [hooks](./04-hooks.md) for details.
145
161
146
162
#### Requirement 1.2.2
147
163
148
-
> The client interface **MUST** define a `metadata` member or accessor, containing an immutable `name` field or accessor of type string, which corresponds to the `name` value supplied during client creation.
164
+
> The client interface **MUST** define a `metadata` member or accessor, containing an immutable `domain` field or accessor of type string, which corresponds to the `domain` value supplied during client creation.
149
165
150
166
```typescript
151
-
client.getMetadata().getName(); // "my-client"
167
+
client.getMetadata().getDomain(); // "domain-1"
152
168
```
153
169
170
+
In previous drafts, this property was called `name`.
171
+
For backwards compatibility, implementations should consider `name` an alias to `domain`.
> When a `provider` signals the occurrence of a particular `event`, event handlers on clients which are not associated with that provider **MUST NOT** run.
44
44
45
-
Providers bound to a named client constitute their own "events scope".
45
+
Providers bound to a `domain` constitute their own "events scope".
46
46
47
-
see:[setting a provider](./01-flag-evaluation.md#setting-a-provider)
47
+
see [setting a provider](./01-flag-evaluation.md#setting-a-provider), [domain](../glossary.md#domain) for details.
0 commit comments