v1.2.0
New
Read OS environment variables through normal Resterm variables
Resterm can now map an OS environment variable to a value in resterm.env.json. This keeps secrets out of the file while still making them available under a useful name:
{
"dev": {
"base": {
"url": "https://api.example.com"
},
"auth": {
"token": "env:RESTERM_TOKEN"
}
}
}Use the mapped value like any other environment variable:
### List reports
GET {{base.url}}/reports
Authorization: Bearer {{auth.token}}Environment references can also be declared directly in request files:
# @file token env:RESTERM_TOKEN
### Create a report
POST https://api.example.com/reports
Authorization: Bearer {{token}}
Content-Type: application/json
{
"name": "Weekly report"
}@const, @request, @global, and @file all support env:NAME.
The OS value is read once at the beginning of each request and is automatically treated as a secret. It is hidden from previews and redacted from results, explain output, and history.
Reference names can also use declarations:
# @file token.variable RESTERM_TOKEN
# @file token env:{{token.variable}}
GET https://api.example.com/account
Authorization: Bearer {{token}}Fixed
- Runtime values written by scripts, captures, workflows, or
@applyare now always treated as plain data. A runtime value beginning withenv:will no longer unexpectedly read an OS environment variable. - Captured response data can no longer choose which OS environment variable a later request reads.
- Missing environment references remain undefined and correctly shadow lower precedence values.
- Empty references such as
env:now produce a clear error in request and environment files. - Environment references now behave consistently in ordinary requests, workflows, generated OpenAPI documents, scripts, and templates.
- Secret values created during compare runs are now carried with their individual result and redacted from compare history.
- Secret collection and sensitive header masking are now consistent across results, explain output, normal history, compare history, and the UI.