Expand description
Server-side JWT validation layer for tonic gRPC services.
Defines two types and one constructor:
JwtValidationService— the [tonic::service::Interceptor] that validatesAuthorization: Bearerheaders on every incoming request.JwtValidationLayer— a type alias forInterceptorLayer<JwtValidationService<V>>.validator_into_layer— constructs aJwtValidationLayerfrom anyTokenValidator.
On successful validation, KeycloakClaims are inserted into the request’s
extensions so handler methods can retrieve them via
request.extensions().get::<KeycloakClaims>(). On failure the request is
rejected with [tonic::Code::Unauthenticated] before reaching any handler.
Structs§
- JwtValidation
Service - The server-side interceptor that validates
Authorization: Bearer <token>on every incoming gRPC request.
Functions§
Type Aliases§
- JwtValidation
Layer - An [
InterceptorLayer] that installs JWT validation on a tonic server.