Skip to content

Commit

Permalink
Prebid 9: rename GDPR modules (#11521)
Browse files Browse the repository at this point in the history
  • Loading branch information
dgirardi authored May 21, 2024
1 parent f34f6b1 commit 45b5fdc
Show file tree
Hide file tree
Showing 26 changed files with 31 additions and 31 deletions.
2 changes: 1 addition & 1 deletion modules/33acrossAnalyticsAdapter.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ by default when Prebid is downloaded. If you are compiling from source,
this might look something like:

```sh
gulp bundle --modules=gptPreAuction,consentManagement,consentManagementGpp,consentManagementUsp,gdprEnforcement,33acrossBidAdapter,33acrossIdSystem,33acrossAnalyticsAdapter
gulp bundle --modules=gptPreAuction,consentManagementTcf,consentManagementGpp,consentManagementUsp,tcfControl,33acrossBidAdapter,33acrossIdSystem,33acrossAnalyticsAdapter
```

Enable the 33Across Analytics Adapter in Prebid.js using the analytics provider `33across`
Expand Down
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion src/prebid.js
Original file line number Diff line number Diff line change
Expand Up @@ -662,7 +662,7 @@ export function executeCallbacks(fn, reqBidsConfigObj) {
}
}

// This hook will execute all storage callbacks which were registered before gdpr enforcement hook was added. Some bidders, user id modules use storage functions when module is parsed but gdpr enforcement hook is not added at that stage as setConfig callbacks are yet to be called. Hence for such calls we execute all the stored callbacks just before requestBids. At this hook point we will know for sure that gdprEnforcement module is added or not
// This hook will execute all storage callbacks which were registered before gdpr enforcement hook was added. Some bidders, user id modules use storage functions when module is parsed but gdpr enforcement hook is not added at that stage as setConfig callbacks are yet to be called. Hence for such calls we execute all the stored callbacks just before requestBids. At this hook point we will know for sure that tcfControl module is added or not
pbjsInstance.requestBids.before(executeCallbacks, 49);

