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.
Undocumented
| Function | _as |
Coerce a stored timestamp into a datetime. |
| Function | _decode |
Deserialise the abilities stored for a token. |
| Function | _encode |
Serialise the abilities of a token for storage. |
| Function | _is |
Report whether an expiration moment already elapsed. |
| Function | _normalize |
Validate credential restrictions without coercing malformed values. |
| Function | _unexpired |
Group the nullable expiration constraint for token use. |
| Function | _utc |
Return the current UTC moment as a naive datetime. |
| Constant | _DEFAULT |
Undocumented |
| Constant | _DEFAULT |
Undocumented |
| Constant | _MAX |
Undocumented |
| Constant | _MAX |
Undocumented |
| Constant | _MAX |
Undocumented |
| Constant | _TOKEN |
Undocumented |
Coerce a stored timestamp into a datetime.
Queries over a table the builder knows no schema for come back with whatever the driver produced, and SQLite hands timestamps back as plain strings. Normalising here keeps the expiration check correct on every dialect.
| Parameters | |
value:object | Raw value read from a timestamp column. |
| Returns | |
datetime | None | Parsed UTC moment without an offset, or None for SQL NULL. |
| Raises | |
TokenException | If a non-null timestamp is malformed. |
Report whether an expiration moment already elapsed.
| Parameters | |
value:datetime | None | Normalised expiration moment of the token. |
| Returns | |
bool | True when the moment is in the past. A missing value means the token never expires on its own. |
Validate credential restrictions without coercing malformed values.
| Parameters | |
abilities:Iterable[str] | None | Explicit restrictions, or None for an unrestricted credential. |
| Returns | |
frozenset[str] | None | Deduplicated, validated abilities. |
| Raises | |
TokenException | If the input is a string or contains invalid ability names. |
Group the nullable expiration constraint for token use.
| Parameters | |
query:QueryBuilderBase | Nested group assembled by the query builder. |
| Returns | |
None | The group accepts only unexpired tokens or SQL NULL deadlines. |
Return the current UTC moment as a naive datetime.
Token columns are declared without a timezone so every dialect stores the same value. Dropping the offset here keeps writes and reads symmetric across SQLite, PostgreSQL and MySQL.
| Returns | |
datetime | Current UTC moment without timezone information. |