Skip to content

Adding Redacted Keys #217

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

Open
wants to merge 28 commits into
base: next
Choose a base branch
from
Open

Adding Redacted Keys #217

wants to merge 28 commits into from

Conversation

clr182
Copy link
Contributor

@clr182 clr182 commented Jul 1, 2024

Goal

Filtering config option is case sensitive and is no longer in line with our notifier spec; as such it should be deprecated in favour of redactedKeys.

Design

Added redactedKeys configuration option, which is case insensitive, as a replacement for the filters configuration option. Additionally due to conflictions the default filters parameters were changed.

Changeset

  • Added redactedKeys config option.

  • Made redactedKeys case insensitive.

  • Changed filters config default parameters from
    {"password", "secret", "Authorization", "Cookie"};
    to
    {"ipAddress", "logLevel"};

  • Set refactedKeys config default parameters to
    {"password", "secret", "Authorization", "Cookie"};

Testing

Added and updated tests for filtering mechanism and redactedKeys mechanism.

@clr182 clr182 marked this pull request as draft July 1, 2024 15:25
@clr182 clr182 self-assigned this Jul 4, 2024
@clr182 clr182 marked this pull request as ready for review July 4, 2024 16:39
@clr182 clr182 requested review from lemnik and tomlongridge and removed request for lemnik and tomlongridge July 4, 2024 16:39
@clr182 clr182 marked this pull request as draft July 4, 2024 20:36
@clr182 clr182 marked this pull request as ready for review July 12, 2024 19:11
@clr182 clr182 requested review from lemnik and tomlongridge July 12, 2024 20:40
@clr182 clr182 requested a review from tomlongridge July 18, 2024 12:44
Comment on lines 41 to 42
public String[] redactedKeys = new String[]{"password", "secret", "Authorization", "Cookie"};
public String[] filters = new String[]{"password", "secret", "Authorization", "Cookie"};
Copy link
Contributor

Choose a reason for hiding this comment

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

I think it would be appropriate to set this to the same instance rather than a different array with the same content. Just in case anyone is amending elements in the array.

Suggested change
public String[] redactedKeys = new String[]{"password", "secret", "Authorization", "Cookie"};
public String[] filters = new String[]{"password", "secret", "Authorization", "Cookie"};
public String[] redactedKeys = new String[]{"password", "secret", "Authorization", "Cookie"};
public String[] filters = redactedKeys;

@clr182 clr182 marked this pull request as draft July 23, 2024 14:24
@clr182 clr182 requested a review from tomlongridge July 25, 2024 09:53
@clr182 clr182 marked this pull request as ready for review July 25, 2024 09:53
@clr182 clr182 requested a review from tomlongridge August 8, 2024 14:40
…ers` & `redactedKeys` separately in order to avoid edge-cases
@lemnik lemnik requested a review from richardelms June 30, 2025 14:52
@lemnik lemnik force-pushed the PLAT-4543-AddRedactedKeys branch from b3da470 to 1b7b28c Compare June 30, 2025 17:02
@tomlongridge tomlongridge removed their request for review July 28, 2025 09:02
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