From c0c7baf9f917a1031379aca6aea79a8dd0fb50dd Mon Sep 17 00:00:00 2001 From: dumitrubarbos Date: Thu, 15 Dec 2022 11:22:05 +0200 Subject: [PATCH 1/5] GPP support for the yahoospp bidder and legacy aol bidder. --- modules/aolBidAdapter.js | 11 +++ modules/yahoosspBidAdapter.js | 96 +++++++++++--------- test/spec/modules/aolBidAdapter_spec.js | 27 ++++++ test/spec/modules/yahoosspBidAdapter_spec.js | 28 +++++- 4 files changed, 117 insertions(+), 45 deletions(-) diff --git a/modules/aolBidAdapter.js b/modules/aolBidAdapter.js index d38c373ff1f..9e4b717b1f9 100644 --- a/modules/aolBidAdapter.js +++ b/modules/aolBidAdapter.js @@ -159,6 +159,7 @@ export const spec = { if (bidderRequest) { consentData.gdpr = bidderRequest.gdprConsent; consentData.uspConsent = bidderRequest.uspConsent; + consentData.gppConsent = bidderRequest.gppConsent; } return bids.map(bid => { @@ -334,6 +335,11 @@ export const spec = { deepSetValue(openRtbObject, 'regs.ext.us_privacy', consentData.uspConsent); } + if (consentData.gppConsent && consentData.gppConsent.gppString) { + deepSetValue(openRtbObject, 'regs.ext.gpp', consentData.gppConsent.gppString); + deepSetValue(openRtbObject, 'regs.ext.gpp_sid', consentData.gppConsent.applicableSections); + } + if (typeof bid.userId === 'object') { openRtbObject.user = openRtbObject.user || {}; openRtbObject.user.ext = openRtbObject.user.ext || {}; @@ -373,6 +379,11 @@ export const spec = { params.us_privacy = consentData.uspConsent; } + if (consentData.gppConsent && consentData.gppConsent.gppString) { + params.gpp = consentData.gppConsent.gppString; + params.gpp_sid = consentData.gppConsent.applicableSections; + } + return params; }, parsePixelItems(pixels) { diff --git a/modules/yahoosspBidAdapter.js b/modules/yahoosspBidAdapter.js index 8f9ede4fccc..91af3f5c231 100644 --- a/modules/yahoosspBidAdapter.js +++ b/modules/yahoosspBidAdapter.js @@ -112,7 +112,7 @@ function getSupportedEids(bid) { function isSecure(bid) { return deepAccess(bid, 'params.bidOverride.imp.secure') || (document.location.protocol === 'https:') ? 1 : 0; -}; +} function getPubIdMode(bid) { let pubIdMode; @@ -120,9 +120,9 @@ function getPubIdMode(bid) { pubIdMode = true; } else if (deepAccess(bid, 'params.dcn') && deepAccess(bid, 'params.pos')) { pubIdMode = false; - }; + } return pubIdMode; -}; +} function getAdapterMode() { let adapterMode = config.getConfig('yahoossp.mode'); @@ -134,7 +134,7 @@ function getAdapterMode() { } else if (adapterMode === 'all') { return '*'; } -}; +} function getResponseFormat(bid) { const adm = bid.adm; @@ -143,7 +143,7 @@ function getResponseFormat(bid) { } else if (adm.indexOf('VAST') !== -1) { return VIDEO; } -}; +} function getFloorModuleData(bid) { const adapterMode = getAdapterMode(); @@ -153,7 +153,7 @@ function getFloorModuleData(bid) { size: '*' }; return (isFn(bid.getFloor)) ? bid.getFloor(getFloorRequestObject) : false; -}; +} function filterBidRequestByMode(validBidRequests) { const mediaTypesMode = getAdapterMode(); @@ -170,9 +170,9 @@ function filterBidRequestByMode(validBidRequests) { result = validBidRequests.filter(bid => { return Object.keys(bid.mediaTypes).some(item => item === BANNER || item === VIDEO); }); - }; + } return result; -}; +} function validateAppendObject(validationType, allowedKeys, inputObject, appendToObject) { const outputObject = { @@ -184,46 +184,46 @@ function validateAppendObject(validationType, allowedKeys, inputObject, appendTo case 'string': if (allowedKeys.indexOf(objectKey) !== -1 && isStr(inputObject[objectKey])) { outputObject[objectKey] = inputObject[objectKey]; - }; + } break; case 'number': if (allowedKeys.indexOf(objectKey) !== -1 && isNumber(inputObject[objectKey])) { outputObject[objectKey] = inputObject[objectKey]; - }; + } break; case 'array': if (allowedKeys.indexOf(objectKey) !== -1 && isArray(inputObject[objectKey])) { outputObject[objectKey] = inputObject[objectKey]; - }; + } break; case 'object': if (allowedKeys.indexOf(objectKey) !== -1 && isPlainObject(inputObject[objectKey])) { outputObject[objectKey] = inputObject[objectKey]; - }; + } break; case 'objectAllKeys': if (isPlainObject(inputObject)) { outputObject[objectKey] = inputObject[objectKey]; - }; + } break; - }; - }; + } + } return outputObject; -}; +} function getTtl(bidderRequest) { const globalTTL = config.getConfig('yahoossp.ttl'); return globalTTL ? validateTTL(globalTTL) : validateTTL(deepAccess(bidderRequest, 'params.ttl')); -}; +} function validateTTL(ttl) { return (isNumber(ttl) && ttl > 0 && ttl < 3600) ? ttl : DEFAULT_BID_TTL -}; +} function isNotEmptyStr(value) { return (isStr(value) && value.length > 0); -}; +} function generateOpenRtbObject(bidderRequest, bid) { if (bidderRequest) { @@ -277,21 +277,29 @@ function generateOpenRtbObject(bidderRequest, bid) { } } else { outBoundBidRequest.site.id = bid.params.dcn; - }; + } + + if (bidderRequest.gppConsent) { + outBoundBidRequest.regs.ext.gpp = bidderRequest.gppConsent.gppString; + outBoundBidRequest.regs.ext.gpp_sid = bidderRequest.gppConsent.applicableSections; + } else if (bidderRequest.ortb2?.regs?.gpp) { + outBoundBidRequest.regs.ext.gpp = bidderRequest.ortb2.regs.gpp; + outBoundBidRequest.regs.ext.gpp_sid = bidderRequest.ortb2.regs.gpp_sid + } if (bidderRequest.ortb2) { outBoundBidRequest = appendFirstPartyData(outBoundBidRequest, bid); - }; + } const schainData = deepAccess(bid, 'schain.nodes'); if (isArray(schainData) && schainData.length > 0) { outBoundBidRequest.source.ext.schain = bid.schain; outBoundBidRequest.source.ext.schain.nodes[0].rid = outBoundBidRequest.id; - }; + } return outBoundBidRequest; - }; -}; + } +} function appendImpObject(bid, openRtbObject) { const mediaTypeMode = getAdapterMode(); @@ -310,8 +318,8 @@ function appendImpObject(bid, openRtbObject) { }; if (bid.mediaTypes.banner.pos) { impObject.banner.pos = bid.mediaTypes.banner.pos; - }; - }; + } + } if (bid.mediaTypes.video && (mediaTypeMode === VIDEO || mediaTypeMode === '*')) { const playerSize = transformSizes(bid.mediaTypes.video.playerSize); @@ -350,26 +358,26 @@ function appendImpObject(bid, openRtbObject) { } } } - }; + } if (deepAccess(bid, 'ortb2Imp.ext.data') && isPlainObject(bid.ortb2Imp.ext.data)) { impObject.ext.data = bid.ortb2Imp.ext.data; - }; + } if (deepAccess(bid, 'ortb2Imp.instl') && isNumber(bid.ortb2Imp.instl) && (bid.ortb2Imp.instl === 1)) { impObject.instl = bid.ortb2Imp.instl; - }; + } if (getPubIdMode(bid) === false) { impObject.tagid = bid.params.pos; impObject.ext.pos = bid.params.pos; } else if (deepAccess(bid, 'params.placementId')) { impObject.tagid = bid.params.placementId - }; + } openRtbObject.imp.push(impObject); - }; -}; + } +} function appendFirstPartyData(outBoundBidRequest, bid) { const ortb2Object = bid.ortb2; @@ -387,7 +395,7 @@ function appendFirstPartyData(outBoundBidRequest, bid) { outBoundBidRequest.site = validateAppendObject('string', allowedSiteStringKeys, siteObject, outBoundBidRequest.site); outBoundBidRequest.site = validateAppendObject('array', allowedSiteArrayKeys, siteObject, outBoundBidRequest.site); outBoundBidRequest.site = validateAppendObject('object', allowedSiteObjectKeys, siteObject, outBoundBidRequest.site); - }; + } if (siteContentObject && isPlainObject(siteContentObject)) { const allowedContentStringKeys = ['id', 'title', 'series', 'season', 'genre', 'contentrating', 'language']; @@ -411,8 +419,8 @@ function appendFirstPartyData(outBoundBidRequest, bid) { outBoundBidRequest.site.content.data = []; outBoundBidRequest.site.content.data.push(newDataObject); }); - }; - }; + } + } if (appContentObject && isPlainObject(appContentObject)) { if (appContentDataArray && isArray(appContentDataArray)) { @@ -431,8 +439,8 @@ function appendFirstPartyData(outBoundBidRequest, bid) { }; outBoundBidRequest.app.content.data.push(newDataObject); }); - }; - }; + } + } if (userObject && isPlainObject(userObject)) { const allowedUserStrings = ['id', 'buyeruid', 'gender', 'keywords', 'customdata']; @@ -443,10 +451,10 @@ function appendFirstPartyData(outBoundBidRequest, bid) { outBoundBidRequest.user = validateAppendObject('number', allowedUserNumbers, userObject, outBoundBidRequest.user); outBoundBidRequest.user = validateAppendObject('array', allowedUserArrays, userObject, outBoundBidRequest.user); outBoundBidRequest.user.ext = validateAppendObject('object', allowedUserObjects, userObject, outBoundBidRequest.user.ext); - }; + } return outBoundBidRequest; -}; +} function generateServerRequest({payload, requestOptions, bidderRequest}) { const pubIdMode = getPubIdMode(bidderRequest); @@ -454,7 +462,7 @@ function generateServerRequest({payload, requestOptions, bidderRequest}) { if (pubIdMode === true) { sspEndpoint = config.getConfig('yahoossp.endpoint') || SSP_ENDPOINT_PUBID; - }; + } if (deepAccess(bidderRequest, 'params.testing.e2etest') === true) { logInfo('yahoossp adapter e2etest mode is active'); @@ -477,7 +485,7 @@ function generateServerRequest({payload, requestOptions, bidderRequest}) { } }); } - }; + } return { url: sspEndpoint, @@ -486,7 +494,7 @@ function generateServerRequest({payload, requestOptions, bidderRequest}) { options: requestOptions, bidderRequest: bidderRequest }; -}; +} function createRenderer(bidderRequest, bidResponse) { const renderer = Renderer.install({ @@ -534,7 +542,7 @@ export const spec = { if (isEmpty(validBidRequests) || isEmpty(bidderRequest)) { logWarn('yahoossp Adapter: buildRequests called with either empty "validBidRequests" or "bidderRequest"'); return undefined; - }; + } const requestOptions = { contentType: 'application/json', @@ -610,7 +618,7 @@ export const spec = { if (bid.nurl) { bidResponse.vastUrl = bid.nurl; - }; + } } if (deepAccess(bidderRequest, 'mediaTypes.video.context') === 'outstream' && !bidderRequest.renderer) { diff --git a/test/spec/modules/aolBidAdapter_spec.js b/test/spec/modules/aolBidAdapter_spec.js index 57ce37145f4..a627cb510fd 100644 --- a/test/spec/modules/aolBidAdapter_spec.js +++ b/test/spec/modules/aolBidAdapter_spec.js @@ -645,6 +645,25 @@ describe('AolAdapter', function () { }); }); + it('returns the basic bid info with gpp data when gpp consent data is included', () => { + let consentData = { + gppConsent: { + gppString: 'gppconsent', + applicableSections: [6], + } + }; + expect(spec.buildOpenRtbRequestData(bid, consentData)).to.deep.equal({ + id: 'bid-id', + imp: [], + regs: { + ext: { + gpp: 'gppconsent', + gpp_sid: [6] + } + } + }); + }); + it('returns the bid object with eid array populated with PB set eids', () => { let userIdBid = Object.assign({ userId: {} @@ -794,6 +813,14 @@ describe('AolAdapter', function () { 'euconsent=test-consent;gdpr=1;us_privacy=test-usp-consent;'); }); + it('should return formatted gpp privacy params when formatConsentData returns GPP data', function () { + formatConsentDataStub.returns({ + gpp: 'gppstring', + gpp_sid: [6, 7] + }); + expect(spec.formatMarketplaceDynamicParams()).to.be.equal('gpp=gppstring;gpp_sid=6%2C7;'); + }); + it('should return formatted params when formatKeyValues returns data', function () { formatKeyValuesStub.returns({ param1: 'val1', diff --git a/test/spec/modules/yahoosspBidAdapter_spec.js b/test/spec/modules/yahoosspBidAdapter_spec.js index 32bc94b73fa..37239e5b0db 100644 --- a/test/spec/modules/yahoosspBidAdapter_spec.js +++ b/test/spec/modules/yahoosspBidAdapter_spec.js @@ -3,6 +3,7 @@ import { config } from 'src/config.js'; import { BANNER, VIDEO } from 'src/mediaTypes.js'; import { spec } from 'modules/yahoosspBidAdapter.js'; import {createEidsArray} from '../../../modules/userId/eids'; +import {deepClone} from '../../../src/utils'; const DEFAULT_BID_ID = '84ab500420319d'; const DEFAULT_BID_DCN = '2093845709823475'; @@ -713,7 +714,7 @@ describe('YahooSSP Bid Adapter:', () => { }); }); - describe('GDPR & Consent:', () => { + describe('GDPR & Consent & GPP:', () => { it('should return request objects that do not send cookies if purpose 1 consent is not provided', () => { const { validBidRequests, bidderRequest } = generateBuildRequestMock({}); bidderRequest.gdprConsent = { @@ -731,6 +732,31 @@ describe('YahooSSP Bid Adapter:', () => { const options = spec.buildRequests(validBidRequests, bidderRequest)[0].options; expect(options.withCredentials).to.be.false; }); + + it('adds the ortb2 gpp consent info to the request', function () { + const { validBidRequests, bidderRequest } = generateBuildRequestMock({}); + const ortb2 = { + regs: { + gpp: 'somegppstring', + gpp_sid: [6, 7] + } + }; + let clonedBidderRequest = {...bidderRequest, ortb2}; + const data = spec.buildRequests(validBidRequests, clonedBidderRequest)[0].data; + expect(data.regs.ext.gpp).to.equal('somegppstring'); + expect(data.regs.ext.gpp_sid).to.eql([6, 7]); + }); + + it('should set the gpp consent data into the downstream request', () => { + const { validBidRequests, bidderRequest } = generateBuildRequestMock({}); + bidderRequest.gppConsent = { + gppString: 'somegppstring', + applicableSections: [6, 7] + }; + const data = spec.buildRequests(validBidRequests, bidderRequest)[0].data; + expect(data.regs.ext.gpp).to.equal('somegppstring'); + expect(data.regs.ext.gpp_sid).to.eql([6, 7]); + }); }); describe('Endpoint & Impression Request Mode:', () => { From 4ef1c829ddf1a0f440abfc236e42b53df25c4074 Mon Sep 17 00:00:00 2001 From: dumitrubarbos Date: Thu, 15 Dec 2022 19:21:12 +0200 Subject: [PATCH 2/5] GPP support for the yahoospp bidder and legacy aol bidder. --- modules/aolBidAdapter.js | 5 ----- test/spec/modules/aolBidAdapter_spec.js | 19 ------------------- 2 files changed, 24 deletions(-) diff --git a/modules/aolBidAdapter.js b/modules/aolBidAdapter.js index 9e4b717b1f9..aefa6762ea7 100644 --- a/modules/aolBidAdapter.js +++ b/modules/aolBidAdapter.js @@ -335,11 +335,6 @@ export const spec = { deepSetValue(openRtbObject, 'regs.ext.us_privacy', consentData.uspConsent); } - if (consentData.gppConsent && consentData.gppConsent.gppString) { - deepSetValue(openRtbObject, 'regs.ext.gpp', consentData.gppConsent.gppString); - deepSetValue(openRtbObject, 'regs.ext.gpp_sid', consentData.gppConsent.applicableSections); - } - if (typeof bid.userId === 'object') { openRtbObject.user = openRtbObject.user || {}; openRtbObject.user.ext = openRtbObject.user.ext || {}; diff --git a/test/spec/modules/aolBidAdapter_spec.js b/test/spec/modules/aolBidAdapter_spec.js index a627cb510fd..48fc5c3cc40 100644 --- a/test/spec/modules/aolBidAdapter_spec.js +++ b/test/spec/modules/aolBidAdapter_spec.js @@ -645,25 +645,6 @@ describe('AolAdapter', function () { }); }); - it('returns the basic bid info with gpp data when gpp consent data is included', () => { - let consentData = { - gppConsent: { - gppString: 'gppconsent', - applicableSections: [6], - } - }; - expect(spec.buildOpenRtbRequestData(bid, consentData)).to.deep.equal({ - id: 'bid-id', - imp: [], - regs: { - ext: { - gpp: 'gppconsent', - gpp_sid: [6] - } - } - }); - }); - it('returns the bid object with eid array populated with PB set eids', () => { let userIdBid = Object.assign({ userId: {} From 1b42c9a6692fa68716b216dfd2f4d15da9fd7c7a Mon Sep 17 00:00:00 2001 From: dumitrubarbos Date: Tue, 20 Dec 2022 15:56:29 +0200 Subject: [PATCH 3/5] GPP support for the yahoo connect id module - review comments. --- modules/yahoosspBidAdapter.js | 90 +++++++++++++++++------------------ 1 file changed, 45 insertions(+), 45 deletions(-) diff --git a/modules/yahoosspBidAdapter.js b/modules/yahoosspBidAdapter.js index 91af3f5c231..25b1452bef7 100644 --- a/modules/yahoosspBidAdapter.js +++ b/modules/yahoosspBidAdapter.js @@ -112,7 +112,7 @@ function getSupportedEids(bid) { function isSecure(bid) { return deepAccess(bid, 'params.bidOverride.imp.secure') || (document.location.protocol === 'https:') ? 1 : 0; -} +}; function getPubIdMode(bid) { let pubIdMode; @@ -120,9 +120,9 @@ function getPubIdMode(bid) { pubIdMode = true; } else if (deepAccess(bid, 'params.dcn') && deepAccess(bid, 'params.pos')) { pubIdMode = false; - } + }; return pubIdMode; -} +}; function getAdapterMode() { let adapterMode = config.getConfig('yahoossp.mode'); @@ -134,7 +134,7 @@ function getAdapterMode() { } else if (adapterMode === 'all') { return '*'; } -} +}; function getResponseFormat(bid) { const adm = bid.adm; @@ -143,7 +143,7 @@ function getResponseFormat(bid) { } else if (adm.indexOf('VAST') !== -1) { return VIDEO; } -} +}; function getFloorModuleData(bid) { const adapterMode = getAdapterMode(); @@ -153,7 +153,7 @@ function getFloorModuleData(bid) { size: '*' }; return (isFn(bid.getFloor)) ? bid.getFloor(getFloorRequestObject) : false; -} +}; function filterBidRequestByMode(validBidRequests) { const mediaTypesMode = getAdapterMode(); @@ -170,9 +170,9 @@ function filterBidRequestByMode(validBidRequests) { result = validBidRequests.filter(bid => { return Object.keys(bid.mediaTypes).some(item => item === BANNER || item === VIDEO); }); - } + }; return result; -} +}; function validateAppendObject(validationType, allowedKeys, inputObject, appendToObject) { const outputObject = { @@ -184,46 +184,46 @@ function validateAppendObject(validationType, allowedKeys, inputObject, appendTo case 'string': if (allowedKeys.indexOf(objectKey) !== -1 && isStr(inputObject[objectKey])) { outputObject[objectKey] = inputObject[objectKey]; - } + }; break; case 'number': if (allowedKeys.indexOf(objectKey) !== -1 && isNumber(inputObject[objectKey])) { outputObject[objectKey] = inputObject[objectKey]; - } + }; break; case 'array': if (allowedKeys.indexOf(objectKey) !== -1 && isArray(inputObject[objectKey])) { outputObject[objectKey] = inputObject[objectKey]; - } + }; break; case 'object': if (allowedKeys.indexOf(objectKey) !== -1 && isPlainObject(inputObject[objectKey])) { outputObject[objectKey] = inputObject[objectKey]; - } + }; break; case 'objectAllKeys': if (isPlainObject(inputObject)) { outputObject[objectKey] = inputObject[objectKey]; - } + }; break; - } - } + }; + }; return outputObject; -} +}; function getTtl(bidderRequest) { const globalTTL = config.getConfig('yahoossp.ttl'); return globalTTL ? validateTTL(globalTTL) : validateTTL(deepAccess(bidderRequest, 'params.ttl')); -} +}; function validateTTL(ttl) { return (isNumber(ttl) && ttl > 0 && ttl < 3600) ? ttl : DEFAULT_BID_TTL -} +}; function isNotEmptyStr(value) { return (isStr(value) && value.length > 0); -} +}; function generateOpenRtbObject(bidderRequest, bid) { if (bidderRequest) { @@ -277,7 +277,7 @@ function generateOpenRtbObject(bidderRequest, bid) { } } else { outBoundBidRequest.site.id = bid.params.dcn; - } + }; if (bidderRequest.gppConsent) { outBoundBidRequest.regs.ext.gpp = bidderRequest.gppConsent.gppString; @@ -285,21 +285,21 @@ function generateOpenRtbObject(bidderRequest, bid) { } else if (bidderRequest.ortb2?.regs?.gpp) { outBoundBidRequest.regs.ext.gpp = bidderRequest.ortb2.regs.gpp; outBoundBidRequest.regs.ext.gpp_sid = bidderRequest.ortb2.regs.gpp_sid - } + }; if (bidderRequest.ortb2) { outBoundBidRequest = appendFirstPartyData(outBoundBidRequest, bid); - } + }; const schainData = deepAccess(bid, 'schain.nodes'); if (isArray(schainData) && schainData.length > 0) { outBoundBidRequest.source.ext.schain = bid.schain; outBoundBidRequest.source.ext.schain.nodes[0].rid = outBoundBidRequest.id; - } + }; return outBoundBidRequest; - } -} + }; +}; function appendImpObject(bid, openRtbObject) { const mediaTypeMode = getAdapterMode(); @@ -318,8 +318,8 @@ function appendImpObject(bid, openRtbObject) { }; if (bid.mediaTypes.banner.pos) { impObject.banner.pos = bid.mediaTypes.banner.pos; - } - } + }; + }; if (bid.mediaTypes.video && (mediaTypeMode === VIDEO || mediaTypeMode === '*')) { const playerSize = transformSizes(bid.mediaTypes.video.playerSize); @@ -358,26 +358,26 @@ function appendImpObject(bid, openRtbObject) { } } } - } + }; if (deepAccess(bid, 'ortb2Imp.ext.data') && isPlainObject(bid.ortb2Imp.ext.data)) { impObject.ext.data = bid.ortb2Imp.ext.data; - } + }; if (deepAccess(bid, 'ortb2Imp.instl') && isNumber(bid.ortb2Imp.instl) && (bid.ortb2Imp.instl === 1)) { impObject.instl = bid.ortb2Imp.instl; - } + }; if (getPubIdMode(bid) === false) { impObject.tagid = bid.params.pos; impObject.ext.pos = bid.params.pos; } else if (deepAccess(bid, 'params.placementId')) { impObject.tagid = bid.params.placementId - } + }; openRtbObject.imp.push(impObject); - } -} + }; +}; function appendFirstPartyData(outBoundBidRequest, bid) { const ortb2Object = bid.ortb2; @@ -395,7 +395,7 @@ function appendFirstPartyData(outBoundBidRequest, bid) { outBoundBidRequest.site = validateAppendObject('string', allowedSiteStringKeys, siteObject, outBoundBidRequest.site); outBoundBidRequest.site = validateAppendObject('array', allowedSiteArrayKeys, siteObject, outBoundBidRequest.site); outBoundBidRequest.site = validateAppendObject('object', allowedSiteObjectKeys, siteObject, outBoundBidRequest.site); - } + }; if (siteContentObject && isPlainObject(siteContentObject)) { const allowedContentStringKeys = ['id', 'title', 'series', 'season', 'genre', 'contentrating', 'language']; @@ -419,8 +419,8 @@ function appendFirstPartyData(outBoundBidRequest, bid) { outBoundBidRequest.site.content.data = []; outBoundBidRequest.site.content.data.push(newDataObject); }); - } - } + }; + }; if (appContentObject && isPlainObject(appContentObject)) { if (appContentDataArray && isArray(appContentDataArray)) { @@ -439,8 +439,8 @@ function appendFirstPartyData(outBoundBidRequest, bid) { }; outBoundBidRequest.app.content.data.push(newDataObject); }); - } - } + }; + }; if (userObject && isPlainObject(userObject)) { const allowedUserStrings = ['id', 'buyeruid', 'gender', 'keywords', 'customdata']; @@ -451,10 +451,10 @@ function appendFirstPartyData(outBoundBidRequest, bid) { outBoundBidRequest.user = validateAppendObject('number', allowedUserNumbers, userObject, outBoundBidRequest.user); outBoundBidRequest.user = validateAppendObject('array', allowedUserArrays, userObject, outBoundBidRequest.user); outBoundBidRequest.user.ext = validateAppendObject('object', allowedUserObjects, userObject, outBoundBidRequest.user.ext); - } + }; return outBoundBidRequest; -} +}; function generateServerRequest({payload, requestOptions, bidderRequest}) { const pubIdMode = getPubIdMode(bidderRequest); @@ -462,7 +462,7 @@ function generateServerRequest({payload, requestOptions, bidderRequest}) { if (pubIdMode === true) { sspEndpoint = config.getConfig('yahoossp.endpoint') || SSP_ENDPOINT_PUBID; - } + }; if (deepAccess(bidderRequest, 'params.testing.e2etest') === true) { logInfo('yahoossp adapter e2etest mode is active'); @@ -485,7 +485,7 @@ function generateServerRequest({payload, requestOptions, bidderRequest}) { } }); } - } + }; return { url: sspEndpoint, @@ -494,7 +494,7 @@ function generateServerRequest({payload, requestOptions, bidderRequest}) { options: requestOptions, bidderRequest: bidderRequest }; -} +}; function createRenderer(bidderRequest, bidResponse) { const renderer = Renderer.install({ @@ -542,7 +542,7 @@ export const spec = { if (isEmpty(validBidRequests) || isEmpty(bidderRequest)) { logWarn('yahoossp Adapter: buildRequests called with either empty "validBidRequests" or "bidderRequest"'); return undefined; - } + }; const requestOptions = { contentType: 'application/json', @@ -618,7 +618,7 @@ export const spec = { if (bid.nurl) { bidResponse.vastUrl = bid.nurl; - } + }; } if (deepAccess(bidderRequest, 'mediaTypes.video.context') === 'outstream' && !bidderRequest.renderer) { From d66fccf19ddbd1a457bf3becff28da87f5cd3087 Mon Sep 17 00:00:00 2001 From: dumitrubarbos Date: Thu, 22 Dec 2022 19:59:12 +0200 Subject: [PATCH 4/5] GPP support for the yahoo connect id module - review comments. --- modules/aolBidAdapter.js | 6 ++++++ test/spec/modules/aolBidAdapter_spec.js | 14 ++++++++++++++ 2 files changed, 20 insertions(+) diff --git a/modules/aolBidAdapter.js b/modules/aolBidAdapter.js index aefa6762ea7..6b471ac6de2 100644 --- a/modules/aolBidAdapter.js +++ b/modules/aolBidAdapter.js @@ -160,6 +160,12 @@ export const spec = { consentData.gdpr = bidderRequest.gdprConsent; consentData.uspConsent = bidderRequest.uspConsent; consentData.gppConsent = bidderRequest.gppConsent; + if (!consentData.gppConsent && bidderRequest.ortb2?.regs?.gpp) { + consentData.gppConsent = { + gppString: bidderRequest.ortb2.regs.gpp, + applicableSections: bidderRequest.ortb2.regs.gpp_sid + } + } } return bids.map(bid => { diff --git a/test/spec/modules/aolBidAdapter_spec.js b/test/spec/modules/aolBidAdapter_spec.js index 48fc5c3cc40..471c76f55cf 100644 --- a/test/spec/modules/aolBidAdapter_spec.js +++ b/test/spec/modules/aolBidAdapter_spec.js @@ -488,6 +488,20 @@ describe('AolAdapter', function () { expect(request.url).to.contain(NEXAGE_URL + 'dcn=2c9d2b50015c5ce9db6aeeed8b9500d6&pos=header'); }); + it('should return One Mobile url with configured GPP data', function () { + let bidRequest = createCustomBidRequest({ + params: getNexageGetBidParams() + }); + bidRequest.ortb2 = { + regs: { + gpp: 'testgpp', + gpp_sid: [8] + } + } + let [request] = spec.buildRequests(bidRequest.bids, bidRequest); + expect(request.url).to.contain('gpp=testgpp&gpp_sid=8'); + }); + it('should return One Mobile url with cmd=bid option', function () { let bidRequest = createCustomBidRequest({ params: getNexageGetBidParams() From 3ceb9369ecd7a38809394c3e77c37bcd7a2bb639 Mon Sep 17 00:00:00 2001 From: dumitrubarbos Date: Fri, 23 Dec 2022 14:06:15 +0200 Subject: [PATCH 5/5] GPP support for the yahoo connect id module - review comments. --- modules/yahoosspBidAdapter.js | 5 +---- test/spec/modules/yahoosspBidAdapter_spec.js | 11 ----------- 2 files changed, 1 insertion(+), 15 deletions(-) diff --git a/modules/yahoosspBidAdapter.js b/modules/yahoosspBidAdapter.js index 25b1452bef7..9dd635a990f 100644 --- a/modules/yahoosspBidAdapter.js +++ b/modules/yahoosspBidAdapter.js @@ -279,10 +279,7 @@ function generateOpenRtbObject(bidderRequest, bid) { outBoundBidRequest.site.id = bid.params.dcn; }; - if (bidderRequest.gppConsent) { - outBoundBidRequest.regs.ext.gpp = bidderRequest.gppConsent.gppString; - outBoundBidRequest.regs.ext.gpp_sid = bidderRequest.gppConsent.applicableSections; - } else if (bidderRequest.ortb2?.regs?.gpp) { + if (bidderRequest.ortb2?.regs?.gpp) { outBoundBidRequest.regs.ext.gpp = bidderRequest.ortb2.regs.gpp; outBoundBidRequest.regs.ext.gpp_sid = bidderRequest.ortb2.regs.gpp_sid }; diff --git a/test/spec/modules/yahoosspBidAdapter_spec.js b/test/spec/modules/yahoosspBidAdapter_spec.js index 37239e5b0db..01583ac30dc 100644 --- a/test/spec/modules/yahoosspBidAdapter_spec.js +++ b/test/spec/modules/yahoosspBidAdapter_spec.js @@ -746,17 +746,6 @@ describe('YahooSSP Bid Adapter:', () => { expect(data.regs.ext.gpp).to.equal('somegppstring'); expect(data.regs.ext.gpp_sid).to.eql([6, 7]); }); - - it('should set the gpp consent data into the downstream request', () => { - const { validBidRequests, bidderRequest } = generateBuildRequestMock({}); - bidderRequest.gppConsent = { - gppString: 'somegppstring', - applicableSections: [6, 7] - }; - const data = spec.buildRequests(validBidRequests, bidderRequest)[0].data; - expect(data.regs.ext.gpp).to.equal('somegppstring'); - expect(data.regs.ext.gpp_sid).to.eql([6, 7]); - }); }); describe('Endpoint & Impression Request Mode:', () => {