pub struct GitHubOAuth { /* private fields */ }Expand description
GitHub OAuth provider wrapper
Handles GitHub-specific OAuth flows and team mapping to FraiseQL roles.
Implementations§
Source§impl GitHubOAuth
impl GitHubOAuth
Sourcepub async fn new(
client_id: String,
client_secret: String,
redirect_uri: String,
) -> Result<Self>
pub async fn new( client_id: String, client_secret: String, redirect_uri: String, ) -> Result<Self>
Sourcepub fn map_teams_to_roles(teams: Vec<String>) -> Vec<String>
pub fn map_teams_to_roles(teams: Vec<String>) -> Vec<String>
Map GitHub teams to FraiseQL roles
Maps organization:team slugs to role names. Example: “my-org:admin-team” -> “admin”
§Arguments
teams- List of “org:team” strings from GitHub
Sourcepub async fn get_user_with_teams(
&self,
access_token: &str,
) -> Result<(GitHubUser, Vec<String>)>
pub async fn get_user_with_teams( &self, access_token: &str, ) -> Result<(GitHubUser, Vec<String>)>
Sourcepub fn extract_org_id_from_teams(
teams: &[(GitHubUser, Vec<String>)],
) -> Option<String>
pub fn extract_org_id_from_teams( teams: &[(GitHubUser, Vec<String>)], ) -> Option<String>
Extract organization ID from GitHub teams (primary org)
Returns the first organization the user belongs to as the org_id. In multi-org scenarios, this should be overridden with explicit org selection.
Trait Implementations§
Source§impl Debug for GitHubOAuth
impl Debug for GitHubOAuth
Source§impl OAuthProvider for GitHubOAuth
impl OAuthProvider for GitHubOAuth
Generate authorization URL for user to visit Read more
Source§fn exchange_code<'life0, 'life1, 'async_trait>(
&'life0 self,
code: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<TokenResponse>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn exchange_code<'life0, 'life1, 'async_trait>(
&'life0 self,
code: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<TokenResponse>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Exchange authorization code for tokens Read more
Source§fn user_info<'life0, 'life1, 'async_trait>(
&'life0 self,
access_token: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<UserInfo>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn user_info<'life0, 'life1, 'async_trait>(
&'life0 self,
access_token: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<UserInfo>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Get user information using access token Read more
Source§fn refresh_token<'life0, 'life1, 'async_trait>(
&'life0 self,
refresh_token: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<TokenResponse>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn refresh_token<'life0, 'life1, 'async_trait>(
&'life0 self,
refresh_token: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<TokenResponse>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Refresh the access token (optional, default returns error) Read more
Auto Trait Implementations§
impl Freeze for GitHubOAuth
impl !RefUnwindSafe for GitHubOAuth
impl Send for GitHubOAuth
impl Sync for GitHubOAuth
impl Unpin for GitHubOAuth
impl UnsafeUnpin for GitHubOAuth
impl !UnwindSafe for GitHubOAuth
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