Skip to content

common_auth.contracts.access

Exact audience identifiers and immutable access-scope labels.

Scope labels retain their meaning independently of a protocol’s wire encoding. OAuth conversion is explicit. These values neither select issuer defaults nor assert that a caller is authorized for an audience or scope.

Classes

ScopeSet

Bases: BaseModel

Distinct exact scope labels, with explicit OAuth text conversion.

Lists, tuples and sets construct the same immutable value; ordinary dumps contain sorted lists. Case, Unicode and boundary spaces are not rewritten. OAuth conversion imposes its narrower token grammar on each label. An empty set is known-empty, not evidence of an omitted/unknown scope field.

Fields and properties declared here; inherited members belong to the bases above.

values

values: frozenset[_IdentityText] = frozenset()

from_oauth

@classmethod
def from_oauth(value: str) -> Self

Parse nonempty OAuth scope text without trimming or guessing separators.

issuperset

def issuperset(required: ScopeSet) -> bool

Check exact label containment; issuer/audience/policy checks are separate.

to_oauth

def to_oauth() -> str

Encode valid OAuth labels in stable order; reject an empty scope set.