prebid.js 7.52.0 → 7.53.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (214) hide show
  1. package/dist/1plusXRtdProvider.js +1 -1
  2. package/dist/33acrossBidAdapter.js +1 -1
  3. package/dist/33acrossIdSystem.js +1 -1
  4. package/dist/adagioBidAdapter.js +1 -1
  5. package/dist/adbookpspBidAdapter.js +1 -1
  6. package/dist/adgenerationBidAdapter.js +1 -1
  7. package/dist/adkernelBidAdapter.js +1 -1
  8. package/dist/adqueryBidAdapter.js +1 -1
  9. package/dist/adrelevantisBidAdapter.js +1 -1
  10. package/dist/adtrgtmeBidAdapter.js +1 -1
  11. package/dist/adxcgBidAdapter.js +1 -1
  12. package/dist/adyoulikeBidAdapter.js +1 -1
  13. package/dist/airgridRtdProvider.js +1 -1
  14. package/dist/ajaBidAdapter.js +1 -1
  15. package/dist/amxBidAdapter.js +1 -1
  16. package/dist/amxIdSystem.js +1 -1
  17. package/dist/appierAnalyticsAdapter.js +1 -1
  18. package/dist/appnexusBidAdapter.js +1 -1
  19. package/dist/asoBidAdapter.js +1 -1
  20. package/dist/axonixBidAdapter.js +1 -1
  21. package/dist/beopBidAdapter.js +1 -1
  22. package/dist/bidglassBidAdapter.js +1 -1
  23. package/dist/big-richmediaBidAdapter.js +1 -1
  24. package/dist/bridgewellBidAdapter.js +1 -1
  25. package/dist/brightMountainMediaBidAdapter.js +1 -1
  26. package/dist/carodaBidAdapter.js +1 -1
  27. package/dist/chtnwBidAdapter.js +1 -1
  28. package/dist/conceptxBidAdapter.js +1 -0
  29. package/dist/concertBidAdapter.js +1 -1
  30. package/dist/connectadBidAdapter.js +1 -1
  31. package/dist/consumableBidAdapter.js +1 -1
  32. package/dist/conversantAnalyticsAdapter.js +1 -1
  33. package/dist/conversantBidAdapter.js +1 -1
  34. package/dist/craftBidAdapter.js +1 -1
  35. package/dist/criteoBidAdapter.js +1 -1
  36. package/dist/cwireBidAdapter.js +1 -1
  37. package/dist/dspxBidAdapter.js +1 -1
  38. package/dist/eplanningBidAdapter.js +1 -1
  39. package/dist/eskimiBidAdapter.js +1 -1
  40. package/dist/euidIdSystem.js +1 -0
  41. package/dist/feedadBidAdapter.js +1 -1
  42. package/dist/finativeBidAdapter.js +1 -1
  43. package/dist/freepassIdSystem.js +1 -0
  44. package/dist/freewheel-sspBidAdapter.js +1 -1
  45. package/dist/glimpseBidAdapter.js +1 -1
  46. package/dist/gmosspBidAdapter.js +1 -1
  47. package/dist/goldbachBidAdapter.js +1 -1
  48. package/dist/greenbidsAnalyticsAdapter.js +1 -1
  49. package/dist/greenbidsRtdProvider.js +1 -1
  50. package/dist/gridBidAdapter.js +1 -1
  51. package/dist/gumgumBidAdapter.js +1 -1
  52. package/dist/h12mediaBidAdapter.js +1 -1
  53. package/dist/id5IdSystem.js +1 -1
  54. package/dist/improvedigitalBidAdapter.js +1 -1
  55. package/dist/inmarBidAdapter.js +1 -1
  56. package/dist/insticatorBidAdapter.js +1 -1
  57. package/dist/ixBidAdapter.js +1 -1
  58. package/dist/justpremiumBidAdapter.js +1 -1
  59. package/dist/kargoBidAdapter.js +1 -1
  60. package/dist/konduitAnalyticsAdapter.js +1 -1
  61. package/dist/kueezBidAdapter.js +1 -1
  62. package/dist/kueezRtbBidAdapter.js +1 -1
  63. package/dist/kulturemediaBidAdapter.js +1 -1
  64. package/dist/lassoBidAdapter.js +1 -1
  65. package/dist/lifestreetBidAdapter.js +1 -1
  66. package/dist/limelightDigitalBidAdapter.js +1 -1
  67. package/dist/liveyieldAnalyticsAdapter.js +1 -1
  68. package/dist/logicadBidAdapter.js +1 -1
  69. package/dist/loglyliftBidAdapter.js +1 -1
  70. package/dist/magniteAnalyticsAdapter.js +1 -1
  71. package/dist/malltvAnalyticsAdapter.js +1 -1
  72. package/dist/marsmediaBidAdapter.js +1 -1
  73. package/dist/mediafuseBidAdapter.js +1 -1
  74. package/dist/mediasquareBidAdapter.js +1 -1
  75. package/dist/mgidBidAdapter.js +1 -1
  76. package/dist/minutemediaBidAdapter.js +1 -1
  77. package/dist/minutemediaplusBidAdapter.js +1 -1
  78. package/dist/nexx360BidAdapter.js +1 -1
  79. package/dist/not-for-prod/prebid.js +146 -142
  80. package/dist/oguryBidAdapter.js +1 -1
  81. package/dist/onetagBidAdapter.js +1 -1
  82. package/dist/ooloAnalyticsAdapter.js +1 -1
  83. package/dist/optidigitalBidAdapter.js +1 -1
  84. package/dist/outbrainBidAdapter.js +1 -1
  85. package/dist/pairIdSystem.js +1 -1
  86. package/dist/parrableIdSystem.js +1 -1
  87. package/dist/pixfutureBidAdapter.js +1 -1
  88. package/dist/prebid-core.js +1 -1
  89. package/dist/proxistoreBidAdapter.js +1 -1
  90. package/dist/publinkIdSystem.js +1 -1
  91. package/dist/pubmaticBidAdapter.js +1 -1
  92. package/dist/pubwiseAnalyticsAdapter.js +1 -1
  93. package/dist/pxyzBidAdapter.js +1 -1
  94. package/dist/quantcastBidAdapter.js +1 -1
  95. package/dist/readpeakBidAdapter.js +1 -1
  96. package/dist/relaidoBidAdapter.js +1 -1
  97. package/dist/retailspotBidAdapter.js +1 -1
  98. package/dist/rhythmoneBidAdapter.js +1 -1
  99. package/dist/richaudienceBidAdapter.js +1 -1
  100. package/dist/riseBidAdapter.js +1 -1
  101. package/dist/rubiconAnalyticsAdapter.js +1 -1
  102. package/dist/rubiconBidAdapter.js +1 -1
  103. package/dist/schain.js +1 -1
  104. package/dist/seedingAllianceBidAdapter.js +1 -1
  105. package/dist/seedtagBidAdapter.js +1 -1
  106. package/dist/sharethroughAnalyticsAdapter.js +1 -1
  107. package/dist/sharethroughBidAdapter.js +1 -1
  108. package/dist/shinezBidAdapter.js +1 -1
  109. package/dist/sirdataRtdProvider.js +1 -1
  110. package/dist/smaatoBidAdapter.js +1 -1
  111. package/dist/smartadserverBidAdapter.js +1 -1
  112. package/dist/smartxBidAdapter.js +1 -1
  113. package/dist/smilewantedBidAdapter.js +1 -1
  114. package/dist/sonobiBidAdapter.js +1 -1
  115. package/dist/sovrnAnalyticsAdapter.js +1 -1
  116. package/dist/sovrnBidAdapter.js +1 -1
  117. package/dist/sspBCBidAdapter.js +1 -1
  118. package/dist/stroeerCoreBidAdapter.js +1 -1
  119. package/dist/stvBidAdapter.js +1 -1
  120. package/dist/sublimeBidAdapter.js +1 -1
  121. package/dist/synacormediaBidAdapter.js +1 -1
  122. package/dist/targetVideoBidAdapter.js +1 -1
  123. package/dist/teadsBidAdapter.js +1 -1
  124. package/dist/trionBidAdapter.js +1 -1
  125. package/dist/tripleliftBidAdapter.js +1 -1
  126. package/dist/ttdBidAdapter.js +1 -1
  127. package/dist/ucfunnelAnalyticsAdapter.js +1 -1
  128. package/dist/uid2IdSystem.js +1 -1
  129. package/dist/uid2IdSystem_shared.js +1 -0
  130. package/dist/underdogmediaBidAdapter.js +1 -1
  131. package/dist/undertoneBidAdapter.js +1 -1
  132. package/dist/userId.js +1 -1
  133. package/dist/vidazooBidAdapter.js +1 -1
  134. package/dist/videobyteBidAdapter.js +1 -1
  135. package/dist/viouslyBidAdapter.js +1 -1
  136. package/dist/visxBidAdapter.js +1 -1
  137. package/dist/vuukleBidAdapter.js +1 -1
  138. package/dist/weboramaRtdProvider.js +1 -1
  139. package/dist/widespaceBidAdapter.js +1 -1
  140. package/dist/winrBidAdapter.js +1 -1
  141. package/dist/yahoosspBidAdapter.js +1 -1
  142. package/dist/yieldlabBidAdapter.js +1 -1
  143. package/dist/yieldmoBidAdapter.js +1 -1
  144. package/dist/yieldoneAnalyticsAdapter.js +1 -1
  145. package/dist/zeta_global_sspBidAdapter.js +1 -1
  146. package/integrationExamples/gpt/userId_example.html +20 -6
  147. package/modules/.submodules.json +3 -1
  148. package/modules/1plusXRtdProvider.js +31 -60
  149. package/modules/adagioBidAdapter.js +86 -24
  150. package/modules/adkernelBidAdapter.js +2 -2
  151. package/modules/airgridRtdProvider.js +11 -12
  152. package/modules/asoBidAdapter.js +2 -1
  153. package/modules/beopBidAdapter.js +6 -0
  154. package/modules/conceptxBidAdapter.js +70 -0
  155. package/modules/conceptxBidAdapter.md +36 -0
  156. package/modules/criteoBidAdapter.js +9 -2
  157. package/modules/eskimiBidAdapter.js +171 -41
  158. package/modules/eskimiBidAdapter.md +35 -16
  159. package/modules/euidIdSystem.js +121 -0
  160. package/modules/euidIdSystem.md +131 -0
  161. package/modules/freepassIdSystem.js +61 -0
  162. package/modules/freepassIdSystem.md +47 -0
  163. package/modules/greenbidsAnalyticsAdapter.js +1 -1
  164. package/modules/id5IdSystem.js +3 -5
  165. package/modules/ixBidAdapter.js +12 -1
  166. package/modules/limelightDigitalBidAdapter.js +1 -1
  167. package/modules/logicadBidAdapter.js +14 -1
  168. package/modules/mediasquareBidAdapter.js +13 -5
  169. package/modules/nexx360BidAdapter.js +1 -0
  170. package/modules/pairIdSystem.js +10 -5
  171. package/modules/proxistoreBidAdapter.js +11 -14
  172. package/modules/richaudienceBidAdapter.js +10 -1
  173. package/modules/riseBidAdapter.js +1 -1
  174. package/modules/schain.js +2 -2
  175. package/modules/sirdataRtdProvider.js +73 -146
  176. package/modules/sovrnBidAdapter.js +4 -1
  177. package/modules/stroeerCoreBidAdapter.js +55 -6
  178. package/modules/uid2IdSystem.js +27 -210
  179. package/modules/uid2IdSystem.md +104 -23
  180. package/modules/uid2IdSystem_shared.js +232 -0
  181. package/modules/userId/eids.js +8 -0
  182. package/modules/userId/userId.md +2 -1
  183. package/modules/viouslyBidAdapter.js +2 -2
  184. package/modules/weboramaRtdProvider.js +25 -95
  185. package/modules/weboramaRtdProvider.md +4 -4
  186. package/modules/yieldlabBidAdapter.js +23 -14
  187. package/modules/zeta_global_sspBidAdapter.js +27 -22
  188. package/package.json +1 -1
  189. package/src/adloader.js +1 -0
  190. package/test/spec/modules/1plusXRtdProvider_spec.js +98 -149
  191. package/test/spec/modules/adagioBidAdapter_spec.js +46 -17
  192. package/test/spec/modules/airgridRtdProvider_spec.js +2 -0
  193. package/test/spec/modules/beopBidAdapter_spec.js +24 -0
  194. package/test/spec/modules/conceptxBidAdapter_spec.js +136 -0
  195. package/test/spec/modules/criteoBidAdapter_spec.js +1 -1
  196. package/test/spec/modules/eids_spec.js +15 -0
  197. package/test/spec/modules/eskimiBidAdapter_spec.js +264 -112
  198. package/test/spec/modules/euidIdSystem_spec.js +130 -0
  199. package/test/spec/modules/freepassIdSystem_spec.js +186 -0
  200. package/test/spec/modules/id5IdSystem_spec.js +10 -3
  201. package/test/spec/modules/ixBidAdapter_spec.js +30 -0
  202. package/test/spec/modules/logicadBidAdapter_spec.js +122 -2
  203. package/test/spec/modules/mediasquareBidAdapter_spec.js +4 -0
  204. package/test/spec/modules/richaudienceBidAdapter_spec.js +44 -0
  205. package/test/spec/modules/schain_spec.js +9 -0
  206. package/test/spec/modules/sirdataRtdProvider_spec.js +110 -17
  207. package/test/spec/modules/sovrnBidAdapter_spec.js +13 -0
  208. package/test/spec/modules/stroeerCoreBidAdapter_spec.js +151 -6
  209. package/test/spec/modules/uid2IdSystem_helpers.js +70 -0
  210. package/test/spec/modules/uid2IdSystem_spec.js +131 -86
  211. package/test/spec/modules/userId_spec.js +16 -12
  212. package/test/spec/modules/weboramaRtdProvider_spec.js +331 -205
  213. package/test/spec/modules/yieldlabBidAdapter_spec.js +42 -2
  214. package/test/spec/modules/zeta_global_sspBidAdapter_spec.js +200 -4
