Secrets

class SecretClient(beaker: Beaker)[source]

Methods for interacting with Beaker Secrets. Accessed via the Beaker.secret property.

Warning

Do not instantiate this class directly! The Beaker client will create one automatically which you can access through the corresponding property.

get(name: str, *, workspace: Workspace | None = None) Secret[source]
Examples:

>>> with Beaker.from_env() as beaker:
...     secret = beaker.secret.get(secret_name)
Returns:

A BeakerSecret protobuf object.

Raises:

BeakerSecretNotFound – If the secret doesn’t exist.

read(secret: Secret, *, workspace: Workspace | None = None) str[source]
write(name: str, value: str, *, workspace: Workspace | None = None) Secret[source]
delete(secret: Secret, *, workspace: Workspace | None = None)[source]
list(*, workspace: Workspace | None = None, sort_order: BeakerSortOrder | None = None, sort_field: Literal['created', 'name'] = 'name', limit: int | None = None) Iterable[Secret][source]