Skip to content

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

@ethanresnick

Description

@ethanresnick

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions