Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Spec change for named client -> provider mappings #183

Merged
merged 3 commits into from
May 3, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 11 additions & 4 deletions specification.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,34 +10,41 @@
{
"id": "Requirement 1.1.2",
"machine_id": "requirement_1_1_2",
"content": "The `API` MUST provide a function to set the global `provider` singleton, which accepts an API-conformant `provider` implementation.",
"content": "The `API` MUST provide a function to set the default `provider`, which accepts an API-conformant `provider` implementation.",
"RFC 2119 keyword": "MUST",
"children": []
},
{
"id": "Requirement 1.1.3",
"machine_id": "requirement_1_1_3",
"content": "The `API` MUST provide a function to add `hooks` which accepts one or more API-conformant `hooks`, and appends them to the collection of any previously added hooks. When new hooks are added, previously added hooks are not removed.",
"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.",
"RFC 2119 keyword": "MUST",
"children": []
},
{
"id": "Requirement 1.1.4",
"machine_id": "requirement_1_1_4",
"content": "The API MUST provide a function for retrieving the metadata field of the configured `provider`.",
"content": "The `API` MUST provide a function to add `hooks` which accepts one or more API-conformant `hooks`, and appends them to the collection of any previously added hooks. When new hooks are added, previously added hooks are not removed.",
"RFC 2119 keyword": "MUST",
"children": []
},
{
"id": "Requirement 1.1.5",
"machine_id": "requirement_1_1_5",
"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.",
"content": "The API MUST provide a function for retrieving the metadata field of the configured `provider`.",
"RFC 2119 keyword": "MUST",
"children": []
},
{
"id": "Requirement 1.1.6",
"machine_id": "requirement_1_1_6",
"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.",
"RFC 2119 keyword": "MUST",
"children": []
},
{
"id": "Requirement 1.1.7",
"machine_id": "requirement_1_1_7",
"content": "The client creation function MUST NOT throw, or otherwise abnormally terminate.",
"RFC 2119 keyword": "MUST NOT",
"children": []
Expand Down
18 changes: 14 additions & 4 deletions specification/sections/01-flag-evaluation.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,17 +22,27 @@ It's important that multiple instances of the `API` not be active, so that state

#### Requirement 1.1.2

> The `API` **MUST** provide a function to set the global `provider` singleton, which accepts an API-conformant `provider` implementation.
> The `API` **MUST** provide a function to set the default `provider`, which accepts an API-conformant `provider` implementation.

```typescript
// example provider mutator
OpenFeature.setProvider(new MyProvider());
```

This provider is used if there is not a more specific client name binding. (see later requirements).

See [provider](./02-providers.md) for details.

#### Requirement 1.1.3

> 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.

```java
OpenFeature.setProvider("client-name", new MyProvider());
```

#### Requirement 1.1.4

> The `API` **MUST** provide a function to add `hooks` which accepts one or more API-conformant `hooks`, and appends them to the collection of any previously added hooks. When new hooks are added, previously added hooks are not removed.

```typescript
Expand All @@ -42,7 +52,7 @@ OpenFeature.addHooks([new MyHook()]);

See [hooks](./04-hooks.md) for details.

#### Requirement 1.1.4
#### Requirement 1.1.5

> The API **MUST** provide a function for retrieving the metadata field of the configured `provider`.

Expand All @@ -53,7 +63,7 @@ OpenFeature.getProviderMetadata();

See [provider](./02-providers.md) for details.

#### Requirement 1.1.5
#### Requirement 1.1.6

> The `API` **MUST** provide a function for creating a `client` which accepts the following options:
>
Expand All @@ -68,7 +78,7 @@ OpenFeature.getClient({

The name is a logical identifier for the client.

#### Requirement 1.1.6
#### Requirement 1.1.7

> The client creation function **MUST NOT** throw, or otherwise abnormally terminate.

Expand Down