-
Notifications
You must be signed in to change notification settings - Fork 339
feat: support new consent resolution strategy values #5798
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: support new consent resolution strategy values #5798
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR adds support for the new consent resolution strategy values ("all" and "any") alongside the existing "and" and "or". It also updates the processing logic to prioritize "allowed consent IDs", fall back to "denied consent IDs", and sanitize consent IDs before filtering events.
- Changed the type of AllowedConsentIDs from interface{} to []string.
- Modified the filtering logic in getConsentFilteredDestinations to accommodate new resolution strategies.
- Enhanced consent ID processing and sanitation in getConsentManagementInfo.
b9773d9
to
6a1283f
Compare
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #5798 +/- ##
==========================================
- Coverage 76.98% 76.94% -0.05%
==========================================
Files 491 491
Lines 67415 67469 +54
==========================================
+ Hits 51900 51914 +14
- Misses 12694 12724 +30
- Partials 2821 2831 +10 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR implements support for new consent resolution strategies ("all" and "any") and adjusts logic to prefer allowed consent IDs while handling legacy OneTrust CMP formats. Key changes include:
- Updated test expectations for destination filtering in processor_test.go.
- Refactored consent management parsing in consent.go to support both object and array formats for allowed consent IDs.
- Added sanitation of consent IDs before filtering events.
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
File | Description |
---|---|
processor/processor_test.go | Updated test expectations to match changes in the consent resolution logic. |
processor/consent.go | Enhanced parsing and sanitation logic for consent IDs, supporting new and legacy formats. |
Comments suppressed due to low confidence (1)
processor/consent.go:74
- [nitpick] Adding inline comments within each case of the resolution strategy switch (for 'any'/'or' and 'all'/'and') could help clarify the intended logic differences and ease future changes.
switch finalResolutionStrategy {
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR adds support for new consent resolution strategy values ("all" and "any") and adjusts the consent filtering logic accordingly. Key changes include updated test expectations in processor_test.go and enhancements to consent handling in processor/consent.go to support both array and object formats for allowed consent IDs.
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
File | Description |
---|---|
processor/processor_test.go | Updated expected destination counts in tests to match new logic |
processor/consent.go | Revised consent processing for allowed and denied consent IDs, including legacy support for OneTrust CMP |
Comments suppressed due to low confidence (1)
processor/processor_test.go:3656
- The updated test expectation reflects the new consent resolution logic. Please verify that these new expected values accurately capture the intended filtering behavior across all relevant cases.
).To(Equal(6)) // all except D6, D13, and D14
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR introduces support for new consent resolution strategy values ("all" and "any") and adjusts the logic to prefer allowed consent IDs while handling both object and array formats for legacy OneTrust CMP data. Key changes include updated test expectation values for consent filtering, enhancements in parsing and sanitizing consent IDs, and revised resolution strategy logic.
- Update tests to reflect new resolution logic
- Enhance getConsentManagementInfo to support multiple types for AllowedConsentIDs and sanitize inputs
- Adjust consent filtering logic in getConsentFilteredDestinations per new strategies
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
File | Description |
---|---|
processor/processor_test.go | Updated expected count values in tests to reflect the new consent filtering logic |
processor/consent.go | Revised consent parsing and sanitization, and added support for new resolution strategies |
Comments suppressed due to low confidence (1)
processor/processor_test.go:3656
- Verify that the updated expected count values in the tests accurately reflect the new consent filtering logic and confirm that the comments remain consistent with the actual behavior.
).To(Equal(6)) // all except D6, D13, and D14
8d8f456
to
675fb73
Compare
3709c1a
to
57d47a2
Compare
🤖 I have created a release *beep* *boop* --- ## [1.49.0-rc.1](v1.48.0...v1.49.0-rc.1) (2025-05-12) ### Features * add support for processing of upload_v2 job type by slave ([#5796](#5796)) ([67988d1](67988d1)) * batch staging files for creating upload_v2 notifier jobs ([#5765](#5765)) ([7dc3a45](7dc3a45)) * enable worker-based kafka client batching ([#5788](#5788)) ([66dc19f](66dc19f)) * support claim renewal in notifier jobs ([#5818](#5818)) ([a499d9c](a499d9c)) * support new consent resolution strategy values ([#5798](#5798)) ([181b95b](181b95b)) * update config to add account details with destination in workspaceConfig ([#5753](#5753)) ([dbd46bf](dbd46bf)) * update contract for account and accountDefinition ([#5830](#5830)) ([c704b07](c704b07)) * use account to decide oauth type of a destination ([#5810](#5810)) ([9165e8c](9165e8c)) ### Bug Fixes * add check for nil secret on oauthv2 ([#5807](#5807)) ([fbc4abe](fbc4abe)) * convert bad request errors to 500 errors in oauth interceptor to prevent panics ([#5813](#5813)) ([3a08ec4](3a08ec4)) * **jobsdb:** completed datasets don't get deleted without a pair ([#5793](#5793)) ([54aee71](54aee71)) * reporting common client path with query ([#5842](#5842)) ([c068920](c068920)) * transformer client recycle ttl bound to connection idle timeout ([#5800](#5800)) ([b13f92c](b13f92c)) * update account type to remove id which we are getting as map key ([#5835](#5835)) ([bc52242](bc52242)) * ut mirroring race condition ([#5824](#5824)) ([a4d579f](a4d579f)) * warehouse cached schema mismatch ([#5805](#5805)) ([4656247](4656247)) * warehouse transformations mismatches ([#5779](#5779)) ([01a7b83](01a7b83)) ### Miscellaneous * **deps:** bump github.com/snowflakedb/gosnowflake from 1.13.2 to 1.13.3 in the go_modules group ([#5787](#5787)) ([41db33e](41db33e)) * **deps:** bump golangci/golangci-lint-action from 7 to 8 ([#5815](#5815)) ([bf3e808](bf3e808)) * **jobsdb:** cache distinct parameters query result for all datasets except last ([#5752](#5752)) ([e85811e](e85811e)) * migrate from denisenkom/go-mssqldb to microsoft/go-mssqldb ([#5776](#5776)) ([dbd46bf](dbd46bf)) * revert synapse staging table with max varchar length ([#5817](#5817)) ([2418329](2418329)) * **router:** support destination-specific configuration overrides for all options ([#5841](#5841)) ([695cf53](695cf53)) * synapse staging table with max varchar length ([#5775](#5775)) ([2fc5384](2fc5384)) * update accountDefination type with authenticationType ([#5791](#5791)) ([2a24e59](2a24e59)) * update rudder-go-kit to 0.49.2 ([#5832](#5832)) ([01a7b83](01a7b83)) * upload embedded dt response difference samples to s3 ([#5792](#5792)) ([c81001f](c81001f)) * warehouse transformer migration to embedded destination transformer package ([#5827](#5827)) ([e124bb0](e124bb0)) * warehouse transformer sample diff ([#5837](#5837)) ([8af55de](8af55de)) * warehouse transformer uploader ([#5828](#5828)) ([fc640bf](fc640bf)) * webhook integration test module upgrade ([#5665](#5665)) ([f4130d1](f4130d1)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please).
🤖 I have created a release *beep* *boop* --- ## [1.49.0](v1.48.0...v1.49.0) (2025-05-13) ### Features * add dynamic config existence flag for destinations ([#5821](#5821)) ([1b4ea06](1b4ea06)) * add support for processing of upload_v2 job type by slave ([#5796](#5796)) ([67988d1](67988d1)) * batch staging files for creating upload_v2 notifier jobs ([#5765](#5765)) ([7dc3a45](7dc3a45)) * enable worker-based kafka client batching ([#5788](#5788)) ([66dc19f](66dc19f)) * support claim renewal in notifier jobs ([#5818](#5818)) ([a499d9c](a499d9c)) * support new consent resolution strategy values ([#5798](#5798)) ([181b95b](181b95b)) * update config to add account details with destination in workspaceConfig ([#5753](#5753)) ([dbd46bf](dbd46bf)) * update contract for account and accountDefinition ([#5830](#5830)) ([c704b07](c704b07)) * use account to decide oauth type of a destination ([#5810](#5810)) ([9165e8c](9165e8c)) ### Bug Fixes * add check for nil secret on oauthv2 ([#5807](#5807)) ([fbc4abe](fbc4abe)) * convert bad request errors to 500 errors in oauth interceptor to prevent panics ([#5813](#5813)) ([3a08ec4](3a08ec4)) * embedded transformations upload ([#5848](#5848)) ([0b19968](0b19968)) * **jobsdb:** completed datasets don't get deleted without a pair ([#5793](#5793)) ([54aee71](54aee71)) * reporting common client path with query ([#5842](#5842)) ([c068920](c068920)) * transformer client recycle ttl bound to connection idle timeout ([#5800](#5800)) ([b13f92c](b13f92c)) * update account type to remove id which we are getting as map key ([#5835](#5835)) ([bc52242](bc52242)) * ut mirroring race condition ([#5824](#5824)) ([a4d579f](a4d579f)) * warehouse cached schema mismatch ([#5805](#5805)) ([4656247](4656247)) * warehouse transformations mismatches ([#5779](#5779)) ([01a7b83](01a7b83)) ### Miscellaneous * **deps:** bump github.com/snowflakedb/gosnowflake from 1.13.2 to 1.13.3 in the go_modules group ([#5787](#5787)) ([41db33e](41db33e)) * **deps:** bump golangci/golangci-lint-action from 7 to 8 ([#5815](#5815)) ([bf3e808](bf3e808)) * enrich event with bot details ([#5836](#5836)) ([6035658](6035658)) * **jobsdb:** cache distinct parameters query result for all datasets except last ([#5752](#5752)) ([e85811e](e85811e)) * migrate from denisenkom/go-mssqldb to microsoft/go-mssqldb ([#5776](#5776)) ([dbd46bf](dbd46bf)) * revert synapse staging table with max varchar length ([#5817](#5817)) ([2418329](2418329)) * **router:** support destination-specific configuration overrides for all options ([#5841](#5841)) ([695cf53](695cf53)) * synapse staging table with max varchar length ([#5775](#5775)) ([2fc5384](2fc5384)) * update accountDefination type with authenticationType ([#5791](#5791)) ([2a24e59](2a24e59)) * update rudder-go-kit to 0.49.2 ([#5832](#5832)) ([01a7b83](01a7b83)) * upload embedded dt response difference samples to s3 ([#5792](#5792)) ([c81001f](c81001f)) * warehouse transformer migration to embedded destination transformer package ([#5827](#5827)) ([e124bb0](e124bb0)) * warehouse transformer sample diff ([#5837](#5837)) ([8af55de](8af55de)) * warehouse transformer uploader ([#5828](#5828)) ([fc640bf](fc640bf)) * webhook integration test module upgrade ([#5665](#5665)) ([f4130d1](f4130d1)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please).
This reverts commit 181b95b.
Description
Besides, "and" and "or" consent resolution strategies, we're now supporting the new "all" and "any" values. The UI changes will be rolled out very soon.
Also, the logic now prefers to use "allowed consent IDs" and falls back to "denied consent IDs" to align with the client side implementation. It's a bit tricky with allowed consent IDs as some older SDK versions send it as an object for OneTrust CMP.
So, we're handling both an object and array of strings.
Additionally, I've sanitized the consent IDs from the config and event before resolving them for filtering events to destinations.
Linear Ticket
https://linear.app/rudderstack/view/scrum-board-75b83c60706a5
Security