Skip to content

Supply the bound domain to provider initialization across SDKs #403

Description

@jonathannorris

Context

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.

Relevant spec sections

Requirements summary

Requirement Level Description
1.1.2.2 MUST The provider mutator supplies the bound domain (if any) when invoking initialize
2.4.1 MAY initialize accepts the global evaluation context and an optional bound domain
2.4.3 MAY A provider may declare itself domain-scoped (maintains per-domain state that can't be shared)
2.4.4 MUST A domain-scoped provider must accept the bound domain during initialization
1.1.8 / 1.1.8.1 MUST NOT The provider mutator must not bind a domain-scoped provider instance to more than one domain, rejecting any attempt to bind an already-bound instance to an additional domain

Section 1.8.4 prose was also updated: a provider instance can back multiple domains unless it declares itself domain-scoped.

Non-functional requirements

  • Add the domain parameter in a backwards-compatible way where the language allows it (optional/overloaded/default parameter). This is non-breaking in JS, Java, Python, .NET, Ruby, and Rust.
  • In languages where initialize/Init is a required interface/protocol method (Go, Kotlin, Swift), introduce it via an optional secondary interface or batch it into the next major; the domain-scoped declaration should likewise be opt-in.
  • PHP has no initialization hook today; adding one is out of scope here unless done separately.
  • Associated testing and README/docs updates.

Implementation tracking

Child issues:

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions