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

Undocumented

Module functions Undocumented
Module repository No module docstring; 0/6 constant, 7/7 functions documented

From __init__.py:

Class AccessTokenRepository Persist personal access tokens through the Orionis query builder.
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.
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.