open-feature / open-feature/rust-sdk
Supply the bound domain to provider initialization
- Dominant language
- Rust
- Stars
- 51
- Forks
- 13
- Avg merge
- 3d 24m
- Merged PRs (30d)
- 3
Description
The spec now supplies the bound `domain` to a provider's `initialize` function, and adds an opt-in `domain-scoped` provider declaration that the API enforces by binding such a provider to at most one `domain`. This lets stateful providers (e.g. an OFREP static-context provider with a persistent cache) scope their state to a single, unambiguous `domain`.
### What needs to happen
- Pass the bound `domain` (if any) to the provider's `initialize` when it's registered via the provider mutator
- Extend the provider `initialize` to accept the optional `domain` (non-breaking, additional optional parameter on the trait method)
- Add a way for a provider to declare itself `domain-scoped`
- Enforce that a `domain-scoped` provider is bound to at most one `domain`, rejecting any attempt to bind an already-bound instance to another `domain`
- Associated testing and docs
### Links
- Parent issue: https://github.com/open-feature/spec/issues/403
- Spec sections: [1.1 Flag evaluation](https://openfeature.dev/specification/sections/flag-evaluation), [2.4 Initialization](https://openfeature.dev/specification/sections/providers)
Contributor guide
Research direction
Start by tracing provider registration through the provider mutator and locating the provider initialize trait method. Verify the optional bound domain is passed during registration, domain-scoped providers reject a second domain binding, and associated tests and documentation cover the new behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- api, backend-api-design
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 52/100