SecretManager
Manages stored tenant secrets and default secret-injection stubs.
Sync · Async counterpart:
AsyncSecretManager
SecretManager declaration
Section titled “SecretManager declaration”class SecretManager(_SdkOwnedHandle):SecretManager access
Section titled “SecretManager access”This type is created by the SDK; do not construct it directly.
manager = client.secretsSecretManager methods
Section titled “SecretManager methods”Create or replace a tenant secret.
def set(name: str, val: str, *, cache_ttl_secs: int = 0) -> SecretInfoParameters
Section titled “Parameters”| Name | Type | Default | Description |
|---|---|---|---|
name | str | — | Display name used to resolve the secret later. |
val | str | — | Secret value to store. |
cache_ttl_secs | int | 0 | Number of seconds runtime agents may cache the value. |
Returns
Section titled “Returns”SecretInfo— Metadata for the stored secret. The secret value is never returned.
Examples
Section titled “Examples”>>> secret = client.secrets.set("github-token", os.environ["GITHUB_TOKEN"])>>> secret.display_name'github-token'Resolve a tenant secret by UUID or display name.
def get(name: str) -> SecretInfoParameters
Section titled “Parameters”| Name | Type | Default | Description |
|---|---|---|---|
name | str | — | Optional resource display name. |
Returns
Section titled “Returns”SecretInfo
list()
Section titled “list()”List tenant secrets.
def list() -> list[SecretInfo]Returns
Section titled “Returns”list[SecretInfo]
delete()
Section titled “delete()”Delete a tenant secret by UUID or display name.
def delete(name: str) -> NoneParameters
Section titled “Parameters”| Name | Type | Default | Description |
|---|---|---|---|
name | str | — | Optional resource display name. |
list_secret_stubs()
Section titled “list_secret_stubs()”List secret-injection stubs across the tenant.
def list_secret_stubs() -> list[SecretStubInfo]Returns
Section titled “Returns”list[SecretStubInfo]
delete_secret_stub()
Section titled “delete_secret_stub()”Delete a secret-injection stub by UUID.
def delete_secret_stub(id: str) -> NoneParameters
Section titled “Parameters”| Name | Type | Default | Description |
|---|---|---|---|
id | str | — | Resource UUID or display name. |
set_default_secret_stub()
Section titled “set_default_secret_stub()”Create or replace a tenant-default secret-injection stub.
def set_default_secret_stub(url: str, path: str | None = None, config: SecretStubConfig | Mapping[str, str] | None = None) -> DefaultSecretStubInfoParameters
Section titled “Parameters”| Name | Type | Default | Description |
|---|---|---|---|
url | str | — | URL whose credentials should be injected. |
path | str | None | None | Path inside the runtime. |
config | SecretStubConfig | Mapping[str, str] | None | None | Secret-injection configuration. |
Returns
Section titled “Returns”DefaultSecretStubInfo
list_default_secret_stubs()
Section titled “list_default_secret_stubs()”List tenant-default secret-injection stubs.
def list_default_secret_stubs() -> list[DefaultSecretStubInfo]Returns
Section titled “Returns”list[DefaultSecretStubInfo]
delete_default_secret_stub()
Section titled “delete_default_secret_stub()”Delete a tenant-default secret-injection stub by UUID.
def delete_default_secret_stub(id: str) -> NoneParameters
Section titled “Parameters”| Name | Type | Default | Description |
|---|---|---|---|
id | str | — | Resource UUID or display name. |