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

Configure the session middleware.

Parameters
driverSession driver. Defaults to SessionDriver.MEMORY.
lifetimeSession lifetime in minutes. Defaults to 120.
expire_on_closeExpire session on browser close (omits Max-Age). Defaults to False.
track_previous_urlRemember successful navigation URLs in the session. Defaults to True.
renewal_intervalMinimum seconds between renewal writes for unchanged scalar payloads. Zero renews every request. Must be strictly below the lifetime in seconds so renewal can occur while the session is still valid. Mutable payloads and dirty sessions are always persisted.
filesPath to session files (file driver). Defaults to 'storage/framework/sessions'.
connectionDatabase connection for session storage (database driver). Defaults to None.
tableDatabase table for session storage (database driver). Defaults to 'sessions'.
cacheCache store for session storage (cache driver). Defaults to None.
cookieName of the session cookie. Defaults to 'sessionid'.
pathCookie path. Defaults to '/'.
domainCookie domain for cross-subdomain usage.
secureRestrict cookies to HTTPS. Defaults to False.
http_onlyPrevent JavaScript from accessing the cookie. Defaults to True.
same_siteSameSite cookie policy. Defaults to SameSitePolicy.LAX.
partitionedEnable CHIPS (partitioned) cookies. Defaults to False.
Returns
NoneThis class does not return a value.
Method __post_init__ Validate all fields after dataclass initialisation.
Method __validateBooleans Validate all boolean fields in a single pass.
Method __validateCache Validate the cache field.
Method __validateConnection Validate the connection field.
Method __validateCookie Validate the cookie field.
Method __validateDomain Validate the domain field.
Method __validateDriver Normalise and validate the driver field.
Method __validateFiles Validate the files path field.
Method __validateLifetime Validate the lifetime field.
Method __validatePath Validate the path field.
Method __validateSameSite Normalise and validate the same_site field.
Method __validateTable Validate the table field.
Class Variable cache Undocumented
Class Variable connection Undocumented
Class Variable cookie Undocumented
Class Variable domain Undocumented
Class Variable driver Undocumented
Class Variable expire_on_close Undocumented
Class Variable files Undocumented
Class Variable http_only Undocumented
Class Variable lifetime Undocumented
Class Variable partitioned Undocumented
Class Variable path Undocumented
Class Variable renewal_interval Undocumented
Class Variable same_site Undocumented
Class Variable secure Undocumented
Class Variable table Undocumented
Class Variable track_previous_url Undocumented

Inherited from BaseEntity:

Class Method _cachedFieldMetadata Retrieve field definitions and normalized types cached by class.
Method getFields Describe field names, normalized types, defaults, and metadata.
Method toDict Convert the dataclass instance to a recursively copied dictionary.
Class Variable __slots__ Undocumented
def __post_init__(self): (source)

Validate all fields after dataclass initialisation.

Called automatically by the dataclass machinery immediately after __init__. Delegates to individual field validators in a deterministic order.

Parameters
self:SessionThe Session instance being validated.
Returns
NoneNo value is returned.
def __validateBooleans(self): (source)

Validate all boolean fields in a single pass.

Iterate over every boolean field and raise on the first value that is not a bool instance.

Parameters
self:SessionThe Session instance being validated.
Returns
NoneNo value is returned.
Raises
TypeErrorIf any boolean field holds a non-boolean value.
def __validateCache(self): (source)

Validate the cache field.

When provided the value must be a non-empty string naming a cache store (cache driver).

Parameters
self:SessionThe Session instance being validated.
Returns
NoneNo value is returned.
Raises
ValueErrorIf cache is provided but is not a non-empty string.
def __validateConnection(self): (source)

Validate the connection field.

When provided the value must be a non-empty string naming a database connection (database driver).

Parameters
self:SessionThe Session instance being validated.
Returns
NoneNo value is returned.
Raises
ValueErrorIf connection is provided but is not a non-empty string.
def __validateCookie(self): (source)

Validate the cookie field.

The cookie name must conform to the restrictions imposed by RFC 6265.

Returns
NoneThis method performs validation and returns None.
Raises
ValueErrorIf the cookie name is invalid.
def __validateDomain(self): (source)

Validate the domain field.

When provided the domain must be a non-empty string that does not begin or end with a dot and contains no consecutive dots.

Parameters
self:SessionThe Session instance being validated.
Returns
NoneNo value is returned.
Raises
ValueErrorIf domain is an empty string or violates dot rules.
def __validateDriver(self): (source)

Normalise and validate the driver field.

Accept a SessionDriver enum member or a plain string matching a recognised driver name (case-insensitive). When a valid string is supplied it is coerced to the corresponding SessionDriver member via object.__setattr__.

Parameters
self:SessionThe Session instance being validated.
Returns
NoneMutates driver in-place when a plain string is given.
Raises
ValueErrorIf the string does not match any registered driver name.
TypeErrorIf the value is neither a str nor a SessionDriver.
def __validateFiles(self): (source)

Validate the files path field.

When provided the value must be a non-empty string pointing to the directory used by the file session driver.

Parameters
self:SessionThe Session instance being validated.
Returns
NoneNo value is returned.
Raises
ValueErrorIf files is provided but is not a non-empty string.
def __validateLifetime(self): (source)

Validate the lifetime field.

The lifetime represents the server-side session duration in minutes and must be a strictly positive integer.

Parameters
self:SessionThe Session instance being validated.
Returns
NoneNo value is returned.
Raises
TypeErrorIf lifetime is not an int.
ValueErrorIf lifetime is not strictly greater than zero.
def __validatePath(self): (source)

Validate the path field.

The cookie path must be a string that begins with '/' as required by RFC 6265 §4.1.1.

Parameters
self:SessionThe Session instance being validated.
Returns
NoneNo value is returned.
Raises
ValueErrorIf path is not a string or does not start with '/'.
def __validateSameSite(self): (source)

Normalise and validate the same_site field.

Accept a SameSitePolicy member or a plain string. The stored value is always the canonical lowercase string form of the policy (e.g. "lax").

Parameters
self:SessionThe Session instance being validated.
Returns
NoneMutates same_site in-place to its canonical string form.
Raises
ValueErrorIf the string is not a valid SameSitePolicy value.
TypeErrorIf the value is neither a str nor a SameSitePolicy.
def __validateTable(self): (source)

Validate the table field.

When provided the value must be a non-empty string naming the database table used to persist session records (database driver).

Parameters
self:SessionThe Session instance being validated.
Returns
NoneNo value is returned.
Raises
ValueErrorIf table is provided but is not a non-empty string.
cache: str | None = (source)

Undocumented

connection: str | None = (source)

Undocumented

Undocumented

domain: str | None = (source)

Undocumented

driver: str | SessionDriver = (source)

Undocumented

expire_on_close: bool = (source)

Undocumented

files: str | None = (source)

Undocumented

http_only: bool = (source)

Undocumented

lifetime: int = (source)

Undocumented

partitioned: bool = (source)

Undocumented

Undocumented

renewal_interval: int = (source)

Undocumented

same_site: str | SameSitePolicy = (source)

Undocumented

Undocumented

table: str | None = (source)

Undocumented

track_previous_url: bool = (source)

Undocumented