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.