Releases: coenttb/swift-password-validation
0.0.1
A flexible and secure password validation library for Swift applications.
🎉 Initial Release
This is the first release of PasswordValidation, providing a comprehensive password validation system for Swift projects.
✨ Features
- Predefined Validators: Ready-to-use validation rules for common scenarios
- Custom Validation: Create your own validation logic with ease
- Dependencies Integration: Built-in support for the Dependencies library
- Localized Error Messages: User-friendly error descriptions in Dutch and English
- Comprehensive Testing: Simple and default validators for different environments
- Swift Concurrency: Full
Sendable
support for modern Swift apps - Swift 6.0 Support: Built with the latest Swift language features
📦 Installation
Add to your Package.swift
:
dependencies: [
.package(url: "https://github.com/coenttb/swift-password-validation.git", from: "0.0.1")
]
🚀 Quick Start
import PasswordValidation
// Use the comprehensive validator
let validator = PasswordValidation.default
do {
let isValid = try validator.validate("MySecurePass123!")
print("Password is valid: (isValid)")
} catch let error as PasswordValidation.Error {
print("Validation failed: (error.description)")
}
🔐 Default Validation Rules
The PasswordValidation.default validator enforces:
- Length: 8-64 characters
- Uppercase: At least one uppercase letter (A-Z)
- Lowercase: At least one lowercase letter (a-z)
- Digits: At least one digit (0-9)
- Special Characters: At least one special character (!&^%$#@()/)
🧪 Dependencies Integration
import Dependencies
import PasswordValidation
struct LoginService {
@Dependency(\.passwordValidation) var passwordValidation
func validateUserPassword(_ password: String) throws -> Bool {
return try passwordValidation.validate(password)
}
}
📚 Documentation
- Comprehensive DocC documentation included
- Getting started guide
- Validation rules reference
- Custom validation examples
🔧 What's Included
- Core password validation system
- Predefined validators (default and simple)
- Custom validation support
- Localized error messages
- Dependencies integration
- Comprehensive test suite
- Apache 2.0 license
Ready to secure your Swift applications with robust password validation! 🔒
Full Changelog: https://github.com/coenttb/swift-password-validation/commits/0.0.1