Skip to content

Commit

Permalink
waf_condition - adds missing options validation to filters (#2220)
Browse files Browse the repository at this point in the history
SUMMARY
waf_condition - adds missing options validation to filters
ISSUE TYPE

Feature Pull Request

COMPONENT NAME
waf_condition
ADDITIONAL INFORMATION
Arguably a breaking change, but behaviour would be a little erratic if bad options were passed.

Reviewed-by: Bikouo Aubin
  • Loading branch information
tremble authored Jan 27, 2025
1 parent 044b8d8 commit 699539f
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
3 changes: 3 additions & 0 deletions changelogs/fragments/20250127-waf_confition.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
---
minor_changes:
- waf_condition - adds missing options validation to filters (https://github.com/ansible-collections/community.aws/pull/2220).
10 changes: 8 additions & 2 deletions plugins/modules/waf_condition.py
Original file line number Diff line number Diff line change
Expand Up @@ -734,12 +734,18 @@ def main():
target_string=dict(), # Bytes
size=dict(type="int"),
ip_address=dict(),
regex_pattern=dict(),
regex_pattern=dict(
type="dict",
options=dict(
name=dict(),
regex_strings=dict(type="list", elements="str"),
),
),
)
argument_spec = dict(
name=dict(required=True),
type=dict(required=True, choices=["byte", "geo", "ip", "regex", "size", "sql", "xss"]),
filters=dict(type="list", elements="dict"),
filters=dict(type="list", elements="dict", options=filters_subspec),
purge_filters=dict(type="bool", default=False),
waf_regional=dict(type="bool", default=False),
state=dict(default="present", choices=["present", "absent"]),
Expand Down

0 comments on commit 699539f

Please sign in to comment.