@@ -48,18 +48,12 @@ const ALLOWED_ALGORITHMS: &[Algorithm] = &[
4848 Algorithm :: PS512 ,
4949] ;
5050
51- /// Claims extracted from a Cosmian Auth Verifier JWT.
52- ///
53- /// The auth server includes the RBAC `roles` (RFC 9068 private claim) and
54- /// the realm identifier in `as_rid` so that OPA can enforce domain-scoped
55- /// policies without an additional lookup.
5651/// Claims extracted from a Cosmian Auth Verifier JWT.
5752///
5853/// The auth server includes the RBAC `roles` (RFC 9068 private claim) and
5954/// the realm identifier in `as_rid` so that OPA can enforce domain-scoped
6055/// policies without an additional lookup.
6156#[ derive( Debug , Deserialize ) ]
62- /// Subject — used as the KMS user identity (username / email).
6357pub ( crate ) struct AuthVerifierClaims {
6458 /// Subject — used as the KMS user identity (username / email).
6559 pub sub : String ,
@@ -82,10 +76,6 @@ pub(crate) struct AuthVerifierClaims {
8276/// against every key in the JWKS (Cosmian tokens carry no `kid`), and
8377/// populates [`AuthenticatedUser`] with the full claims — including `roles`
8478/// and `domain` — so OPA can evaluate role-based and domain-scoped policies.
85- /// Extracts the bearer token from the `Authorization` header, validates it
86- /// against every key in the JWKS (Cosmian tokens carry no `kid`), and
87- /// populates [`AuthenticatedUser`] with the full claims — including `roles`
88- /// and `domain` — so OPA can evaluate role-based and domain-scoped policies.
8979pub ( super ) async fn handle_auth_verifier (
9080 jwks_manager : & Arc < JwksManager > ,
9181 req : & ServiceRequest ,
@@ -102,22 +92,15 @@ pub(super) async fn handle_auth_verifier(
10292 } )
10393}
10494
105- /// Validate a Cosmian Auth Verifier JWT and return its full claims.
10695/// Validate a Cosmian Auth Verifier JWT and return its full claims.
10796///
10897/// Validates the signature against every public key in the JWKS (Cosmian
10998/// tokens carry no `kid`). Returns all claims — `sub`, `roles`, and
11099/// `domain` (`as_rid` / `as_domain`) — so callers can populate
111100/// [`AuthenticatedUser`] or store them in a session without re-parsing.
112- /// Validates the signature against every public key in the JWKS (Cosmian
113- /// tokens carry no `kid`). Returns all claims — `sub`, `roles`, and
114- /// `domain` (`as_rid` / `as_domain`) — so callers can populate
115- /// [`AuthenticatedUser`] or store them in a session without re-parsing.
116101///
117102/// In test / insecure builds the signature check is skipped; only the
118103/// claim structure is decoded (same behaviour as [`JwtAuth`]).
119- /// In test / insecure builds the signature check is skipped; only the
120- /// claim structure is decoded (same behaviour as [`JwtAuth`]).
121104#[ cfg_attr( any( test, feature = "insecure" ) , allow( unused_variables) ) ]
122105#[ cfg_attr( any( test, feature = "insecure" ) , allow( clippy:: unused_async) ) ]
123106pub ( crate ) async fn verify_auth_verifier_jwt (
0 commit comments