feat(vaults): support custom headers on API vault

This commit is contained in:
hifumi
2026-08-04 08:20:24 -06:00
committed by GitHub
parent a5f5e7d14d
commit eb40c67385
2 changed files with 38 additions and 10 deletions
+4
View File
@@ -208,6 +208,9 @@ key_vaults:
name: myapi
uri: https://vault.example.com/api
token: "your-bearer-token"
headers:
CF-Access-Client-Id: "CLIENT_ID_HERE"
CF-Access-Client-Secret: "CLIENT_SECRET_HERE"
```
| Field | Required | Description |
@@ -218,6 +221,7 @@ key_vaults:
| `token` | yes | Bearer token, sent as `Authorization: Bearer <token>`. |
| `no_push` | no | If `true`, keys are read but never written. |
| `timeout` | no | Request timeout in seconds; defaults to `vault_timeout`. |
| `headers` | no | Extra HTTP `headers` sent with every request, for example the Cloudflare Access service-token headers `CF-Access-Client-Id` and `CF-Access-Client-Secret`. |
The backend talks to endpoints under `uri` (for example `GET {uri}/{service}/{kid}` to look up a single key) and interprets a numeric `code` field in each JSON response to detect errors such as an invalid token, rate limiting, or an invalid service tag.