pub struct GitHubOAuthHandler<S: OAuthStorage, CM: ClientManager> {
pub storage: S,
pub client_manager: CM,
pub config: OAuthProviderConfig,
pub http_client: Client,
pub auth_flow: DefaultAuthorizationFlow<S, CM>,
}Expand description
GitHub OAuth handler state
Fields§
§storage: S§client_manager: CM§config: OAuthProviderConfig§http_client: Client§auth_flow: DefaultAuthorizationFlow<S, CM>Implementations§
Source§impl<S: OAuthStorage + Clone + 'static, CM: ClientManager + Clone + 'static> GitHubOAuthHandler<S, CM>
impl<S: OAuthStorage + Clone + 'static, CM: ClientManager + Clone + 'static> GitHubOAuthHandler<S, CM>
pub fn new(storage: S, client_manager: CM, config: OAuthProviderConfig) -> Self
Source§impl GitHubOAuthHandler<InMemoryStorage, DefaultClientManager<InMemoryStorage>>
impl GitHubOAuthHandler<InMemoryStorage, DefaultClientManager<InMemoryStorage>>
Sourcepub fn new_github(github_config: OAuthProviderConfig) -> Self
pub fn new_github(github_config: OAuthProviderConfig) -> Self
Create a new GitHub OAuth provider with InMemoryStorage
Trait Implementations§
Source§impl<S: Clone + OAuthStorage, CM: Clone + ClientManager> Clone for GitHubOAuthHandler<S, CM>
impl<S: Clone + OAuthStorage, CM: Clone + ClientManager> Clone for GitHubOAuthHandler<S, CM>
Source§impl<S: OAuthStorage + Clone + Send + Sync + 'static, CM: ClientManager + Clone + Send + Sync + 'static> OAuthProviderTrait<S, CM> for GitHubOAuthHandler<S, CM>
Implement the OAuthProviderTrait trait for GitHubOAuthHandler
impl<S: OAuthStorage + Clone + Send + Sync + 'static, CM: ClientManager + Clone + Send + Sync + 'static> OAuthProviderTrait<S, CM> for GitHubOAuthHandler<S, CM>
Implement the OAuthProviderTrait trait for GitHubOAuthHandler
Source§fn provider_name(&self) -> &str
fn provider_name(&self) -> &str
Get the provider name (e.g., “github”, “cognito”, etc.)
Source§fn config(&self) -> &OAuthProviderConfig
fn config(&self) -> &OAuthProviderConfig
Get the configuration for this provider
Source§fn get_user_info<'life0, 'life1, 'async_trait>(
&'life0 self,
access_token: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<UserInfo, String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn get_user_info<'life0, 'life1, 'async_trait>(
&'life0 self,
access_token: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<UserInfo, String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Get user information from the provider
Source§fn client_manager(&self) -> &CM
fn client_manager(&self) -> &CM
Get client manager reference
Auto Trait Implementations§
impl<S, CM> !RefUnwindSafe for GitHubOAuthHandler<S, CM>
impl<S, CM> !UnwindSafe for GitHubOAuthHandler<S, CM>
impl<S, CM> Freeze for GitHubOAuthHandler<S, CM>
impl<S, CM> Send for GitHubOAuthHandler<S, CM>where
DefaultAuthorizationFlow<S, CM>: Send,
impl<S, CM> Sync for GitHubOAuthHandler<S, CM>where
DefaultAuthorizationFlow<S, CM>: Sync,
impl<S, CM> Unpin for GitHubOAuthHandler<S, CM>
impl<S, CM> UnsafeUnpin for GitHubOAuthHandler<S, CM>
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,
impl<T> ErasedDestructor for Twhere
T: 'static,
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.