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

Removed Digitrust From Prebid Server #1892

Merged
merged 3 commits into from
Jul 1, 2021
Merged
Show file tree
Hide file tree
Changes from 2 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
7 changes: 1 addition & 6 deletions adapters/adform/adformtest/supplemental/user-nil.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,7 @@
},
"user": {
"ext": {
"consent": "abc2",
"digitrust": {
"ID": "digitrustId",
"KeyV": 1,
"Pref": 0
}
"consent": "abc2"
}
}
},
Expand Down
2 changes: 1 addition & 1 deletion adapters/dmx/dmx.go
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ func (adapter *DmxAdapter) MakeRequests(request *openrtb2.BidRequest, req *adapt
}
if dmxReq.User.Ext != nil {
if err := json.Unmarshal(dmxReq.User.Ext, &userExt); err == nil {
if len(userExt.Eids) > 0 || (userExt.DigiTrust != nil && userExt.DigiTrust.ID != "") {
if len(userExt.Eids) > 0 {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please send an email to DMX notifying them of this change to their adapter.

anyHasId = true
}
}
Expand Down
59 changes: 5 additions & 54 deletions adapters/dmx/dmx_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -643,50 +643,6 @@ func TestUserEidsOnly(t *testing.T) {
}
}

func TestUserDigitrustOnly(t *testing.T) {
var w, h int = 300, 250

var width, height int64 = int64(w), int64(h)

bidder, buildErr := Builder(openrtb_ext.BidderDmx, config.Adapter{
Endpoint: "https://dmx.districtm.io/b/v2"})

if buildErr != nil {
t.Fatalf("Builder returned unexpected error %v", buildErr)
}

imp1 := openrtb2.Imp{
ID: "imp1",
Ext: json.RawMessage("{\"bidder\":{\"dmxid\": \"1007\", \"memberid\": \"123456\", \"seller_id\":\"1008\"}}"),
Banner: &openrtb2.Banner{
W: &width,
H: &height,
Format: []openrtb2.Format{
{W: 300, H: 250},
},
}}

inputRequest := openrtb2.BidRequest{
Imp: []openrtb2.Imp{imp1, imp1, imp1},
Site: &openrtb2.Site{
Publisher: &openrtb2.Publisher{
ID: "10007",
},
},
User: &openrtb2.User{Ext: json.RawMessage(`{
"digitrust": {
"id": "11111111111",
"keyv": 4
}}`)},
ID: "1234",
}

actualAdapterRequests, _ := bidder.MakeRequests(&inputRequest, &adapters.ExtraRequestInfo{})
if len(actualAdapterRequests) != 1 {
t.Errorf("should have 1 request")
}
}

func TestUsersEids(t *testing.T) {
var w, h int = 300, 250

Expand Down Expand Up @@ -728,16 +684,14 @@ func TestUsersEids(t *testing.T) {
},{
"source": "pubcid.org",
"uids": [{
"id":"11111111"
"id": "11111111"
}]
},
{
},{
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we roll back to:

},
{

please?

"source": "id5-sync.com",
"uids": [{
"id": "ID5-12345"
}]
},
{
}, {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we roll back to:

},
{

please?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated!

"source": "parrable.com",
"uids": [{
"id": "01.1563917337.test-eid"
Expand Down Expand Up @@ -767,11 +721,8 @@ func TestUsersEids(t *testing.T) {
"uids": [{
"id": "11111111"
}]
}],
"digitrust": {
"id": "11111111111",
"keyv": 4
}}`)},
}]
}`)},
ID: "1234",
}

Expand Down
14 changes: 5 additions & 9 deletions adapters/rubicon/rubicon.go
Original file line number Diff line number Diff line change
Expand Up @@ -96,12 +96,11 @@ type rubiconUserDataExt struct {
}

type rubiconUserExt struct {
Consent string `json:"consent,omitempty"`
DigiTrust *openrtb_ext.ExtUserDigiTrust `json:"digitrust"`
Eids []openrtb_ext.ExtUserEid `json:"eids,omitempty"`
TpID []rubiconExtUserTpID `json:"tpid,omitempty"`
RP rubiconUserExtRP `json:"rp"`
LiverampIdl string `json:"liveramp_idl,omitempty"`
Consent string `json:"consent,omitempty"`
Eids []openrtb_ext.ExtUserEid `json:"eids,omitempty"`
TpID []rubiconExtUserTpID `json:"tpid,omitempty"`
RP rubiconUserExtRP `json:"rp"`
LiverampIdl string `json:"liveramp_idl,omitempty"`
}

