management.util.startup_context¶
Context builder for startup strategies.
Classes¶
Builder for creating StartupContext objects. |
Module Contents¶
- class management.util.startup_context.StartupContextBuilder(output, current_version)[source]¶
Builder for creating StartupContext objects.
- Parameters:
current_version (packaging.version.Version)
- wizard_state: setup_wizard.SetupWizardState | None = None[source]¶
- storage_type: management.models.KeyStorageConfig.StorageType | None = None[source]¶
- with_db_version(db_version)[source]¶
Set the database version.
- Parameters:
db_version (packaging.version.Version) – The version from the database.
- Returns:
Self for method chaining.
- Return type:
- collect_wizard_state()[source]¶
Collect wizard state information.
- Returns:
Self for method chaining.
- Return type:
- collect_storage_config()[source]¶
Collect storage configuration information.
- Returns:
Self for method chaining.
- Return type:
- collect_dek_state()[source]¶
Collect DEK accessibility information.
- Returns:
Self for method chaining.
- Return type:
- _check_kek_exists_on_hsm(token)[source]¶
Check if the KEK actually exists on the physical HSM.
This method verifies that the KEK is not just referenced in the database, but actually exists on the physical HSM by attempting to load it.
- Parameters:
token (management.models.PKCS11Token) – The PKCS11Token to check.
- Returns:
True if KEK exists on HSM, False otherwise.
- Return type:
bool
- build()[source]¶
Build the StartupContext object.
- Returns:
The constructed StartupContext.
- Return type:
- build_for_db_init()[source]¶
Build a minimal StartupContext for database initialization scenarios.
This is used when the database is not initialized or has no version, so we can’t query for wizard state, storage config, or DEK state.
- Returns:
A minimal StartupContext with db_initialized=False.
- Return type: