Struct vit_servicing_station_lib::v0::api_token::ApiTokenManager
source · pub struct ApiTokenManager {
connection_pool: DbConnectionPool,
}
Expand description
API token manager is an abstraction on the API tokens for the service The main idea is to keep the service agnostic of what kind of backend we are using such task. Right now we rely on a SQLlite connection. But in the future it maybe be something else like a REDIS, or some other hybrid system.
Fields§
§connection_pool: DbConnectionPool
Implementations§
source§impl ApiTokenManager
impl ApiTokenManager
fn new(connection_pool: DbConnectionPool) -> Self
async fn is_token_valid(&self, token: ApiToken) -> Result<bool, HandleError>
async fn revoke_token(&self, _token: ApiToken) -> Result<(), ()>
Auto Trait Implementations§
impl !RefUnwindSafe for ApiTokenManager
impl Send for ApiTokenManager
impl Sync for ApiTokenManager
impl Unpin for ApiTokenManager
impl !UnwindSafe for ApiTokenManager
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