Skip to content

Commit

Permalink
fix(pii): Fix roundtrip error when PII selector starts with number (#982
Browse files Browse the repository at this point in the history
)

Co-authored-by: Jan Michael Auer <[email protected]>

For disambiguous parsing, keys starting with numbers need to be quoted.
  • Loading branch information
untitaker authored Apr 23, 2021
1 parent c002eca commit 8aed942
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 2 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@
- Support the `frame.stack_start` field for chained async stack traces in Cocoa SDK v7. ([#981](https://github.com/getsentry/relay/pull/981))
- Rename configuration fields `cache.event_buffer_size` to `cache.envelope_buffer_size` and `cache.event_expiry` to `cache.envelope_expiry`. The former names are still supported by Relay. ([#985](https://github.com/getsentry/relay/pull/985))

**Bug Fixes**:

- Fix roundtrip error when PII selector starts with number. ([#982](https://github.com/getsentry/relay/pull/982))

**Internal**:

- Update internal representation of distribution metrics. ([#979](https://github.com/getsentry/relay/pull/979))
Expand Down
1 change: 1 addition & 0 deletions py/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

- Add back `breadcrumb.event_id`. ([#977](https://github.com/getsentry/relay/pull/977))
- Add `frame.stack_start` for chained async stack traces. ([#981](https://github.com/getsentry/relay/pull/981))
- Fix roundtrip error when PII selector starts with number. ([#982](https://github.com/getsentry/relay/pull/982))

## 0.8.5

Expand Down
5 changes: 4 additions & 1 deletion relay-general/src/pii/convert.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1354,7 +1354,10 @@ THd+9FBxiHLGXNKhG/FRSyREXEt+NyYIf/0cyByc9tNksat794ddUqnLOg0vwSkv

let pii_config = to_pii_config(&DataScrubbingConfig {
sensitive_fields: vec!["special ,./<>?!@#$%^&*())'gärbage'".to_owned()],
exclude_fields: vec!["do not ,./<>?!@#$%^&*())'ßtrip'".to_owned()],
exclude_fields: vec![
"do not ,./<>?!@#$%^&*())'ßtrip'".to_owned(),
"2abc".to_owned(),
],
..simple_enabled_config()
});

Expand Down
2 changes: 1 addition & 1 deletion relay-general/src/processor/selector.pest
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Or = _{ "||" | "|" }
Not = _{ "~" | "!" }
EscapedQuote = @{ "'" }

UnquotedKey = @{ (ASCII_ALPHANUMERIC | "-" | "_") + }
UnquotedKey = @{ (ASCII_ALPHA | "_") ~ (ASCII_ALPHANUMERIC | "-" | "_") * }
RootUnquotedKey = { SOI ~ UnquotedKey ~ EOI }
QuotedCharacter = @{ ((!"'") ~ ANY) }
QuotedKey = ${ (QuotedCharacter | ("'" ~ EscapedQuote))+ }
Expand Down

0 comments on commit 8aed942

Please sign in to comment.