Skip to content
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 Storage Manager: add gdpr check before device write tests to ensure purpose1 gets respected #8410

Closed
wants to merge 0 commits into from

Conversation

renebaudisch
Copy link
Contributor

Type of change

  • Other: GDPR insurance update

Description of change

implemented getting consent before trying to write to storage

@renebaudisch
Copy link
Contributor Author

I would need assistance for that. The test all access storage regardless of consent, but since tcf one cannot rely on granted access so all of the tests are some kind of incomplete as they do not respect the users choice. IMO, either the test should use a mockedup constent string or anything else, but I'm not able to take care of this.

@patmmccann patmmccann changed the title add gdpr check before device write tests to ensure purpose1 gets respected Prebid Core Storage Manager: add gdpr check before device write tests to ensure purpose1 gets respected May 12, 2022
@patmmccann
Copy link
Collaborator

Our model has been to put stuff like this in the gdpr module(s), eg the enforcement module, as many publishers don't load gdpr related code outside of gdpr countries.

@patmmccann
Copy link
Collaborator

@renebaudisch do you have concerns with the enforcement module or the device access flag now? It's not clear what issue this pr is trying to solve.

@patmmccann
Copy link
Collaborator

Please reopen and engage if you're looking for a path to merge

@patmmccann patmmccann closed this Jun 8, 2022
@renebaudisch
Copy link
Contributor Author

renebaudisch commented Jun 21, 2022

The problem we need to solve is that the "userSync" module initially calls "cookiesAreEnabled" from the sessionManager what right now is writing and reading the device storage regardless of consent. We need to ensure that this check respects the given laws and if needed checks consent before doing this write test.

I also cannot reopen the pr.

@patmmccann patmmccann reopened this Jun 21, 2022
@patmmccann
Copy link
Collaborator

#6289 (comment)

Indicates this was solved in #6323

@patmmccann patmmccann requested review from Fawke and removed request for robertrmartinez June 21, 2022 11:37
@patmmccann patmmccann assigned Fawke and unassigned robertrmartinez Jun 21, 2022
@renebaudisch
Copy link
Contributor Author

@patmmccann
Please have a look of what has been changed in #6323.
That only removes the written entry, but the privacy issue that it get's written without asking the cmp is still there, commented in this issue:
#6323 (comment)

This PR is to not let pbjs write cookieTest without having consent amd addresses this privacy part of #6323.

@patmmccann
Copy link
Collaborator

@Fawke could you comment? Do we need to reopen 6289?

@renebaudisch
Copy link
Contributor Author

renebaudisch commented Jun 21, 2022

I prepared a testpage where you can see that before the cmp is shown the LS get's written with cookieTest:
https://reports.asadcdn.com/demopages/2022/prebid.html

If it is too fast, set a breakpoint here:
image

/**
* @param {string} consentData
*/
const hasPurposeOneConsent = function(consentData) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @renebaudisch

There is already a similar function in src/utils/gpdr.js under the name hasPurpose1Consent. Would you be able to use that function instead of redefining it here?

src/userSync.js Outdated
@@ -315,7 +315,9 @@ export function newUserSync(userSyncDependencies) {
return publicApi;
}

const browserSupportsCookies = !isSafariBrowser() && storage.cookiesAreEnabled();
const browserSupportsCookies = function() {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does the type of this variable really need to change to a function, instead of its boolean resolution?

If so, can you please update the corresponding unit tests in test/spec/userSync_spec.js to update the signature references it has for this param (from a boolean to a function)?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This way the check is done later. At the time it is done now, the cmp(-module?) isn't ready, or at least gdprDataHandler.getConsentData() doesn't deliver anything. When called at time needed, the module or the cmp is set and we get response.

I'll update the PR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants