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

Keep web login and registration routes restricted to guests.

Authenticated browsers are sent to the page declared in auth.session.home. Subclasses pin a different destination by overriding the redirect_to class attribute.

Method __init__ Initialise the middleware with its collaborators.
Async Method handle Continue for guests and reject authenticated access to guest routes.
Class Variable __slots__ Declare the instance attribute slots reserved by this class.
Class Variable redirect_to Explicit destination replacing the configured home page.
Instance Variable _home Redirect destination for users who are already authenticated.

Inherited from ResolveIdentityMiddleware:

Async Method _establish Resolve the identity and bind the resulting context.
Class Variable guard An unpinned middleware reuses the request guard. Before any resolution, None falls back to the configured default guard.
Instance Variable _manager Manager exposing the configured guards.
Instance Variable _permissions Source the authorization snapshot is built from.
def __init__(self, app: IApplication, manager: IAuthManager, permissions: IPermissionRepository): (source)

Initialise the middleware with its collaborators.

Parameters
app:orionis.IApplicationApplication exposing the auth.session configuration.
manager:orionis.auth.contracts.IAuthManagerManager exposing the configured guards.
permissions:orionis.auth.contracts.IPermissionRepositorySource the authorization snapshot is built from.
Returns
NoneNo return value.
async def handle(self, request: Request, call_next: NextCallable) -> Response: (source)

Continue for guests and reject authenticated access to guest routes.

Parameters
request:orionis.http.RequestIncoming request.
call_next:orionis.http.NextCallableRemaining route pipeline.
Returns
orionis.http.ResponseGuest response or a browser redirect to the home page.
Raises
orionis.auth.AuthorizationExceptionIf an authenticated JSON or AJAX client accesses a guest-only route.
__slots__: tuple[str, ...] = (source)

Declare the instance attribute slots reserved by this class.

redirect_to: ClassVar[str | None] = (source)

Explicit destination replacing the configured home page.

Redirect destination for users who are already authenticated.