Skip to content

fix(ASV-4003): Fix default filter regex patterns - #61

Merged
2k-joker merged 3 commits into
mainfrom
ASV-4003-fix-default-regex
May 1, 2026
Merged

2k-joker merged 3 commits into
mainfrom
ASV-4003-fix-default-regex

Conversation

@2k-joker

@2k-joker 2k-joker commented Apr 30, 2026 •

Copy link
Copy Markdown
Collaborator

JIRA

Summary

  • Removes $ from [^&$] character classes in PASSWORD, USERNAME, CLIENT_ID, and CLIENT_SECRET patterns so literal $ characters in values are properly matched and redacted
  • Replaces greedy .* in EMAIL pattern with [^&\n\r]* to prevent matching past & delimiters, and converts trailing (&|$) to a lookahead (?=&|$) so the & separator is preserved in output
  • Adds \n\r to all negated character classes to prevent patterns from matching across newline boundaries
  • Adds comprehensive test coverage for all default FilterPatterns (PASSWORD, USERNAME, CLIENT_ID, CLIENT_SECRET, EMAIL) including key-name variants, edge cases, and a combined integration test

Test plan

  • Full RSpec suite passes (116 examples, 0 failures)
  • Coverage at 97.13% (above 95% threshold)
  • Verified $ in password values is now captured and redacted
  • Verified EMAIL pattern preserves & delimiter in output
  • Verified patterns do not match across newline boundaries

🤖 Generated with Claude Code

2k-joker and others added 3 commits April 30, 2026 18:32
- Remove `$` from `[^&$]` character classes so literal `$` in values is matched
- Replace greedy `.*` in EMAIL pattern with `[^&\n\r]*` to stop at `&` boundaries
- Convert EMAIL trailing `(&|$)` to lookahead `(?=&|$)` to preserve `&` delimiter
- Add `\n\r` to all negated character classes to prevent cross-line matching
- Add comprehensive tests for all default FilterPatterns

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

@harry-stebbins-dailypay harry-stebbins-dailypay left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

very nice 👍 thorough tests

@2k-joker
2k-joker merged commit 8cb6d37 into main May 1, 2026
5 checks passed
@2k-joker
2k-joker deleted the ASV-4003-fix-default-regex branch May 1, 2026 15:41
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.

3 participants