Skip to content
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

Sonobi - removed digitrust from sonobi adapter #5491

Merged
merged 1 commit into from
Jul 16, 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
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