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

Multi-wildcard implementation broke paths passed to censor function #45

Open
ethanresnick opened this issue Feb 23, 2022 · 3 comments
Open

Comments

@ethanresnick
Copy link
Contributor

Hi! I love the new support for multiple wildcards in redaction paths. Unfortunately, when the PR for that feature was merged, it looks like it introduced some weird behavior.

As shown in this test and the one right below it, when a wildcard is used in a redaction path, and that path is exposed to the censor function, the prior contract was for the censor function to see a path based on what the wildcard actually matched. E.g., the path '*.b' would be passed to the censor function as ['a', 'b'] if the wildcard matched a key named 'a'.

With multiple wildcards, though, as shown in this test, the first wildcard in the path is exposed to the censor function using the actual key it matched, but subsequent wildcards are passed in as a literal '*'.

I implemented the original support for passing a path to the censor function, so I'd normally be open to fixing this ticket, but I really have no time right now. I've also completely forgotten everything figured out about specialSet, and generally how all the pieces of this library fit together.

If @lukehedger is able to fix this, that would be amazing, since he's obviously touched the code more recently and wrote the multi-wildcard code. But, if he doesn't have time either, I figured I'd still open this issue just to document the problem.

@mcollina
Copy link
Collaborator

Thanks, that would be amazing.

@lukehedger
Copy link
Contributor

I think you've got the wrong guy @ethanresnick! At least, I have no memory of writing this code 😄

@ethanresnick
Copy link
Contributor Author

Doh, my bad. I meant @lrecknagel

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

No branches or pull requests

3 participants