From b87237c692bac0bd1c6ecce486eb933d0bdd5543 Mon Sep 17 00:00:00 2001 From: Vladislav Isaiko Date: Mon, 26 Mar 2018 11:58:02 +0300 Subject: [PATCH 01/36] add video&native traffic colossus ssp --- modules/colossussspBidAdapter.js | 70 +++++++------------ modules/colossussspBidAdapter.md | 3 +- .../modules/colossussspBidAdapter_spec.js | 14 ++-- 3 files changed, 32 insertions(+), 55 deletions(-) diff --git a/modules/colossussspBidAdapter.js b/modules/colossussspBidAdapter.js index df011bc102d..6a267ea14e1 100644 --- a/modules/colossussspBidAdapter.js +++ b/modules/colossussspBidAdapter.js @@ -1,44 +1,31 @@ import { registerBidder } from 'src/adapters/bidderFactory'; +import { BANNER, NATIVE, VIDEO } from 'src/mediaTypes'; import * as utils from 'src/utils'; const BIDDER_CODE = 'colossusssp'; const URL = '//colossusssp.com/?c=o&m=multi'; const URL_SYNC = '//colossusssp.com/?c=o&m=cookie'; -let sizeObj = { - '468x60': 1, - '728x90': 2, - '300x600': 10, - '300x250': 15, - '300x100': 19, - '320x50': 43, - '300x50': 44, - '300x300': 48, - '300x1050': 54, - '970x90': 55, - '970x250': 57, - '1000x90': 58, - '320x80': 59, - '640x480': 65, - '320x480': 67, - '320x320': 72, - '320x160': 73, - '480x300': 83, - '970x310': 94, - '970x210': 96, - '480x320': 101, - '768x1024': 102, - '1000x300': 113, - '320x100': 117, - '800x250': 118, - '200x600': 119 -}; +function isBidResponseValid(bid) { + if (!bid.requestId || !bid.cpm || !bid.creativeId || !bid.ttl || !bid.currency) { + return false; + } -utils._each(sizeObj, (item, key) => sizeObj[item] = key); + switch (bid.mediaType) { + case BANNER: + return Boolean(bid.width && bid.height && bid.ad); + case VIDEO: + return Boolean(bid.vastUrl); + case NATIVE: + return Boolean(bid.title && bid.image && bid.impressionTrackers); + default: + return false; + } +} export const spec = { code: BIDDER_CODE, - + supportedMediaTypes: [BANNER, VIDEO, NATIVE], /** * Determines whether or not the given bid request is valid. * @@ -46,9 +33,7 @@ export const spec = { * @return boolean True if this is a valid bid, and false otherwise. */ isBidRequestValid: (bid) => { - return (!isNaN(bid.params.placement_id) && - ((bid.params.sizes !== undefined && bid.params.sizes.length > 0 && bid.params.sizes.some((sizeIndex) => sizeObj[sizeIndex] !== undefined)) || - (bid.sizes !== undefined && bid.sizes.length > 0 && bid.sizes.map((size) => `${size[0]}x${size[1]}`).some((size) => sizeObj[size] !== undefined)))); + return Boolean(bid.bidId && bid.params && !isNaN(bid.params.placement_id)); }, /** @@ -78,10 +63,11 @@ export const spec = { }; for (let i = 0; i < validBidRequests.length; i++) { let bid = validBidRequests[i]; - let placement = {}; - placement['placementId'] = bid.params.placement_id; - placement['bidId'] = bid.bidId; - placement['sizes'] = bid.sizes; + let placement = { + placementId: bid.params.placement_id, + bidId: bid.bidId, + traffic: bid.params.traffic || BANNER + }; placements.push(placement); } return { @@ -103,15 +89,7 @@ export const spec = { serverResponse = serverResponse.body; for (let i = 0; i < serverResponse.length; i++) { let resItem = serverResponse[i]; - if (resItem.width && !isNaN(resItem.width) && - resItem.height && !isNaN(resItem.height) && - resItem.requestId && typeof resItem.requestId === 'string' && - resItem.cpm && !isNaN(resItem.cpm) && - resItem.ad && typeof resItem.ad === 'string' && - resItem.ttl && !isNaN(resItem.ttl) && - resItem.creativeId && typeof resItem.creativeId === 'string' && - resItem.netRevenue && typeof resItem.netRevenue === 'boolean' && - resItem.currency && typeof resItem.currency === 'string') { + if (isBidResponseValid(resItem)) { response.push(resItem); } } diff --git a/modules/colossussspBidAdapter.md b/modules/colossussspBidAdapter.md index 9a5b9a0fe39..4760002f0db 100644 --- a/modules/colossussspBidAdapter.md +++ b/modules/colossussspBidAdapter.md @@ -18,7 +18,8 @@ Module that connects to Colossus SSP demand sources bids: [{ bidder: 'colossusssp', params: { - placement_id: 0 + placement_id: 0, + traffic: 'banner' } }] } diff --git a/test/spec/modules/colossussspBidAdapter_spec.js b/test/spec/modules/colossussspBidAdapter_spec.js index e14d2f27b42..61ea4e2d0ad 100644 --- a/test/spec/modules/colossussspBidAdapter_spec.js +++ b/test/spec/modules/colossussspBidAdapter_spec.js @@ -16,17 +16,13 @@ describe('ColossussspAdapter', () => { }; describe('isBidRequestValid', () => { - it('Should return true when placement_id can be cast to a number, and when at least one of the sizes passed is allowed', () => { + it('Should return true when placement_id can be cast to a number', () => { expect(spec.isBidRequestValid(bid)).to.be.true; }); it('Should return false when placement_id is not a number', () => { bid.params.placement_id = 'aaa'; expect(spec.isBidRequestValid(bid)).to.be.false; }); - it('Should return false when the sizes are not allowed', () => { - bid.sizes = [[1, 1]]; - expect(spec.isBidRequestValid(bid)).to.be.false; - }); }); describe('buildRequests', () => { @@ -56,10 +52,10 @@ describe('ColossussspAdapter', () => { let placements = data['placements']; for (let i = 0; i < placements.length; i++) { let placement = placements[i]; - expect(placement).to.have.all.keys('placementId', 'bidId', 'sizes'); + expect(placement).to.have.all.keys('placementId', 'bidId', 'traffic'); expect(placement.placementId).to.be.a('number'); expect(placement.bidId).to.be.a('string'); - expect(placement.sizes).to.be.an('array'); + expect(placement.traffic).to.be.a('string'); } }); it('Returns empty data if no valid requests are passed', () => { @@ -72,6 +68,7 @@ describe('ColossussspAdapter', () => { let resObject = { body: [ { requestId: '123', + mediaType: 'banner', cpm: 0.3, width: 320, height: 50, @@ -88,7 +85,7 @@ describe('ColossussspAdapter', () => { for (let i = 0; i < serverResponses.length; i++) { let dataItem = serverResponses[i]; expect(dataItem).to.have.all.keys('requestId', 'cpm', 'width', 'height', 'ad', 'ttl', 'creativeId', - 'netRevenue', 'currency'); + 'netRevenue', 'currency', 'mediaType'); expect(dataItem.requestId).to.be.a('string'); expect(dataItem.cpm).to.be.a('number'); expect(dataItem.width).to.be.a('number'); @@ -98,6 +95,7 @@ describe('ColossussspAdapter', () => { expect(dataItem.creativeId).to.be.a('string'); expect(dataItem.netRevenue).to.be.a('boolean'); expect(dataItem.currency).to.be.a('string'); + expect(dataItem.mediaType).to.be.a('string'); } it('Returns an empty array if invalid response is passed', () => { serverResponses = spec.interpretResponse('invalid_response'); From 1ca4e288a57162e3798e0630c52018b16c6f5235 Mon Sep 17 00:00:00 2001 From: Vladislav Isaiko Date: Tue, 10 Apr 2018 11:31:46 +0300 Subject: [PATCH 02/36] Native obj validation --- modules/colossussspBidAdapter.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/colossussspBidAdapter.js b/modules/colossussspBidAdapter.js index 6a267ea14e1..01c68be69f1 100644 --- a/modules/colossussspBidAdapter.js +++ b/modules/colossussspBidAdapter.js @@ -17,7 +17,7 @@ function isBidResponseValid(bid) { case VIDEO: return Boolean(bid.vastUrl); case NATIVE: - return Boolean(bid.title && bid.image && bid.impressionTrackers); + return Boolean(bid.title || bid.icon || (bid.image && bid.image.url && bid.image.height && bid.image.width)); default: return false; } From b5c1850d5e3ab48230f3646ae5df53669cfde480 Mon Sep 17 00:00:00 2001 From: Vladislav Isaiko Date: Sun, 22 Apr 2018 15:31:36 +0300 Subject: [PATCH 03/36] Native obj validation #2 --- modules/colossussspBidAdapter.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/colossussspBidAdapter.js b/modules/colossussspBidAdapter.js index 01c68be69f1..004612d1784 100644 --- a/modules/colossussspBidAdapter.js +++ b/modules/colossussspBidAdapter.js @@ -17,7 +17,7 @@ function isBidResponseValid(bid) { case VIDEO: return Boolean(bid.vastUrl); case NATIVE: - return Boolean(bid.title || bid.icon || (bid.image && bid.image.url && bid.image.height && bid.image.width)); + return Boolean(bid.native); default: return false; } From e969f275ba3542678eaa9d23a1c3fec868c01aa9 Mon Sep 17 00:00:00 2001 From: Vladislav Isaiko Date: Sun, 22 Apr 2018 15:42:06 +0300 Subject: [PATCH 04/36] Added size field in requests --- modules/colossussspBidAdapter.js | 1 + 1 file changed, 1 insertion(+) diff --git a/modules/colossussspBidAdapter.js b/modules/colossussspBidAdapter.js index 004612d1784..22b0415936c 100644 --- a/modules/colossussspBidAdapter.js +++ b/modules/colossussspBidAdapter.js @@ -66,6 +66,7 @@ export const spec = { let placement = { placementId: bid.params.placement_id, bidId: bid.bidId, + sizes: bid.sizes, traffic: bid.params.traffic || BANNER }; placements.push(placement); From 67693e13013234f50c82e75749187a7b6b2c61a8 Mon Sep 17 00:00:00 2001 From: Vladislav Isaiko Date: Sun, 22 Apr 2018 15:48:02 +0300 Subject: [PATCH 05/36] fixed test --- test/spec/modules/colossussspBidAdapter_spec.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/test/spec/modules/colossussspBidAdapter_spec.js b/test/spec/modules/colossussspBidAdapter_spec.js index 61ea4e2d0ad..54952fbf4b5 100644 --- a/test/spec/modules/colossussspBidAdapter_spec.js +++ b/test/spec/modules/colossussspBidAdapter_spec.js @@ -52,10 +52,11 @@ describe('ColossussspAdapter', () => { let placements = data['placements']; for (let i = 0; i < placements.length; i++) { let placement = placements[i]; - expect(placement).to.have.all.keys('placementId', 'bidId', 'traffic'); + expect(placement).to.have.all.keys('placementId', 'bidId', 'traffic', 'sizes'); expect(placement.placementId).to.be.a('number'); expect(placement.bidId).to.be.a('string'); expect(placement.traffic).to.be.a('string'); + expect(placement.sizes).to.be.an('array'); } }); it('Returns empty data if no valid requests are passed', () => { From 3320c68679f700affaf3d3ac75ea0fe4ea8f059e Mon Sep 17 00:00:00 2001 From: Aiholkin Date: Mon, 18 Nov 2019 11:27:08 +0200 Subject: [PATCH 06/36] fix merge conflicts --- modules/colossussspBidAdapter.js | 6 ------ test/spec/modules/colossussspBidAdapter_spec.js | 5 ----- 2 files changed, 11 deletions(-) diff --git a/modules/colossussspBidAdapter.js b/modules/colossussspBidAdapter.js index cc100452948..2ad320ede38 100644 --- a/modules/colossussspBidAdapter.js +++ b/modules/colossussspBidAdapter.js @@ -1,12 +1,6 @@ -<<<<<<< HEAD -import { registerBidder } from 'src/adapters/bidderFactory'; -import { BANNER, NATIVE, VIDEO } from 'src/mediaTypes'; -import * as utils from 'src/utils'; -======= import { registerBidder } from '../src/adapters/bidderFactory'; import { BANNER, NATIVE, VIDEO } from '../src/mediaTypes'; import * as utils from '../src/utils'; ->>>>>>> upstream/master const BIDDER_CODE = 'colossusssp'; const URL = '//colossusssp.com/?c=o&m=multi'; diff --git a/test/spec/modules/colossussspBidAdapter_spec.js b/test/spec/modules/colossussspBidAdapter_spec.js index a3ab6766df5..62b4158676e 100644 --- a/test/spec/modules/colossussspBidAdapter_spec.js +++ b/test/spec/modules/colossussspBidAdapter_spec.js @@ -15,13 +15,8 @@ describe('ColossussspAdapter', function () { transactionId: '3bb2f6da-87a6-4029-aeb0-bfe951372e62' }; -<<<<<<< HEAD - describe('isBidRequestValid', () => { - it('Should return true when placement_id can be cast to a number', () => { -======= describe('isBidRequestValid', function () { it('Should return true when placement_id can be cast to a number', function () { ->>>>>>> upstream/master expect(spec.isBidRequestValid(bid)).to.be.true; }); it('Should return false when placement_id is not a number', function () { From 44e59b808401d0e47eac888bf16ca19f3eca8934 Mon Sep 17 00:00:00 2001 From: Aiholkin Date: Mon, 18 Nov 2019 12:17:48 +0200 Subject: [PATCH 07/36] move to 3.0 --- modules/colossussspBidAdapter.js | 10 ++++++---- modules/colossussspBidAdapter.md | 6 +++++- test/spec/modules/colossussspBidAdapter_spec.js | 11 ++++++++--- 3 files changed, 19 insertions(+), 8 deletions(-) diff --git a/modules/colossussspBidAdapter.js b/modules/colossussspBidAdapter.js index 2ad320ede38..459f11f349e 100644 --- a/modules/colossussspBidAdapter.js +++ b/modules/colossussspBidAdapter.js @@ -42,7 +42,7 @@ export const spec = { * @param {BidRequest[]} validBidRequests A non-empty list of valid bid requests that should be sent to the Server. * @return ServerRequest Info describing the request to the server. */ - buildRequests: (validBidRequests) => { + buildRequests: (validBidRequests, bidderRequest) => { let winTop = window; try { window.top.location.toString(); @@ -50,7 +50,7 @@ export const spec = { } catch (e) { utils.logMessage(e); }; - let location = utils.getTopWindowLocation(); + let location = bidderRequest.referer; let placements = []; let request = { 'deviceWidth': winTop.screen.width, @@ -61,13 +61,15 @@ export const spec = { 'page': location.pathname, 'placements': placements }; + for (let i = 0; i < validBidRequests.length; i++) { let bid = validBidRequests[i]; + let traff = bid.params.traffic || BANNER let placement = { placementId: bid.params.placement_id, bidId: bid.bidId, - sizes: bid.sizes, - traffic: bid.params.traffic || BANNER + sizes: bid.mediaTypes[traff].sizes, + traffic: traff }; placements.push(placement); } diff --git a/modules/colossussspBidAdapter.md b/modules/colossussspBidAdapter.md index 4760002f0db..d95080546c2 100644 --- a/modules/colossussspBidAdapter.md +++ b/modules/colossussspBidAdapter.md @@ -14,7 +14,11 @@ Module that connects to Colossus SSP demand sources ``` var adUnits = [{ code: 'placementid_0', - sizes: [[300, 250]], + mediaTypes: { + banner: { + sizes: [[300, 250], [300,600]] + } + }, bids: [{ bidder: 'colossusssp', params: { diff --git a/test/spec/modules/colossussspBidAdapter_spec.js b/test/spec/modules/colossussspBidAdapter_spec.js index 62b4158676e..7ff33feab16 100644 --- a/test/spec/modules/colossussspBidAdapter_spec.js +++ b/test/spec/modules/colossussspBidAdapter_spec.js @@ -11,7 +11,11 @@ describe('ColossussspAdapter', function () { }, placementCode: 'placementid_0', auctionId: '74f78609-a92d-4cf1-869f-1b244bbfb5d2', - sizes: [[300, 250]], + mediatTypes: { + banner: { + sizes: [[300, 250]] + } + }, transactionId: '3bb2f6da-87a6-4029-aeb0-bfe951372e62' }; @@ -52,11 +56,12 @@ describe('ColossussspAdapter', function () { let placements = data['placements']; for (let i = 0; i < placements.length; i++) { let placement = placements[i]; - expect(placement).to.have.all.keys('placementId', 'bidId', 'traffic', 'sizes'); + expect(placement).to.have.all.keys('placementId', 'bidId', 'traffic', 'mediatTypes'); + expect(placement.mediatTypes).to.have.all.keys('banner'); expect(placement.placementId).to.be.a('number'); expect(placement.bidId).to.be.a('string'); expect(placement.traffic).to.be.a('string'); - expect(placement.sizes).to.be.an('array'); + expect(placement.mediatTypes.banner.sizes).to.be.an('array'); } }); it('Returns empty data if no valid requests are passed', function () { From 7133a7236db94349c283337b0cb48030caa29583 Mon Sep 17 00:00:00 2001 From: Aiholkin Date: Mon, 18 Nov 2019 13:52:47 +0200 Subject: [PATCH 08/36] move to 3.0 --- modules/colossussspBidAdapter.js | 12 ++++++------ test/spec/modules/colossussspBidAdapter_spec.js | 7 +++---- 2 files changed, 9 insertions(+), 10 deletions(-) diff --git a/modules/colossussspBidAdapter.js b/modules/colossussspBidAdapter.js index 459f11f349e..ec0b91a4a16 100644 --- a/modules/colossussspBidAdapter.js +++ b/modules/colossussspBidAdapter.js @@ -3,8 +3,8 @@ import { BANNER, NATIVE, VIDEO } from '../src/mediaTypes'; import * as utils from '../src/utils'; const BIDDER_CODE = 'colossusssp'; -const URL = '//colossusssp.com/?c=o&m=multi'; -const URL_SYNC = '//colossusssp.com/?c=o&m=cookie'; +const G_URL = '//colossusssp.com/?c=o&m=multi'; +const G_URL_SYNC = '//colossusssp.com/?c=o&m=cookie'; function isBidResponseValid(bid) { if (!bid.requestId || !bid.cpm || !bid.creativeId || !bid.ttl || !bid.currency) { @@ -50,7 +50,7 @@ export const spec = { } catch (e) { utils.logMessage(e); }; - let location = bidderRequest.referer; + let location = new URL((bidderRequest && bidderRequest.refererInfo ? bidderRequest.refererInfo.referer : window.top.location.toString())); let placements = []; let request = { 'deviceWidth': winTop.screen.width, @@ -61,7 +61,7 @@ export const spec = { 'page': location.pathname, 'placements': placements }; - + for (let i = 0; i < validBidRequests.length; i++) { let bid = validBidRequests[i]; let traff = bid.params.traffic || BANNER @@ -75,7 +75,7 @@ export const spec = { } return { method: 'POST', - url: URL, + url: G_URL, data: request }; }, @@ -105,7 +105,7 @@ export const spec = { getUserSyncs: () => { return [{ type: 'image', - url: URL_SYNC + url: G_URL_SYNC }]; } }; diff --git a/test/spec/modules/colossussspBidAdapter_spec.js b/test/spec/modules/colossussspBidAdapter_spec.js index 7ff33feab16..288a594ebb6 100644 --- a/test/spec/modules/colossussspBidAdapter_spec.js +++ b/test/spec/modules/colossussspBidAdapter_spec.js @@ -11,7 +11,7 @@ describe('ColossussspAdapter', function () { }, placementCode: 'placementid_0', auctionId: '74f78609-a92d-4cf1-869f-1b244bbfb5d2', - mediatTypes: { + mediaTypes: { banner: { sizes: [[300, 250]] } @@ -56,12 +56,11 @@ describe('ColossussspAdapter', function () { let placements = data['placements']; for (let i = 0; i < placements.length; i++) { let placement = placements[i]; - expect(placement).to.have.all.keys('placementId', 'bidId', 'traffic', 'mediatTypes'); - expect(placement.mediatTypes).to.have.all.keys('banner'); + expect(placement).to.have.all.keys('placementId', 'bidId', 'traffic', 'sizes'); expect(placement.placementId).to.be.a('number'); expect(placement.bidId).to.be.a('string'); expect(placement.traffic).to.be.a('string'); - expect(placement.mediatTypes.banner.sizes).to.be.an('array'); + expect(placement.sizes).to.be.an('array'); } }); it('Returns empty data if no valid requests are passed', function () { From 3dba3aca3309bc5687802b2b29132befc5033dd8 Mon Sep 17 00:00:00 2001 From: Aiholkin Date: Mon, 18 Nov 2019 17:25:44 +0200 Subject: [PATCH 09/36] fix IE11 new URL issue --- modules/colossussspBidAdapter.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/modules/colossussspBidAdapter.js b/modules/colossussspBidAdapter.js index ec0b91a4a16..8debdae94f1 100644 --- a/modules/colossussspBidAdapter.js +++ b/modules/colossussspBidAdapter.js @@ -44,13 +44,15 @@ export const spec = { */ buildRequests: (validBidRequests, bidderRequest) => { let winTop = window; + let location; try { - window.top.location.toString(); + location = new URL(bidderRequest.refererInfo.referer) winTop = window.top; } catch (e) { + location = window.top.location; utils.logMessage(e); }; - let location = new URL((bidderRequest && bidderRequest.refererInfo ? bidderRequest.refererInfo.referer : window.top.location.toString())); + let placements = []; let request = { 'deviceWidth': winTop.screen.width, From 7f14e4d885743e62da3d8116d0decf265fba1daa Mon Sep 17 00:00:00 2001 From: Aiholkin Date: Mon, 18 Nov 2019 17:29:25 +0200 Subject: [PATCH 10/36] fix IE11 new URL issue --- modules/colossussspBidAdapter.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/colossussspBidAdapter.js b/modules/colossussspBidAdapter.js index 8debdae94f1..613a983c037 100644 --- a/modules/colossussspBidAdapter.js +++ b/modules/colossussspBidAdapter.js @@ -49,7 +49,7 @@ export const spec = { location = new URL(bidderRequest.refererInfo.referer) winTop = window.top; } catch (e) { - location = window.top.location; + location = winTop.location; utils.logMessage(e); }; From 78609ff339d2a87135b92c5c8421e47bf133c432 Mon Sep 17 00:00:00 2001 From: Aiholkin Date: Mon, 18 Nov 2019 17:44:56 +0200 Subject: [PATCH 11/36] fix IE11 new URL issue --- modules/colossussspBidAdapter.js | 1 - 1 file changed, 1 deletion(-) diff --git a/modules/colossussspBidAdapter.js b/modules/colossussspBidAdapter.js index 613a983c037..7990c6e08cf 100644 --- a/modules/colossussspBidAdapter.js +++ b/modules/colossussspBidAdapter.js @@ -52,7 +52,6 @@ export const spec = { location = winTop.location; utils.logMessage(e); }; - let placements = []; let request = { 'deviceWidth': winTop.screen.width, From 4c5d7110225de80a27675fa9836ad1eeb1ab0036 Mon Sep 17 00:00:00 2001 From: Aiholkin Date: Wed, 20 Nov 2019 12:01:44 +0200 Subject: [PATCH 12/36] https for 3.0 --- modules/colossussspBidAdapter.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/colossussspBidAdapter.js b/modules/colossussspBidAdapter.js index 7990c6e08cf..9f02f5057c1 100644 --- a/modules/colossussspBidAdapter.js +++ b/modules/colossussspBidAdapter.js @@ -3,8 +3,8 @@ import { BANNER, NATIVE, VIDEO } from '../src/mediaTypes'; import * as utils from '../src/utils'; const BIDDER_CODE = 'colossusssp'; -const G_URL = '//colossusssp.com/?c=o&m=multi'; -const G_URL_SYNC = '//colossusssp.com/?c=o&m=cookie'; +const G_URL = 'https://colossusssp.com/?c=o&m=multi'; +const G_URL_SYNC = 'https://colossusssp.com/?c=o&m=cookie'; function isBidResponseValid(bid) { if (!bid.requestId || !bid.cpm || !bid.creativeId || !bid.ttl || !bid.currency) { From 1027b54dcd96cddbe4e27406a3e9e83bea76593d Mon Sep 17 00:00:00 2001 From: Aiholkin Date: Thu, 21 Nov 2019 10:08:56 +0200 Subject: [PATCH 13/36] add https test --- test/spec/modules/colossussspBidAdapter_spec.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/spec/modules/colossussspBidAdapter_spec.js b/test/spec/modules/colossussspBidAdapter_spec.js index 288a594ebb6..f5042220610 100644 --- a/test/spec/modules/colossussspBidAdapter_spec.js +++ b/test/spec/modules/colossussspBidAdapter_spec.js @@ -41,7 +41,7 @@ describe('ColossussspAdapter', function () { expect(serverRequest.method).to.equal('POST'); }); it('Returns valid URL', function () { - expect(serverRequest.url).to.equal('//colossusssp.com/?c=o&m=multi'); + expect(serverRequest.url).to.equal('https://colossusssp.com/?c=o&m=multi'); }); it('Returns valid data if array of bids is valid', function () { let data = serverRequest.data; @@ -116,7 +116,7 @@ describe('ColossussspAdapter', function () { expect(userSync[0].type).to.exist; expect(userSync[0].url).to.exist; expect(userSync[0].type).to.be.equal('image'); - expect(userSync[0].url).to.be.equal('//colossusssp.com/?c=o&m=cookie'); + expect(userSync[0].url).to.be.equal('https://colossusssp.com/?c=o&m=cookie'); }); }); }); From 684639c7ca30b24a0f7e28fc94a6df41e3b1c07e Mon Sep 17 00:00:00 2001 From: Aiholkin Date: Thu, 5 Dec 2019 14:41:32 +0200 Subject: [PATCH 14/36] add ccp and schain features --- modules/colossussspBidAdapter.js | 12 ++++++ .../modules/colossussspBidAdapter_spec.js | 39 +++++++++++++++++-- 2 files changed, 48 insertions(+), 3 deletions(-) diff --git a/modules/colossussspBidAdapter.js b/modules/colossussspBidAdapter.js index 9f02f5057c1..93f78a2e659 100644 --- a/modules/colossussspBidAdapter.js +++ b/modules/colossussspBidAdapter.js @@ -63,6 +63,15 @@ export const spec = { 'placements': placements }; + if (bidderRequest.gdprConsent) { + if (bidderRequest.gdprConsent.consentString) { + request.gdpr_consent = bidderRequest.gdprConsent.consentString; + } + } + if (bidderRequest.uspConsent) { + request.ccpa = bidderRequest.uspConsent; + } + for (let i = 0; i < validBidRequests.length; i++) { let bid = validBidRequests[i]; let traff = bid.params.traffic || BANNER @@ -72,6 +81,9 @@ export const spec = { sizes: bid.mediaTypes[traff].sizes, traffic: traff }; + if (bid.schain) { + placement.schain = bid.schain; + } placements.push(placement); } return { diff --git a/test/spec/modules/colossussspBidAdapter_spec.js b/test/spec/modules/colossussspBidAdapter_spec.js index f5042220610..0946d57f822 100644 --- a/test/spec/modules/colossussspBidAdapter_spec.js +++ b/test/spec/modules/colossussspBidAdapter_spec.js @@ -16,8 +16,36 @@ describe('ColossussspAdapter', function () { sizes: [[300, 250]] } }, - transactionId: '3bb2f6da-87a6-4029-aeb0-bfe951372e62' + transactionId: '3bb2f6da-87a6-4029-aeb0-bfe951372e62', + schain: { + ver: '1.0', + complete: 1, + nodes: [ + { + asi: 'example.com', + sid: '0', + hp: 1, + rid: 'bidrequestid', + // name: 'alladsallthetime', + domain: 'example.com' + } + ] + } }; + let bidderRequest = { + bidderCode: 'colossus', + auctionId: 'fffffff-ffff-ffff-ffff-ffffffffffff', + bidderRequestId: 'ffffffffffffff', + start: 1472239426002, + auctionStart: 1472239426000, + timeout: 5000, + uspConsent: '1YN-', + refererInfo: { + referer: 'http://www.example.com', + reachedTop: true, + }, + bids: [bid] + } describe('isBidRequestValid', function () { it('Should return true when placement_id can be cast to a number', function () { @@ -30,7 +58,7 @@ describe('ColossussspAdapter', function () { }); describe('buildRequests', function () { - let serverRequest = spec.buildRequests([bid]); + let serverRequest = spec.buildRequests([bid], bidderRequest); it('Creates a ServerRequest object with method, URL and data', function () { expect(serverRequest).to.exist; expect(serverRequest.method).to.exist; @@ -43,6 +71,10 @@ describe('ColossussspAdapter', function () { it('Returns valid URL', function () { expect(serverRequest.url).to.equal('https://colossusssp.com/?c=o&m=multi'); }); + it('Should contain ccpa', function() { + expect(serverRequest.data.ccpa).to.be.an('string') + }) + it('Returns valid data if array of bids is valid', function () { let data = serverRequest.data; expect(data).to.be.an('object'); @@ -56,7 +88,8 @@ describe('ColossussspAdapter', function () { let placements = data['placements']; for (let i = 0; i < placements.length; i++) { let placement = placements[i]; - expect(placement).to.have.all.keys('placementId', 'bidId', 'traffic', 'sizes'); + expect(placement).to.have.all.keys('placementId', 'bidId', 'traffic', 'sizes', 'schain'); + expect(placement.schain).to.be.an('object') expect(placement.placementId).to.be.a('number'); expect(placement.bidId).to.be.a('string'); expect(placement.traffic).to.be.a('string'); From 1c6681cfebae037787f06a0e35022ed6e761f484 Mon Sep 17 00:00:00 2001 From: Aiholkin Date: Thu, 5 Dec 2019 14:59:41 +0200 Subject: [PATCH 15/36] fix test --- modules/colossussspBidAdapter.js | 14 ++++++++------ test/spec/modules/colossussspBidAdapter_spec.js | 2 +- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/modules/colossussspBidAdapter.js b/modules/colossussspBidAdapter.js index 93f78a2e659..7125097c7b9 100644 --- a/modules/colossussspBidAdapter.js +++ b/modules/colossussspBidAdapter.js @@ -63,14 +63,16 @@ export const spec = { 'placements': placements }; - if (bidderRequest.gdprConsent) { - if (bidderRequest.gdprConsent.consentString) { - request.gdpr_consent = bidderRequest.gdprConsent.consentString; + if(bidderRequest){ + // if (bidderRequest.gdprConsent) { + // if (bidderRequest.gdprConsent.consentString) { + // request.gdpr_consent = bidderRequest.gdprConsent.consentString; + // } + // } + if (bidderRequest.uspConsent) { + request.ccpa = bidderRequest.uspConsent; } } - if (bidderRequest.uspConsent) { - request.ccpa = bidderRequest.uspConsent; - } for (let i = 0; i < validBidRequests.length; i++) { let bid = validBidRequests[i]; diff --git a/test/spec/modules/colossussspBidAdapter_spec.js b/test/spec/modules/colossussspBidAdapter_spec.js index 0946d57f822..9ed2dbe6e6b 100644 --- a/test/spec/modules/colossussspBidAdapter_spec.js +++ b/test/spec/modules/colossussspBidAdapter_spec.js @@ -78,7 +78,7 @@ describe('ColossussspAdapter', function () { it('Returns valid data if array of bids is valid', function () { let data = serverRequest.data; expect(data).to.be.an('object'); - expect(data).to.have.all.keys('deviceWidth', 'deviceHeight', 'language', 'secure', 'host', 'page', 'placements'); + expect(data).to.have.all.keys('deviceWidth', 'deviceHeight', 'language', 'secure', 'host', 'page', 'placements', 'ccpa'); expect(data.deviceWidth).to.be.a('number'); expect(data.deviceHeight).to.be.a('number'); expect(data.language).to.be.a('string'); From 2f9efee32a20fe28999ab5beff3f197132f78d27 Mon Sep 17 00:00:00 2001 From: Aiholkin Date: Thu, 5 Dec 2019 15:14:20 +0200 Subject: [PATCH 16/36] sync with upstream, fix conflicts --- test/spec/modules/colossussspBidAdapter_spec.js | 4 ---- 1 file changed, 4 deletions(-) diff --git a/test/spec/modules/colossussspBidAdapter_spec.js b/test/spec/modules/colossussspBidAdapter_spec.js index efb0d627798..9ed2dbe6e6b 100644 --- a/test/spec/modules/colossussspBidAdapter_spec.js +++ b/test/spec/modules/colossussspBidAdapter_spec.js @@ -16,7 +16,6 @@ describe('ColossussspAdapter', function () { sizes: [[300, 250]] } }, -<<<<<<< HEAD transactionId: '3bb2f6da-87a6-4029-aeb0-bfe951372e62', schain: { ver: '1.0', @@ -32,9 +31,6 @@ describe('ColossussspAdapter', function () { } ] } -======= - transactionId: '3bb2f6da-87a6-4029-aeb0-bfe951372e62' ->>>>>>> upstream/master }; let bidderRequest = { bidderCode: 'colossus', From c40dbe388c663f25f13649b1882c06f384c72c8c Mon Sep 17 00:00:00 2001 From: Bill Newman Date: Mon, 9 Dec 2019 09:59:08 +0200 Subject: [PATCH 17/36] Update colossussspBidAdapter.js remove commented code --- modules/colossussspBidAdapter.js | 5 ----- 1 file changed, 5 deletions(-) diff --git a/modules/colossussspBidAdapter.js b/modules/colossussspBidAdapter.js index 7125097c7b9..3f951871ff0 100644 --- a/modules/colossussspBidAdapter.js +++ b/modules/colossussspBidAdapter.js @@ -64,11 +64,6 @@ export const spec = { }; if(bidderRequest){ - // if (bidderRequest.gdprConsent) { - // if (bidderRequest.gdprConsent.consentString) { - // request.gdpr_consent = bidderRequest.gdprConsent.consentString; - // } - // } if (bidderRequest.uspConsent) { request.ccpa = bidderRequest.uspConsent; } From 7d2e9f3f5ebbc25c1f134bd59d726e3afe781124 Mon Sep 17 00:00:00 2001 From: Bill Newman Date: Tue, 10 Dec 2019 10:38:38 +0200 Subject: [PATCH 18/36] Update colossussspBidAdapter.js lint fix --- modules/colossussspBidAdapter.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/colossussspBidAdapter.js b/modules/colossussspBidAdapter.js index 3f951871ff0..adcd5df9fb6 100644 --- a/modules/colossussspBidAdapter.js +++ b/modules/colossussspBidAdapter.js @@ -63,7 +63,7 @@ export const spec = { 'placements': placements }; - if(bidderRequest){ + if (bidderRequest) { if (bidderRequest.uspConsent) { request.ccpa = bidderRequest.uspConsent; } From 53bb18eee83bdfc9a6d84978d35c0cc1f4d6ee17 Mon Sep 17 00:00:00 2001 From: Aiholkin Date: Fri, 28 Feb 2020 11:52:00 +0200 Subject: [PATCH 19/36] identity extensions --- modules/colossussspBidAdapter.js | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/modules/colossussspBidAdapter.js b/modules/colossussspBidAdapter.js index cf4d306e686..102230034ed 100644 --- a/modules/colossussspBidAdapter.js +++ b/modules/colossussspBidAdapter.js @@ -23,6 +23,19 @@ function isBidResponseValid(bid) { } } +function getUserId(eids, id, source, uidExt) { + if (id) { + var uid = { id }; + if (uidExt) { + uid.ext = uidExt; + } + eids.push({ + source, + uids: [ uid ] + }); + } +} + export const spec = { code: BIDDER_CODE, supportedMediaTypes: [BANNER, VIDEO, NATIVE], @@ -67,6 +80,14 @@ export const spec = { if (bidderRequest.uspConsent) { request.ccpa = bidderRequest.uspConsent; } + if (bidRequest.userId) { + ext.eids = []; + getUserId(ext.eids, bidRequest.userId.britepoolid, 'britepool.com'); + getUserId(ext.eids, bidRequest.userId.idl_env, 'identityLink'); + getUserId(ext.eids, bidRequest.userId.tdid, 'adserver.org', { + rtiPartner: 'TDID' + }); + } } for (let i = 0; i < validBidRequests.length; i++) { From 51faedc47963f85123f8f63ea150ef27f74bdce1 Mon Sep 17 00:00:00 2001 From: Aiholkin Date: Fri, 28 Feb 2020 12:06:28 +0200 Subject: [PATCH 20/36] identity extensions --- modules/colossussspBidAdapter.js | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/modules/colossussspBidAdapter.js b/modules/colossussspBidAdapter.js index 102230034ed..b162c0cf877 100644 --- a/modules/colossussspBidAdapter.js +++ b/modules/colossussspBidAdapter.js @@ -73,7 +73,8 @@ export const spec = { 'secure': location.protocol === 'https:' ? 1 : 0, 'host': location.host, 'page': location.pathname, - 'placements': placements + 'placements': placements, + 'ortb_user_ext': {} }; if (bidderRequest) { @@ -81,10 +82,10 @@ export const spec = { request.ccpa = bidderRequest.uspConsent; } if (bidRequest.userId) { - ext.eids = []; - getUserId(ext.eids, bidRequest.userId.britepoolid, 'britepool.com'); - getUserId(ext.eids, bidRequest.userId.idl_env, 'identityLink'); - getUserId(ext.eids, bidRequest.userId.tdid, 'adserver.org', { + request.ortb_user_ext.eids = []; + getUserId(request.ortb_user_ext.eids, bidRequest.userId.britepoolid, 'britepool.com'); + getUserId(request.ortb_user_ext.eids, bidRequest.userId.idl_env, 'identityLink'); + getUserId(request.ortb_user_ext.eids, bidRequest.userId.tdid, 'adserver.org', { rtiPartner: 'TDID' }); } @@ -104,6 +105,7 @@ export const spec = { } placements.push(placement); } + console.log(JSON.stringify(request)) return { method: 'POST', url: G_URL, From 6cee3e711c6c7801fa5cd88b664ea4f42e51955c Mon Sep 17 00:00:00 2001 From: "huddled.masses" Date: Fri, 6 Mar 2020 17:04:55 +0200 Subject: [PATCH 21/36] fix --- modules/colossussspBidAdapter.js | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/modules/colossussspBidAdapter.js b/modules/colossussspBidAdapter.js index b162c0cf877..db37f5d5a17 100644 --- a/modules/colossussspBidAdapter.js +++ b/modules/colossussspBidAdapter.js @@ -81,14 +81,6 @@ export const spec = { if (bidderRequest.uspConsent) { request.ccpa = bidderRequest.uspConsent; } - if (bidRequest.userId) { - request.ortb_user_ext.eids = []; - getUserId(request.ortb_user_ext.eids, bidRequest.userId.britepoolid, 'britepool.com'); - getUserId(request.ortb_user_ext.eids, bidRequest.userId.idl_env, 'identityLink'); - getUserId(request.ortb_user_ext.eids, bidRequest.userId.tdid, 'adserver.org', { - rtiPartner: 'TDID' - }); - } } for (let i = 0; i < validBidRequests.length; i++) { @@ -98,11 +90,19 @@ export const spec = { placementId: bid.params.placement_id, bidId: bid.bidId, sizes: bid.mediaTypes[traff].sizes, - traffic: traff + traffic: traff, + eids : [] }; if (bid.schain) { placement.schain = bid.schain; } + if (bid.userId) { + getUserId(placement.eids, bid.userId.britepoolid, 'britepool.com'); + getUserId(placement.eids, bid.userId.idl_env, 'identityLink'); + getUserId(placement.eids, bid.userId.tdid, 'adserver.org', { + rtiPartner: 'TDID' + }); + } placements.push(placement); } console.log(JSON.stringify(request)) From 461e4ff6eb62086f461d26e0267431b48d1e9c22 Mon Sep 17 00:00:00 2001 From: "huddled.masses" Date: Fri, 6 Mar 2020 17:09:11 +0200 Subject: [PATCH 22/36] fix --- modules/colossussspBidAdapter.js | 1 - 1 file changed, 1 deletion(-) diff --git a/modules/colossussspBidAdapter.js b/modules/colossussspBidAdapter.js index db37f5d5a17..95e17298971 100644 --- a/modules/colossussspBidAdapter.js +++ b/modules/colossussspBidAdapter.js @@ -74,7 +74,6 @@ export const spec = { 'host': location.host, 'page': location.pathname, 'placements': placements, - 'ortb_user_ext': {} }; if (bidderRequest) { From e78a9dcf73de14e226bde777fd7ddae3ee2e362a Mon Sep 17 00:00:00 2001 From: "huddled.masses" Date: Fri, 6 Mar 2020 17:10:13 +0200 Subject: [PATCH 23/36] fix --- modules/colossussspBidAdapter.js | 1 - 1 file changed, 1 deletion(-) diff --git a/modules/colossussspBidAdapter.js b/modules/colossussspBidAdapter.js index 95e17298971..f1f8526aaee 100644 --- a/modules/colossussspBidAdapter.js +++ b/modules/colossussspBidAdapter.js @@ -104,7 +104,6 @@ export const spec = { } placements.push(placement); } - console.log(JSON.stringify(request)) return { method: 'POST', url: G_URL, From 1547d0a2c24a5da8969eb0eb9fae7d9cae615931 Mon Sep 17 00:00:00 2001 From: "huddled.masses" Date: Fri, 6 Mar 2020 17:18:01 +0200 Subject: [PATCH 24/36] fix --- test/spec/modules/colossussspBidAdapter_spec.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/spec/modules/colossussspBidAdapter_spec.js b/test/spec/modules/colossussspBidAdapter_spec.js index d2343516b6a..12a4bab9042 100644 --- a/test/spec/modules/colossussspBidAdapter_spec.js +++ b/test/spec/modules/colossussspBidAdapter_spec.js @@ -88,7 +88,7 @@ describe('ColossussspAdapter', function () { let placements = data['placements']; for (let i = 0; i < placements.length; i++) { let placement = placements[i]; - expect(placement).to.have.all.keys('placementId', 'bidId', 'traffic', 'sizes', 'schain'); + expect(placement).to.have.all.keys('placementId', 'eids', 'bidId', 'traffic', 'sizes', 'schain'); expect(placement.schain).to.be.an('object') expect(placement.placementId).to.be.a('number'); expect(placement.bidId).to.be.a('string'); From 803be443f2eb0834c6be669cbf0c2869a51c9137 Mon Sep 17 00:00:00 2001 From: "huddled.masses" Date: Fri, 6 Mar 2020 17:25:55 +0200 Subject: [PATCH 25/36] fix --- modules/colossussspBidAdapter.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/colossussspBidAdapter.js b/modules/colossussspBidAdapter.js index f1f8526aaee..e1e7d873402 100644 --- a/modules/colossussspBidAdapter.js +++ b/modules/colossussspBidAdapter.js @@ -90,7 +90,7 @@ export const spec = { bidId: bid.bidId, sizes: bid.mediaTypes[traff].sizes, traffic: traff, - eids : [] + eids: [] }; if (bid.schain) { placement.schain = bid.schain; From 47a78af0f42252562f12a2d8894e89a9f62e7f8f Mon Sep 17 00:00:00 2001 From: "huddled.masses" Date: Tue, 10 Mar 2020 11:14:05 +0200 Subject: [PATCH 26/36] add tests for user ids --- .../modules/colossussspBidAdapter_spec.js | 21 +++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/test/spec/modules/colossussspBidAdapter_spec.js b/test/spec/modules/colossussspBidAdapter_spec.js index 12a4bab9042..febfcb1b17f 100644 --- a/test/spec/modules/colossussspBidAdapter_spec.js +++ b/test/spec/modules/colossussspBidAdapter_spec.js @@ -102,6 +102,27 @@ describe('ColossussspAdapter', function () { expect(data.placements).to.be.an('array').that.is.empty; }); }); + + describe('buildRequests with user ids', function () { + bid.userId.britepoolid = 'britepoolid123'; + bid.userId.idl_env = 'idl_env123'; + bid.userId.tdid = 'tdid123'; + let serverRequest = spec.buildRequests([bid], bidderRequest); + it('Returns valid data if array of bids is valid', function () { + let data = serverRequest.data; + expect(data).to.be.an('object'); + for (let i = 0; i < placements.length; i++) { + let placement = placements[i]; + expect(placement).to.have.key('eids') + expect(placement.eids).to.be.an('array') + expect(placement.eids.length).to.be.equal(3) + for(let v of placement.eids){ + expect(v.source).to.be.oneOf(['britepool.com','identityLink','adserver.org']) + } + } + }); + }); + describe('interpretResponse', function () { let resObject = { body: [ { From 9ff6f10164eb7dab3973f0beffc1b4fb69f1c248 Mon Sep 17 00:00:00 2001 From: "huddled.masses" Date: Tue, 10 Mar 2020 11:17:50 +0200 Subject: [PATCH 27/36] fix --- test/spec/modules/colossussspBidAdapter_spec.js | 1 + 1 file changed, 1 insertion(+) diff --git a/test/spec/modules/colossussspBidAdapter_spec.js b/test/spec/modules/colossussspBidAdapter_spec.js index febfcb1b17f..7518d1b5fac 100644 --- a/test/spec/modules/colossussspBidAdapter_spec.js +++ b/test/spec/modules/colossussspBidAdapter_spec.js @@ -104,6 +104,7 @@ describe('ColossussspAdapter', function () { }); describe('buildRequests with user ids', function () { + bid.userId = {} bid.userId.britepoolid = 'britepoolid123'; bid.userId.idl_env = 'idl_env123'; bid.userId.tdid = 'tdid123'; From b02455a9aa3271ed17fa3958c078311d9be485cd Mon Sep 17 00:00:00 2001 From: "huddled.masses" Date: Tue, 10 Mar 2020 11:19:07 +0200 Subject: [PATCH 28/36] fix --- test/spec/modules/colossussspBidAdapter_spec.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/spec/modules/colossussspBidAdapter_spec.js b/test/spec/modules/colossussspBidAdapter_spec.js index 7518d1b5fac..1f20d3196c3 100644 --- a/test/spec/modules/colossussspBidAdapter_spec.js +++ b/test/spec/modules/colossussspBidAdapter_spec.js @@ -117,8 +117,8 @@ describe('ColossussspAdapter', function () { expect(placement).to.have.key('eids') expect(placement.eids).to.be.an('array') expect(placement.eids.length).to.be.equal(3) - for(let v of placement.eids){ - expect(v.source).to.be.oneOf(['britepool.com','identityLink','adserver.org']) + for (let v of placement.eids) { + expect(v.source).to.be.oneOf(['britepool.com', 'identityLink', 'adserver.org']) } } }); From a4b93a1686588fb3f3ea266af3a2fe445dbd11de Mon Sep 17 00:00:00 2001 From: "huddled.masses" Date: Tue, 10 Mar 2020 11:26:22 +0200 Subject: [PATCH 29/36] fix --- test/spec/modules/colossussspBidAdapter_spec.js | 1 + 1 file changed, 1 insertion(+) diff --git a/test/spec/modules/colossussspBidAdapter_spec.js b/test/spec/modules/colossussspBidAdapter_spec.js index 1f20d3196c3..a2dfa46e7a9 100644 --- a/test/spec/modules/colossussspBidAdapter_spec.js +++ b/test/spec/modules/colossussspBidAdapter_spec.js @@ -111,6 +111,7 @@ describe('ColossussspAdapter', function () { let serverRequest = spec.buildRequests([bid], bidderRequest); it('Returns valid data if array of bids is valid', function () { let data = serverRequest.data; + let placements = data['placements']; expect(data).to.be.an('object'); for (let i = 0; i < placements.length; i++) { let placement = placements[i]; From 1e741691b56ae5ad35026b7d9269563043be52b2 Mon Sep 17 00:00:00 2001 From: "huddled.masses" Date: Tue, 10 Mar 2020 11:33:37 +0200 Subject: [PATCH 30/36] fix --- test/spec/modules/colossussspBidAdapter_spec.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/spec/modules/colossussspBidAdapter_spec.js b/test/spec/modules/colossussspBidAdapter_spec.js index a2dfa46e7a9..087f6eb98d3 100644 --- a/test/spec/modules/colossussspBidAdapter_spec.js +++ b/test/spec/modules/colossussspBidAdapter_spec.js @@ -115,7 +115,7 @@ describe('ColossussspAdapter', function () { expect(data).to.be.an('object'); for (let i = 0; i < placements.length; i++) { let placement = placements[i]; - expect(placement).to.have.key('eids') + expect(placement).to.have.property('eids') expect(placement.eids).to.be.an('array') expect(placement.eids.length).to.be.equal(3) for (let v of placement.eids) { From 74a42cd6bb09d35281f642245359c1a788ef095b Mon Sep 17 00:00:00 2001 From: "huddled.masses" Date: Tue, 10 Mar 2020 12:03:38 +0200 Subject: [PATCH 31/36] fix --- test/spec/modules/colossussspBidAdapter_spec.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/test/spec/modules/colossussspBidAdapter_spec.js b/test/spec/modules/colossussspBidAdapter_spec.js index 087f6eb98d3..9b2140f6940 100644 --- a/test/spec/modules/colossussspBidAdapter_spec.js +++ b/test/spec/modules/colossussspBidAdapter_spec.js @@ -119,7 +119,11 @@ describe('ColossussspAdapter', function () { expect(placement.eids).to.be.an('array') expect(placement.eids.length).to.be.equal(3) for (let v of placement.eids) { - expect(v.source).to.be.oneOf(['britepool.com', 'identityLink', 'adserver.org']) + expect(v).to.have.all.keys('source', 'uids') + expect(v.source).to.be.oneOf('britepool.com', 'identityLink', 'adserver.org') + expect(v.uids).to.be.an('array').with.length.equal(1); + expect(v.uids[0]).to.have.property('id') + expect(v.uids[0].id).to.be.oneOf('britepoolid123', 'idl_env123', 'tdid123') } } }); From d65984e0fa3d1a45a038f4d92a8001962ad931c6 Mon Sep 17 00:00:00 2001 From: "huddled.masses" Date: Tue, 10 Mar 2020 12:05:44 +0200 Subject: [PATCH 32/36] fix --- test/spec/modules/colossussspBidAdapter_spec.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/spec/modules/colossussspBidAdapter_spec.js b/test/spec/modules/colossussspBidAdapter_spec.js index 9b2140f6940..398b45c87cb 100644 --- a/test/spec/modules/colossussspBidAdapter_spec.js +++ b/test/spec/modules/colossussspBidAdapter_spec.js @@ -120,10 +120,10 @@ describe('ColossussspAdapter', function () { expect(placement.eids.length).to.be.equal(3) for (let v of placement.eids) { expect(v).to.have.all.keys('source', 'uids') - expect(v.source).to.be.oneOf('britepool.com', 'identityLink', 'adserver.org') + expect(v.source).to.be.oneOf(['britepool.com', 'identityLink', 'adserver.org']) expect(v.uids).to.be.an('array').with.length.equal(1); expect(v.uids[0]).to.have.property('id') - expect(v.uids[0].id).to.be.oneOf('britepoolid123', 'idl_env123', 'tdid123') + expect(v.uids[0].id).to.be.oneOf(['britepoolid123', 'idl_env123', 'tdid123']) } } }); From 1595a00f13bfa47f20b1c843e09bb5ee89fb33aa Mon Sep 17 00:00:00 2001 From: "huddled.masses" Date: Tue, 10 Mar 2020 12:07:53 +0200 Subject: [PATCH 33/36] fix --- test/spec/modules/colossussspBidAdapter_spec.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/test/spec/modules/colossussspBidAdapter_spec.js b/test/spec/modules/colossussspBidAdapter_spec.js index 398b45c87cb..e5e8f2b5ac7 100644 --- a/test/spec/modules/colossussspBidAdapter_spec.js +++ b/test/spec/modules/colossussspBidAdapter_spec.js @@ -121,7 +121,8 @@ describe('ColossussspAdapter', function () { for (let v of placement.eids) { expect(v).to.have.all.keys('source', 'uids') expect(v.source).to.be.oneOf(['britepool.com', 'identityLink', 'adserver.org']) - expect(v.uids).to.be.an('array').with.length.equal(1); + expect(v.uids).to.be.an('array'); + expect(v.uids.length).to.be.equal(1) expect(v.uids[0]).to.have.property('id') expect(v.uids[0].id).to.be.oneOf(['britepoolid123', 'idl_env123', 'tdid123']) } From 42c5e53bdf2bfbb98f47540b3700bd9e718ff83b Mon Sep 17 00:00:00 2001 From: "huddled.masses" Date: Tue, 10 Mar 2020 14:28:44 +0200 Subject: [PATCH 34/36] add gdpr support --- modules/colossussspBidAdapter.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/modules/colossussspBidAdapter.js b/modules/colossussspBidAdapter.js index e1e7d873402..c0dfe345c30 100644 --- a/modules/colossussspBidAdapter.js +++ b/modules/colossussspBidAdapter.js @@ -80,6 +80,10 @@ export const spec = { if (bidderRequest.uspConsent) { request.ccpa = bidderRequest.uspConsent; } + if (bidderRequest.gdprConsent) { + request.gdpr = bidderRequest.gdprConsent.consentString + request.gdprRequire = bidderRequest.gdprConsent.gdprApplies ? 1 : 0 + } } for (let i = 0; i < validBidRequests.length; i++) { From 480f127411e775498449fcaf726c5af575955555 Mon Sep 17 00:00:00 2001 From: "huddled.masses" Date: Tue, 10 Mar 2020 14:42:40 +0200 Subject: [PATCH 35/36] add gdpr support --- modules/colossussspBidAdapter.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/colossussspBidAdapter.js b/modules/colossussspBidAdapter.js index c0dfe345c30..68762035f67 100644 --- a/modules/colossussspBidAdapter.js +++ b/modules/colossussspBidAdapter.js @@ -81,8 +81,8 @@ export const spec = { request.ccpa = bidderRequest.uspConsent; } if (bidderRequest.gdprConsent) { - request.gdpr = bidderRequest.gdprConsent.consentString - request.gdprRequire = bidderRequest.gdprConsent.gdprApplies ? 1 : 0 + request.gdpr_consent = bidderRequest.gdprConsent.consentString || 'ALL' + request.gdpr_require = bidderRequest.gdprConsent.gdprApplies ? 1 : 0 } } From a51a3e13ba1a0269366f75bf512ee8e85f2a6486 Mon Sep 17 00:00:00 2001 From: "huddled.masses" Date: Thu, 16 Apr 2020 19:19:53 +0300 Subject: [PATCH 36/36] id5id support --- modules/colossussspBidAdapter.js | 1 + test/spec/modules/colossussspBidAdapter_spec.js | 7 ++++--- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/modules/colossussspBidAdapter.js b/modules/colossussspBidAdapter.js index 68762035f67..baa60a76a0d 100644 --- a/modules/colossussspBidAdapter.js +++ b/modules/colossussspBidAdapter.js @@ -102,6 +102,7 @@ export const spec = { if (bid.userId) { getUserId(placement.eids, bid.userId.britepoolid, 'britepool.com'); getUserId(placement.eids, bid.userId.idl_env, 'identityLink'); + getUserId(placement.eids, bid.userId.id5id, 'id5-sync.com') getUserId(placement.eids, bid.userId.tdid, 'adserver.org', { rtiPartner: 'TDID' }); diff --git a/test/spec/modules/colossussspBidAdapter_spec.js b/test/spec/modules/colossussspBidAdapter_spec.js index e5e8f2b5ac7..bb541d1041d 100644 --- a/test/spec/modules/colossussspBidAdapter_spec.js +++ b/test/spec/modules/colossussspBidAdapter_spec.js @@ -108,6 +108,7 @@ describe('ColossussspAdapter', function () { bid.userId.britepoolid = 'britepoolid123'; bid.userId.idl_env = 'idl_env123'; bid.userId.tdid = 'tdid123'; + bid.userId.id5id = 'id5id123' let serverRequest = spec.buildRequests([bid], bidderRequest); it('Returns valid data if array of bids is valid', function () { let data = serverRequest.data; @@ -117,14 +118,14 @@ describe('ColossussspAdapter', function () { let placement = placements[i]; expect(placement).to.have.property('eids') expect(placement.eids).to.be.an('array') - expect(placement.eids.length).to.be.equal(3) + expect(placement.eids.length).to.be.equal(4) for (let v of placement.eids) { expect(v).to.have.all.keys('source', 'uids') - expect(v.source).to.be.oneOf(['britepool.com', 'identityLink', 'adserver.org']) + expect(v.source).to.be.oneOf(['britepool.com', 'identityLink', 'adserver.org', 'id5-sync.com']) expect(v.uids).to.be.an('array'); expect(v.uids.length).to.be.equal(1) expect(v.uids[0]).to.have.property('id') - expect(v.uids[0].id).to.be.oneOf(['britepoolid123', 'idl_env123', 'tdid123']) + expect(v.uids[0].id).to.be.oneOf(['britepoolid123', 'idl_env123', 'tdid123', 'id5id123']) } } });