@@ -0,0 +1,130 @@
1
+ import {coreStorage, init, setSubmoduleRegistry, requestBidsHook} from 'modules/userId/index.js';
2
+ import {config} from 'src/config.js';
3
+ import * as utils from 'src/utils.js';
4
+ import { euidIdSubmodule } from 'modules/euidIdSystem.js';
5
+ import 'modules/consentManagement.js';
6
+ import 'src/prebid.js';
7
+ import { getGlobal } from 'src/prebidGlobal.js';
8
+ import { server } from 'test/mocks/xhr.js';
9
+ import { configureTimerInterceptors } from 'test/mocks/timers.js';
10
+ import { cookieHelpers, runAuction, apiHelpers, setGdprApplies } from './uid2IdSystem_helpers.js';
11
+ import {hook} from 'src/hook.js';
12
+ import {uninstall as uninstallGdprEnforcement} from 'modules/gdprEnforcement.js';
13
+
14
+ let expect = require('chai').expect;
15
+
16
+ // N.B. Most of the EUID code is shared with UID2 - the tests here only cover the happy path.
17
+ // Most of the functionality is covered by the UID2 tests.
18
+
19
+ const moduleCookieName = '__euid_advertising_token';
20
+ const publisherCookieName = '__EUID_SERVER_COOKIE';
21
+ const initialToken = `initial-advertising-token`;
22
+ const legacyToken = 'legacy-advertising-token';
23
+ const refreshedToken = 'refreshed-advertising-token';
24
+ const auctionDelayMs = 10;
25
+
26
+ const makeEuidIdentityContainer = (token) => ({euid: {id: token}});
27
+ const useLocalStorage = true;
28
+ const makePrebidConfig = (params = null, extraSettings = {}, debug = false) => ({
29
+ userSync: { auctionDelay: auctionDelayMs, userIds: [{name: 'euid', params: {storage: useLocalStorage ? 'localStorage' : 'cookie', ...params}, ...extraSettings}] }, debug
30
+ });
31
+
32
+ const apiUrl = 'https://prod.euid.eu/v2/token/refresh';
33
+ const headers = { 'Content-Type': 'application/json' };
34
+ const makeSuccessResponseBody = () => btoa(JSON.stringify({ status: 'success', body: { ...apiHelpers.makeTokenResponse(initialToken), advertising_token: refreshedToken } }));
35
+ const configureEuidResponse = (httpStatus, response) => server.respondWith('POST', apiUrl, (xhr) => xhr.respond(httpStatus, headers, response));
36
+ const expectToken = (bid, token) => expect(bid?.userId ?? {}).to.deep.include(makeEuidIdentityContainer(token));
37
+ const expectNoIdentity = (bid) => expect(bid).to.not.haveOwnProperty('userId');
38
+
39
+ describe('EUID module', function() {
40
+ let suiteSandbox, testSandbox, timerSpy, fullTestTitle, restoreSubtleToUndefined = false;
41
+ before(function() {
42
+ uninstallGdprEnforcement();
43
+ hook.ready();
44
+ suiteSandbox = sinon.sandbox.create();
45
+ if (typeof window.crypto.subtle === 'undefined') {
46
+ restoreSubtleToUndefined = true;
47
+ window.crypto.subtle = { importKey: () => {}, decrypt: () => {} };
48
+ }
49
+ suiteSandbox.stub(window.crypto.subtle, 'importKey').callsFake(() => Promise.resolve());
50
+ suiteSandbox.stub(window.crypto.subtle, 'decrypt').callsFake((settings, key, data) => Promise.resolve(new Uint8Array([...settings.iv, ...data])));
51
+ });
52
+ after(function() {
53
+ suiteSandbox.restore();
54
+ if (restoreSubtleToUndefined) window.crypto.subtle = undefined;
55
+ });
56
+ beforeEach(function() {
57
+ init(config);
58
+ setSubmoduleRegistry([euidIdSubmodule]);
59
+ });
60
+ afterEach(function() {
61
+ $$PREBID_GLOBAL$$.requestBids.removeAll();
62
+ config.resetConfig();
63
+ cookieHelpers.clearCookies(moduleCookieName, publisherCookieName);
64
+ coreStorage.removeDataFromLocalStorage(moduleCookieName);
65
+ });
66
+
67
+ it('When a server-only token value is provided in config but consent is not available, it is not available to the auction.', async function() {
68
+ setGdprApplies();
69
+ config.setConfig(makePrebidConfig(null, {value: makeEuidIdentityContainer(initialToken)}));
70
+ const bid = await runAuction();
71
+ expectNoIdentity(bid);
72
+ });
73
+
74
+ it('When a server-only token value is provided in config, it is available to the auction.', async function() {
75
+ setGdprApplies(true);
76
+ config.setConfig(makePrebidConfig(null, {value: makeEuidIdentityContainer(initialToken)}));
77
+ const bid = await runAuction();
78
+ expectToken(bid, initialToken);
79
+ });
80
+
81
+ it('When a server-only token is provided in the module storage cookie but consent is not available, it is not available to the auction.', async function() {
82
+ setGdprApplies();
83
+ coreStorage.setCookie(moduleCookieName, legacyToken, cookieHelpers.getFutureCookieExpiry());
84
+ config.setConfig({userSync: {auctionDelay: auctionDelayMs, userIds: [{name: 'euid'}]}});
85
+ const bid = await runAuction();
86
+ expectNoIdentity(bid);
87
+ });
88
+
89
+ it('When a server-only token is provided in the module storage cookie, it is available to the auction.', async function() {
90
+ setGdprApplies(true);
91
+ coreStorage.setCookie(moduleCookieName, legacyToken, cookieHelpers.getFutureCookieExpiry());
92
+ config.setConfig({userSync: {auctionDelay: auctionDelayMs, userIds: [{name: 'euid'}]}});
93
+ const bid = await runAuction();
94
+ expectToken(bid, legacyToken);
95
+ })
96
+
97
+ it('When a valid response body is provided in config, it is available to the auction', async function() {
98
+ setGdprApplies(true);
99
+ const euidToken = apiHelpers.makeTokenResponse(initialToken, false, false);
100
+ config.setConfig(makePrebidConfig({euidToken}));
101
+ const bid = await runAuction();
102
+ expectToken(bid, initialToken);
103
+ })
104
+
105
+ it('When a valid response body is provided via cookie, it is available to the auction', async function() {
106
+ setGdprApplies(true);
107
+ const euidToken = apiHelpers.makeTokenResponse(initialToken, false, false);
108
+ cookieHelpers.setPublisherCookie(publisherCookieName, euidToken);
109
+ config.setConfig(makePrebidConfig({euidCookie: publisherCookieName}));
110
+ const bid = await runAuction();
111
+ expectToken(bid, initialToken);
112
+ })
113
+
114
+ it('When an expired token is provided in config, it calls the API.', function() {
115
+ setGdprApplies(true);
116
+ const euidToken = apiHelpers.makeTokenResponse(initialToken, true, true);
117
+ config.setConfig(makePrebidConfig({euidToken}));
118
+ expect(server.requests[0]?.url).to.have.string('https://prod.euid.eu/');
119
+ });
120
+
121
+ it('When an expired token is provided and the API responds in time, the refreshed token is provided to the auction.', async function() {
122
+ setGdprApplies(true);
123
+ const euidToken = apiHelpers.makeTokenResponse(initialToken, true, true);
124
+ configureEuidResponse(200, makeSuccessResponseBody());
125
+ config.setConfig(makePrebidConfig({euidToken}));
126
+ apiHelpers.respondAfterDelay(1);
127
+ const bid = await runAuction();
128
+ expectToken(bid, refreshedToken);
129
+ });
130
+ });
@@ -0,0 +1,186 @@
1
+ import {freepassIdSubmodule} from 'modules/freepassIdSystem';
2
+ import sinon from 'sinon';
3
+ import * as utils from '../../../src/utils';
4
+
5
+ let expect = require('chai').expect;
6
+
7
+ describe('FreePass ID System', function () {
8
+ const UUID = '15fde1dc-1861-4894-afdf-b757272f3568';
9
+
10
+ before(function () {
11
+ sinon.stub(utils, 'generateUUID').returns(UUID);
12
+ sinon.stub(utils, 'logMessage');
13
+ });
14
+
15
+ after(function () {
16
+ utils.generateUUID.restore();
17
+ utils.logMessage.restore();
18
+ });
19
+
20
+ describe('freepassIdSubmodule', function () {
21
+ it('should expose submodule name', function () {
22
+ expect(freepassIdSubmodule.name).to.equal('freepassId');
23
+ });
24
+ });
25
+
26
+ describe('getId', function () {
27
+ const config = {
28
+ storage: {
29
+ name: '_freepassId',
30
+ type: 'cookie',
31
+ expires: 30
32
+ },
33
+ params: {
34
+ freepassData: {
35
+ commonId: 'commonId',
36
+ userIp: '127.0.0.1'
37
+ }
38
+ }
39
+ };
40
+
41
+ it('should return an IdObject with a UUID', function () {
42
+ const objectId = freepassIdSubmodule.getId(config, undefined);
43
+ expect(objectId).to.be.an('object');
44
+ expect(objectId.id).to.be.an('object');
45
+ expect(objectId.id.userId).to.equal(UUID);
46
+ });
47
+
48
+ it('should include userIp in IdObject', function () {
49
+ const objectId = freepassIdSubmodule.getId(config, undefined);
50
+ expect(objectId).to.be.an('object');
51
+ expect(objectId.id).to.be.an('object');
52
+ expect(objectId.id.userIp).to.equal('127.0.0.1');
53
+ });
54
+ it('should skip userIp in IdObject if not available', function () {
55
+ const localConfig = Object.assign({}, config);
56
+ delete localConfig.params.freepassData.userIp;
57
+ const objectId = freepassIdSubmodule.getId(localConfig, undefined);
58
+ expect(objectId).to.be.an('object');
59
+ expect(objectId.id).to.be.an('object');
60
+ expect(objectId.id.userIp).to.be.undefined;
61
+ });
62
+ it('should skip userIp in IdObject if freepassData is not available', function () {
63
+ const localConfig = JSON.parse(JSON.stringify(config));
64
+ delete localConfig.params.freepassData;
65
+ const objectId = freepassIdSubmodule.getId(localConfig, undefined);
66
+ expect(objectId).to.be.an('object');
67
+ expect(objectId.id).to.be.an('object');
68
+ expect(objectId.id.userIp).to.be.undefined;
69
+ });
70
+ it('should skip userIp in IdObject if params is not available', function () {
71
+ const localConfig = JSON.parse(JSON.stringify(config));
72
+ delete localConfig.params;
73
+ const objectId = freepassIdSubmodule.getId(localConfig, undefined);
74
+ expect(objectId).to.be.an('object');
75
+ expect(objectId.id).to.be.an('object');
76
+ expect(objectId.id.userIp).to.be.undefined;
77
+ });
78
+ it('should include commonId in IdObject', function () {
79
+ const objectId = freepassIdSubmodule.getId(config, undefined);
80
+ expect(objectId).to.be.an('object');
81
+ expect(objectId.id).to.be.an('object');
82
+ expect(objectId.id.commonId).to.equal('commonId');
83
+ });
84
+ it('should skip commonId in IdObject if not available', function () {
85
+ const localConfig = Object.assign({}, config);
86
+ delete localConfig.params.freepassData.commonId;
87
+ const objectId = freepassIdSubmodule.getId(localConfig, undefined);
88
+ expect(objectId).to.be.an('object');
89
+ expect(objectId.id).to.be.an('object');
90
+ expect(objectId.id.commonId).to.be.undefined;
91
+ });
92
+ it('should skip commonId in IdObject if freepassData is not available', function () {
93
+ const localConfig = JSON.parse(JSON.stringify(config));
94
+ delete localConfig.params.freepassData;
95
+ const objectId = freepassIdSubmodule.getId(localConfig, undefined);
96
+ expect(objectId).to.be.an('object');
97
+ expect(objectId.id).to.be.an('object');
98
+ expect(objectId.id.commonId).to.be.undefined;
99
+ });
100
+ it('should skip commonId in IdObject if params is not available', function () {
101
+ const localConfig = JSON.parse(JSON.stringify(config));
102
+ delete localConfig.params;
103
+ const objectId = freepassIdSubmodule.getId(localConfig, undefined);
104
+ expect(objectId).to.be.an('object');
105
+ expect(objectId.id).to.be.an('object');
106
+ expect(objectId.id.commonId).to.be.undefined;
107
+ });
108
+ });
109
+
110
+ describe('decode', function () {
111
+ it('should have module name as property', function () {
112
+ const decodedId = freepassIdSubmodule.decode({}, {});
113
+ expect(decodedId).to.be.an('object');
114
+ expect(decodedId).to.have.property('freepassId');
115
+ });
116
+ it('should have IObject as property value', function () {
117
+ const idObject = {
118
+ commonId: 'commonId',
119
+ userIp: '127.0.0.1',
120
+ userId: UUID
121
+ };
122
+ const decodedId = freepassIdSubmodule.decode(idObject, {});
123
+ expect(decodedId).to.be.an('object');
124
+ expect(decodedId.freepassId).to.be.an('object');
125
+ expect(decodedId.freepassId).to.equal(idObject);
126
+ });
127
+ });
128
+
129
+ describe('extendId', function () {
130
+ const config = {
131
+ storage: {
132
+ name: '_freepassId',
133
+ type: 'cookie',
134
+ expires: 30
135
+ },
136
+ params: {
137
+ freepassData: {
138
+ commonId: 'commonId',
139
+ userIp: '127.0.0.1'
140
+ }
141
+ }
142
+ };
143
+
144
+ it('should return cachedIdObject if there are no changes', function () {
145
+ const idObject = freepassIdSubmodule.getId(config, undefined);
146
+ const cachedIdObject = Object.assign({}, idObject.id);
147
+ const extendedIdObject = freepassIdSubmodule.extendId(config, undefined, cachedIdObject);
148
+ expect(extendedIdObject).to.be.an('object');
149
+ expect(extendedIdObject.id).to.be.an('object');
150
+ expect(extendedIdObject.id).to.equal(cachedIdObject);
151
+ });
152
+
153
+ it('should return cachedIdObject if there are no new data', function () {
154
+ const idObject = freepassIdSubmodule.getId(config, undefined);
155
+ const cachedIdObject = Object.assign({}, idObject.id);
156
+ const localConfig = JSON.parse(JSON.stringify(config));
157
+ delete localConfig.params.freepassData;
158
+ const extendedIdObject = freepassIdSubmodule.extendId(localConfig, undefined, cachedIdObject);
159
+ expect(extendedIdObject).to.be.an('object');
160
+ expect(extendedIdObject.id).to.be.an('object');
161
+ expect(extendedIdObject.id).to.equal(cachedIdObject);
162
+ });
163
+
164
+ it('should return new commonId if there are changes', function () {
165
+ const idObject = freepassIdSubmodule.getId(config, undefined);
166
+ const cachedIdObject = Object.assign({}, idObject.id);
167
+ const localConfig = JSON.parse(JSON.stringify(config));
168
+ localConfig.params.freepassData.commonId = 'newCommonId';
169
+ const extendedIdObject = freepassIdSubmodule.extendId(localConfig, undefined, cachedIdObject);
170
+ expect(extendedIdObject).to.be.an('object');
171
+ expect(extendedIdObject.id).to.be.an('object');
172
+ expect(extendedIdObject.id.commonId).to.equal('newCommonId');
173
+ });
174
+
175
+ it('should return new userIp if there are changes', function () {
176
+ const idObject = freepassIdSubmodule.getId(config, undefined);
177
+ const cachedIdObject = Object.assign({}, idObject.id);
178
+ const localConfig = JSON.parse(JSON.stringify(config));
179
+ localConfig.params.freepassData.userIp = '192.168.1.1';
180
+ const extendedIdObject = freepassIdSubmodule.extendId(localConfig, undefined, cachedIdObject);
181
+ expect(extendedIdObject).to.be.an('object');
182
+ expect(extendedIdObject.id).to.be.an('object');
183
+ expect(extendedIdObject.id.userIp).to.equal('192.168.1.1');
184
+ });
185
+ });
186
+ });
@@ -42,7 +42,9 @@ describe('ID5 ID System', function () {
42
42
  const ID5_STORED_OBJ = {
43
43
  'universal_uid': ID5_STORED_ID,
44
44
  'signature': ID5_STORED_SIGNATURE,
45
- 'link_type': ID5_STORED_LINK_TYPE
45
+ 'ext': {
46
+ 'linkType': ID5_STORED_LINK_TYPE
47
+ }
46
48
  };
47
49
  const ID5_RESPONSE_ID = 'newid5id';
48
50
  const ID5_RESPONSE_SIGNATURE = 'abcdef';
@@ -50,7 +52,10 @@ describe('ID5 ID System', function () {
50
52
  const ID5_JSON_RESPONSE = {
51
53
  'universal_uid': ID5_RESPONSE_ID,
52
54
  'signature': ID5_RESPONSE_SIGNATURE,
53
- 'link_type': ID5_RESPONSE_LINK_TYPE
55
+ 'link_type': ID5_RESPONSE_LINK_TYPE,
56
+ 'ext': {
57
+ 'linkType': ID5_RESPONSE_LINK_TYPE
58
+ }
54
59
  };
55
60
  const ALLOWED_ID5_VENDOR_DATA = {
56
61
  purpose: {
@@ -958,7 +963,9 @@ describe('ID5 ID System', function () {
958
963
  it('should not expose ID when everyone is in control group', function () {
959
964
  storedObject.ab_testing = {result: 'control'};
960
965
  storedObject.universal_uid = '';
961
- storedObject.link_type = 0;
966
+ storedObject.ext = {
967
+ 'linkType': 0
968
+ };
962
969
  let decoded = id5IdSubmodule.decode(storedObject, testConfig);
963
970
  expect(decoded).is.deep.equal(expectedDecodedObjectWithoutIdAbOn);
964
971
  });
@@ -2570,6 +2570,36 @@ describe('IndexexchangeAdapter', function () {
2570
2570
  expect(impression.video.placement).to.equal(2);
2571
2571
  });
2572
2572
 
2573
+ it('should use plcmt value when set in video.params', function () {
2574
+ const bid = utils.deepClone(DEFAULT_VIDEO_VALID_BID[0]);
2575
+ bid.params.video.plcmt = 2;
2576
+ const request = spec.buildRequests([bid], {})[0];
2577
+ const impression = extractPayload(request).imp[0];
2578
+
2579
+ expect(impression.id).to.equal(DEFAULT_VIDEO_VALID_BID[0].bidId);
2580
+ expect(impression.video.plcmt).to.equal(2);
2581
+ });
2582
+
2583
+ it('invalid plcmt value when set in video.params', function () {
2584
+ const bid = utils.deepClone(DEFAULT_VIDEO_VALID_BID[0]);
2585
+ bid.params.video.plcmt = 5;
2586
+ const request = spec.buildRequests([bid], {})[0];
2587
+ const impression = extractPayload(request).imp[0];
2588
+
2589
+ expect(impression.id).to.equal(DEFAULT_VIDEO_VALID_BID[0].bidId);
2590
+ expect(impression.video.plcmt).to.be.undefined;
2591
+ });
2592
+
2593
+ it('invalid plcmt value string when set in video.params', function () {
2594
+ const bid = utils.deepClone(DEFAULT_VIDEO_VALID_BID[0]);
2595
+ bid.params.video.plcmt = '4';
2596
+ const request = spec.buildRequests([bid], {})[0];
2597
+ const impression = extractPayload(request).imp[0];
2598
+
2599
+ expect(impression.id).to.equal(DEFAULT_VIDEO_VALID_BID[0].bidId);
2600
+ expect(impression.video.plcmt).to.be.undefined;
2601
+ });
2602
+
2573
2603
  it('should set imp.ext.sid for video imps if params.id exists', function () {
2574
2604
  const bid = utils.deepClone(DEFAULT_VIDEO_VALID_BID[0]);
2575
2605
  bid.params.id = 50;
@@ -35,7 +35,52 @@ describe('LogicadAdapter', function () {
35
35
  third: 'fakesharedid'
36
36
  }
37
37
  }]
38
- }]
38
+ }],
39
+ ortb2: {
40
+ device: {
41
+ sua: {
42
+ source: 2,
43
+ platform: {
44
+ brand: 'Windows',
45
+ version: ['10', '0', '0']
46
+ },
47
+ browsers: [
48
+ {
49
+ brand: 'Chromium',
50
+ version: ['112', '0', '5615', '20']
51
+ },
52
+ {
53
+ brand: 'Google Chrome',
54
+ version: ['112', '0', '5615', '20']
55
+ },
56
+ {
57
+ brand: 'Not:A-Brand',
58
+ version: ['99', '0', '0', '0']
59
+ }
60
+ ],
61
+ mobile: 0,
62
+ model: '',
63
+ bitness: '64',
64
+ architecture: 'x86'
65
+ }
66
+ },
67
+ user: {
68
+ data: [
69
+ {
70
+ ext: {
71
+ segtax: 600,
72
+ segclass: '2206021246'
73
+ },
74
+ segment: [
75
+ {
76
+ id: '1'
77
+ }
78
+ ],
79
+ name: 'cd.ladsp.com'
80
+ }
81
+ ]
82
+ }
83
+ }
39
84
  }];
40
85
  const nativeBidRequests = [{
41
86
  bidder: 'logicad',
@@ -77,7 +122,52 @@ describe('LogicadAdapter', function () {
77
122
  third: 'fakesharedid'
78
123
  }
79
124
  }]
80
- }]
125
+ }],
126
+ ortb2: {
127
+ device: {
128
+ sua: {
129
+ source: 2,
130
+ platform: {
131
+ brand: 'Windows',
132
+ version: ['10', '0', '0']
133
+ },
134
+ browsers: [
135
+ {
136
+ brand: 'Chromium',
137
+ version: ['112', '0', '5615', '20']
138
+ },
139
+ {
140
+ brand: 'Google Chrome',
141
+ version: ['112', '0', '5615', '20']
142
+ },
143
+ {
144
+ brand: 'Not:A-Brand',
145
+ version: ['99', '0', '0', '0']
146
+ }
147
+ ],
148
+ mobile: 0,
149
+ model: '',
150
+ bitness: '64',
151
+ architecture: 'x86'
152
+ }
153
+ },
154
+ user: {
155
+ data: [
156
+ {
157
+ ext: {
158
+ segtax: 600,
159
+ segclass: '2206021246'
160
+ },
161
+ segment: [
162
+ {
163
+ id: '1'
164
+ }
165
+ ],
166
+ name: 'cd.ladsp.com'
167
+ }
168
+ ]
169
+ }
170
+ }
81
171
  }];
