pub struct EmailManager { /* private fields */ }
Expand description
Email manager for handling email-based MFA with production providers
Implementations§
Source§impl EmailManager
impl EmailManager
Sourcepub fn new(storage: Arc<dyn AuthStorage>) -> Self
pub fn new(storage: Arc<dyn AuthStorage>) -> Self
Create a new email manager with default development configuration
Sourcepub fn new_with_config(
storage: Arc<dyn AuthStorage>,
email_config: EmailProviderConfig,
) -> Self
pub fn new_with_config( storage: Arc<dyn AuthStorage>, email_config: EmailProviderConfig, ) -> Self
Create a new email manager with custom provider configuration
Sourcepub async fn register_email(&self, user_id: &str, email: &str) -> Result<()>
pub async fn register_email(&self, user_id: &str, email: &str) -> Result<()>
Register email for email MFA
Sourcepub async fn initiate_challenge(&self, user_id: &str) -> Result<String>
pub async fn initiate_challenge(&self, user_id: &str) -> Result<String>
Initiate email challenge
Sourcepub async fn generate_code(&self, challenge_id: &str) -> Result<String>
pub async fn generate_code(&self, challenge_id: &str) -> Result<String>
Generate email code
Sourcepub async fn verify_code(&self, challenge_id: &str, code: &str) -> Result<bool>
pub async fn verify_code(&self, challenge_id: &str, code: &str) -> Result<bool>
Verify email code
Sourcepub async fn send_code(&self, user_id: &str, code: &str) -> Result<()>
pub async fn send_code(&self, user_id: &str, code: &str) -> Result<()>
Send email code (placeholder - would integrate with email provider)
Sourcepub async fn get_user_email(&self, user_id: &str) -> Result<Option<String>>
pub async fn get_user_email(&self, user_id: &str) -> Result<Option<String>>
Get user’s email address
Sourcepub async fn has_email(&self, user_id: &str) -> Result<bool>
pub async fn has_email(&self, user_id: &str) -> Result<bool>
Check if user has email configured
Sourcepub async fn send_email_code(&self, user_id: &str) -> Result<String>
pub async fn send_email_code(&self, user_id: &str) -> Result<String>
Send email code and return the generated code (mock implementation)
Auto Trait Implementations§
impl Freeze for EmailManager
impl !RefUnwindSafe for EmailManager
impl Send for EmailManager
impl Sync for EmailManager
impl Unpin for EmailManager
impl !UnwindSafe for EmailManager
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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