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 tokens components and public imports.

Module functions Provide auth tokens operations.
Module lookup Provide auth tokens operations through lookup_owner.
Module repository Persist personal access tokens through the Orionis query builder.
Module schema Provide auth tokens operations through build_tokens_table.

From __init__.py:

Class AccessTokenRepository Persist personal access tokens through the Orionis query builder.
Function __dir__ List loaded attributes and declared public exports.
Function __getattr__ Resolve and cache a public package export.
Function generate_token_secret Generate the plain text secret of a personal access token.
Function hash_token_secret Derive the value persisted for a personal access token.
Constant _EXPORTS Public export names mapped to their defining modules and attributes.
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 generate_token_secret(size: int) -> str: (source)

Generate the plain text secret of a personal access token.

Parameters
size:intNumber of random bytes backing the secret. The returned string is longer because it is URL-safe base64 encoded.
Returns
strCryptographically secure random string. secrets is used on purpose: random is not suitable for credentials.
def hash_token_secret(secret: str) -> str: (source)

Derive the value persisted for a personal access token.

Only this digest reaches the database, so a leaked row never exposes a usable credential. SHA-256 is appropriate here because the input is already high entropy random data, unlike a user chosen password.

Parameters
secret:strPlain text token presented by the client.
Returns
strHexadecimal SHA-256 digest of the secret, 64 characters long.
_EXPORTS: dict = (source)

Public export names mapped to their defining modules and attributes.

Value
{'AccessTokenRepository': ('orionis.auth.tokens.repository',
                           'AccessTokenRepository'),
 'generate_token_secret': ('orionis.auth.tokens.functions',
                           'generate_token_secret'),
 'hash_token_secret': ('orionis.auth.tokens.functions', 'hash_token_secret')}