82
172
  const bidderRequest = {
83
173
  refererInfo: {
@@ -184,6 +274,36 @@ describe('LogicadAdapter', function () {
184
274
  expect(data.auctionId).to.equal('18fd8b8b0bd757');
185
275
  expect(data.eids[0].source).to.equal('sharedid.org');
186
276
  expect(data.eids[0].uids[0].id).to.equal('fakesharedid');
277
+
278
+ expect(data.sua.source).to.equal(2);
279
+ expect(data.sua.platform.brand).to.equal('Windows');
280
+ expect(data.sua.platform.version[0]).to.equal('10');
281
+ expect(data.sua.platform.version[1]).to.equal('0');
282
+ expect(data.sua.platform.version[2]).to.equal('0');
283
+ expect(data.sua.browsers[0].brand).to.equal('Chromium');
284
+ expect(data.sua.browsers[0].version[0]).to.equal('112');
285
+ expect(data.sua.browsers[0].version[1]).to.equal('0');
286
+ expect(data.sua.browsers[0].version[2]).to.equal('5615');
287
+ expect(data.sua.browsers[0].version[3]).to.equal('20');
288
+ expect(data.sua.browsers[1].brand).to.equal('Google Chrome');
289
+ expect(data.sua.browsers[1].version[0]).to.equal('112');
290
+ expect(data.sua.browsers[1].version[1]).to.equal('0');
291
+ expect(data.sua.browsers[1].version[2]).to.equal('5615');
292
+ expect(data.sua.browsers[1].version[3]).to.equal('20');
293
+ expect(data.sua.browsers[2].brand).to.equal('Not:A-Brand');
294
+ expect(data.sua.browsers[2].version[0]).to.equal('99');
295
+ expect(data.sua.browsers[2].version[1]).to.equal('0');
296
+ expect(data.sua.browsers[2].version[2]).to.equal('0');
297
+ expect(data.sua.browsers[2].version[3]).to.equal('0');
298
+ expect(data.sua.mobile).to.equal(0);
299
+ expect(data.sua.model).to.equal('');
300
+ expect(data.sua.bitness).to.equal('64');
301
+ expect(data.sua.architecture).to.equal('x86');
302
+
303
+ expect(data.userData[0].name).to.equal('cd.ladsp.com');
304
+ expect(data.userData[0].segment[0].id).to.equal('1');
305
+ expect(data.userData[0].ext.segtax).to.equal(600);
306
+ expect(data.userData[0].ext.segclass).to.equal('2206021246');
187
307
  });
188
308
  });
