open-feature / dotnet-sdk

.NET implementation of the OpenFeature SDK
https://openfeature.dev
Apache License 2.0
61 stars 17 forks source link

[FEATURE] Implement domain scoping #249

Closed beeme1mr closed 1 week ago

beeme1mr commented 5 months ago

Overview

A domain is an identifier that logically binds clients with providers, allowing multiple providers to be used simultaneously within a single application.

Domains were added to the spec in the following PR: https://github.com/open-feature/spec/pull/229

Tasks

### Tasks
- [ ] [Requirement 1.1.3](https://openfeature.dev/specification/sections/flag-evaluation#requirement-113): 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.
- [ ] [Requirement 1.1.6](https://openfeature.dev/specification/sections/flag-evaluation#requirement-116): The API MUST provide a function for creating a client which accepts `domain`
- [ ] [Requirement 1.2.2](https://openfeature.dev/specification/sections/flag-evaluation#requirement-122): 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.
- [ ] [Requirement 3.2.2.3](https://openfeature.dev/specification/sections/evaluation-context#conditional-requirement-3223): The API MUST have a method for setting evaluation context for a domain.
- [ ] [Requirement 3.2.2.4](https://openfeature.dev/specification/sections/evaluation-context#conditional-requirement-3224): The API MUST have a mechanism to manage evaluation context for an associated domain.
- [ ] Update the `named provider` section of the readme to `domain`. See the JS SDK readme for an example: https://github.com/open-feature/js-sdk/tree/main/packages/server#domains

Reference implementations

Support was added in the JS SDK here and the Python SDK here.

[!NOTE] Some SDKs support named clients which predate domains. The domain term is intended to clarify intended behavior.

toddbaert commented 3 weeks ago

@benjiro I just saw you self-assigned this.

Please note that I think in the case of this SDK, there's not much work. It's mostly renaming client name, and name to domain. We basically already have this concept with named clients.

benjiro commented 3 weeks ago

@benjiro I just saw you self-assigned this.

Please note that I think in the case of this SDK, there's not much work. It's mostly renaming client name, and name to domain. We basically already have this concept with named clients.

Yea I was going to do the renames over the weekend. Didnt get the time. If you want to knock it out go a head otherwise I'll try and make some time next weekend.