Skip to content

Commit 001d491

Browse files
authored
Revert "Gdpr Enforcement module and sharedId/pubCommonId modules: vendor consent should not be enforced for first-party-id modules (#8448)" (#8648)
This reverts commit 5ece4bb.
1 parent bd4f220 commit 001d491

File tree

6 files changed

+72
-128
lines changed

6 files changed

+72
-128
lines changed

modules/gdprEnforcement.js

+8-14
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,6 @@ const TCF2 = {
1818
'purpose7': { id: 7, name: 'measurement' }
1919
}
2020

21-
const VENDORLESS_MODULE_TYPES = ['fpid-module'];
22-
2321
/*
2422
These rules would be used if `consentManagement.gdpr.rules` is undefined by the publisher.
2523
*/
@@ -125,10 +123,9 @@ function getGvlidForAnalyticsAdapter(code) {
125123
* @param {Object} consentData - gdpr consent data
126124
* @param {string=} currentModule - Bidder code of the current module
127125
* @param {number=} gvlId - GVL ID for the module
128-
* @param {string=} moduleType module type
129126
* @returns {boolean}
130127
*/
131-
export function validateRules(rule, consentData, currentModule, gvlId, moduleType) {
128+
export function validateRules(rule, consentData, currentModule, gvlId) {
132129
const purposeId = TCF2[Object.keys(TCF2).filter(purposeName => TCF2[purposeName].name === rule.purpose)[0]].id;
133130

134131
// return 'true' if vendor present in 'vendorExceptions'
@@ -141,14 +138,12 @@ export function validateRules(rule, consentData, currentModule, gvlId, moduleTyp
141138
const vendorConsent = deepAccess(consentData, `vendorData.vendor.consents.${gvlId}`);
142139
const liTransparency = deepAccess(consentData, `vendorData.purpose.legitimateInterests.${purposeId}`);
143140

144-
const vendorlessModule = includes(VENDORLESS_MODULE_TYPES, moduleType);
145-
146141
/*
147142
Since vendor exceptions have already been handled, the purpose as a whole is allowed if it's not being enforced
148143
or the user has consented. Similar with vendors.
149144
*/
150145
const purposeAllowed = rule.enforcePurpose === false || purposeConsent === true;
151-
const vendorAllowed = rule.enforceVendor === false || vendorConsent === true || vendorlessModule === true;
146+
const vendorAllowed = rule.enforceVendor === false || vendorConsent === true;
152147

153148
/*
154149
Few if any vendors should be declaring Legitimate Interest for Device Access (Purpose 1), but some are claiming
@@ -167,16 +162,15 @@ export function validateRules(rule, consentData, currentModule, gvlId, moduleTyp
167162
* @param {Function} fn reference to original function (used by hook logic)
168163
* @param {Number=} gvlid gvlid of the module
169164
* @param {string=} moduleName name of the module
170-
* @param {string=} moduleType module type
171165
*/
172-
export function deviceAccessHook(fn, gvlid, moduleName, moduleType, result) {
166+
export function deviceAccessHook(fn, gvlid, moduleName, result) {
173167
result = Object.assign({}, {
174168
hasEnforcementHook: true
175169
});
176170
if (!hasDeviceAccess()) {
177171
logWarn('Device access is disabled by Publisher');
178172
result.valid = false;
179-
fn.call(this, gvlid, moduleName, moduleType, result);
173+
fn.call(this, gvlid, moduleName, result);
180174
} else {
181175
const consentData = gdprDataHandler.getConsentData();
182176
if (consentData && consentData.gdprApplies) {
@@ -188,19 +182,19 @@ export function deviceAccessHook(fn, gvlid, moduleName, moduleType, result) {
188182
gvlid = getGvlid(moduleName) || gvlid;
189183
}
190184
const curModule = moduleName || curBidder;
191-
let isAllowed = validateRules(purpose1Rule, consentData, curModule, gvlid, moduleType);
185+
let isAllowed = validateRules(purpose1Rule, consentData, curModule, gvlid);
192186
if (isAllowed) {
193187
result.valid = true;
194-
fn.call(this, gvlid, moduleName, moduleType, result);
188+
fn.call(this, gvlid, moduleName, result);
195189
} else {
196190
curModule && logWarn(`TCF2 denied device access for ${curModule}`);
197191
result.valid = false;
198192
storageBlocked.push(curModule);
199-
fn.call(this, gvlid, moduleName, moduleType, result);
193+
fn.call(this, gvlid, moduleName, result);
200194
}
201195
} else {
202196
result.valid = true;
203-
fn.call(this, gvlid, moduleName, moduleType, result);
197+
fn.call(this, gvlid, moduleName, result);
204198
}
205199
}
206200
}

modules/ixBidAdapter.js

+1-2
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@ import {Renderer} from '../src/Renderer.js';
3030
const BIDDER_CODE = 'ix';
3131
const ALIAS_BIDDER_CODE = 'roundel';
3232
const GLOBAL_VENDOR_ID = 10;
33-
const MODULE_TYPE = 'bid-adapter';
3433
const SECURE_BID_URL = 'https://htlb.casalemedia.com/openrtb/pbjs';
3534
const SUPPORTED_AD_TYPES = [BANNER, VIDEO, NATIVE];
3635
const BANNER_ENDPOINT_VERSION = 7.2;
@@ -1425,7 +1424,7 @@ function localStorageHandler(data) {
14251424
hasEnforcementHook: false,
14261425
valid: hasDeviceAccess()
14271426
};
1428-
validateStorageEnforcement(GLOBAL_VENDOR_ID, BIDDER_CODE, MODULE_TYPE, DEFAULT_ENFORCEMENT_SETTINGS, (permissions) => {
1427+
validateStorageEnforcement(GLOBAL_VENDOR_ID, BIDDER_CODE, DEFAULT_ENFORCEMENT_SETTINGS, (permissions) => {
14291428
if (permissions.valid) {
14301429
storeErrorEventData(data);
14311430
}

modules/pubCommonId.js

+1-2
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,7 @@ import * as events from '../src/events.js';
99
import CONSTANTS from '../src/constants.json';
1010
import { getStorageManager } from '../src/storageManager.js';
1111

12-
const MODULE_TYPE = 'fpid-module';
13-
const storage = getStorageManager({moduleType: MODULE_TYPE});
12+
const storage = getStorageManager({moduleName: 'pubCommonId'});
1413

1514
const ID_NAME = '_pubcid';
1615
const OPTOUT_NAME = '_pubcid_optout';

modules/sharedIdSystem.js

+5-5
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,12 @@
55
* @requires module:modules/userId
66
*/
77

8-
import {buildUrl, generateUUID, hasDeviceAccess, logInfo, parseUrl, triggerPixel} from '../src/utils.js';
8+
import { parseUrl, buildUrl, triggerPixel, logInfo, hasDeviceAccess, generateUUID } from '../src/utils.js';
99
import {submodule} from '../src/hook.js';
10-
import {coppaDataHandler} from '../src/adapterManager.js';
10+
import { coppaDataHandler } from '../src/adapterManager.js';
1111
import {getStorageManager} from '../src/storageManager.js';
1212

13-
const MODULE_TYPE = 'fpid-module';
14-
export const storage = getStorageManager({moduleName: 'pubCommonId', moduleType: MODULE_TYPE});
13+
export const storage = getStorageManager({moduleName: 'pubCommonId'});
1514
const COOKIE = 'cookie';
1615
const LOCAL_STORAGE = 'html5';
1716
const OPTOUT_NAME = '_pubcid_optout';
@@ -88,7 +87,8 @@ export const sharedIdSystemSubmodule = {
8887
return undefined;
8988
}
9089
logInfo(' Decoded value PubCommonId ' + value);
91-
return {'pubcid': value};
90+
const idObj = {'pubcid': value};
91+
return idObj;
9292
},
9393
/**
9494
* performs action to obtain id

src/storageManager.js

+4-5
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ export function newStorageManager({gvlid, moduleName, bidderCode, moduleType} =
4848
let hookDetails = {
4949
hasEnforcementHook: false
5050
}
51-
validateStorageEnforcement(gvlid, bidderCode || moduleName, moduleType, hookDetails, function(result) {
51+
validateStorageEnforcement(gvlid, bidderCode || moduleName, hookDetails, function(result) {
5252
if (result && result.hasEnforcementHook) {
5353
value = cb(result);
5454
} else {
@@ -303,7 +303,7 @@ export function newStorageManager({gvlid, moduleName, bidderCode, moduleType} =
303303
/**
304304
* This hook validates the storage enforcement if gdprEnforcement module is included
305305
*/
306-
export const validateStorageEnforcement = hook('async', function(gvlid, moduleName, moduleType, hookDetails, callback) {
306+
export const validateStorageEnforcement = hook('async', function(gvlid, moduleName, hookDetails, callback) {
307307
callback(hookDetails);
308308
}, 'validateStorageEnforcement');
309309

@@ -322,13 +322,12 @@ export function getCoreStorageManager(moduleName) {
322322
* @param {Number=} gvlid? Vendor id - required for proper GDPR integration
323323
* @param {string=} bidderCode? - required for bid adapters
324324
* @param {string=} moduleName? module name
325-
* @param {string=} moduleType? module type
326325
*/
327-
export function getStorageManager({gvlid, moduleName, bidderCode, moduleType} = {}) {
326+
export function getStorageManager({gvlid, moduleName, bidderCode} = {}) {
328327
if (arguments.length > 1 || (arguments.length > 0 && !isPlainObject(arguments[0]))) {
329328
throw new Error('Invalid invocation for getStorageManager')
330329
}
331-
return newStorageManager({gvlid, moduleName, bidderCode, moduleType});
330+
return newStorageManager({gvlid, moduleName, bidderCode});
332331
}
333332

334333
export function resetData() {

0 commit comments

Comments
 (0)