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

Establish authentication while allowing anonymous requests to continue.

The HTTP kernel installs the session variant for web routes and the token variant for API routes. Guests reach the controller with a guest context, and Auth.check() answers False.

An authenticated context cannot be replaced by another guard. Repeated resolution by the same guard reuses the context, including guest results.

Subclasses pin a specific guard by overriding the guard class attribute:

class ResolveApiIdentity(ResolveIdentityMiddleware):
    guard = "token"
Method __init__ Initialise the middleware with its collaborators.
Async Method _establish Resolve the identity and bind the resulting context.
Async Method handle Bind the authentication context and continue the pipeline.
Class Variable __slots__ Undocumented
Class Variable guard Undocumented
Instance Variable _manager Undocumented
Instance Variable _permissions Undocumented
def __init__(self, manager: IAuthManager, permissions: IPermissionRepository): (source)

Initialise the middleware with its collaborators.

Parameters
manager:IAuthManagerManager exposing the configured guards.
permissions:IPermissionRepositorySource the authorization snapshot is built from.
Returns
NoneMiddleware instances are built once at boot and stay stateless afterwards.
async def _establish(self, request: Request) -> IAuthenticationContext: (source)

Resolve the identity and bind the resulting context.

The context is stored in the container scope opened by the HTTP kernel, never on this middleware: instances are shared by every concurrent request.

Parameters
request:RequestIncoming HTTP request.
Returns
IAuthenticationContextContext bound for the rest of the request.
async def handle(self, request: Request, call_next: NextCallable) -> Response: (source)

Bind the authentication context and continue the pipeline.

Parameters
request:RequestIncoming HTTP request.
call_next:NextCallableCallable advancing to the next layer.
Returns
ResponseResponse produced by the rest of the pipeline.
guard: ClassVar[str | None] = (source)

Undocumented

_manager = (source)

Undocumented

_permissions = (source)

Undocumented