Configuration¶
Two separate mechanisms, deliberately kept apart. Config loads the YAML file
that describes cryptographic defaults — query plans, bounds, budget limits.
Settings reads deployment concerns from the environment: endpoints,
credentials, limits.
YAML configuration¶
config
¶
ConfigError
¶
Bases: ConfigurationError
Raised when there are configuration-related errors.
Initialize configuration error.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
message
|
str
|
Human-readable error message |
required |
config_key
|
str | None
|
The configuration key that caused the error |
None
|
error_code
|
str | None
|
Optional error code for programmatic handling |
None
|
Source code in src/cryptography_manager/exceptions.py
Config
¶
Initialize the configuration.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
config_data
|
dict[str, Any] | None
|
Optional initial configuration data |
None
|
Source code in src/cryptography_manager/config/config.py
load_from_file
¶
Load configuration from a file.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
file_path
|
str | Path
|
Path to the configuration file |
required |
Raises:
| Type | Description |
|---|---|
ConfigError
|
If file cannot be loaded or parsed |
Source code in src/cryptography_manager/config/config.py
get_submodule_config
¶
Return one top-level configuration section.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
submodule
|
str
|
Name of the section, e.g. |
required |
Returns:
| Type | Description |
|---|---|
dict[str, Any]
|
The section, or an empty mapping when it is absent. Returning an |
dict[str, Any]
|
empty mapping rather than |
dict[str, Any]
|
|
dict[str, Any]
|
|
Raises:
| Type | Description |
|---|---|
ConfigError
|
If the section cannot be read. |
Source code in src/cryptography_manager/config/config.py
Defaults¶
defaults
¶
Default configuration values for the Cryptography Manager.
This module defines all default configuration values used throughout the library, organized by component and feature area.
Environment settings¶
settings
¶
Environment-derived runtime settings.
These are deployment concerns -- where to send audit records, how to verify tokens, where to keep state -- as opposed to the cryptographic parameters in the YAML configuration file. Keeping them apart means the same config file can be mounted into different environments without editing.
Field names use a CRM_ prefix, but the unprefixed names some deployments
already set are accepted as aliases so nothing has to be renamed to adopt this.