type rubiconSiteExtRP struct {
Expand Down Expand Up @@ -768,9 +767,6 @@ func (a *RubiconAdapter) MakeRequests(request *openrtb2.BidRequest, reqInfo *ada
continue
}
userExtRP.Consent = userExt.Consent
if userExt.DigiTrust != nil {
userExtRP.DigiTrust = userExt.DigiTrust
}
userExtRP.Eids = userExt.Eids

// set user.ext.tpid
Expand Down
10 changes: 1 addition & 9 deletions adapters/rubicon/rubicon_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -993,11 +993,7 @@ func TestOpenRTBRequest(t *testing.T) {
PxRatio: rubidata.devicePxRatio,
},
User: &openrtb2.User{
Ext: json.RawMessage(`{"digitrust": {
"id": "some-digitrust-id",
"keyv": 1,
"pref": 0
},
Ext: json.RawMessage(`{
"eids": [{
"source": "pubcid",
"id": "2402fc76-7b39-4f0e-bfc2-060ef7693648"
Expand Down Expand Up @@ -1071,10 +1067,6 @@ func TestOpenRTBRequest(t *testing.T) {
t.Fatal("Error unmarshalling request.user.ext object.")
}

assert.Equal(t, "some-digitrust-id", userExt.DigiTrust.ID, "DigiTrust ID id not as expected!")
assert.Equal(t, 1, userExt.DigiTrust.KeyV, "DigiTrust KeyV id not as expected!")
assert.Equal(t, 0, userExt.DigiTrust.Pref, "DigiTrust Pref id not as expected!")

assert.NotNil(t, userExt.Eids)
assert.Equal(t, 1, len(userExt.Eids), "Eids values are not as expected!")
assert.Contains(t, userExt.Eids, openrtb_ext.ExtUserEid{Source: "pubcid", ID: "2402fc76-7b39-4f0e-bfc2-060ef7693648"})
Expand Down
1 change: 0 additions & 1 deletion adapters/rubicon/rubicontest/exemplary/simple-video.json
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,6 @@
}
],
"ext": {
"digitrust": null,
"rp": {
"target": {
"iab": [
Expand Down
12 changes: 2 additions & 10 deletions endpoints/openrtb2/amp_auction_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ func TestGoodAmpRequests(t *testing.T) {
goodRequests := map[string]json.RawMessage{
"1": json.RawMessage(validRequest(t, "aliased-buyeruids.json")),
"2": json.RawMessage(validRequest(t, "aliases.json")),
"4": json.RawMessage(validRequest(t, "digitrust.json")),
"5": json.RawMessage(validRequest(t, "gdpr-no-consentstring.json")),
"6": json.RawMessage(validRequest(t, "gdpr.json")),
"7": json.RawMessage(validRequest(t, "site.json")),
Expand Down Expand Up @@ -122,11 +121,6 @@ func TestAMPPageInfo(t *testing.T) {
func TestGDPRConsent(t *testing.T) {
consent := "BOu5On0Ou5On0ADACHENAO7pqzAAppY"
existingConsent := "BONV8oqONXwgmADACHENAO7pqzAAppY"
digitrust := &openrtb_ext.ExtUserDigiTrust{
ID: "anyDigitrustID",
KeyV: 1,
Pref: 0,
}

testCases := []struct {
description string
Expand Down Expand Up @@ -165,12 +159,10 @@ func TestGDPRConsent(t *testing.T) {
description: "Overrides Existing Consent - With Sibling Data",
consent: consent,
userExt: &openrtb_ext.ExtUser{
Consent: existingConsent,
DigiTrust: digitrust,
Consent: existingConsent,
},
expectedUserExt: openrtb_ext.ExtUser{
Consent: consent,
DigiTrust: digitrust,
Consent: consent,
},
},
{
Expand Down
6 changes: 1 addition & 5 deletions endpoints/openrtb2/auction.go
Original file line number Diff line number Diff line change
Expand Up @@ -1124,13 +1124,9 @@ func (deps *endpointDeps) validateUser(user *openrtb2.User, aliases map[string]s
}

if user.Ext != nil {
// Creating ExtUser object to check if DigiTrust is valid
// Creating ExtUser object
var userExt openrtb_ext.ExtUser
if err := json.Unmarshal(user.Ext, &userExt); err == nil {
if userExt.DigiTrust != nil && userExt.DigiTrust.Pref != 0 {
// DigiTrust is not valid. Return error.
return errors.New("request.user contains a digitrust object that is not valid.")
}
// Check if the buyeruids are valid
if userExt.Prebid != nil {
if len(userExt.Prebid.BuyerUIDs) < 1 {
Expand Down
46 changes: 0 additions & 46 deletions endpoints/openrtb2/sample-requests/invalid-whole/digitrust.json

This file was deleted.

This file was deleted.

4 changes: 2 additions & 2 deletions exchange/exchange_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1720,7 +1720,7 @@ func newRaceCheckingRequest(t *testing.T) *openrtb2.BidRequest {
User: &openrtb2.User{
ID: "our-id",
BuyerUID: "their-id",
Ext: json.RawMessage(`{"consent":"BONciguONcjGKADACHENAOLS1rAHDAFAAEAASABQAMwAeACEAFw","digitrust":{"id":"digi-id","keyv":1,"pref":1}}`),
Ext: json.RawMessage(`{"consent":"BONciguONcjGKADACHENAOLS1rAHDAFAAEAASABQAMwAeACEAFw"}`),
},
Regs: &openrtb2.Regs{
COPPA: 1,
Expand Down Expand Up @@ -1882,7 +1882,7 @@ func TestPanicRecoveryHighLevel(t *testing.T) {
User: &openrtb2.User{
ID: "our-id",
BuyerUID: "their-id",
Ext: json.RawMessage(`{"consent":"BONciguONcjGKADACHENAOLS1rAHDAFAAEAASABQAMwAeACEAFw","digitrust":{"id":"digi-id","keyv":1,"pref":1}}`),
Ext: json.RawMessage(`{"consent":"BONciguONcjGKADACHENAOLS1rAHDAFAAEAASABQAMwAeACEAFw"}`),
},
Imp: []openrtb2.Imp{{
ID: "some-imp-id",
Expand Down
14 changes: 1 addition & 13 deletions exchange/exchangetest/request-other-user-ext.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,6 @@
"buyeruids": {
"appnexus": "explicit-appnexus"
}
},
"digitrust": {
"id": "digi-id",
"keyv": 1,
"pref": 2
}
}
},
Expand Down Expand Up @@ -48,14 +43,7 @@
},
"user": {
"id": "foo",
"buyeruid": "explicit-appnexus",
"ext": {
"digitrust": {
"id": "digi-id",
"keyv": 1,
"pref": 2
}
}
"buyeruid": "explicit-appnexus"
},
"imp": [
{
Expand Down
10 changes: 0 additions & 10 deletions exchange/exchangetest/request-user-no-prebid.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,6 @@
"user": {
"id": "foo",
"ext": {
"digitrust": {
"id": "digi-id",
"keyv": 1,
"pref": 2
}
}
},
"imp": [
Expand Down Expand Up @@ -45,11 +40,6 @@
"id": "foo",
"buyeruid": "implicit-appnexus",
"ext": {
"digitrust": {
"id": "digi-id",
"keyv": 1,
"pref": 2
}
}
},
"imp": [
Expand Down
2 changes: 1 addition & 1 deletion exchange/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -332,7 +332,7 @@ func extractBuyerUIDs(user *openrtb2.User) (map[string]string, error) {
userExt.Prebid = nil

// Remarshal (instead of removing) if the ext has other known fields
if userExt.Consent != "" || userExt.DigiTrust != nil || len(userExt.Eids) > 0 {
if userExt.Consent != "" || len(userExt.Eids) > 0 {
if newUserExtBytes, err := json.Marshal(userExt); err != nil {
return nil, err
} else {
Expand Down
Loading