pub struct MeEndpointConfig {
pub enabled: bool,
pub expose_claims: Vec<String>,
}Expand description
Configuration for the GET /auth/me session-identity endpoint.
Exposed at /auth/me when enabled. The endpoint reads the validated
JWT already in the request context and returns a JSON object containing
sub, user_id (alias for sub), expires_at, plus any extra claims
listed in expose_claims that are present in the token.
§Example (TOML)
[auth.me]
enabled = true
expose_claims = ["email", "tenant_id", "https://myapp.com/role"]Fields§
§enabled: boolEnable the GET /auth/me endpoint. Default: false (opt-in).
expose_claims: Vec<String>Raw JWT claim names to include in the response body, beyond the
always-present sub, user_id, and expires_at.
Names must match the raw claim key in the token (e.g. "email",
"https://myapp.com/role"). Claims absent from the token are silently
omitted. The user_id alias for sub is always included and must
not be listed here — listing "user_id" would silently return
nothing because the JWT only carries sub.
Trait Implementations§
Source§impl Clone for MeEndpointConfig
impl Clone for MeEndpointConfig
Source§fn clone(&self) -> MeEndpointConfig
fn clone(&self) -> MeEndpointConfig
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more