Skip to content

Commit

Permalink
Removes unneeded regex use
Browse files Browse the repository at this point in the history
  • Loading branch information
gdavison committed Oct 2, 2024
1 parent c1e181a commit 564d464
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions internal/service/wafv2/schemas.go
Original file line number Diff line number Diff line change
Expand Up @@ -960,7 +960,7 @@ var headersMatchPatternBaseSchema = sync.OnceValue(func() *schema.Schema {
Type: schema.TypeString,
ValidateFunc: validation.All(
validation.StringLenBetween(1, 64),
validation.StringMatch(regexache.MustCompile(`^\S+$`), "must not contain any white-space characters"),
validation.StringIsNotWhiteSpace,
),
},
}
Expand Down Expand Up @@ -1213,15 +1213,15 @@ func managedRuleGroupConfigSchema() *schema.Schema {
Required: true,
ValidateFunc: validation.All(
validation.StringLenBetween(1, 256),
validation.StringMatch(regexache.MustCompile(`^\S+$`), "must not contain any white-space characters"),
validation.StringIsNotWhiteSpace,
),
},
"registration_page_path": {
Type: schema.TypeString,
Required: true,
ValidateFunc: validation.All(
validation.StringLenBetween(1, 256),
validation.StringMatch(regexache.MustCompile(`^\S+$`), "must not contain any white-space characters"),
validation.StringIsNotWhiteSpace,
),
},
"request_inspection": managedRuleGroupConfigACFPRequestInspectionSchema(),
Expand All @@ -1245,7 +1245,7 @@ func managedRuleGroupConfigSchema() *schema.Schema {
Required: true,
ValidateFunc: validation.All(
validation.StringLenBetween(1, 256),
validation.StringMatch(regexache.MustCompile(`^\S+$`), "must not contain any white-space characters"),
validation.StringIsNotWhiteSpace,
),
},
"request_inspection": managedRuleGroupConfigATPRequestInspectionSchema(),
Expand Down Expand Up @@ -1277,7 +1277,7 @@ func managedRuleGroupConfigSchema() *schema.Schema {
Optional: true,
ValidateFunc: validation.All(
validation.StringLenBetween(1, 256),
validation.StringMatch(regexache.MustCompile(`^\S+$`), "must not contain any white-space characters"),
validation.StringIsNotWhiteSpace,
),
},
"password_field": {
Expand All @@ -1291,7 +1291,7 @@ func managedRuleGroupConfigSchema() *schema.Schema {
Required: true,
ValidateFunc: validation.All(
validation.StringLenBetween(1, 512),
validation.StringMatch(regexache.MustCompile(`^\S+$`), "must not contain any white-space characters"),
validation.StringIsNotWhiteSpace,
),
},
},
Expand All @@ -1313,7 +1313,7 @@ func managedRuleGroupConfigSchema() *schema.Schema {
Required: true,
ValidateFunc: validation.All(
validation.StringLenBetween(1, 512),
validation.StringMatch(regexache.MustCompile(`^\S+$`), "must not contain any white-space characters"),
validation.StringIsNotWhiteSpace,
),
},
},
Expand Down Expand Up @@ -1392,7 +1392,7 @@ func managedRuleGroupConfigACFPRequestInspectionSchema() *schema.Schema {
Required: true,
ValidateFunc: validation.All(
validation.StringLenBetween(1, 512),
validation.StringMatch(regexache.MustCompile(`^\S+$`), "must not contain any white-space characters"),
validation.StringIsNotWhiteSpace,
),
},
},
Expand All @@ -1409,7 +1409,7 @@ func managedRuleGroupConfigACFPRequestInspectionSchema() *schema.Schema {
Required: true,
ValidateFunc: validation.All(
validation.StringLenBetween(1, 512),
validation.StringMatch(regexache.MustCompile(`^\S+$`), "must not contain any white-space characters"),
validation.StringIsNotWhiteSpace,
),
},
},
Expand Down Expand Up @@ -1446,7 +1446,7 @@ func managedRuleGroupConfigACFPRequestInspectionSchema() *schema.Schema {
Required: true,
ValidateFunc: validation.All(
validation.StringLenBetween(1, 512),
validation.StringMatch(regexache.MustCompile(`^\S+$`), "must not contain any white-space characters"),
validation.StringIsNotWhiteSpace,
),
},
},
Expand Down Expand Up @@ -1475,7 +1475,7 @@ func managedRuleGroupConfigATPRequestInspectionSchema() *schema.Schema {
Required: true,
ValidateFunc: validation.All(
validation.StringLenBetween(1, 512),
validation.StringMatch(regexache.MustCompile(`^\S+$`), "must not contain any white-space characters"),
validation.StringIsNotWhiteSpace,
),
},
},
Expand All @@ -1497,7 +1497,7 @@ func managedRuleGroupConfigATPRequestInspectionSchema() *schema.Schema {
Required: true,
ValidateFunc: validation.All(
validation.StringLenBetween(1, 512),
validation.StringMatch(regexache.MustCompile(`^\S+$`), "must not contain any white-space characters"),
validation.StringIsNotWhiteSpace,
),
},
},
Expand Down

0 comments on commit 564d464

Please sign in to comment.