Skip to main content

Module auth

Module auth 

Source
Expand description

JWT authentication and authorization. JWT authentication middleware and token management.

Structs§

AuthenticatedAgent
Claims
JWT claims embedded in every token.
TokenRequest
Request body for the token generation endpoint.

Functions§

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.