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

Cadent Aperture MX Bid Adapter: address auctionId/transactionId leak #10485

Merged
merged 1 commit into from
Sep 14, 2023
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
4 changes: 2 additions & 2 deletions modules/cadentApertureMXBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,7 @@ export const spec = {
let isVideo = !!bid.mediaTypes.video;
let data = {
id: bid.bidId,
tid: bid.transactionId,
tid: bid.ortb2Imp?.ext?.tid,
tagid,
secure
};
Expand All @@ -297,7 +297,7 @@ export const spec = {
});

let cadentData = {
id: bidderRequest.auctionId,
id: bidderRequest.auctionId ?? bidderRequest.bidderRequestId,
imp: cadentImps,
device,
site,
Expand Down
17 changes: 16 additions & 1 deletion test/spec/modules/cadentApertureMXBidAdapter_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -237,6 +237,11 @@ describe('cadent_aperture_mx Adapter', function () {
'bidId': '30b31c2501de1e',
'auctionId': 'e19f1eff-8b27-42a6-888d-9674e5a6130c',
'transactionId': 'd7b773de-ceaa-484d-89ca-d9f51b8d61ec',
'ortb2Imp': {
'ext': {
'tid': 'd7b773de-ceaa-484d-89ca-d9f51b8d61ed',
},
},
}]
};
let request = spec.buildRequests(bidderRequest.bids, bidderRequest);
Expand Down Expand Up @@ -297,12 +302,22 @@ describe('cadent_aperture_mx Adapter', function () {
expect(data.id).to.equal(bidderRequest.auctionId);
expect(data.imp.length).to.equal(1);
expect(data.imp[0].id).to.equal('30b31c2501de1e');
expect(data.imp[0].tid).to.equal('d7b773de-ceaa-484d-89ca-d9f51b8d61ec');
expect(data.imp[0].tid).to.equal('d7b773de-ceaa-484d-89ca-d9f51b8d61ed');
expect(data.imp[0].tagid).to.equal('25251');
expect(data.imp[0].secure).to.equal(0);
expect(data.imp[0].vastXml).to.equal(undefined);
});

it('populates id even when auctionId is not available', function () {
// addressing https://github.com/prebid/Prebid.js/issues/9781
bidderRequest.auctionId = null;
request = spec.buildRequests(bidderRequest.bids, bidderRequest);

const data = JSON.parse(request.data);
expect(data.id).not.to.be.null;
expect(data.id).not.to.equal(bidderRequest.auctionId);
});

it('properly sends site information and protocol', function () {
request = spec.buildRequests(bidderRequest.bids, bidderRequest);
request = JSON.parse(request.data);
Expand Down