Skip to content

Commit a497ee6

Browse files
committed
Add example of how to use a secret from an env variable
1 parent f495475 commit a497ee6

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

Development/v4.x/backend/configuration/jobconfig.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,9 @@ top-level variables are availabe in the handlebars context:
142142
| `datasets` | `DatasetClass[]` | `{{#each datasets}}{{pid}}{{/each}}` | All datasets referenced in `job.jobParams.datasetsList`. |
143143
| `env` | `object` | `{{env.SECRET_TOKEN}}` | Access environmental variables |
144144

145+
Environmental variables are particularly useful for secrets that should not be stored in
146+
the config file.
147+
145148
### Actions Configuration
146149

147150
The following actions are built-in to SciCat and can be included in the `actions` array.
@@ -162,6 +165,7 @@ For example:
162165
method: GET
163166
headers:
164167
accept: application/json
168+
Authorization: "Bearer {{env.ARCHIVER_AUTH_TOKEN}}",
165169
```
166170

167171
Where:
@@ -171,6 +175,9 @@ Where:
171175
- `headers` (optional): An object containing HTTP headers to be included in the request.
172176
- `body` (optional): The body of the request, for methods like "POST" or "PUT".
173177

178+
It is recommended that authorization tokens be stored as environmental variables rather
179+
than included directly in the jobConfig.yaml file.
180+
174181
#### Validate
175182

176183
The `validate` action is used to validate requests to the job endpoints. It is used to

0 commit comments

Comments
 (0)