pub trait TokenCache: Send + Sync {
// Required methods
fn get_jwt<'life0, 'async_trait>(
&'life0 self,
app_id: GitHubAppId,
) -> Pin<Box<dyn Future<Output = Result<Option<JsonWebToken>, CacheError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn store_jwt<'life0, 'async_trait>(
&'life0 self,
jwt: JsonWebToken,
) -> Pin<Box<dyn Future<Output = Result<(), CacheError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn get_installation_token<'life0, 'async_trait>(
&'life0 self,
installation_id: InstallationId,
) -> Pin<Box<dyn Future<Output = Result<Option<InstallationToken>, CacheError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn store_installation_token<'life0, 'async_trait>(
&'life0 self,
token: InstallationToken,
) -> Pin<Box<dyn Future<Output = Result<(), CacheError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn invalidate_installation_token<'life0, 'async_trait>(
&'life0 self,
installation_id: InstallationId,
) -> Pin<Box<dyn Future<Output = Result<(), CacheError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn cleanup_expired_tokens(&self);
}Expand description
Interface for caching authentication tokens securely.
Required Methods§
Sourcefn get_jwt<'life0, 'async_trait>(
&'life0 self,
app_id: GitHubAppId,
) -> Pin<Box<dyn Future<Output = Result<Option<JsonWebToken>, CacheError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn get_jwt<'life0, 'async_trait>(
&'life0 self,
app_id: GitHubAppId,
) -> Pin<Box<dyn Future<Output = Result<Option<JsonWebToken>, CacheError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Get cached JWT token.
Sourcefn store_jwt<'life0, 'async_trait>(
&'life0 self,
jwt: JsonWebToken,
) -> Pin<Box<dyn Future<Output = Result<(), CacheError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn store_jwt<'life0, 'async_trait>(
&'life0 self,
jwt: JsonWebToken,
) -> Pin<Box<dyn Future<Output = Result<(), CacheError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Store JWT token in cache.
Sourcefn get_installation_token<'life0, 'async_trait>(
&'life0 self,
installation_id: InstallationId,
) -> Pin<Box<dyn Future<Output = Result<Option<InstallationToken>, CacheError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn get_installation_token<'life0, 'async_trait>(
&'life0 self,
installation_id: InstallationId,
) -> Pin<Box<dyn Future<Output = Result<Option<InstallationToken>, CacheError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Get cached installation token.
Sourcefn store_installation_token<'life0, 'async_trait>(
&'life0 self,
token: InstallationToken,
) -> Pin<Box<dyn Future<Output = Result<(), CacheError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn store_installation_token<'life0, 'async_trait>(
&'life0 self,
token: InstallationToken,
) -> Pin<Box<dyn Future<Output = Result<(), CacheError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Store installation token in cache.
Sourcefn invalidate_installation_token<'life0, 'async_trait>(
&'life0 self,
installation_id: InstallationId,
) -> Pin<Box<dyn Future<Output = Result<(), CacheError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn invalidate_installation_token<'life0, 'async_trait>(
&'life0 self,
installation_id: InstallationId,
) -> Pin<Box<dyn Future<Output = Result<(), CacheError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Invalidate installation token.
Sourcefn cleanup_expired_tokens(&self)
fn cleanup_expired_tokens(&self)
Cleanup expired tokens.