open-feature / open-feature/swift-sdk

Supply the bound domain to provider initialization

Open
#121 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Swift
Stars
31
Forks
14
Avg merge
1d 12h
Merged PRs (30d)
2

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
- Make the bound `domain` available to provider initialization. `initialize` is a required protocol method today, so changing its signature is a breaking change; introduce it accordingly
- 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

### Related

- Depends on domain support landing first: #96

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

Open the contributing guide

Research direction

Start with the provider mutator and the required provider initialize protocol method, then review the domain support from #96. Trace provider registration and binding to determine where initialization receives the domain and where domain-scoped providers are rejected. Done means the API change, enforcement, associated tests, and documentation are covered.

Written by the indexing model from the issue text.

Assessment

Tech stack
swift
Domain
api, mobile-dev
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.