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 StartSessionMiddleware(BaseMiddleware): (source)
Constructor: StartSessionMiddleware(manager, catch)
Open request sessions and persist their response-side changes.
| Static Method | __store |
Record the current URL as the page to redirect back to. |
| Method | __init__ |
Initialise the middleware with the given session manager. |
| Async Method | __response |
Render failures while the session is still available for persistence. |
| Async Method | handle |
Process the request through the session lifecycle. |
| Class Variable | __slots__ |
Declare the instance attribute slots reserved by this class. |
| Instance Variable | _catch |
Framework exception handler producing responses before persistence. |
| Instance Variable | _manager |
Session manager used for the start / save cycle. |
| Instance Variable | _track |
Track previous url obtained from manager.tracksPreviousUrl. |
Record the current URL as the page to redirect back to.
Only GET/HEAD responses with status 200-299 are stored, excluding AJAX and requests that want JSON. Other statuses, background calls and form submissions never overwrite the previous page.
| Parameters | |
request:orionis.http.Request | Incoming HTTP request. |
response:orionis.http.Response | Outgoing HTTP response. |
session:orionis.session.contracts.ISession | Active session for this request. |
| Returns | |
None | Record the current URL as the page to redirect back to. |
Initialise the middleware with the given session manager.
| Parameters | |
manager:orionis.session.manager.SessionManager | Session manager used for the start / save cycle. |
catch:orionis.failure.contracts.ICatch | Framework exception handler producing responses before persistence. |
| Returns | |
None | Initialise the middleware with the given session manager. |
async def __response(self, request:
Request, call_next: Callable[ [], Awaitable[ Response]]) -> Response:
(source)
¶
Render failures while the session is still available for persistence.
| Parameters | |
request:orionis.http.Request | Incoming request. |
callCallable[[], Awaitable[Response]] | Remaining middleware and controller pipeline. |
| Returns | |
orionis.http.Response | Normal response or the framework's exception response. |
| Raises | |
orionis.console.debug.dumper.HttpDump | If a dump must propagate to the HTTP kernel after session cleanup. |
async def handle(self, request:
Request, call_next: Callable[ [], Awaitable[ Response]]) -> Response:
(source)
¶
Process the request through the session lifecycle.
| Parameters | |
request:orionis.http.Request | Incoming HTTP request. |
callCallable[[], Awaitable[Response]] | No-arg async callable that advances to the next middleware or final route handler. |
| Returns | |
orionis.http.Response | The outgoing HTTP response, optionally augmented with a Set-Cookie header when the session was used. |