pub struct FactorStrengthPolicy {Show 13 fields
pub tenant_id: TenantId,
pub name: String,
pub enforce_phishing_resistant: bool,
pub min_factor_strength: u8,
pub require_webauthn_for_admins: bool,
pub operation_risk_levels: HashMap<String, OperationRiskLevel>,
pub role_requirements: HashMap<String, u8>,
pub allow_phishable_fallback: bool,
pub show_security_warnings: bool,
pub upgrade_grace_period_days: i64,
pub enable_factor_promotion: bool,
pub created_at: DateTime<Utc>,
pub updated_at: DateTime<Utc>,
}Expand description
Factor strength policy configuration
Fields§
§tenant_id: TenantIdTenant ID this policy applies to
name: StringPolicy name
enforce_phishing_resistant: boolRequire phishing-resistant factors for all operations
min_factor_strength: u8Minimum factor strength score (0-100)
require_webauthn_for_admins: boolRequire WebAuthn for admin roles
operation_risk_levels: HashMap<String, OperationRiskLevel>Risk level thresholds for operations
role_requirements: HashMap<String, u8>Role-based factor requirements
allow_phishable_fallback: boolAllow phishable factors as fallback
show_security_warnings: boolShow security warnings for phishable factors
upgrade_grace_period_days: i64Grace period for users to upgrade factors (days)
enable_factor_promotion: boolEnable factor promotion campaigns
created_at: DateTime<Utc>Created timestamp
updated_at: DateTime<Utc>Last updated timestamp
Implementations§
Source§impl FactorStrengthPolicy
impl FactorStrengthPolicy
Sourcepub fn is_factor_allowed(
&self,
factor_type: FactorType,
operation_risk: OperationRiskLevel,
) -> Result<(), FactorStrengthError>
pub fn is_factor_allowed( &self, factor_type: FactorType, operation_risk: OperationRiskLevel, ) -> Result<(), FactorStrengthError>
Check if a factor meets this policy’s requirements
Sourcepub fn get_operation_risk(&self, operation: &str) -> OperationRiskLevel
pub fn get_operation_risk(&self, operation: &str) -> OperationRiskLevel
Get operation risk level for a specific operation
Trait Implementations§
Source§impl Clone for FactorStrengthPolicy
impl Clone for FactorStrengthPolicy
Source§fn clone(&self) -> FactorStrengthPolicy
fn clone(&self) -> FactorStrengthPolicy
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 moreSource§impl Debug for FactorStrengthPolicy
impl Debug for FactorStrengthPolicy
Source§impl<'de> Deserialize<'de> for FactorStrengthPolicy
impl<'de> Deserialize<'de> for FactorStrengthPolicy
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for FactorStrengthPolicy
impl RefUnwindSafe for FactorStrengthPolicy
impl Send for FactorStrengthPolicy
impl Sync for FactorStrengthPolicy
impl Unpin for FactorStrengthPolicy
impl UnsafeUnpin for FactorStrengthPolicy
impl UnwindSafe for FactorStrengthPolicy
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