Auth4Free
A modern, secure, and easy-to-use authentication library for Rust applications.
๐ Features
- Password Validation - Robust password strength checking and validation
- JWT Authentication - Secure token-based authentication
- Password Hashing - Industry-standard bcrypt password hashing
- User Management - Complete user lifecycle management
- Session Management - Secure session handling (coming soon)
- Rate Limiting - Protection against brute force attacks (planned)
- Multi-Factor Authentication - Enhanced security (planned)
๐ฆ Installation
Add this to your Cargo.toml:
[]
= "0.1.0"
๐ง Quick Start
Password Validation
use *;
let config = default;
let password = "MySecureP@ssw0rd!";
match validate_password
// Check password strength
let score = password_strength_score;
let category = password_strength_category;
println!;
User Authentication
use authenticate_user;
use User;
async
๐ก๏ธ Security Features
Password Validation Rules
- Minimum length requirements
- Uppercase/lowercase letter requirements
- Number and special character requirements
- Consecutive character limits
- Common password detection
Password Strength Analysis
use *;
let passwords = vec!;
for pwd in passwords
๐ Examples
Check out the examples directory for complete working examples:
password_validation- Basic password validationuser_registration- Complete user registration flowweb_api_integration- Web framework integration
Run examples with:
๐งช Testing
Run all tests:
๐ Documentation
API documentation is available at docs.rs.
๐ฎ Future Features
Coming Soon
- Session Management
- Refresh Token System
- Account Lockout Mechanisms
Planned Features
- OAuth2 Provider Integration (Google, GitHub, etc.)
- Multi-Factor Authentication (TOTP, SMS, Email)
- Rate Limiting and Brute Force Protection
- Email Verification System
- Role-Based Access Control (RBAC)
- Audit Logging
๐ค Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
- Fork the repository
- Create your feature branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'Add some AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request
๐ License
This project is licensed under the MIT License - see the LICENSE file for details.
๐ Acknowledgments
- Built with security best practices in mind
- Inspired by industry standards for authentication systems
- Development assisted by AI pair programming tools
Made with โค๏ธ for the Rust community