pub enum Requester {
User {
id: Ulid,
username: Option<String>,
},
OAuth2Client {
id: Ulid,
},
Homeserver,
}Expand description
An identified principal making a request, recorded on the LogContext.
This is the entity that authenticated the request (the caller), not the subject an operation might be about — e.g. on the introspection endpoint it is the homeserver or client doing the introspecting, not the user whose token is being introspected.
Variants§
User
A user, identified by their Ulid and (when known) their username.
Fields
OAuth2Client
An OAuth2 client acting on its own behalf (e.g. at the token endpoint,
or a client-credentials session), identified by its internal Ulid.
Homeserver
The homeserver, e.g. calling the introspection endpoint with its shared secret.
Implementations§
Source§impl Requester
impl Requester
Sourcepub fn user(id: Ulid, username: impl Into<String>) -> Self
pub fn user(id: Ulid, username: impl Into<String>) -> Self
Build a User requester with both an id and a known username.
Sourcepub fn user_id_only(id: Ulid) -> Self
pub fn user_id_only(id: Ulid) -> Self
Build a User requester from a user_id alone (username unknown).
Sourcepub fn oauth2_client(id: Ulid) -> Self
pub fn oauth2_client(id: Ulid) -> Self
Build an OAuth2Client requester from a client’s internal Ulid.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Requester
impl RefUnwindSafe for Requester
impl Send for Requester
impl Sync for Requester
impl Unpin for Requester
impl UnsafeUnpin for Requester
impl UnwindSafe for Requester
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,
impl<T> ErasedDestructor for Twhere
T: 'static,
Source§impl<T> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
Source§fn with_current_context(self) -> WithContext<Self> ⓘ
fn with_current_context(self) -> WithContext<Self> ⓘ
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 moreSource§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<T> ToStringFallible for Twhere
T: Display,
impl<T> ToStringFallible for Twhere
T: Display,
Source§fn try_to_string(&self) -> Result<String, TryReserveError>
fn try_to_string(&self) -> Result<String, TryReserveError>
ToString::to_string, but without panic on OOM.