MCPcopy Create free account
hub / github.com/google/adk-samples / parse_secrets

Function parse_secrets

python/agents/RAG/rag/app_utils/deploy.py:74–84  ·  view source on GitHub ↗

Parse secrets from ENV_VAR=SECRET_ID or ENV_VAR=SECRET_ID:VERSION format.

(secrets_string: str | None)

Source from the content-addressed store, hash-verified

72
73
74def parse_secrets(secrets_string: str | None) -> dict[str, dict[str, str]]:
75 """Parse secrets from ENV_VAR=SECRET_ID or ENV_VAR=SECRET_ID:VERSION format."""
76 raw = parse_key_value_pairs(secrets_string)
77 result: dict[str, dict[str, str]] = {}
78 for key, spec in raw.items():
79 if ":" not in spec:
80 secret_id, version = spec, "latest"
81 else:
82 secret_id, _, version = spec.rpartition(":")
83 result[key] = {"secret": secret_id, "version": version}
84 return result
85
86
87def format_env_value(value: Any) -> str:

Callers 1

deploy_agent_engine_appFunction · 0.70

Calls 2

itemsMethod · 0.80
parse_key_value_pairsFunction · 0.70

Tested by

no test coverage detected