189
309
 
@@ -98,6 +98,7 @@ describe('MediaSquare bid adapter tests', function () {
98
98
  'code': 'test/publishername_atf_desktop_rg_pave',
99
99
  'bid_id': 'aaaa1234',
100
100
  'adomain': ['test.com'],
101
+ 'context': 'instream',
101
102
  }],
102
103
  }};
103
104
 
@@ -161,7 +162,10 @@ describe('MediaSquare bid adapter tests', function () {
161
162
  expect(bid.ttl).to.equal(300);
162
163
  expect(bid.requestId).to.equal('aaaa1234');
163
164
  expect(bid.mediasquare).to.exist;
165
+ expect(bid.mediasquare.bidder).to.exist;
164
166
  expect(bid.mediasquare.bidder).to.equal('msqClassic');
167
+ expect(bid.mediasquare.context).to.exist;
168
+ expect(bid.mediasquare.context).to.equal('instream');
165
169
  expect(bid.mediasquare.code).to.equal([DEFAULT_PARAMS[0].params.owner, DEFAULT_PARAMS[0].params.code].join('/'));
166
170
  expect(bid.meta).to.exist;
167
171
  expect(bid.meta.advertiserDomains).to.exist;
@@ -29,6 +29,37 @@ describe('Richaudience adapter tests', function () {
29
29
  user: {}
30
30
  }];
31
31
 
32
+ var DEFAULT_PARAMS_NEW_SIZES_GPID = [{
33
+ adUnitCode: 'test-div',
34
+ bidId: '2c7c8e9c900244',
35
+ ortb2Imp: {
36
+ ext: {
37
+ gpid: '/19968336/header-bid-tag-1#example-2',
38
+ data: {
39
+ pbadslot: '/19968336/header-bid-tag-1#example-2'
40
+ }
41
+ }
42
+ },
43
+ mediaTypes: {
44
+ banner: {
45
+ sizes: [
46
+ [300, 250], [300, 600], [728, 90], [970, 250]]
47
+ }
48
+ },
49
+ bidder: 'richaudience',
50
+ params: {
51
+ bidfloor: 0.5,
52
+ pid: 'ADb1f40rmi',
53
+ supplyType: 'site',
54
+ keywords: 'key1=value1;key2=value2'
55
+ },
56
+ auctionId: '0cb3144c-d084-4686-b0d6-f5dbe917c563',
57
+ bidRequestsCount: 1,
58
+ bidderRequestId: '1858b7382993ca',
59
+ transactionId: '29df2112-348b-4961-8863-1b33684d95e6',
60
+ user: {}
61
+ }];
62
+
32
63
  var DEFAULT_PARAMS_VIDEO_IN = [{
33
64
  adUnitCode: 'test-div',
34
65
  bidId: '2c7c8e9c900244',
@@ -236,6 +267,7 @@ describe('Richaudience adapter tests', function () {
236
267
  expect(requestContent).to.have.property('numIframes').and.to.equal(0);
237
268
  expect(typeof requestContent.scr_rsl === 'string')
238
269
  expect(typeof requestContent.cpuc === 'number')
270
+ expect(typeof requestContent.gpid === 'string')
239
271
  expect(requestContent).to.have.property('kws').and.to.equal('key1=value1;key2=value2');
240
272
  })
241
273
 
@@ -831,6 +863,18 @@ describe('Richaudience adapter tests', function () {
831
863
  expect(requestContent).to.have.property('schain').to.deep.equal(schain);
832
864
  })
833
865
 
866
+ it('should pass gpid', function() {
867
+ const request = spec.buildRequests(DEFAULT_PARAMS_NEW_SIZES_GPID, {
868
+ gdprConsent: {
869
+ consentString: 'BOZcQl_ObPFjWAeABAESCD-AAAAjx7_______9______9uz_Ov_v_f__33e8__9v_l_7_-___u_-33d4-_1vf99yfm1-7ftr3tp_87ues2_Xur__59__3z3_NohBgA',
870
+ gdprApplies: true
871
+ },
872
+ refererInfo: {}
873
+ })
874
+ const requestContent = JSON.parse(request[0].data);
875
+ expect(requestContent).to.have.property('gpid').and.to.equal('/19968336/header-bid-tag-1#example-2');
876
+ })
877
+
834
878
  describe('userSync', function () {
835
879
  it('Verifies user syncs iframe include', function () {
836
880
  config.setConfig({
@@ -469,6 +469,15 @@ describe('#makeBidRequestsHook', function() {
469
469
  makeBidRequestsHook(testCallback, testBidderRequests);
470
470
  });
471
471
 
472
+ it('should not share the same schain object between different bid requests', (done) => {
473
+ config.setBidderConfig(goodStrictBidderConfig);
474
+ makeBidRequestsHook((requests) => {
475
+ requests[0].bids[0].schain.field = 'value';
476
+ expect(requests[1].bids[0].schain.field).to.not.exist;
477
+ done();
478
+ }, deepClone(bidderRequests))
479
+ });
480
+
472
481
  it('should reject bad strict config but allow a bad relaxed config for bidders trying to override it', function () {
473
482
  function testCallback(bidderRequests) {
474
483
  expect(bidderRequests[0].bids[0].schain).to.exist;