Expand description
Authentication and authorization middleware.
This module provides API key and JWT token validation for the baseline service.
Structs§
- ApiKey
- Represents an authenticated API key.
- ApiKey
Store - In-memory API key store for development and testing.
- Auth
Context - Authenticated user context extracted from requests.
- Auth
State - Authentication state shared by middleware.
- JwtClaims
- JWT claims accepted by the server.
- JwtConfig
- JWT validation settings.
Enums§
Functions§
- auth_
middleware - Authentication middleware.
- check_
scope - Checks if the current auth context has the required scope, project access, and benchmark access. Returns an error response if the scope is not present, project mismatch, or benchmark restricted.
- local_
mode_ auth_ middleware - Local-mode middleware that injects a synthetic admin auth context.
- validate_
key_ format - Validates API key format.