Skip to content

Commit

Permalink
removed digitrust from sonobi adapter (#5491)
Browse files Browse the repository at this point in the history
  • Loading branch information
JonGoSonobi authored Jul 16, 2020
1 parent e43b414 commit b110d97
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 63 deletions.
22 changes: 0 additions & 22 deletions modules/sonobiBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import { userSync } from '../src/userSync.js';
const BIDDER_CODE = 'sonobi';
const STR_ENDPOINT = 'https://apex.go.sonobi.com/trinity.json';
const PAGEVIEW_ID = generateUUID();
const SONOBI_DIGITRUST_KEY = 'fhnS5drwmH';
const OUTSTREAM_REDNERER_URL = 'https://mtrx.go.sonobi.com/sbi_outstream_renderer.js';

export const spec = {
Expand Down Expand Up @@ -114,13 +113,6 @@ export const spec = {
}
}

const digitrust = _getDigiTrustObject(SONOBI_DIGITRUST_KEY);

if (digitrust) {
payload.digid = digitrust.id;
payload.digkeyv = digitrust.keyv;
}

if (validBidRequests[0].schain) {
payload.schain = JSON.stringify(validBidRequests[0].schain)
}
Expand Down Expand Up @@ -336,20 +328,6 @@ export function _getPlatform(context = window) {
return 'desktop';
}

// https://github.com/digi-trust/dt-cdn/wiki/Integration-Guide
function _getDigiTrustObject(key) {
function getDigiTrustId() {
let digiTrustUser = window.DigiTrust && (config.getConfig('digiTrustId') || window.DigiTrust.getUser({member: key}));
return (digiTrustUser && digiTrustUser.success && digiTrustUser.identity) || null;
}
let digiTrustId = getDigiTrustId();
// Verify there is an ID and this user has not opted out
if (!digiTrustId || (digiTrustId.privacy && digiTrustId.privacy.optout)) {
return null;
}
return digiTrustId;
}

function newRenderer(adUnitCode, bid, rendererOptions = {}) {
const renderer = Renderer.install({
id: bid.aid,
Expand Down
41 changes: 0 additions & 41 deletions test/spec/modules/sonobiBidAdapter_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -303,47 +303,6 @@ describe('SonobiBidAdapter', function () {
},
uspConsent: 'someCCPAString'
};
it('should include the digitrust id and keyv', () => {
window.DigiTrust = {
getUser: function () {
}
};
let sandbox = sinon.sandbox.create();
sandbox.stub(window.DigiTrust, 'getUser').callsFake(() =>
({
success: true,
identity: {
id: 'Vb0YJIxTMJV4W0GHRdJ3MwyiOVYJjYEgc2QYdBSG',
keyv: 4,
version: 2,
privacy: {}
}
})
);
const bidRequests = spec.buildRequests(bidRequest, bidderRequests)
expect(bidRequests.data.digid).to.equal('Vb0YJIxTMJV4W0GHRdJ3MwyiOVYJjYEgc2QYdBSG');
expect(bidRequests.data.digkeyv).to.equal(4);
sandbox.restore();
delete window.DigiTrust;
});

it('should not include the digitrust id and keyv', () => {
window.DigiTrust = {
getUser: function () {
}
};
let sandbox = sinon.sandbox.create();
sandbox.stub(window.DigiTrust, 'getUser').callsFake(() =>
({
success: false
})
);
const bidRequests = spec.buildRequests(bidRequest, bidderRequests)
expect(bidRequests.data.digid).to.be.undefined;
expect(bidRequests.data.digkeyv).to.be.undefined;
sandbox.restore();
delete window.DigiTrust;
});

it('should return a properly formatted request', function () {
const bidRequests = spec.buildRequests(bidRequest, bidderRequests)
Expand Down

0 comments on commit b110d97

Please sign in to comment.