1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
/// Trait for accessing standard JWT/OIDC claims
///
/// All JWT claims types must implement this trait to provide access to
/// the standard OIDC fields that are used for validation (issuer, expiration, audience).
/// This allows the verifier to validate these fields generically across different
/// claim structures from different providers.
///
/// # Example
///
/// ```rust
/// use mozambigue::StandardClaims;
/// use serde::Deserialize;
///
/// #[derive(Deserialize)]
/// struct MyClaims {
/// iss: String,
/// sub: String,
/// aud: Vec<String>,
/// exp: i64,
/// }
///
/// impl StandardClaims for MyClaims {
/// fn iss(&self) -> &str { &self.iss }
/// fn sub(&self) -> &str { &self.sub }
/// fn aud(&self) -> &[String] { &self.aud }
/// fn exp(&self) -> i64 { self.exp }
/// }
/// ```
// Some methods will be used by future OIDC extractors