feat(data-collection): Add sensitive key-value collection filter - #3025
feat(data-collection): Add sensitive key-value collection filter#3025sl0thentr0py wants to merge 1 commit into
Conversation
caa24a5 to
6a1469f
Compare
6a1469f to
29d2ec4
Compare
29d2ec4 to
d86858a
Compare
d86858a to
284c040
Compare
284c040 to
801ff01
Compare
d90c1b7 to
e649ed3
Compare
e649ed3 to
2672657
Compare
53393da to
6f61522
Compare
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 6f61522. Configure here.
6f61522 to
e3d1a05
Compare
e3d1a05 to
a0dcc7a
Compare
a0dcc7a to
e3d1a05
Compare
ea1251f to
97bdffe
Compare
97bdffe to
ea1251f
Compare
solnic
left a comment
There was a problem hiding this comment.
Left some non-blocking comments.
| end | ||
|
|
||
| def terms=(terms) | ||
| @terms = terms&.map { |term| term.to_s.downcase }&.reject { |term| term.strip.empty? } |
There was a problem hiding this comment.
Can't we default to an empty array ie DEFAULT_TERMS frozen constant, so that it's clear that this thing works with an array, and then we could just do terms.any? { ... } in the matching methods?
| it "covers every built-in sensitive term" do | ||
| values = Sentry::DataCollection::KeyValueCollection::SENSITIVE_DENY_LIST.to_h do |term| | ||
| ["prefix-#{term.upcase}-suffix", "value"] | ||
| end |
There was a problem hiding this comment.
I'd also add lowcased terms + some other keys just to fully cover behavior that it covers defaults and leaves the rest. Otherwise this test is very narrow.

Description
KeyValueCollectionfiltering behavior for:off, :allow_list, :deny_listIssues
Stack created with GitHub Stacks CLI • Give Feedback 💬