Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,10 @@ static void initKeywords() {
* based on sentry list: https://github.com/getsentry/sentry-python/blob/fefb454287b771ac31db4e30fa459d9be2f977b8/sentry_sdk/scrubber.py#L17-L58
*/
KEYWORDS.addAll(PREDEFINED_KEYWORDS);
KEYWORDS.removeAll(Config.get().getDynamicInstrumentationRedactionExcludedIdentifiers());
// Exclude user defined keywords
for (String keyword : Config.get().getDynamicInstrumentationRedactionExcludedIdentifiers()) {
KEYWORDS.remove(normalize(keyword));
}
}

public static void addUserDefinedKeywords(Config config) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,10 +58,11 @@ public void exclusions() {
setFieldInConfig(
config,
"dynamicInstrumentationRedactionExcludedIdentifiers",
new HashSet<>(Arrays.asList("password")));
new HashSet<>(Arrays.asList("password", "_2FA")));
Redaction.initKeywords();
try {
assertFalse(Redaction.isRedactedKeyword("password"));
assertFalse(Redaction.isRedactedKeyword("_2fa"));
} finally {
setFieldInConfig(
config, "dynamicInstrumentationRedactionExcludedIdentifiers", Collections.emptySet());
Expand Down
Loading