Skip to content

Latest commit

 

History

History
147 lines (87 loc) · 3.66 KB

robocorp.vault.md

File metadata and controls

147 lines (87 loc) · 3.66 KB

module robocorp.vault

Functions


get_secret

Get a secret with the given name.

Args:

  • name: Name of secret to fetch
  • hide: Hide secret values from log output

Note:

If robocorp.log is available in the environment, the hide 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.

Link to source

get_secret(name: str, hide: bool = True) → SecretContainer

set_secret

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 by get_secret
  • hide: Hide secret values from log output

Note:

If robocorp.log is available in the environment, the hide argument controls if the given values are automatically hidden in the log output.

Raises:

  • RobocorpVaultError: Error with API request or response payload

Link to source

set_secret(secret: SecretContainer, hide: bool = True) → None

create_secret

Create a new secret, or overwrite an existing one.

Args:

  • name: Name of secret
  • values: Mapping of secret keys and values
  • description: Optional description for secret
  • exist_ok: Overwrite existing secret
  • hide: Hide secret values from log output

Note:

If robocorp.log is available in the environment, the hide 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

Link to source

create_secret(
    name: str,
    values: dict[str, Any],
    description: str = '',
    exist_ok: bool = False,
    hide: bool = True
) → SecretContainer

Class 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.

__init__

Args:

  • name: Name of secret
  • description: Human-friendly description for secret
  • values: Dictionary of key-value pairs stored in secret

Link to source

__init__(name: str, description: str, values: Dict[str, Any])

Properties

  • description

  • name

Methods


update

Link to source

update(kvpairs) → None

Exceptions


RobocorpVaultError

Raised when there's problem with reading from Robocorp Vault.