Skip to content

Conversation

@satazor
Copy link
Contributor

@satazor satazor commented Apr 15, 2025

Given the following data:

{
  "evaluation": {
    "rules": [
      {
        "conditions": {
          "name-matching-score": {
            "name": "foo",
            "details": {
              "userFullName": "raj"
            }
          }
        }
      }
    ]
  }
}

And the following whitelist patterns:

['evaluation.rules.**.name']

The redaction is unredacting userFullName but it shouldn't.

Copilot AI review requested due to automatic review settings April 15, 2025 17:08
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

Comments suppressed due to low confidence (2)

src/index.js:127

  • Removing this regex replacement may impact patterns that require a preceding dot. Please verify that the new regex replacements fully cover all intended double wildcard scenarios without causing mis-matches.
.replaceAll('\.\*\*\.', '\..*')

test/src/index.test.js:236

  • [nitpick] Consider adding additional tests to cover edge cases involving double wildcard patterns, ensuring that only the intended properties are redacted under various nesting and path conditions.
expect(anonymizer({ whitelist: ['parent1.**.oo'] })(data)).toEqual({

@fixe fixe merged commit 342704e into master Apr 15, 2025
2 checks passed
@fixe fixe deleted the bugfix/fix-incorrect-redaction-double-wildcard branch April 15, 2025 18:04
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