Skip to main content
Version: devel

dlt.common.configuration.providers.google_secrets

normalize_key

def normalize_key(in_string: str) -> str

View source on GitHub

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)

View source on GitHub

__init__

def __init__(credentials: GcpServiceAccountCredentials,
only_secrets: bool = True,
only_toml_fragments: bool = True,
list_secrets: bool = False) -> None

View source on GitHub

Initialize a Google Secrets Provider to access secrets stored in Google Secret Manager

Arguments:

  • credentials - Google Cloud credentials to access Secret Manager
  • only_secrets - When True, only keys with secret hint types will be looked up
  • only_toml_fragments - When True, only load known TOML fragments and ignore other lookups
  • list_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

View source on GitHub

Make key name for the secret

Per Google the secret name can contain, so we will use snake_case normalizer

  1. Uppercase and lowercase letters,
  2. Numerals,
  3. Hyphens,
  4. Underscores.

This demo works on codespaces. Codespaces is a development environment available for free to anyone with a Github account. You'll be asked to fork the demo repository and from there the README guides you with further steps.
The demo uses the Continue VSCode extension.

Off to codespaces!

DHelp

Ask a question

Welcome to "Codex Central", your next-gen help center, driven by OpenAI's GPT-4 model. It's more than just a forum or a FAQ hub – it's a dynamic knowledge base where coders can find AI-assisted solutions to their pressing problems. With GPT-4's powerful comprehension and predictive abilities, Codex Central provides instantaneous issue resolution, insightful debugging, and personalized guidance. Get your code running smoothly with the unparalleled support at Codex Central - coding help reimagined with AI prowess.