Expand description
HTTP access guard: Origin allow-list, optional API key, and the JSON errors they return.
Structs§
- ApiKey
- SHA-256 of the configured API key; requests are compared digest to digest.
- Guard
State
Functions§
- guard
- Rejects a disallowed
Originwith 403, then a missing or wrong API key with 401. - origin_
allowed - Loopback origins are always allowed; others must equal an entry of
allowedafter normalisation. - presented_
key - The key a request presents:
X-API-Key(even if empty) wins, else theBearertoken.