A simple package to work as an interface with a key; at the moment only supporting Azure.
Project description
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.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file key_vault_interface-1.0.8.tar.gz.
File metadata
- Download URL: key_vault_interface-1.0.8.tar.gz
- Upload date:
- Size: 8.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.0.1 CPython/3.12.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b01a232cafd80c834b0663e344711de534e992c72cc099fcb9ff278832cd4bd3
|
|
| MD5 |
5355858810412d2c66e97e6557266442
|
|
| BLAKE2b-256 |
a0fda348e89968f06b9f879836b397d37aba40a5f1346644eed267f16dc09c2e
|
File details
Details for the file key_vault_interface-1.0.8-py3-none-any.whl.
File metadata
- Download URL: key_vault_interface-1.0.8-py3-none-any.whl
- Upload date:
- Size: 8.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.0.1 CPython/3.12.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8b6b99a6ed4a6159395a232fb05f0bed301a74aa318107d3608c9afd916bb3dc
|
|
| MD5 |
53d36c476507a2e1b5b7f4c93aba1ef5
|
|
| BLAKE2b-256 |
eb193071c2fd4c1abc13c595f701dabbf978d8a6ae4e34c7899ca158eb29326b
|