pub async fn authenticate(
headers: HeaderMap,
request: Request,
next: Next,
) -> Result<Response, (StatusCode, Json<AuthError>)>Expand description
Authentication middleware
Validates that the request includes a Bearer token in the Authorization header. This token should be a Kubernetes ServiceAccount token.
§Headers
Authorization: Bearer <token>- Required
§Errors
Returns 401 Unauthorized if:
- No Authorization header is present
- Authorization header is malformed
- Token is invalid (future implementation)