pub struct InstallationTokenManager { /* private fields */ }Expand description
Installation token manager that handles caching and refreshing
Implementations§
Source§impl InstallationTokenManager
impl InstallationTokenManager
Sourcepub fn new(auth: GithubAppAuth) -> Self
pub fn new(auth: GithubAppAuth) -> Self
Create new installation token manager
Sourcepub async fn get_token(&mut self, installation_id: i64) -> GithubResult<String>
pub async fn get_token(&mut self, installation_id: i64) -> GithubResult<String>
Get a valid installation token, refreshing if necessary
This method would:
- Check if cached token exists and is still valid
- If not, generate a new JWT
- Use JWT to request installation token from GitHub API
- Cache and return the new token
Sourcepub fn clear_cache(&mut self)
pub fn clear_cache(&mut self)
Clear cached token (useful for testing or forcing refresh)
Auto Trait Implementations§
impl Freeze for InstallationTokenManager
impl RefUnwindSafe for InstallationTokenManager
impl Send for InstallationTokenManager
impl Sync for InstallationTokenManager
impl Unpin for InstallationTokenManager
impl UnwindSafe for InstallationTokenManager
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