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:
Secret types
OuterProduct supports several Secret types:| Type | Supported values |
|---|---|
| Generic | Arbitrary bytes, such as API tokens and passwords. |
| AWS | Access keys, optionally with a session token, or an assume-role configuration referencing another AWS Secret. |
| Google Cloud | Service account keys or OAuth access tokens. |
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.
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:
client.access_secret() can be used to retrieve the credential directly:
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 throughenv_vars:
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:aws-storage is an AWS Secret. Google Cloud Storage volumes use their corresponding credential types. Volumes includes examples for all three providers.