Secrets
You can keep secrets out of your workspace in two ways:
- Put them in the private env file,
http-client.private.env.json, which stays out of git. See Environments. - Store a reference instead of the secret. Courier reads the real value in memory when it sends the request and never writes it to disk.
Secret references
Section titled “Secret references”Use one of these as a variable’s value:
| Value | Read from |
|---|---|
secret://keychain/<name> |
The macOS keychain (service “Courier”) |
secret://vault/<path>#<field> |
HashiCorp Vault, KV v1 or v2 |
secret://aws/<secret-id>[#<json-field>] |
AWS Secrets Manager |
secret://op/<vault>/<item>/<field> |
1Password, through the op CLI |
secret://azure/<vault>/<name> |
Azure Key Vault |
secret://gcp/<project>/<name> |
Google Cloud Secret Manager |
{ "staging": { "token": "secret://keychain/staging-token", "dbPassword": "secret://vault/secret/data/staging/db#password" }}Credentials for each provider
Section titled “Credentials for each provider”Courier uses the credentials you already have on your Mac:
- Vault:
VAULT_ADDR, andVAULT_TOKENor~/.vault-token. - AWS:
AWS_ACCESS_KEY_IDand related variables, or~/.aws/credentials, plusAWS_REGION. - 1Password: the
opCLI, signed in. - Azure: an
azCLI login, orAZURE_ACCESS_TOKEN. - Google Cloud: a
gcloudlogin, orGOOGLE_OAUTH_ACCESS_TOKEN.
Move values to the keychain
Section titled “Move values to the keychain”In the environment editor (⌘E), right-click a variable → Move values to the keychain. Courier stores each environment’s value in the keychain and replaces it in the file with a secret://keychain/… reference.
Where secrets are masked
Section titled “Where secrets are masked”- The request shown in the app and stored in history has
********in place of a resolved secret. - Generated code keeps secrets masked unless you tick Show secrets.
courier runresolves the same references and masks secrets in its HTML, JUnit and JSON reports.