(request)
| 6 | const rateLimitApiActions = Object.keys(actionMapBucketRateLimit); |
| 7 | |
| 8 | function requestNeedsRateCheck(request) { |
| 9 | // Is the feature enabled? |
| 10 | if (!config.rateLimiting.enabled) { |
| 11 | return false; |
| 12 | } |
| 13 | |
| 14 | // Is the request an internal or rate limit admin operation? |
| 15 | if (rateLimitApiActions.includes(request.apiMethod) || request.isInternalServiceRequest) { |
| 16 | return false; |
| 17 | } |
| 18 | |
| 19 | // Have we already checked both bucket and account configs? |
| 20 | return !(request.rateLimitAccountAlreadyChecked && request.rateLimitBucketAlreadyChecked); |
| 21 | } |
| 22 | |
| 23 | /** |
| 24 | * Extract bucket rate limit configuration from bucket metadata or global rate limit configuration. |
no outgoing calls
no test coverage detected