Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix!: gathered_filter to process regex correctly #583

Merged
merged 3 commits into from
Oct 1, 2024

Conversation

alperenkose
Copy link
Collaborator

@alperenkose alperenkose commented Sep 24, 2024

Description

Regex expressions in gathered state gathered_filter required extra escape chars which wasn't a valid regex in deed.
This PR allows to write valid regex expression in the gathered_filter, the previous syntax is not valid anymore hence this is introducing a breaking change.

shlex.split() was used to split logic expressions in the gathered_filter, which also escaped(removed) backslash \ chars from the expression and led to a non-working regex. We have implemented our split method using shlex but removing backslash(\) escape char from shlex instance to avoid escaping and properly processing regex expressions.

Motivation and Context

Fixes #579

How Has This Been Tested?

Tested on vm firewalls with examples in the issue.

Types of changes

  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist

  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes if appropriate.
  • All new and existing tests passed.

Removed backslash(\) escape char from shlex to avoid escaping
and properly processing regex expressions.
@alperenkose alperenkose force-pushed the 579-gathered_filter-regex-escape-characters branch from 3c5eb74 to 15226e3 Compare September 24, 2024 09:17
@alperenkose alperenkose marked this pull request as ready for review September 24, 2024 09:17
Copy link
Collaborator

@horiagunica horiagunica left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@alperenkose alperenkose merged commit ae4103a into beta Oct 1, 2024
16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants