Skip to content

Commit

Permalink
Update limter middleware default EXPIRATION to 1440
Browse files Browse the repository at this point in the history
  • Loading branch information
sameh-farouk committed Oct 29, 2024
1 parent 3df3c4e commit 452cff4
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,19 +69,19 @@ The application uses environment variables for configuration. Here's a list of a
- `VERIFICATION_SUSPICIOUS_VERIFICATION_OUTCOME`: Outcome for suspicious verifications (default: "verified")
- `VERIFICATION_EXPIRED_DOCUMENT_OUTCOME`: Outcome for expired documents (default: "unverified")
- `VERIFICATION_MIN_BALANCE_TO_VERIFY_ACCOUNT`: Minimum balance required to verify an account (default: 10000000)
- `VERIFICATION_MIN_BALANCE_TO_VERIFY_ACCOUNT`: Minimum balance in unitTFT required to verify an account (default: 10000000)
### Rate Limiting
#### IP-based Rate Limiting
- `IP_LIMITER_MAX_TOKEN_REQUESTS`: Maximum number of token requests per IP (default: 4)
- `IP_LIMITER_TOKEN_EXPIRATION`: Token expiration time in hours (default: 24)
- `IP_LIMITER_TOKEN_EXPIRATION`: Token expiration time in minutes (default: 1440)
#### ID-based Rate Limiting
- `ID_LIMITER_MAX_TOKEN_REQUESTS`: Maximum number of token requests per ID (default: 4)
- `ID_LIMITER_TOKEN_EXPIRATION`: Token expiration time in hours (default: 24)
- `ID_LIMITER_TOKEN_EXPIRATION`: Token expiration time in minutes (default: 1440)
### Challenge Configuration
Expand Down
4 changes: 2 additions & 2 deletions internal/configs/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,11 @@ type Verification struct {
}
type IPLimiter struct {
MaxTokenRequests int `env:"IP_LIMITER_MAX_TOKEN_REQUESTS" env-default:"4"`
TokenExpiration int `env:"IP_LIMITER_TOKEN_EXPIRATION" env-default:"24"`
TokenExpiration int `env:"IP_LIMITER_TOKEN_EXPIRATION" env-default:"1440"`
}
type IDLimiter struct {
MaxTokenRequests int `env:"ID_LIMITER_MAX_TOKEN_REQUESTS" env-default:"4"`
TokenExpiration int `env:"ID_LIMITER_TOKEN_EXPIRATION" env-default:"24"`
TokenExpiration int `env:"ID_LIMITER_TOKEN_EXPIRATION" env-default:"1440"`
}
type Log struct {
Debug bool `env:"DEBUG" env-default:"false"`
Expand Down

0 comments on commit 452cff4

Please sign in to comment.