pub struct EmailVerificationConfig {
pub redis_key_prefix: String,
pub secret: String,
pub ttl_seconds: u64,
pub resend_cooldown_seconds: u64,
pub max_attempts: u32,
pub code_digits: usize,
pub send_window_seconds: u64,
pub send_ip_attempts: u64,
pub send_email_attempts: u64,
pub send_global_attempts: u64,
pub send_metric_name: &'static str,
pub verify_metric_name: &'static str,
}Expand description
RegistrationEmailVerification 的独立参数结构。
Fields§
§redis_key_prefix: StringRedis key 完整前缀(按应用与部署环境隔离,
如 "yang-system:prod:registration-email")。
secret: String验证码摘要的独立服务端密钥,不得与 Token/Step-up 密钥复用。
ttl_seconds: u64验证码有效期(秒)。
resend_cooldown_seconds: u64同一身份的重发冷却(秒)。
max_attempts: u32单枚验证码的最大错误尝试次数,用尽即销毁。
code_digits: usize验证码位数(1..=9,决定数字码空间 10^n)。
send_window_seconds: u64发送侧计数窗口长度(秒)。
send_ip_attempts: u64窗口内单来源 IP 允许的最大发送次数。
send_email_attempts: u64窗口内单身份允许的最大发送次数。
send_global_attempts: u64窗口内全局允许的最大发送次数。
send_metric_name: &'static str发送侧计数器指标名(metrics feature 启用时发出)。
verify_metric_name: &'static str校验侧计数器指标名(metrics feature 启用时发出)。
Trait Implementations§
Source§impl Clone for EmailVerificationConfig
impl Clone for EmailVerificationConfig
Source§fn clone(&self) -> EmailVerificationConfig
fn clone(&self) -> EmailVerificationConfig
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 Freeze for EmailVerificationConfig
impl RefUnwindSafe for EmailVerificationConfig
impl Send for EmailVerificationConfig
impl Sync for EmailVerificationConfig
impl Unpin for EmailVerificationConfig
impl UnsafeUnpin for EmailVerificationConfig
impl UnwindSafe for EmailVerificationConfig
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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