-
Notifications
You must be signed in to change notification settings - Fork 0
Environment Variables
Azizul Hakim edited this page Nov 1, 2024
·
1 revision
The nestjs-xsecurity
module uses environment variables for configuration and sensitive settings. This guide covers all supported environment variables and their proper usage.
Variable | Type | Default | Required | Description |
---|---|---|---|---|
XSECURITY_ENABLED |
boolean | true |
No | Enable/disable the security middleware globally |
XSECURITY_SECRET |
string | - | Yes | Secret key used for token signing and verification |
Variable | Type | Default | Description |
---|---|---|---|
XSECURITY_MAX_ATTEMPTS |
number | 5 |
Maximum failed attempts before rate limiting |
XSECURITY_DECAY_MINUTES |
number | 1 |
Minutes before rate limit reset |
XSECURITY_CLEANUP_INTERVAL |
number | 5 |
Cleanup interval for rate limit store (minutes) |
# Required
XSECURITY_SECRET=your-secure-secret-key
# Optional
XSECURITY_ENABLED=true
XSECURITY_MAX_ATTEMPTS=5
XSECURITY_DECAY_MINUTES=1
XSECURITY_CLEANUP_INTERVAL=5
XSECURITY_SECRET=dev-secret-key
XSECURITY_MAX_ATTEMPTS=10
XSECURITY_DECAY_MINUTES=1
XSECURITY_SECRET=prod-secret-key-should-be-very-long-and-secure
XSECURITY_MAX_ATTEMPTS=3
XSECURITY_DECAY_MINUTES=5
Copyright 2024, @AHS12 All Right Reserved