@digitraffic/common 2024.7.8-1 → 2024.8.13-1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -11,10 +11,10 @@ export type AWSManagedWafRule = "CommonRuleSet" | "AmazonIpReputationList" | "Kn
|
|
11
11
|
export declare class AclBuilder {
|
12
12
|
readonly _construct: Construct;
|
13
13
|
readonly _rules: CfnWebACL.RuleProperty[];
|
14
|
+
readonly _name: string;
|
14
15
|
_scope: string;
|
15
|
-
_name: string;
|
16
16
|
_customResponseBodies: Record<string, CfnWebACL.CustomResponseBodyProperty>;
|
17
|
-
constructor(construct: Construct);
|
17
|
+
constructor(construct: Construct, name?: string);
|
18
18
|
isRuleDefined(rules: AWSManagedWafRule[] | "all", rule: AWSManagedWafRule): boolean;
|
19
19
|
withAWSManagedRules(rules?: AWSManagedWafRule[] | "all"): AclBuilder;
|
20
20
|
withIpRestrictionRule(addresses: string[]): AclBuilder;
|
@@ -10,11 +10,12 @@ import { logger } from "../runtime/dt-logger-default.mjs";
|
|
10
10
|
export class AclBuilder {
|
11
11
|
_construct;
|
12
12
|
_rules = [];
|
13
|
+
_name;
|
13
14
|
_scope = "CLOUDFRONT";
|
14
|
-
_name = "WebACL";
|
15
15
|
_customResponseBodies = {};
|
16
|
-
constructor(construct) {
|
16
|
+
constructor(construct, name = "WebACL") {
|
17
17
|
this._construct = construct;
|
18
|
+
this._name = name;
|
18
19
|
}
|
19
20
|
isRuleDefined(rules, rule) {
|
20
21
|
return rules === "all" || rules.includes(rule);
|
@@ -82,7 +83,7 @@ export class AclBuilder {
|
|
82
83
|
if (key in this._customResponseBodies) {
|
83
84
|
logger.warn({
|
84
85
|
method: "acl-builder.withCustomResponseBody",
|
85
|
-
message: `Overriding custom response body with key ${key}`,
|
86
|
+
message: `Overriding custom response body with key ${key} for distribution ${this._name}`,
|
86
87
|
});
|
87
88
|
}
|
88
89
|
this._customResponseBodies[key] = customResponseBody;
|
@@ -138,7 +139,7 @@ export class AclBuilder {
|
|
138
139
|
_logMissingLimit(method) {
|
139
140
|
logger.warn({
|
140
141
|
method: `acl-builder.${method}`,
|
141
|
-
message: `'limit' was not defined. Not setting a throttle rule`,
|
142
|
+
message: `'limit' was not defined. Not setting a throttle rule for ${this._name}`,
|
142
143
|
});
|
143
144
|
}
|
144
145
|
build() {
|