(command)
| 48 | } |
| 49 | |
| 50 | function getCommandPolicy(command) { |
| 51 | const protection = command?.abuseProtection || {}; |
| 52 | const maxAttempts = Number.isInteger(protection.maxAttempts) && protection.maxAttempts > 0 |
| 53 | ? protection.maxAttempts |
| 54 | : DEFAULT_PROTECTION_POLICY.maxAttempts; |
| 55 | const windowMs = Number.isInteger(protection.windowMs) && protection.windowMs > 0 |
| 56 | ? protection.windowMs |
| 57 | : DEFAULT_PROTECTION_POLICY.windowMs; |
| 58 | |
| 59 | return { maxAttempts, windowMs }; |
| 60 | } |
| 61 | |
| 62 | function getAnomalyPolicy(command) { |
| 63 | const anomaly = command?.abuseProtection?.anomaly || {}; |
no outgoing calls
no test coverage detected