Skip to content

EX-2549 Address upstream comments #28

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

Merged
merged 6 commits into from
Dec 10, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion modules/beachfrontBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { VIDEO, BANNER } from '../src/mediaTypes.js';
import find from 'core-js-pure/features/array/find.js';
import includes from 'core-js-pure/features/array/includes.js';

const ADAPTER_VERSION = '1.14';
const ADAPTER_VERSION = '1.15';
const ADAPTER_NAME = 'BFIO_PREBID';
const OUTSTREAM = 'outstream';

Expand Down Expand Up @@ -387,6 +387,7 @@ function createBannerRequestData(bids, bidderRequest) {
slot: bid.adUnitCode,
id: getBannerBidParam(bid, 'appId'),
bidfloor: getBannerBidParam(bid, 'bidfloor'),
tagid: getBannerBidParam(bid, 'tagid'),
sizes: getBannerSizes(bid)
};
});
Expand Down
2 changes: 1 addition & 1 deletion modules/jixieBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import { Renderer } from '../src/Renderer.js';
export const storage = getStorageManager();

const BIDDER_CODE = 'jixie';
const EVENTS_URL = 'https://jxhbtrackers.azurewebsites.net/sync/evt?';
const EVENTS_URL = 'https://hbtra.jixie.io/sync/hb?';
Copy link

Choose a reason for hiding this comment

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

Where did this come from?

Copy link
Author

Choose a reason for hiding this comment

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

upstream origin 🤷‍♂️

const JX_OUTSTREAM_RENDERER_URL = 'https://scripts.jixie.io/jxhboutstream.js';
const REQUESTS_URL = 'https://hb.jixie.io/v2/hbpost';
const sidTTLMins_ = 30;
Expand Down
2 changes: 1 addition & 1 deletion modules/sovrnBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ export const spec = {

if (segmentsString) {
imp.ext = {
deals: segmentsString.split(',')
deals: segmentsString.split(',').map(deal => deal.trim())
}
}

Expand Down
31 changes: 28 additions & 3 deletions modules/tripleliftBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,9 @@ function _buildPostBody(bidRequests) {
} else if (bidRequest.mediaTypes.banner) {
imp.banner = { format: _sizes(bidRequest.sizes) };
};
if (!utils.isEmpty(bidRequest.fpd)) {
imp.fpd = _getAdUnitFpd(bidRequest.fpd);
}
return imp;
});

Expand Down Expand Up @@ -183,12 +186,34 @@ function _getFloor (bid) {
}

function _getGlobalFpd() {
let fpd = {};
const fpd = {};
const context = {}
const user = {};

const fpdContext = Object.assign({}, config.getConfig('fpd.context'));
const fpdUser = Object.assign({}, config.getConfig('fpd.user'));

_addEntries(fpd, fpdContext);
_addEntries(fpd, fpdUser);
_addEntries(context, fpdContext);
_addEntries(user, fpdUser);

if (!utils.isEmpty(context)) {
fpd.context = context;
}
if (!utils.isEmpty(user)) {
fpd.user = user;
}
return fpd;
}

function _getAdUnitFpd(adUnitFpd) {
const fpd = {};
const context = {};

_addEntries(context, adUnitFpd.context);

if (!utils.isEmpty(context)) {
fpd.context = context;
}

return fpd;
}
Expand Down
4 changes: 2 additions & 2 deletions modules/userId/eids.js
Original file line number Diff line number Diff line change
Expand Up @@ -158,8 +158,8 @@ const USER_IDS_CONFIG = {
atype: 1
},

