Skip to main content
Secrets store API keys, passwords, and cloud credentials. They can supply environment variables to functions and authenticate access to external object stores. Access is controlled through OuterProduct Policies.

Creating a Secret

Secrets can be created in the OuterProduct UI or through the Python API. client.create_secret() accepts a name and a SecretValue, and returns a Secret object. This example stores a Hugging Face token as a generic Secret:
Generic values are stored as bytes.

Secret types

OuterProduct supports several Secret types:
TypeSupported values
GenericArbitrary bytes, such as API tokens and passwords.
AWSAccess keys, optionally with a session token, or an assume-role configuration referencing another AWS Secret.
Google CloudService account keys or OAuth access tokens.
The type is determined by the SecretValue supplied during creation. Cloud credential types provide the information OuterProduct needs to authenticate with the corresponding provider.

Managing Secrets

client.list_secrets() returns accessible Secret metadata without stored values. Use update_secret() to replace a value or change its comment. Omitting value preserves the current value and version. delete_secret() removes the Secret and its stored value.
An existing Secret is available through client.get_secret(). The returned object contains metadata, including the Secret’s name, type, and version. It acts as a reference when configuring runs and volumes. Calling get_secret() does not retrieve the stored value:
If needed for application code, client.access_secret() can be used to retrieve the credential directly:
Here, response.value is the stored SecretValue. Its generic field contains the token as bytes, and .decode("utf-8") converts it to a string. Viewing metadata through .get_secret() and accessing values through .access_secret() require separate permissions. A user may be allowed to see that a Secret exists without being allowed to retrieve or use its value.

Using Secrets in environment variables

Generic Secrets containing UTF-8 text can be supplied through env_vars:
OuterProduct resolves the Secret and supplies its value as HF_TOKEN in the function’s environment.

Using Secrets to authorize external volumes

Cloud credential Secrets authenticate access to external object stores. A volume’s provider configuration references the corresponding Secret by name:
This example assumes aws-storage is an AWS Secret. Google Cloud Storage volumes use their corresponding credential types. Volumes includes examples for all three providers.