pub struct AnthropicAuth { /* private fields */ }
Expand description
Anthropic authentication provider
Implementations§
Source§impl AnthropicAuth
impl AnthropicAuth
pub fn new(storage: Box<dyn AuthStorage>) -> Self
Sourcepub async fn start_oauth_flow(&self) -> Result<OAuthFlow>
pub async fn start_oauth_flow(&self) -> Result<OAuthFlow>
Start OAuth flow with PKCE
Sourcepub async fn exchange_code(
&self,
code: &str,
verifier: &str,
) -> Result<TokenResponse>
pub async fn exchange_code( &self, code: &str, verifier: &str, ) -> Result<TokenResponse>
Exchange authorization code for tokens
Sourcepub async fn refresh_token(&self, refresh_token: &str) -> Result<TokenResponse>
pub async fn refresh_token(&self, refresh_token: &str) -> Result<TokenResponse>
Refresh access token using refresh token
Trait Implementations§
Source§impl Auth for AnthropicAuth
impl Auth for AnthropicAuth
Source§fn provider_id(&self) -> &str
fn provider_id(&self) -> &str
Get the provider ID this auth is for
Source§fn get_credentials<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<AuthCredentials>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn get_credentials<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<AuthCredentials>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Get current valid credentials
Source§fn set_credentials<'life0, 'async_trait>(
&'life0 self,
credentials: AuthCredentials,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn set_credentials<'life0, 'async_trait>(
&'life0 self,
credentials: AuthCredentials,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Store new credentials
Auto Trait Implementations§
impl Freeze for AnthropicAuth
impl !RefUnwindSafe for AnthropicAuth
impl Send for AnthropicAuth
impl Sync for AnthropicAuth
impl Unpin for AnthropicAuth
impl !UnwindSafe for AnthropicAuth
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> 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 more