Rotate a client token¶
Rotate a client's token when it may have leaked (it showed up in a log, or someone who had it left), or on a regular schedule.
The old token stops working immediately
There's no overlap. Have the new token ready to paste into the
pipeline's secret before you rotate, and expect installs with the old
token to fail with 401 until it's replaced.
This is one reason to give every pipeline its own client: rotating one token then affects only that pipeline.
Rotate in the console¶
You need the admin role in the workspace.
- Open Clients.
- Find the client and select Rotate token.
- Copy the new token. It's shown only once.
- Replace the secret where the client uses it, for example the
PROVENIX_NPM_TOKEN_BUILDsecret in GitHub Actions. - Re-run the pipeline and check
npm whoamistill prints the client's name.
Rotate with the API¶
curl -sSf -X POST "https://provenix.example.com/api/v1/clients/<client id>/rotate-token" \
-H "Authorization: Bearer $PROVENIX_ADMIN_KEY" | jq -r .token
Retire a client instead¶
If the pipeline or machine is gone, select Deactivate on the client instead. Its token stops working at once, and its install history is kept.