// Verizon Media
'vmuid': {
// Verizon Media ConnectID
'connectid': {
source: 'verizonmedia.com',
atype: 1
},
Expand Down
11 changes: 6 additions & 5 deletions modules/verizonMediaIdSystem.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import * as utils from '../src/utils.js';
const MODULE_NAME = 'verizonMediaId';
const VENDOR_ID = 25;
const PLACEHOLDER = '__PIXEL_ID__';
const VMUID_ENDPOINT = `https://ups.analytics.yahoo.com/ups/${PLACEHOLDER}/fed`;
const VMCID_ENDPOINT = `https://ups.analytics.yahoo.com/ups/${PLACEHOLDER}/fed`;

function isEUConsentRequired(consentData) {
return !!(consentData && consentData.gdpr && consentData.gdpr.gdprApplies);
Expand All @@ -33,13 +33,14 @@ export const verizonMediaIdSubmodule = {
/**
* decode the stored id value for passing to bid requests
* @function
* @returns {{vmuid: string} | undefined}
* @returns {{connectid: string} | undefined}
*/
decode(value) {
return (value && typeof value.vmuid === 'string') ? {vmuid: value.vmuid} : undefined;
return (typeof value === 'object' && (value.connectid || value.vmuid))
? {connectid: value.connectid || value.vmuid} : undefined;
},
/**
* get the VerizonMedia Id
* Gets the Verizon Media Connect ID
* @function
* @param {SubmoduleConfig} [config]
* @param {ConsentData} [consentData]
Expand Down Expand Up @@ -83,7 +84,7 @@ export const verizonMediaIdSubmodule = {
callback();
}
};
const endpoint = VMUID_ENDPOINT.replace(PLACEHOLDER, params.pixelId);
const endpoint = VMCID_ENDPOINT.replace(PLACEHOLDER, params.pixelId);
let url = `${params.endpoint || endpoint}?${utils.formatQS(data)}`;
verizonMediaIdSubmodule.getAjaxFn()(url, callbacks, null, {method: 'GET', withCredentials: true});
};
Expand Down
4 changes: 2 additions & 2 deletions modules/verizonMediaSystemId.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ pbjs.setConfig({
userIds: [{
name: 'verizonMediaId',
storage: {
name: 'vmuid',
name: 'vmcid',
type: 'html5',
expires: 30
expires: 15
},
params: {
pixelId: 58776,
Expand Down
2 changes: 1 addition & 1 deletion test/spec/modules/aolBidAdapter_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ describe('AolAdapter', function () {

const USER_ID_DATA = {
criteoId: SUPPORTED_USER_ID_SOURCES['criteo.com'],
vmuid: SUPPORTED_USER_ID_SOURCES['verizonmedia.com'],
connectid: SUPPORTED_USER_ID_SOURCES['verizonmedia.com'],
idl_env: SUPPORTED_USER_ID_SOURCES['liveramp.com'],
lipb: {
lipbid: SUPPORTED_USER_ID_SOURCES['liveintent.com'],
Expand Down
2 changes: 2 additions & 0 deletions test/spec/modules/beachfrontBidAdapter_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -336,6 +336,7 @@ describe('BeachfrontAdapter', function () {
const width = 300;
const height = 250;
const bidRequest = bidRequests[0];
bidRequest.params.tagid = '7cd7a7b4-ef3f-4aeb-9565-3627f255fa10';
bidRequest.mediaTypes = {
banner: {
sizes: [ width, height ]
Expand All @@ -354,6 +355,7 @@ describe('BeachfrontAdapter', function () {
slot: bidRequest.adUnitCode,
id: bidRequest.params.appId,
bidfloor: bidRequest.params.bidfloor,
tagid: bidRequest.params.tagid,
sizes: [{ w: width, h: height }]
}
]);
Expand Down
4 changes: 2 additions & 2 deletions test/spec/modules/sovrnBidAdapter_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -282,11 +282,11 @@ describe('sovrnBidAdapter', function() {
expect(payload.imp[0].ext).to.be.undefined
})

it('should pass segments param as dealids array', function() {
it('should pass the segments param value as trimmed deal ids array', function() {
const segmentsRequests = [{
'bidder': 'sovrn',
'params': {
'segments': 'test1,test2'
'segments': ' test1,test2 '
},
'adUnitCode': 'adunit-code',
'sizes': [
Expand Down
31 changes: 24 additions & 7 deletions test/spec/modules/tripleliftBidAdapter_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,14 @@ describe('triplelift adapter', function () {
auctionId: '1d1a030790a475',
userId: {},
schain,
fpd: {
context: {
pbAdSlot: 'homepage-top-rect',
data: {
adUnitSpecificAttribute: 123
}
}
}
},
{
bidder: 'triplelift',
Expand Down Expand Up @@ -597,17 +605,19 @@ describe('triplelift adapter', function () {
const request = tripleliftAdapterSpec.buildRequests(bidRequests, bidderRequest);
expect(request.data.imp[0].floor).to.equal(1.99);
});
it('should send fpd on root level ext if kvps are available', function() {
it('should send global config fpd if kvps are available', function() {
const sens = null;
const category = ['news', 'weather', 'hurricane'];
const pmp_elig = 'true';
const fpd = {
context: {
pmp_elig,
category,
pmp_elig: pmp_elig,
data: {
category: category
}
},
user: {
sens,
sens: sens,
}
}
sandbox.stub(config, 'getConfig').callsFake(key => {
Expand All @@ -618,9 +628,16 @@ describe('triplelift adapter', function () {
});
const request = tripleliftAdapterSpec.buildRequests(bidRequests, bidderRequest);
const { data: payload } = request;
expect(payload.ext.fpd).to.not.haveOwnProperty('sens');
expect(payload.ext.fpd).to.haveOwnProperty('category');
expect(payload.ext.fpd).to.haveOwnProperty('pmp_elig');
expect(payload.ext.fpd.user).to.not.exist;
expect(payload.ext.fpd.context.data).to.haveOwnProperty('category');
expect(payload.ext.fpd.context).to.haveOwnProperty('pmp_elig');
});
it('should send ad unit fpd if kvps are available', function() {
const request = tripleliftAdapterSpec.buildRequests(bidRequests, bidderRequest);
expect(request.data.imp[0].fpd.context).to.haveOwnProperty('pbAdSlot');
expect(request.data.imp[0].fpd.context).to.haveOwnProperty('data');
expect(request.data.imp[0].fpd.context.data).to.haveOwnProperty('adUnitSpecificAttribute');
expect(request.data.imp[1].fpd).to.not.exist;
});
});

Expand Down
34 changes: 28 additions & 6 deletions test/spec/modules/verizonMediaIdSystem_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -165,12 +165,34 @@ describe('Verizon Media ID Submodule', () => {
});

describe('decode()', () => {
const VALID_API_RESPONSE = {
vmuid: '1234'
};
it('should return a newly constructed object with the vmuid property', () => {
expect(verizonMediaIdSubmodule.decode(VALID_API_RESPONSE)).to.deep.equal(VALID_API_RESPONSE);
expect(verizonMediaIdSubmodule.decode(VALID_API_RESPONSE)).to.not.equal(VALID_API_RESPONSE);
const VALID_API_RESPONSES = [{
key: 'vmiud',
expected: '1234',
payload: {
vmuid: '1234'
}
},
{
key: 'connectid',
expected: '4567',
payload: {
connectid: '4567'
}
},
{
key: 'both',
expected: '4567',
payload: {
vmuid: '1234',
connectid: '4567'
}
}];
VALID_API_RESPONSES.forEach(responseData => {
it('should return a newly constructed object with the connectid for a payload with ${responseData.key} key(s)', () => {
expect(verizonMediaIdSubmodule.decode(responseData.payload)).to.deep.equal(
{connectid: responseData.expected}
);
});
});

[{}, '', {foo: 'bar'}].forEach((response) => {
Expand Down