Expand description
Security presets for the Auth Framework
This module provides pre-configured security levels that automatically apply appropriate security settings for different environments and use cases.
§Security Presets
- Development: Convenient settings for development environments
- Balanced: Good security with reasonable performance (default)
- HighSecurity: Strong security for sensitive applications
- Paranoid: Maximum security settings for high-risk environments
§Usage
use auth_framework::prelude::*;
// Quick setup with security preset
let auth = AuthFramework::quick_start()
.jwt_auth_from_env()
.security_level(SecurityPreset::HighSecurity)
.build().await?;
// Or apply to existing configuration
let config = AuthConfig::new()
.security(SecurityPreset::Paranoid.to_config());§Security Validation
Each preset includes built-in validation to ensure security requirements are met for the target environment:
use auth_framework::prelude::*;
// Validate security configuration
let issues = SecurityPreset::HighSecurity
.validate_environment()
.await?;
for issue in issues {
println!("⚠️ {}: {}", issue.severity, issue.description);
println!("💡 Fix: {}", issue.suggestion);
}Structs§
- Security
Audit Report - Security audit report
- Security
Issue - Security validation issue
Enums§
- Security
Audit Status - Overall security audit status
- Security
Preset - Security presets for common configurations
- Security
Severity - Security issue severity levels