VaultStorage

class phalanx.storage.vault.VaultStorage

Bases: object

Create Vault clients for specific environments.

Methods Summary

get_vault_client(env[, path_prefix, credentials])

Return a Vault client configured for the given environment.

Methods Documentation

get_vault_client(env, path_prefix=None, *, credentials=None)

Return a Vault client configured for the given environment.

Parameters:
  • env (EnvironmentBaseConfig) – Phalanx environment.

  • path_prefix (str | None, default: None) – Path prefix within Vault for application secrets. If given, this overrides the path prefix in the environment configuration.

  • credentials (VaultCredentials | None, default: None) – Credentials to use for authentication. If this is not set, fall back on the default library behavior of getting the token from the environment or the user’s home directory.

Returns:

Vault client configured to manage secrets for that environment.

Return type:

VaultClient

Raises:

ValueError – Raised if vaultUrl is not set for the environment or if both a Vault AppRole and a Vault token were provided.