pub struct AuthClient { /* private fields */ }Expand description
OAuth2 authorization client for Ppoppo Accounts.
Implementations§
Source§impl AuthClient
impl AuthClient
Sourcepub fn try_new(config: OAuthConfig) -> Result<Self, Error>
pub fn try_new(config: OAuthConfig) -> Result<Self, Error>
Create a new Ppoppo Accounts auth client.
Returns an error iff reqwest::Client::builder() cannot construct a
client with the configured timeouts (TLS init failure, OS-level
resource exhaustion). The previous unwrap_or_default() path silently
substituted a no-timeout client, which converted a startup failure
into a runtime hang on the first PAS call — fail loudly instead.
§Errors
Returns Error::Http if the underlying HTTP client cannot be built.
Sourcepub async fn exchange_code(
&self,
code: &str,
code_verifier: &str,
) -> Result<TokenResponse, Error>
pub async fn exchange_code( &self, code: &str, code_verifier: &str, ) -> Result<TokenResponse, Error>
Exchange an authorization code for tokens using PKCE.
§Errors
Returns Error::Http on network failure, or
Error::OAuth if the token endpoint returns an error.
Trait Implementations§
Source§impl PasAuthPort for AuthClient
Available on crate feature well-known-fetch only.
impl PasAuthPort for AuthClient
Available on crate feature
well-known-fetch only.Source§async fn refresh(
&self,
refresh_token: &str,
) -> Result<TokenResponse, PasFailure>
async fn refresh( &self, refresh_token: &str, ) -> Result<TokenResponse, PasFailure>
POST /oauth/token with grant_type=refresh_token (RFC 6749 §6).Auto Trait Implementations§
impl !RefUnwindSafe for AuthClient
impl !UnwindSafe for AuthClient
impl Freeze for AuthClient
impl Send for AuthClient
impl Sync for AuthClient
impl Unpin for AuthClient
impl UnsafeUnpin for AuthClient
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