feat(server): Disable graphql scrubbing when datascrubbing is disabled#2689
Merged
feat(server): Disable graphql scrubbing when datascrubbing is disabled#2689
Conversation
TBS1996
commented
Nov 6, 2023
| Ok(()) | ||
| } | ||
|
|
||
| fn process_event( |
Contributor
Author
There was a problem hiding this comment.
Since removing scrub_graphl makes it match the default implementation we can simply remove this
TBS1996
commented
Nov 6, 2023
|
|
||
| /// Scrubs GraphQL variables from the event. | ||
| fn scrub_graphql(event: &mut Event) { | ||
| pub fn scrub_graphql(event: &mut Event) { |
Contributor
Author
There was a problem hiding this comment.
Since it's not used in the processor directly we might consider moving it elsewhere, thoughts?
jjbayer
approved these changes
Nov 6, 2023
| if let Some(event) = event.value_mut() { | ||
| scrub_graphql(event); | ||
| } | ||
| } |
Member
There was a problem hiding this comment.
So the reason for moving this here is that inside the processor, we do not have access to datascrubbing_settings? Might be worth pointing that out in the PR description.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
issue: #2666
Previously the graphql scrubbing would run any time there is a pii config, which would always be the case even if datascrubbing is disabled as it would simply be a config without rules.
The expected behaviour would be that if you disable datascrubbing, graphql scrubbing will also be disabled.
this PR moves the graphql scrubbing outside of the processor, and simply checks the datascrubbing flag for whether to scrub graphql or not. Moving it out because we don't have access to the datascrubbing config in the processor.
in the future, it would be better to have a separate graphql option for the user to configure in sentry and the graphql rules could be part of the normal datascrubbing rules.