Overview
API keys are the simplest way to authenticate service-to-service access. Each key is a pre-shared secret that a service includes in every request. Keys are configured inconfig.yaml — there is no runtime key management API.
API keys are for proxy access only. They cannot call the admin API (/auth/login, /api/v1/status, etc.).
Configuration
Fields
| Field | Type | Default | Description |
|---|---|---|---|
name | string | required | Identifier used in logs and error messages |
key | string | required | The secret key string sent in the Authorization header |
targets | list | ["*"] | Target names this key can access. ["*"] = all targets. |
Generating keys
Generate a random key:ph_ to make API keys recognisable in logs and config files.
Sending requests
Include the key in theX-Proxy-Hopper-Auth header on every request:
Target restrictions
Whentargets is a named list (not ["*"]), the key is rejected with 403 if the request matches a target not in the list:
Error responses
| Status | Message | Cause |
|---|---|---|
401 | Authentication required | X-Proxy-Hopper-Auth header missing |
401 | Invalid or expired token | Key not found in config |
403 | API key '...' is not permitted to access target '...' | Key’s targets list does not include the matched target |
Security notes
- Store keys in secrets management (Vault, AWS Secrets Manager, Kubernetes Secrets) — not in plain environment variables or source control
- Rotate keys by adding the new key alongside the old one, deploying, updating clients, then removing the old key
- Use the
namefield to make log attribution easy — key names appear in403messages and logs - There is no key expiry — rotate compromised keys immediately by removing them from
config.yamland reloading