diff --git a/adapters/imds/imds.go b/adapters/advertising/advertising.go similarity index 92% rename from adapters/imds/imds.go rename to adapters/advertising/advertising.go index a5f53d60362..e0f6ed2e230 100644 --- a/adapters/imds/imds.go +++ b/adapters/advertising/advertising.go @@ -1,4 +1,4 @@ -package imds +package advertising import ( "encoding/json" @@ -31,7 +31,7 @@ type ReqExt struct { SeatId string `json:"seatId"` } -// Builder builds a new instance of the Imds adapter for the given bidder with the given config. +// Builder builds a new instance of the Advertising.com 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) if err != nil { @@ -61,7 +61,7 @@ func (a *adapter) makeRequest(request *openrtb2.BidRequest) (*adapters.RequestDa var errs []error var validImps []openrtb2.Imp var re *ReqExt - var firstExtImp *openrtb_ext.ExtImpImds = nil + var firstExtImp *openrtb_ext.ExtImpAdvertising = nil for _, imp := range request.Imp { validExtImpObj, err := getExtImpObj(&imp) // getExtImpObj returns {seatId:"", tagId:""} @@ -131,11 +131,11 @@ func (a *adapter) makeRequest(request *openrtb2.BidRequest) (*adapters.RequestDa } // Builds enpoint url based on adapter-specific pub settings from imp.ext -func (adapter *adapter) buildEndpointURL(params *openrtb_ext.ExtImpImds) (string, error) { +func (adapter *adapter) buildEndpointURL(params *openrtb_ext.ExtImpAdvertising) (string, error) { return macros.ResolveMacros(adapter.EndpointTemplate, macros.EndpointTemplateParams{AccountID: url.QueryEscape(params.SeatId), SourceId: url.QueryEscape(adapterVersion)}) } -func getExtImpObj(imp *openrtb2.Imp) (*openrtb_ext.ExtImpImds, error) { +func getExtImpObj(imp *openrtb2.Imp) (*openrtb_ext.ExtImpAdvertising, error) { var bidderExt adapters.ExtImpBidder if err := jsonutil.Unmarshal(imp.Ext, &bidderExt); err != nil { return nil, &errortypes.BadInput{ @@ -143,14 +143,14 @@ func getExtImpObj(imp *openrtb2.Imp) (*openrtb_ext.ExtImpImds, error) { } } - var imdsExt openrtb_ext.ExtImpImds - if err := jsonutil.Unmarshal(bidderExt.Bidder, &imdsExt); err != nil { + var advertisingExt openrtb_ext.ExtImpAdvertising + if err := jsonutil.Unmarshal(bidderExt.Bidder, &advertisingExt); err != nil { return nil, &errortypes.BadInput{ Message: err.Error(), } } - return &imdsExt, nil + return &advertisingExt, nil } // MakeBids make the bids for the bid response. diff --git a/adapters/imds/imds_test.go b/adapters/advertising/advertising_test.go similarity index 62% rename from adapters/imds/imds_test.go rename to adapters/advertising/advertising_test.go index 40a00462c13..20bd29d47a0 100644 --- a/adapters/imds/imds_test.go +++ b/adapters/advertising/advertising_test.go @@ -1,4 +1,4 @@ -package imds +package advertising import ( "testing" @@ -10,18 +10,18 @@ import ( ) func TestJsonSamples(t *testing.T) { - bidder, buildErr := Builder(openrtb_ext.BidderImds, config.Adapter{ - Endpoint: "http://pbs.technoratimedia.com/openrtb/bids/{{.AccountID}}?src={{.SourceId}}&adapter=imds"}, config.Server{ExternalUrl: "http://hosturl.com", GvlID: 1, DataCenter: "2"}) + bidder, buildErr := Builder(openrtb_ext.BidderAdvertising, config.Adapter{ + Endpoint: "http://pbs.technoratimedia.com/openrtb/bids/{{.AccountID}}?src={{.SourceId}}&adapter=advertising"}, config.Server{ExternalUrl: "http://hosturl.com", GvlID: 1, DataCenter: "2"}) if buildErr != nil { t.Fatalf("Builder returned unexpected error %v", buildErr) } - adapterstest.RunJSONBidderTest(t, "imdstest", bidder) + adapterstest.RunJSONBidderTest(t, "advertisingtest", bidder) } func TestEndpointTemplateMalformed(t *testing.T) { - _, buildErr := Builder(openrtb_ext.BidderImds, config.Adapter{ + _, buildErr := Builder(openrtb_ext.BidderAdvertising, config.Adapter{ Endpoint: "{{Malformed}}"}, config.Server{ExternalUrl: "http://hosturl.com", GvlID: 1, DataCenter: "2"}) assert.Error(t, buildErr) diff --git a/adapters/imds/imdstest/exemplary/simple-banner.json b/adapters/advertising/advertisingtest/exemplary/simple-banner.json similarity index 95% rename from adapters/imds/imdstest/exemplary/simple-banner.json rename to adapters/advertising/advertisingtest/exemplary/simple-banner.json index 753f89ac8f5..c27372c9b6c 100644 --- a/adapters/imds/imdstest/exemplary/simple-banner.json +++ b/adapters/advertising/advertisingtest/exemplary/simple-banner.json @@ -25,7 +25,7 @@ "httpCalls": [ { "expectedRequest": { - "uri": "http://pbs.technoratimedia.com/openrtb/bids/prebid?src=pbs-go%2F1.0.0&adapter=imds", + "uri": "http://pbs.technoratimedia.com/openrtb/bids/prebid?src=pbs-go%2F1.0.0&adapter=advertising", "body": { "id": "test-request-id", "ext": { @@ -74,12 +74,12 @@ } } ], - "seat": "imds" + "seat": "advertising" } ], "ext": { "responsetimemillis": { - "imds": 339 + "advertising": 339 } } } diff --git a/adapters/imds/imdstest/exemplary/simple-video.json b/adapters/advertising/advertisingtest/exemplary/simple-video.json similarity index 95% rename from adapters/imds/imdstest/exemplary/simple-video.json rename to adapters/advertising/advertisingtest/exemplary/simple-video.json index 90d5d39f80c..4758f3bc341 100644 --- a/adapters/imds/imdstest/exemplary/simple-video.json +++ b/adapters/advertising/advertisingtest/exemplary/simple-video.json @@ -31,7 +31,7 @@ "httpCalls": [ { "expectedRequest": { - "uri": "http://pbs.technoratimedia.com/openrtb/bids/prebid?src=pbs-go%2F1.0.0&adapter=imds", + "uri": "http://pbs.technoratimedia.com/openrtb/bids/prebid?src=pbs-go%2F1.0.0&adapter=advertising", "body": { "id": "1", "site": { @@ -88,12 +88,12 @@ } } ], - "seat": "imds" + "seat": "advertising" } ], "ext": { "responsetimemillis": { - "imds": 339 + "advertising": 339 } } } diff --git a/adapters/imds/imdstest/supplemental/audio_response.json b/adapters/advertising/advertisingtest/supplemental/audio_response.json similarity index 96% rename from adapters/imds/imdstest/supplemental/audio_response.json rename to adapters/advertising/advertisingtest/supplemental/audio_response.json index 1e8eecd5ab8..513d86fc2ae 100644 --- a/adapters/imds/imdstest/supplemental/audio_response.json +++ b/adapters/advertising/advertisingtest/supplemental/audio_response.json @@ -20,7 +20,7 @@ "httpCalls": [ { "expectedRequest": { - "uri": "http://pbs.technoratimedia.com/openrtb/bids/prebid?src=pbs-go%2F1.0.0&adapter=imds", + "uri": "http://pbs.technoratimedia.com/openrtb/bids/prebid?src=pbs-go%2F1.0.0&adapter=advertising", "body": { "id": "test-request-id", "ext": { diff --git a/adapters/imds/imdstest/supplemental/bad_response.json b/adapters/advertising/advertisingtest/supplemental/bad_response.json similarity index 96% rename from adapters/imds/imdstest/supplemental/bad_response.json rename to adapters/advertising/advertisingtest/supplemental/bad_response.json index ff7c089e53d..bb5e6b9f751 100644 --- a/adapters/imds/imdstest/supplemental/bad_response.json +++ b/adapters/advertising/advertisingtest/supplemental/bad_response.json @@ -29,7 +29,7 @@ "httpCalls": [ { "expectedRequest": { - "uri": "http://pbs.technoratimedia.com/openrtb/bids/prebid?src=pbs-go%2F1.0.0&adapter=imds", + "uri": "http://pbs.technoratimedia.com/openrtb/bids/prebid?src=pbs-go%2F1.0.0&adapter=advertising", "body": { "id": "test-request-id", "ext": { diff --git a/adapters/imds/imdstest/supplemental/bad_seat_id.json b/adapters/advertising/advertisingtest/supplemental/bad_seat_id.json similarity index 81% rename from adapters/imds/imdstest/supplemental/bad_seat_id.json rename to adapters/advertising/advertisingtest/supplemental/bad_seat_id.json index 5e4b879540d..89acc4fe6a0 100644 --- a/adapters/imds/imdstest/supplemental/bad_seat_id.json +++ b/adapters/advertising/advertisingtest/supplemental/bad_seat_id.json @@ -24,7 +24,7 @@ "expectedMakeRequestsErrors": [ { - "value": "cannot unmarshal openrtb_ext.ExtImpImds.SeatId: expects \" or n, but found 1", + "value": "cannot unmarshal openrtb_ext.ExtImpAdvertising.SeatId: expects \" or n, but found 1", "comparison": "literal" } ] diff --git a/adapters/imds/imdstest/supplemental/missing_seat_id.json b/adapters/advertising/advertisingtest/supplemental/missing_seat_id.json similarity index 100% rename from adapters/imds/imdstest/supplemental/missing_seat_id.json rename to adapters/advertising/advertisingtest/supplemental/missing_seat_id.json diff --git a/adapters/imds/imdstest/supplemental/missing_tag_id.json b/adapters/advertising/advertisingtest/supplemental/missing_tag_id.json similarity index 100% rename from adapters/imds/imdstest/supplemental/missing_tag_id.json rename to adapters/advertising/advertisingtest/supplemental/missing_tag_id.json diff --git a/adapters/imds/imdstest/supplemental/native_response.json b/adapters/advertising/advertisingtest/supplemental/native_response.json similarity index 96% rename from adapters/imds/imdstest/supplemental/native_response.json rename to adapters/advertising/advertisingtest/supplemental/native_response.json index 5d5bec1e24d..a427c4a388a 100644 --- a/adapters/imds/imdstest/supplemental/native_response.json +++ b/adapters/advertising/advertisingtest/supplemental/native_response.json @@ -20,7 +20,7 @@ "httpCalls": [ { "expectedRequest": { - "uri": "http://pbs.technoratimedia.com/openrtb/bids/prebid?src=pbs-go%2F1.0.0&adapter=imds", + "uri": "http://pbs.technoratimedia.com/openrtb/bids/prebid?src=pbs-go%2F1.0.0&adapter=advertising", "body": { "id": "test-request-id", "ext": { diff --git a/adapters/imds/imdstest/supplemental/one_bad_ext.json b/adapters/advertising/advertisingtest/supplemental/one_bad_ext.json similarity index 96% rename from adapters/imds/imdstest/supplemental/one_bad_ext.json rename to adapters/advertising/advertisingtest/supplemental/one_bad_ext.json index 9da43d95057..4e3e42c207f 100644 --- a/adapters/imds/imdstest/supplemental/one_bad_ext.json +++ b/adapters/advertising/advertisingtest/supplemental/one_bad_ext.json @@ -42,7 +42,7 @@ "httpCalls": [ { "expectedRequest": { - "uri": "http://pbs.technoratimedia.com/openrtb/bids/prebid?src=pbs-go%2F1.0.0&adapter=imds", + "uri": "http://pbs.technoratimedia.com/openrtb/bids/prebid?src=pbs-go%2F1.0.0&adapter=advertising", "body": { "id": "test-request-id", "ext": { @@ -91,12 +91,12 @@ } } ], - "seat": "imds" + "seat": "advertising" } ], "ext": { "responsetimemillis": { - "imds": 339 + "advertising": 339 } } } diff --git a/adapters/imds/imdstest/supplemental/status_204.json b/adapters/advertising/advertisingtest/supplemental/status_204.json similarity index 96% rename from adapters/imds/imdstest/supplemental/status_204.json rename to adapters/advertising/advertisingtest/supplemental/status_204.json index c9002a6c455..0054c3cd6b6 100644 --- a/adapters/imds/imdstest/supplemental/status_204.json +++ b/adapters/advertising/advertisingtest/supplemental/status_204.json @@ -29,7 +29,7 @@ "httpCalls": [ { "expectedRequest": { - "uri": "http://pbs.technoratimedia.com/openrtb/bids/prebid?src=pbs-go%2F1.0.0&adapter=imds", + "uri": "http://pbs.technoratimedia.com/openrtb/bids/prebid?src=pbs-go%2F1.0.0&adapter=advertising", "body": { "id": "test-request-id", "ext": { diff --git a/adapters/imds/imdstest/supplemental/status_400.json b/adapters/advertising/advertisingtest/supplemental/status_400.json similarity index 97% rename from adapters/imds/imdstest/supplemental/status_400.json rename to adapters/advertising/advertisingtest/supplemental/status_400.json index e6a100d62b2..0853b84552c 100644 --- a/adapters/imds/imdstest/supplemental/status_400.json +++ b/adapters/advertising/advertisingtest/supplemental/status_400.json @@ -29,7 +29,7 @@ "httpCalls": [ { "expectedRequest": { - "uri": "http://pbs.technoratimedia.com/openrtb/bids/prebid?src=pbs-go%2F1.0.0&adapter=imds", + "uri": "http://pbs.technoratimedia.com/openrtb/bids/prebid?src=pbs-go%2F1.0.0&adapter=advertising", "body": { "id": "test-request-id", "ext": { diff --git a/adapters/imds/imdstest/supplemental/status_500.json b/adapters/advertising/advertisingtest/supplemental/status_500.json similarity index 97% rename from adapters/imds/imdstest/supplemental/status_500.json rename to adapters/advertising/advertisingtest/supplemental/status_500.json index ba1ccfe5db6..db803eb4592 100644 --- a/adapters/imds/imdstest/supplemental/status_500.json +++ b/adapters/advertising/advertisingtest/supplemental/status_500.json @@ -29,7 +29,7 @@ "httpCalls": [ { "expectedRequest": { - "uri": "http://pbs.technoratimedia.com/openrtb/bids/prebid?src=pbs-go%2F1.0.0&adapter=imds", + "uri": "http://pbs.technoratimedia.com/openrtb/bids/prebid?src=pbs-go%2F1.0.0&adapter=advertising", "body": { "id": "test-request-id", "ext": { diff --git a/adapters/imds/params_test.go b/adapters/advertising/params_test.go similarity index 57% rename from adapters/imds/params_test.go rename to adapters/advertising/params_test.go index d98fe04cd1f..6d7a277abdb 100644 --- a/adapters/imds/params_test.go +++ b/adapters/advertising/params_test.go @@ -1,4 +1,4 @@ -package imds +package advertising import ( "encoding/json" @@ -7,11 +7,11 @@ import ( "github.com/prebid/prebid-server/v3/openrtb_ext" ) -// This file actually intends to test static/bidder-params/imds.json +// This file actually intends to test static/bidder-params/advertising.json // -// These also validate the format of the external API: request.imp[i].ext.prebid.bidder.imds +// These also validate the format of the external API: request.imp[i].ext.prebid.bidder.advertising -// TestValidParams makes sure that the imds schema accepts all imp.ext fields which we intend to support. +// TestValidParams makes sure that the advertising.com schema accepts all imp.ext fields which we intend to support. func TestValidParams(t *testing.T) { validator, err := openrtb_ext.NewBidderParamsValidator("../../static/bidder-params") if err != nil { @@ -19,13 +19,13 @@ func TestValidParams(t *testing.T) { } for _, validParam := range validParams { - if err := validator.Validate(openrtb_ext.BidderImds, json.RawMessage(validParam)); err != nil { - t.Errorf("Schema rejected imds params: %s", validParam) + if err := validator.Validate(openrtb_ext.BidderAdvertising, json.RawMessage(validParam)); err != nil { + t.Errorf("Schema rejected advertising.com params: %s", validParam) } } } -// TestInvalidParams makes sure that the imds schema rejects all the imp.ext fields we don't support. +// TestInvalidParams makes sure that the advertising.com schema rejects all the imp.ext fields we don't support. func TestInvalidParams(t *testing.T) { validator, err := openrtb_ext.NewBidderParamsValidator("../../static/bidder-params") if err != nil { @@ -33,7 +33,7 @@ func TestInvalidParams(t *testing.T) { } for _, invalidParam := range invalidParams { - if err := validator.Validate(openrtb_ext.BidderImds, json.RawMessage(invalidParam)); err == nil { + if err := validator.Validate(openrtb_ext.BidderAdvertising, json.RawMessage(invalidParam)); err == nil { t.Errorf("Schema allowed unexpected params: %s", invalidParam) } } diff --git a/exchange/adapter_builders.go b/exchange/adapter_builders.go index 7647de71786..b1fd3fe33c6 100755 --- a/exchange/adapter_builders.go +++ b/exchange/adapter_builders.go @@ -31,6 +31,7 @@ import ( "github.com/prebid/prebid-server/v3/adapters/adtrgtme" "github.com/prebid/prebid-server/v3/adapters/aduptech" "github.com/prebid/prebid-server/v3/adapters/advangelists" + "github.com/prebid/prebid-server/v3/adapters/advertising" "github.com/prebid/prebid-server/v3/adapters/adverxo" "github.com/prebid/prebid-server/v3/adapters/adview" "github.com/prebid/prebid-server/v3/adapters/adxcg" @@ -110,7 +111,6 @@ import ( "github.com/prebid/prebid-server/v3/adapters/grid" "github.com/prebid/prebid-server/v3/adapters/gumgum" "github.com/prebid/prebid-server/v3/adapters/huaweiads" - "github.com/prebid/prebid-server/v3/adapters/imds" "github.com/prebid/prebid-server/v3/adapters/impactify" "github.com/prebid/prebid-server/v3/adapters/improvedigital" "github.com/prebid/prebid-server/v3/adapters/infytv" @@ -358,7 +358,7 @@ func newAdapterBuilders() map[openrtb_ext.BidderName]adapters.Builder { openrtb_ext.BidderGrid: grid.Builder, openrtb_ext.BidderGumGum: gumgum.Builder, openrtb_ext.BidderHuaweiAds: huaweiads.Builder, - openrtb_ext.BidderImds: imds.Builder, + openrtb_ext.BidderAdvertising: advertising.Builder, openrtb_ext.BidderImpactify: impactify.Builder, openrtb_ext.BidderImprovedigital: improvedigital.Builder, openrtb_ext.BidderInfyTV: infytv.Builder, diff --git a/openrtb_ext/bidders.go b/openrtb_ext/bidders.go index 10755dfd7fd..945cf9e59bf 100644 --- a/openrtb_ext/bidders.go +++ b/openrtb_ext/bidders.go @@ -127,7 +127,7 @@ var coreBidderNames []BidderName = []BidderName{ BidderGrid, BidderGumGum, BidderHuaweiAds, - BidderImds, + BidderAdvertising, BidderImpactify, BidderImprovedigital, BidderInfyTV, @@ -481,7 +481,7 @@ const ( BidderGrid BidderName = "grid" BidderGumGum BidderName = "gumgum" BidderHuaweiAds BidderName = "huaweiads" - BidderImds BidderName = "imds" + BidderAdvertising BidderName = "advertising" BidderImpactify BidderName = "impactify" BidderImprovedigital BidderName = "improvedigital" BidderInfyTV BidderName = "infytv" diff --git a/openrtb_ext/imp_advertising.go b/openrtb_ext/imp_advertising.go new file mode 100644 index 00000000000..379f1a4c6c4 --- /dev/null +++ b/openrtb_ext/imp_advertising.go @@ -0,0 +1,7 @@ +package openrtb_ext + +// ExtImpAdvertising defines the contract for bidrequest.imp[i].ext.prebid.bidder.advertising +type ExtImpAdvertising struct { + SeatId string `json:"seatId"` + TagId string `json:"tagId"` +} diff --git a/openrtb_ext/imp_imds.go b/openrtb_ext/imp_imds.go deleted file mode 100644 index 97f32e900a4..00000000000 --- a/openrtb_ext/imp_imds.go +++ /dev/null @@ -1,7 +0,0 @@ -package openrtb_ext - -// ExtImpImds defines the contract for bidrequest.imp[i].ext.prebid.bidder.imds -type ExtImpImds struct { - SeatId string `json:"seatId"` - TagId string `json:"tagId"` -} diff --git a/static/bidder-info/imds.yaml b/static/bidder-info/advertising.yaml similarity index 96% rename from static/bidder-info/imds.yaml rename to static/bidder-info/advertising.yaml index 135b67fc1f9..d0b5d9bb197 100644 --- a/static/bidder-info/imds.yaml +++ b/static/bidder-info/advertising.yaml @@ -4,7 +4,7 @@ geoscope: - USA - CAN maintainer: - email: "eng-demand@imds.tv" + email: "prebid@advertising.com" capabilities: app: mediaTypes: diff --git a/static/bidder-info/synacormedia.yaml b/static/bidder-info/synacormedia.yaml deleted file mode 100644 index ccbba0700a4..00000000000 --- a/static/bidder-info/synacormedia.yaml +++ /dev/null @@ -1,3 +0,0 @@ -# DEPRECATED: Use imds bidder instead -aliasOf: imds -endpoint: "https://pbs.technoratimedia.com/openrtb/bids/{{.AccountID}}?src={{.SourceId}}&adapter=synacormedia" diff --git a/static/bidder-params/imds.json b/static/bidder-params/advertising.json similarity index 77% rename from static/bidder-params/imds.json rename to static/bidder-params/advertising.json index e5b05bcb1c0..80ade91cd26 100644 --- a/static/bidder-params/imds.json +++ b/static/bidder-params/advertising.json @@ -1,7 +1,7 @@ { "$schema": "http://json-schema.org/draft-04/schema#", - "title": "iMedia Digital Services (IMDS) Adapter Params", - "description": "A schema which validates params accepted by the iMedia Digital Services (IMDS) adapter", + "title": "Advertising.com Adapter Params", + "description": "A schema which validates params accepted by the Advertising.com adapter", "type": "object", "properties": {