/**
Expand Down
2 changes: 1 addition & 1 deletion test/spec/fpd/gdpr_spec.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import {gdprDataHandler} from '../../../src/adapterManager.js';
import {enrichFPDHook} from '../../../modules/consentManagement.js';
import {enrichFPDHook} from '../../../modules/consentManagementTcf.js';

describe('GDPR FPD enrichment', () => {
let sandbox, consent;
Expand Down
4 changes: 2 additions & 2 deletions test/spec/modules/BTBidAdapter_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ import 'modules/currency.js';
import 'modules/userId/index.js';
import 'modules/multibid/index.js';
import 'modules/priceFloors.js';
import 'modules/consentManagement.js';
import 'modules/consentManagementTcf.js';
import 'modules/consentManagementUsp.js';
import 'modules/consentManagementGpp.js';
import 'modules/gdprEnforcement.js';
import 'modules/tcfControl.js';
import 'modules/gppControl_usnat.js';
import 'modules/schain.js';

Expand Down
2 changes: 1 addition & 1 deletion test/spec/modules/asoBidAdapter_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import {syncAddFPDToBidderRequest} from '../../helpers/fpd';
import {parseUrl} from '../../../src/utils';

import 'modules/priceFloors.js';
import 'modules/consentManagement.js';
import 'modules/consentManagementTcf.js';
import 'modules/consentManagementUsp.js';

describe('Adserver.Online bidding adapter', function () {
Expand Down
2 changes: 1 addition & 1 deletion test/spec/modules/bizzclickBidAdapter_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import 'modules/currency.js';
import 'modules/userId/index.js';
import 'modules/multibid/index.js';
import 'modules/priceFloors.js';
import 'modules/consentManagement.js';
import 'modules/consentManagementTcf.js';
import 'modules/consentManagementUsp.js';
import 'modules/schain.js';

Expand Down
2 changes: 1 addition & 1 deletion test/spec/modules/consentManagement_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import {
setConsentConfig,
staticConsentData,
userCMP
} from 'modules/consentManagement.js';
} from 'modules/consentManagementTcf.js';
import {gdprDataHandler} from 'src/adapterManager.js';
import * as utils from 'src/utils.js';
import {config} from 'src/config.js';
Expand Down
2 changes: 1 addition & 1 deletion test/spec/modules/conversantBidAdapter_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import 'src/prebid.js'
import 'modules/currency.js';
import 'modules/userId/index.js'; // handles eids
import 'modules/priceFloors.js';
import 'modules/consentManagement.js';
import 'modules/consentManagementTcf.js';
import 'modules/consentManagementUsp.js';
import 'modules/schain.js'; // handles schain
import {hook} from '../../../src/hook.js'
Expand Down
6 changes: 3 additions & 3 deletions test/spec/modules/euidIdSystem_spec.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import {coreStorage, init, setSubmoduleRegistry} from 'modules/userId/index.js';
import {config} from 'src/config.js';
import {euidIdSubmodule} from 'modules/euidIdSystem.js';
import 'modules/consentManagement.js';
import 'modules/consentManagementTcf.js';
import 'src/prebid.js';
import * as utils from 'src/utils.js';
import {apiHelpers, cookieHelpers, runAuction, setGdprApplies} from './uid2IdSystem_helpers.js';
import {hook} from 'src/hook.js';
import {uninstall as uninstallGdprEnforcement} from 'modules/gdprEnforcement.js';
import {uninstall as uninstallTcfControl} from 'modules/tcfControl.js';
import {server} from 'test/mocks/xhr';

let expect = require('chai').expect;
Expand Down Expand Up @@ -49,7 +49,7 @@ describe('EUID module', function() {
const configureEuidCstgResponse = (httpStatus, response) => server.respondWith('POST', cstgApiUrl, (xhr) => xhr.respond(httpStatus, headers, response));

before(function() {
uninstallGdprEnforcement();
uninstallTcfControl();
hook.ready();
suiteSandbox = sinon.sandbox.create();
if (typeof window.crypto.subtle === 'undefined') {
Expand Down
2 changes: 1 addition & 1 deletion test/spec/modules/id5AnalyticsAdapter_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ describe('ID5 analytics adapter', () => {
server.respond();

// Why 3? 1: config, 2: tcfEnforcement, 3: auctionEnd
// tcfEnforcement? yes, gdprEnforcement module emits in reaction to auctionEnd
// tcfEnforcement? yes, tcfControl module emits in reaction to auctionEnd
expect(server.requests).to.have.length(3);

const body1 = JSON.parse(server.requests[1].requestBody);
Expand Down
2 changes: 1 addition & 1 deletion test/spec/modules/improvedigitalBidAdapter_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import 'modules/currency.js';
import 'modules/userId/index.js';
import 'modules/multibid/index.js';
import 'modules/priceFloors.js';
import 'modules/consentManagement.js';
import 'modules/consentManagementTcf.js';
import 'modules/consentManagementUsp.js';
import 'modules/schain.js';
import {decorateAdUnitsWithNativeParams} from '../../../src/native.js';
Expand Down
2 changes: 1 addition & 1 deletion test/spec/modules/openxBidAdapter_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import 'modules/currency.js';
import 'modules/userId/index.js';
import 'modules/multibid/index.js';
import 'modules/priceFloors.js';
import 'modules/consentManagement.js';
import 'modules/consentManagementTcf.js';
import 'modules/consentManagementUsp.js';
import 'modules/schain.js';
import {deepClone} from 'src/utils.js';
Expand Down
2 changes: 1 addition & 1 deletion test/spec/modules/prebidServerBidAdapter_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import 'modules/currency.js'; // adServerCurrency test
import 'modules/userId/index.js';
import 'modules/multibid/index.js';
import 'modules/priceFloors.js';
import 'modules/consentManagement.js';
import 'modules/consentManagementTcf.js';
import 'modules/consentManagementUsp.js';
import 'modules/schain.js';
import 'modules/fledgeForGpt.js';
Expand Down
2 changes: 1 addition & 1 deletion test/spec/modules/prismaBidAdapter_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import {spec} from 'modules/prismaBidAdapter.js';
import {newBidder} from 'src/adapters/bidderFactory.js';
import {config} from 'src/config.js';
import * as utils from 'src/utils.js';
import { requestBidsHook } from 'modules/consentManagement.js';
import { requestBidsHook } from 'modules/consentManagementTcf.js';

describe('Prisma bid adapter tests', function () {
const DISPLAY_BID_REQUEST = [{
Expand Down
2 changes: 1 addition & 1 deletion test/spec/modules/rubiconBidAdapter_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import * as utils from 'src/utils.js';
import {find} from 'src/polyfill.js';
import {createEidsArray} from 'modules/userId/eids.js';
import 'modules/schain.js';
import 'modules/consentManagement.js';
import 'modules/consentManagementTcf.js';
import 'modules/consentManagementUsp.js';
import 'modules/userId/index.js';
import 'modules/priceFloors.js';
Expand Down
2 changes: 1 addition & 1 deletion test/spec/modules/silvermobBidAdapter_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import 'modules/currency.js';
import 'modules/userId/index.js';
import 'modules/multibid/index.js';
import 'modules/priceFloors.js';
import 'modules/consentManagement.js';
import 'modules/consentManagementTcf.js';
import 'modules/consentManagementUsp.js';
import 'modules/schain.js';

Expand Down
2 changes: 1 addition & 1 deletion test/spec/modules/smaatoBidAdapter_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import 'modules/currency.js';
import 'modules/userId/index.js';
import 'modules/multibid/index.js';
import 'modules/priceFloors.js';
import 'modules/consentManagement.js';
import 'modules/consentManagementTcf.js';
import 'modules/consentManagementUsp.js';
import 'modules/schain.js';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import {
STRICT_STORAGE_ENFORCEMENT,
syncUserRule, ufpdRule,
validateRules
} from 'modules/gdprEnforcement.js';
} from 'modules/tcfControl.js';
import {config} from 'src/config.js';
import adapterManager, {gdprDataHandler} from 'src/adapterManager.js';
import * as utils from 'src/utils.js';
Expand Down
2 changes: 1 addition & 1 deletion test/spec/modules/tpmnBidAdapter_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { generateUUID } from '../../../src/utils.js';
import { expect } from 'chai';
import * as utils from 'src/utils';
import * as sinon from 'sinon';
import 'modules/consentManagement.js';
import 'modules/consentManagementTcf.js';
import {syncAddFPDToBidderRequest} from '../../helpers/fpd.js';
import {mockGdprConsent} from '../../helpers/consentData.js';

Expand Down
2 changes: 1 addition & 1 deletion test/spec/modules/trafficgateBidAdapter_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import 'modules/currency.js';
import 'modules/userId/index.js';
import 'modules/multibid/index.js';
import 'modules/priceFloors.js';
import 'modules/consentManagement.js';
import 'modules/consentManagementTcf.js';
import 'modules/consentManagementUsp.js';
import 'modules/schain.js';
import {deepClone} from 'src/utils.js';
Expand Down
2 changes: 1 addition & 1 deletion test/spec/modules/uid2IdSystem_helpers.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {setConsentConfig} from 'modules/consentManagement.js';
import {setConsentConfig} from 'modules/consentManagementTcf.js';
import {server} from 'test/mocks/xhr.js';
import {coreStorage, requestBidsHook} from 'modules/userId/index.js';

Expand Down
6 changes: 3 additions & 3 deletions test/spec/modules/uid2IdSystem_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@ import {config} from 'src/config.js';
import * as utils from 'src/utils.js';
import { uid2IdSubmodule } from 'modules/uid2IdSystem.js';
import 'src/prebid.js';
import 'modules/consentManagement.js';
import 'modules/consentManagementTcf.js';
import { getGlobal } from 'src/prebidGlobal.js';
import { configureTimerInterceptors } from 'test/mocks/timers.js';
import { cookieHelpers, runAuction, apiHelpers, setGdprApplies } from './uid2IdSystem_helpers.js';
import {hook} from 'src/hook.js';
import {uninstall as uninstallGdprEnforcement} from 'modules/gdprEnforcement.js';
import {uninstall as uninstallTcfControl} from 'modules/tcfControl.js';
import {server} from 'test/mocks/xhr';

let expect = require('chai').expect;
Expand Down Expand Up @@ -90,7 +90,7 @@ describe(`UID2 module`, function () {
before(function () {
timerSpy = configureTimerInterceptors(debugOutput);
hook.ready();
uninstallGdprEnforcement();
uninstallTcfControl();

suiteSandbox = sinon.sandbox.create();
// I'm unable to find an authoritative source, but apparently subtle isn't available in some test stacks for security reasons.
Expand Down
6 changes: 3 additions & 3 deletions test/spec/modules/userId_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import {getPrebidInternal} from 'src/utils.js';
import * as events from 'src/events.js';
import {EVENTS} from 'src/constants.js';
import {getGlobal} from 'src/prebidGlobal.js';
import {resetConsentData, } from 'modules/consentManagement.js';
import {resetConsentData, } from 'modules/consentManagementTcf.js';
import {server} from 'test/mocks/xhr.js';
import {unifiedIdSubmodule} from 'modules/unifiedIdSystem.js';
import {id5IdSubmodule} from 'modules/id5IdSystem.js';
Expand Down Expand Up @@ -55,7 +55,7 @@ import 'src/prebid.js';
import {hook} from '../../../src/hook.js';
import {mockGdprConsent} from '../../helpers/consentData.js';
import {getPPID} from '../../../src/adserver.js';
import {uninstall as uninstallGdprEnforcement} from 'modules/gdprEnforcement.js';
import {uninstall as uninstallTcfControl} from 'modules/tcfControl.js';
import {allConsent, GDPR_GVLIDS, gdprDataHandler} from '../../../src/consentHandler.js';
import {MODULE_TYPE_UID} from '../../../src/activities/modules.js';
import {ACTIVITY_ENRICH_EIDS} from '../../../src/activities/activities.js';
Expand Down Expand Up @@ -179,7 +179,7 @@ describe('User ID', function () {

before(function () {
hook.ready();
uninstallGdprEnforcement();
uninstallTcfControl();
localStorage.removeItem(PBJS_USER_ID_OPTOUT_NAME);
liveIntentIdSubmoduleDoNotFireEvent();
});
Expand Down
2 changes: 1 addition & 1 deletion test/spec/ortbConverter/gdpr_spec.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {setOrtbAdditionalConsent} from '../../../modules/consentManagement.js';
import {setOrtbAdditionalConsent} from '../../../modules/consentManagementTcf.js';

describe('pbjs -> ortb addtlConsent', () => {
it('sets ConsentedProvidersSettings', () => {
Expand Down

0 comments on commit 45b5fdc

Please sign in to comment.