ds_common_placeholder_py_lib.functions.secrets¶
File: functions/secrets.py
Region: ds-common-placeholder-py-lib
Description¶
get_secret (contract §7): tenant-scoped vault keys, base64 handling, and
recording each value so Context.scrub
can remove it.
Functions¶
|
The tenant segment of a vault key |
|
Read a vault value of the run's tenant from ds-vault. |
|
A secret already read upstream ( |
Module Contents¶
- ds_common_placeholder_py_lib.functions.secrets.key_tenant(key: object) str | None[source]¶
The tenant segment of a vault key
/ds/vault/<store>/<tenant>/….Only the tenant is read; the rest of the key’s format is the definition author’s (and the frontend’s) concern. Returns
Nonewhen the key has no tenant segment, so it cannot be shown to belong to any tenant.
- ds_common_placeholder_py_lib.functions.secrets.get_secret(ctx: ds_common_placeholder_py_lib.context.Context, args: list[Any]) str[source]¶
Read a vault value of the run’s tenant from ds-vault.
- Raises:
PlaceholderError –
secret_scopeif the key’s tenant segment is not the context’s tenant (checked before the vault is read),secret_missingif the vault has no such key,secret_unavailableif the vault cannot be read (configuration, connection, or KMS),typeif the value is not UTF-8.
- ds_common_placeholder_py_lib.functions.secrets.secret(ctx: ds_common_placeholder_py_lib.context.Context, args: list[Any]) str[source]¶
A secret already read upstream (
resolve(strict=False)writes each one as@{secret, '…'}): return it and record it, soContext.scrub()and the SQL check know it.