pub struct Auth<S: Storage = LocalStorage> {
pub paths: DomainPaths,
pub storage: Arc<S>,
/* private fields */
}Fields§
§paths: DomainPaths§storage: Arc<S>Implementations§
Source§impl<S: Storage + Send + Sync> Auth<S>
impl<S: Storage + Send + Sync> Auth<S>
pub fn new(paths: DomainPaths, storage: Arc<S>) -> Self
pub async fn login<T: HttpClient>( &self, http_client: &T, host: &Host, refresh_token: String, ) -> Res
Sourcepub async fn get_or_register_client<T: HttpClient>(
&self,
http_client: &T,
host: &Host,
redirect_uri: &str,
) -> Res<OAuthClient>
pub async fn get_or_register_client<T: HttpClient>( &self, http_client: &T, host: &Host, redirect_uri: &str, ) -> Res<OAuthClient>
Get a stored OAuth client_id for the host, or register a new one via DCR.
Sourcepub async fn login_oauth<T: HttpClient>(
&self,
http_client: &T,
host: &Host,
params: OAuthParams,
) -> Res
pub async fn login_oauth<T: HttpClient>( &self, http_client: &T, host: &Host, params: OAuthParams, ) -> Res
Login using OAuth 2.1 Authorization Code flow with PKCE.
Exchanges the authorization code for tokens, then fetches S3 credentials.
§State / CSRF verification
This method does not verify the state parameter returned by the
Authorization Endpoint. The caller is responsible for comparing the
state value in the callback against the value generated by
random_state before calling this method (RFC 6749 §10.12).
pub async fn get_credentials_or_refresh<T: HttpClient>( &self, http_client: &T, host: &Host, ) -> Res<Credentials>
Trait Implementations§
Auto Trait Implementations§
impl<S> Freeze for Auth<S>
impl<S> RefUnwindSafe for Auth<S>where
S: RefUnwindSafe,
impl<S> Send for Auth<S>
impl<S> Sync for Auth<S>
impl<S> Unpin for Auth<S>
impl<S> UnsafeUnpin for Auth<S>
impl<S> UnwindSafe for Auth<S>where
S: RefUnwindSafe,
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: 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>
Converts
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>
Converts
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 moreCreates a shared type from an unshared type.