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 TokenGuard(IGuard): (source)

Constructor: TokenGuard(tokens, identities)

View In Hierarchy

Resolve the identity of API requests from a personal access token.

The token travels in the standard header:

Authorization: Bearer <token>

Tokens are opaque, revocable and optionally expiring. No signed payload such as a JWT is involved, so revocation is immediate.

Concurrency

The guard is stateless and safe as a singleton. The only write it performs is the last_used_at update, issued as a single statement where the last writer legitimately wins.

Method __init__ Initialise the guard with its collaborators.
Async Method resolve Resolve the identity owning the presented access token.
Class Variable __slots__ Undocumented
Instance Variable __identities Undocumented
Instance Variable __tokens Undocumented
Property name Return the configuration name of this guard.
def __init__(self, tokens: IAccessTokenRepository, identities: IIdentityProvider): (source)

Initialise the guard with its collaborators.

Parameters
tokens:IAccessTokenRepositoryStore used to look tokens up and mark them as used.
identities:IIdentityProviderProvider turning a token owner into an identity.
Returns
NoneOnly the collaborators are retained.
async def resolve(self, request: Request) -> GuardResult | None: (source)

Resolve the identity owning the presented access token.

Parameters
request:RequestIncoming HTTP request.
Returns
GuardResult | NoneResolved identity together with the abilities of the token, or None when the request carries no usable token.
__slots__: tuple[str, ...] = (source)

Undocumented

__identities = (source)

Undocumented

__tokens = (source)

Undocumented

Return the configuration name of this guard.

Returns
strAlways "token".