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.
Expose an algorithm-agnostic hashing API.
Resolve the configured password hashing driver and delegate every operation to it, so application code never depends on a concrete algorithm.
Concurrency
No locks are used. The only mutable state is the driver cache, written the first time a driver is resolved: a concurrent first resolution from several threads may build the same driver twice, and the last write wins. Driver resolution is synchronous and never suspends, so tasks sharing an event loop never observe a partially built cache; only the hashing work itself is awaited on a worker thread. setRounds mutates the cached driver, and the provider binds this class as a singleton, so the change is visible to the whole application.
| Method | __init__ |
Initialize the manager from the application hashing configuration. |
| Method | _build |
Instantiate the driver identified by name. |
| Async Method | check |
Verify a plain text value against an encoded hash. |
| Method | driver |
Return the hasher bound to the named (or default) driver. |
| Method | get |
Return the algorithm identifier of the default driver. |
| Method | get |
Return the name of the configured default driver. |
| Async Method | make |
Hash a plain text value with the default driver. |
| Method | needs |
Determine whether a hash was produced with outdated parameters. |
| Method | set |
Set the default cost factor used by the default driver. |
| Class Variable | __slots__ |
Undocumented |
| Instance Variable | _config |
Undocumented |
| Instance Variable | _default |
Undocumented |
| Instance Variable | _drivers |
Undocumented |
Initialize the manager from the application hashing configuration.
A missing hashing section falls back to the defaults declared by the configuration entity.
| Parameters | |
app:IApplication | Application container used to read the configuration. |
| Returns | |
None | This method initializes the instance and returns None. |
Return the hasher bound to the named (or default) driver.
| Parameters | |
name:str | None | Driver name ('argon2' or 'bcrypt'). None selects the configured default driver. |
| Returns | |
IHasher | Hasher instance for the requested driver, created on first access and cached afterwards. |
| Raises | |
HashDriverNotSupportedException | If the requested driver is not supported. |
Return the algorithm identifier of the default driver.
| Returns | |
str | Algorithm identifier, such as 'argon2id' or 'bcrypt'. |
Return the name of the configured default driver.
| Returns | |
str | Driver name, such as 'argon2' or 'bcrypt'. |
str, *, rounds: int | None = None, memory: int | None = None, threads: int | None = None) -> str:
(source)
¶
orionis.hashing.contracts.IHasher.makeHash a plain text value with the default driver.
The hashing work runs on a worker thread, so the event loop stays free while the cost parameters are burned.
| Parameters | |
value:str | Plain text value to hash. |
rounds:int | None | Per-call cost override. |
memory:int | None | Per-call memory cost override, in kibibytes. |
threads:int | None | Per-call parallelism override. |
| Returns | |
str | Encoded hash produced by the default driver. |
Set the default cost factor used by the default driver.
| Parameters | |
rounds:int | New cost factor. |
| Returns | |
Self | The same manager instance, allowing fluent configuration. |
| Raises | |
HashConfigurationException | If the value is not valid for the active driver. |