CrydenSync π
π― The Problem
Authentication is not business logic, yet every project rewrites it. Developers face three painful choices:
- Rewrite auth logic for every project β risky, inconsistent, time-consuming
- Use hosted auth services β vendor lock-in, users aren't yours, requires internet
- Use framework-specific tools β tied to Express, Django, Next.js β not reusable
π‘ The Solution
CrydenSync is an embeddable authentication engine that gives you a standard, reusable auth system you control:
import "github.com/crydensync/cryden"
func main() {
engine := cryden.New() // In-memory for testing
// Or with persistent storage
// engine, _ := cryden.WithSQLite("users.db")
ctx := context.Background()
// Sign up
user, _ := cryden.SignUp(ctx, engine, "alice@example.com", "SecurePass123")
// Login
tokens, _, _ := cryden.Login(ctx, engine, "alice@example.com", "SecurePass123")
// Protect routes
userID, _ := cryden.VerifyToken(engine, tokens.AccessToken)
}
β¨ Features
β
v1.0.0 (Current)
Β· Email/password authentication β Secure, bcrypt hashed
Β· JWT access tokens β Short-lived, stateless
Β· Opaque refresh tokens β Stored in DB for revocation
Β· Rate limiting β Per IP with headers (X-RateLimit-*)
Β· Audit logging β Track every auth event
Β· Session management β Logout single device or all devices
Β· Multiple storage backends β Memory, SQLite, PostgreSQL, MongoDB
Β· Complete test suite β 90%+ coverage
Β· Offline-first β Works without internet, SQLite by default
π§ Coming Soon
Feature Status Target
gRPC API π§ Planned v1.1.0
CLI tool (csax) π§ Planned v1.1.0
Language SDKs (JS, Python, PHP) π§ Planned v1.2.0
MFA/2FA (TOTP) π
Future v1.3.0
Magic Links π
Future v1.3.0
WebAuthn/Passkeys π
Future v2.0.0
π¦ Installation
go get github.com/crydensync/cryden@v1.0.0
π Documentation
Section Description
π Getting Started 60-second working auth
π― Philosophy Why Cryden exists
ποΈ Architecture How it works
π Design Decisions Why we built it this way
π§ Guide Installation, config, middleware, testing
π Adapters Interface implementations
π API Reference Complete API docs
π‘ Examples Copy-paste working code
π§ͺ Testing
CrydenSync is designed for maximum testability:
func TestLogin(t *testing.T) {
engine := cryden.New() // In-memory storage
// Optional: Use mock hasher for faster tests
engine.WithHasher(&core.MockHasher{})
// Optional: Disable rate limiting
engine.WithRateLimiter(&core.NoopRateLimiter{})
ctx := context.Background()
cryden.SignUp(ctx, engine, "test@example.com", "pass")
tokens, _, err := cryden.Login(ctx, engine, "test@example.com", "pass")
assert.NoError(t, err)
assert.NotEmpty(t, tokens.AccessToken)
}
π Testing Guide β
π§ Configuration
// With SQLite persistence
engine, err := cryden.WithSQLite("users.db")
// With custom JWT secret (required in production)
cryden.WithJWTSecret(engine, os.Getenv("JWT_SECRET"))
// With custom rate limiter
engine.WithRateLimiter(redis.NewRateLimiter())
// With custom audit logger
engine.WithAuditLogger(file.NewAuditLogger("auth.log"))
π Storage Backends
Backend Status Use Case
Memory β
Stable Testing
SQLite β
Stable Offline-first, development
PostgreSQL β
Stable Production
MongoDB β
Stable Document stores
MySQL π§ Planned v1.1.0
Redis π§ Planned v1.1.0 (rate limiting)
π About the Name
CrydenSync is the full name of the project, but the Go package is simply cryden for brevity.
import "github.com/crydensync/cryden" // Notice: crydensync/cryden
auth := cryden.New() // Short and sweet!
π Security Notes v1.0.0
β
Implemented
- Password hashing with bcrypt
- JWT signing with HMAC-SHA256
- Rate limiting to prevent brute force
- Audit logging for all auth events
β οΈ Planned for v1.1.0
- Refresh token hashing in database
- Session token hashing
- Device fingerprinting
- Argon2id hasher option
Future Security Enhancements
- Email verification (v1.1)
- Password reset flow (v1.1)
- MFA/2FA (v1.2)
- Login notifications (v1.2)
- Breached password detection (v1.2)
π Best Practices
- Always use HTTPS in production
- Set strong JWT secrets via environment variables
- Monitor audit logs for suspicious activity
- Add email verification before sensitive actions
π€ Contributing
We welcome contributions! See CONTRIBUTING.md for:
Β· Code of Conduct
Β· Development setup
Β· Pull request process
Β· Coding standards
π License
MIT Β© Crydensync
β Support
If you find Cryden useful, please star the repo!
πΊοΈ Roadmap
Current: v1.0.0 (March 2026)
β
Core authentication with email/password. β
JWT + refresh tokens. β
Rate limiting & audit logs. β
Multiple databases (SQLite, PostgreSQL, MongoDB)
Coming in v1.1.0 (Q2 2026)
π CLI tool (csax)
π± Device tracking (IP, user agent, last seen)
π Argon2id hasher
β‘ Redis rate limiter
le audit logger
π¬ MySQL support
Coming in v1.2.0 (Q3 2026)
π gRPC API
π Language SDKs (JS, Python, PHP)
π Webhooks
π Migration tools (Clerk, Auth0, Supabase)
Coming in v1.3.0 (Q4 2026)
π Multi-Factor Authentication (TOTP)
π§ Magic links & passwordless
π WebAuthn / Passkeys
π Social login (OAuth2)
Future (2027+)
βοΈ Optional cloud sync
π Enterprise features
π More adapters
π v2.0.0 (breaking changes if needed)
View full roadmap β
Built with β€οΈ in Africa Β· Own your users, not vendor lock-in