Skip to main content

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

key_vault_interface-1.0.8.tar.gz (8.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

key_vault_interface-1.0.8-py3-none-any.whl (8.5 kB view details)

Uploaded Python 3

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

Hashes for key_vault_interface-1.0.8.tar.gz
Algorithm Hash digest
SHA256 b01a232cafd80c834b0663e344711de534e992c72cc099fcb9ff278832cd4bd3
MD5 5355858810412d2c66e97e6557266442
BLAKE2b-256 a0fda348e89968f06b9f879836b397d37aba40a5f1346644eed267f16dc09c2e

See more details on using hashes here.

File details

Details for the file key_vault_interface-1.0.8-py3-none-any.whl.

File metadata

File hashes

Hashes for key_vault_interface-1.0.8-py3-none-any.whl
Algorithm Hash digest
SHA256 8b6b99a6ed4a6159395a232fb05f0bed301a74aa318107d3608c9afd916bb3dc
MD5 53d36c476507a2e1b5b7f4c93aba1ef5
BLAKE2b-256 eb193071c2fd4c1abc13c595f701dabbf978d8a6ae4e34c7899ca158eb29326b

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page