pub struct GithubAuthMiddleware { /* private fields */ }Implementations§
Source§impl GithubAuthMiddleware
impl GithubAuthMiddleware
Sourcepub fn from_environment(
stored_token: Option<AccessTokenResponse>,
) -> Option<Self>
pub fn from_environment( stored_token: Option<AccessTokenResponse>, ) -> Option<Self>
Resolve auth credentials from the environment.
Prefers the GH_TOKEN env var; otherwise falls back to the supplied
stored device-flow token (read by the caller to prevent circular deps).
Returns None if neither is available.
pub fn from_app_flow(token: AccessTokenResponse, client_id: String) -> Self
pub async fn from_github_app( app_id: String, installation_id: String, key: SecretValue, ) -> Result<Self>
pub fn from_token(token: impl Into<SecretValue>) -> Self
Trait Implementations§
Source§impl Middleware for GithubAuthMiddleware
impl Middleware for GithubAuthMiddleware
Source§fn handle<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
req: Request,
extensions: &'life1 mut Extensions,
next: Next<'life2>,
) -> Pin<Box<dyn Future<Output = Result<Response>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn handle<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
req: Request,
extensions: &'life1 mut Extensions,
next: Next<'life2>,
) -> Pin<Box<dyn Future<Output = Result<Response>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Invoked with a request before sending it. If you want to continue processing the request,
you should explicitly call
next.run(req, extensions). Read moreAuto Trait Implementations§
impl Freeze for GithubAuthMiddleware
impl RefUnwindSafe for GithubAuthMiddleware
impl Send for GithubAuthMiddleware
impl Sync for GithubAuthMiddleware
impl Unpin for GithubAuthMiddleware
impl UnsafeUnpin for GithubAuthMiddleware
impl UnwindSafe for GithubAuthMiddleware
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