@domusjs/security - Introduction
The DomusJS Security Module provides essential security primitives such as password hashing and rate limiting. It’s designed to be plug-and-play with extensibility in mind, so you can swap implementations while preserving a unified interface.
What Does the Security Module Provide
Section titled “What Does the Security Module Provide”- Hashing Service: Built on top of a
Hasher
interface. The default implementation usesbcrypt
. - Rate Limiter: Abstracts rate-limiting logic. Includes:
- ✅ In-memory implementation for local environments.
- ✅ Redis-based implementation for distributed rate limiting.
- Express Middleware: Plug-and-play rate limiting with Express apps using the provided
rateLimitMiddleware
.
Flexible & Extensible
Section titled “Flexible & Extensible”You can easily provide your own implementations for Hasher
or RateLimiter
by registering them via the DI container or inside your own registerSecurityModule()
setup.