apiKey(...) when you want a lightweight header-based auth layer for HTTP clients.
Basic usage
What it does
- reads a header from
request.headers - validates it against a static secret or custom validator
- stores the validated value on
ctx
When to move beyond the built-in helper
If you want to attach richer auth metadata toctx, build a custom plugin instead of just storing the raw key.
That pattern is shown in Plugin example, where API-key lookup attaches:
keyIdownerplan