pub struct LsAuthAccountService<Id: IdType + MaybeWeb, RepoManager: AuthRepositoryManager<Id>> { /* private fields */ }

Implementations§

source§

impl<Id: IdType + MaybeWeb, RepoManager: AuthRepositoryManager<Id>> LsAuthAccountService<Id, RepoManager>

source

pub fn new( c3p0: RepoManager::C3P0, auth_config: AuthConfig, token_service: Arc<LsTokenService<Id, RepoManager>>, password_service: Arc<LsPasswordCodecService>, auth_repo: RepoManager::AuthAccountRepo ) -> Self

source

pub async fn login( &self, username: &str, password: &str ) -> Result<Auth<Id>, LsError>

source

pub async fn login_with_conn( &self, conn: &mut RepoManager::Tx, username: &str, password: &str ) -> Result<Auth<Id>, LsError>

source

pub async fn create_user( &self, create_login_dto: CreateLoginDto ) -> Result<(AuthAccountModel<Id>, TokenModel<Id>), LsError>

source

pub async fn create_user_with_conn( &self, conn: &mut RepoManager::Tx, create_login_dto: CreateLoginDto ) -> Result<(AuthAccountModel<Id>, TokenModel<Id>), LsError>

source

pub async fn generate_new_activation_token_by_username_and_email( &self, username: &str, email: &str ) -> Result<(AuthAccountModel<Id>, TokenModel<Id>), LsError>

source

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>

source

pub async fn generate_new_activation_token_by_token( &self, previous_activation_token: &str ) -> Result<(AuthAccountModel<Id>, TokenModel<Id>), LsError>

source

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>

source

pub async fn activate_user( &self, activation_token: &str ) -> Result<AuthAccountModel<Id>, LsError>

source

pub async fn activate_user_with_conn( &self, conn: &mut RepoManager::Tx, activation_token: &str ) -> Result<AuthAccountModel<Id>, LsError>

source

pub async fn generate_reset_password_token( &self, username: &str ) -> Result<(AuthAccountModel<Id>, TokenModel<Id>), LsError>

source

pub async fn generate_reset_password_token_with_conn( &self, conn: &mut RepoManager::Tx, username: &str ) -> Result<(AuthAccountModel<Id>, TokenModel<Id>), LsError>

source

pub async fn reset_password_by_token( &self, reset_password_dto: ResetPasswordDto ) -> Result<AuthAccountModel<Id>, LsError>

source

pub async fn reset_password_by_token_with_conn( &self, conn: &mut RepoManager::Tx, reset_password_dto: ResetPasswordDto ) -> Result<AuthAccountModel<Id>, LsError>

source

pub async fn change_password( &self, dto: ChangePasswordDto<Id> ) -> Result<AuthAccountModel<Id>, LsError>

source

pub async fn change_password_with_conn( &self, conn: &mut RepoManager::Tx, dto: ChangePasswordDto<Id> ) -> Result<AuthAccountModel<Id>, LsError>

source

pub async fn fetch_by_user_id( &self, user_id: &Id ) -> Result<AuthAccountModel<Id>, LsError>

source

pub async fn fetch_by_user_id_with_conn( &self, conn: &mut RepoManager::Tx, user_id: &Id ) -> Result<AuthAccountModel<Id>, LsError>

source

pub async fn fetch_by_username( &self, username: &str ) -> Result<AuthAccountModel<Id>, LsError>

source

pub async fn fetch_by_username_with_conn( &self, conn: &mut RepoManager::Tx, username: &str ) -> Result<AuthAccountModel<Id>, LsError>

source

pub async fn fetch_all_by_status( &self, status: AuthAccountStatus, start_user_id: &Id, limit: u32 ) -> Result<Vec<AuthAccountModel<Id>>, LsError>

source

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>

source

pub async fn add_roles( &self, user_id: &Id, roles: &[String] ) -> Result<AuthAccountModel<Id>, LsError>

source

pub async fn add_roles_with_conn( &self, conn: &mut RepoManager::Tx, user_id: &Id, roles: &[String] ) -> Result<AuthAccountModel<Id>, LsError>

source

pub async fn delete_roles( &self, user_id: &Id, roles: &[String] ) -> Result<AuthAccountModel<Id>, LsError>

source

pub async fn delete_roles_with_conn( &self, conn: &mut RepoManager::Tx, user_id: &Id, roles: &[String] ) -> Result<AuthAccountModel<Id>, LsError>

source

pub async fn change_user_data( &self, user_id: &Id, new_username: Option<String>, new_email: Option<String> ) -> Result<AuthAccountModel<Id>, LsError>

source

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>

source

pub async fn disable_by_user_id( &self, user_id: &Id ) -> Result<AuthAccountModel<Id>, LsError>

source

pub async fn disable_by_user_id_with_conn( &self, conn: &mut RepoManager::Tx, user_id: &Id ) -> Result<AuthAccountModel<Id>, LsError>

source

pub async fn reactivate_disabled_user_by_user_id( &self, user_id: &Id ) -> Result<AuthAccountModel<Id>, LsError>

source

pub async fn reactivate_disabled_user_by_user_id_with_conn( &self, conn: &mut RepoManager::Tx, user_id: &Id ) -> Result<AuthAccountModel<Id>, LsError>

source

pub async fn delete_by_user_id(&self, user_id: &Id) -> Result<u64, LsError>

source

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>
where RepoManager::C3P0: Clone, RepoManager::AuthAccountRepo: Clone,

source§

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)

Performs copy-assignment from source. Read more

Auto 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>

§

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> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T> Instrument for T

source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

source§

fn vzip(self) -> V

source§

impl<T> WithSubscriber for T

source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
source§

impl<T> MaybeWeb for T
where T: Send + Sync + ?Sized,