Expand description
JWT authentication and authorization. JWT authentication middleware and token management.
Structs§
- Authenticated
Agent - Claims
- JWT claims embedded in every token.
- Token
Request - Request body for the token generation endpoint.
Functions§
- admin_
authorized - Authorize an admin request from request headers against the configured admin
key. Errors if no admin key is configured (admin endpoints are disabled) or the
provided
x-api-key/ bearer does not match. Used by the /v1/admin endpoints. - auth_
middleware - Middleware that enforces JWT auth when a secret is configured.
- create_
token - Create a signed JWT for the given agent.
- generate_
token - validate_
token - Validate a JWT and return the embedded claims.