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.

package documentation

Group the auth context components and public imports.

Module context Hold the authenticated state of one request.
Module functions Provide auth context operations.

From __init__.py:

Class AuthenticationContext Hold the authenticated state of one request.
Function __dir__ List loaded attributes and declared public exports.
Function __getattr__ Resolve and cache a public package export.
Function bind_auth_context Bind an authentication context to the current scope.
Function current_auth_context Return the authentication context bound to the current scope.
Constant _EXPORTS Public export names mapped to their defining modules and attributes.
Constant GUEST_CONTEXT Shared context handed to every request nobody authenticated. It carries no identity and resolves to the empty snapshot, so sharing is safe.
def __dir__() -> list[str]: (source)

List loaded attributes and declared public exports.

Returns
list[str]Sorted attribute names available on this package.
def __getattr__(name: str) -> object: (source)

Resolve and cache a public package export.

Parameters
name:strPublic attribute requested from this package.
Returns
objectExported object from its defining module.
Raises
AttributeErrorIf the requested attribute is not exported.
def bind_auth_context(context: IAuthenticationContext): (source)

Bind an authentication context to the current scope.

Parameters
context:orionis.auth.contracts.IAuthenticationContextContext resolved for the running request.
Returns
NoneNo return value.
Raises
orionis.auth.AuthExceptionWhen no container scope is active, which means the caller is not inside a request and has nowhere to store the context.
def current_auth_context() -> IAuthenticationContext: (source)

Return the authentication context bound to the current scope.

The context lives in the container scope the HTTP kernel opens for every request, which is backed by contextvars. Code running outside a request, such as a console command, always sees the shared guest context.

Returns
orionis.auth.contracts.IAuthenticationContextContext of the running request, or the shared guest context when no scope is active or nothing was bound yet.
_EXPORTS: dict = (source)

Public export names mapped to their defining modules and attributes.

Value
{'GUEST_CONTEXT': ('orionis.auth.context.context', 'GUEST_CONTEXT'),
 'AuthenticationContext': ('orionis.auth.context.context',
                           'AuthenticationContext'),
 'bind_auth_context': ('orionis.auth.context.functions', 'bind_auth_context'),
 'current_auth_context': ('orionis.auth.context.functions',
                          'current_auth_context')}

Shared context handed to every request nobody authenticated. It carries no identity and resolves to the empty snapshot, so sharing is safe.

Value
AuthenticationContext()