dlt.common.configuration.providers.google_secrets
normalize_key
def normalize_key(in_string: str) -> str
Replaces punctuation characters in a string
Note: We exclude _
and -
from punctuation characters
Arguments:
in_string(str)
- input string
Returns:
(str)
- a string without punctuation characters and whitespaces
GoogleSecretsProvider Objects
class GoogleSecretsProvider(VaultDocProvider)
__init__
def __init__(credentials: GcpServiceAccountCredentials,
only_secrets: bool = True,
only_toml_fragments: bool = True,
list_secrets: bool = False) -> None
Initialize a Google Secrets Provider to access secrets stored in Google Secret Manager
Arguments:
credentials
- Google Cloud credentials to access Secret Manageronly_secrets
- When True, only keys with secret hint types will be looked uponly_toml_fragments
- When True, only load known TOML fragments and ignore other lookupslist_secrets
- When True, list all secrets upfront to optimize vault access by avoiding lookups for non-existent secrets. Requires additional API calls and roles/secretmanager.secretViewer permission.
get_key_name
@staticmethod
def get_key_name(key: str, *sections: str) -> str
Make key name for the secret
Per Google the secret name can contain, so we will use snake_case normalizer
- Uppercase and lowercase letters,
- Numerals,
- Hyphens,
- Underscores.