pub struct OAuthClient {
pub client_id: String,
pub client_secret: Option<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,
}Expand description
A registered OAuth client.
Fields§
§client_id: StringUnique client identifier.
client_secret: Option<String>Client secret (None for public clients).
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.
Trait Implementations§
Source§impl Clone for OAuthClient
impl Clone for OAuthClient
Source§fn clone(&self) -> OAuthClient
fn clone(&self) -> OAuthClient
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for OAuthClient
impl RefUnwindSafe for OAuthClient
impl Send for OAuthClient
impl Sync for OAuthClient
impl Unpin for OAuthClient
impl UnwindSafe for OAuthClient
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
Mutably borrows from an owned value. Read more
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: 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).