pub struct OAuthClient {
pub client_id: String,
pub client_type: ClientType,
pub redirect_uris: Vec<String>,
pub allowed_scopes: HashSet<String>,
pub name: Option<String>,
pub description: Option<String>,
pub registered_at: SystemTime,
/* private fields */
}Expand description
A registered OAuth client.
Fields§
§client_id: StringUnique client identifier.
client_type: ClientTypeClient type.
redirect_uris: Vec<String>Allowed redirect URIs.
allowed_scopes: HashSet<String>Allowed scopes.
name: Option<String>Client name (for display).
description: Option<String>Client description.
registered_at: SystemTimeWhen the client was registered.
Implementations§
Source§impl OAuthClient
impl OAuthClient
Sourcepub fn builder(client_id: impl Into<String>) -> OAuthClientBuilder
pub fn builder(client_id: impl Into<String>) -> OAuthClientBuilder
Creates a new client builder.
Sourcepub fn validate_redirect_uri(&self, uri: &str) -> bool
pub fn validate_redirect_uri(&self, uri: &str) -> bool
Validates that a redirect URI is allowed for this client.
Sourcepub fn validate_scopes(&self, scopes: &[String]) -> bool
pub fn validate_scopes(&self, scopes: &[String]) -> bool
Validates that the requested scopes are allowed for this client.
Sourcepub fn authenticate(&self, secret: Option<&str>) -> bool
pub fn authenticate(&self, secret: Option<&str>) -> bool
Authenticates a confidential client.
Sourcepub fn has_client_secret(&self) -> bool
pub fn has_client_secret(&self) -> bool
Returns whether this registration input carries a confidential-client credential.
Trait Implementations§
Source§impl Debug for OAuthClient
impl Debug for OAuthClient
Source§impl From<&OAuthClient> for OAuthClientMetadata
impl From<&OAuthClient> for OAuthClientMetadata
Source§fn from(client: &OAuthClient) -> Self
fn from(client: &OAuthClient) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl Freeze for OAuthClient
impl RefUnwindSafe for OAuthClient
impl Send for OAuthClient
impl Sync for OAuthClient
impl Unpin for OAuthClient
impl UnsafeUnpin for OAuthClient
impl UnwindSafe for OAuthClient
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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
Mutably borrows from an owned value. Read more
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, _span: NoopSpan) -> Self
fn instrument(self, _span: NoopSpan) -> Self
Instruments this future with a span (no-op when disabled).
Source§fn in_current_span(self) -> Self
fn in_current_span(self) -> Self
Instruments this future with the current span (no-op when disabled).