What are secrets?

Secrets are a type of environmental variable that store confidential data. Users can attach them to their capsules to enable secure authentication.

Why not just put this information in my .Pythonenv or .Renviron file?

While those files can similarly contain data that you would otherwise put in a secret, it’s quite easy for a user to inadvertently release this info when sharing capsules. In contrast, when you contain this information in a secret, and share a capsule, the recipient cannot see your secrets. Instead, they must attach their own.

Furthermore, if you have a secret attached to multiple capsules, and the value of that secret needs to be updated for any reason, you can change its value in your profile and the change will be reflected in all capsules that secret is attached to!

How to set secrets

  1. click on the Account icon

    Untitled

  2. Select User Secrets

    Untitled

  3. Click Add secret

    add secret.png

  4. Fill in the dialog box

Example Secrets:

AWS Cloud Credentials: Use this to access data stored in any S3 buckets you own

API Credentials: Your Portal username and password

Custom Key: The EMDB_API_KEY you generated on the Portal

How to attach secrets

Attach secrets to your capsule before running them - simply click “Attach secret to capsule” and select from the dropdown. You can also create new secrets from the link in this dropdown!

secrets_codeocean.gif

Defining custom names for secrets

By default secrets will be assigned to environment variables with names like API_KEY, API_VALUE, CUSTOM_KEY, CUSTOM_KEY_2, etc.