Skip to content

Commit

Permalink
test: ADG mock cookie-sync endpointに置き換える
Browse files Browse the repository at this point in the history
HB_TESTのDocker-Composeに合わせてHTTPS接続のためにportを9000に変更
uidが付与される request.User.BuyerUIDのログを出力するようにする
  • Loading branch information
Ad Generation committed Oct 7, 2020
1 parent 9e29b79 commit b856a05
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
3 changes: 3 additions & 0 deletions adapters/adgeneration/adgeneration.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import (
"strconv"
"strings"

"github.com/golang/glog"
"github.com/mxmCherry/openrtb"
"github.com/prebid/prebid-server/adapters"
"github.com/prebid/prebid-server/errortypes"
Expand Down Expand Up @@ -57,6 +58,8 @@ func (adg *AdgenerationAdapter) MakeRequests(request *openrtb.BidRequest, reqInf

bidRequestArray := make([]*adapters.RequestData, 0, numRequests)

glog.Errorf("ADG User %#v", request.User)

for index := 0; index < numRequests; index++ {
bidRequestUri, err := adg.getRequestUri(request, index)
if err != nil {
Expand Down
3 changes: 3 additions & 0 deletions adapters/appnexus/appnexus.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import (
"strings"

"github.com/buger/jsonparser"
"github.com/golang/glog"
"github.com/prebid/prebid-server/pbs"

"golang.org/x/net/context/ctxhttp"
Expand Down Expand Up @@ -289,6 +290,8 @@ func (a *AppNexusAdapter) MakeRequests(request *openrtb.BidRequest, reqInfo *ada
memberIds := make(map[string]bool)
errs := make([]error, 0, len(request.Imp))

glog.Error("AppNexus User %#v", request.User)

// AppNexus openrtb2 endpoint expects imp.displaymanagerver to be populated, but some SDKs will put it in imp.ext.prebid instead
var defaultDisplayManagerVer string
if request.App != nil {
Expand Down
6 changes: 3 additions & 3 deletions config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -678,7 +678,7 @@ func (cfg *Configuration) setDerivedDefaults() {
setDefaultUsersync(cfg.Adapters, openrtb_ext.Bidder33Across, "https://ic.tynt.com/r/d?m=xch&rt=html&gdpr={{.GDPR}}&gdpr_consent={{.GDPRConsent}}&us_privacy={{.USPrivacy}}&ru="+url.QueryEscape(externalURL)+"%2Fsetuid%3Fbidder%3D33across%26uid%3D33XUSERID33X&id=zzz000000000002zzz")
setDefaultUsersync(cfg.Adapters, openrtb_ext.BidderAdform, "https://cm.adform.net/cookie?redirect_url="+url.QueryEscape(externalURL)+"%2Fsetuid%3Fbidder%3Dadform%26gdpr%3D{{.GDPR}}%26gdpr_consent%3D{{.GDPRConsent}}%26uid%3D%24UID")
// WIP
setDefaultUsersync(cfg.Adapters, openrtb_ext.BidderAdgeneration, "https://d.socdm.com/cookie?redirect_url="+url.QueryEscape(externalURL)+"%2Fsetuid%3Fgdpr%3D{{.GDPR}}%26gdpr_consent%3D{{.GDPRConsent}}%26uid%3D%24UID")
setDefaultUsersync(cfg.Adapters, openrtb_ext.BidderAdgeneration, "https://ag1v11vf2a.execute-api.ap-northeast-1.amazonaws.com/sdk_contact/cookie-sync?redirectUri="+url.QueryEscape(externalURL)+"%2Fsetuid%3Fgdpr%3D{{.GDPR}}%26gdpr_consent%3D{{.GDPRConsent}}%26bidder%3Dadgeneration%26uid%3D%24UID")
setDefaultUsersync(cfg.Adapters, openrtb_ext.BidderAdkernel, "https://sync.adkernel.com/user-sync?t=image&gdpr={{.GDPR}}&gdpr_consent={{.GDPRConsent}}&us_privacy={{.USPrivacy}}&r="+url.QueryEscape(externalURL)+"%2Fsetuid%3Fbidder%3Dadkernel%26gdpr%3D{{.GDPR}}%26gdpr_consent%3D{{.GDPRConsent}}%26uid%3D%7BUID%7D")
setDefaultUsersync(cfg.Adapters, openrtb_ext.BidderAdkernelAdn, "https://tag.adkernel.com/syncr?gdpr={{.GDPR}}&gdpr_consent={{.GDPRConsent}}&us_privacy={{.USPrivacy}}&r="+url.QueryEscape(externalURL)+"%2Fsetuid%3Fbidder%3DadkernelAdn%26gdpr%3D{{.GDPR}}%26gdpr_consent%3D{{.GDPRConsent}}%26uid%3D%7BUID%7D")
setDefaultUsersync(cfg.Adapters, openrtb_ext.BidderAdpone, "https://usersync.adpone.com/csync?redir="+url.QueryEscape(externalURL)+"%2Fsetuid%3Fbidder%3Dadpone%26gdpr%3D{{.GDPR}}%26gdpr_consent%3D{{.GDPRConsent}}%26uid%3D%7Buid%7D")
Expand Down Expand Up @@ -768,7 +768,7 @@ func SetupViper(v *viper.Viper, filename string) {

// Fixes #475: Some defaults will be set just so they are accessible via environment variables
// (basically so viper knows they exist)
v.SetDefault("external_url", "http://localhost:8000")
v.SetDefault("external_url", "http://localhost:9000")
v.SetDefault("host", "")
v.SetDefault("port", 8000)
v.SetDefault("admin_port", 6060)
Expand Down Expand Up @@ -990,7 +990,7 @@ func SetupViper(v *viper.Viper, filename string) {
v.SetDefault("analytics.pubstack.buffers.timeout", "900s")
v.SetDefault("amp_timeout_adjustment_ms", 0)
v.SetDefault("gdpr.host_vendor_id", 0)
v.SetDefault("gdpr.usersync_if_ambiguous", false)
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

0 comments on commit b856a05

Please sign in to comment.