ORIONIS API REFERENCE

THE ORIONIS API

Build with clarity.

Explore the building blocks of an async-first Python framework. Every module, class, and method — connected, searchable, and ready to build with.

class documentation

class IAuthenticationContext(ABC): (source)

Known subclasses: orionis.auth.context.AuthenticationContext

View In Hierarchy

Define the authenticated state bound to a single request.

The context is never stored on a singleton. It lives in the container scope opened by the HTTP kernel, so two concurrent requests can never observe each other's identity.

Async Method authorization Return the effective authorization snapshot of the request.
Method identifier Return the unique identifier of the authenticated identity.
Class Variable __slots__ Undocumented
Property abilities Return the abilities carried by the presented credential.
Property credentialId Return the identifier of the credential that authenticated.
Property guard Return the name of the guard that resolved the identity.
Property identity Return the authenticated identity of the request.
Property isAuthenticated Report whether the request carries an authenticated identity.
Property isGuest Report whether the request is anonymous.
@abstractmethod
async def authorization(self) -> IAuthorizationSnapshot: (source)

Return the effective authorization snapshot of the request.

The snapshot is built at most once and reused by every later authorization check performed during the same request.

Returns
IAuthorizationSnapshotImmutable view of the permissions, roles and abilities that apply to the current request.
@abstractmethod
def identifier(self) -> object | None: (source)

Return the unique identifier of the authenticated identity.

Returns
object | NoneIdentifier of the identity, or None for a guest request.
@property
@abstractmethod
abilities: frozenset[str] | None = (source)

Return the abilities carried by the presented credential.

Returns
frozenset[str] | NoneAbilities of the access token, or None when the credential does not restrict the authorization of the identity.
@property
@abstractmethod
credentialId: object | None = (source)

Return the identifier of the credential that authenticated.

Returns
object | NoneIdentifier of the revocable credential, such as a personal access token, or None when the guard uses none.
@property
@abstractmethod
guard: str | None = (source)

Return the name of the guard that resolved the identity.

Returns
str | NoneGuard name, or None when nobody authenticated the request.
@property
@abstractmethod
identity: IAuthenticatable | None = (source)

Return the authenticated identity of the request.

Returns
IAuthenticatable | NoneResolved identity, or None for a guest request.
@property
@abstractmethod
isAuthenticated: bool = (source)

Report whether the request carries an authenticated identity.

Returns
boolTrue when an identity was resolved by a guard.
@property
@abstractmethod
isGuest: bool = (source)

Report whether the request is anonymous.

Returns
boolTrue when no identity was resolved by any guard.