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 GuestMiddleware(ResolveIdentityMiddleware): (source)
Constructor: GuestMiddleware(app, manager, permissions)
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__ |
Undocumented |
| Class Variable | redirect |
Undocumented |
| Instance Variable | _home |
Undocumented |
Inherited from ResolveIdentityMiddleware:
| Async Method | _establish |
Resolve the identity and bind the resulting context. |
| Class Variable | guard |
Undocumented |
| Instance Variable | _manager |
Undocumented |
| Instance Variable | _permissions |
Undocumented |
def __init__(self, app:
IApplication, manager: IAuthManager, permissions: IPermissionRepository):
(source)
¶
Initialise the middleware with its collaborators.
| Parameters | |
app:IApplication | Application exposing the auth.session configuration. |
manager:IAuthManager | Manager exposing the configured guards. |
permissions:IPermissionRepository | Source the authorization snapshot is built from. |
| Returns | |
None | The redirect target is resolved once, at boot time. |
Continue for guests and reject authenticated access to guest routes.
| Parameters | |
request:Request | Incoming request. |
callNextCallable | Remaining route pipeline. |
| Returns | |
Response | Guest response or a browser redirect to the home page. |
| Raises | |
AuthorizationException | If an authenticated JSON or AJAX client accesses a guest-only route. |