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

View In Hierarchy

Define the stateful operations supported by session authentication.

Async Method attempt Validate credentials and start an authenticated session.
Method login Persist an identity in the session of the current request.
Async Method logout Drop the authenticated state from the session.
Class Variable __slots__ Undocumented

Inherited from IGuard:

Async Method resolve Resolve the identity backing the incoming request.
Property name Return the configuration name of this guard.
@abstractmethod
async def attempt(self, request: Request, credentials: Mapping[str, object], *, remember: bool = False) -> IAuthenticatable | None: (source)

Validate credentials and start an authenticated session.

Parameters
request:RequestIncoming HTTP request owning the session.
credentials:Mapping[str, object]Submitted credentials, typically the username and password.
remember:bool, optionalIssue a persistent login credential after verifying the password.
Returns
IAuthenticatable | NoneAuthenticated identity, or None when the credentials do not match any identity.
@abstractmethod
def login(self, request: Request, identity: IAuthenticatable): (source)

Persist an identity in the session of the current request.

The session identifier is rotated to close any session fixation window opened before the login.

Parameters
request:RequestIncoming HTTP request owning the session.
identity:IAuthenticatableIdentity to remember for subsequent requests.
Returns
NoneThe session is mutated as a side effect.
@abstractmethod
async def logout(self, request: Request): (source)

Drop the authenticated state from the session.

Parameters
request:RequestIncoming HTTP request owning the session.
Returns
NoneThe session is invalidated as a side effect.