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(relay): add view hierarchy scrubbing #4452

Open
wants to merge 20 commits into
base: master
Choose a base branch
from

Conversation

Litarnus
Copy link
Contributor

This PR adds explicit ViewHierarchy scrubbing to the attachment scrubbing process.

Most of the logic is taken from the current recording scrubbing because both are JSON files.

@Litarnus Litarnus changed the title Martinl/viewhierarchy scrubbing feat(relay): add view hierarchy scrubbing Jan 16, 2025
# Conflicts:
#	Cargo.lock
#	relay-pii/Cargo.toml
#	relay-server/src/services/processor/attachment.rs
#	tests/integration/test_attachments.py
@Litarnus Litarnus self-assigned this Jan 16, 2025
@Litarnus Litarnus marked this pull request as ready for review January 17, 2025 10:59
@Litarnus Litarnus requested a review from a team as a code owner January 17, 2025 10:59
relay-pii/src/attachments.rs Outdated Show resolved Hide resolved
relay-pii/src/json.rs Outdated Show resolved Hide resolved
Copy link
Member

@jjbayer jjbayer left a comment

Choose a reason for hiding this comment

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

Looks good!

Comment on lines +529 to +530
let mut deserializer_inner = Deserializer::from_slice(payload);
let deserializer = crate::transform::Deserializer::new(&mut deserializer_inner, visitor);
Copy link
Member

Choose a reason for hiding this comment

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

nit, to make it super explicit which deserializer is which:

Suggested change
let mut deserializer_inner = Deserializer::from_slice(payload);
let deserializer = crate::transform::Deserializer::new(&mut deserializer_inner, visitor);
let mut deserializer_inner = serde_json::Deserializer::from_slice(payload);
let deserializer = transform::Deserializer::new(&mut deserializer_inner, visitor);

@@ -49,6 +49,7 @@ use serde::de;
/// }
/// }
/// ```
#[allow(missing_docs)]
Copy link
Member

Choose a reason for hiding this comment

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

Should we add some docs instead?

scrub_view_hierarchy(item, config)
} else if item.attachment_type() == Some(&AttachmentType::Minidump) {
scrub_minidump(item, config)
} else if has_simple_attachment_selector(config) && item.ty() == &ItemType::Attachment {
Copy link
Member

Choose a reason for hiding this comment

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

nit

Suggested change
} else if has_simple_attachment_selector(config) && item.ty() == &ItemType::Attachment {
} else if item.ty() == &ItemType::Attachment && has_simple_attachment_selector(config) {

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