pub struct EmailOtpPlugin { /* private fields */ }Implementations§
Source§impl EmailOtpPlugin
impl EmailOtpPlugin
Sourcepub fn change_email_email_otp_endpoint(
input: &EmailOtpChangeInput,
) -> AuthResult<ServerEndpoint<EmailOtpChanged>>
pub fn change_email_email_otp_endpoint( input: &EmailOtpChangeInput, ) -> AuthResult<ServerEndpoint<EmailOtpChanged>>
Consume a new-mailbox challenge using the caller’s authoritative session.
§Errors
Returns an error if the supplied input cannot be serialized.
Sourcepub fn request_email_change_email_otp_endpoint(
input: &EmailOtpChangeRequestInput,
) -> AuthResult<ServerEndpoint<EmailOtpChangeRequested>>
pub fn request_email_change_email_otp_endpoint( input: &EmailOtpChangeRequestInput, ) -> AuthResult<ServerEndpoint<EmailOtpChangeRequested>>
Request a new-mailbox challenge using an authoritative caller session.
§Errors
Returns an error if the supplied input cannot be serialized.
Sourcepub fn reset_password_email_otp_endpoint(
input: &EmailOtpPasswordResetInput,
) -> AuthResult<ServerEndpoint<EmailOtpPasswordReset>>
pub fn reset_password_email_otp_endpoint( input: &EmailOtpPasswordResetInput, ) -> AuthResult<ServerEndpoint<EmailOtpPasswordReset>>
Consume a reset proof and replace or create the owner’s credential.
§Errors
Returns an error if reset input cannot be serialized.
Sourcepub fn request_password_reset_email_otp_endpoint(
email: impl Into<String>,
) -> ServerEndpoint<EmailOtpResetRequested>
pub fn request_password_reset_email_otp_endpoint( email: impl Into<String>, ) -> ServerEndpoint<EmailOtpResetRequested>
Request a scoped reset proof without exposing whether the mailbox exists.
Sourcepub fn forget_password_email_otp_endpoint(
email: impl Into<String>,
) -> ServerEndpoint<EmailOtpResetRequested>
pub fn forget_password_email_otp_endpoint( email: impl Into<String>, ) -> ServerEndpoint<EmailOtpResetRequested>
Call the published deprecated reset-request alias.
Sourcepub fn sign_in_email_otp_endpoint(
input: &EmailOtpSignInInput,
) -> AuthResult<ServerEndpoint<EmailOtpSignInResult>>
pub fn sign_in_email_otp_endpoint( input: &EmailOtpSignInInput, ) -> AuthResult<ServerEndpoint<EmailOtpSignInResult>>
Consume a sign-in proof and apply returning-user or signup policy.
§Errors
Returns an error if the supplied sign-in input cannot be serialized.
Sourcepub fn verify_email_otp_endpoint(
email: impl Into<String>,
otp: impl Into<String>,
) -> ServerEndpoint<EmailOtpVerification>
pub fn verify_email_otp_endpoint( email: impl Into<String>, otp: impl Into<String>, ) -> ServerEndpoint<EmailOtpVerification>
Consume a mailbox proof and apply verification/session policy.
Sourcepub fn check_verification_otp_endpoint(
email: impl Into<String>,
otp_type: EmailOtpType,
otp: impl Into<String>,
) -> ServerEndpoint<EmailOtpCheck>
pub fn check_verification_otp_endpoint( email: impl Into<String>, otp_type: EmailOtpType, otp: impl Into<String>, ) -> ServerEndpoint<EmailOtpCheck>
Check a scoped proof without consuming a successful validation.
Sourcepub fn send_verification_otp_endpoint(
email: impl Into<String>,
otp_type: EmailOtpType,
) -> ServerEndpoint<EmailOtpSent>
pub fn send_verification_otp_endpoint( email: impl Into<String>, otp_type: EmailOtpType, ) -> ServerEndpoint<EmailOtpSent>
Send a scoped OTP through the installed delivery and storage policies.
Sourcepub fn create_verification_otp_endpoint(
email: impl Into<String>,
otp_type: EmailOtpType,
) -> ServerEndpoint<String>
pub fn create_verification_otp_endpoint( email: impl Into<String>, otp_type: EmailOtpType, ) -> ServerEndpoint<String>
Create a code through the installed endpoint hooks and post-hook validation.
Sourcepub fn get_verification_otp_endpoint(
email: impl Into<String>,
otp_type: EmailOtpType,
) -> ServerEndpoint<EmailOtpRead>
pub fn get_verification_otp_endpoint( email: impl Into<String>, otp_type: EmailOtpType, ) -> ServerEndpoint<EmailOtpRead>
Retrieve a code through the installed endpoint hooks.
Source§impl EmailOtpPlugin
impl EmailOtpPlugin
pub const fn new(config: EmailOtpConfig) -> Self
Sourcepub async fn create_verification_otp(
&self,
ctx: &AuthContext<impl AuthSchema>,
email: &str,
otp_type: EmailOtpType,
) -> AuthResult<String>
pub async fn create_verification_otp( &self, ctx: &AuthContext<impl AuthSchema>, email: &str, otp_type: EmailOtpType, ) -> AuthResult<String>
Create and persist a code without delivering it or checking whether the mailbox has an account. This operation is available only to server code.
§Errors
Returns an error if OTP generation, encoding, or persistence fails.
Sourcepub async fn get_verification_otp(
&self,
ctx: &AuthContext<impl AuthSchema>,
email: &str,
otp_type: EmailOtpType,
) -> AuthResult<Option<String>>
pub async fn get_verification_otp( &self, ctx: &AuthContext<impl AuthSchema>, email: &str, otp_type: EmailOtpType, ) -> AuthResult<Option<String>>
Retrieve a live plaintext/decryptable code without consuming it. Hashed storage rejects this operation, since a hash cannot reveal a code.
§Errors
Returns an error if storage fails or the configured OTP representation cannot be recovered.
Trait Implementations§
Source§impl<S: AuthSchema> AuthPlugin<S> for EmailOtpPlugin
impl<S: AuthSchema> AuthPlugin<S> for EmailOtpPlugin
Source§fn on_request<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
req: &'life1 AuthRequest,
ctx: &'life2 AuthContext<S>,
) -> Pin<Box<dyn Future<Output = AuthResult<Option<AuthResponse>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn on_request<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
req: &'life1 AuthRequest,
ctx: &'life2 AuthContext<S>,
) -> Pin<Box<dyn Future<Output = AuthResult<Option<AuthResponse>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Source§fn static_openapi_metadata(&self) -> PluginOpenApiMetadata
fn static_openapi_metadata(&self) -> PluginOpenApiMetadata
Source§fn openapi_metadata(&self, ctx: &AuthInitContext<S>) -> PluginOpenApiMetadata
fn openapi_metadata(&self, ctx: &AuthInitContext<S>) -> PluginOpenApiMetadata
Source§fn rate_limits(&self) -> Vec<PluginRateLimit>
fn rate_limits(&self) -> Vec<PluginRateLimit>
Source§fn server_endpoints(&self) -> Vec<EndpointDefinition>
fn server_endpoints(&self) -> Vec<EndpointDefinition>
Source§fn validate_endpoint(
&self,
call: &EndpointCall,
_ctx: &AuthContext<S>,
) -> AuthResult<EndpointInput>
fn validate_endpoint( &self, call: &EndpointCall, _ctx: &AuthContext<S>, ) -> AuthResult<EndpointInput>
Source§fn on_endpoint<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
call: &'life1 EndpointCall,
ctx: &'life2 AuthContext<S>,
) -> Pin<Box<dyn Future<Output = AuthResult<EndpointResponse>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn on_endpoint<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
call: &'life1 EndpointCall,
ctx: &'life2 AuthContext<S>,
) -> Pin<Box<dyn Future<Output = AuthResult<EndpointResponse>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Source§fn on_init<'life0, 'life1, 'async_trait>(
&'life0 self,
ctx: &'life1 mut AuthInitContext<S>,
) -> Pin<Box<dyn Future<Output = AuthResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn on_init<'life0, 'life1, 'async_trait>(
&'life0 self,
ctx: &'life1 mut AuthInitContext<S>,
) -> Pin<Box<dyn Future<Output = AuthResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Source§fn after_request<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
req: &'life1 AuthRequest,
ctx: &'life2 AuthContext<S>,
response: AuthResponse,
) -> Pin<Box<dyn Future<Output = AuthResult<AuthResponse>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn after_request<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
req: &'life1 AuthRequest,
ctx: &'life2 AuthContext<S>,
response: AuthResponse,
) -> Pin<Box<dyn Future<Output = AuthResult<AuthResponse>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Source§fn endpoint_hooks(&self) -> Vec<&dyn EndpointHook<S>>
fn endpoint_hooks(&self) -> Vec<&dyn EndpointHook<S>>
Source§fn allowed_media_types(&self, _route: &AuthRoute) -> Vec<&'static str>
fn allowed_media_types(&self, _route: &AuthRoute) -> Vec<&'static str>
Source§fn session_fields(&self) -> IndexMap<String, FieldConfig>
fn session_fields(&self) -> IndexMap<String, FieldConfig>
fn user_fields(&self) -> IndexMap<String, FieldConfig>
fn account_fields(&self) -> IndexMap<String, FieldConfig>
Source§fn on_http_request<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
_req: &'life1 AuthRequest,
_ctx: &'life2 AuthContext<S>,
) -> Pin<Box<dyn Future<Output = Result<Option<AuthResponse>, AuthError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Self: 'async_trait,
fn on_http_request<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
_req: &'life1 AuthRequest,
_ctx: &'life2 AuthContext<S>,
) -> Pin<Box<dyn Future<Output = Result<Option<AuthResponse>, AuthError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Self: 'async_trait,
Source§fn on_http_request_action<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
req: &'life1 AuthRequest,
ctx: &'life2 AuthContext<S>,
) -> Pin<Box<dyn Future<Output = Result<Option<HttpRequestAction>, AuthError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Self: 'async_trait,
fn on_http_request_action<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
req: &'life1 AuthRequest,
ctx: &'life2 AuthContext<S>,
) -> Pin<Box<dyn Future<Output = Result<Option<HttpRequestAction>, AuthError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Self: 'async_trait,
on_http_request implementations. Request-local configuration has already
been resolved from the incoming request, matching the Source HTTP handler.Source§fn on_http_response<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
_req: &'life1 AuthRequest,
_ctx: &'life2 AuthContext<S>,
_response: &'life3 AuthResponse,
) -> Pin<Box<dyn Future<Output = Result<Option<AuthResponse>, AuthError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
Self: 'async_trait,
fn on_http_response<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
_req: &'life1 AuthRequest,
_ctx: &'life2 AuthContext<S>,
_response: &'life3 AuthResponse,
) -> Pin<Box<dyn Future<Output = Result<Option<AuthResponse>, AuthError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
Self: 'async_trait,
Source§fn before_request<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
_req: &'life1 AuthRequest,
_ctx: &'life2 AuthContext<S>,
) -> Pin<Box<dyn Future<Output = Result<Option<BeforeRequestAction>, AuthError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Self: 'async_trait,
fn before_request<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
_req: &'life1 AuthRequest,
_ctx: &'life2 AuthContext<S>,
) -> Pin<Box<dyn Future<Output = Result<Option<BeforeRequestAction>, AuthError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Self: 'async_trait,
Source§fn on_http_endpoint<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
req: &'life1 AuthRequest,
ctx: &'life2 AuthContext<S>,
) -> Pin<Box<dyn Future<Output = Result<Option<HttpEndpointResponse>, AuthError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Self: 'async_trait,
fn on_http_endpoint<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
req: &'life1 AuthRequest,
ctx: &'life2 AuthContext<S>,
) -> Pin<Box<dyn Future<Output = Result<Option<HttpEndpointResponse>, AuthError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Self: 'async_trait,
on_request; plugins returning a native raw response can
override this method to bypass the endpoint after-hook pipeline.