Skip to content

Commit

Permalink
UOE-6610: Upgrade prebid-server to 0.170.0 (#190)
Browse files Browse the repository at this point in the history
* Smaato: Add support for app (prebid#1767)

Co-authored-by: Bernhard Pickenbrock <[email protected]>

* Update sync types (prebid#1770)

* 33across: Fix Shared Memory Overwriting (prebid#1764)

This reverts commit f7df258.

* Fix race condition in Yeahmobi adapter (prebid#1761)

Co-authored-by: Gus Carreon <[email protected]>

* Pubnative: Fix Shared Memory Overwriting (prebid#1760)

* Add request for registration (prebid#1780)

* Update OpenRTB Library (prebid#1733)

* Tappx changes - Backward compatible change of version (prebid#1777)

Co-authored-by: ubuntu <[email protected]>
Co-authored-by: Albert Grandes <[email protected]>

* DMX: Enforcing w and h in imp (prebid#1778)

Co-authored-by: steve-a-districtm <[email protected]>

* Remove Authorization Headers From Debug Response (prebid#1779)

* Hide Authorization Headers In Debug Response

* MakeExtHeaders Tests

* Add Empty Test

* Use http.Header Methods

* Updates From Code Review

* Fix Merge Conflict

* New Adapter: Bidmachine (prebid#1769)

* New Adapter: Criteo (prebid#1775)

* Fix shared memory issue when stripping authorization header from bid requests (prebid#1790)

* RTB House: update parameters (prebid#1785)

* update parameters required by RTB House adapter

* tabs to spaces

Co-authored-by: Przemyslaw Iwanczak <[email protected]>

* Generate seatbid[].bid[].ext.prebid.bidid (prebid#1772)

* Basic GDPR enforcement for specific publisher-vendors. (prebid#1782)

* New Adapter: Zemanta (prebid#1774)

* add zemanta adapter

* update openrtb package for zemanta

* fix loop iterator reference bug

* fix getMediaTypeForImp to match server behavior

* Zemanta: Rename Adapter To Outbrain (prebid#1797)

* Update openrtb library to v15 (prebid#1802)

* IX: Set bidVideo when category and duration is available (prebid#1794)

* Update IX defaults (prebid#1799)

Co-authored-by: Mike Burns <[email protected]>

* Update Adyoulike endpoint to hit production servers (prebid#1805)

* Openx: use bidfloor if set - prebid.js adapter behavior  (prebid#1795)

* [ORBIDDER] add gvlVendorID and set bid response currency (prebid#1798)

* New Adapter: ADXCG (prebid#1803)

* Update kidoz properties to type string (prebid#1808)

Remove definitions object from schema and define types and other parameters directly in properties objects to ensure compatibility with more downstream systems that use this schema.

* Update bidmachine properties to type string (prebid#1809)

Remove definitions object from schema and define types and other parameters directly in properties objects to ensure compatibility with more downstream systems that use this schema.

* transform native eventtrackers to imptrackers and jstracker (prebid#1811)

* TheMediaGrid: Added processing of imp[].ext.data (prebid#1807)

* New Adapter: adf (adformOpenRTB) (prebid#1815)

* initial adformOpenRTB adapter implementation

* do not make request copy

* rename adfromOpenRTB adapter to adf

* fix user sync url

* Set Adhese gvl id and vast modification flag (prebid#1821)

* Added gvlVendorID for mobilefuse (prebid#1822)

* AppNexus: reform bid floor handling (prebid#1814)

* PubNative: Add GVL Vendor ID (prebid#1824)

* InMobi: adding gvlVendorID to static yaml (prebid#1826)

* Epom Adapter: configure vendor id (GVL ID) (prebid#1828)

Co-authored-by: Vasyl Zarva <[email protected]>

* Update Adtarget gvlid (prebid#1829)

* Adding site to static yaml, and exemplary tests (prebid#1827)

* AdOcean adapter - add support for mobile apps (prebid#1830)

* Allow Native Ad Exchange Specific Types (prebid#1810)

* PubMatic: Fix Banner Size Assignment When No AdSlot Provided (prebid#1825)

* New Adapter: Interactive Offers (prebid#1835)

* IX: Set category in bid.cat (prebid#1837)

* New Adapter: Madvertise (prebid#1834)

* Conversant bid floor handling (prebid#1840)

* Adf adapter: banner and video mediatype support (prebid#1841)

* Test for data race conditions in adapters (prebid#1756)

* Revcontent adapter: add vendor id (GVL ID) (prebid#1849)

* Refactor: Removed unused GDPR return value (prebid#1839)

* New Adapter : Kayzen (prebid#1838)

* Add Kayzen Adapter

* Beachfront: Add schain support (prebid#1844)

Co-authored-by: jim naumann <[email protected]>

* Pangle: add appid & placementid to bidder param (prebid#1842)

Co-authored-by: hcai <[email protected]>

* New Adapter: BidsCube (prebid#1843)

* add BidsCube adapter

* add BidsCube adapter

* add BidsCube adapter

* add BidsCube adapter

* add BidsCube adapter

* add BidsCube adapter

Co-authored-by: vlad <[email protected]>

* Add Viewdeos alias (prebid#1846)

* [Smaato] Adding TCF 2.0 vendor id (prebid#1852)

* Pass Global Privacy Control header to bidders (prebid#1789)

* Feature Request: Ability to pass Sec-GPC header to the bidder endpoints (prebid#1712)

* making Sec-GPC value check more strict

* minor syntax change

* gofmt fixes

* updates against draft-code-review:one, more to come soon.

* adding a unit test

* Adding a test and request header clone update

* modified one test and related logic

* modifying the last test added with slight more modification of the logic

* GDPR: Don't Call Bidder If It Lacks Purpose 2 Legal Basis (prebid#1851)

* Update go-gdpr package to v0.9.0 (prebid#1856)

* Marsmedia - add GVL ID to bidder config file (prebid#1864)

Co-authored-by: Vladi Izgayev <[email protected]>

* PubMatic: Added parameters dctr & pmzoneid (prebid#1865)

* Better Support For Go Modules (prebid#1862)

* IX: Update usersync default id (prebid#1873)

* AppNexus: Make Ad Pod Id Optional (prebid#1792)

* Bugfix for applyCategoryMapping (prebid#1857)

* Facebook: Drop consented providers (prebid#1867)

* Between: Fix for bid floor issue#1787 (prebid#1870)

Co-authored-by: Egor Skorokhodov <[email protected]>

* Beachfront: Fix for bid floor issue#1787 (prebid#1878)

Co-authored-by: jim naumann <[email protected]>

* Updating interactiveoffers contact info (prebid#1881)

* Docs metrics configuration (prebid#1850)

* Criteo: update maintainer email address (prebid#1884)

* New Adapter: BrightMountainMedia (prebid#1855)

New Adapter : BrightMountainMedia

* New Adapter: AlgoriX (prebid#1861)

* Remove LifeStreet + Legacy Cleanup (prebid#1883)

* New Adapter: E-Volution  (prebid#1868)

* [criteo] accept zoneId and networkId alternate case (prebid#1869)

* Unit test random map order fix (prebid#1887)

Co-authored-by: Veronika Solovei <[email protected]>

* Request Provided Currency Rates (prebid#1753)

* Debug override header (prebid#1853)

* Remove GDPR TCF1 (prebid#1854)

* Rename GDPR UserSyncIfAmbiguous to DefaultValue (prebid#1858)

* Accept bidfloor from impression to fix issue prebid#1787 for sovrn adapter (prebid#1886)

* GDPR: require host specify default value (prebid#1859)

* New Adapter: Smile Wanted (prebid#1877)

* New Adapter: Smile Wanted

* Implementations of changes requested by : prebid#1877 (review)

* Improvement of test coverage as requested.

* Implementations of changes requested by : prebid#1877 (review)

* Fix a weak vendor enforcement bug where vendor does not exist (prebid#1890)

* Pubmatic: Sending GPT slotname in impression extension (prebid#1880)

* Update To Go 1.16 (prebid#1888)

* Friendlier Startup Error Messages (prebid#1894)

* Second fix for weak vendor enforcement (prebid#1896)

* Rubicon: hardcode EUR to USD for floors (prebid#1899)

Co-authored-by: Serhii Nahornyi <[email protected]>

* Outbrain adapter: overwrite tagid only if it exists (prebid#1895)

* New Adapter: BidMyAdz (prebid#1882)

Co-authored-by: BidMyAdz <[email protected]>

* Currency Conversion Utility Function (prebid#1901)

* New Adapter: SA Lunamedia  (prebid#1891)

* Removed Digitrust From Prebid Server (prebid#1892)

Co-authored-by: avolcy <[email protected]>

* IX: merge eventtrackers with imptrackers for native bid responses (prebid#1900)

* Inmobi: user sync (prebid#1911)

* Rubicon: Update segtax logic (prebid#1909)

Co-authored-by: Serhii Nahornyi <[email protected]>

* New Adapter: Axonix (prebid#1912)

* New Axonix adapter

* Changed endpoint

* Rename adapter type

* Leave in examplary only the basic test fixtures

* PR comments

* Rubicon: Fix Nil Reference Panic (prebid#1918)

* GDPR: host-level per-purpose vendor exceptions config (prebid#1893)

Co-authored-by: Scott Kay <[email protected]>

* Criteo - Fix fields mapping error when building bid from bidder response (prebid#1917)

* Smaato: Rework multi imp support and add adpod support (prebid#1902)

* Allowed $0.00 price bids if there are deals (prebid#1910)

* GDPR: host-level per-purpose enforce vendor signals config (prebid#1921)

* Add GDPR host-level per-purpose enforce vendor signals config

* Update config defaults test with TCF2 object compare

* Fix for fetcher warning at server startup  (prebid#1914)

Co-authored-by: Veronika Solovei <[email protected]>

* Request Wrapper first pass (prebid#1784)

* Rubicon: Use currency conversion function (prebid#1924)

Co-authored-by: Serhii Nahornyi <[email protected]>

* New Adapter: operaads (prebid#1916)

* Fix Beachfront data race condition (prebid#1915)

Co-authored-by: Jim Naumann <[email protected]>

* Sharethrough: Add support for GPID (prebid#1925)

* Admixer: Fix for bid floor issue#1787 (prebid#1872)

* InMobi: adding native support (prebid#1928)

* Tappx: new bidder params (prebid#1931)

Co-authored-by: Albert Grandes <[email protected]>

* Fix CVE-2020-35381 (prebid#1942)

* Smaato: Split multiple media types (prebid#1930)

Co-authored-by: Bernhard Pickenbrock <[email protected]>

* New adapter: Adagio (prebid#1907)

* IX: update required site id field to be more flexible (prebid#1934)

Co-authored-by: Joshua Gross <[email protected]>

* Add SmartRTB adapter (prebid#1071)

* Adds timeout notifications for Facebook (prebid#1182)

* Add Adoppler bidder support. (prebid#1186)

* Add Adoppler bidder support.

* Address code review comments. Use JSON-templates for testing.

* Fix misprint; Add url.PathEscape call for adunit URL parameter.

* Kidoz adapter (prebid#1210)

Co-authored-by: Ryan Haksi <[email protected]>

* AMP CCPA Fix (prebid#1187)

* Add kidoz bidder info (prebid#1257)

got this info from email communication with kidoz

* populate the app ID in the FAN timeout notif url with the publisher ID (prebid#1265)

and the auction with the request ID

Co-authored-by: Aadesh Patel <[email protected]>

* * Add PubMatic bidder doc file (prebid#1255)

* Add app video capability to PubMatic bidder info file

* Added OpenX Bidder adapter documentation (prebid#1291)

* Restore the AMP privacy exception as an option. (prebid#1311)

* Restore the AMP privacy exception as an option.

* Adds missing test case

* More PR feedback

* Remove unused constant

* Comment tweak

* Add Yieldlab Adapter (prebid#1287)

Co-authored-by: Mirko Feddern <[email protected]>
Signed-off-by: Alex Klinkert <[email protected]>

Co-authored-by: Alexander Pinnecke <[email protected]>
Co-authored-by: Alex Klinkert <[email protected]>
Co-authored-by: Mirko Feddern <[email protected]>

* Add Pubnative bidder documentation (prebid#1340)

* Add Adtarget server adapter (prebid#1319)

* Add Adtarget server adapter

* Suggested changes for Adtarget

* Avoid overriding AMP request original size with mutli-size (prebid#1352)

* Adds Avocet adapter (prebid#1354)

* Adding Smartadserver adapter (prebid#1346)

Co-authored-by: tadam <[email protected]>

* Metrics for TCF 2 adoption (prebid#1360)

* Add support for multiple root schain nodes (prebid#1374)

* Facebook Only Supports App Impressions (prebid#1396)

* Add Outgoing Connection Metrics (prebid#1343)

* OpenX adapter: pass optional platform (PBID-598) (prebid#1421)

* Adds keyvalue hb_format support (prebid#1414)

* feat: Add new logger module - Pubstack Analytics Module (prebid#1331)

* Pubstack Analytics V1 (#11)

* V1 Pubstack (#7)

* feat: Add Pubstack Logger (#6)

* first version of pubstack analytics

* bypass viperconfig

* commit #1

* gofmt

* update configuration and make the tests pass

* add readme on how to configure the adapter and update the network calls

* update logging and fix intake url definition

* feat: Pubstack Analytics Connector

* fixing go mod

* fix: bad behaviour on appending path to auction url

* add buffering

* support bootstyrap like configuration

* implement route for all the objects

* supports termination signal handling for goroutines

* move readme to the correct location

* wording

* enable configuration reload + add tests

* fix logs messages

* fix tests

* fix log line

* conclude merge

* merge

* update go mod

Co-authored-by: Amaury Ravanel <[email protected]>

* fix duplicated channel keys

Co-authored-by: Amaury Ravanel <[email protected]>

* first pass - PR reviews

* rename channel* -> eventChannel

* dead code

* Review (#10)

* use json.Decoder

* update documentation

* use nil instead []byte("")

* clean code

* do not use http.DefaultClient

* fix race condition (need validation)

* separate the sender and buffer logics

* refactor the default configuration

* remove error counter

* Review GP + AR

* updating default config

* add more logs

* remove alias fields in json

* fix json serializer

* close event channels

Co-authored-by: Amaury Ravanel <[email protected]>

* fix race condition

* first pass (pr reviews)

* refactor: store enabled modules into a dedicated struct

* stop goroutine

* test: improve coverage

* PR Review

* Revert "refactor: store enabled modules into a dedicated struct"

This reverts commit f57d9d6.

# Conflicts:
#	analytics/config/config_test.go

Co-authored-by: Amaury Ravanel <[email protected]>

* New bid adapter for Smaato (prebid#1413)

Co-authored-by: vikram <[email protected]>
Co-authored-by: Stephan <[email protected]>

* New Adprime adapter (prebid#1418)

Co-authored-by: Aiholkin <[email protected]>

* Enable geo activation of GDPR flag (prebid#1427)

* moving docs to website repo (prebid#1443)

* Add support for Account configuration (PBID-727, prebid#1395) (prebid#1426)

* Pass Through First Party Context Data (prebid#1479)

* between adapter (prebid#1437)

Co-authored-by: Alexey Elymanov <[email protected]>

* Bidder Uniqueness Gatekeeping Test (prebid#1506)

* Smarty ads adapter (prebid#1500)

Co-authored-by: Kushneryk Pavlo <[email protected]>
Co-authored-by: user <[email protected]>

* Vtrack and event endpoints (prebid#1467)

* Add bidder name key support (prebid#1496)

* Add metrics to capture stored data fetch all/delta durations with fetch status (prebid#1515)

* Acuity ads adapter (prebid#1537)

Co-authored-by: Kushneryk Pavlo <[email protected]>

* Yieldmo app support in yaml file (prebid#1542)

Co-authored-by: Winston <[email protected]>

* Add client/AccountID support into Adoppler adapter. (prebid#1535)

* 33Across: Add video support in adapter (prebid#1557)

* Fix bug in request.imp.ext Validation (prebid#1575)

* First draft

* Brian's reivew

* Removed leftover comments

Co-authored-by: Gus Carreon <[email protected]>

* New Adapter Initialization Framework (prebid#1532)

* Fix 33Across App Handling (prebid#1602)

* Fix adapter JSON tests to have the right test structure (prebid#1589)

* Fix JSON EMX Digital

* Fix JSON Brightroll

* Fix JSON Beintoo

* Fix JSON Gamoshi

* Fix JSON Kubient

* Fix JSON Marsmedia

* Fix JSON Nanointeractive

* Fix JSON Telaria

* Fix JSON valueimpression

* Fix JSON smartyads

* Fix JSON rhythmone

* Fix JSON krushmedia

* Fix JSON cpmstar

* Fix JSON acuityads

* Fix JSON avocet

* Rename wrongly named acuity ads test file

* Fix JSON gamma

* Add expected no bid responses

* Fixed indentation and asesome-markup

* Added usersync support to Between SSP adapter; Major fixes and refactor (prebid#1587)

Co-authored-by: Egor Skorokhodov <[email protected]>

* 33Across: Add support for multi-imp requests (prebid#1609)

* Remove legacy GDPR AMP config flag used to prevent buyer ID scrub on AMP requests (prebid#1565)

* New Adapter: Mobfox (prebid#1585)

Co-authored-by: mobfox <[email protected]>

* New Adapter: Revcontent (prebid#1622)

* Audit beachfront tests and change some videoResponseType details (prebid#1638)

* Tappx User Syncer + Site Update (prebid#1674)

Co-authored-by: ubuntu <[email protected]>
Co-authored-by: Albert Grandes <[email protected]>

* Beachfront Additional tests (prebid#1679)

* added place holder files for all but a couple of the intended new tests. I need to grok what those couple mean before being able to name a file.

* This covers most of the suggested cases and a couple more that occured to me. I'll look at the couple that I held off on next.

* added the unmarshal tests and found a couple problems to address in the process.

* removed my __debug_bin. should be in gitignore.

* A bit of clean up and commenting. Bumped version number. Added __debug_bin to .gitignore. This is the debugging binary created by Visual Studio Code, or at least version 1.52.1.

* missed a bunch of version strings

* removed IP faker

* If IP is not included in an AdM request, an error is now thrown for the AdM imp instead of faking it. The AdM endpoint is the only one that requires an IP. Also, added several "no-ip" test cases.

* Whent back to the fake IP solution instead of the error. Removed most of the "no-ip" test cases, leaving one.

* changed ip in adm-video.json to not match the faker ip

* removed a debugging comment

* Mobfox: Add rout to adexcange (prebid#1702)

Co-authored-by: mobfox <[email protected]>

* Add Support For SkAdN + Refactor Split Imps (prebid#1741)

* No Longer Move bid.ext To bid.ext.bidder (prebid#1742)

* No Longer Move bid.ext To bid.ext.bidder

* Remove Similar Behavior From seatbid.ext

* Avoid Second Bid Copy

* Removed Unused seatbid.ext

* Debug warnings (prebid#1724)

Co-authored-by: Veronika Solovei <[email protected]>

* FPD: Allow imp.ext.data To Passthrough To Adapters (prebid#1765)

* Basic GDPR enforcement for specific publisher-vendors. (prebid#1782)

* New Adapter: Zemanta (prebid#1774)

* add zemanta adapter

* update openrtb package for zemanta

* fix loop iterator reference bug

* fix getMediaTypeForImp to match server behavior

* Zemanta: Rename Adapter To Outbrain (prebid#1797)

* New Adapter: adf (adformOpenRTB) (prebid#1815)

* initial adformOpenRTB adapter implementation

* do not make request copy

* rename adfromOpenRTB adapter to adf

* fix user sync url

* Set Adhese gvl id and vast modification flag (prebid#1821)

* Added gvlVendorID for mobilefuse (prebid#1822)

* AppNexus: reform bid floor handling (prebid#1814)

* PubNative: Add GVL Vendor ID (prebid#1824)

* InMobi: adding gvlVendorID to static yaml (prebid#1826)

* Epom Adapter: configure vendor id (GVL ID) (prebid#1828)

Co-authored-by: Vasyl Zarva <[email protected]>

* Update Adtarget gvlid (prebid#1829)

* Adding site to static yaml, and exemplary tests (prebid#1827)

* AdOcean adapter - add support for mobile apps (prebid#1830)

* Allow Native Ad Exchange Specific Types (prebid#1810)

* PubMatic: Fix Banner Size Assignment When No AdSlot Provided (prebid#1825)

* New Adapter: Interactive Offers (prebid#1835)

* IX: Set category in bid.cat (prebid#1837)

* New Adapter: Madvertise (prebid#1834)

* Conversant bid floor handling (prebid#1840)

* Adf adapter: banner and video mediatype support (prebid#1841)

* Test for data race conditions in adapters (prebid#1756)

* Revcontent adapter: add vendor id (GVL ID) (prebid#1849)

* Refactor: Removed unused GDPR return value (prebid#1839)

* New Adapter : Kayzen (prebid#1838)

* Add Kayzen Adapter

* Beachfront: Add schain support (prebid#1844)

Co-authored-by: jim naumann <[email protected]>

* Pangle: add appid & placementid to bidder param (prebid#1842)

Co-authored-by: hcai <[email protected]>

* New Adapter: BidsCube (prebid#1843)

* add BidsCube adapter

* add BidsCube adapter

* add BidsCube adapter

* add BidsCube adapter

* add BidsCube adapter

* add BidsCube adapter

Co-authored-by: vlad <[email protected]>

* Add Viewdeos alias (prebid#1846)

* [Smaato] Adding TCF 2.0 vendor id (prebid#1852)

* Pass Global Privacy Control header to bidders (prebid#1789)

* Feature Request: Ability to pass Sec-GPC header to the bidder endpoints (prebid#1712)

* making Sec-GPC value check more strict

* minor syntax change

* gofmt fixes

* updates against draft-code-review:one, more to come soon.

* adding a unit test

* Adding a test and request header clone update

* modified one test and related logic

* modifying the last test added with slight more modification of the logic

* GDPR: Don't Call Bidder If It Lacks Purpose 2 Legal Basis (prebid#1851)

* Update go-gdpr package to v0.9.0 (prebid#1856)

* Marsmedia - add GVL ID to bidder config file (prebid#1864)

Co-authored-by: Vladi Izgayev <[email protected]>

* PubMatic: Added parameters dctr & pmzoneid (prebid#1865)

* Better Support For Go Modules (prebid#1862)

* AppNexus: Make Ad Pod Id Optional (prebid#1792)

* Facebook: Drop consented providers (prebid#1867)

* Between: Fix for bid floor issue#1787 (prebid#1870)

Co-authored-by: Egor Skorokhodov <[email protected]>

* Beachfront: Fix for bid floor issue#1787 (prebid#1878)

Co-authored-by: jim naumann <[email protected]>

* Updating interactiveoffers contact info (prebid#1881)

* Docs metrics configuration (prebid#1850)

* Criteo: update maintainer email address (prebid#1884)

* New Adapter: BrightMountainMedia (prebid#1855)

New Adapter : BrightMountainMedia

* New Adapter: AlgoriX (prebid#1861)

* Remove LifeStreet + Legacy Cleanup (prebid#1883)

* New Adapter: E-Volution  (prebid#1868)

* [criteo] accept zoneId and networkId alternate case (prebid#1869)

* Request Provided Currency Rates (prebid#1753)

* Debug override header (prebid#1853)

* Remove GDPR TCF1 (prebid#1854)

* Rename GDPR UserSyncIfAmbiguous to DefaultValue (prebid#1858)

* Accept bidfloor from impression to fix issue prebid#1787 for sovrn adapter (prebid#1886)

* GDPR: require host specify default value (prebid#1859)

* New Adapter: Smile Wanted (prebid#1877)

* New Adapter: Smile Wanted

* Implementations of changes requested by : prebid#1877 (review)

* Improvement of test coverage as requested.

* Implementations of changes requested by : prebid#1877 (review)

* Fix a weak vendor enforcement bug where vendor does not exist (prebid#1890)

* Update To Go 1.16 (prebid#1888)

* Friendlier Startup Error Messages (prebid#1894)

* Second fix for weak vendor enforcement (prebid#1896)

* Rubicon: hardcode EUR to USD for floors (prebid#1899)

Co-authored-by: Serhii Nahornyi <[email protected]>

* Outbrain adapter: overwrite tagid only if it exists (prebid#1895)

* New Adapter: BidMyAdz (prebid#1882)

Co-authored-by: BidMyAdz <[email protected]>

* Currency Conversion Utility Function (prebid#1901)

* New Adapter: SA Lunamedia  (prebid#1891)

* Removed Digitrust From Prebid Server (prebid#1892)

Co-authored-by: avolcy <[email protected]>

* IX: merge eventtrackers with imptrackers for native bid responses (prebid#1900)

* Inmobi: user sync (prebid#1911)

* Rubicon: Update segtax logic (prebid#1909)

Co-authored-by: Serhii Nahornyi <[email protected]>

* New Adapter: Axonix (prebid#1912)

* New Axonix adapter

* Changed endpoint

* Rename adapter type

* Leave in examplary only the basic test fixtures

* PR comments

* Rubicon: Fix Nil Reference Panic (prebid#1918)

* git rebase

* Reverted some changes after prebid-server upgrade

* Fixed ctv_auction.go after merging prebid-0.170.0

* Added missing gdpr.default_value

* Updated usersync url for bidder Unruly

Co-authored-by: el-chuck <[email protected]>
Co-authored-by: Bernhard Pickenbrock <[email protected]>
Co-authored-by: Gena <[email protected]>
Co-authored-by: guscarreon <[email protected]>
Co-authored-by: Gus Carreon <[email protected]>
Co-authored-by: bretg <[email protected]>
Co-authored-by: Scott Kay <[email protected]>
Co-authored-by: prebidtappx <[email protected]>
Co-authored-by: ubuntu <[email protected]>
Co-authored-by: Albert Grandes <[email protected]>
Co-authored-by: Steve Alliance <[email protected]>
Co-authored-by: steve-a-districtm <[email protected]>
Co-authored-by: Pavel Dunyashev <[email protected]>
Co-authored-by: Benjamin <[email protected]>
Co-authored-by: Brian Sardo <[email protected]>
Co-authored-by: Przemysław Iwańczak <[email protected]>
Co-authored-by: Przemyslaw Iwanczak <[email protected]>
Co-authored-by: Veronika Solovei <[email protected]>
Co-authored-by: hhhjort <[email protected]>
Co-authored-by: Rok Sušnik <[email protected]>
Co-authored-by: Rok Sušnik <[email protected]>
Co-authored-by: ixjohnny <[email protected]>
Co-authored-by: Michael Burns <[email protected]>
Co-authored-by: Mike Burns <[email protected]>
Co-authored-by: guiann <[email protected]>
Co-authored-by: Laurentiu Badea <[email protected]>
Co-authored-by: Arne Schulz <[email protected]>
Co-authored-by: adxcgcom <[email protected]>
Co-authored-by: agilfix <[email protected]>
Co-authored-by: TheMediaGrid <[email protected]>
Co-authored-by: Jurij Sinickij <[email protected]>
Co-authored-by: mefjush <[email protected]>
Co-authored-by: dtbarne <[email protected]>
Co-authored-by: Pillsoo Shin <[email protected]>
Co-authored-by: Daniel Lawrence <[email protected]>
Co-authored-by: epomrnd <[email protected]>
Co-authored-by: Vasyl Zarva <[email protected]>
Co-authored-by: Marcin Muras <[email protected]>
Co-authored-by: IOTiagoFaria <[email protected]>
Co-authored-by: notmani <[email protected]>
Co-authored-by: johnwier <[email protected]>
Co-authored-by: jcamp-revc <[email protected]>
Co-authored-by: Raghu Teja <[email protected]>
Co-authored-by: Jim Naumann <[email protected]>
Co-authored-by: jim naumann <[email protected]>
Co-authored-by: Hengsheng Cai <[email protected]>
Co-authored-by: hcai <[email protected]>
Co-authored-by: Vladyslav Laktionov <[email protected]>
Co-authored-by: vlad <[email protected]>
Co-authored-by: Ruslan Sibgatullin <[email protected]>
Co-authored-by: Vivek Narang <[email protected]>
Co-authored-by: vladi-mmg <[email protected]>
Co-authored-by: Vladi Izgayev <[email protected]>
Co-authored-by: egsk <[email protected]>
Co-authored-by: Egor Skorokhodov <[email protected]>
Co-authored-by: timoshas <[email protected]>
Co-authored-by: Léonard Labat <[email protected]>
Co-authored-by: BrightMountainMedia <[email protected]>
Co-authored-by: Bugxyb <[email protected]>
Co-authored-by: e-volution-tech <[email protected]>
Co-authored-by: Léonard Labat <[email protected]>
Co-authored-by: Veronika Solovei <[email protected]>
Co-authored-by: Rachel Joyce <[email protected]>
Co-authored-by: Maxime DEYMÈS <[email protected]>
Co-authored-by: Serhii Nahornyi <[email protected]>
Co-authored-by: Serhii Nahornyi <[email protected]>
Co-authored-by: bidmyadz <[email protected]>
Co-authored-by: BidMyAdz <[email protected]>
Co-authored-by: lunamedia <[email protected]>
Co-authored-by: AlexBVolcy <[email protected]>
Co-authored-by: avolcy <[email protected]>
Co-authored-by: Mani Gandham <[email protected]>
Co-authored-by: armon823 <[email protected]>
Co-authored-by: César Fernández <[email protected]>
Co-authored-by: jizeyopera <[email protected]>
Co-authored-by: Mansi Nahar <[email protected]>
Co-authored-by: Jim Naumann <[email protected]>
Co-authored-by: Eddy Pechuzal <[email protected]>
Co-authored-by: avolokha <[email protected]>
Co-authored-by: Olivier <[email protected]>
Co-authored-by: Joshua Gross <[email protected]>
Co-authored-by: Joshua Gross <[email protected]>
Co-authored-by: evanmsmrtb <[email protected]>
Co-authored-by: Viacheslav Chimishuk <[email protected]>
Co-authored-by: rhaksi-kidoz <[email protected]>
Co-authored-by: Ryan Haksi <[email protected]>
Co-authored-by: Aadesh <[email protected]>
Co-authored-by: Aadesh Patel <[email protected]>
Co-authored-by: Mike Chowla <[email protected]>
Co-authored-by: Jimmy Tu <[email protected]>
Co-authored-by: Mirko Feddern <[email protected]>
Co-authored-by: Alexander Pinnecke <[email protected]>
Co-authored-by: Alex Klinkert <[email protected]>
Co-authored-by: Mirko Feddern <[email protected]>
Co-authored-by: Artur Aleksanyan <[email protected]>
Co-authored-by: Richard Lee <[email protected]>
Co-authored-by: Simon Critchley <[email protected]>
Co-authored-by: tadam75 <[email protected]>
Co-authored-by: tadam <[email protected]>
Co-authored-by: gpolaert <[email protected]>
Co-authored-by: Amaury Ravanel <[email protected]>
Co-authored-by: Vikram <[email protected]>
Co-authored-by: vikram <[email protected]>
Co-authored-by: Stephan <[email protected]>
Co-authored-by: Adprime <[email protected]>
Co-authored-by: Aiholkin <[email protected]>
Co-authored-by: Alexey Elymanov <[email protected]>
Co-authored-by: Alexey Elymanov <[email protected]>
Co-authored-by: Kushneryk Pavel <[email protected]>
Co-authored-by: Kushneryk Pavlo <[email protected]>
Co-authored-by: user <[email protected]>
Co-authored-by: Daniel Barrigas <[email protected]>
Co-authored-by: Cameron Rice <[email protected]>
Co-authored-by: AcuityAdsIntegrations <[email protected]>
Co-authored-by: Winston-Yieldmo <[email protected]>
Co-authored-by: Winston <[email protected]>
Co-authored-by: Aparna Rao <[email protected]>
Co-authored-by: Gus Carreon <[email protected]>
Co-authored-by: mobfxoHB <[email protected]>
  • Loading branch information
Show file tree
Hide file tree
Showing 32 changed files with 832 additions and 110 deletions.
4 changes: 1 addition & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,7 @@ of exported types.

Want to [add an adapter](https://docs.prebid.org/prebid-server/developers/add-new-bidder-go.html)? Found a bug? Great!

Report bugs, request features, and suggest improvements [on Github](https://github.com/prebid/prebid-server/issues).

Or better yet, [open a pull request](https://github.com/prebid/prebid-server/compare) with the changes you'd like to see.
Or better yet, [open a pull request](https://github.com/PubMatic-OpenWrap/prebid-server/compare) with the changes you'd like to see.

## IDE Recommendations

Expand Down
4 changes: 3 additions & 1 deletion adapters/appnexus/appnexus.go
Original file line number Diff line number Diff line change
Expand Up @@ -374,13 +374,15 @@ func (a *AppNexusAdapter) MakeRequests(request *openrtb2.BidRequest, reqInfo *ad

imps := request.Imp

// Commenting out the following piece of code to avoid populating adpod_id in the Appnexus request (ref: https://inside.pubmatic.com:9443/jira/browse/UOE-6196)

// For long form requests if adpodId feature enabled, adpod_id must be sent downstream.
// Adpod id is a unique identifier for pod
// All impressions in the same pod must have the same pod id in request extension
// For this all impressions in request should belong to the same pod
// If impressions number per pod is more than maxImpsPerReq - divide those imps to several requests but keep pod id the same
// If adpodId feature disabled and impressions number per pod is more than maxImpsPerReq - divide those imps to several requests but do not include ad pod id
if isVIDEO == 1 && *adPodId {
/*if isVIDEO == 1 && *adPodId {
podImps := groupByPods(imps)
requests := make([]*adapters.RequestData, 0, len(podImps))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@
"id": "test-request-id",
"ext": {
"appnexus": {
"adpod_id": "5577006791947779410",
"hb_source": 6
},
"prebid": {}
Expand Down
1 change: 0 additions & 1 deletion adapters/beachfront/beachfronttest/exemplary/banner.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
}
]
},

"httpCalls": [
{
"expectedRequest": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@
"bidfloor": 7,
"secure": 1,
"tagid": "mytag",
"displaymanager": "prebid-s2s",
"displaymanager": "pubmatic-openwrap",
"displaymanagerver": "2.0.0",
"video": {
"api": [1,2],
Expand All @@ -126,7 +126,7 @@
"bidfloor": 1,
"secure": 1,
"tagid": "mytag",
"displaymanager": "prebid-s2s",
"displaymanager": "pubmatic-openwrap",
"displaymanagerver": "2.0.0",
"video": {
"api": [1,2],
Expand Down Expand Up @@ -154,7 +154,7 @@
"bidfloor": 7,
"secure": 1,
"tagid": "mytag",
"displaymanager": "prebid-s2s",
"displaymanager": "pubmatic-openwrap",
"displaymanagerver": "2.0.0",
"video": {
"api": [1,2],
Expand Down Expand Up @@ -182,7 +182,7 @@
"bidfloor": -3,
"secure": 1,
"tagid": "mytag",
"displaymanager": "prebid-s2s",
"displaymanager": "pubmatic-openwrap",
"displaymanagerver": "2.0.0",
"video": {
"api": [1,2],
Expand Down
6 changes: 5 additions & 1 deletion adapters/pubmatic/pubmatic.go
Original file line number Diff line number Diff line change
Expand Up @@ -489,6 +489,10 @@ func assignBannerSize(banner *openrtb2.Banner) (*openrtb2.Banner, error) {
return banner, nil
}

if len(banner.Format) == 0 {
return nil, errors.New(fmt.Sprintf("No sizes provided for Banner %v", banner.Format))
}

return assignBannerWidthAndHeight(banner, banner.Format[0].W, banner.Format[0].H), nil
}

Expand Down Expand Up @@ -545,7 +549,7 @@ func parseImpressionObject(imp *openrtb2.Imp, wrapExt *string, pubID *string) er
imp.Banner = bannerCopy
}

extMap := make(map[string]interface{}, 0)
impExtMap := make(map[string]interface{}, 0)
if pubmaticExt.Keywords != nil && len(pubmaticExt.Keywords) != 0 {
addKeywordsToExt(pubmaticExt.Keywords, extMap)
}
Expand Down
3 changes: 1 addition & 2 deletions analytics/config/config_test.go
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
package config

import (
"github.com/stretchr/testify/assert"
"net/http"
"os"
"testing"

"github.com/mxmCherry/openrtb/v15/openrtb2"
"github.com/stretchr/testify/assert"

"github.com/prebid/prebid-server/analytics"
"github.com/prebid/prebid-server/config"
)
Expand Down
3 changes: 1 addition & 2 deletions analytics/filesystem/file_module_test.go
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
package filesystem

import (
"github.com/prebid/prebid-server/config"
"net/http"
"os"
"strings"
"testing"

"github.com/mxmCherry/openrtb/v15/openrtb2"
"github.com/prebid/prebid-server/config"

"github.com/prebid/prebid-server/analytics"
"github.com/prebid/prebid-server/usersync"
)
Expand Down
12 changes: 10 additions & 2 deletions config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -654,7 +654,7 @@ func (cfg *Configuration) setDerivedDefaults() {
setDefaultUsersync(cfg.Adapters, openrtb_ext.BidderGumGum, "https://rtb.gumgum.com/usync/prbds2s?gdpr={{.GDPR}}&gdpr_consent={{.GDPRConsent}}&us_privacy={{.USPrivacy}}&r="+url.QueryEscape(externalURL)+"%2Fsetuid%3Fbidder%3Dgumgum%26gdpr%3D{{.GDPR}}%26gdpr_consent%3D{{.GDPRConsent}}%26uid%3D")
setDefaultUsersync(cfg.Adapters, openrtb_ext.BidderImprovedigital, "https://ad.360yield.com/server_match?gdpr={{.GDPR}}&gdpr_consent={{.GDPRConsent}}&us_privacy={{.USPrivacy}}&r="+url.QueryEscape(externalURL)+"%2Fsetuid%3Fbidder%3Dimprovedigital%26gdpr%3D{{.GDPR}}%26gdpr_consent%3D{{.GDPRConsent}}%26uid%3D%7BPUB_USER_ID%7D")
setDefaultUsersync(cfg.Adapters, openrtb_ext.BidderInMobi, "https://id5-sync.com/i/495/0.gif?gdpr={{.GDPR}}&gdpr_consent={{.GDPRConsent}}&us_privacy={{.USPrivacy}}&callback="+url.QueryEscape(externalURL)+"%2Fsetuid%3Fbidder%3Dinmobi%26gdpr%3D{{.GDPR}}%26gdpr_consent%3D{{.GDPRConsent}}%26uid%3D%7BID5UID%7D")
setDefaultUsersync(cfg.Adapters, openrtb_ext.BidderIx, "https://ssum.casalemedia.com/usermatchredir?s=194962&gdpr={{.GDPR}}&gdpr_consent={{.GDPRConsent}}&us_privacy={{.USPrivacy}}&cb="+url.QueryEscape(externalURL)+"%2Fsetuid%3Fbidder%3Dix%26gdpr%3D{{.GDPR}}%26gdpr_consent%3D{{.GDPRConsent}}%26uid%3D")
setDefaultUsersync(cfg.Adapters, openrtb_ext.BidderIx, "https://ssum.casalemedia.com/usermatchredir?s=186523&gdpr={{.GDPR}}&gdpr_consent={{.GDPRConsent}}&us_privacy={{.USPrivacy}}&cb="+url.QueryEscape(externalURL)+"%2Fsetuid%3Fbidder%3Dix%26gdpr%3D{{.GDPR}}%26gdpr_consent%3D{{.GDPRConsent}}%26uid%3D")
// openrtb_ext.BidderInvibes doesn't have a good default.
setDefaultUsersync(cfg.Adapters, openrtb_ext.BidderJixie, "https://id.jixie.io/api/sync?pid=&gdpr={{.GDPR}}&gdpr_consent={{.GDPRConsent}}&us_privacy={{.USPrivacy}}&redirect="+url.QueryEscape(externalURL)+"%2Fsetuid%3Fbidder%3Djixie%26gdpr%3D{{.GDPR}}%26gdpr_consent%3D{{.GDPRConsent}}%26uid%3D%25%25JXUID%25%25")
setDefaultUsersync(cfg.Adapters, openrtb_ext.BidderKrushmedia, "https://cs.krushmedia.com/4e4abdd5ecc661643458a730b1aa927d.gif?gdpr={{.GDPR}}&gdpr_consent={{.GDPRConsent}}&us_privacy={{.USPrivacy}}&redir="+url.QueryEscape(externalURL)+"%2Fsetuid%3Fbidder%3Dkrushmedia%26uid%3D%5BUID%5D")
Expand Down Expand Up @@ -753,6 +753,10 @@ func SetupViper(v *viper.Viper, filename string) {
v.SetDefault("http_client.max_idle_connections", 400)
v.SetDefault("http_client.max_idle_connections_per_host", 10)
v.SetDefault("http_client.idle_connection_timeout_seconds", 60)
v.SetDefault("http_client_cache.max_connections_per_host", 0) // unlimited
v.SetDefault("http_client_cache.max_idle_connections", 10)
v.SetDefault("http_client_cache.max_idle_connections_per_host", 2)
v.SetDefault("http_client_cache.idle_connection_timeout_seconds", 60)
v.SetDefault("http_client.tls_handshake_timeout", 0) //no timeout
v.SetDefault("http_client.response_header_timeout", 0) //unlimited
v.SetDefault("http_client.dial_timeout", 0) //no timeout
Expand All @@ -765,6 +769,7 @@ func SetupViper(v *viper.Viper, filename string) {
v.SetDefault("metrics.disabled_metrics.account_adapter_details", false)
v.SetDefault("metrics.disabled_metrics.adapter_connections_metrics", true)
v.SetDefault("metrics.disabled_metrics.adapter_gdpr_request_blocked", false)
v.SetDefault("metrics.disabled_metrics.adapter_connections_metrics", true)
v.SetDefault("metrics.influxdb.host", "")
v.SetDefault("metrics.influxdb.database", "")
v.SetDefault("metrics.influxdb.username", "")
Expand Down Expand Up @@ -916,7 +921,8 @@ func SetupViper(v *viper.Viper, filename string) {
v.SetDefault("adapters.improvedigital.endpoint", "http://ad.360yield.com/pbs")
v.SetDefault("adapters.inmobi.endpoint", "https://api.w.inmobi.com/showad/openrtb/bidder/prebid")
v.SetDefault("adapters.interactiveoffers.endpoint", "https://rtb.ioadx.com/bidRequest/?partnerId=d9e56d418c4825d466ee96c7a31bf1da6b62fa04")
v.SetDefault("adapters.ix.disabled", true)
v.SetDefault("adapters.ix.disabled", false)
v.SetDefault("adapters.ix.endpoint", "http://exchange.indexww.com/pbs?p=192919")
v.SetDefault("adapters.jixie.endpoint", "https://hb.jixie.io/v2/hbsvrpost")
v.SetDefault("adapters.kayzen.endpoint", "https://bids-{{.ZoneID}}.bidder.kayzen.io/?exchange={{.AccountID}}")
v.SetDefault("adapters.krushmedia.endpoint", "http://ads4.krushmedia.com/?c=rtb&m=req&key={{.AccountID}}")
Expand Down Expand Up @@ -996,6 +1002,8 @@ func SetupViper(v *viper.Viper, filename string) {
v.BindEnv("gdpr.default_value")
v.SetDefault("gdpr.enabled", true)
v.SetDefault("gdpr.host_vendor_id", 0)
v.SetDefault("gdpr.default_value", "0")
v.SetDefault("gdpr.usersync_if_ambiguous", true)
v.SetDefault("gdpr.timeouts_ms.init_vendorlist_fetches", 0)
v.SetDefault("gdpr.timeouts_ms.active_vendorlist_fetch", 0)
v.SetDefault("gdpr.non_standard_publishers", []string{""})
Expand Down
2 changes: 1 addition & 1 deletion config/config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ func TestExternalCacheURLValidate(t *testing.T) {
}
}

func TestDefaults(t *testing.T) {
func TestDefaults(t *testing.T) {
cfg, _ := newDefaultConfig(t)

cmpInts(t, "port", cfg.Port, 8000)
Expand Down
2 changes: 1 addition & 1 deletion endpoints/events/vtrack_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -938,7 +938,7 @@ func TestGetVideoEventTracking(t *testing.T) {
name: "valid_scenario",
args: args{
trackerURL: "http://company.tracker.com?eventId=[EVENT_ID]&appbundle=[DOMAIN]",
bid: &openrtb2.Bid{
bid: &openrtb2.Bid{
// AdM: vastXMLWith2Creatives,
},
req: &openrtb2.BidRequest{
Expand Down
8 changes: 0 additions & 8 deletions endpoints/openrtb2/auction.go
Original file line number Diff line number Diff line change
Expand Up @@ -375,14 +375,6 @@ func (deps *endpointDeps) validateRequest(req *openrtb_ext.RequestWrapper) []err
if err := validateCustomRates(reqPrebid.CurrencyConversions); err != nil {
return []error{err}
}

if err := validateSChains(bidExt); err != nil {
return []error{err}
}

if err := deps.validateEidPermissions(bidExt, aliases); err != nil {
return []error{err}
}
}

if (req.Site == nil && req.App == nil) || (req.Site != nil && req.App != nil) {
Expand Down
8 changes: 5 additions & 3 deletions endpoints/openrtb2/ctv_auction.go
Original file line number Diff line number Diff line change
Expand Up @@ -105,8 +105,9 @@ func NewCTVEndpoint(
func (deps *ctvEndpointDeps) CTVAuctionEndpoint(w http.ResponseWriter, r *http.Request, _ httprouter.Params) {
defer util.TimeTrack(time.Now(), "CTVAuctionEndpoint")

var request *openrtb.BidRequest
var response *openrtb.BidResponse
var reqWrapper *openrtb_ext.RequestWrapper
var request *openrtb2.BidRequest
var response *openrtb2.BidResponse
var err error
var errL []error

Expand Down Expand Up @@ -137,10 +138,11 @@ func (deps *ctvEndpointDeps) CTVAuctionEndpoint(w http.ResponseWriter, r *http.R
}()

//Parse ORTB Request and do Standard Validation
request, errL = deps.parseRequest(r)
reqWrapper, errL = deps.parseRequest(r)
if errortypes.ContainsFatalError(errL) && writeError(errL, w, &deps.labels) {
return
}
request = reqWrapper.BidRequest

util.JLogf("Original BidRequest", request) //TODO: REMOVE LOG

Expand Down
1 change: 1 addition & 0 deletions errortypes/code.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ const (
BlacklistedAcctErrorCode
AcctRequiredErrorCode
NoConversionRateErrorCode
NoBidPriceErrorCode
)

// Defines numeric codes for well-known warnings.
Expand Down
2 changes: 2 additions & 0 deletions exchange/adapter_builders.go
Original file line number Diff line number Diff line change
Expand Up @@ -231,6 +231,7 @@ func newAdapterBuilders() map[openrtb_ext.BidderName]adapters.Builder {
openrtb_ext.BidderSomoaudience: somoaudience.Builder,
openrtb_ext.BidderSonobi: sonobi.Builder,
openrtb_ext.BidderSovrn: sovrn.Builder,
openrtb_ext.BidderSpotX: spotx.Builder,
openrtb_ext.BidderSynacormedia: synacormedia.Builder,
openrtb_ext.BidderTappx: tappx.Builder,
openrtb_ext.BidderTelaria: telaria.Builder,
Expand All @@ -241,6 +242,7 @@ func newAdapterBuilders() map[openrtb_ext.BidderName]adapters.Builder {
openrtb_ext.BidderUnicorn: unicorn.Builder,
openrtb_ext.BidderUnruly: unruly.Builder,
openrtb_ext.BidderValueImpression: valueimpression.Builder,
openrtb_ext.BidderVASTBidder: vastbidder.Builder,
openrtb_ext.BidderVerizonMedia: verizonmedia.Builder,
openrtb_ext.BidderViewdeos: adtelligent.Builder,
openrtb_ext.BidderVisx: visx.Builder,
Expand Down
4 changes: 2 additions & 2 deletions exchange/events.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@ package exchange

import (
"encoding/json"
"github.com/mxmCherry/openrtb/v15/openrtb2"
"time"

jsonpatch "github.com/evanphx/json-patch"
"github.com/mxmCherry/openrtb/v15/openrtb2"
"github.com/evanphx/json-patch"
"github.com/prebid/prebid-server/analytics"
"github.com/prebid/prebid-server/config"
"github.com/prebid/prebid-server/endpoints/events"
Expand Down
54 changes: 31 additions & 23 deletions exchange/exchange.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ type exchange struct {
privacyConfig config.Privacy
categoriesFetcher stored_requests.CategoryFetcher
bidIDGenerator BidIDGenerator
trakerURL string
}

// Container to pass out response ext data from the GetAllBids goroutines back into the main thread
Expand Down Expand Up @@ -228,7 +229,7 @@ func (e *exchange) HoldAuction(ctx context.Context, r AuctionRequest, debugLog *
//If includebrandcategory is present in ext then CE feature is on.
if requestExt.Prebid.Targeting != nil && requestExt.Prebid.Targeting.IncludeBrandCategory != nil {
var rejections []string
bidCategory, adapterBids, rejections, err = applyCategoryMapping(ctx, requestExt, adapterBids, e.categoriesFetcher, targData, &randomDeduplicateBidBooleanGenerator{})
bidCategory, adapterBids, rejections, err = applyCategoryMapping(ctx, r.BidRequest, requestExt, adapterBids, e.categoriesFetcher, targData, &randomDeduplicateBidBooleanGenerator{})
if err != nil {
return nil, fmt.Errorf("Error in category mapping : %s", err.Error())
}
Expand Down Expand Up @@ -517,7 +518,6 @@ func (e *exchange) getAllBids(
bidsFound = true
bidIDsCollision = recordAdaptorDuplicateBidIDs(e.me, adapterBids)
}

}
if bidIDsCollision {
// record this request count this request if bid collision is detected
Expand Down Expand Up @@ -662,7 +662,7 @@ func encodeBidResponseExt(bidResponseExt *openrtb_ext.ExtBidResponse) ([]byte, e
return buffer.Bytes(), err
}

func applyCategoryMapping(ctx context.Context, requestExt *openrtb_ext.ExtRequest, seatBids map[openrtb_ext.BidderName]*pbsOrtbSeatBid, categoriesFetcher stored_requests.CategoryFetcher, targData *targetData, booleanGenerator deduplicateChanceGenerator) (map[string]string, map[openrtb_ext.BidderName]*pbsOrtbSeatBid, []string, error) {
func applyCategoryMapping(ctx context.Context, bidRequest *openrtb2.BidRequest, requestExt *openrtb_ext.ExtRequest, seatBids map[openrtb_ext.BidderName]*pbsOrtbSeatBid, categoriesFetcher stored_requests.CategoryFetcher, targData *targetData, booleanGenerator deduplicateChanceGenerator) (map[string]string, map[openrtb_ext.BidderName]*pbsOrtbSeatBid, []string, error) {
res := make(map[string]string)

type bidDedupe struct {
Expand Down Expand Up @@ -796,19 +796,20 @@ func applyCategoryMapping(ctx context.Context, requestExt *openrtb_ext.ExtReques
if !brandCatExt.SkipDedup {
if dupe, ok := dedupe[dupeKey]; ok {

dupeBidPrice, err := strconv.ParseFloat(dupe.bidPrice, 64)
if err != nil {
dupeBidPrice = 0
}
currBidPrice, err := strconv.ParseFloat(pb, 64)
if err != nil {
currBidPrice = 0
}
if dupeBidPrice == currBidPrice {
if booleanGenerator.Generate() {
dupeBidPrice = -1
} else {
currBidPrice = -1
dupeBidPrice, err := strconv.ParseFloat(dupe.bidPrice, 64)
if err != nil {
dupeBidPrice = 0
}
currBidPrice, err := strconv.ParseFloat(pb, 64)
if err != nil {
currBidPrice = 0
}
if dupeBidPrice == currBidPrice {
if booleanGenerator.Generate() {
dupeBidPrice = -1
} else {
currBidPrice = -1
}
}

if dupeBidPrice < currBidPrice {
Expand All @@ -823,12 +824,19 @@ func applyCategoryMapping(ctx context.Context, requestExt *openrtb_ext.ExtReques
if len(oldSeatBid.bids) == 1 {
seatBidsToRemove = append(seatBidsToRemove, dupe.bidderName)
} else {
// This is a very rare, but still possible case where bid needs to be removed from already processed bidder
// This happens when current processing bidder has a bid that has same deduplication key as a bid from already processed bidder
// and already processed bid was selected to be removed
// See example of input data in unit test `TestCategoryMappingTwoBiddersManyBidsEachNoCategorySamePrice`
// Need to remove bid by name, not index in this case
removeBidById(oldSeatBid, dupe.bidID)
// An older bid from a different seatBid we've already finished with
oldSeatBid := (seatBids)[dupe.bidderName]
rejections = updateRejections(rejections, dupe.bidID, "Bid was deduplicated")
if len(oldSeatBid.bids) == 1 {
seatBidsToRemove = append(seatBidsToRemove, dupe.bidderName)
} else {
// This is a very rare, but still possible case where bid needs to be removed from already processed bidder
// This happens when current processing bidder has a bid that has same deduplication key as a bid from already processed bidder
// and already processed bid was selected to be removed
// See example of input data in unit test `TestCategoryMappingTwoBiddersManyBidsEachNoCategorySamePrice`
// Need to remove bid by name, not index in this case
removeBidById(oldSeatBid, dupe.bidID)
}
}
delete(res, dupe.bidID)
} else {
Expand All @@ -838,9 +846,9 @@ func applyCategoryMapping(ctx context.Context, requestExt *openrtb_ext.ExtReques
continue
}
}
dedupe[dupeKey] = bidDedupe{bidderName: bidderName, bidIndex: bidInd, bidID: bidID, bidPrice: pb}
}
res[bidID] = categoryDuration
dedupe[dupeKey] = bidDedupe{bidderName: bidderName, bidIndex: bidInd, bidID: bidID, bidPrice: pb}
}

if len(bidsToRemove) > 0 {
Expand Down
Loading

0 comments on commit 26d9a66

Please sign in to comment.