rusmes-auth
Authentication backend abstraction for RusMES. Defines a pluggable AuthBackend trait used by all protocol servers (SMTP, IMAP, JMAP, POP3).
Status
Complete. Implements AuthBackend trait with five production backends, full SASL
framework, and security hardening.
Key Trait
All protocol servers receive an Arc<dyn AuthBackend> and call authenticate()
during login/auth flows.
Backends
| Backend | Description | Status |
|---|---|---|
| File | htpasswd-style file with bcrypt hashes | ✅ Complete |
| LDAP | LDAP/LDAPS bind authentication (802 lines) | ✅ Complete |
| SQL | Query-based auth against PostgreSQL/MySQL/SQLite (1,154 lines) | ✅ Complete |
| OAuth2/OIDC | Token introspection and JWKS validation (1,469 lines) | ✅ Complete |
| PAM | Linux PAM integration (feature-gated) | ✅ Complete |
SASL Mechanisms (1,495 lines)
PLAIN, LOGIN, CRAM-MD5, SCRAM-SHA-256, XOAUTH2
Security (885 lines)
Brute-force protection, password strength validation, audit logging, IP rate limiting.
Note: Only file-based auth is fully integrated end-to-end in
rusmes-server. LDAP/SQL/OAuth2 backends work independently but fall back toDummyAuthBackendin the main server binary.
Dependencies
rusmes-proto-Usernametypeasync-trait- async trait supportanyhow- error handling