Struct lightspeed_auth::service::auth_account::LsAuthAccountService
source · pub struct LsAuthAccountService<Id: IdType + MaybeWeb, RepoManager: AuthRepositoryManager<Id>> { /* private fields */ }
Implementations§
source§impl<Id: IdType + MaybeWeb, RepoManager: AuthRepositoryManager<Id>> LsAuthAccountService<Id, RepoManager>
impl<Id: IdType + MaybeWeb, RepoManager: AuthRepositoryManager<Id>> LsAuthAccountService<Id, RepoManager>
pub fn new( c3p0: RepoManager::C3P0, auth_config: AuthConfig, token_service: Arc<LsTokenService<Id, RepoManager>>, password_service: Arc<LsPasswordCodecService>, auth_repo: RepoManager::AuthAccountRepo ) -> Self
pub async fn login( &self, username: &str, password: &str ) -> Result<Auth<Id>, LsError>
pub async fn login_with_conn( &self, conn: &mut RepoManager::Tx, username: &str, password: &str ) -> Result<Auth<Id>, LsError>
pub async fn create_user( &self, create_login_dto: CreateLoginDto ) -> Result<(AuthAccountModel<Id>, TokenModel<Id>), LsError>
pub async fn create_user_with_conn( &self, conn: &mut RepoManager::Tx, create_login_dto: CreateLoginDto ) -> Result<(AuthAccountModel<Id>, TokenModel<Id>), LsError>
pub async fn generate_new_activation_token_by_username_and_email( &self, username: &str, email: &str ) -> Result<(AuthAccountModel<Id>, TokenModel<Id>), LsError>
pub async fn generate_new_activation_token_by_username_and_email_with_conn( &self, conn: &mut RepoManager::Tx, username: &str, email: &str ) -> Result<(AuthAccountModel<Id>, TokenModel<Id>), LsError>
pub async fn generate_new_activation_token_by_token( &self, previous_activation_token: &str ) -> Result<(AuthAccountModel<Id>, TokenModel<Id>), LsError>
pub async fn generate_new_activation_token_by_token_with_conn( &self, conn: &mut RepoManager::Tx, previous_activation_token: &str ) -> Result<(AuthAccountModel<Id>, TokenModel<Id>), LsError>
pub async fn activate_user( &self, activation_token: &str ) -> Result<AuthAccountModel<Id>, LsError>
pub async fn activate_user_with_conn( &self, conn: &mut RepoManager::Tx, activation_token: &str ) -> Result<AuthAccountModel<Id>, LsError>
pub async fn generate_reset_password_token( &self, username: &str ) -> Result<(AuthAccountModel<Id>, TokenModel<Id>), LsError>
pub async fn generate_reset_password_token_with_conn( &self, conn: &mut RepoManager::Tx, username: &str ) -> Result<(AuthAccountModel<Id>, TokenModel<Id>), LsError>
pub async fn reset_password_by_token( &self, reset_password_dto: ResetPasswordDto ) -> Result<AuthAccountModel<Id>, LsError>
pub async fn reset_password_by_token_with_conn( &self, conn: &mut RepoManager::Tx, reset_password_dto: ResetPasswordDto ) -> Result<AuthAccountModel<Id>, LsError>
pub async fn change_password( &self, dto: ChangePasswordDto<Id> ) -> Result<AuthAccountModel<Id>, LsError>
pub async fn change_password_with_conn( &self, conn: &mut RepoManager::Tx, dto: ChangePasswordDto<Id> ) -> Result<AuthAccountModel<Id>, LsError>
pub async fn fetch_by_user_id( &self, user_id: &Id ) -> Result<AuthAccountModel<Id>, LsError>
pub async fn fetch_by_user_id_with_conn( &self, conn: &mut RepoManager::Tx, user_id: &Id ) -> Result<AuthAccountModel<Id>, LsError>
pub async fn fetch_by_username( &self, username: &str ) -> Result<AuthAccountModel<Id>, LsError>
pub async fn fetch_by_username_with_conn( &self, conn: &mut RepoManager::Tx, username: &str ) -> Result<AuthAccountModel<Id>, LsError>
pub async fn fetch_all_by_status( &self, status: AuthAccountStatus, start_user_id: &Id, limit: u32 ) -> Result<Vec<AuthAccountModel<Id>>, LsError>
pub async fn fetch_all_by_status_with_conn( &self, conn: &mut RepoManager::Tx, status: AuthAccountStatus, start_user_id: &Id, limit: u32 ) -> Result<Vec<AuthAccountModel<Id>>, LsError>
pub async fn add_roles( &self, user_id: &Id, roles: &[String] ) -> Result<AuthAccountModel<Id>, LsError>
pub async fn add_roles_with_conn( &self, conn: &mut RepoManager::Tx, user_id: &Id, roles: &[String] ) -> Result<AuthAccountModel<Id>, LsError>
pub async fn delete_roles( &self, user_id: &Id, roles: &[String] ) -> Result<AuthAccountModel<Id>, LsError>
pub async fn delete_roles_with_conn( &self, conn: &mut RepoManager::Tx, user_id: &Id, roles: &[String] ) -> Result<AuthAccountModel<Id>, LsError>
pub async fn change_user_data( &self, user_id: &Id, new_username: Option<String>, new_email: Option<String> ) -> Result<AuthAccountModel<Id>, LsError>
pub async fn change_user_data_with_conn( &self, conn: &mut RepoManager::Tx, user_id: &Id, new_username: Option<String>, new_email: Option<String> ) -> Result<AuthAccountModel<Id>, LsError>
pub async fn disable_by_user_id( &self, user_id: &Id ) -> Result<AuthAccountModel<Id>, LsError>
pub async fn disable_by_user_id_with_conn( &self, conn: &mut RepoManager::Tx, user_id: &Id ) -> Result<AuthAccountModel<Id>, LsError>
pub async fn reactivate_disabled_user_by_user_id( &self, user_id: &Id ) -> Result<AuthAccountModel<Id>, LsError>
pub async fn reactivate_disabled_user_by_user_id_with_conn( &self, conn: &mut RepoManager::Tx, user_id: &Id ) -> Result<AuthAccountModel<Id>, LsError>
pub async fn delete_by_user_id(&self, user_id: &Id) -> Result<u64, LsError>
pub async fn delete_by_user_id_with_conn( &self, conn: &mut RepoManager::Tx, user_id: &Id ) -> Result<u64, LsError>
Trait Implementations§
source§impl<Id: Clone + IdType + MaybeWeb, RepoManager: Clone + AuthRepositoryManager<Id>> Clone for LsAuthAccountService<Id, RepoManager>
impl<Id: Clone + IdType + MaybeWeb, RepoManager: Clone + AuthRepositoryManager<Id>> Clone for LsAuthAccountService<Id, RepoManager>
source§fn clone(&self) -> LsAuthAccountService<Id, RepoManager>
fn clone(&self) -> LsAuthAccountService<Id, RepoManager>
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreAuto Trait Implementations§
impl<Id, RepoManager> Freeze for LsAuthAccountService<Id, RepoManager>where
<RepoManager as AuthRepositoryManager<Id>>::AuthAccountRepo: Freeze,
<RepoManager as AuthRepositoryManager<Id>>::C3P0: Freeze,
impl<Id, RepoManager> RefUnwindSafe for LsAuthAccountService<Id, RepoManager>where
<RepoManager as AuthRepositoryManager<Id>>::AuthAccountRepo: RefUnwindSafe,
<RepoManager as AuthRepositoryManager<Id>>::C3P0: RefUnwindSafe,
<RepoManager as AuthRepositoryManager<Id>>::TokenRepo: RefUnwindSafe,
impl<Id, RepoManager> Send for LsAuthAccountService<Id, RepoManager>
impl<Id, RepoManager> Sync for LsAuthAccountService<Id, RepoManager>
impl<Id, RepoManager> Unpin for LsAuthAccountService<Id, RepoManager>where
<RepoManager as AuthRepositoryManager<Id>>::AuthAccountRepo: Unpin,
<RepoManager as AuthRepositoryManager<Id>>::C3P0: Unpin,
impl<Id, RepoManager> UnwindSafe for LsAuthAccountService<Id, RepoManager>where
<RepoManager as AuthRepositoryManager<Id>>::AuthAccountRepo: UnwindSafe,
<RepoManager as AuthRepositoryManager<Id>>::C3P0: UnwindSafe,
<RepoManager as AuthRepositoryManager<Id>>::TokenRepo: RefUnwindSafe,
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