From b9c2614798d16dbb27841dc6a1c6103566a04b49 Mon Sep 17 00:00:00 2001 From: Ashish Garg Date: Mon, 25 Sep 2023 22:22:54 +0530 Subject: [PATCH 1/8] make case insensitive comparison in auction request (#3113) --- endpoints/openrtb2/auction.go | 21 +-- endpoints/openrtb2/auction_test.go | 78 ++++++++-- .../exemplary/all-ext-case-insensitive.json | 140 ++++++++++++++++++ .../valid-whole/exemplary/all-ext.json | 86 ++++++----- .../exemplary/simple-case-insensitive.json | 61 ++++++++ .../valid-whole/exemplary/simple.json | 40 ++--- exchange/exchange_test.go | 6 +- exchange/utils.go | 3 +- 8 files changed, 355 insertions(+), 80 deletions(-) create mode 100644 endpoints/openrtb2/sample-requests/valid-whole/exemplary/all-ext-case-insensitive.json create mode 100644 endpoints/openrtb2/sample-requests/valid-whole/exemplary/simple-case-insensitive.json diff --git a/endpoints/openrtb2/auction.go b/endpoints/openrtb2/auction.go index 375756cc565..f419ca341ee 100644 --- a/endpoints/openrtb2/auction.go +++ b/endpoints/openrtb2/auction.go @@ -1520,12 +1520,12 @@ func (deps *endpointDeps) validateImpExt(imp *openrtb_ext.ImpWrapper, aliases ma errL := []error{} for bidder, ext := range prebid.Bidder { - coreBidder := bidder + coreBidder, _ := openrtb_ext.NormalizeBidderName(bidder) if tmp, isAlias := aliases[bidder]; isAlias { - coreBidder = tmp + coreBidder = openrtb_ext.BidderName(tmp) } - if coreBidderNormalized, isValid := deps.bidderMap[coreBidder]; isValid { + if coreBidderNormalized, isValid := deps.bidderMap[coreBidder.String()]; isValid { if err := deps.paramsValidator.Validate(coreBidderNormalized, ext); err != nil { return []error{fmt.Errorf("request.imp[%d].ext.prebid.bidder.%s failed validation.\n%v", impIndex, bidder, err)} } @@ -1585,18 +1585,21 @@ func (deps *endpointDeps) parseBidExt(req *openrtb_ext.RequestWrapper) error { } func (deps *endpointDeps) validateAliases(aliases map[string]string) error { - for alias, coreBidder := range aliases { - if _, isCoreBidderDisabled := deps.disabledBidders[coreBidder]; isCoreBidderDisabled { - return fmt.Errorf("request.ext.prebid.aliases.%s refers to disabled bidder: %s", alias, coreBidder) + for alias, bidderName := range aliases { + normalisedBidderName, _ := openrtb_ext.NormalizeBidderName(bidderName) + coreBidderName := normalisedBidderName.String() + if _, isCoreBidderDisabled := deps.disabledBidders[coreBidderName]; isCoreBidderDisabled { + return fmt.Errorf("request.ext.prebid.aliases.%s refers to disabled bidder: %s", alias, bidderName) } - if _, isCoreBidder := deps.bidderMap[coreBidder]; !isCoreBidder { - return fmt.Errorf("request.ext.prebid.aliases.%s refers to unknown bidder: %s", alias, coreBidder) + if _, isCoreBidder := deps.bidderMap[coreBidderName]; !isCoreBidder { + return fmt.Errorf("request.ext.prebid.aliases.%s refers to unknown bidder: %s", alias, bidderName) } - if alias == coreBidder { + if alias == coreBidderName { return fmt.Errorf("request.ext.prebid.aliases.%s defines a no-op alias. Choose a different alias, or remove this entry.", alias) } + aliases[alias] = coreBidderName } return nil } diff --git a/endpoints/openrtb2/auction_test.go b/endpoints/openrtb2/auction_test.go index f60fd98e926..08637df2493 100644 --- a/endpoints/openrtb2/auction_test.go +++ b/endpoints/openrtb2/auction_test.go @@ -2968,19 +2968,21 @@ func TestValidateImpExt(t *testing.T) { for _, group := range testGroups { for _, test := range group.testCases { - imp := &openrtb2.Imp{Ext: test.impExt} - impWrapper := &openrtb_ext.ImpWrapper{Imp: imp} + t.Run(test.description, func(t *testing.T) { + imp := &openrtb2.Imp{Ext: test.impExt} + impWrapper := &openrtb_ext.ImpWrapper{Imp: imp} - errs := deps.validateImpExt(impWrapper, nil, 0, false, nil) + errs := deps.validateImpExt(impWrapper, nil, 0, false, nil) - assert.NoError(t, impWrapper.RebuildImp(), test.description+":rebuild_imp") + assert.NoError(t, impWrapper.RebuildImp(), test.description+":rebuild_imp") - if len(test.expectedImpExt) > 0 { - assert.JSONEq(t, test.expectedImpExt, string(imp.Ext), "imp.ext JSON does not match expected. Test: %s. %s\n", group.description, test.description) - } else { - assert.Empty(t, imp.Ext, "imp.ext expected to be empty but was: %s. Test: %s. %s\n", string(imp.Ext), group.description, test.description) - } - assert.Equal(t, test.expectedErrs, errs, "errs slice does not match expected. Test: %s. %s\n", group.description, test.description) + if len(test.expectedImpExt) > 0 { + assert.JSONEq(t, test.expectedImpExt, string(imp.Ext), "imp.ext JSON does not match expected. Test: %s. %s\n", group.description, test.description) + } else { + assert.Empty(t, imp.Ext, "imp.ext expected to be empty but was: %s. Test: %s. %s\n", string(imp.Ext), group.description, test.description) + } + assert.Equal(t, test.expectedErrs, errs, "errs slice does not match expected. Test: %s. %s\n", group.description, test.description) + }) } } } @@ -5978,3 +5980,59 @@ func TestSetSeatNonBidRaw(t *testing.T) { }) } } + +func TestValidateAliases(t *testing.T) { + deps := &endpointDeps{ + disabledBidders: map[string]string{"rubicon": "rubicon"}, + bidderMap: map[string]openrtb_ext.BidderName{"appnexus": openrtb_ext.BidderName("appnexus")}, + } + + testCases := []struct { + description string + aliases map[string]string + expectedAliases map[string]string + expectedError error + }{ + { + description: "valid case", + aliases: map[string]string{"test": "appnexus"}, + expectedAliases: map[string]string{"test": "appnexus"}, + expectedError: nil, + }, + { + description: "valid case - case insensitive", + aliases: map[string]string{"test": "Appnexus"}, + expectedAliases: map[string]string{"test": "appnexus"}, + expectedError: nil, + }, + { + description: "disabled bidder", + aliases: map[string]string{"test": "rubicon"}, + expectedAliases: nil, + expectedError: errors.New("request.ext.prebid.aliases.test refers to disabled bidder: rubicon"), + }, + { + description: "coreBidderName not found", + aliases: map[string]string{"test": "anyBidder"}, + expectedAliases: nil, + expectedError: errors.New("request.ext.prebid.aliases.test refers to unknown bidder: anyBidder"), + }, + { + description: "alias name is coreBidder name", + aliases: map[string]string{"appnexus": "appnexus"}, + expectedAliases: nil, + expectedError: errors.New("request.ext.prebid.aliases.appnexus defines a no-op alias. Choose a different alias, or remove this entry."), + }, + } + + for _, testCase := range testCases { + t.Run(testCase.description, func(t *testing.T) { + err := deps.validateAliases(testCase.aliases) + if err != nil { + assert.Equal(t, testCase.expectedError, err) + } else { + assert.ObjectsAreEqualValues(testCase.expectedAliases, map[string]string{"test": "appnexus"}) + } + }) + } +} diff --git a/endpoints/openrtb2/sample-requests/valid-whole/exemplary/all-ext-case-insensitive.json b/endpoints/openrtb2/sample-requests/valid-whole/exemplary/all-ext-case-insensitive.json new file mode 100644 index 00000000000..20997076af2 --- /dev/null +++ b/endpoints/openrtb2/sample-requests/valid-whole/exemplary/all-ext-case-insensitive.json @@ -0,0 +1,140 @@ +{ + "description": "This demonstrates all extension in case insensitive.", + "config": { + "mockBidders": [ + { + "bidderName": "appnexus", + "currency": "USD", + "price": 1.00 + }, + { + "bidderName": "rubicon", + "currency": "USD", + "price": 1.00 + } + ] + }, + "mockBidRequest": { + "id": "some-request-id", + "site": { + "page": "prebid.org" + }, + "user": { + "ext": { + "consent": "gdpr-consent-string", + "prebid": { + "buyeruids": { + "appnexus": "override-appnexus-id-in-cookie" + } + } + } + }, + "regs": { + "ext": { + "gdpr": 1, + "us_privacy": "1NYN" + } + }, + "imp": [ + { + "id": "some-impression-id", + "banner": { + "format": [ + { + "w": 300, + "h": 250 + }, + { + "w": 300, + "h": 600 + } + ] + }, + "ext": { + "appnexus": { + "placementId": 12883451 + }, + "districtm": { + "placementId": 105 + }, + "rubicon": { + "accountId": 1001, + "siteId": 113932, + "zoneId": 535510 + } + } + } + ], + "tmax": 500, + "ext": { + "prebid": { + "aliases": { + "districtm": "Appnexus" + }, + "bidadjustmentfactors": { + "appnexus": 1.01, + "districtm": 0.98, + "rubicon": 0.99 + }, + "cache": { + "bids": {} + }, + "channel": { + "name": "video", + "version": "1.0" + }, + "targeting": { + "includewinners": false, + "pricegranularity": { + "precision": 2, + "ranges": [ + { + "max": 20, + "increment": 0.10 + } + ] + } + } + } + } + }, + "expectedBidResponse": { + "id": "some-request-id", + "seatbid": [ + { + "bid": [ + { + "id": "appnexus-bid", + "impid": "some-impression-id", + "price": 1.01 + } + ], + "seat": "appnexus" + }, + { + "bid": [ + { + "id": "appnexus-bid", + "impid": "some-impression-id", + "price": 0.98 + } + ], + "seat": "districtm" + }, + { + "bid": [ + { + "id": "rubicon-bid", + "impid": "some-impression-id", + "price": 0.99 + } + ], + "seat": "rubicon" + } + ], + "bidid": "test bid id", + "cur": "USD", + "nbr": 0 + }, + "expectedReturnCode": 200 +} \ No newline at end of file diff --git a/endpoints/openrtb2/sample-requests/valid-whole/exemplary/all-ext.json b/endpoints/openrtb2/sample-requests/valid-whole/exemplary/all-ext.json index 8f64fd2a5fd..02dc6160d49 100644 --- a/endpoints/openrtb2/sample-requests/valid-whole/exemplary/all-ext.json +++ b/endpoints/openrtb2/sample-requests/valid-whole/exemplary/all-ext.json @@ -2,8 +2,16 @@ "description": "This demonstrates all of the OpenRTB extensions supported by Prebid Server. Very few requests will need all of these at once.", "config": { "mockBidders": [ - {"bidderName": "appnexus", "currency": "USD", "price": 1.00}, - {"bidderName": "rubicon", "currency": "USD", "price": 1.00} + { + "bidderName": "appnexus", + "currency": "USD", + "price": 1.00 + }, + { + "bidderName": "rubicon", + "currency": "USD", + "price": 1.00 + } ] }, "mockBidRequest": { @@ -91,42 +99,42 @@ } }, "expectedBidResponse": { - "id":"some-request-id", - "seatbid": [ - { - "bid": [ - { - "id": "appnexus-bid", - "impid": "some-impression-id", - "price": 1.01 - } - ], - "seat": "appnexus" - }, - { - "bid": [ - { - "id": "appnexus-bid", - "impid": "some-impression-id", - "price": 0.98 - } - ], - "seat": "districtm" - }, - { - "bid": [ - { - "id": "rubicon-bid", - "impid": "some-impression-id", - "price": 0.99 - } - ], - "seat": "rubicon" - } - ], - "bidid":"test bid id", - "cur":"USD", - "nbr":0 + "id": "some-request-id", + "seatbid": [ + { + "bid": [ + { + "id": "appnexus-bid", + "impid": "some-impression-id", + "price": 1.01 + } + ], + "seat": "appnexus" + }, + { + "bid": [ + { + "id": "appnexus-bid", + "impid": "some-impression-id", + "price": 0.98 + } + ], + "seat": "districtm" + }, + { + "bid": [ + { + "id": "rubicon-bid", + "impid": "some-impression-id", + "price": 0.99 + } + ], + "seat": "rubicon" + } + ], + "bidid": "test bid id", + "cur": "USD", + "nbr": 0 }, "expectedReturnCode": 200 -} +} \ No newline at end of file diff --git a/endpoints/openrtb2/sample-requests/valid-whole/exemplary/simple-case-insensitive.json b/endpoints/openrtb2/sample-requests/valid-whole/exemplary/simple-case-insensitive.json new file mode 100644 index 00000000000..9b66a59d0a5 --- /dev/null +++ b/endpoints/openrtb2/sample-requests/valid-whole/exemplary/simple-case-insensitive.json @@ -0,0 +1,61 @@ +{ + "description": "Simple request - bidder case insensitive", + "config": { + "mockBidders": [ + { + "bidderName": "appnexus", + "currency": "USD", + "price": 0.00 + } + ] + }, + "mockBidRequest": { + "id": "some-request-id", + "site": { + "page": "prebid.org" + }, + "imp": [ + { + "id": "some-impression-id", + "banner": { + "format": [ + { + "w": 300, + "h": 250 + }, + { + "w": 300, + "h": 600 + } + ] + }, + "ext": { + "Appnexus": { + "placementId": 12883451 + } + } + } + ], + "tmax": 500, + "ext": {} + }, + "expectedBidResponse": { + "id": "some-request-id", + "seatbid": [ + { + "bid": [ + { + "id": "appnexus-bid", + "impid": "some-impression-id", + "price": 0 + } + ], + "seat": "Appnexus" + } + ], + "bidid": "test bid id", + "cur": "USD", + "nbr": 0 + }, + "expectedReturnCode": 200 +} \ No newline at end of file diff --git a/endpoints/openrtb2/sample-requests/valid-whole/exemplary/simple.json b/endpoints/openrtb2/sample-requests/valid-whole/exemplary/simple.json index ba9079d4675..5a7dbd20747 100644 --- a/endpoints/openrtb2/sample-requests/valid-whole/exemplary/simple.json +++ b/endpoints/openrtb2/sample-requests/valid-whole/exemplary/simple.json @@ -2,7 +2,11 @@ "description": "Simple request", "config": { "mockBidders": [ - {"bidderName": "appnexus", "currency": "USD", "price": 0.00} + { + "bidderName": "appnexus", + "currency": "USD", + "price": 0.00 + } ] }, "mockBidRequest": { @@ -36,22 +40,22 @@ "ext": {} }, "expectedBidResponse": { - "id":"some-request-id", - "seatbid": [ - { - "bid": [ - { - "id": "appnexus-bid", - "impid": "some-impression-id", - "price": 0 - } - ], - "seat": "appnexus" - } - ], - "bidid":"test bid id", - "cur":"USD", - "nbr":0 + "id": "some-request-id", + "seatbid": [ + { + "bid": [ + { + "id": "appnexus-bid", + "impid": "some-impression-id", + "price": 0 + } + ], + "seat": "appnexus" + } + ], + "bidid": "test bid id", + "cur": "USD", + "nbr": 0 }, "expectedReturnCode": 200 -} +} \ No newline at end of file diff --git a/exchange/exchange_test.go b/exchange/exchange_test.go index 8ca96880781..c4b85ebeb1f 100644 --- a/exchange/exchange_test.go +++ b/exchange/exchange_test.go @@ -769,7 +769,7 @@ func TestAdapterCurrency(t *testing.T) { categoriesFetcher: nilCategoryFetcher{}, bidIDGenerator: &mockBidIDGenerator{false, false}, adapterMap: map[openrtb_ext.BidderName]AdaptedBidder{ - openrtb_ext.BidderName("foo"): AdaptBidder(mockBidder, nil, &config.Configuration{}, &metricsConfig.NilMetricsEngine{}, openrtb_ext.BidderName("foo"), nil, ""), + openrtb_ext.BidderName("appnexus"): AdaptBidder(mockBidder, nil, &config.Configuration{}, &metricsConfig.NilMetricsEngine{}, openrtb_ext.BidderName("appnexus"), nil, ""), }, } e.requestSplitter = requestSplitter{ @@ -783,7 +783,7 @@ func TestAdapterCurrency(t *testing.T) { Imp: []openrtb2.Imp{{ ID: "some-impression-id", Banner: &openrtb2.Banner{Format: []openrtb2.Format{{W: 300, H: 250}, {W: 300, H: 600}}}, - Ext: json.RawMessage(`{"prebid":{"bidder":{"foo":{"placementId":1}}}}`), + Ext: json.RawMessage(`{"prebid":{"bidder":{"appnexus":{"placementId":1}}}}`), }}, Site: &openrtb2.Site{ Page: "prebid.org", @@ -805,7 +805,7 @@ func TestAdapterCurrency(t *testing.T) { assert.NoError(t, err) assert.Equal(t, "some-request-id", response.ID, "Response ID") assert.Empty(t, response.SeatBid, "Response Bids") - assert.Contains(t, string(response.Ext), `"errors":{"foo":[{"code":5,"message":"The adapter failed to generate any bid requests, but also failed to generate an error explaining why"}]}`, "Response Ext") + assert.Contains(t, string(response.Ext), `"errors":{"appnexus":[{"code":5,"message":"The adapter failed to generate any bid requests, but also failed to generate an error explaining why"}]}`, "Response Ext") // Test Currency Converter Properly Passed To Adapter if assert.NotNil(t, mockBidder.lastExtraRequestInfo, "Currency Conversion Argument") { diff --git a/exchange/utils.go b/exchange/utils.go index 6c47bcaa9c0..0a38e487632 100644 --- a/exchange/utils.go +++ b/exchange/utils.go @@ -762,10 +762,11 @@ func setUserExtWithCopy(request *openrtb2.BidRequest, userExtJSON json.RawMessag // resolveBidder returns the known BidderName associated with bidder, if bidder is an alias. If it's not an alias, the bidder is returned. func resolveBidder(bidder string, aliases map[string]string) openrtb_ext.BidderName { + normalisedBidderName, _ := openrtb_ext.NormalizeBidderName(bidder) if coreBidder, ok := aliases[bidder]; ok { return openrtb_ext.BidderName(coreBidder) } - return openrtb_ext.BidderName(bidder) + return normalisedBidderName } // parseAliases parses the aliases from the BidRequest From a91e40c8429a224a186cb998f99e35e97432d43d Mon Sep 17 00:00:00 2001 From: freemmy Date: Tue, 26 Sep 2023 12:51:19 +0700 Subject: [PATCH 2/8] Silvermob: host validation (us, eu, apac) (#3110) --- adapters/silvermob/silvermob.go | 14 ++++- .../supplemental/invalid-host.json | 53 +++++++++++++++++++ 2 files changed, 65 insertions(+), 2 deletions(-) create mode 100644 adapters/silvermob/silvermobtest/supplemental/invalid-host.json diff --git a/adapters/silvermob/silvermob.go b/adapters/silvermob/silvermob.go index 9130ab4d96a..d4a1b55b45f 100644 --- a/adapters/silvermob/silvermob.go +++ b/adapters/silvermob/silvermob.go @@ -18,6 +18,10 @@ type SilverMobAdapter struct { endpoint *template.Template } +func isValidHost(host string) bool { + return host == "eu" || host == "us" || host == "apac" +} + // Builder builds a new instance of the SilverMob adapter for the given bidder with the given config. func Builder(bidderName openrtb_ext.BidderName, config config.Adapter, server config.Server) (adapters.Bidder, error) { template, err := template.New("endpointTemplate").Parse(config.Endpoint) @@ -121,8 +125,14 @@ func (a *SilverMobAdapter) getImpressionExt(imp *openrtb2.Imp) (*openrtb_ext.Ext } func (a *SilverMobAdapter) buildEndpointURL(params *openrtb_ext.ExtSilverMob) (string, error) { - endpointParams := macros.EndpointTemplateParams{ZoneID: params.ZoneID, Host: params.Host} - return macros.ResolveMacros(a.endpoint, endpointParams) + if isValidHost(params.Host) { + endpointParams := macros.EndpointTemplateParams{ZoneID: params.ZoneID, Host: params.Host} + return macros.ResolveMacros(a.endpoint, endpointParams) + } else { + return "", &errortypes.BadInput{ + Message: fmt.Sprintf("invalid host %s", params.Host), + } + } } func (a *SilverMobAdapter) MakeBids( diff --git a/adapters/silvermob/silvermobtest/supplemental/invalid-host.json b/adapters/silvermob/silvermobtest/supplemental/invalid-host.json new file mode 100644 index 00000000000..f8b2cd3442f --- /dev/null +++ b/adapters/silvermob/silvermobtest/supplemental/invalid-host.json @@ -0,0 +1,53 @@ +{ + "mockBidRequest": { + "id": "some-request-id", + "device": { + "ua": "test-user-agent", + "ip": "123.123.123.123", + "language": "en", + "dnt": 0 + }, + "tmax": 1000, + "user": { + "buyeruid": "awesome-user" + }, + "app": { + "publisher": { + "id": "123456789" + }, + "cat": [ + "IAB22-1" + ], + "bundle": "com.app.awesome", + "name": "Awesome App", + "domain": "awesomeapp.com", + "id": "123456789" + }, + "imp": [ + { + "id": "some-impression-id", + "tagid": "ogTAGID", + "banner": { + "w":320, + "h":50 + }, + "ext": { + "bidder": { + "host": "some_host", + "zoneid": "0" + } + } + } + ] + }, + "httpCalls": [ + ], + "expectedBidResponses": [ + ], + "expectedMakeRequestsErrors": [ + { + "value": "invalid host some_host", + "comparison": "literal" + } + ] + } \ No newline at end of file From 63170b8484c6a1eb35194d0d04b22c5b76126c9f Mon Sep 17 00:00:00 2001 From: Ashish Garg Date: Tue, 26 Sep 2023 11:26:52 +0530 Subject: [PATCH 3/8] make bidderInfo endpoint case insensitive (#3136) co-authored by @gargcreation1992 --- endpoints/info/bidders_detail.go | 20 ++++++++- endpoints/info/bidders_detail_test.go | 62 +++++++++++++++++---------- 2 files changed, 59 insertions(+), 23 deletions(-) diff --git a/endpoints/info/bidders_detail.go b/endpoints/info/bidders_detail.go index 9b8d42686ae..d9dc776f50d 100644 --- a/endpoints/info/bidders_detail.go +++ b/endpoints/info/bidders_detail.go @@ -27,7 +27,11 @@ func NewBiddersDetailEndpoint(bidders config.BidderInfos, aliases map[string]str return func(w http.ResponseWriter, _ *http.Request, ps httprouter.Params) { bidder := ps.ByName("bidderName") - if response, ok := responses[bidder]; ok { + coreBidderName, found := getNormalisedBidderName(bidder, aliases) + if !found { + w.WriteHeader(http.StatusNotFound) + } + if response, ok := responses[coreBidderName]; ok { w.Header().Set("Content-Type", "application/json") if _, err := w.Write(response); err != nil { glog.Errorf("error writing response to /info/bidders/%s: %v", bidder, err) @@ -38,6 +42,20 @@ func NewBiddersDetailEndpoint(bidders config.BidderInfos, aliases map[string]str } } +func getNormalisedBidderName(bidderName string, aliases map[string]string) (string, bool) { + if strings.ToLower(bidderName) == "all" { + return "all", true + } + coreBidderName, ok := openrtb_ext.NormalizeBidderName(bidderName) + if !ok { //check default aliases if not found in coreBidders + if _, isDefaultAlias := aliases[bidderName]; isDefaultAlias { + return bidderName, true + } + return "", false + } + return coreBidderName.String(), true +} + func prepareBiddersDetailResponse(bidders config.BidderInfos, aliases map[string]string) (map[string][]byte, error) { details, err := mapDetails(bidders, aliases) if err != nil { diff --git a/endpoints/info/bidders_detail_test.go b/endpoints/info/bidders_detail_test.go index 3be24acfdba..435d0cec92c 100644 --- a/endpoints/info/bidders_detail_test.go +++ b/endpoints/info/bidders_detail_test.go @@ -2,6 +2,7 @@ package info import ( "bytes" + "fmt" "io" "net/http" "net/http/httptest" @@ -365,22 +366,22 @@ func TestMapMediaTypes(t *testing.T) { func TestBiddersDetailHandler(t *testing.T) { bidderAInfo := config.BidderInfo{Endpoint: "https://secureEndpoint.com", Disabled: false, Maintainer: &config.MaintainerInfo{Email: "bidderA"}} bidderAResponse := []byte(`{"status":"ACTIVE","usesHttps":true,"maintainer":{"email":"bidderA"}}`) - aliasAResponse := []byte(`{"status":"ACTIVE","usesHttps":true,"maintainer":{"email":"bidderA"},"aliasOf":"a"}`) + aliasAResponse := []byte(`{"status":"ACTIVE","usesHttps":true,"maintainer":{"email":"bidderA"},"aliasOf":"appnexus"}`) bidderBInfo := config.BidderInfo{Endpoint: "http://unsecureEndpoint.com", Disabled: false, Maintainer: &config.MaintainerInfo{Email: "bidderB"}} bidderBResponse := []byte(`{"status":"ACTIVE","usesHttps":false,"maintainer":{"email":"bidderB"}}`) allResponse := bytes.Buffer{} - allResponse.WriteString(`{"a":`) - allResponse.Write(bidderAResponse) - allResponse.WriteString(`,"aAlias":`) + allResponse.WriteString(`{"aAlias":`) allResponse.Write(aliasAResponse) - allResponse.WriteString(`,"b":`) + allResponse.WriteString(`,"appnexus":`) + allResponse.Write(bidderAResponse) + allResponse.WriteString(`,"rubicon":`) allResponse.Write(bidderBResponse) allResponse.WriteString(`}`) - bidders := config.BidderInfos{"a": bidderAInfo, "b": bidderBInfo} - aliases := map[string]string{"aAlias": "a"} + bidders := config.BidderInfos{"appnexus": bidderAInfo, "rubicon": bidderBInfo} + aliases := map[string]string{"aAlias": "appnexus"} handler := NewBiddersDetailEndpoint(bidders, aliases) @@ -393,14 +394,21 @@ func TestBiddersDetailHandler(t *testing.T) { }{ { description: "Bidder A", - givenBidder: "a", + givenBidder: "appnexus", expectedStatus: http.StatusOK, expectedHeaders: http.Header{"Content-Type": []string{"application/json"}}, expectedResponse: bidderAResponse, }, { description: "Bidder B", - givenBidder: "b", + givenBidder: "rubicon", + expectedStatus: http.StatusOK, + expectedHeaders: http.Header{"Content-Type": []string{"application/json"}}, + expectedResponse: bidderBResponse, + }, + { + description: "Bidder B - case insensitive", + givenBidder: "RUBICON", expectedStatus: http.StatusOK, expectedHeaders: http.Header{"Content-Type": []string{"application/json"}}, expectedResponse: bidderBResponse, @@ -412,6 +420,13 @@ func TestBiddersDetailHandler(t *testing.T) { expectedHeaders: http.Header{"Content-Type": []string{"application/json"}}, expectedResponse: aliasAResponse, }, + { + description: "Bidder A Alias - case insensitive", + givenBidder: "aAlias", + expectedStatus: http.StatusOK, + expectedHeaders: http.Header{"Content-Type": []string{"application/json"}}, + expectedResponse: aliasAResponse, + }, { description: "All Bidders", givenBidder: "all", @@ -420,11 +435,11 @@ func TestBiddersDetailHandler(t *testing.T) { expectedResponse: allResponse.Bytes(), }, { - description: "All Bidders - Wrong Case", - givenBidder: "ALL", - expectedStatus: http.StatusNotFound, - expectedHeaders: http.Header{}, - expectedResponse: []byte{}, + description: "All Bidders - Case insensitive", + givenBidder: "All", + expectedStatus: http.StatusOK, + expectedHeaders: http.Header{"Content-Type": []string{"application/json"}}, + expectedResponse: allResponse.Bytes(), }, { description: "Invalid Bidder", @@ -436,16 +451,19 @@ func TestBiddersDetailHandler(t *testing.T) { } for _, test := range testCases { - responseRecorder := httptest.NewRecorder() - handler(responseRecorder, nil, httprouter.Params{{"bidderName", test.givenBidder}}) + t.Run(test.description, func(t *testing.T) { + responseRecorder := httptest.NewRecorder() + handler(responseRecorder, nil, httprouter.Params{{"bidderName", test.givenBidder}}) - result := responseRecorder.Result() - assert.Equal(t, result.StatusCode, test.expectedStatus, test.description+":statuscode") + result := responseRecorder.Result() + assert.Equal(t, result.StatusCode, test.expectedStatus, test.description+":statuscode") - resultBody, _ := io.ReadAll(result.Body) - assert.Equal(t, test.expectedResponse, resultBody, test.description+":body") + resultBody, _ := io.ReadAll(result.Body) + fmt.Println(string(test.expectedResponse)) + assert.Equal(t, test.expectedResponse, resultBody, test.description+":body") - resultHeaders := result.Header - assert.Equal(t, test.expectedHeaders, resultHeaders, test.description+":headers") + resultHeaders := result.Header + assert.Equal(t, test.expectedHeaders, resultHeaders, test.description+":headers") + }) } } From bc81af56826c90d262a1848f7a503daff4fe4a24 Mon Sep 17 00:00:00 2001 From: Onkar Hanumante Date: Tue, 26 Sep 2023 11:28:47 +0530 Subject: [PATCH 4/8] extract directory name only if file is not removed and file is in adapters directory (#3145) co-authored by @onkarvhanumante --- .github/workflows/adapter-code-coverage.yml | 14 +++++++------- .github/workflows/helpers/pull-request-utils.js | 4 ++-- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/.github/workflows/adapter-code-coverage.yml b/.github/workflows/adapter-code-coverage.yml index 5b5dc9331e5..b4c3f0745d6 100644 --- a/.github/workflows/adapter-code-coverage.yml +++ b/.github/workflows/adapter-code-coverage.yml @@ -28,9 +28,9 @@ jobs: result-encoding: string script: | const utils = require('./.github/workflows/helpers/pull-request-utils.js') - function directoryExtractor(filepath) { - // extract directory name from filepath of the form adapters//*.go - if (filepath.startsWith("adapters/") && filepath.split("/").length > 2) { + function directoryExtractor(filepath, status) { + // extract directory name only if file is not removed and file is in adapters directory + if (status != "removed" && filepath.startsWith("adapters/") && filepath.split("/").length > 2) { return filepath.split("/")[1] } return "" @@ -41,7 +41,7 @@ jobs: - name: Run coverage tests id: run_coverage - if: ${{ steps.get_directories.outputs.result }} != "" + if: steps.get_directories.outputs.result != '' run: | directories=$(echo '${{ steps.get_directories.outputs.result }}' | jq -r '.[]') go mod download @@ -74,7 +74,7 @@ jobs: repository: prebid/prebid-server - name: Commit coverage files to coverage-preview branch - if: ${{ steps.run_coverage.outputs.coverage_dir }} != "" + if: steps.run_coverage.outputs.coverage_dir != '' id: commit_coverage run: | directory=.github/preview/${{ github.run_id }}_$(date +%s) @@ -88,11 +88,11 @@ jobs: echo "remote_coverage_preview_dir=${directory}" >> $GITHUB_OUTPUT - name: Checkout master branch - if: ${{ steps.get_directories.outputs.result }} != "" + if: steps.get_directories.outputs.result != '' run: git checkout master - name: Add coverage summary to pull request - if: ${{ steps.run_coverage.outputs.coverage_dir }} != "" && ${{ steps.commit_coverage.outputs.remote_coverage_preview_dir }} != "" + if: steps.run_coverage.outputs.coverage_dir != '' && steps.commit_coverage.outputs.remote_coverage_preview_dir != '' uses: actions/github-script@v6 with: script: | diff --git a/.github/workflows/helpers/pull-request-utils.js b/.github/workflows/helpers/pull-request-utils.js index 78ab0bb2bc5..941ae5b6953 100644 --- a/.github/workflows/helpers/pull-request-utils.js +++ b/.github/workflows/helpers/pull-request-utils.js @@ -213,8 +213,8 @@ class diffHelper { }) const directories = [] - for (const { filename } of data) { - const directory = directoryExtractor(filename) + for (const { filename, status } of data) { + const directory = directoryExtractor(filename, status) if (directory != "" && !directories.includes(directory)) { directories.push(directory) } From 00bdbef5368b68e3bcbe0a12f797e79e2ba80d32 Mon Sep 17 00:00:00 2001 From: Onkar Hanumante Date: Tue, 26 Sep 2023 11:33:23 +0530 Subject: [PATCH 5/8] Support case insensitive bidder name in ext.prebid.storedbidresponse.bidder (#3139) --- endpoints/openrtb2/auction.go | 7 +++- endpoints/openrtb2/auction_test.go | 13 ++++++- ...ored-bid-resp-insensitive-bidder-name.json | 39 +++++++++++++++++++ stored_responses/stored_responses.go | 7 +++- 4 files changed, 62 insertions(+), 4 deletions(-) create mode 100644 endpoints/openrtb2/sample-requests/valid-whole/supplementary/imp-with-stored-bid-resp-insensitive-bidder-name.json diff --git a/endpoints/openrtb2/auction.go b/endpoints/openrtb2/auction.go index f419ca341ee..d8b5c41b018 100644 --- a/endpoints/openrtb2/auction.go +++ b/endpoints/openrtb2/auction.go @@ -2486,7 +2486,12 @@ func validateStoredBidRespAndImpExtBidders(bidderExts map[string]json.RawMessage } for bidderName := range bidResponses { - if _, present := bidderExts[bidderName]; !present { + bidder := bidderName + normalizedCoreBidder, ok := openrtb_ext.NormalizeBidderName(bidder) + if ok { + bidder = normalizedCoreBidder.String() + } + if _, present := bidderExts[bidder]; !present { return generateStoredBidResponseValidationError(impId) } } diff --git a/endpoints/openrtb2/auction_test.go b/endpoints/openrtb2/auction_test.go index 08637df2493..c071d6b0950 100644 --- a/endpoints/openrtb2/auction_test.go +++ b/endpoints/openrtb2/auction_test.go @@ -4954,9 +4954,11 @@ func TestParseRequestStoredResponses(t *testing.T) { func TestParseRequestStoredBidResponses(t *testing.T) { bidRespId1 := json.RawMessage(`{"id": "resp_id1", "seatbid": [{"bid": [{"id": "bid_id1"}], "seat": "testBidder1"}], "bidid": "123", "cur": "USD"}`) bidRespId2 := json.RawMessage(`{"id": "resp_id2", "seatbid": [{"bid": [{"id": "bid_id2"}], "seat": "testBidder2"}], "bidid": "124", "cur": "USD"}`) + bidRespId3 := json.RawMessage(`{"id": "resp_id3", "seatbid": [{"bid": [{"id": "bid_id3"}], "seat": "APPNEXUS"}], "bidid": "125", "cur": "USD"}`) mockStoredBidResponses := map[string]json.RawMessage{ "bidResponseId1": bidRespId1, "bidResponseId2": bidRespId2, + "bidResponseId3": bidRespId3, } tests := []struct { @@ -4974,6 +4976,14 @@ func TestParseRequestStoredBidResponses(t *testing.T) { }, expectedErrorCount: 0, }, + { + name: "req imp has valid stored bid response with case insensitive bidder name", + givenRequestBody: validRequest(t, "imp-with-stored-bid-resp-insensitive-bidder-name.json"), + expectedStoredBidResponses: map[string]map[string]json.RawMessage{ + "imp-id3": {"APPNEXUS": bidRespId3}, + }, + expectedErrorCount: 0, + }, { name: "req has two imps with valid stored bid responses", givenRequestBody: validRequest(t, "req-two-imps-stored-bid-responses.json"), @@ -5014,7 +5024,7 @@ func TestParseRequestStoredBidResponses(t *testing.T) { map[string]string{}, false, []byte{}, - map[string]openrtb_ext.BidderName{"testBidder1": "testBidder1", "testBidder2": "testBidder2"}, + map[string]openrtb_ext.BidderName{"testBidder1": "testBidder1", "testBidder2": "testBidder2", "appnexus": "appnexus"}, nil, nil, hardcodedResponseIPValidator{response: true}, @@ -5027,7 +5037,6 @@ func TestParseRequestStoredBidResponses(t *testing.T) { req := httptest.NewRequest("POST", "/openrtb2/auction", strings.NewReader(test.givenRequestBody)) _, _, _, storedBidResponses, _, _, errL := deps.parseRequest(req, &metrics.Labels{}, hookExecutor) - if test.expectedErrorCount == 0 { assert.Equal(t, test.expectedStoredBidResponses, storedBidResponses, "stored responses should match") } else { diff --git a/endpoints/openrtb2/sample-requests/valid-whole/supplementary/imp-with-stored-bid-resp-insensitive-bidder-name.json b/endpoints/openrtb2/sample-requests/valid-whole/supplementary/imp-with-stored-bid-resp-insensitive-bidder-name.json new file mode 100644 index 00000000000..e7b688d4d83 --- /dev/null +++ b/endpoints/openrtb2/sample-requests/valid-whole/supplementary/imp-with-stored-bid-resp-insensitive-bidder-name.json @@ -0,0 +1,39 @@ +{ + "description": "request with impression with stored bid response with sensitive bidder name", + "mockBidRequest": { + "id": "request-with-stored-resp", + "site": { + "page": "test.somepage.com" + }, + "imp": [ + { + "id": "imp-id3", + "banner": { + "format": [ + { + "w": 300, + "h": 600 + } + ] + }, + "ext": { + "appnexus": { + "placementId": 12883451 + }, + "prebid": { + "storedbidresponse": [ + { + "bidder": "APPNEXUS", + "id": "bidResponseId3" + } + ] + } + } + } + ], + "user": { + "yob": 1989 + } + }, + "expectedReturnCode": 200 +} \ No newline at end of file diff --git a/stored_responses/stored_responses.go b/stored_responses/stored_responses.go index 19b010fb12d..6a5da01deba 100644 --- a/stored_responses/stored_responses.go +++ b/stored_responses/stored_responses.go @@ -97,8 +97,13 @@ func extractStoredResponsesIds(impInfo []ImpExtPrebidData, if len(bidderResp.ID) == 0 || len(bidderResp.Bidder) == 0 { return nil, nil, nil, nil, fmt.Errorf("request.imp[%d] has ext.prebid.storedbidresponse specified, but \"id\" or/and \"bidder\" fields are missing ", index) } + bidderName := bidderResp.Bidder + normalizedCoreBidder, ok := openrtb_ext.NormalizeBidderName(bidderResp.Bidder) + if ok { + bidderName = normalizedCoreBidder.String() + } //check if bidder is valid/exists - if _, isValid := bidderMap[bidderResp.Bidder]; !isValid { + if _, isValid := bidderMap[bidderName]; !isValid { return nil, nil, nil, nil, fmt.Errorf("request.imp[impId: %s].ext.prebid.bidder contains unknown bidder: %s. Did you forget an alias in request.ext.prebid.aliases?", impId, bidderResp.Bidder) } // bidder is unique per one bid stored response From 940355c3061527c362e1b742f67f00428c461c55 Mon Sep 17 00:00:00 2001 From: Onkar Hanumante Date: Tue, 26 Sep 2023 11:36:38 +0530 Subject: [PATCH 6/8] Support case insensitive bidder name in adjustment factors (#3140) --- endpoints/openrtb2/auction.go | 9 +- ...r-adjustment-factors-case-insensitive.json | 119 ++++++++++++++++++ 2 files changed, 127 insertions(+), 1 deletion(-) create mode 100644 endpoints/openrtb2/sample-requests/valid-whole/exemplary/bidder-adjustment-factors-case-insensitive.json diff --git a/endpoints/openrtb2/auction.go b/endpoints/openrtb2/auction.go index d8b5c41b018..bede06217e4 100644 --- a/endpoints/openrtb2/auction.go +++ b/endpoints/openrtb2/auction.go @@ -964,7 +964,14 @@ func (deps *endpointDeps) validateBidAdjustmentFactors(adjustmentFactors map[str if adjustmentFactor <= 0 { return fmt.Errorf("request.ext.prebid.bidadjustmentfactors.%s must be a positive number. Got %f", bidderToAdjust, adjustmentFactor) } - if _, isBidder := deps.bidderMap[bidderToAdjust]; !isBidder { + + bidderName := bidderToAdjust + normalizedCoreBidder, ok := openrtb_ext.NormalizeBidderName(bidderToAdjust) + if ok { + bidderName = normalizedCoreBidder.String() + } + + if _, isBidder := deps.bidderMap[bidderName]; !isBidder { if _, isAlias := aliases[bidderToAdjust]; !isAlias { return fmt.Errorf("request.ext.prebid.bidadjustmentfactors.%s is not a known bidder or alias", bidderToAdjust) } diff --git a/endpoints/openrtb2/sample-requests/valid-whole/exemplary/bidder-adjustment-factors-case-insensitive.json b/endpoints/openrtb2/sample-requests/valid-whole/exemplary/bidder-adjustment-factors-case-insensitive.json new file mode 100644 index 00000000000..2fa4f37cc88 --- /dev/null +++ b/endpoints/openrtb2/sample-requests/valid-whole/exemplary/bidder-adjustment-factors-case-insensitive.json @@ -0,0 +1,119 @@ +{ + "description": "This demonstrates bid adjustment factors with case insensitive bidder names", + "config": { + "mockBidders": [ + { + "bidderName": "appnexus", + "currency": "USD", + "price": 1.00 + }, + { + "bidderName": "rubicon", + "currency": "USD", + "price": 1.00 + } + ] + }, + "mockBidRequest": { + "id": "some-request-id", + "site": { + "page": "prebid.org" + }, + "user": { + "ext": { + "consent": "gdpr-consent-string" + } + }, + "regs": { + "ext": { + "gdpr": 1, + "us_privacy": "1NYN" + } + }, + "imp": [ + { + "id": "some-impression-id", + "banner": { + "format": [ + { + "w": 300, + "h": 250 + }, + { + "w": 300, + "h": 600 + } + ] + }, + "ext": { + "APPNEXUS": { + "placementId": 12883451 + }, + "districtm": { + "placementId": 105 + } + } + } + ], + "tmax": 500, + "ext": { + "prebid": { + "aliases": { + "districtm": "APPNEXUS" + }, + "bidadjustmentfactors": { + "APPNEXUS": 1.01, + "districtm": 0.98 + }, + "cache": { + "bids": {} + }, + "channel": { + "name": "video", + "version": "1.0" + }, + "targeting": { + "includewinners": false, + "pricegranularity": { + "precision": 2, + "ranges": [ + { + "max": 20, + "increment": 0.10 + } + ] + } + } + } + } + }, + "expectedBidResponse": { + "id": "some-request-id", + "seatbid": [ + { + "bid": [ + { + "id": "appnexus-bid", + "impid": "some-impression-id", + "price": 1.01 + } + ], + "seat": "APPNEXUS" + }, + { + "bid": [ + { + "id": "appnexus-bid", + "impid": "some-impression-id", + "price": 0.98 + } + ], + "seat": "districtm" + } + ], + "bidid": "test bid id", + "cur": "USD", + "nbr": 0 + }, + "expectedReturnCode": 200 +} \ No newline at end of file From 27498c8584b5c96d86a10b8873b835a2009a4ac0 Mon Sep 17 00:00:00 2001 From: Onkar Hanumante Date: Tue, 26 Sep 2023 11:37:14 +0530 Subject: [PATCH 7/8] Support case insensitive bidder name in ext.prebid.data.eidpermissions.bidders (#3141) --- endpoints/openrtb2/auction.go | 7 +- ...idpermissions-insensitive-bidder-name.json | 109 ++++++++++++++++++ 2 files changed, 115 insertions(+), 1 deletion(-) create mode 100644 endpoints/openrtb2/sample-requests/valid-whole/exemplary/eidpermissions-insensitive-bidder-name.json diff --git a/endpoints/openrtb2/auction.go b/endpoints/openrtb2/auction.go index bede06217e4..810741982ef 100644 --- a/endpoints/openrtb2/auction.go +++ b/endpoints/openrtb2/auction.go @@ -1020,7 +1020,12 @@ func validateBidders(bidders []string, knownBidders map[string]openrtb_ext.Bidde return errors.New(`bidder wildcard "*" mixed with specific bidders`) } } else { - _, isCoreBidder := knownBidders[bidder] + bidderName := bidder + normalizedCoreBidder, ok := openrtb_ext.NormalizeBidderName(bidderName) + if ok { + bidderName = normalizedCoreBidder.String() + } + _, isCoreBidder := knownBidders[bidderName] _, isAlias := knownAliases[bidder] if !isCoreBidder && !isAlias { return fmt.Errorf(`unrecognized bidder "%v"`, bidder) diff --git a/endpoints/openrtb2/sample-requests/valid-whole/exemplary/eidpermissions-insensitive-bidder-name.json b/endpoints/openrtb2/sample-requests/valid-whole/exemplary/eidpermissions-insensitive-bidder-name.json new file mode 100644 index 00000000000..b06b2593e26 --- /dev/null +++ b/endpoints/openrtb2/sample-requests/valid-whole/exemplary/eidpermissions-insensitive-bidder-name.json @@ -0,0 +1,109 @@ +{ + "description": "This demonstrates ext.prebid.data.eidpermissions.bidders with case insensitive bidder names", + "config": { + "mockBidders": [ + { + "bidderName": "appnexus", + "currency": "USD", + "price": 1.00 + }, + { + "bidderName": "rubicon", + "currency": "USD", + "price": 1.00 + } + ] + }, + "mockBidRequest": { + "id": "some-request-id", + "site": { + "page": "prebid.org" + }, + "user": { + "ext": { + "consent": "gdpr-consent-string" + } + }, + "regs": { + "ext": { + "gdpr": 1, + "us_privacy": "1NYN" + } + }, + "imp": [ + { + "id": "some-impression-id", + "banner": { + "format": [ + { + "w": 300, + "h": 250 + }, + { + "w": 300, + "h": 600 + } + ] + }, + "ext": { + "APPNEXUS": { + "placementId": 12883451 + } + } + } + ], + "tmax": 500, + "ext": { + "prebid": { + "data": { + "eidpermissions": [ + { + "source": "source1", + "bidders": [ + "APPNEXUS" + ] + } + ] + }, + "cache": { + "bids": {} + }, + "channel": { + "name": "video", + "version": "1.0" + }, + "targeting": { + "includewinners": false, + "pricegranularity": { + "precision": 2, + "ranges": [ + { + "max": 20, + "increment": 0.10 + } + ] + } + } + } + } + }, + "expectedBidResponse": { + "id": "some-request-id", + "seatbid": [ + { + "bid": [ + { + "id": "appnexus-bid", + "impid": "some-impression-id", + "price": 1 + } + ], + "seat": "APPNEXUS" + } + ], + "bidid": "test bid id", + "cur": "USD", + "nbr": 0 + }, + "expectedReturnCode": 200 +} \ No newline at end of file From 6738217a311ec4f53b10f09ddaf98d619268fd49 Mon Sep 17 00:00:00 2001 From: Scott Kay Date: Tue, 26 Sep 2023 03:43:57 -0400 Subject: [PATCH 8/8] Remove Adapter: RhythmOne (#3129) --- adapters/rhythmone/params_test.go | 57 ----- adapters/rhythmone/rhythmone.go | 150 ------------- adapters/rhythmone/rhythmone_test.go | 20 -- .../exemplary/banner-and-video-app.json | 211 ------------------ .../exemplary/banner-and-video-gdpr.json | 182 --------------- .../exemplary/banner-and-video-site.json | 190 ---------------- .../exemplary/banner-and-video.json | 191 ---------------- .../exemplary/simple-banner.json | 114 ---------- .../rhythmonetest/exemplary/simple-video.json | 109 --------- .../supplemental/missing-extension.json | 34 --- .../exemplary/simple-banner-both-ids.json | 2 +- .../risetest/exemplary/simple-banner.json | 2 +- .../rise/risetest/exemplary/simple-video.json | 2 +- .../risetest/supplemental/missing-mtype.json | 4 +- exchange/adapter_builders.go | 2 - exchange/adapter_util.go | 1 + openrtb_ext/bidders.go | 2 - openrtb_ext/imp_rhythmone.go | 9 - static/bidder-info/rhythmone.yaml | 17 -- static/bidder-params/rhythmone.json | 24 -- 20 files changed, 6 insertions(+), 1317 deletions(-) delete mode 100644 adapters/rhythmone/params_test.go delete mode 100644 adapters/rhythmone/rhythmone.go delete mode 100644 adapters/rhythmone/rhythmone_test.go delete mode 100644 adapters/rhythmone/rhythmonetest/exemplary/banner-and-video-app.json delete mode 100644 adapters/rhythmone/rhythmonetest/exemplary/banner-and-video-gdpr.json delete mode 100644 adapters/rhythmone/rhythmonetest/exemplary/banner-and-video-site.json delete mode 100644 adapters/rhythmone/rhythmonetest/exemplary/banner-and-video.json delete mode 100644 adapters/rhythmone/rhythmonetest/exemplary/simple-banner.json delete mode 100644 adapters/rhythmone/rhythmonetest/exemplary/simple-video.json delete mode 100644 adapters/rhythmone/rhythmonetest/supplemental/missing-extension.json delete mode 100644 openrtb_ext/imp_rhythmone.go delete mode 100644 static/bidder-info/rhythmone.yaml delete mode 100644 static/bidder-params/rhythmone.json diff --git a/adapters/rhythmone/params_test.go b/adapters/rhythmone/params_test.go deleted file mode 100644 index 7d8cad47d53..00000000000 --- a/adapters/rhythmone/params_test.go +++ /dev/null @@ -1,57 +0,0 @@ -package rhythmone - -import ( - "encoding/json" - "testing" - - "github.com/prebid/prebid-server/openrtb_ext" -) - -func TestValidParams(t *testing.T) { - validator, err := openrtb_ext.NewBidderParamsValidator("../../static/bidder-params") - if err != nil { - t.Fatalf("Failed to fetch the json-schemas. %v", err) - } - - for _, validParam := range validParams { - if err := validator.Validate(openrtb_ext.BidderRhythmone, json.RawMessage(validParam)); err != nil { - t.Errorf("Schema rejected rhythmone params: %s", validParam) - } - } -} - -func TestInvalidParams(t *testing.T) { - validator, err := openrtb_ext.NewBidderParamsValidator("../../static/bidder-params") - if err != nil { - t.Fatalf("Failed to fetch the json-schemas. %v", err) - } - - for _, invalidParam := range invalidParams { - if err := validator.Validate(openrtb_ext.BidderRhythmone, json.RawMessage(invalidParam)); err == nil { - t.Errorf("Schema allowed unexpected params: %s", invalidParam) - } - } -} - -var validParams = []string{ - `{"placementId":"123", "zone":"12345", "path":"34567"}`, -} - -var invalidParams = []string{ - `{"placementId":"123", "zone":"12345", "path":34567}`, - `{"placementId":"123", "zone":12345, "path":"34567"}`, - `{"placementId":123, "zone":"12345", "path":"34567"}`, - `{"placementId":123, "zone":12345, "path":34567}`, - `{"placementId":123, "zone":12345, "path":"34567"}`, - `{"appId":"123", "bidfloor":0.01}`, - `{"publisherName": 100}`, - `{"placementId": 1234}`, - `{"zone": true}`, - ``, - `null`, - `nil`, - `true`, - `9`, - `[]`, - `{}`, -} diff --git a/adapters/rhythmone/rhythmone.go b/adapters/rhythmone/rhythmone.go deleted file mode 100644 index 0ac07a77252..00000000000 --- a/adapters/rhythmone/rhythmone.go +++ /dev/null @@ -1,150 +0,0 @@ -package rhythmone - -import ( - "encoding/json" - "fmt" - - "net/http" - - "github.com/prebid/openrtb/v19/openrtb2" - "github.com/prebid/prebid-server/adapters" - "github.com/prebid/prebid-server/config" - "github.com/prebid/prebid-server/errortypes" - "github.com/prebid/prebid-server/openrtb_ext" -) - -type RhythmoneAdapter struct { - endPoint string -} - -func (a *RhythmoneAdapter) MakeRequests(request *openrtb2.BidRequest, reqInfo *adapters.ExtraRequestInfo) ([]*adapters.RequestData, []error) { - errs := make([]error, 0, len(request.Imp)) - - var uri string - request, uri, errs = a.preProcess(request, errs) - if request != nil { - reqJSON, err := json.Marshal(request) - if err != nil { - errs = append(errs, err) - return nil, errs - } - if uri != "" { - headers := http.Header{} - headers.Add("Content-Type", "application/json;charset=utf-8") - headers.Add("Accept", "application/json") - return []*adapters.RequestData{{ - Method: "POST", - Uri: uri, - Body: reqJSON, - Headers: headers, - }}, errs - } - } - return nil, errs -} - -func (a *RhythmoneAdapter) MakeBids(internalRequest *openrtb2.BidRequest, externalRequest *adapters.RequestData, response *adapters.ResponseData) (*adapters.BidderResponse, []error) { - if response.StatusCode == http.StatusNoContent { - return nil, nil - } - - if response.StatusCode == http.StatusBadRequest { - return nil, []error{&errortypes.BadInput{ - Message: fmt.Sprintf("unexpected status code: %d. Run with request.debug = 1 for more info", response.StatusCode), - }} - } - - if response.StatusCode != http.StatusOK { - return nil, []error{&errortypes.BadServerResponse{ - Message: fmt.Sprintf("unexpected status code: %d. Run with request.debug = 1 for more info", response.StatusCode), - }} - } - var bidResp openrtb2.BidResponse - if err := json.Unmarshal(response.Body, &bidResp); err != nil { - return nil, []error{&errortypes.BadServerResponse{ - Message: fmt.Sprintf("bad server response: %d. ", err), - }} - } - - var errs []error - bidResponse := adapters.NewBidderResponseWithBidsCapacity(5) - - for _, sb := range bidResp.SeatBid { - for i := range sb.Bid { - bidResponse.Bids = append(bidResponse.Bids, &adapters.TypedBid{ - Bid: &sb.Bid[i], - BidType: getMediaTypeForImp(sb.Bid[i].ImpID, internalRequest.Imp), - }) - } - } - return bidResponse, errs -} - -func getMediaTypeForImp(impId string, imps []openrtb2.Imp) openrtb_ext.BidType { - mediaType := openrtb_ext.BidTypeBanner - for _, imp := range imps { - if imp.ID == impId { - if imp.Banner != nil { - mediaType = openrtb_ext.BidTypeBanner - } else if imp.Video != nil { - mediaType = openrtb_ext.BidTypeVideo - } - return mediaType - } - } - return mediaType -} - -// Builder builds a new instance of the Rythomone adapter for the given bidder with the given config. -func Builder(bidderName openrtb_ext.BidderName, config config.Adapter, server config.Server) (adapters.Bidder, error) { - bidder := &RhythmoneAdapter{ - endPoint: config.Endpoint, - } - return bidder, nil -} - -func (a *RhythmoneAdapter) preProcess(req *openrtb2.BidRequest, errors []error) (*openrtb2.BidRequest, string, []error) { - numRequests := len(req.Imp) - var uri string = "" - for i := 0; i < numRequests; i++ { - imp := req.Imp[i] - var bidderExt adapters.ExtImpBidder - err := json.Unmarshal(imp.Ext, &bidderExt) - if err != nil { - err = &errortypes.BadInput{ - Message: fmt.Sprintf("ext data not provided in imp id=%s. Abort all Request", imp.ID), - } - errors = append(errors, err) - return nil, "", errors - } - var rhythmoneExt openrtb_ext.ExtImpRhythmone - err = json.Unmarshal(bidderExt.Bidder, &rhythmoneExt) - if err != nil { - err = &errortypes.BadInput{ - Message: fmt.Sprintf("placementId | zone | path not provided in imp id=%s. Abort all Request", imp.ID), - } - errors = append(errors, err) - return nil, "", errors - } - rhythmoneExt.S2S = true - rhythmoneExtCopy, err := json.Marshal(&rhythmoneExt) - if err != nil { - errors = append(errors, err) - return nil, "", errors - } - bidderExtCopy := struct { - Bidder json.RawMessage `json:"bidder,omitempty"` - }{rhythmoneExtCopy} - impExtCopy, err := json.Marshal(&bidderExtCopy) - if err != nil { - errors = append(errors, err) - return nil, "", errors - } - imp.Ext = impExtCopy - req.Imp[i] = imp - if uri == "" { - uri = fmt.Sprintf("%s/%s/0/%s?z=%s&s2s=%s", a.endPoint, rhythmoneExt.PlacementId, rhythmoneExt.Path, rhythmoneExt.Zone, "true") - } - } - return req, uri, errors -} diff --git a/adapters/rhythmone/rhythmone_test.go b/adapters/rhythmone/rhythmone_test.go deleted file mode 100644 index 0492241dce6..00000000000 --- a/adapters/rhythmone/rhythmone_test.go +++ /dev/null @@ -1,20 +0,0 @@ -package rhythmone - -import ( - "testing" - - "github.com/prebid/prebid-server/adapters/adapterstest" - "github.com/prebid/prebid-server/config" - "github.com/prebid/prebid-server/openrtb_ext" -) - -func TestJsonSamples(t *testing.T) { - bidder, buildErr := Builder(openrtb_ext.BidderRhythmone, config.Adapter{ - Endpoint: "http://tag.1rx.io/rmp"}, config.Server{ExternalUrl: "http://hosturl.com", GvlID: 1, DataCenter: "2"}) - - if buildErr != nil { - t.Fatalf("Builder returned unexpected error %v", buildErr) - } - - adapterstest.RunJSONBidderTest(t, "rhythmonetest", bidder) -} diff --git a/adapters/rhythmone/rhythmonetest/exemplary/banner-and-video-app.json b/adapters/rhythmone/rhythmonetest/exemplary/banner-and-video-app.json deleted file mode 100644 index 11e89c37007..00000000000 --- a/adapters/rhythmone/rhythmonetest/exemplary/banner-and-video-app.json +++ /dev/null @@ -1,211 +0,0 @@ -{ - "mockBidRequest": { - "id": "test-request-id", - "imp": [ - { - "id": "test-imp-id", - "banner": { - "format": [ - { - "w": 300, - "h": 250 - }, - { - "w": 300, - "h": 300 - } - ] - }, - "ext": { - "bidder": { - "placementId": "72721", - "path": "mvo", - "zone": "1r" - } - } - }, - { - "id": "test-imp-video-id", - "video": { - "mimes": ["video/mp4"], - "minduration": 1, - "maxduration": 2, - "protocols": [1, 2, 5], - "w": 1020, - "h": 780, - "startdelay": 1, - "placement": 1, - "playbackmethod": [2], - "delivery": [1], - "api": [1, 2, 3, 4] - }, - "ext": { - "bidder": { - "placementId": "72721", - "path": "mvo", - "zone": "1r" - } - } - } - ], - "app": { - "id": "agltb3B1Yi1pbmNyDAsSA0FwcBiJkfIUDA", - "name": "Yahoo Weather", - "bundle": "12345", - "storeurl": "https://itunes.apple.com/id628677149", - "cat": ["IAB15", "IAB15-10"], - "ver": "1.0.2", - "publisher": { - "id": "1" - } - }, - "device": { - "dnt": 0, - "ua": "Mozilla/5.0 (iPhone; CPU iPhone OS 6_1 like Mac OS X) AppleWebKit / 534.46(KHTML, like Gecko) Version / 5.1 Mobile / 9 A334 Safari / 7534.48 .3", - "ip": "123.145.167.189", - "ifa": "AA000DFE74168477C70D291f574D344790E0BB11", - "carrier": "VERIZON", - "language": "en", - "make": "Apple", - "model": "iPhone", - "os": "iOS", - "osv": "6.1", - "js": 1, - "connectiontype": 3, - "devicetype": 1 - } - }, - "httpCalls": [ - { - "expectedRequest": { - "uri": "http://tag.1rx.io/rmp/72721/0/mvo?z=1r&s2s=true", - "body": { - "id": "test-request-id", - "imp": [ - { - "id": "test-imp-id", - "banner": { - "format": [ - { - "w": 300, - "h": 250 - }, - { - "w": 300, - "h": 300 - } - ] - }, - "ext": { - "bidder": { - "placementId": "72721", - "zone": "1r", - "path": "mvo", - "S2S": true - } - } - }, - { - "id": "test-imp-video-id", - "video": { - "mimes": ["video/mp4"], - "minduration": 1, - "maxduration": 2, - "protocols": [1, 2, 5], - "w": 1020, - "h": 780, - "startdelay": 1, - "placement": 1, - "playbackmethod": [2], - "delivery": [1], - "api": [1, 2, 3, 4] - }, - "ext": { - "bidder": { - "placementId": "72721", - "zone": "1r", - "path": "mvo", - "S2S": true - } - } - } - ], - "app": { - "id": "agltb3B1Yi1pbmNyDAsSA0FwcBiJkfIUDA", - "name": "Yahoo Weather", - "bundle": "12345", - "storeurl": "https://itunes.apple.com/id628677149", - "cat": ["IAB15", "IAB15-10"], - "ver": "1.0.2", - "publisher": { - "id": "1" - } - }, - "device": { - "ua": "Mozilla/5.0 (iPhone; CPU iPhone OS 6_1 like Mac OS X) AppleWebKit / 534.46(KHTML, like Gecko) Version / 5.1 Mobile / 9 A334 Safari / 7534.48 .3", - "ip": "123.145.167.189", - "devicetype": 1, - "make": "Apple", - "model": "iPhone", - "os": "iOS", - "osv": "6.1", - "js": 1, - "dnt": 0, - "language": "en", - "carrier": "VERIZON", - "connectiontype": 3, - "ifa": "AA000DFE74168477C70D291f574D344790E0BB11" - } - } - }, - "mockResponse": { - "status": 200, - "body": { - "id": "test-request-id", - "seatbid": [ - { - "seat": "958", - "bid": [ - { - "id": "7706636740145184841", - "impid": "test-imp-video-id", - "price": 0.5, - "adid": "29681110", - "adm": "some-test-ad", - "adomain": ["yahoo.com"], - "cid": "958", - "crid": "29681110", - "h": 576, - "w": 1024 - } - ] - } - ], - "bidid": "5778926625248726496", - "cur": "USD" - } - } - } - ], - "expectedBidResponses": [ - { - "bids": [ - { - "bid": { - "id": "7706636740145184841", - "impid": "test-imp-video-id", - "price": 0.5, - "adm": "some-test-ad", - "adid": "29681110", - "adomain": ["yahoo.com"], - "cid": "958", - "crid": "29681110", - "w": 1024, - "h": 576 - }, - "type": "video" - } - ] - } - ] -} diff --git a/adapters/rhythmone/rhythmonetest/exemplary/banner-and-video-gdpr.json b/adapters/rhythmone/rhythmonetest/exemplary/banner-and-video-gdpr.json deleted file mode 100644 index d6546179c24..00000000000 --- a/adapters/rhythmone/rhythmonetest/exemplary/banner-and-video-gdpr.json +++ /dev/null @@ -1,182 +0,0 @@ -{ - "mockBidRequest": { - "id": "test-request-id", - "imp": [ - { - "id": "test-imp-id", - "banner": { - "format": [ - { - "w": 300, - "h": 250 - }, - { - "w": 300, - "h": 300 - } - ] - }, - "ext": { - "bidder": { - "placementId": "72721", - "path": "mvo", - "zone": "1r" - } - } - }, - { - "id": "test-imp-video-id", - "video": { - "mimes": ["video/mp4"], - "minduration": 1, - "maxduration": 2, - "protocols": [1, 2, 5], - "w": 1020, - "h": 780, - "startdelay": 1, - "placement": 1, - "playbackmethod": [2], - "delivery": [1], - "api": [1, 2, 3, 4] - }, - "ext": { - "bidder": { - "placementId": "72721", - "path": "mvo", - "zone": "1r" - } - } - } - ], - "user": { - "id": "eyJ0ZW1wVUlEcyI6eyJhZGZvcm0iOnsidWlkIjoiMzA5MTMwOTUxNjQ5NDA1MjcxIiwiZXhwaXJlcyI6IjIwMTgtMDYtMjBUMTE6NDA6MzUuODAwNTE0NzQ3KzA1OjMwIn0sImFkbnhzIjp7InVpZCI6IjM1MTUzMjg2MTAyNjMxNjQ0ODQiLCJleHBpcmVzIjoiMjAxOC0wNi0xOFQxODoxMjoxNy4wMTExMzg2MDgrMDU6MzAifX0sImJkYXkiOiIyMDE4LTA2LTA0VDE4OjEyOjE3LjAxMTEzMDg3NSswNTozMCJ9", - "ext": { - "consent": "BOPVK28OPVK28ABABAENA8-AAAADkCNQCGoQAAQ" - } - }, - "regs": { - "ext": { - "gdpr": 1 - } - } - }, - "httpCalls": [ - { - "expectedRequest": { - "uri": "http://tag.1rx.io/rmp/72721/0/mvo?z=1r&s2s=true", - "body": { - "id": "test-request-id", - "imp": [ - { - "id": "test-imp-id", - "banner": { - "format": [ - { - "w": 300, - "h": 250 - }, - { - "w": 300, - "h": 300 - } - ] - }, - "ext": { - "bidder": { - "placementId": "72721", - "zone": "1r", - "path": "mvo", - "S2S": true - } - } - }, - { - "id": "test-imp-video-id", - "video": { - "mimes": ["video/mp4"], - "minduration": 1, - "maxduration": 2, - "protocols": [1, 2, 5], - "w": 1020, - "h": 780, - "startdelay": 1, - "placement": 1, - "playbackmethod": [2], - "delivery": [1], - "api": [1, 2, 3, 4] - }, - "ext": { - "bidder": { - "placementId": "72721", - "zone": "1r", - "path": "mvo", - "S2S": true - } - } - } - ], - "user": { - "id": "eyJ0ZW1wVUlEcyI6eyJhZGZvcm0iOnsidWlkIjoiMzA5MTMwOTUxNjQ5NDA1MjcxIiwiZXhwaXJlcyI6IjIwMTgtMDYtMjBUMTE6NDA6MzUuODAwNTE0NzQ3KzA1OjMwIn0sImFkbnhzIjp7InVpZCI6IjM1MTUzMjg2MTAyNjMxNjQ0ODQiLCJleHBpcmVzIjoiMjAxOC0wNi0xOFQxODoxMjoxNy4wMTExMzg2MDgrMDU6MzAifX0sImJkYXkiOiIyMDE4LTA2LTA0VDE4OjEyOjE3LjAxMTEzMDg3NSswNTozMCJ9", - "ext": { - "consent": "BOPVK28OPVK28ABABAENA8-AAAADkCNQCGoQAAQ" - } - }, - "regs": { - "ext": { - "gdpr": 1 - } - } - } - }, - "mockResponse": { - "status": 200, - "body": { - "id": "test-request-id", - "seatbid": [ - { - "seat": "958", - "bid": [ - { - "id": "7706636740145184841", - "impid": "test-imp-video-id", - "price": 0.5, - "adid": "29681110", - "adm": "some-test-ad", - "adomain": ["yahoo.com"], - "cid": "958", - "crid": "29681110", - "h": 576, - "w": 1024 - } - ] - } - ], - "bidid": "5778926625248726496", - "cur": "USD" - } - } - } - ], - - "expectedBidResponses": [ - { - "bids": [ - { - "bid": { - "id": "7706636740145184841", - "impid": "test-imp-video-id", - "price": 0.5, - "adm": "some-test-ad", - "adid": "29681110", - "adomain": ["yahoo.com"], - "cid": "958", - "crid": "29681110", - "w": 1024, - "h": 576 - }, - "type": "video" - } - ] - } - ] -} diff --git a/adapters/rhythmone/rhythmonetest/exemplary/banner-and-video-site.json b/adapters/rhythmone/rhythmonetest/exemplary/banner-and-video-site.json deleted file mode 100644 index 223ebee5fb0..00000000000 --- a/adapters/rhythmone/rhythmonetest/exemplary/banner-and-video-site.json +++ /dev/null @@ -1,190 +0,0 @@ -{ - "mockBidRequest": { - "id": "test-request-id", - "imp": [ - { - "id": "test-imp-id", - "banner": { - "format": [ - { - "w": 300, - "h": 250 - }, - { - "w": 300, - "h": 300 - } - ] - }, - "ext": { - "bidder": { - "placementId": "72721", - "path": "mvo", - "zone": "1r" - } - } - }, - { - "id": "test-imp-video-id", - "video": { - "mimes": ["video/mp4"], - "minduration": 1, - "maxduration": 2, - "protocols": [1, 2, 5], - "w": 1020, - "h": 780, - "startdelay": 1, - "placement": 1, - "playbackmethod": [2], - "delivery": [1], - "api": [1, 2, 3, 4] - }, - "ext": { - "bidder": { - "placementId": "72721", - "path": "mvo", - "zone": "1r" - } - } - } - ], - "site": { - "id": "102855", - "cat": ["IAB3-1"], - "domain": "www.foobar.com", - "page": "http://www.foobar.com/1234.html ", - "publisher": { - "id": "8953", - "name": "foobar.com", - "cat": ["IAB3-1"], - "domain": "foobar.com" - } - }, - "device": { - "ua": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_6_8) AppleWebKit/537.13 (KHTML, like Gecko) Version / 5.1 .7 Safari / 534.57 .2", - "ip": "123.145.167.10" - } - }, - "httpCalls": [ - { - "expectedRequest": { - "uri": "http://tag.1rx.io/rmp/72721/0/mvo?z=1r&s2s=true", - "body": { - "id": "test-request-id", - "imp": [ - { - "id": "test-imp-id", - "banner": { - "format": [ - { - "w": 300, - "h": 250 - }, - { - "w": 300, - "h": 300 - } - ] - }, - "ext": { - "bidder": { - "placementId": "72721", - "zone": "1r", - "path": "mvo", - "S2S": true - } - } - }, - { - "id": "test-imp-video-id", - "video": { - "mimes": ["video/mp4"], - "minduration": 1, - "maxduration": 2, - "protocols": [1, 2, 5], - "w": 1020, - "h": 780, - "startdelay": 1, - "placement": 1, - "playbackmethod": [2], - "delivery": [1], - "api": [1, 2, 3, 4] - }, - "ext": { - "bidder": { - "placementId": "72721", - "zone": "1r", - "path": "mvo", - "S2S": true - } - } - } - ], - "site": { - "id": "102855", - "cat": ["IAB3-1"], - "domain": "www.foobar.com", - "page": "http://www.foobar.com/1234.html ", - "publisher": { - "id": "8953", - "name": "foobar.com", - "cat": ["IAB3-1"], - "domain": "foobar.com" - } - }, - "device": { - "ua": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_6_8) AppleWebKit/537.13 (KHTML, like Gecko) Version / 5.1 .7 Safari / 534.57 .2", - "ip": "123.145.167.10" - } - } - }, - "mockResponse": { - "status": 200, - "body": { - "id": "test-request-id", - "seatbid": [ - { - "seat": "958", - "bid": [ - { - "id": "7706636740145184841", - "impid": "test-imp-video-id", - "price": 0.5, - "adid": "29681110", - "adm": "some-test-ad", - "adomain": ["yahoo.com"], - "cid": "958", - "crid": "29681110", - "h": 576, - "w": 1024 - } - ] - } - ], - "bidid": "5778926625248726496", - "cur": "USD" - } - } - } - ], - - "expectedBidResponses": [ - { - "bids": [{ - "bid": { - "id": "7706636740145184841", - "impid": "test-imp-video-id", - "price": 0.5, - "adm": "some-test-ad", - "adid": "29681110", - "adomain": ["yahoo.com"], - "cid": "958", - "crid": "29681110", - "w": 1024, - "h": 576 - }, - "type": "video" - }] - } - ] -} diff --git a/adapters/rhythmone/rhythmonetest/exemplary/banner-and-video.json b/adapters/rhythmone/rhythmonetest/exemplary/banner-and-video.json deleted file mode 100644 index ae400a2d53c..00000000000 --- a/adapters/rhythmone/rhythmonetest/exemplary/banner-and-video.json +++ /dev/null @@ -1,191 +0,0 @@ -{ - "mockBidRequest": { - "id": "test-request-id", - "imp": [ - { - "id": "test-imp-id", - "banner": { - "format": [ - { - "w": 300, - "h": 250 - }, - { - "w": 300, - "h": 300 - } - ] - }, - "ext": { - "bidder": { - "placementId": "72721", - "path": "mvo", - "zone": "1r" - } - } - }, - { - "id": "test-imp-video-id", - "video": { - "mimes": [ - "video/mp4" - ], - "minduration": 1, - "maxduration": 2, - "protocols": [ - 1, - 2, - 5 - ], - "w": 1020, - "h": 780, - "startdelay": 1, - "placement": 1, - "playbackmethod": [ - 2 - ], - "delivery": [ - 1 - ], - "api": [ - 1, - 2, - 3, - 4 - ] - }, - "ext": { - "bidder": { - "placementId": "72721", - "path": "mvo", - "zone": "1r" - } - } - } - ] - }, - "httpCalls": [ - { - "expectedRequest": { - "uri": "http://tag.1rx.io/rmp/72721/0/mvo?z=1r&s2s=true", - "body": { - "id": "test-request-id", - "imp": [ - { - "id": "test-imp-id", - "banner": { - "format": [ - { - "w": 300, - "h": 250 - }, - { - "w": 300, - "h": 300 - } - ] - }, - "ext": { - "bidder": { - "placementId": "72721", - "zone": "1r", - "path": "mvo", - "S2S": true - } - } - }, - { - "id": "test-imp-video-id", - "video": { - "mimes": [ - "video/mp4" - ], - "minduration": 1, - "maxduration": 2, - "protocols": [ - 1, - 2, - 5 - ], - "w": 1020, - "h": 780, - "startdelay": 1, - "placement": 1, - "playbackmethod": [ - 2 - ], - "delivery": [ - 1 - ], - "api": [ - 1, - 2, - 3, - 4 - ] - }, - "ext": { - "bidder": { - "placementId": "72721", - "zone": "1r", - "path": "mvo", - "S2S": true - } - } - } - ] - } - }, - "mockResponse": { - "status": 200, - "body": { - "id": "test-request-id", - "seatbid": [ - { - "seat": "958", - "bid": [ - { - "id": "7706636740145184841", - "impid": "test-imp-video-id", - "price": 0.500000, - "adid": "29681110", - "adm": "some-test-ad", - "adomain": [ - "yahoo.com" - ], - "cid": "958", - "crid": "29681110", - "h": 576, - "w": 1024 - } - ] - } - ], - "bidid": "5778926625248726496", - "cur": "USD" - } - } - } - ], - "expectedBidResponses": [ - { - "bids": [{ - "bid": { - "id": "7706636740145184841", - "impid": "test-imp-video-id", - "price": 0.5, - "adm": "some-test-ad", - "adid": "29681110", - "adomain": [ - "yahoo.com" - ], - "cid": "958", - "crid": "29681110", - "w": 1024, - "h": 576 - }, - "type": "video" - }] - } - ] -} \ No newline at end of file diff --git a/adapters/rhythmone/rhythmonetest/exemplary/simple-banner.json b/adapters/rhythmone/rhythmonetest/exemplary/simple-banner.json deleted file mode 100644 index d2acf3612af..00000000000 --- a/adapters/rhythmone/rhythmonetest/exemplary/simple-banner.json +++ /dev/null @@ -1,114 +0,0 @@ -{ - "mockBidRequest": { - "id": "test-request-id", - "imp": [ - { - "id": "test-imp-id", - "banner": { - "format": [ - { - "w": 300, - "h": 250 - }, - { - "w": 300, - "h": 300 - } - ] - }, - "ext": { - "bidder": { - "placementId": "72721", - "path": "mvo", - "zone": "1r" - } - } - } - ] - }, - "httpCalls": [ - { - "expectedRequest": { - "uri": "http://tag.1rx.io/rmp/72721/0/mvo?z=1r&s2s=true", - "body": { - "id": "test-request-id", - "imp": [ - { - "id": "test-imp-id", - "banner": { - "format": [ - { - "w": 300, - "h": 250 - }, - { - "w": 300, - "h": 300 - } - ] - }, - "ext": { - "bidder": { - "placementId": "72721", - "zone": "1r", - "path": "mvo", - "S2S": true - } - } - } - ] - } - }, - "mockResponse": { - "status": 200, - "body": { - "id": "test-request-id", - "seatbid": [ - { - "seat": "Rhythmone", - "bid": [ - { - "id": "7706636740145184841", - "impid": "test-imp-id", - "price": 0.500000, - "adid": "29681110", - "adm": "some-test-ad", - "adomain": [ - "yahoo.com" - ], - "cid": "958", - "crid": "29681110", - "h": 250, - "w": 300 - } - ] - } - ], - "bidid": "5778926625248726496", - "cur": "USD" - } - } - } - ], - "expectedBidResponses": [ - { - "bids": [{ - "bid": { - "id": "7706636740145184841", - "impid": "test-imp-id", - "price": 0.5, - "adm": "some-test-ad", - "adid": "29681110", - "adomain": [ - "yahoo.com" - ], - "cid": "958", - "crid": "29681110", - "w": 300, - "h": 250 - }, - "type": "banner" - }] - } - ] -} \ No newline at end of file diff --git a/adapters/rhythmone/rhythmonetest/exemplary/simple-video.json b/adapters/rhythmone/rhythmonetest/exemplary/simple-video.json deleted file mode 100644 index 6b86a9e39ee..00000000000 --- a/adapters/rhythmone/rhythmonetest/exemplary/simple-video.json +++ /dev/null @@ -1,109 +0,0 @@ -{ - "mockBidRequest": { - "id": "test-request-id", - "imp": [ - { - "id": "test-imp-id", - "video": { - "mimes": [ - "video/mp4" - ], - "minduration": 1, - "maxduration": 2, - "protocols": [1,3,5], - "w": 1020, - "h": 780, - "startdelay": 1, - "placement": 1, - "playbackmethod": [2], - "delivery": [1], - "api": [1,2,3,4] - }, - "ext": { - "bidder": { - "placementId": "72721", - "path": "mvo", - "zone": "1r" - } - } - } - ] - }, - "httpCalls": [ - { - "expectedRequest": { - "uri": "http://tag.1rx.io/rmp/72721/0/mvo?z=1r&s2s=true", - "body": { - "id": "test-request-id", - "imp": [ - { - "id": "test-imp-id", - "video": { - "mimes": [ - "video/mp4" - ], - "minduration": 1, - "maxduration": 2, - "protocols": [1,3,5], - "w": 1020, - "h": 780, - "startdelay": 1, - "placement": 1, - "playbackmethod": [2], - "delivery": [1], - "api": [1,2,3,4] - }, - "ext": { - "bidder": { - "placementId": "72721", - "zone": "1r", - "path": "mvo", - "S2S": true - } - } - } - ] - } - }, - "mockResponse": { - "status": 200, - "body": { - "id": "test-request-id", - "cur": "USD", - "seatbid": [ - { - "seat": "Rhythmone", - "bid": [ - { - "id": "8ee514f1-b2b8-4abb-89fd-084437d1e800", - "impid": "test-imp-id", - "price": 0.500000, - "adm": "some-test-ad", - "crid": "crid_10", - "w": 1024, - "h": 576 - } - ] - } - ] - } - } - } - ], - "expectedBidResponses": [ - { - "bids": [{ - "bid": { - "id": "8ee514f1-b2b8-4abb-89fd-084437d1e800", - "impid": "test-imp-id", - "price": 0.5, - "adm": "some-test-ad", - "crid": "crid_10", - "w": 1024, - "h": 576 - }, - "type": "video" - }] - } - ] -} \ No newline at end of file diff --git a/adapters/rhythmone/rhythmonetest/supplemental/missing-extension.json b/adapters/rhythmone/rhythmonetest/supplemental/missing-extension.json deleted file mode 100644 index d313a1759d4..00000000000 --- a/adapters/rhythmone/rhythmonetest/supplemental/missing-extension.json +++ /dev/null @@ -1,34 +0,0 @@ -{ - "mockBidRequest": { - "id": "test-request-id", - "imp": [ - { - "id": "test-missing-ext-id", - "video": { - "mimes": [ - "video/mp4" - ], - "minduration": 1, - "maxduration": 2, - "maxextended": 30, - "minbitrate": 300, - "maxbitrate": 1500, - "protocols": [1,2,5], - "w": 1020, - "h": 780, - "startdelay": 1, - "placement": 1, - "playbackmethod": [2], - "delivery": [1], - "api": [1,2,3,4] - } - } - ] - }, - "expectedMakeRequestsErrors": [ - { - "value": "ext data not provided in imp id=test-missing-ext-id. Abort all Request", - "comparison": "literal" - } - ] -} \ No newline at end of file diff --git a/adapters/rise/risetest/exemplary/simple-banner-both-ids.json b/adapters/rise/risetest/exemplary/simple-banner-both-ids.json index cb6bbfa779f..99f9e1f211f 100644 --- a/adapters/rise/risetest/exemplary/simple-banner-both-ids.json +++ b/adapters/rise/risetest/exemplary/simple-banner-both-ids.json @@ -66,7 +66,7 @@ "id": "test-request-id", "seatbid": [ { - "seat": "Rhythmone", + "seat": "958", "bid": [ { "id": "7706636740145184841", diff --git a/adapters/rise/risetest/exemplary/simple-banner.json b/adapters/rise/risetest/exemplary/simple-banner.json index 13e965d1e2f..1fba0f398cb 100644 --- a/adapters/rise/risetest/exemplary/simple-banner.json +++ b/adapters/rise/risetest/exemplary/simple-banner.json @@ -64,7 +64,7 @@ "id": "test-request-id", "seatbid": [ { - "seat": "Rhythmone", + "seat": "958", "bid": [ { "id": "7706636740145184841", diff --git a/adapters/rise/risetest/exemplary/simple-video.json b/adapters/rise/risetest/exemplary/simple-video.json index 921736a6295..0854c06c59f 100644 --- a/adapters/rise/risetest/exemplary/simple-video.json +++ b/adapters/rise/risetest/exemplary/simple-video.json @@ -71,7 +71,7 @@ "cur": "USD", "seatbid": [ { - "seat": "Rhythmone", + "seat": "958", "bid": [ { "id": "8ee514f1-b2b8-4abb-89fd-084437d1e800", diff --git a/adapters/rise/risetest/supplemental/missing-mtype.json b/adapters/rise/risetest/supplemental/missing-mtype.json index 5693f25ad83..79fe4b38406 100644 --- a/adapters/rise/risetest/supplemental/missing-mtype.json +++ b/adapters/rise/risetest/supplemental/missing-mtype.json @@ -71,7 +71,7 @@ "cur": "USD", "seatbid": [ { - "seat": "Rhythmone", + "seat": "958", "bid": [ { "id": "8ee514f1-b2b8-4abb-89fd-084437d1e800", @@ -85,7 +85,7 @@ ] }, { - "seat": "Rhythmone", + "seat": "958", "bid": [ { "id": "8ee514f1-b2b8-4abb-89fd-084437d1e800", diff --git a/exchange/adapter_builders.go b/exchange/adapter_builders.go index 395e4fbbc39..825eff56353 100755 --- a/exchange/adapter_builders.go +++ b/exchange/adapter_builders.go @@ -140,7 +140,6 @@ import ( "github.com/prebid/prebid-server/adapters/pulsepoint" "github.com/prebid/prebid-server/adapters/pwbid" "github.com/prebid/prebid-server/adapters/revcontent" - "github.com/prebid/prebid-server/adapters/rhythmone" "github.com/prebid/prebid-server/adapters/richaudience" "github.com/prebid/prebid-server/adapters/rise" "github.com/prebid/prebid-server/adapters/rtbhouse" @@ -348,7 +347,6 @@ func newAdapterBuilders() map[openrtb_ext.BidderName]adapters.Builder { openrtb_ext.BidderPWBid: pwbid.Builder, openrtb_ext.BidderQuantumdex: apacdex.Builder, openrtb_ext.BidderRevcontent: revcontent.Builder, - openrtb_ext.BidderRhythmone: rhythmone.Builder, openrtb_ext.BidderRichaudience: richaudience.Builder, openrtb_ext.BidderRise: rise.Builder, openrtb_ext.BidderRTBHouse: rtbhouse.Builder, diff --git a/exchange/adapter_util.go b/exchange/adapter_util.go index ee9a066aa58..5a3b8a4ce99 100644 --- a/exchange/adapter_util.go +++ b/exchange/adapter_util.go @@ -118,6 +118,7 @@ func GetDisabledBidderWarningMessages(infos config.BidderInfos) map[string]strin "groupm": `Bidder "groupm" is no longer available in Prebid Server. Please update your configuration.`, "verizonmedia": `Bidder "verizonmedia" is no longer available in Prebid Server. Please update your configuration.`, "brightroll": `Bidder "brightroll" is no longer available in Prebid Server. Please update your configuration.`, + "rhythmone": `Bidder "rhythmone" is no longer available in Prebid Server. Please update your configuration.`, } return mergeRemovedAndDisabledBidderWarningMessages(removed, infos) diff --git a/openrtb_ext/bidders.go b/openrtb_ext/bidders.go index e12316f7e72..f6636a00a48 100644 --- a/openrtb_ext/bidders.go +++ b/openrtb_ext/bidders.go @@ -170,7 +170,6 @@ var coreBidderNames []BidderName = []BidderName{ BidderPWBid, BidderQuantumdex, BidderRevcontent, - BidderRhythmone, BidderRichaudience, BidderRise, BidderRTBHouse, @@ -465,7 +464,6 @@ const ( BidderPWBid BidderName = "pwbid" BidderQuantumdex BidderName = "quantumdex" BidderRevcontent BidderName = "revcontent" - BidderRhythmone BidderName = "rhythmone" BidderRichaudience BidderName = "richaudience" BidderRise BidderName = "rise" BidderRTBHouse BidderName = "rtbhouse" diff --git a/openrtb_ext/imp_rhythmone.go b/openrtb_ext/imp_rhythmone.go deleted file mode 100644 index 526a2843b53..00000000000 --- a/openrtb_ext/imp_rhythmone.go +++ /dev/null @@ -1,9 +0,0 @@ -package openrtb_ext - -// ExtImpRhythmone defines the contract for bidrequest.imp[i].ext.prebid.bidder.rhythmone -type ExtImpRhythmone struct { - PlacementId string `json:"placementId"` - Zone string `json:"zone"` - Path string `json:"path"` - S2S bool -} diff --git a/static/bidder-info/rhythmone.yaml b/static/bidder-info/rhythmone.yaml deleted file mode 100644 index 529eae12628..00000000000 --- a/static/bidder-info/rhythmone.yaml +++ /dev/null @@ -1,17 +0,0 @@ -endpoint: "http://tag.1rx.io/rmp" -maintainer: - email: "support@rhythmone.com" -gvlVendorID: 36 -capabilities: - app: - mediaTypes: - - banner - - video - site: - mediaTypes: - - banner - - video -userSync: - redirect: - url: "https://sync.1rx.io/usersync2/rmphb?gdpr={{.GDPR}}&gdpr_consent={{.GDPRConsent}}&us_privacy={{.USPrivacy}}&redir={{.RedirectURL}}" - userMacro: "[RX_UUID]" \ No newline at end of file diff --git a/static/bidder-params/rhythmone.json b/static/bidder-params/rhythmone.json deleted file mode 100644 index 01366b45607..00000000000 --- a/static/bidder-params/rhythmone.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-04/schema#", - "title": "Rhythmone Adapter Params", - "description": "A schema which validates params accepted by the Rhythmone adapter", - "type": "object", - "properties": { - "placementId": { - "type": "string", - "description": "An ID which is used to frame Rhythmone ad tag", - "minLength": 1 - }, - "path": { - "type": "string", - "description": "An ID which is used to frame Rhythmone ad tag", - "minLength": 1 - }, - "zone": { - "type": "string", - "description": "An ID which is used to frame Rhythmone ad tag", - "minLength": 1 - } - }, - "required": ["placementId", "path", "zone"] -}