Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

imds: Change imds/synacormedia adapter hostname to be static #2793

Merged
merged 1 commit into from May 29, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 4 additions & 1 deletion adapters/imds/imds.go
Expand Up @@ -4,6 +4,7 @@ import (
"encoding/json"
"fmt"
"net/http"
"net/url"
"text/template"

"github.com/prebid/openrtb/v19/openrtb2"
Expand All @@ -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
}
Expand Down Expand Up @@ -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) {
Expand Down
2 changes: 1 addition & 1 deletion adapters/imds/imds_test.go
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion adapters/imds/imdstest/exemplary/simple-banner.json
Expand Up @@ -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": {
Expand Down
2 changes: 1 addition & 1 deletion adapters/imds/imdstest/exemplary/simple-video.json
Expand Up @@ -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": {
Expand Down
2 changes: 1 addition & 1 deletion adapters/imds/imdstest/supplemental/audio_response.json
Expand Up @@ -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": {
Expand Down
2 changes: 1 addition & 1 deletion adapters/imds/imdstest/supplemental/bad_response.json
Expand Up @@ -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": {
Expand Down
2 changes: 1 addition & 1 deletion adapters/imds/imdstest/supplemental/native_response.json
Expand Up @@ -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": {
Expand Down
2 changes: 1 addition & 1 deletion adapters/imds/imdstest/supplemental/one_bad_ext.json
Expand Up @@ -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": {
Expand Down
2 changes: 1 addition & 1 deletion adapters/imds/imdstest/supplemental/status_204.json
Expand Up @@ -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": {
Expand Down
2 changes: 1 addition & 1 deletion adapters/imds/imdstest/supplemental/status_400.json
Expand Up @@ -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": {
Expand Down
2 changes: 1 addition & 1 deletion adapters/imds/imdstest/supplemental/status_500.json
Expand Up @@ -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": {
Expand Down
2 changes: 1 addition & 1 deletion 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:
Expand Down
4 changes: 2 additions & 2 deletions 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"
Copy link
Contributor

Choose a reason for hiding this comment

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

domain pbs.technoratimedia.com is not reachable

~ » ping pbs.technoratimedia.com                                                                                                                                                                 oh0387@15852-p-mac
PING adserver.technoratimedia.com (150.136.26.45): 56 data bytes
Request timeout for icmp_seq 0
Request timeout for icmp_seq 1
Request timeout for icmp_seq 2
^C
--- adserver.technoratimedia.com ping statistics ---
4 packets transmitted, 0 packets received, 100.0% packet loss

Copy link
Contributor Author

@ecammit ecammit May 22, 2023

Choose a reason for hiding this comment

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

domain pbs.technoratimedia.com is not reachable

~ » ping pbs.technoratimedia.com                                                                                                                                                                 oh0387@15852-p-mac
PING adserver.technoratimedia.com (150.136.26.45): 56 data bytes
Request timeout for icmp_seq 0
Request timeout for icmp_seq 1
Request timeout for icmp_seq 2
^C
--- adserver.technoratimedia.com ping statistics ---
4 packets transmitted, 0 packets received, 100.0% packet loss

Our servers do not respond to ICMP ping requests. If you issue an HTTP or HTTPS request, it responds:

% curl -i 'http://pbs.technoratimedia.com/'
HTTP/1.1 404 Not Found
Server: nginx
Date: Mon, 22 May 2023 13:19:23 GMT
Content-Length: 0
Connection: keep-alive
access-control-allow-origin: *
access-control-allow-methods: POST,GET,HEAD,OPTIONS
X-Varnish: 47900326
Age: 0
Via: 1.1 varnish

Copy link
Contributor

Choose a reason for hiding this comment

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

Thanks @ecammit for clarification

maintainer:
email: "eng-demand@imds.tv"
capabilities:
Expand All @@ -12,4 +12,4 @@ capabilities:
- banner
- video
userSync:
key: "imds"
key: "imds"