Get a secret with the given name.
Args:
name
: Name of secret to fetchhide
: Hide secret values from log output
Note:
If
robocorp.log
is available in the environment, thehide
argument controls if the given values are automatically hidden in the log output.
Returns: Secret container of name, description, and key-value pairs
Raises:
RobocorpVaultError
: Error with API request or response payload.
get_secret(name: str, hide: bool = True) → SecretContainer
Set a secret value using an existing container.
Note: If the secret already exists, all contents are replaced.
Args:
secret
: Secret container, created manually or returned byget_secret
hide
: Hide secret values from log output
Note:
If
robocorp.log
is available in the environment, thehide
argument controls if the given values are automatically hidden in the log output.
Raises:
RobocorpVaultError
: Error with API request or response payload
set_secret(secret: SecretContainer, hide: bool = True) → None
Create a new secret, or overwrite an existing one.
Args:
name
: Name of secretvalues
: Mapping of secret keys and valuesdescription
: Optional description for secretexist_ok
: Overwrite existing secrethide
: Hide secret values from log output
Note:
If
robocorp.log
is available in the environment, thehide
argument controls if the given values are automatically hidden in the log output.
Returns: Secret container of name, description, and key-value pairs
Raises:
RobocorpVaultError
: Error with API request or response payload
create_secret(
name: str,
values: dict[str, Any],
description: str = '',
exist_ok: bool = False,
hide: bool = True
) → SecretContainer
Container for a secret with name, description, and multiple key-value pairs.
Avoids logging internal values when possible.
Note that keys are always converted to str internally.
Args:
name
: Name of secretdescription
: Human-friendly description for secretvalues
: Dictionary of key-value pairs stored in secret
__init__(name: str, description: str, values: Dict[str, Any])
-
description
-
name
update(kvpairs) → None
Raised when there's problem with reading from Robocorp Vault.