key vault interface documentation
API Reference
class key_vault_interface.KeyVaultInterface(*args, **kwargs)
Bases: object
This class serves as an interface for interacting with Azure Key Vault.
Implements a singleton pattern to ensure only one instance is created. It handles the interaction with Azure Key Vault to retrieve secrets and manage them in memory.
- Parameters:
- key_vault_name – The Azure Key Vault name.
- tenant_id – Azure AD Tenant ID.
- client_id – Azure Client ID.
- client_secret_var_name – The environment variable to use to load the client secret matching the client ID.
- secrets_to_load (dict , optional) – Optional dictionary of secrets to load into the interface.
forget_secret(alias: str) → None
Removes a secret from memory.
- Parameters: alias (str) – Alias of the secret to remove.
- Raises: KeyError – If the secret alias is not found in the loaded secrets.
get(secret_name: str) → str
Retrieve a secret value from loaded secrets.
- Parameters: secret_name (str) – Name of the secret.
- Returns: Value of the secret or None if not found.
- Return type: str
- Raises: ValueError – If the secret_name is not a string.
load_secrets() → None
Loads all secrets specified in ‘secrets_to_load’ into memory.
Iterates over the secrets_to_load dictionary and fetches each secret from the Azure Key Vault.
update_and_reload_secrets(new_secrets: Dict[str, str]) → None
Updates the list of secrets to load and reloads them.
- Parameters: new_secrets (dict) – Dictionary of new secrets to load.
- Raises: TypeError – If new_secrets is not a dictionary.
Release files for key-vault-interface 1.0.8
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| key_vault_interface-1.0.8.tar.gz | 8.0 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| key_vault_interface-1.0.8-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 16.5 kB
Release files / key_vault_interface-1.0.8.tar.gz
| Download URL | key_vault_interface-1.0.8.tar.gz |
|---|---|
| Size | 8.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
b01a232cafd80c834b0663e344711de534e992c72cc099fcb9ff278832cd4bd3
|
|
BLAKE2b-256 checksum How to use checksums |
a0fda348e89968f06b9f879836b397d37aba40a5f1346644eed267f16dc09c2e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.0.1 CPython/3.12.0
|
Release files / key_vault_interface-1.0.8-py3-none-any.whl
| Download URL | key_vault_interface-1.0.8-py3-none-any.whl |
|---|---|
| Size | 8.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
8b6b99a6ed4a6159395a232fb05f0bed301a74aa318107d3608c9afd916bb3dc
|
|
BLAKE2b-256 checksum How to use checksums |
eb193071c2fd4c1abc13c595f701dabbf978d8a6ae4e34c7899ca158eb29326b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.0.1 CPython/3.12.0
|