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 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for MeEndpointConfig
impl Debug for MeEndpointConfig
Source§impl Default for MeEndpointConfig
impl Default for MeEndpointConfig
Source§fn default() -> MeEndpointConfig
fn default() -> MeEndpointConfig
Source§impl<'de> Deserialize<'de> for MeEndpointConfig
impl<'de> Deserialize<'de> for MeEndpointConfig
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Auto Trait Implementations§
impl Freeze for MeEndpointConfig
impl RefUnwindSafe for MeEndpointConfig
impl Send for MeEndpointConfig
impl Sync for MeEndpointConfig
impl Unpin for MeEndpointConfig
impl UnsafeUnpin for MeEndpointConfig
impl UnwindSafe for MeEndpointConfig
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more