Skip to content

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.

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
http-client.env.json
{
"staging": {
"token": "secret://keychain/staging-token",
"dbPassword": "secret://vault/secret/data/staging/db#password"
}
}

Courier uses the credentials you already have on your Mac:

  • Vault: VAULT_ADDR, and VAULT_TOKEN or ~/.vault-token.
  • AWS: AWS_ACCESS_KEY_ID and related variables, or ~/.aws/credentials, plus AWS_REGION.
  • 1Password: the op CLI, signed in.
  • Azure: an az CLI login, or AZURE_ACCESS_TOKEN.
  • Google Cloud: a gcloud login, or GOOGLE_OAUTH_ACCESS_TOKEN.

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.

  • 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 run resolves the same references and masks secrets in its HTML, JUnit and JSON reports.