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

feat(pii): Scrub arrays of 2 elements as key-value pairs #3639

Merged
merged 30 commits into from
Jun 10, 2024
Merged
Show file tree
Hide file tree
Changes from 25 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
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# Changelog

## Unreleased

**Internal**:

- Allow treating arrays of two elements as key-value pairs during PII scrubbing. ([#3639](https://github.com/getsentry/relay/pull/3639))
iambriccardo marked this conversation as resolved.
Show resolved Hide resolved

## 24.5.1

**Bug fixes**:
Expand Down
41 changes: 41 additions & 0 deletions relay-pii/src/convert.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1656,4 +1656,45 @@ THd+9FBxiHLGXNKhG/FRSyREXEt+NyYIf/0cyByc9tNksat794ddUqnLOg0vwSkv
process_value(&mut data, &mut pii_processor, ProcessingState::root()).unwrap();
assert_annotated_snapshot!(data);
}

#[test]
fn test_pairlist_scrubbed() {
let mut data = Event::from_value(
serde_json::json!({
"threads": {
"values": [
{
"stacktrace": {
"frames": [
{
"vars": {
"request": {
"headers": [
[
"secret",
"A1BBC234QWERTY0987MNBV012765HJKL"
],
[
"passwd",
"my_password"
]
Copy link
Member

Choose a reason for hiding this comment

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

Can we split this up to test both the key-detection and the value detection?

Suggested change
[
"passwd",
"my_password"
]
[
"passwd",
"asdf123"
],
[
"something_else",
"my_password"
]

]
}
}
}

]
}
}
]
}
})
.into(),
);

let pii_config = simple_enabled_pii_config();
let mut pii_processor = PiiProcessor::new(pii_config.compiled());
process_value(&mut data, &mut pii_processor, ProcessingState::root()).unwrap();
assert_annotated_snapshot!(data);
}
}
Loading
Loading