Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rubicon: Remove pchain support #4166

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 15 additions & 26 deletions adapters/rubicon/rubicon.go
Original file line number Diff line number Diff line change
Expand Up @@ -436,37 +436,26 @@ func (a *RubiconAdapter) MakeRequests(request *openrtb2.BidRequest, reqInfo *ada
rubiconRequest.App = &appCopy
}

if request.Source != nil || rubiconExt.PChain != "" {
var sourceCopy openrtb2.Source
if request.Source != nil {
sourceCopy = *request.Source
} else {
sourceCopy = openrtb2.Source{}
}

if sourceCopy.SChain != nil {
var sourceCopyExt openrtb_ext.ExtSource
if sourceCopy.Ext != nil {
if err = jsonutil.Unmarshal(sourceCopy.Ext, &sourceCopyExt); err != nil {
errs = append(errs, &errortypes.BadInput{Message: err.Error()})
continue
}
} else {
sourceCopyExt = openrtb_ext.ExtSource{}
}

sourceCopyExt.SChain = sourceCopy.SChain
sourceCopy.SChain = nil
if request.Source != nil && request.Source.SChain != nil {
sourceCopy := *request.Source

sourceCopy.Ext, err = json.Marshal(&sourceCopyExt)
if err != nil {
errs = append(errs, err)
var sourceCopyExt openrtb_ext.ExtSource
if sourceCopy.Ext != nil {
if err = jsonutil.Unmarshal(sourceCopy.Ext, &sourceCopyExt); err != nil {
errs = append(errs, &errortypes.BadInput{Message: err.Error()})
continue
}
} else {
sourceCopyExt = openrtb_ext.ExtSource{}
}

if rubiconExt.PChain != "" {
sourceCopy.PChain = rubiconExt.PChain
sourceCopyExt.SChain = sourceCopy.SChain
sourceCopy.SChain = nil

sourceCopy.Ext, err = json.Marshal(&sourceCopyExt)
if err != nil {
errs = append(errs, err)
continue
}

rubiconRequest.Source = &sourceCopy
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -154,8 +154,7 @@
"bidder": {
"accountId": 1001,
"siteId": 113932,
"zoneId": 535510,
"pchain": "pchain"
"zoneId": 535510
},
"skadn": {
"version": "1.0",
Expand Down Expand Up @@ -323,7 +322,6 @@
"bundle": "com.wls.testwlsapplication"
},
"source": {
"pchain": "pchain",
AntoxaAntoxic marked this conversation as resolved.
Show resolved Hide resolved
"ext": {
"schain": {
"complete": 0,
Expand Down
6 changes: 1 addition & 5 deletions adapters/rubicon/rubicontest/exemplary/simple-banner.json
Original file line number Diff line number Diff line change
Expand Up @@ -131,8 +131,7 @@
"bidder": {
"accountId": 1001,
"siteId": 113932,
"zoneId": 535510,
"pchain": "pchain"
"zoneId": 535510
},
"skadn": {
"version": "1.0",
Expand Down Expand Up @@ -299,9 +298,6 @@
"id": "1",
"bundle": "com.wls.testwlsapplication"
},
"source": {
"pchain": "pchain"
AntoxaAntoxic marked this conversation as resolved.
Show resolved Hide resolved
},
"imp": [
{
"id": "test-imp-id",
Expand Down
1 change: 0 additions & 1 deletion openrtb_ext/imp_rubicon.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ type ExtImpRubicon struct {
Visitor json.RawMessage `json:"visitor,omitempty"`
Video rubiconVideoParams `json:"video"`
Debug impExtRubiconDebug `json:"debug,omitempty"`
PChain string `json:"pchain,omitempty"`
}

// rubiconVideoParams defines the contract for bidrequest.imp[i].ext.prebid.bidder.rubicon.video
Expand Down
Loading