pub struct CollabUserDataProvider { /* private fields */ }Expand description
User data provider for collaboration system
Implementations§
Source§impl CollabUserDataProvider
impl CollabUserDataProvider
Sourcepub fn new(
db: Pool<Sqlite>,
user_service: Arc<UserService>,
workspace_service: Arc<WorkspaceService>,
) -> Self
pub fn new( db: Pool<Sqlite>, user_service: Arc<UserService>, workspace_service: Arc<WorkspaceService>, ) -> Self
Create a new user data provider
Sourcepub fn with_storage(
db: Pool<Sqlite>,
user_service: Arc<UserService>,
workspace_service: Arc<WorkspaceService>,
token_storage: Option<Arc<dyn ApiTokenStorage>>,
mfa_storage: Option<Arc<dyn MfaStorage>>,
justification_storage: Option<Arc<dyn JustificationStorage>>,
) -> Self
pub fn with_storage( db: Pool<Sqlite>, user_service: Arc<UserService>, workspace_service: Arc<WorkspaceService>, token_storage: Option<Arc<dyn ApiTokenStorage>>, mfa_storage: Option<Arc<dyn MfaStorage>>, justification_storage: Option<Arc<dyn JustificationStorage>>, ) -> Self
Create with optional storage backends
Trait Implementations§
Source§impl UserDataProvider for CollabUserDataProvider
impl UserDataProvider for CollabUserDataProvider
Source§fn get_all_users<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Vec<UserAccessInfo>, Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn get_all_users<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Vec<UserAccessInfo>, Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Get all active users with their access information
Source§fn get_privileged_users<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Vec<PrivilegedAccessInfo>, Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn get_privileged_users<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Vec<PrivilegedAccessInfo>, Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Get privileged users (users with admin roles)
Source§fn get_api_tokens<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Vec<ApiTokenInfo>, Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn get_api_tokens<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Vec<ApiTokenInfo>, Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Get all API tokens for review
Source§fn get_user<'life0, 'async_trait>(
&'life0 self,
user_id: Uuid,
) -> Pin<Box<dyn Future<Output = Result<Option<UserAccessInfo>, Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn get_user<'life0, 'async_trait>(
&'life0 self,
user_id: Uuid,
) -> Pin<Box<dyn Future<Output = Result<Option<UserAccessInfo>, Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Get user by ID
Source§fn get_last_login<'life0, 'async_trait>(
&'life0 self,
user_id: Uuid,
) -> Pin<Box<dyn Future<Output = Result<Option<DateTime<Utc>>, Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn get_last_login<'life0, 'async_trait>(
&'life0 self,
user_id: Uuid,
) -> Pin<Box<dyn Future<Output = Result<Option<DateTime<Utc>>, Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Get last login date for a user Read more
Auto Trait Implementations§
impl Freeze for CollabUserDataProvider
impl !RefUnwindSafe for CollabUserDataProvider
impl Send for CollabUserDataProvider
impl Sync for CollabUserDataProvider
impl Unpin for CollabUserDataProvider
impl !UnwindSafe for CollabUserDataProvider
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