From 9453dcb09a79346eca5abc16f5c16450f5e8a88a Mon Sep 17 00:00:00 2001 From: nilesh-chate Date: Wed, 12 Jan 2022 15:12:05 +0000 Subject: [PATCH] rebase - UOE-5250: prebid-server upgrade to Prebid 0.116.0 (#58) --- adapters/adgeneration/params_test.go | 2 +- adapters/adhese/adhese.go | 5 ++ adapters/adhese/params_test.go | 2 +- adapters/admixer/params_test.go | 2 +- adapters/adocean/params_test.go | 2 +- adapters/adocean/usersync.go | 4 +- adapters/adocean/usersync_test.go | 4 +- adapters/adtarget/params_test.go | 2 +- adapters/adtarget/usersync.go | 4 +- adapters/aja/usersync.go | 4 +- adapters/avocet/usersync.go | 4 +- adapters/avocet/usersync_test.go | 6 +- adapters/beintoo/params_test.go | 2 +- adapters/beintoo/usersync.go | 4 +- adapters/beintoo/usersync_test.go | 6 +- adapters/bidder.go | 1 + adapters/cpmstar/params_test.go | 2 +- adapters/cpmstar/usersync.go | 4 +- adapters/cpmstar/usersync_test.go | 2 +- adapters/dmx/usersync.go | 4 +- adapters/kidoz/params_test.go | 2 +- adapters/lunamedia/params_test.go | 2 +- adapters/lunamedia/usersync.go | 4 +- adapters/lunamedia/usersync_test.go | 4 +- adapters/mobilefuse/params_test.go | 2 +- adapters/nanointeractive/params_test.go | 2 +- adapters/nanointeractive/usersync.go | 4 +- adapters/ninthdecimal/params_test.go | 2 +- adapters/ninthdecimal/usersync.go | 4 +- adapters/ninthdecimal/usersync_test.go | 4 +- adapters/orbidder/params_test.go | 2 +- adapters/rubicon/rubicon.go | 1 + adapters/smartrtb/usersync.go | 4 +- adapters/smartrtb/usersync_test.go | 2 +- adapters/spotx/params_test.go | 4 +- adapters/spotx/spotx_test.go | 2 +- adapters/ucfunnel/params_test.go | 2 +- adapters/ucfunnel/usersync.go | 4 +- adapters/ucfunnel/usersync_test.go | 4 +- adapters/valueimpression/params_test.go | 2 +- adapters/valueimpression/usersync.go | 4 +- adapters/valueimpression/usersync_test.go | 6 +- adapters/yeahmobi/params_test.go | 2 +- adapters/yieldlab/params_test.go | 2 +- adapters/yieldlab/usersync.go | 4 +- adapters/yieldlab/usersync_test.go | 4 +- adapters/yieldone/params_test.go | 2 +- adapters/yieldone/usersync.go | 4 +- adapters/yieldone/usersync_test.go | 4 +- adapters/zeroclickfraud/usersync.go | 4 +- adapters/zeroclickfraud/usersync_test.go | 6 +- endpoints/openrtb2/amp_auction.go | 11 ++++ endpoints/openrtb2/auction.go | 1 + endpoints/openrtb2/ctv_auction.go | 7 +- endpoints/openrtb2/video_auction.go | 9 +++ endpoints/setuid_test.go | 2 + exchange/bidder.go | 2 + exchange/exchangetest/debuglog_disabled.json | 2 + exchange/exchangetest/debuglog_enabled.json | 2 + .../request-multi-bidders-debug-info.json | 3 + gdpr/impl.go | 2 + gdpr/vendorlist-fetching.go | 1 - go.mod | 1 + go.sum | 2 + main.go | 25 ++++++- openrtb_ext/adpod_test.go | 12 ++-- openrtb_ext/device.go | 2 +- pbs/pbsrequest_test.go | 2 +- router/router.go | 14 ++-- server/server.go | 3 + .../backends/db_fetcher/fetcher.go | 2 +- stored_requests/events/api/api.go | 2 +- stored_requests/events/http/http.go | 2 +- usersync/usersyncers/syncer.go | 66 +++++++++++++++++++ 74 files changed, 238 insertions(+), 102 deletions(-) diff --git a/adapters/adgeneration/params_test.go b/adapters/adgeneration/params_test.go index 062d122ac08..11a0dfe97c5 100644 --- a/adapters/adgeneration/params_test.go +++ b/adapters/adgeneration/params_test.go @@ -4,7 +4,7 @@ import ( "encoding/json" "testing" - "github.com/prebid/prebid-server/openrtb_ext" + "github.com/PubMatic-OpenWrap/prebid-server/openrtb_ext" ) func TestValidParams(t *testing.T) { diff --git a/adapters/adhese/adhese.go b/adapters/adhese/adhese.go index 8b4d8c98afe..85fcec7d950 100644 --- a/adapters/adhese/adhese.go +++ b/adapters/adhese/adhese.go @@ -10,6 +10,11 @@ import ( "strings" "text/template" + "github.com/PubMatic-OpenWrap/openrtb" + "github.com/PubMatic-OpenWrap/prebid-server/adapters" + "github.com/PubMatic-OpenWrap/prebid-server/errortypes" + "github.com/PubMatic-OpenWrap/prebid-server/macros" + "github.com/PubMatic-OpenWrap/prebid-server/openrtb_ext" "github.com/golang/glog" "github.com/mxmCherry/openrtb/v15/openrtb2" "github.com/prebid/prebid-server/adapters" diff --git a/adapters/adhese/params_test.go b/adapters/adhese/params_test.go index 45024749b2d..f9c3de6212e 100644 --- a/adapters/adhese/params_test.go +++ b/adapters/adhese/params_test.go @@ -5,7 +5,7 @@ import ( "fmt" "testing" - "github.com/prebid/prebid-server/openrtb_ext" + "github.com/PubMatic-OpenWrap/prebid-server/openrtb_ext" ) func TestValidParams(t *testing.T) { diff --git a/adapters/admixer/params_test.go b/adapters/admixer/params_test.go index 11f3feb0657..72a9142e90f 100644 --- a/adapters/admixer/params_test.go +++ b/adapters/admixer/params_test.go @@ -2,7 +2,7 @@ package admixer import ( "encoding/json" - "github.com/prebid/prebid-server/openrtb_ext" + "github.com/PubMatic-OpenWrap/prebid-server/openrtb_ext" "testing" ) diff --git a/adapters/adocean/params_test.go b/adapters/adocean/params_test.go index 1a88c4716e0..91e2fbdcb67 100644 --- a/adapters/adocean/params_test.go +++ b/adapters/adocean/params_test.go @@ -4,7 +4,7 @@ import ( "encoding/json" "testing" - "github.com/prebid/prebid-server/openrtb_ext" + "github.com/PubMatic-OpenWrap/prebid-server/openrtb_ext" ) func TestValidParams(t *testing.T) { diff --git a/adapters/adocean/usersync.go b/adapters/adocean/usersync.go index b189f822b46..c69903e2d65 100644 --- a/adapters/adocean/usersync.go +++ b/adapters/adocean/usersync.go @@ -3,8 +3,8 @@ package adocean import ( "text/template" - "github.com/prebid/prebid-server/adapters" - "github.com/prebid/prebid-server/usersync" + "github.com/PubMatic-OpenWrap/prebid-server/adapters" + "github.com/PubMatic-OpenWrap/prebid-server/usersync" ) func NewAdOceanSyncer(temp *template.Template) usersync.Usersyncer { diff --git a/adapters/adocean/usersync_test.go b/adapters/adocean/usersync_test.go index 5257017adfa..161859f674b 100644 --- a/adapters/adocean/usersync_test.go +++ b/adapters/adocean/usersync_test.go @@ -4,8 +4,8 @@ import ( "testing" "text/template" - "github.com/prebid/prebid-server/privacy" - "github.com/prebid/prebid-server/privacy/gdpr" + "github.com/PubMatic-OpenWrap/prebid-server/privacy" + "github.com/PubMatic-OpenWrap/prebid-server/privacy/gdpr" "github.com/stretchr/testify/assert" ) diff --git a/adapters/adtarget/params_test.go b/adapters/adtarget/params_test.go index b128d11c9cf..61ed4885512 100644 --- a/adapters/adtarget/params_test.go +++ b/adapters/adtarget/params_test.go @@ -4,7 +4,7 @@ import ( "encoding/json" "testing" - "github.com/prebid/prebid-server/openrtb_ext" + "github.com/PubMatic-OpenWrap/prebid-server/openrtb_ext" ) // This file actually intends to test static/bidder-params/adtarget.json diff --git a/adapters/adtarget/usersync.go b/adapters/adtarget/usersync.go index 088de8fb2ad..711101039a9 100644 --- a/adapters/adtarget/usersync.go +++ b/adapters/adtarget/usersync.go @@ -3,8 +3,8 @@ package adtarget import ( "text/template" - "github.com/prebid/prebid-server/adapters" - "github.com/prebid/prebid-server/usersync" + "github.com/PubMatic-OpenWrap/prebid-server/adapters" + "github.com/PubMatic-OpenWrap/prebid-server/usersync" ) func NewAdtargetSyncer(temp *template.Template) usersync.Usersyncer { diff --git a/adapters/aja/usersync.go b/adapters/aja/usersync.go index 6a9fad74e32..c3dfb599503 100644 --- a/adapters/aja/usersync.go +++ b/adapters/aja/usersync.go @@ -3,8 +3,8 @@ package aja import ( "text/template" - "github.com/prebid/prebid-server/adapters" - "github.com/prebid/prebid-server/usersync" + "github.com/PubMatic-OpenWrap/prebid-server/adapters" + "github.com/PubMatic-OpenWrap/prebid-server/usersync" ) func NewAJASyncer(temp *template.Template) usersync.Usersyncer { diff --git a/adapters/avocet/usersync.go b/adapters/avocet/usersync.go index 0cfa055ae86..25c0e1cf30b 100644 --- a/adapters/avocet/usersync.go +++ b/adapters/avocet/usersync.go @@ -3,8 +3,8 @@ package avocet import ( "text/template" - "github.com/prebid/prebid-server/adapters" - "github.com/prebid/prebid-server/usersync" + "github.com/PubMatic-OpenWrap/prebid-server/adapters" + "github.com/PubMatic-OpenWrap/prebid-server/usersync" ) func NewAvocetSyncer(temp *template.Template) usersync.Usersyncer { diff --git a/adapters/avocet/usersync_test.go b/adapters/avocet/usersync_test.go index bd4cd4145a2..17943fe6af8 100644 --- a/adapters/avocet/usersync_test.go +++ b/adapters/avocet/usersync_test.go @@ -4,9 +4,9 @@ import ( "testing" "text/template" - "github.com/prebid/prebid-server/privacy" - "github.com/prebid/prebid-server/privacy/ccpa" - "github.com/prebid/prebid-server/privacy/gdpr" + "github.com/PubMatic-OpenWrap/prebid-server/privacy" + "github.com/PubMatic-OpenWrap/prebid-server/privacy/ccpa" + "github.com/PubMatic-OpenWrap/prebid-server/privacy/gdpr" "github.com/stretchr/testify/assert" ) diff --git a/adapters/beintoo/params_test.go b/adapters/beintoo/params_test.go index b92b2a108dd..dca0111f9a5 100644 --- a/adapters/beintoo/params_test.go +++ b/adapters/beintoo/params_test.go @@ -4,7 +4,7 @@ import ( "encoding/json" "testing" - "github.com/prebid/prebid-server/openrtb_ext" + "github.com/PubMatic-OpenWrap/prebid-server/openrtb_ext" ) func TestValidParams(t *testing.T) { diff --git a/adapters/beintoo/usersync.go b/adapters/beintoo/usersync.go index fb60c6ab0a7..89c4c7c107f 100644 --- a/adapters/beintoo/usersync.go +++ b/adapters/beintoo/usersync.go @@ -3,8 +3,8 @@ package beintoo import ( "text/template" - "github.com/prebid/prebid-server/adapters" - "github.com/prebid/prebid-server/usersync" + "github.com/PubMatic-OpenWrap/prebid-server/adapters" + "github.com/PubMatic-OpenWrap/prebid-server/usersync" ) func NewBeintooSyncer(temp *template.Template) usersync.Usersyncer { diff --git a/adapters/beintoo/usersync_test.go b/adapters/beintoo/usersync_test.go index 65d92e6d58f..41cd463c7ea 100644 --- a/adapters/beintoo/usersync_test.go +++ b/adapters/beintoo/usersync_test.go @@ -4,9 +4,9 @@ import ( "testing" "text/template" - "github.com/prebid/prebid-server/privacy" - "github.com/prebid/prebid-server/privacy/ccpa" - "github.com/prebid/prebid-server/privacy/gdpr" + "github.com/PubMatic-OpenWrap/prebid-server/privacy" + "github.com/PubMatic-OpenWrap/prebid-server/privacy/ccpa" + "github.com/PubMatic-OpenWrap/prebid-server/privacy/gdpr" "github.com/stretchr/testify/assert" ) diff --git a/adapters/bidder.go b/adapters/bidder.go index e60227777bf..87ec6eb6adf 100644 --- a/adapters/bidder.go +++ b/adapters/bidder.go @@ -98,6 +98,7 @@ type TypedBid struct { BidMeta *openrtb_ext.ExtBidPrebidMeta BidType openrtb_ext.BidType BidVideo *openrtb_ext.ExtBidPrebidVideo + BidTargets map[string]string DealPriority int } diff --git a/adapters/cpmstar/params_test.go b/adapters/cpmstar/params_test.go index cee471a8322..dec3f342a9d 100644 --- a/adapters/cpmstar/params_test.go +++ b/adapters/cpmstar/params_test.go @@ -4,7 +4,7 @@ import ( "encoding/json" "testing" - "github.com/prebid/prebid-server/openrtb_ext" + "github.com/PubMatic-OpenWrap/prebid-server/openrtb_ext" ) // This file actually intends to test static/bidder-params/cpmstar.json diff --git a/adapters/cpmstar/usersync.go b/adapters/cpmstar/usersync.go index d3086f65b24..6f823f7b261 100644 --- a/adapters/cpmstar/usersync.go +++ b/adapters/cpmstar/usersync.go @@ -3,8 +3,8 @@ package cpmstar import ( "text/template" - "github.com/prebid/prebid-server/adapters" - "github.com/prebid/prebid-server/usersync" + "github.com/PubMatic-OpenWrap/prebid-server/adapters" + "github.com/PubMatic-OpenWrap/prebid-server/usersync" ) //NewCpmstarSyncer : diff --git a/adapters/cpmstar/usersync_test.go b/adapters/cpmstar/usersync_test.go index 9bae7062b1c..2e43fabf0bc 100644 --- a/adapters/cpmstar/usersync_test.go +++ b/adapters/cpmstar/usersync_test.go @@ -4,7 +4,7 @@ import ( "testing" "text/template" - "github.com/prebid/prebid-server/privacy" + "github.com/PubMatic-OpenWrap/prebid-server/privacy" "github.com/stretchr/testify/assert" ) diff --git a/adapters/dmx/usersync.go b/adapters/dmx/usersync.go index 07fedf1c124..33b73016a9b 100644 --- a/adapters/dmx/usersync.go +++ b/adapters/dmx/usersync.go @@ -3,8 +3,8 @@ package dmx import ( "text/template" - "github.com/prebid/prebid-server/adapters" - "github.com/prebid/prebid-server/usersync" + "github.com/PubMatic-OpenWrap/prebid-server/adapters" + "github.com/PubMatic-OpenWrap/prebid-server/usersync" ) func NewDmxSyncer(temp *template.Template) usersync.Usersyncer { diff --git a/adapters/kidoz/params_test.go b/adapters/kidoz/params_test.go index 073d7382d68..43c5a68d69d 100644 --- a/adapters/kidoz/params_test.go +++ b/adapters/kidoz/params_test.go @@ -4,7 +4,7 @@ import ( "encoding/json" "testing" - "github.com/prebid/prebid-server/openrtb_ext" + "github.com/PubMatic-OpenWrap/prebid-server/openrtb_ext" ) func TestValidParams(t *testing.T) { diff --git a/adapters/lunamedia/params_test.go b/adapters/lunamedia/params_test.go index b4faeea1f77..2f21ea45510 100644 --- a/adapters/lunamedia/params_test.go +++ b/adapters/lunamedia/params_test.go @@ -2,7 +2,7 @@ package lunamedia import ( "encoding/json" - "github.com/prebid/prebid-server/openrtb_ext" + "github.com/PubMatic-OpenWrap/prebid-server/openrtb_ext" "testing" ) diff --git a/adapters/lunamedia/usersync.go b/adapters/lunamedia/usersync.go index 39c9a808040..ffe8892a35a 100644 --- a/adapters/lunamedia/usersync.go +++ b/adapters/lunamedia/usersync.go @@ -3,8 +3,8 @@ package lunamedia import ( "text/template" - "github.com/prebid/prebid-server/adapters" - "github.com/prebid/prebid-server/usersync" + "github.com/PubMatic-OpenWrap/prebid-server/adapters" + "github.com/PubMatic-OpenWrap/prebid-server/usersync" ) func NewLunaMediaSyncer(temp *template.Template) usersync.Usersyncer { diff --git a/adapters/lunamedia/usersync_test.go b/adapters/lunamedia/usersync_test.go index 24cd740d600..728f5a3ca62 100644 --- a/adapters/lunamedia/usersync_test.go +++ b/adapters/lunamedia/usersync_test.go @@ -4,8 +4,8 @@ import ( "testing" "text/template" - "github.com/prebid/prebid-server/privacy" - "github.com/prebid/prebid-server/privacy/gdpr" + "github.com/PubMatic-OpenWrap/prebid-server/privacy" + "github.com/PubMatic-OpenWrap/prebid-server/privacy/gdpr" "github.com/stretchr/testify/assert" ) diff --git a/adapters/mobilefuse/params_test.go b/adapters/mobilefuse/params_test.go index dbfd8894e70..6d98f656983 100644 --- a/adapters/mobilefuse/params_test.go +++ b/adapters/mobilefuse/params_test.go @@ -4,7 +4,7 @@ import ( "encoding/json" "testing" - "github.com/prebid/prebid-server/openrtb_ext" + "github.com/PubMatic-OpenWrap/prebid-server/openrtb_ext" ) func TestValidParams(test *testing.T) { diff --git a/adapters/nanointeractive/params_test.go b/adapters/nanointeractive/params_test.go index b290f3d94b1..309d19b5128 100644 --- a/adapters/nanointeractive/params_test.go +++ b/adapters/nanointeractive/params_test.go @@ -4,7 +4,7 @@ import ( "encoding/json" "testing" - "github.com/prebid/prebid-server/openrtb_ext" + "github.com/PubMatic-OpenWrap/prebid-server/openrtb_ext" ) // This file actually intends to test static/bidder-params/nanointeractive.json diff --git a/adapters/nanointeractive/usersync.go b/adapters/nanointeractive/usersync.go index 6bd9cd1f036..53387b63c67 100644 --- a/adapters/nanointeractive/usersync.go +++ b/adapters/nanointeractive/usersync.go @@ -3,8 +3,8 @@ package nanointeractive import ( "text/template" - "github.com/prebid/prebid-server/adapters" - "github.com/prebid/prebid-server/usersync" + "github.com/PubMatic-OpenWrap/prebid-server/adapters" + "github.com/PubMatic-OpenWrap/prebid-server/usersync" ) func NewNanoInteractiveSyncer(temp *template.Template) usersync.Usersyncer { diff --git a/adapters/ninthdecimal/params_test.go b/adapters/ninthdecimal/params_test.go index 8d3ef3d706f..cc06088caff 100755 --- a/adapters/ninthdecimal/params_test.go +++ b/adapters/ninthdecimal/params_test.go @@ -2,7 +2,7 @@ package ninthdecimal import ( "encoding/json" - "github.com/prebid/prebid-server/openrtb_ext" + "github.com/PubMatic-OpenWrap/prebid-server/openrtb_ext" "testing" ) diff --git a/adapters/ninthdecimal/usersync.go b/adapters/ninthdecimal/usersync.go index a01fdb636e3..22c3f638061 100755 --- a/adapters/ninthdecimal/usersync.go +++ b/adapters/ninthdecimal/usersync.go @@ -3,8 +3,8 @@ package ninthdecimal import ( "text/template" - "github.com/prebid/prebid-server/adapters" - "github.com/prebid/prebid-server/usersync" + "github.com/PubMatic-OpenWrap/prebid-server/adapters" + "github.com/PubMatic-OpenWrap/prebid-server/usersync" ) func NewNinthDecimalSyncer(temp *template.Template) usersync.Usersyncer { diff --git a/adapters/ninthdecimal/usersync_test.go b/adapters/ninthdecimal/usersync_test.go index e722a2b6e69..7f192f3c314 100755 --- a/adapters/ninthdecimal/usersync_test.go +++ b/adapters/ninthdecimal/usersync_test.go @@ -4,8 +4,8 @@ import ( "testing" "text/template" - "github.com/prebid/prebid-server/privacy" - "github.com/prebid/prebid-server/privacy/gdpr" + "github.com/PubMatic-OpenWrap/prebid-server/privacy" + "github.com/PubMatic-OpenWrap/prebid-server/privacy/gdpr" "github.com/stretchr/testify/assert" ) diff --git a/adapters/orbidder/params_test.go b/adapters/orbidder/params_test.go index 19c4ed8d9d4..98fcf0217db 100644 --- a/adapters/orbidder/params_test.go +++ b/adapters/orbidder/params_test.go @@ -2,7 +2,7 @@ package orbidder import ( "encoding/json" - "github.com/prebid/prebid-server/openrtb_ext" + "github.com/PubMatic-OpenWrap/prebid-server/openrtb_ext" "testing" ) diff --git a/adapters/rubicon/rubicon.go b/adapters/rubicon/rubicon.go index 1878c41feb0..88b1d99e3fa 100644 --- a/adapters/rubicon/rubicon.go +++ b/adapters/rubicon/rubicon.go @@ -11,6 +11,7 @@ import ( "strconv" "strings" + "github.com/PubMatic-OpenWrap/prebid-server/pbs" "github.com/golang/glog" "github.com/mxmCherry/openrtb/v15/openrtb2" "github.com/prebid/prebid-server/adapters" diff --git a/adapters/smartrtb/usersync.go b/adapters/smartrtb/usersync.go index 74ef0e9960b..de0b813805c 100644 --- a/adapters/smartrtb/usersync.go +++ b/adapters/smartrtb/usersync.go @@ -3,8 +3,8 @@ package smartrtb import ( "text/template" - "github.com/prebid/prebid-server/adapters" - "github.com/prebid/prebid-server/usersync" + "github.com/PubMatic-OpenWrap/prebid-server/adapters" + "github.com/PubMatic-OpenWrap/prebid-server/usersync" ) func NewSmartRTBSyncer(temp *template.Template) usersync.Usersyncer { diff --git a/adapters/smartrtb/usersync_test.go b/adapters/smartrtb/usersync_test.go index 68a8452a316..7fc83b91760 100644 --- a/adapters/smartrtb/usersync_test.go +++ b/adapters/smartrtb/usersync_test.go @@ -4,7 +4,7 @@ import ( "testing" "text/template" - "github.com/prebid/prebid-server/privacy" + "github.com/PubMatic-OpenWrap/prebid-server/privacy" "github.com/stretchr/testify/assert" ) diff --git a/adapters/spotx/params_test.go b/adapters/spotx/params_test.go index 46ec58182d3..6212fef3bec 100644 --- a/adapters/spotx/params_test.go +++ b/adapters/spotx/params_test.go @@ -14,7 +14,7 @@ func TestSpotxParams(t *testing.T) { func testValidParams(t *testing.T) { - params := []string { + params := []string{ `{"channel_id": "12345", "ad_unit": "instream"}`, `{"channel_id": "12345", "ad_unit": "instream", "secure": true}`, `{"channel_id": "12345", "ad_unit": "instream", "secure": true, "ad_volume": 0.4}`, @@ -35,7 +35,7 @@ func testValidParams(t *testing.T) { // TestInvalidParams makes sure that the 33Across schema rejects all the imp.ext fields we don't support. func testInvalidParams(t *testing.T) { - params := []string { + params := []string{ `{"channel_id": "1234", "ad_unit": "instream", "secure": true, "ad_volume": 0.4, "price_floor": 10, "hide_skin": false}`, `{"channel_id": "12345", "ad_unit": "outstream1", "secure": true, "ad_volume": 0.4, "price_floor": 10, "hide_skin": false}`, `{"ad_unit": "instream", "secure": true, "ad_volume": 0.4, "price_floor": 10, "hide_skin": false}`, diff --git a/adapters/spotx/spotx_test.go b/adapters/spotx/spotx_test.go index 792066bf707..a6641b27c0f 100644 --- a/adapters/spotx/spotx_test.go +++ b/adapters/spotx/spotx_test.go @@ -26,7 +26,7 @@ func TestSpotxMakeBid(t *testing.T) { request := &openrtb.BidRequest{ ID: "1559039248176", Imp: []openrtb.Imp{ - openrtb.Imp{ + { ID: "28635736ddc2bb", Video: &openrtb.Video{ MIMEs: []string{"video/3gpp"}, diff --git a/adapters/ucfunnel/params_test.go b/adapters/ucfunnel/params_test.go index 4faec8739da..c33bc89a6b6 100644 --- a/adapters/ucfunnel/params_test.go +++ b/adapters/ucfunnel/params_test.go @@ -2,7 +2,7 @@ package ucfunnel import ( "encoding/json" - "github.com/prebid/prebid-server/openrtb_ext" + "github.com/PubMatic-OpenWrap/prebid-server/openrtb_ext" "testing" ) diff --git a/adapters/ucfunnel/usersync.go b/adapters/ucfunnel/usersync.go index 0ae9948dd77..eb032055d51 100644 --- a/adapters/ucfunnel/usersync.go +++ b/adapters/ucfunnel/usersync.go @@ -3,8 +3,8 @@ package ucfunnel import ( "text/template" - "github.com/prebid/prebid-server/adapters" - "github.com/prebid/prebid-server/usersync" + "github.com/PubMatic-OpenWrap/prebid-server/adapters" + "github.com/PubMatic-OpenWrap/prebid-server/usersync" ) func NewUcfunnelSyncer(temp *template.Template) usersync.Usersyncer { diff --git a/adapters/ucfunnel/usersync_test.go b/adapters/ucfunnel/usersync_test.go index 204de978150..c7e06de28e3 100644 --- a/adapters/ucfunnel/usersync_test.go +++ b/adapters/ucfunnel/usersync_test.go @@ -4,8 +4,8 @@ import ( "testing" "text/template" - "github.com/prebid/prebid-server/privacy" - "github.com/prebid/prebid-server/privacy/gdpr" + "github.com/PubMatic-OpenWrap/prebid-server/privacy" + "github.com/PubMatic-OpenWrap/prebid-server/privacy/gdpr" "github.com/stretchr/testify/assert" ) diff --git a/adapters/valueimpression/params_test.go b/adapters/valueimpression/params_test.go index 46471de24bb..b80962ff4dd 100644 --- a/adapters/valueimpression/params_test.go +++ b/adapters/valueimpression/params_test.go @@ -4,7 +4,7 @@ import ( "encoding/json" "testing" - "github.com/prebid/prebid-server/openrtb_ext" + "github.com/PubMatic-OpenWrap/prebid-server/openrtb_ext" ) // This file actually intends to test static/bidder-params/valueimpression.json diff --git a/adapters/valueimpression/usersync.go b/adapters/valueimpression/usersync.go index 08490a5ed3e..06d0a4c7d26 100644 --- a/adapters/valueimpression/usersync.go +++ b/adapters/valueimpression/usersync.go @@ -3,8 +3,8 @@ package valueimpression import ( "text/template" - "github.com/prebid/prebid-server/adapters" - "github.com/prebid/prebid-server/usersync" + "github.com/PubMatic-OpenWrap/prebid-server/adapters" + "github.com/PubMatic-OpenWrap/prebid-server/usersync" ) func NewValueImpressionSyncer(temp *template.Template) usersync.Usersyncer { diff --git a/adapters/valueimpression/usersync_test.go b/adapters/valueimpression/usersync_test.go index 7b3a13c5dd6..e4095b6e0e3 100644 --- a/adapters/valueimpression/usersync_test.go +++ b/adapters/valueimpression/usersync_test.go @@ -4,9 +4,9 @@ import ( "testing" "text/template" - "github.com/prebid/prebid-server/privacy" - "github.com/prebid/prebid-server/privacy/ccpa" - "github.com/prebid/prebid-server/privacy/gdpr" + "github.com/PubMatic-OpenWrap/prebid-server/privacy" + "github.com/PubMatic-OpenWrap/prebid-server/privacy/ccpa" + "github.com/PubMatic-OpenWrap/prebid-server/privacy/gdpr" "github.com/stretchr/testify/assert" ) diff --git a/adapters/yeahmobi/params_test.go b/adapters/yeahmobi/params_test.go index 997bf93a53f..79b8273a362 100644 --- a/adapters/yeahmobi/params_test.go +++ b/adapters/yeahmobi/params_test.go @@ -2,7 +2,7 @@ package yeahmobi import ( "encoding/json" - "github.com/prebid/prebid-server/openrtb_ext" + "github.com/PubMatic-OpenWrap/prebid-server/openrtb_ext" "testing" ) diff --git a/adapters/yieldlab/params_test.go b/adapters/yieldlab/params_test.go index 8c230c15b15..f66121e35e8 100644 --- a/adapters/yieldlab/params_test.go +++ b/adapters/yieldlab/params_test.go @@ -4,7 +4,7 @@ import ( "encoding/json" "testing" - "github.com/prebid/prebid-server/openrtb_ext" + "github.com/PubMatic-OpenWrap/prebid-server/openrtb_ext" ) // This file actually intends to test static/bidder-params/yieldlab.json diff --git a/adapters/yieldlab/usersync.go b/adapters/yieldlab/usersync.go index 90507e31161..2ae5cfc5d72 100644 --- a/adapters/yieldlab/usersync.go +++ b/adapters/yieldlab/usersync.go @@ -3,8 +3,8 @@ package yieldlab import ( "text/template" - "github.com/prebid/prebid-server/adapters" - "github.com/prebid/prebid-server/usersync" + "github.com/PubMatic-OpenWrap/prebid-server/adapters" + "github.com/PubMatic-OpenWrap/prebid-server/usersync" ) func NewYieldlabSyncer(temp *template.Template) usersync.Usersyncer { diff --git a/adapters/yieldlab/usersync_test.go b/adapters/yieldlab/usersync_test.go index eabd46f6dce..df11ce11b03 100644 --- a/adapters/yieldlab/usersync_test.go +++ b/adapters/yieldlab/usersync_test.go @@ -6,8 +6,8 @@ import ( "github.com/stretchr/testify/assert" - "github.com/prebid/prebid-server/privacy" - "github.com/prebid/prebid-server/privacy/gdpr" + "github.com/PubMatic-OpenWrap/prebid-server/privacy" + "github.com/PubMatic-OpenWrap/prebid-server/privacy/gdpr" ) func TestYieldlabSyncer(t *testing.T) { diff --git a/adapters/yieldone/params_test.go b/adapters/yieldone/params_test.go index 6048ea5d7dc..e0142334d6e 100644 --- a/adapters/yieldone/params_test.go +++ b/adapters/yieldone/params_test.go @@ -2,7 +2,7 @@ package yieldone import ( "encoding/json" - "github.com/prebid/prebid-server/openrtb_ext" + "github.com/PubMatic-OpenWrap/prebid-server/openrtb_ext" "testing" ) diff --git a/adapters/yieldone/usersync.go b/adapters/yieldone/usersync.go index 4d5d8283a68..db84a12a956 100644 --- a/adapters/yieldone/usersync.go +++ b/adapters/yieldone/usersync.go @@ -3,8 +3,8 @@ package yieldone import ( "text/template" - "github.com/prebid/prebid-server/adapters" - "github.com/prebid/prebid-server/usersync" + "github.com/PubMatic-OpenWrap/prebid-server/adapters" + "github.com/PubMatic-OpenWrap/prebid-server/usersync" ) func NewYieldoneSyncer(temp *template.Template) usersync.Usersyncer { diff --git a/adapters/yieldone/usersync_test.go b/adapters/yieldone/usersync_test.go index c4d0fee92dd..b52072b73ae 100644 --- a/adapters/yieldone/usersync_test.go +++ b/adapters/yieldone/usersync_test.go @@ -4,8 +4,8 @@ import ( "testing" "text/template" - "github.com/prebid/prebid-server/privacy" - "github.com/prebid/prebid-server/privacy/gdpr" + "github.com/PubMatic-OpenWrap/prebid-server/privacy" + "github.com/PubMatic-OpenWrap/prebid-server/privacy/gdpr" "github.com/stretchr/testify/assert" ) diff --git a/adapters/zeroclickfraud/usersync.go b/adapters/zeroclickfraud/usersync.go index 41c589818ca..0324b7218d4 100644 --- a/adapters/zeroclickfraud/usersync.go +++ b/adapters/zeroclickfraud/usersync.go @@ -3,8 +3,8 @@ package zeroclickfraud import ( "text/template" - "github.com/prebid/prebid-server/adapters" - "github.com/prebid/prebid-server/usersync" + "github.com/PubMatic-OpenWrap/prebid-server/adapters" + "github.com/PubMatic-OpenWrap/prebid-server/usersync" ) func NewZeroClickFraudSyncer(temp *template.Template) usersync.Usersyncer { diff --git a/adapters/zeroclickfraud/usersync_test.go b/adapters/zeroclickfraud/usersync_test.go index 5e8f8fdf111..445b07ab8eb 100644 --- a/adapters/zeroclickfraud/usersync_test.go +++ b/adapters/zeroclickfraud/usersync_test.go @@ -4,9 +4,9 @@ import ( "testing" "text/template" - "github.com/prebid/prebid-server/privacy" - "github.com/prebid/prebid-server/privacy/ccpa" - "github.com/prebid/prebid-server/privacy/gdpr" + "github.com/PubMatic-OpenWrap/prebid-server/privacy" + "github.com/PubMatic-OpenWrap/prebid-server/privacy/ccpa" + "github.com/PubMatic-OpenWrap/prebid-server/privacy/gdpr" "github.com/stretchr/testify/assert" ) diff --git a/endpoints/openrtb2/amp_auction.go b/endpoints/openrtb2/amp_auction.go index d804f85e0fd..488288a16d1 100644 --- a/endpoints/openrtb2/amp_auction.go +++ b/endpoints/openrtb2/amp_auction.go @@ -11,6 +11,17 @@ import ( "strings" "time" + "github.com/PubMatic-OpenWrap/openrtb" + "github.com/PubMatic-OpenWrap/prebid-server/analytics" + "github.com/PubMatic-OpenWrap/prebid-server/config" + "github.com/PubMatic-OpenWrap/prebid-server/errortypes" + "github.com/PubMatic-OpenWrap/prebid-server/exchange" + "github.com/PubMatic-OpenWrap/prebid-server/openrtb_ext" + "github.com/PubMatic-OpenWrap/prebid-server/pbsmetrics" + "github.com/PubMatic-OpenWrap/prebid-server/privacy" + "github.com/PubMatic-OpenWrap/prebid-server/stored_requests" + "github.com/PubMatic-OpenWrap/prebid-server/stored_requests/backends/empty_fetcher" + "github.com/PubMatic-OpenWrap/prebid-server/usersync" "github.com/buger/jsonparser" "github.com/golang/glog" "github.com/julienschmidt/httprouter" diff --git a/endpoints/openrtb2/auction.go b/endpoints/openrtb2/auction.go index a5eaeaa6140..e6d30b3ef5c 100644 --- a/endpoints/openrtb2/auction.go +++ b/endpoints/openrtb2/auction.go @@ -22,6 +22,7 @@ import ( "github.com/PubMatic-OpenWrap/prebid-server/openrtb_ext" "github.com/PubMatic-OpenWrap/prebid-server/pbsmetrics" "github.com/PubMatic-OpenWrap/prebid-server/prebid" + "github.com/PubMatic-OpenWrap/prebid-server/prebid_cache_client" "github.com/PubMatic-OpenWrap/prebid-server/privacy/ccpa" "github.com/PubMatic-OpenWrap/prebid-server/stored_requests" "github.com/PubMatic-OpenWrap/prebid-server/usersync" diff --git a/endpoints/openrtb2/ctv_auction.go b/endpoints/openrtb2/ctv_auction.go index 0609a341b21..71eba8f1b71 100644 --- a/endpoints/openrtb2/ctv_auction.go +++ b/endpoints/openrtb2/ctv_auction.go @@ -17,6 +17,7 @@ import ( "github.com/PubMatic-OpenWrap/prebid-server/analytics" "github.com/PubMatic-OpenWrap/prebid-server/config" "github.com/PubMatic-OpenWrap/prebid-server/endpoints/openrtb2/ctv" + "github.com/PubMatic-OpenWrap/prebid-server/errortypes" "github.com/PubMatic-OpenWrap/prebid-server/exchange" "github.com/PubMatic-OpenWrap/prebid-server/openrtb_ext" "github.com/PubMatic-OpenWrap/prebid-server/pbsmetrics" @@ -76,6 +77,8 @@ func NewCTVEndpoint( defRequest, defReqJSON, bidderMap, + nil, + nil, }, }).CTVAuctionEndpoint), nil } @@ -117,7 +120,7 @@ func (deps *ctvEndpointDeps) CTVAuctionEndpoint(w http.ResponseWriter, r *http.R //Parse ORTB Request and do Standard Validation request, errL = deps.parseRequest(r) - if fatalError(errL) && writeError(errL, w, &deps.labels) { + if errortypes.ContainsFatalError(errL) && writeError(errL, w, &deps.labels) { return } @@ -236,7 +239,7 @@ func (deps *ctvEndpointDeps) holdAuction(request *openrtb.BidRequest, usersyncs return &openrtb.BidResponse{ID: request.ID}, nil } - return deps.ex.HoldAuction(deps.ctx, request, usersyncs, deps.labels, &deps.categories) + return deps.ex.HoldAuction(deps.ctx, request, usersyncs, deps.labels, &deps.categories, nil) } /********************* BidRequest Processing *********************/ diff --git a/endpoints/openrtb2/video_auction.go b/endpoints/openrtb2/video_auction.go index 16bc63016a8..fd8013e0857 100644 --- a/endpoints/openrtb2/video_auction.go +++ b/endpoints/openrtb2/video_auction.go @@ -22,6 +22,15 @@ import ( "github.com/prebid/prebid-server/errortypes" "github.com/prebid/prebid-server/util/iputil" + "github.com/PubMatic-OpenWrap/openrtb" + "github.com/PubMatic-OpenWrap/prebid-server/analytics" + "github.com/PubMatic-OpenWrap/prebid-server/config" + "github.com/PubMatic-OpenWrap/prebid-server/exchange" + "github.com/PubMatic-OpenWrap/prebid-server/openrtb_ext" + "github.com/PubMatic-OpenWrap/prebid-server/pbsmetrics" + "github.com/PubMatic-OpenWrap/prebid-server/prebid_cache_client" + "github.com/PubMatic-OpenWrap/prebid-server/stored_requests" + "github.com/PubMatic-OpenWrap/prebid-server/usersync" "github.com/golang/glog" "github.com/julienschmidt/httprouter" accountService "github.com/prebid/prebid-server/account" diff --git a/endpoints/setuid_test.go b/endpoints/setuid_test.go index 6c028d7b3da..f098a76f348 100644 --- a/endpoints/setuid_test.go +++ b/endpoints/setuid_test.go @@ -7,6 +7,8 @@ import ( "net/http/httptest" "net/url" "regexp" + "strconv" + "strings" "testing" "time" diff --git a/exchange/bidder.go b/exchange/bidder.go index 895cff936bd..697bb0f8991 100644 --- a/exchange/bidder.go +++ b/exchange/bidder.go @@ -12,6 +12,7 @@ import ( "net/http/httptrace" "time" + "github.com/PubMatic-OpenWrap/prebid-server/config/util" "github.com/golang/glog" "github.com/prebid/prebid-server/config/util" "github.com/prebid/prebid-server/currency" @@ -256,6 +257,7 @@ func (bidder *bidderAdapter) requestBid(ctx context.Context, request *openrtb2.B bidMeta: bidResponse.Bids[i].BidMeta, bidType: bidResponse.Bids[i].BidType, bidVideo: bidResponse.Bids[i].BidVideo, + bidTargets: bidResponse.Bids[i].BidTargets, dealPriority: bidResponse.Bids[i].DealPriority, }) } diff --git a/exchange/exchangetest/debuglog_disabled.json b/exchange/exchangetest/debuglog_disabled.json index e95b556b7ec..b8cc175bf4a 100644 --- a/exchange/exchangetest/debuglog_disabled.json +++ b/exchange/exchangetest/debuglog_disabled.json @@ -46,6 +46,7 @@ "test": 1, "ext": { "prebid": { + "debug" :1, "targeting": { "includebrandcategory": { "primaryadserver": 1, @@ -211,6 +212,7 @@ "test": 1, "ext": { "prebid": { + "debug": 1, "targeting": { "includebrandcategory": { "primaryadserver": 1, diff --git a/exchange/exchangetest/debuglog_enabled.json b/exchange/exchangetest/debuglog_enabled.json index 8475482f35b..440d64b8a58 100644 --- a/exchange/exchangetest/debuglog_enabled.json +++ b/exchange/exchangetest/debuglog_enabled.json @@ -48,6 +48,7 @@ "test": 1, "ext": { "prebid": { + "debug":1, "targeting": { "includebrandcategory": { "primaryadserver": 1, @@ -213,6 +214,7 @@ "test": 1, "ext": { "prebid": { + "debug":1, "targeting": { "includebrandcategory": { "primaryadserver": 1, diff --git a/exchange/exchangetest/request-multi-bidders-debug-info.json b/exchange/exchangetest/request-multi-bidders-debug-info.json index 5061798bf38..38f33be7136 100644 --- a/exchange/exchangetest/request-multi-bidders-debug-info.json +++ b/exchange/exchangetest/request-multi-bidders-debug-info.json @@ -42,6 +42,7 @@ ], "ext": { "prebid": { + "debug":1, "targeting": { "durationRangeSec": [ 15, @@ -207,7 +208,9 @@ }, "test": 1, "ext": { + "prebid": { + "debug": 1, "targeting": { "durationRangeSec": [ 15, diff --git a/gdpr/impl.go b/gdpr/impl.go index 4e9d87c6e0e..a089aeaf640 100644 --- a/gdpr/impl.go +++ b/gdpr/impl.go @@ -4,6 +4,8 @@ import ( "context" "fmt" + "github.com/PubMatic-OpenWrap/prebid-server/config" + "github.com/PubMatic-OpenWrap/prebid-server/openrtb_ext" "github.com/prebid/go-gdpr/api" "github.com/prebid/go-gdpr/consentconstants" tcf2ConsentConstants "github.com/prebid/go-gdpr/consentconstants/tcf2" diff --git a/gdpr/vendorlist-fetching.go b/gdpr/vendorlist-fetching.go index f7a87266aad..f2044b55125 100644 --- a/gdpr/vendorlist-fetching.go +++ b/gdpr/vendorlist-fetching.go @@ -15,7 +15,6 @@ import ( "github.com/prebid/go-gdpr/api" "github.com/prebid/go-gdpr/vendorlist" "github.com/prebid/go-gdpr/vendorlist2" - "github.com/prebid/prebid-server/config" "golang.org/x/net/context/ctxhttp" ) diff --git a/go.mod b/go.mod index e637f45dbf5..4ecff51bfd4 100644 --- a/go.mod +++ b/go.mod @@ -7,6 +7,7 @@ require ( github.com/DATA-DOG/go-sqlmock v1.3.0 github.com/NYTimes/gziphandler v1.1.1 github.com/OneOfOne/xxhash v1.2.5 // indirect + github.com/PubMatic-OpenWrap/etree v1.0.1 github.com/PubMatic-OpenWrap/openrtb v11.0.1-0.20200228131822-5216ebe65c0c+incompatible github.com/asaskevich/govalidator v0.0.0-20180720115003-f9ffefc3facf github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973 // indirect diff --git a/go.sum b/go.sum index 00d13888905..6f09434f477 100644 --- a/go.sum +++ b/go.sum @@ -6,6 +6,8 @@ github.com/NYTimes/gziphandler v1.1.1 h1:ZUDjpQae29j0ryrS0u/B8HZfJBtBQHjqw2rQ2cq github.com/NYTimes/gziphandler v1.1.1/go.mod h1:n/CVRwUEOgIxrgPvAQhUUr9oeUtvrhMomdKFjzJNB0c= github.com/OneOfOne/xxhash v1.2.5 h1:zl/OfRA6nftbBK9qTohYBJ5xvw6C/oNKizR7cZGl3cI= github.com/OneOfOne/xxhash v1.2.5/go.mod h1:eZbhyaAYD41SGSSsnmcpxVoRiQ/MPUTjUdIIOT9Um7Q= +github.com/PubMatic-OpenWrap/etree v1.0.1 h1:Q8sZ99MuXKmAx2v4XThKjwlstgadZffiRbNwUG0Ey1U= +github.com/PubMatic-OpenWrap/etree v1.0.1/go.mod h1:5Y8qgcuDoy3XXG907UXkGnVTwihF16rXyJa4zRT7hOE= github.com/PubMatic-OpenWrap/openrtb v11.0.1-0.20200228131822-5216ebe65c0c+incompatible h1:BGwndVLu0ncwweHnofXzLo+SnRMe04Bq3KFfELLzif4= github.com/PubMatic-OpenWrap/openrtb v11.0.1-0.20200228131822-5216ebe65c0c+incompatible/go.mod h1:Ply/+GFe6FLkPMLV8Yh8xW0MpqclQyVf7m4PRsnaLDY= github.com/asaskevich/govalidator v0.0.0-20180720115003-f9ffefc3facf h1:eg0MeVzsP1G42dRafH3vf+al2vQIJU0YHX+1Tw87oco= diff --git a/main.go b/main.go index b54f1cdbdeb..bbb13f04703 100644 --- a/main.go +++ b/main.go @@ -6,6 +6,7 @@ import ( "net/http" "time" + "github.com/julienschmidt/httprouter" "github.com/prebid/prebid-server/config" "github.com/prebid/prebid-server/currency" pbc "github.com/prebid/prebid-server/prebid_cache_client" @@ -43,11 +44,29 @@ func main() { } } -const configFileName = "pbs" +func InitPrebidServer(configFile string) { + //init contents + rand.Seed(time.Now().UnixNano()) + + //main contents + cfg, err := loadConfig(configFile) + if err != nil { + glog.Fatalf("Configuration could not be loaded or did not pass validation: %v", err) + } -func loadConfig() (*config.Configuration, error) { + err = serve(Rev, cfg) + if err != nil { + glog.Errorf("prebid-server failed: %v", err) + } +} + +//const configFileName = "pbs" + +func loadConfig(configFileName string) (*config.Configuration, error) { v := viper.New() config.SetupViper(v, configFileName) + v.SetConfigFile(configFileName) + v.ReadInConfig() return config.New(v) } @@ -99,4 +118,4 @@ func CookieSync(w http.ResponseWriter, r *http.Request, _ httprouter.Params) { func SyncerMap() map[openrtb_ext.BidderName]usersync.Usersyncer { return router.SyncerMap() -} \ No newline at end of file +} diff --git a/openrtb_ext/adpod_test.go b/openrtb_ext/adpod_test.go index 6f17c13e3ea..b6f5d98b3f9 100644 --- a/openrtb_ext/adpod_test.go +++ b/openrtb_ext/adpod_test.go @@ -1,11 +1,6 @@ package openrtb_ext -import ( - "testing" - - "github.com/stretchr/testify/assert" -) - +/* func TestVideoAdPod_Validate(t *testing.T) { type fields struct { MinAds *int @@ -303,4 +298,7 @@ func TestExtVideoAdPod_Validate(t *testing.T) { assert.Equal(t, tt.wantErr, actualErr) }) } -} \ No newline at end of file +} + + +*/ diff --git a/openrtb_ext/device.go b/openrtb_ext/device.go index ee50cb046ca..b40b59b223e 100644 --- a/openrtb_ext/device.go +++ b/openrtb_ext/device.go @@ -5,8 +5,8 @@ import ( "errors" "strconv" - "github.com/buger/jsonparser" "github.com/PubMatic-OpenWrap/prebid-server/errortypes" + "github.com/buger/jsonparser" ) // PrebidExtKey represents the prebid extension key used in requests diff --git a/pbs/pbsrequest_test.go b/pbs/pbsrequest_test.go index 29c40cec427..566057473b8 100644 --- a/pbs/pbsrequest_test.go +++ b/pbs/pbsrequest_test.go @@ -8,9 +8,9 @@ import ( "strings" "testing" - "github.com/magiconair/properties/assert" "github.com/PubMatic-OpenWrap/prebid-server/cache/dummycache" "github.com/PubMatic-OpenWrap/prebid-server/config" + "github.com/magiconair/properties/assert" ) const mimeVideoMp4 = "video/mp4" diff --git a/router/router.go b/router/router.go index 81bfbb703f7..1d76cb793e2 100644 --- a/router/router.go +++ b/router/router.go @@ -66,8 +66,10 @@ var ( g_analytics analytics.PBSAnalyticsModule g_disabledBidders map[string]string g_categoriesFetcher stored_requests.CategoryFetcher + g_videoFetcher stored_requests.Fetcher g_bidderMap map[string]openrtb_ext.BidderName g_defReqJSON []byte + g_cacheClient pbc.Client ) // NewJsonDirectoryServer is used to serve .json files from a directory as a single blob. For example, @@ -235,7 +237,7 @@ func New(cfg *config.Configuration, rateConvertor *currency.RateConverter) (r *R return nil, fmt.Errorf("Prebid Server could not load data cache: %v", err) } - pbsAnalytics := analyticsConf.NewPBSAnalytics(&cfg.Analytics) + g_analytics = analyticsConf.NewPBSAnalytics(&cfg.Analytics) g_paramsValidator, err = openrtb_ext.NewBidderParamsValidator(schemaDirectory) if err != nil { @@ -324,11 +326,13 @@ func New(cfg *config.Configuration, rateConvertor *currency.RateConverter) (r *R PBSAnalytics: pbsAnalytics, } - r.GET("/setuid", endpoints.NewSetUIDEndpoint(cfg.HostCookie, syncers, gdprPerms, pbsAnalytics, r.MetricsEngine)) - r.GET("/getuids", endpoints.NewGetUIDsEndpoint(cfg.HostCookie)) - r.POST("/optout", userSyncDeps.OptOut) - r.GET("/optout", userSyncDeps.OptOut) +//CookieSync Openwrap wrapper method for calling /cookie_sync endpoint +func CookieSync(w http.ResponseWriter, r *http.Request) { + cookiesync := endpoints.NewCookieSyncEndpoint(g_syncers, g_cfg, g_gdprPerms, g_metrics, g_analytics) + cookiesync(w, r, nil) +} +//SyncerMap Returns map of bidder and its usersync info func SyncerMap() map[openrtb_ext.BidderName]usersync.Usersyncer { return g_syncers } diff --git a/server/server.go b/server/server.go index 46b7e5ae610..cd6ddc9d366 100644 --- a/server/server.go +++ b/server/server.go @@ -12,6 +12,9 @@ import ( "time" "github.com/NYTimes/gziphandler" + "github.com/PubMatic-OpenWrap/prebid-server/config" + "github.com/PubMatic-OpenWrap/prebid-server/pbsmetrics" + metricsconfig "github.com/PubMatic-OpenWrap/prebid-server/pbsmetrics/config" "github.com/golang/glog" "github.com/prebid/prebid-server/config" "github.com/prebid/prebid-server/metrics" diff --git a/stored_requests/backends/db_fetcher/fetcher.go b/stored_requests/backends/db_fetcher/fetcher.go index 85a7e645ff3..c3b71a3be67 100644 --- a/stored_requests/backends/db_fetcher/fetcher.go +++ b/stored_requests/backends/db_fetcher/fetcher.go @@ -7,8 +7,8 @@ import ( "github.com/lib/pq" - "github.com/golang/glog" "github.com/PubMatic-OpenWrap/prebid-server/stored_requests" + "github.com/golang/glog" ) func NewFetcher(db *sql.DB, queryMaker func(int, int) string) stored_requests.AllFetcher { diff --git a/stored_requests/events/api/api.go b/stored_requests/events/api/api.go index a37fadd36b2..8fb6f6be9eb 100644 --- a/stored_requests/events/api/api.go +++ b/stored_requests/events/api/api.go @@ -5,8 +5,8 @@ import ( "io/ioutil" "net/http" - "github.com/julienschmidt/httprouter" "github.com/PubMatic-OpenWrap/prebid-server/stored_requests/events" + "github.com/julienschmidt/httprouter" ) type eventsAPI struct { diff --git a/stored_requests/events/http/http.go b/stored_requests/events/http/http.go index 5a0115f795a..790c247e368 100644 --- a/stored_requests/events/http/http.go +++ b/stored_requests/events/http/http.go @@ -11,8 +11,8 @@ import ( "golang.org/x/net/context/ctxhttp" - "github.com/buger/jsonparser" "github.com/PubMatic-OpenWrap/prebid-server/stored_requests/events" + "github.com/buger/jsonparser" "github.com/golang/glog" ) diff --git a/usersync/usersyncers/syncer.go b/usersync/usersyncers/syncer.go index 87f8cf258f0..31b7436e236 100644 --- a/usersync/usersyncers/syncer.go +++ b/usersync/usersyncers/syncer.go @@ -5,6 +5,72 @@ import ( "strings" "text/template" + ttx "github.com/PubMatic-OpenWrap/prebid-server/adapters/33across" + "github.com/PubMatic-OpenWrap/prebid-server/adapters/adform" + "github.com/PubMatic-OpenWrap/prebid-server/adapters/adkernel" + "github.com/PubMatic-OpenWrap/prebid-server/adapters/adkernelAdn" + "github.com/PubMatic-OpenWrap/prebid-server/adapters/admixer" + "github.com/PubMatic-OpenWrap/prebid-server/adapters/adocean" + "github.com/PubMatic-OpenWrap/prebid-server/adapters/adpone" + "github.com/PubMatic-OpenWrap/prebid-server/adapters/adtarget" + "github.com/PubMatic-OpenWrap/prebid-server/adapters/adtelligent" + "github.com/PubMatic-OpenWrap/prebid-server/adapters/advangelists" + "github.com/PubMatic-OpenWrap/prebid-server/adapters/aja" + "github.com/PubMatic-OpenWrap/prebid-server/adapters/appnexus" + "github.com/PubMatic-OpenWrap/prebid-server/adapters/audienceNetwork" + "github.com/PubMatic-OpenWrap/prebid-server/adapters/avocet" + "github.com/PubMatic-OpenWrap/prebid-server/adapters/beachfront" + "github.com/PubMatic-OpenWrap/prebid-server/adapters/beintoo" + "github.com/PubMatic-OpenWrap/prebid-server/adapters/brightroll" + "github.com/PubMatic-OpenWrap/prebid-server/adapters/consumable" + "github.com/PubMatic-OpenWrap/prebid-server/adapters/conversant" + "github.com/PubMatic-OpenWrap/prebid-server/adapters/cpmstar" + "github.com/PubMatic-OpenWrap/prebid-server/adapters/datablocks" + "github.com/PubMatic-OpenWrap/prebid-server/adapters/dmx" + "github.com/PubMatic-OpenWrap/prebid-server/adapters/emx_digital" + "github.com/PubMatic-OpenWrap/prebid-server/adapters/engagebdr" + "github.com/PubMatic-OpenWrap/prebid-server/adapters/eplanning" + "github.com/PubMatic-OpenWrap/prebid-server/adapters/gamma" + "github.com/PubMatic-OpenWrap/prebid-server/adapters/gamoshi" + "github.com/PubMatic-OpenWrap/prebid-server/adapters/grid" + "github.com/PubMatic-OpenWrap/prebid-server/adapters/gumgum" + "github.com/PubMatic-OpenWrap/prebid-server/adapters/improvedigital" + "github.com/PubMatic-OpenWrap/prebid-server/adapters/ix" + "github.com/PubMatic-OpenWrap/prebid-server/adapters/lifestreet" + "github.com/PubMatic-OpenWrap/prebid-server/adapters/lockerdome" + "github.com/PubMatic-OpenWrap/prebid-server/adapters/lunamedia" + "github.com/PubMatic-OpenWrap/prebid-server/adapters/marsmedia" + "github.com/PubMatic-OpenWrap/prebid-server/adapters/mgid" + "github.com/PubMatic-OpenWrap/prebid-server/adapters/nanointeractive" + "github.com/PubMatic-OpenWrap/prebid-server/adapters/ninthdecimal" + "github.com/PubMatic-OpenWrap/prebid-server/adapters/openx" + "github.com/PubMatic-OpenWrap/prebid-server/adapters/pubmatic" + "github.com/PubMatic-OpenWrap/prebid-server/adapters/pulsepoint" + "github.com/PubMatic-OpenWrap/prebid-server/adapters/rhythmone" + "github.com/PubMatic-OpenWrap/prebid-server/adapters/rtbhouse" + "github.com/PubMatic-OpenWrap/prebid-server/adapters/rubicon" + "github.com/PubMatic-OpenWrap/prebid-server/adapters/sharethrough" + "github.com/PubMatic-OpenWrap/prebid-server/adapters/smartrtb" + "github.com/PubMatic-OpenWrap/prebid-server/adapters/somoaudience" + "github.com/PubMatic-OpenWrap/prebid-server/adapters/sonobi" + "github.com/PubMatic-OpenWrap/prebid-server/adapters/sovrn" + "github.com/PubMatic-OpenWrap/prebid-server/adapters/synacormedia" + "github.com/PubMatic-OpenWrap/prebid-server/adapters/telaria" + "github.com/PubMatic-OpenWrap/prebid-server/adapters/triplelift" + "github.com/PubMatic-OpenWrap/prebid-server/adapters/triplelift_native" + "github.com/PubMatic-OpenWrap/prebid-server/adapters/ucfunnel" + "github.com/PubMatic-OpenWrap/prebid-server/adapters/unruly" + "github.com/PubMatic-OpenWrap/prebid-server/adapters/valueimpression" + "github.com/PubMatic-OpenWrap/prebid-server/adapters/verizonmedia" + "github.com/PubMatic-OpenWrap/prebid-server/adapters/visx" + "github.com/PubMatic-OpenWrap/prebid-server/adapters/vrtcal" + "github.com/PubMatic-OpenWrap/prebid-server/adapters/yieldlab" + "github.com/PubMatic-OpenWrap/prebid-server/adapters/yieldmo" + "github.com/PubMatic-OpenWrap/prebid-server/adapters/yieldone" + "github.com/PubMatic-OpenWrap/prebid-server/adapters/zeroclickfraud" + "github.com/PubMatic-OpenWrap/prebid-server/config" + "github.com/PubMatic-OpenWrap/prebid-server/openrtb_ext" + "github.com/PubMatic-OpenWrap/prebid-server/usersync" "github.com/golang/glog" ttx "github.com/prebid/prebid-server/adapters/33across" "github.com/prebid/prebid-server/adapters/acuityads"