From 10e36b30833593644d02eaf0395977069011c410 Mon Sep 17 00:00:00 2001 From: daknhh Date: Fri, 12 Apr 2024 21:48:03 +0200 Subject: [PATCH] add description to function --- .../web-application-firewall/quotas-and-capacity.ts | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/lib/tools/helpers/web-application-firewall/quotas-and-capacity.ts b/lib/tools/helpers/web-application-firewall/quotas-and-capacity.ts index 27084ae5..f61e1e00 100644 --- a/lib/tools/helpers/web-application-firewall/quotas-and-capacity.ts +++ b/lib/tools/helpers/web-application-firewall/quotas-and-capacity.ts @@ -560,9 +560,13 @@ async function calculateCustomRulesCapacities(customRules: FmsRule[], deployment return capacities; } - +/** + * Function to remove the ScopeDown statement from the RateBasedStatement + * @param customRule the customRule + * @param rateBasedStatement the RateBasedStatement + * @returns tempCalcRule + */ function calculateRatebasedStatementwithoutScopeDownStatement(customRule: FmsRule, rateBasedStatement: wafv2.CfnWebACL.RateBasedStatementProperty): FmsRule { - // Remove scopedDownStatement if it exists // eslint-disable-next-line @typescript-eslint/no-unused-vars const { scopeDownStatement, ...rateBasedWithoutScopeDown } = rateBasedStatement; const statement:wafv2.CfnWebACL.StatementProperty = { @@ -640,7 +644,7 @@ function calculateRegexPatternSetsStatementsCapacity(regexPatternSetsStatement: * @param customRule FmsRule * @param concatenatedStatement wafv2.CfnWebACL.AndStatementProperty | wafv2.CfnWebACL.OrStatementProperty * @param isOrStatement boolean - * @returns + * @returns tempCalcRule */ function buildCustomRuleWithoutReferenceStatements(customRule: FmsRule, concatenatedStatement: wafv2.CfnWebACL.AndStatementProperty | wafv2.CfnWebACL.OrStatementProperty, isOrStatement: boolean) { const statements = concatenatedStatement.statements as wafv2.CfnWebACL.StatementProperty[];