diff --git a/adapters/imds/imds.go b/adapters/imds/imds.go index 6c555bcca45..02d30828966 100644 --- a/adapters/imds/imds.go +++ b/adapters/imds/imds.go @@ -4,6 +4,7 @@ import ( "encoding/json" "fmt" "net/http" + "net/url" "text/template" "github.com/prebid/openrtb/v19/openrtb2" @@ -14,6 +15,8 @@ import ( "github.com/prebid/prebid-server/openrtb_ext" ) +const adapterVersion string = "pbs-go/1.0.0" + type adapter struct { EndpointTemplate *template.Template } @@ -127,7 +130,7 @@ 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) { - return macros.ResolveMacros(adapter.EndpointTemplate, macros.EndpointTemplateParams{Host: params.SeatId}) + 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) { diff --git a/adapters/imds/imds_test.go b/adapters/imds/imds_test.go index 3a8c33ed31c..5fab0509c1d 100644 --- a/adapters/imds/imds_test.go +++ b/adapters/imds/imds_test.go @@ -11,7 +11,7 @@ import ( func TestJsonSamples(t *testing.T) { bidder, buildErr := Builder(openrtb_ext.BidderImds, config.Adapter{ - Endpoint: "http://{{.Host}}.technoratimedia.com/openrtb/bids/{{.Host}}"}, config.Server{ExternalUrl: "http://hosturl.com", GvlID: 1, DataCenter: "2"}) + Endpoint: "http://pbs.technoratimedia.com/openrtb/bids/{{.AccountID}}?src={{.SourceId}}&adapter=imds"}, config.Server{ExternalUrl: "http://hosturl.com", GvlID: 1, DataCenter: "2"}) if buildErr != nil { t.Fatalf("Builder returned unexpected error %v", buildErr) diff --git a/adapters/imds/imdstest/exemplary/simple-banner.json b/adapters/imds/imdstest/exemplary/simple-banner.json index 5b15f9e058a..c19d19bd5fe 100644 --- a/adapters/imds/imdstest/exemplary/simple-banner.json +++ b/adapters/imds/imdstest/exemplary/simple-banner.json @@ -25,7 +25,7 @@ "httpCalls": [ { "expectedRequest": { - "uri": "http://prebid.technoratimedia.com/openrtb/bids/prebid", + "uri": "http://pbs.technoratimedia.com/openrtb/bids/prebid?src=pbs-go%2F1.0.0&adapter=imds", "body": { "id": "test-request-id", "ext": { diff --git a/adapters/imds/imdstest/exemplary/simple-video.json b/adapters/imds/imdstest/exemplary/simple-video.json index 9aaea18cca9..31a8d568b5d 100644 --- a/adapters/imds/imdstest/exemplary/simple-video.json +++ b/adapters/imds/imdstest/exemplary/simple-video.json @@ -31,7 +31,7 @@ "httpCalls": [ { "expectedRequest": { - "uri": "http://prebid.technoratimedia.com/openrtb/bids/prebid", + "uri": "http://pbs.technoratimedia.com/openrtb/bids/prebid?src=pbs-go%2F1.0.0&adapter=imds", "body": { "id": "1", "site": { diff --git a/adapters/imds/imdstest/supplemental/audio_response.json b/adapters/imds/imdstest/supplemental/audio_response.json index 752d610aa72..9873d9b91d4 100644 --- a/adapters/imds/imdstest/supplemental/audio_response.json +++ b/adapters/imds/imdstest/supplemental/audio_response.json @@ -20,7 +20,7 @@ "httpCalls": [ { "expectedRequest": { - "uri": "http://prebid.technoratimedia.com/openrtb/bids/prebid", + "uri": "http://pbs.technoratimedia.com/openrtb/bids/prebid?src=pbs-go%2F1.0.0&adapter=imds", "body": { "id": "test-request-id", "ext": { diff --git a/adapters/imds/imdstest/supplemental/bad_response.json b/adapters/imds/imdstest/supplemental/bad_response.json index 520f415bcf4..1f96ac643bb 100644 --- a/adapters/imds/imdstest/supplemental/bad_response.json +++ b/adapters/imds/imdstest/supplemental/bad_response.json @@ -29,7 +29,7 @@ "httpCalls": [ { "expectedRequest": { - "uri": "http://prebid.technoratimedia.com/openrtb/bids/prebid", + "uri": "http://pbs.technoratimedia.com/openrtb/bids/prebid?src=pbs-go%2F1.0.0&adapter=imds", "body": { "id": "test-request-id", "ext": { diff --git a/adapters/imds/imdstest/supplemental/native_response.json b/adapters/imds/imdstest/supplemental/native_response.json index 1428ac1ccd3..b402084a97e 100644 --- a/adapters/imds/imdstest/supplemental/native_response.json +++ b/adapters/imds/imdstest/supplemental/native_response.json @@ -20,7 +20,7 @@ "httpCalls": [ { "expectedRequest": { - "uri": "http://prebid.technoratimedia.com/openrtb/bids/prebid", + "uri": "http://pbs.technoratimedia.com/openrtb/bids/prebid?src=pbs-go%2F1.0.0&adapter=imds", "body": { "id": "test-request-id", "ext": { diff --git a/adapters/imds/imdstest/supplemental/one_bad_ext.json b/adapters/imds/imdstest/supplemental/one_bad_ext.json index f5e9fed874d..d1bd7451384 100644 --- a/adapters/imds/imdstest/supplemental/one_bad_ext.json +++ b/adapters/imds/imdstest/supplemental/one_bad_ext.json @@ -42,7 +42,7 @@ "httpCalls": [ { "expectedRequest": { - "uri": "http://prebid.technoratimedia.com/openrtb/bids/prebid", + "uri": "http://pbs.technoratimedia.com/openrtb/bids/prebid?src=pbs-go%2F1.0.0&adapter=imds", "body": { "id": "test-request-id", "ext": { diff --git a/adapters/imds/imdstest/supplemental/status_204.json b/adapters/imds/imdstest/supplemental/status_204.json index 302e8ed1585..77906a7b54b 100644 --- a/adapters/imds/imdstest/supplemental/status_204.json +++ b/adapters/imds/imdstest/supplemental/status_204.json @@ -29,7 +29,7 @@ "httpCalls": [ { "expectedRequest": { - "uri": "http://prebid.technoratimedia.com/openrtb/bids/prebid", + "uri": "http://pbs.technoratimedia.com/openrtb/bids/prebid?src=pbs-go%2F1.0.0&adapter=imds", "body": { "id": "test-request-id", "ext": { diff --git a/adapters/imds/imdstest/supplemental/status_400.json b/adapters/imds/imdstest/supplemental/status_400.json index 1bb2cf6fa45..9a63221972b 100644 --- a/adapters/imds/imdstest/supplemental/status_400.json +++ b/adapters/imds/imdstest/supplemental/status_400.json @@ -29,7 +29,7 @@ "httpCalls": [ { "expectedRequest": { - "uri": "http://prebid.technoratimedia.com/openrtb/bids/prebid", + "uri": "http://pbs.technoratimedia.com/openrtb/bids/prebid?src=pbs-go%2F1.0.0&adapter=imds", "body": { "id": "test-request-id", "ext": { diff --git a/adapters/imds/imdstest/supplemental/status_500.json b/adapters/imds/imdstest/supplemental/status_500.json index 37ca398e59e..ee29aee4329 100644 --- a/adapters/imds/imdstest/supplemental/status_500.json +++ b/adapters/imds/imdstest/supplemental/status_500.json @@ -29,7 +29,7 @@ "httpCalls": [ { "expectedRequest": { - "uri": "http://prebid.technoratimedia.com/openrtb/bids/prebid", + "uri": "http://pbs.technoratimedia.com/openrtb/bids/prebid?src=pbs-go%2F1.0.0&adapter=imds", "body": { "id": "test-request-id", "ext": { diff --git a/static/bidder-info/imds.yaml b/static/bidder-info/imds.yaml index 3f27c766df3..e608a6c6c8c 100644 --- a/static/bidder-info/imds.yaml +++ b/static/bidder-info/imds.yaml @@ -1,4 +1,4 @@ -endpoint: "http://{{.Host}}.technoratimedia.com/openrtb/bids/{{.Host}}" +endpoint: "https://pbs.technoratimedia.com/openrtb/bids/{{.AccountID}}?src={{.SourceId}}&adapter=imds" maintainer: email: "eng-demand@imds.tv" capabilities: diff --git a/static/bidder-info/synacormedia.yaml b/static/bidder-info/synacormedia.yaml index c19d7674d18..2a796ae839f 100644 --- a/static/bidder-info/synacormedia.yaml +++ b/static/bidder-info/synacormedia.yaml @@ -1,5 +1,5 @@ # DEPRECATED: Use imds bidder instead -endpoint: "http://{{.Host}}.technoratimedia.com/openrtb/bids/{{.Host}}" +endpoint: "https://pbs.technoratimedia.com/openrtb/bids/{{.AccountID}}?src={{.SourceId}}&adapter=synacormedia" maintainer: email: "eng-demand@imds.tv" capabilities: @@ -12,4 +12,4 @@ capabilities: - banner - video userSync: - key: "imds" \ No newline at end of file + key: "imds"