Auth middleware

The first Gateway plugin on every request. It checks the Authorization: Bearer JWT before anything else runs.

  • Verifies the signature against the User Service's public signing keys, which it refreshes on a schedule, so validation needs no call to the User API.
  • Checks expiry and audience, then passes the user or partner ID to the Router in a header.
  • Public routes, such as registration, login and token refresh, are allow-listed and skip the check.
  • Rejects an invalid or expired token with 401 before the request costs any quota.

Edit ./docs/components/auth.md to change this text.