Skip to content

Commit

Permalink
Merge pull request #354 from PubMatic-OpenWrap/revert-352-OpenIdentity
Browse files Browse the repository at this point in the history
Revert "Open identity"
  • Loading branch information
pm-shashank-jain authored Oct 11, 2019
2 parents 464ba3b + 78f22b9 commit fed46df
Show file tree
Hide file tree
Showing 11 changed files with 21 additions and 124 deletions.
2 changes: 1 addition & 1 deletion modules.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
["pubmaticBidAdapter","appnexusBidAdapter","userId","pubCommonId","identityLinkIdSystem","digiTrustIdSystem","id5IdSystem","customIdSystem","unifiedIdSystem"]
["appnexusBidAdapter","consentManagement","sekindoUMBidAdapter","pulsepointBidAdapter","audienceNetworkBidAdapter","openxBidAdapter","rubiconBidAdapter","sovrnBidAdapter","pubmaticBidAdapter","adgenerationBidAdapter","pubmaticServerBidAdapter","ixBidAdapter","criteoBidAdapter","userId"]
3 changes: 1 addition & 2 deletions modules/.submodules.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@
"userId": [
"digiTrustIdSystem",
"id5IdSystem",
"criteortusIdSystem",
"customIdSystem"
"criteortusIdSystem"
],
"adpod": [
"freeWheelAdserverVideo",
Expand Down
67 changes: 0 additions & 67 deletions modules/customIdSystem.js

This file was deleted.

8 changes: 1 addition & 7 deletions modules/id5IdSystem.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,7 @@ export const id5IdSubmodule = {
* @returns {function(callback:function)}
*/
getId(configParams, consentData) {
if (configParams) {
configParams.partner = parseInt(configParams.partner);
if (typeof configParams.partner !== 'number') {
utils.logError(`User ID - ID5 submodule requires partner to be defined as a number`);
return;
}
} else {
if (!configParams || typeof configParams.partner !== 'number') {
utils.logError(`User ID - ID5 submodule requires partner to be defined as a number`);
return;
}
Expand Down
28 changes: 2 additions & 26 deletions modules/pubmaticBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -634,34 +634,10 @@ function _handleTTDId(eids, validBidRequests) {
}
}

/**
* Produces external userid object in ortb 3.0 model.
*/
function _addExternalUserId(eids, value, source, atype) {
if (utils.isStr(value)) {
eids.push({
source,
uids: [{
id: value,
atype
}]
});
}
}

function _handleEids(payload, validBidRequests) {
let eids = [];
_handleDigitrustId(eids);
_handleTTDId(eids, validBidRequests);
const bidRequest = validBidRequests[0];
if (bidRequest && bidRequest.userId) {
_addExternalUserId(eids, utils.deepAccess(bidRequest, `userId.pubcid`), 'pubcommon', 1);
_addExternalUserId(eids, utils.deepAccess(bidRequest, `userId.digitrustid.data.id`), 'digitru.st', 1);
_addExternalUserId(eids, utils.deepAccess(bidRequest, `userId.id5id`), 'id5-sync.com', 1);
_addExternalUserId(eids, utils.deepAccess(bidRequest, `userId.criteortus.${BIDDER_CODE}.userid`), 'criteortus', 1);
_addExternalUserId(eids, utils.deepAccess(bidRequest, `userId.idl_env`), 'liveramp.com', 1);
_addExternalUserId(eids, utils.deepAccess(bidRequest, `userId.customData`), 'customData', 1);
}
if (eids.length > 0) {
payload.user.eids = eids;
}
Expand Down Expand Up @@ -965,7 +941,7 @@ export const spec = {
netRevenue: NET_REVENUE,
cpm: 0,
currency: respCur,
referrer: parsedReferrer,
referrer: requestData.site && requestData.site.ref ? requestData.site.ref : '',
})
});
}
Expand All @@ -987,7 +963,7 @@ export const spec = {
br.currency = respCur;
br.netRevenue = NET_REVENUE;
br.ttl = 300;
br.referrer = parsedReferrer;
br.referrer = requestData.site && requestData.site.ref ? requestData.site.ref : '';
br.ad = bid.adm;
if (requestData.imp && requestData.imp.length > 0) {
requestData.imp.forEach(req => {
Expand Down
12 changes: 6 additions & 6 deletions modules/pubmaticServerBidAdapter.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import * as utils from '../src/utils';
import * as ajax from '../src/ajax';
import {userSync} from '../src/userSync';
import { config } from '../src/config';
import { registerBidder } from '../src/adapters/bidderFactory';
const constants = require('../src/constants.json');
import * as utils from 'src/utils';
import * as ajax from 'src/ajax';
import {userSync} from 'src/userSync';
import { config } from 'src/config';
import { registerBidder } from 'src/adapters/bidderFactory';
const constants = require('src/constants.json');

const BIDDER_CODE = 'pubmaticServer';
const ENDPOINT = '//ow.pubmatic.com/openrtb/2.5/';
Expand Down
10 changes: 4 additions & 6 deletions modules/userId/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -76,9 +76,8 @@ import {getGlobal} from '../../src/prebidGlobal';
import {gdprDataHandler} from '../../src/adapterManager';
import CONSTANTS from '../../src/constants.json';
import {module} from '../../src/hook';
// import {unifiedIdSubmodule} from './unifiedIdSystem.js';
import {unifiedIdSubmodule} from './unifiedIdSystem.js';
import {pubCommonIdSubmodule} from './pubCommonIdSystem.js';
// import {customIdSubmodule} from './customIdSystem.js';

const MODULE_NAME = 'User ID';
const COOKIE = 'cookie';
Expand Down Expand Up @@ -250,8 +249,8 @@ function initializeSubmodulesAndExecuteCallbacks() {

if (submodulesWithCallbacks.length) {
// wait for auction complete before processing submodule callbacks
events.on(CONSTANTS.EVENTS.REQUEST_BIDS, function auctionEndHandler() {
events.off(CONSTANTS.EVENTS.REQUEST_BIDS, auctionEndHandler);
events.on(CONSTANTS.EVENTS.AUCTION_END, function auctionEndHandler() {
events.off(CONSTANTS.EVENTS.AUCTION_END, auctionEndHandler);

// when syncDelay is zero, process callbacks now, otherwise dealy process with a setTimeout
if (syncDelay > 0) {
Expand Down Expand Up @@ -467,7 +466,6 @@ init(config);

// add submodules after init has been called
attachIdSystem(pubCommonIdSubmodule);
// attachIdSystem(unifiedIdSubmodule);
// attachIdSystem(customIdSubmodule);
attachIdSystem(unifiedIdSubmodule);

module('userId', attachIdSystem);
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,8 @@
* @requires module:modules/userId
*/

import * as utils from '../src/utils'
import {ajax} from '../src/ajax';
import {submodule} from '../src/hook';
import * as utils from '../../src/utils'
import {ajax} from '../../src/ajax';

/** @type {Submodule} */
export const unifiedIdSubmodule = {
Expand Down Expand Up @@ -54,5 +53,3 @@ export const unifiedIdSubmodule = {
}
}
};

submodule('userId', unifiedIdSubmodule);
2 changes: 1 addition & 1 deletion test/spec/modules/appierAnalyticsAdapter_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -608,7 +608,7 @@ describe('Appier Prebid AnalyticsAdapter Testing', function () {
sinon.stub(appierAnalyticsAdapter, 'createBidMessage').returns({});
sinon.spy(appierAnalyticsAdapter, 'createCreativeMessage');
events.emit(constants.EVENTS.AUCTION_END, args);
// sinon.assert.callCount(appierAnalyticsAdapter.createCreativeMessage, 1);
sinon.assert.callCount(appierAnalyticsAdapter.createCreativeMessage, 1);
appierAnalyticsAdapter.sendEventMessage.restore();
appierAnalyticsAdapter.createBidMessage.restore();
appierAnalyticsAdapter.createCreativeMessage.restore();
Expand Down
2 changes: 1 addition & 1 deletion test/spec/modules/userId_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import {
} from 'modules/userId/index.js';
import {config} from 'src/config';
import * as utils from 'src/utils';
import {unifiedIdSubmodule} from 'modules/unifiedIdSystem';
import {unifiedIdSubmodule} from 'modules/userId/unifiedIdSystem';
import {pubCommonIdSubmodule} from 'modules/userId/pubCommonIdSystem';
import {id5IdSubmodule} from 'modules/id5IdSystem';
import {identityLinkSubmodule} from 'modules/identityLinkIdSystem';
Expand Down
4 changes: 2 additions & 2 deletions test/spec/unit/core/targeting_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -467,7 +467,7 @@ describe('targeting tests', function () {
expect(targeting['/123456/header-bid-tag-0'][CONSTANTS.TARGETING_KEYS.PRICE_BUCKET + '_rubicon']).to.deep.equal(targeting['/123456/header-bid-tag-0'][CONSTANTS.TARGETING_KEYS.PRICE_BUCKET]);
});

xit('ensures keys are properly generated when enableSendAllBids is true and multiple bidders use native', function() {
it('ensures keys are properly generated when enableSendAllBids is true and multiple bidders use native', function() {
const nativeAdUnitCode = '/19968336/prebid_native_example_1';
enableSendAllBids = true;

Expand All @@ -480,7 +480,7 @@ describe('targeting tests', function () {
});

let targeting = targetingInstance.getAllTargeting([nativeAdUnitCode]);
// expect(targeting[nativeAdUnitCode].hb_native_image).to.equal(nativeBid1.native.image.url);
expect(targeting[nativeAdUnitCode].hb_native_image).to.equal(nativeBid1.native.image.url);
expect(targeting[nativeAdUnitCode].hb_native_linkurl).to.equal(nativeBid1.native.clickUrl);
expect(targeting[nativeAdUnitCode].hb_native_title).to.equal(nativeBid1.native.title);
expect(targeting[nativeAdUnitCode].hb_native_image_dgad).to.exist.and.to.equal(nativeBid2.native.image.url);
Expand Down

0 comments on commit fed46df

Please sign in to comment.