-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
Prebid Core: Adding support for a global return of consent metadata. #8043
Merged
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
d63074e
Adding support for a global return of consent metadata with light tes…
decaffeinatedio f79092f
removing duplicate test
decaffeinatedio 9cd6231
updates for code consistency, timestamp naming
decaffeinatedio 4d6671c
move tcstring check down, return a zero if not a string
decaffeinatedio ba2194c
forgot util import!
decaffeinatedio File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -45,6 +45,13 @@ describe('consentManagement', function () { | |
expect(userCMP).to.be.undefined; | ||
sinon.assert.calledOnce(utils.logWarn); | ||
}); | ||
|
||
it('should not produce any consent metadata', function() { | ||
setConsentConfig(undefined) | ||
let consentMetadata = gdprDataHandler.getConsentMeta(); | ||
expect(consentMetadata).to.be.undefined; | ||
sinon.assert.calledOnce(utils.logWarn); | ||
}) | ||
}); | ||
|
||
describe('valid setConsentConfig value', function () { | ||
|
@@ -667,6 +674,33 @@ describe('consentManagement', function () { | |
expect(consent.apiVersion).to.equal(2); | ||
}); | ||
|
||
it('produces gdpr metadata', function () { | ||
let testConsentData = { | ||
tcString: 'abc12345234', | ||
gdprApplies: true, | ||
purposeOneTreatment: false, | ||
eventStatus: 'tcloaded', | ||
vendorData: { | ||
tcString: 'abc12345234' | ||
} | ||
}; | ||
cmpStub = sinon.stub(window, '__tcfapi').callsFake((...args) => { | ||
args[2](testConsentData, true); | ||
}); | ||
|
||
setConsentConfig(goodConfigWithAllowAuction); | ||
|
||
requestBidsHook(() => { | ||
didHookReturn = true; | ||
}, {}); | ||
let consentMeta = gdprDataHandler.getConsentMeta(); | ||
sinon.assert.notCalled(utils.logError); | ||
expect(consentMeta.consentStringSize).to.be.above(0) | ||
expect(consentMeta.gdprApplies).to.be.true; | ||
expect(consentMeta.apiVersion).to.equal(2); | ||
expect(consentMeta.generatedAt).to.be.above(1644367751709); | ||
}); | ||
|
||
it('performs lookup check and stores consentData for a valid existing user with additional consent', function () { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @dgirardi This should do the trick 🤞 |
||
let testConsentData = { | ||
tcString: 'abc12345234', | ||
|
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.
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.
For the USP case there does not seem to be a distinction between data and metadata - this just adds a timestamp.
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.
We can further strip this down for consistency, but since this doesn't qualify as personal data, it's OK to reveal.