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(redaction): fix corner cases with paths #732

Merged
merged 1 commit into from Nov 8, 2019

Conversation

ethanresnick
Copy link
Contributor

In particular, this supports single-item paths where the first item is bracketed (e.g. { redact: ["['some-key']"] }) and paths where one of the segments is the empty string [in brackets] (e.g., { redact: ["a[''].x"] }).

Conceptually, the change is quite simple: it uses the namespace rather, than the string, even for single-segment paths, since the namespace has the brackets + quotes removed. It also changes the namespace .replace regex to allow 0 character (i.e., .* instead of .+) between the quotes.

In particular, this supports single-item paths where the first item is
bracketed (e.g. `{ redact: ["['some-key']"] }`) and paths where one of
the segments is the empty string [in brackets] (e.g., `{ redact:
["a[''].x"] }`).

Conceptually, the change is quite simple: it uses the namespace rather,
than the string, even for single-segment paths, since the namespace has
the brackets + quotes removed. It also changes the namespace `.replace`
regex to allow 0 character (i.e., `.*` instead of `.+`) between the
quotes.
Copy link
Member

@mcollina mcollina left a comment

Choose a reason for hiding this comment

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

LGTM

@ethanresnick
Copy link
Contributor Author

@mcollina Next steps to getting this merged/published? I'd love to delete my fork :)

@mcollina
Copy link
Member

mcollina commented Nov 7, 2019

@davidmarkclements can you take a look?

Copy link
Member

@davidmarkclements davidmarkclements left a comment

Choose a reason for hiding this comment

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

Lgtm

@github-actions
Copy link

github-actions bot commented Feb 4, 2022

This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 4, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants