From 9a121a8175421be77f63b188641d983011615480 Mon Sep 17 00:00:00 2001 From: anna-y-perion Date: Wed, 9 Jul 2025 16:28:12 +0300 Subject: [PATCH 1/6] adding new server adapter --- adapters/programmaticxortb/params_test.go | 50 ++++ .../programmaticxortb/programmaticxortb.go | 131 +++++++++ .../programmaticxortb_test.go | 24 ++ .../exemplary/banner.json | 127 +++++++++ .../exemplary/multi-imp.json | 265 ++++++++++++++++++ .../exemplary/video.json | 154 ++++++++++ .../supplemental/bad-request.json | 65 +++++ .../supplemental/body-unmarshal-fail.json | 65 +++++ .../supplemental/internal-error.json | 65 +++++ .../supplemental/no-content.json | 60 ++++ .../supplemental/unknown-bid-type.json | 109 +++++++ exchange/adapter_builders.go | 2 + openrtb_ext/bidders.go | 2 + openrtb_ext/imp_programmaticxortb.go | 6 + static/bidder-info/programmaticxortb.yaml | 20 ++ static/bidder-params/programmaticxortb.json | 18 ++ 16 files changed, 1163 insertions(+) create mode 100644 adapters/programmaticxortb/params_test.go create mode 100644 adapters/programmaticxortb/programmaticxortb.go create mode 100644 adapters/programmaticxortb/programmaticxortb_test.go create mode 100644 adapters/programmaticxortb/programmaticxortbtest/exemplary/banner.json create mode 100644 adapters/programmaticxortb/programmaticxortbtest/exemplary/multi-imp.json create mode 100644 adapters/programmaticxortb/programmaticxortbtest/exemplary/video.json create mode 100644 adapters/programmaticxortb/programmaticxortbtest/supplemental/bad-request.json create mode 100644 adapters/programmaticxortb/programmaticxortbtest/supplemental/body-unmarshal-fail.json create mode 100644 adapters/programmaticxortb/programmaticxortbtest/supplemental/internal-error.json create mode 100644 adapters/programmaticxortb/programmaticxortbtest/supplemental/no-content.json create mode 100644 adapters/programmaticxortb/programmaticxortbtest/supplemental/unknown-bid-type.json create mode 100644 openrtb_ext/imp_programmaticxortb.go create mode 100644 static/bidder-info/programmaticxortb.yaml create mode 100644 static/bidder-params/programmaticxortb.json diff --git a/adapters/programmaticxortb/params_test.go b/adapters/programmaticxortb/params_test.go new file mode 100644 index 00000000000..7bcc980b448 --- /dev/null +++ b/adapters/programmaticxortb/params_test.go @@ -0,0 +1,50 @@ +package programmaticxortb + +import ( + "encoding/json" + "testing" + + "github.com/prebid/prebid-server/v3/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 schema. %v", err) + } + + for _, validParam := range validParams { + if err := validator.Validate(openrtb_ext.BidderProgrammaticxOrtb, json.RawMessage(validParam)); err != nil { + t.Errorf("Schema rejected valid 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 schema. %v", err) + } + + for _, p := range invalidParams { + if err := validator.Validate(openrtb_ext.BidderProgrammaticxOrtb, json.RawMessage(p)); err == nil { + t.Errorf("Schema allowed invalid params: %s", p) + } + } +} + +var validParams = []string{ + `{"cId": "provided_cid_123"}`, +} + +var invalidParams = []string{ + `{"cId": 123}`, + `{"cId": true}`, + `{"cId": ["array"]}`, + `{"cId": {}`, + `{"cId": ""}`, + `{"cId": null}`, + `{"cId": "provided_cid_123", "extra": "field"}`, + `{"cid": "valid_cid"}`, + `{"cId": "invalid_chars_!@#$%^&*()"}`, +} diff --git a/adapters/programmaticxortb/programmaticxortb.go b/adapters/programmaticxortb/programmaticxortb.go new file mode 100644 index 00000000000..2c6c29cf574 --- /dev/null +++ b/adapters/programmaticxortb/programmaticxortb.go @@ -0,0 +1,131 @@ +package programmaticxortb + +import ( + "encoding/json" + "fmt" + "github.com/prebid/openrtb/v20/openrtb2" + "github.com/prebid/prebid-server/v3/adapters" + "github.com/prebid/prebid-server/v3/config" + "github.com/prebid/prebid-server/v3/errortypes" + "github.com/prebid/prebid-server/v3/openrtb_ext" + "github.com/prebid/prebid-server/v3/util/jsonutil" + "net/http" + "net/url" + "strings" +) + +type adapter struct { + endpoint string +} + +// Builder builds a new instance of the programmaticx for the given bidder with the given config. +func Builder(bidderName openrtb_ext.BidderName, config config.Adapter, server config.Server) (adapters.Bidder, error) { + bidder := &adapter{ + endpoint: config.Endpoint, + } + return bidder, nil +} + +func (a *adapter) MakeRequests(request *openrtb2.BidRequest, requestInfo *adapters.ExtraRequestInfo) ([]*adapters.RequestData, []error) { + var requests []*adapters.RequestData + var errors []error + + requestCopy := *request + + for _, imp := range request.Imp { + requestCopy.Imp = []openrtb2.Imp{imp} + + requestJSON, err := json.Marshal(&requestCopy) + if err != nil { + errors = append(errors, fmt.Errorf("marshal bidRequest: %w", err)) + return nil, errors + } + + cId, err := extractCid(&imp) + if err != nil { + errors = append(errors, fmt.Errorf("extract cId: %w", err)) + continue + } + + headers := http.Header{} + headers.Add("Content-Type", "application/json;charset=utf-8") + + requestData := &adapters.RequestData{ + Method: http.MethodPost, + Uri: fmt.Sprintf("%s/%s", strings.TrimRight(a.endpoint, "/"), url.QueryEscape(cId)), + Body: requestJSON, + Headers: headers, + ImpIDs: []string{imp.ID}, + } + + requests = append(requests, requestData) + } + + return requests, errors +} + +func (a *adapter) MakeBids(request *openrtb2.BidRequest, requestData *adapters.RequestData, responseData *adapters.ResponseData) (*adapters.BidderResponse, []error) { + var errs []error + + if adapters.IsResponseStatusCodeNoContent(responseData) { + return nil, nil + } + + if err := adapters.CheckResponseStatusCodeForErrors(responseData); err != nil { + return nil, []error{err} + } + + var response openrtb2.BidResponse + if err := jsonutil.Unmarshal(responseData.Body, &response); err != nil { + return nil, []error{&errortypes.BadServerResponse{ + Message: fmt.Sprintf("bad server response: %v. ", err), + }} + } + + bidResponse := adapters.NewBidderResponseWithBidsCapacity(len(response.SeatBid)) + + if response.Cur != "" { + bidResponse.Currency = response.Cur + } + + for _, seatBid := range response.SeatBid { + for i := range seatBid.Bid { + bidType, err := getMediaTypeForBid(seatBid.Bid[i]) + if err != nil { + errs = append(errs, err) + continue + } + bidResponse.Bids = append(bidResponse.Bids, &adapters.TypedBid{ + Bid: &seatBid.Bid[i], + BidType: bidType, + }) + } + } + + return bidResponse, errs +} + +func extractCid(imp *openrtb2.Imp) (string, error) { + var bidderExt adapters.ExtImpBidder + if err := jsonutil.Unmarshal(imp.Ext, &bidderExt); err != nil { + return "", fmt.Errorf("unmarshal bidderExt: %w", err) + } + + var impExt openrtb_ext.ImpExtProgrammaticxOrtb + if err := jsonutil.Unmarshal(bidderExt.Bidder, &impExt); err != nil { + return "", fmt.Errorf("unmarshal ImpExtProgrammaticxOrtb: %w", err) + } + return impExt.ConnectionId, nil +} + +func getMediaTypeForBid(bid openrtb2.Bid) (openrtb_ext.BidType, error) { + switch bid.MType { + case openrtb2.MarkupBanner: + return openrtb_ext.BidTypeBanner, nil + case openrtb2.MarkupVideo: + return openrtb_ext.BidTypeVideo, nil + } + return "", &errortypes.BadInput{ + Message: fmt.Sprintf("Could not define bid type for imp: %s", bid.ImpID), + } +} diff --git a/adapters/programmaticxortb/programmaticxortb_test.go b/adapters/programmaticxortb/programmaticxortb_test.go new file mode 100644 index 00000000000..df79688a1c3 --- /dev/null +++ b/adapters/programmaticxortb/programmaticxortb_test.go @@ -0,0 +1,24 @@ +package programmaticxortb + +import ( + "testing" + + "github.com/prebid/prebid-server/v3/adapters/adapterstest" + "github.com/prebid/prebid-server/v3/config" + "github.com/prebid/prebid-server/v3/openrtb_ext" +) + +func TestJsonSamples(t *testing.T) { + bidder, buildErr := Builder(openrtb_ext.BidderProgrammaticxOrtb, config.Adapter{ + Endpoint: "https://programmaticx.ai/", + }, + config.Server{ + ExternalUrl: "http://hosturl.com", GvlID: 1, DataCenter: "2", + }) + + if buildErr != nil { + t.Fatalf("Builder returned unexpected error %v", buildErr) + } + + adapterstest.RunJSONBidderTest(t, "programmaticxortbtest", bidder) +} diff --git a/adapters/programmaticxortb/programmaticxortbtest/exemplary/banner.json b/adapters/programmaticxortb/programmaticxortbtest/exemplary/banner.json new file mode 100644 index 00000000000..128e2ff8c0e --- /dev/null +++ b/adapters/programmaticxortb/programmaticxortbtest/exemplary/banner.json @@ -0,0 +1,127 @@ +{ + "mockBidRequest": { + "id": "some-request-id", + "site": { + "page": "prebid.org" + }, + "imp": [ + { + "id": "some-impression-id", + "banner": { + "w": 240, + "h": 400 + }, + "ext": { + "bidder": { + "cId": "test_cid_123" + } + } + } + ], + "tmax": 5000 + }, + "httpCalls": [ + { + "expectedRequest": { + "uri": "https://programmaticx.ai/test_cid_123", + "body": { + "id": "some-request-id", + "site": { + "page": "prebid.org" + }, + "imp": [ + { + "id": "some-impression-id", + "banner": { + "w": 240, + "h": 400 + }, + "ext": { + "bidder": { + "cId": "test_cid_123" + } + } + } + ], + "tmax": 5000 + }, + "impIDs": [ + "some-impression-id" + ] + }, + "mockResponse": { + "status": 200, + "body": { + "id": "some-request-id", + "cur": "", + "bidid": "some-bid-id", + "seatbid": [ + { + "bid": [ + { + "exp": 60, + "adm": "
Some creative
", + "burl": "", + "iurl": "https://programmaticx.ai/creative.jpg", + "lurl": "", + "nurl": "", + "id": "some-bid-id", + "impid": "some-impression-id", + "h": 400, + "w": 240, + "price": 1, + "dealid": "deal123", + "adomain": [ + "test.com" + ], + "adid": "some-ad-id", + "cid": "test", + "attr": [], + "cat": [], + "crid": "some-creative-id", + "ext": {}, + "hratio": 0, + "language": "", + "protocol": 0, + "qagmediarating": 0, + "tactic": "", + "wratio": 0, + "mtype": 1 + } + ] + } + ] + } + } + } + ], + "expectedBidResponses": [ + { + "bids": [ + { + "bid": { + "id": "some-bid-id", + "impid": "some-impression-id", + "price": 1, + "adm": "
Some creative
", + "adid": "some-ad-id", + "cid": "test", + "iurl": "https://programmaticx.ai/creative.jpg", + "crid": "some-creative-id", + "adomain": [ + "test.com" + ], + "dealid": "deal123", + "w": 240, + "h": 400, + "exp": 60, + "ext": {}, + "mtype": 1 + }, + "type": "banner" + } + ] + } + ], + "expectedMakeBidsErrors": [] +} \ No newline at end of file diff --git a/adapters/programmaticxortb/programmaticxortbtest/exemplary/multi-imp.json b/adapters/programmaticxortb/programmaticxortbtest/exemplary/multi-imp.json new file mode 100644 index 00000000000..deff1f18364 --- /dev/null +++ b/adapters/programmaticxortb/programmaticxortbtest/exemplary/multi-imp.json @@ -0,0 +1,265 @@ +{ + "mockBidRequest": { + "id": "some-request-id", + "site": { + "page": "prebid.org" + }, + "imp": [ + { + "id": "some-impression-id", + "video": { + "mimes": [ + "video/mp4" + ], + "minduration": 1, + "maxduration": 2, + "protocols": [ + 1, + 2, + 5 + ], + "w": 300, + "h": 250, + "startdelay": 1, + "placement": 1, + "playbackmethod": [ + 2 + ], + "api": [ + 1, + 2, + 3, + 4 + ] + }, + "ext": { + "bidder": { + "cId": "test_cid_123" + } + } + }, + { + "id": "some-impression-id_2", + "banner": { + "w": 240, + "h": 400 + }, + "ext": { + "bidder": { + "cId": "test_cid_123" + } + } + } + ], + "tmax": 5000 + }, + "httpCalls": [ + { + "expectedRequest": { + "uri": "https://programmaticx.ai/test_cid_123", + "body": { + "id": "some-request-id", + "site": { + "page": "prebid.org" + }, + "imp": [ + { + "id": "some-impression-id", + "video": { + "mimes": [ + "video/mp4" + ], + "minduration": 1, + "maxduration": 2, + "protocols": [ + 1, + 2, + 5 + ], + "w": 300, + "h": 250, + "startdelay": 1, + "placement": 1, + "playbackmethod": [ + 2 + ], + "api": [ + 1, + 2, + 3, + 4 + ] + }, + "ext": { + "bidder": { + "cId": "test_cid_123" + } + } + } + ], + "tmax": 5000 + }, + "impIDs": [ + "some-impression-id" + ] + }, + "mockResponse": { + "status": 200, + "body": { + "id": "some-request-id", + "cur": "", + "bidid": "some-bid-id", + "seatbid": [ + { + "bid": [ + { + "exp": 60, + "adm": "Some Ad SystemSome Ad Title00:00:02", + "id": "some-bid-id", + "impid": "some-impression-id", + "h": 250, + "w": 300, + "price": 1, + "dealid": "deal123", + "adomain": [ + "test.com" + ], + "adid": "some-ad-id", + "cid": "test", + "crid": "some-creative-id", + "mtype": 2 + } + ] + } + ] + } + } + }, + { + "expectedRequest": { + "uri": "https://programmaticx.ai/test_cid_123", + "body": { + "id": "some-request-id", + "site": { + "page": "prebid.org" + }, + "imp": [ + { + "id": "some-impression-id_2", + "banner": { + "w": 240, + "h": 400 + }, + "ext": { + "bidder": { + "cId": "test_cid_123" + } + } + } + ], + "tmax": 5000 + }, + "impIDs": [ + "some-impression-id_2" + ] + }, + "mockResponse": { + "status": 200, + "body": { + "id": "some-request-id", + "cur": "", + "bidid": "some-bid-id", + "seatbid": [ + { + "bid": [ + { + "exp": 60, + "adm": "
Some creative
", + "burl": "", + "iurl": "https://programmaticx.ai/creative.jpg", + "lurl": "", + "nurl": "", + "id": "some-bid-id", + "impid": "some-impression-id_2", + "h": 400, + "w": 240, + "price": 1, + "dealid": "deal123", + "adomain": [ + "test.com" + ], + "adid": "some-ad-id", + "cid": "test", + "attr": [], + "cat": [], + "crid": "some-creative-id", + "ext": {}, + "hratio": 0, + "language": "", + "protocol": 0, + "qagmediarating": 0, + "tactic": "", + "wratio": 0, + "mtype": 1 + } + ] + } + ] + } + } + } + ], + "expectedBidResponses": [ + { + "bids": [ + { + "bid": { + "exp": 60, + "adm": "Some Ad SystemSome Ad Title00:00:02", + "id": "some-bid-id", + "impid": "some-impression-id", + "h": 250, + "w": 300, + "price": 1, + "dealid": "deal123", + "adomain": [ + "test.com" + ], + "adid": "some-ad-id", + "cid": "test", + "crid": "some-creative-id", + "mtype": 2 + }, + "type": "video" + } + ] + }, + { + "bids": [ + { + "bid": { + "id": "some-bid-id", + "impid": "some-impression-id_2", + "price": 1, + "adm": "
Some creative
", + "adid": "some-ad-id", + "cid": "test", + "iurl": "https://programmaticx.ai/creative.jpg", + "crid": "some-creative-id", + "adomain": [ + "test.com" + ], + "dealid": "deal123", + "w": 240, + "h": 400, + "exp": 60, + "ext": {}, + "mtype": 1 + }, + "type": "banner" + } + ] + } + ], + "expectedMakeBidsErrors": [] +} \ No newline at end of file diff --git a/adapters/programmaticxortb/programmaticxortbtest/exemplary/video.json b/adapters/programmaticxortb/programmaticxortbtest/exemplary/video.json new file mode 100644 index 00000000000..24f198589a5 --- /dev/null +++ b/adapters/programmaticxortb/programmaticxortbtest/exemplary/video.json @@ -0,0 +1,154 @@ +{ + "mockBidRequest": { + "id": "some-request-id", + "site": { + "page": "prebid.org" + }, + "imp": [ + { + "id": "some-impression-id", + "video": { + "mimes": [ + "video/mp4" + ], + "minduration": 1, + "maxduration": 2, + "protocols": [ + 1, + 2, + 5 + ], + "w": 300, + "h": 250, + "startdelay": 1, + "placement": 1, + "playbackmethod": [ + 2 + ], + "api": [ + 1, + 2, + 3, + 4 + ] + }, + "ext": { + "bidder": { + "cId": "test_cid_123" + } + } + } + ], + "tmax": 5000 + }, + "httpCalls": [ + { + "expectedRequest": { + "uri": "https://programmaticx.ai/test_cid_123", + "body": { + "id": "some-request-id", + "site": { + "page": "prebid.org" + }, + "imp": [ + { + "id": "some-impression-id", + "video": { + "mimes": [ + "video/mp4" + ], + "minduration": 1, + "maxduration": 2, + "protocols": [ + 1, + 2, + 5 + ], + "w": 300, + "h": 250, + "startdelay": 1, + "placement": 1, + "playbackmethod": [ + 2 + ], + "api": [ + 1, + 2, + 3, + 4 + ] + }, + "ext": { + "bidder": { + "cId": "test_cid_123" + } + } + } + ], + "tmax": 5000 + }, + "impIDs": [ + "some-impression-id" + ] + }, + "mockResponse": { + "status": 200, + "body": { + "id": "some-request-id", + "cur": "", + "bidid": "some-bid-id", + "seatbid": [ + { + "bid": [ + { + "exp": 60, + "adm": "Some Ad SystemSome Ad Title00:00:02", + "id": "some-bid-id", + "impid": "some-impression-id", + "h": 250, + "w": 300, + "price": 1, + "dealid": "deal123", + "adomain": [ + "test.com" + ], + "adid": "some-ad-id", + "cid": "test", + "crid": "some-creative-id", + "mtype": 2 + } + ] + } + ] + } + } + } + ], + "expectedBidResponses": [ + { + "bids": [ + { + "bid": { + "exp": 60, + "adm": "Some Ad SystemSome Ad Title00:00:02", + "id": "some-bid-id", + "impid": "some-impression-id", + "h": 250, + "w": 300, + "price": 1, + "dealid": "deal123", + "adomain": [ + "test.com" + ], + "adid": "some-ad-id", + "cid": "test", + "crid": "some-creative-id", + "mtype": 2 + }, + "type": "video" + } + ] + } + ], + "expectedMakeBidsErrors": [] +} \ No newline at end of file diff --git a/adapters/programmaticxortb/programmaticxortbtest/supplemental/bad-request.json b/adapters/programmaticxortb/programmaticxortbtest/supplemental/bad-request.json new file mode 100644 index 00000000000..4efa28085dc --- /dev/null +++ b/adapters/programmaticxortb/programmaticxortbtest/supplemental/bad-request.json @@ -0,0 +1,65 @@ +{ + "mockBidRequest": { + "id": "some-request-id", + "site": { + "page": "prebid.org" + }, + "imp": [ + { + "id": "some-impression-id", + "banner": { + "w": 240, + "h": 400 + }, + "ext": { + "bidder": { + "cId": "test_cid_123" + } + } + } + ], + "tmax": 5000 + }, + "httpCalls": [ + { + "expectedRequest": { + "uri": "https://programmaticx.ai/test_cid_123", + "body": { + "id": "some-request-id", + "site": { + "page": "prebid.org" + }, + "imp": [ + { + "id": "some-impression-id", + "banner": { + "w": 240, + "h": 400 + }, + "ext": { + "bidder": { + "cId": "test_cid_123" + } + } + } + ], + "tmax": 5000 + }, + "impIDs": [ + "some-impression-id" + ] + }, + "mockResponse": { + "status": 400, + "body": {} + } + } + ], + "expectedBidResponses": [], + "expectedMakeBidsErrors": [ + { + "value": "Unexpected status code: 400. Run with request.debug = 1 for more info", + "comparison": "literal" + } + ] +} \ No newline at end of file diff --git a/adapters/programmaticxortb/programmaticxortbtest/supplemental/body-unmarshal-fail.json b/adapters/programmaticxortb/programmaticxortbtest/supplemental/body-unmarshal-fail.json new file mode 100644 index 00000000000..e4d113683fa --- /dev/null +++ b/adapters/programmaticxortb/programmaticxortbtest/supplemental/body-unmarshal-fail.json @@ -0,0 +1,65 @@ +{ + "mockBidRequest": { + "id": "some-request-id", + "site": { + "page": "prebid.org" + }, + "imp": [ + { + "id": "some-impression-id", + "banner": { + "w": 240, + "h": 400 + }, + "ext": { + "bidder": { + "cId": "test_cid_123" + } + } + } + ], + "tmax": 5000 + }, + "httpCalls": [ + { + "expectedRequest": { + "uri": "https://programmaticx.ai/test_cid_123", + "body": { + "id": "some-request-id", + "site": { + "page": "prebid.org" + }, + "imp": [ + { + "id": "some-impression-id", + "banner": { + "w": 240, + "h": 400 + }, + "ext": { + "bidder": { + "cId": "test_cid_123" + } + } + } + ], + "tmax": 5000 + }, + "impIDs": [ + "some-impression-id" + ] + }, + "mockResponse": { + "status": 200, + "body": "invalid json response" + } + } + ], + "expectedBidResponses": [], + "expectedMakeBidsErrors": [ + { + "value": "bad server response:", + "comparison": "regex" + } + ] +} \ No newline at end of file diff --git a/adapters/programmaticxortb/programmaticxortbtest/supplemental/internal-error.json b/adapters/programmaticxortb/programmaticxortbtest/supplemental/internal-error.json new file mode 100644 index 00000000000..714adfa3711 --- /dev/null +++ b/adapters/programmaticxortb/programmaticxortbtest/supplemental/internal-error.json @@ -0,0 +1,65 @@ +{ + "mockBidRequest": { + "id": "some-request-id", + "site": { + "page": "prebid.org" + }, + "imp": [ + { + "id": "some-impression-id", + "banner": { + "w": 240, + "h": 400 + }, + "ext": { + "bidder": { + "cId": "test_cid_123" + } + } + } + ], + "tmax": 5000 + }, + "httpCalls": [ + { + "expectedRequest": { + "uri": "https://programmaticx.ai/test_cid_123", + "body": { + "id": "some-request-id", + "site": { + "page": "prebid.org" + }, + "imp": [ + { + "id": "some-impression-id", + "banner": { + "w": 240, + "h": 400 + }, + "ext": { + "bidder": { + "cId": "test_cid_123" + } + } + } + ], + "tmax": 5000 + }, + "impIDs": [ + "some-impression-id" + ] + }, + "mockResponse": { + "status": 500, + "body": {} + } + } + ], + "expectedBidResponses": [], + "expectedMakeBidsErrors": [ + { + "value": "Unexpected status code: 500. Run with request.debug = 1 for more info", + "comparison": "literal" + } + ] +} \ No newline at end of file diff --git a/adapters/programmaticxortb/programmaticxortbtest/supplemental/no-content.json b/adapters/programmaticxortb/programmaticxortbtest/supplemental/no-content.json new file mode 100644 index 00000000000..f6340271e7d --- /dev/null +++ b/adapters/programmaticxortb/programmaticxortbtest/supplemental/no-content.json @@ -0,0 +1,60 @@ +{ + "mockBidRequest": { + "id": "some-request-id", + "site": { + "page": "prebid.org" + }, + "imp": [ + { + "id": "some-impression-id", + "banner": { + "w": 240, + "h": 400 + }, + "ext": { + "bidder": { + "cId": "test_cid_123" + } + } + } + ], + "tmax": 5000 + }, + "httpCalls": [ + { + "expectedRequest": { + "uri": "https://programmaticx.ai/test_cid_123", + "body": { + "id": "some-request-id", + "site": { + "page": "prebid.org" + }, + "imp": [ + { + "id": "some-impression-id", + "banner": { + "w": 240, + "h": 400 + }, + "ext": { + "bidder": { + "cId": "test_cid_123" + } + } + } + ], + "tmax": 5000 + }, + "impIDs": [ + "some-impression-id" + ] + }, + "mockResponse": { + "status": 204, + "body": {} + } + } + ], + "expectedBidResponses": [], + "expectedMakeBidsErrors": [] +} \ No newline at end of file diff --git a/adapters/programmaticxortb/programmaticxortbtest/supplemental/unknown-bid-type.json b/adapters/programmaticxortb/programmaticxortbtest/supplemental/unknown-bid-type.json new file mode 100644 index 00000000000..bc5bf4b1d9e --- /dev/null +++ b/adapters/programmaticxortb/programmaticxortbtest/supplemental/unknown-bid-type.json @@ -0,0 +1,109 @@ +{ + "mockBidRequest": { + "id": "some-request-id", + "site": { + "page": "prebid.org" + }, + "imp": [ + { + "id": "some-impression-id", + "banner": { + "w": 240, + "h": 400 + }, + "ext": { + "bidder": { + "cId": "test_cid_123" + } + } + } + ], + "tmax": 5000 + }, + "httpCalls": [ + { + "expectedRequest": { + "uri": "https://programmaticx.ai/test_cid_123", + "body": { + "id": "some-request-id", + "site": { + "page": "prebid.org" + }, + "imp": [ + { + "id": "some-impression-id", + "banner": { + "w": 240, + "h": 400 + }, + "ext": { + "bidder": { + "cId": "test_cid_123" + } + } + } + ], + "tmax": 5000 + }, + "impIDs": [ + "some-impression-id" + ] + }, + "mockResponse": { + "status": 200, + "body": { + "id": "some-request-id", + "cur": "", + "bidid": "some-bid-id", + "seatbid": [ + { + "bid": [ + { + "exp": 60, + "adm": "
Some creative
", + "burl": "", + "iurl": "https://programmaticx.ai/creative.jpg", + "lurl": "", + "nurl": "", + "id": "some-bid-id", + "impid": "some-impression-id", + "h": 400, + "w": 240, + "price": 1, + "dealid": "deal123", + "adomain": [ + "test.com" + ], + "adid": "some-ad-id", + "cid": "test", + "attr": [], + "cat": [], + "crid": "some-creative-id", + "ext": {}, + "hratio": 0, + "language": "", + "protocol": 0, + "qagmediarating": 0, + "tactic": "", + "wratio": 0, + "mtype": 8 + } + ] + } + ] + } + } + } + ], + "expectedBidResponses": [ + { + "bids": [] + } + ], + "expectedMakeBidsErrors": [ + { + "value": "Could not define bid type for imp: some-impression-id", + "comparison": "literal" + } + ] +} \ No newline at end of file diff --git a/exchange/adapter_builders.go b/exchange/adapter_builders.go index ba0ff57d4a9..40e1d52d6e3 100755 --- a/exchange/adapter_builders.go +++ b/exchange/adapter_builders.go @@ -177,6 +177,7 @@ import ( "github.com/prebid/prebid-server/v3/adapters/pangle" "github.com/prebid/prebid-server/v3/adapters/pgamssp" "github.com/prebid/prebid-server/v3/adapters/playdigo" + "github.com/prebid/prebid-server/v3/adapters/programmaticxortb" "github.com/prebid/prebid-server/v3/adapters/pubmatic" "github.com/prebid/prebid-server/v3/adapters/pubnative" "github.com/prebid/prebid-server/v3/adapters/pubrise" @@ -436,6 +437,7 @@ func newAdapterBuilders() map[openrtb_ext.BidderName]adapters.Builder { openrtb_ext.BidderPangle: pangle.Builder, openrtb_ext.BidderPGAMSsp: pgamssp.Builder, openrtb_ext.BidderPlaydigo: playdigo.Builder, + openrtb_ext.BidderProgrammaticxOrtb: programmaticxortb.Builder, openrtb_ext.BidderPubmatic: pubmatic.Builder, openrtb_ext.BidderPubnative: pubnative.Builder, openrtb_ext.BidderPubrise: pubrise.Builder, diff --git a/openrtb_ext/bidders.go b/openrtb_ext/bidders.go index f43a63a85c3..2a7e16309aa 100644 --- a/openrtb_ext/bidders.go +++ b/openrtb_ext/bidders.go @@ -195,6 +195,7 @@ var coreBidderNames []BidderName = []BidderName{ BidderPangle, BidderPGAMSsp, BidderPlaydigo, + BidderProgrammaticxOrtb, BidderPubmatic, BidderPubrise, BidderPubnative, @@ -558,6 +559,7 @@ const ( BidderPangle BidderName = "pangle" BidderPGAMSsp BidderName = "pgamssp" BidderPlaydigo BidderName = "playdigo" + BidderProgrammaticxOrtb BidderName = "programmaticxortb" BidderPubmatic BidderName = "pubmatic" BidderPubrise BidderName = "pubrise" BidderPubnative BidderName = "pubnative" diff --git a/openrtb_ext/imp_programmaticxortb.go b/openrtb_ext/imp_programmaticxortb.go new file mode 100644 index 00000000000..6628285cc56 --- /dev/null +++ b/openrtb_ext/imp_programmaticxortb.go @@ -0,0 +1,6 @@ +package openrtb_ext + +// ImpExtProgrammaticxOrtb defines the contract for bidrequest.imp[i].ext.prebid.bidder.programmaticx +type ImpExtProgrammaticxOrtb struct { + ConnectionId string `json:"cId"` +} diff --git a/static/bidder-info/programmaticxortb.yaml b/static/bidder-info/programmaticxortb.yaml new file mode 100644 index 00000000000..bf24846f88e --- /dev/null +++ b/static/bidder-info/programmaticxortb.yaml @@ -0,0 +1,20 @@ +endpoint: "https://exchange.programmaticx.ai/openrtb/" +maintainer: + email: "pxteam@programmaticx.ai" +endpointCompression: gzip +capabilities: + app: + mediaTypes: + - banner + - video + site: + mediaTypes: + - banner + - video +userSync: + iframe: + url: https://sync.programmaticx.ai/api/user/html/6819bdc3e6bb44545c55f843?pbs=true&gdpr={{.GDPR}}&gdpr_consent={{.GDPRConsent}}&us_privacy={{.USPrivacy}}&redirect={{.RedirectURL}}&gpp={{.GPP}}&gpp_sid={{.GPPSID}} + userMacro: ${userId} +openrtb: + gpp_supported: true + version: 2.6 \ No newline at end of file diff --git a/static/bidder-params/programmaticxortb.json b/static/bidder-params/programmaticxortb.json new file mode 100644 index 00000000000..3a46d1dca9a --- /dev/null +++ b/static/bidder-params/programmaticxortb.json @@ -0,0 +1,18 @@ +{ + "$schema": "http://json-schema.org/draft-04/schema#", + "title": "Programmaticx Adapter Params", + "description": "A schema which validates params accepted by the Programmaticx adapter", + "type": "object", + "properties": { + "cId": { + "type": "string", + "description": "The connection id.", + "minLength": 1, + "pattern": "^[a-zA-Z0-9_]+$" + } + }, + "required": [ + "cId" + ], + "additionalProperties": false +} \ No newline at end of file From 9ce9aa633146b2e3d652368c818e6955c75d03ac Mon Sep 17 00:00:00 2001 From: anna-y-perion Date: Wed, 9 Jul 2025 18:07:58 +0300 Subject: [PATCH 2/6] fixing sync id --- static/bidder-info/programmaticxortb.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/static/bidder-info/programmaticxortb.yaml b/static/bidder-info/programmaticxortb.yaml index bf24846f88e..ac61011feb5 100644 --- a/static/bidder-info/programmaticxortb.yaml +++ b/static/bidder-info/programmaticxortb.yaml @@ -13,7 +13,7 @@ capabilities: - video userSync: iframe: - url: https://sync.programmaticx.ai/api/user/html/6819bdc3e6bb44545c55f843?pbs=true&gdpr={{.GDPR}}&gdpr_consent={{.GDPRConsent}}&us_privacy={{.USPrivacy}}&redirect={{.RedirectURL}}&gpp={{.GPP}}&gpp_sid={{.GPPSID}} + url: https://sync.programmaticx.ai/api/user/html/685297194d85991a5e6e36dd?pbs=true&gdpr={{.GDPR}}&gdpr_consent={{.GDPRConsent}}&us_privacy={{.USPrivacy}}&redirect={{.RedirectURL}}&gpp={{.GPP}}&gpp_sid={{.GPPSID}} userMacro: ${userId} openrtb: gpp_supported: true From 36c2597df16ef6950eea75ccbf0223f0f3067219 Mon Sep 17 00:00:00 2001 From: anna-y-perion Date: Tue, 15 Jul 2025 18:27:43 +0300 Subject: [PATCH 3/6] adapter change --- adapters/{programmaticxortb => px}/params_test.go | 6 +++--- .../{programmaticxortb/programmaticxortb.go => px/px.go} | 8 ++++---- .../programmaticxortb_test.go => px/px_test.go} | 6 +++--- .../pxtest}/exemplary/banner.json | 0 .../pxtest}/exemplary/multi-imp.json | 0 .../pxtest}/exemplary/video.json | 0 .../pxtest}/supplemental/bad-request.json | 0 .../pxtest}/supplemental/body-unmarshal-fail.json | 0 .../pxtest}/supplemental/internal-error.json | 0 .../pxtest}/supplemental/no-content.json | 0 .../pxtest}/supplemental/unknown-bid-type.json | 0 exchange/adapter_builders.go | 4 ++-- openrtb_ext/bidders.go | 4 ++-- openrtb_ext/imp_programmaticxortb.go | 6 ------ openrtb_ext/imp_px.go | 6 ++++++ static/bidder-info/{programmaticxortb.yaml => px.yaml} | 0 static/bidder-params/{programmaticxortb.json => px.json} | 4 ++-- 17 files changed, 22 insertions(+), 22 deletions(-) rename adapters/{programmaticxortb => px}/params_test.go (80%) rename adapters/{programmaticxortb/programmaticxortb.go => px/px.go} (93%) rename adapters/{programmaticxortb/programmaticxortb_test.go => px/px_test.go} (71%) rename adapters/{programmaticxortb/programmaticxortbtest => px/pxtest}/exemplary/banner.json (100%) rename adapters/{programmaticxortb/programmaticxortbtest => px/pxtest}/exemplary/multi-imp.json (100%) rename adapters/{programmaticxortb/programmaticxortbtest => px/pxtest}/exemplary/video.json (100%) rename adapters/{programmaticxortb/programmaticxortbtest => px/pxtest}/supplemental/bad-request.json (100%) rename adapters/{programmaticxortb/programmaticxortbtest => px/pxtest}/supplemental/body-unmarshal-fail.json (100%) rename adapters/{programmaticxortb/programmaticxortbtest => px/pxtest}/supplemental/internal-error.json (100%) rename adapters/{programmaticxortb/programmaticxortbtest => px/pxtest}/supplemental/no-content.json (100%) rename adapters/{programmaticxortb/programmaticxortbtest => px/pxtest}/supplemental/unknown-bid-type.json (100%) delete mode 100644 openrtb_ext/imp_programmaticxortb.go create mode 100644 openrtb_ext/imp_px.go rename static/bidder-info/{programmaticxortb.yaml => px.yaml} (100%) rename static/bidder-params/{programmaticxortb.json => px.json} (84%) diff --git a/adapters/programmaticxortb/params_test.go b/adapters/px/params_test.go similarity index 80% rename from adapters/programmaticxortb/params_test.go rename to adapters/px/params_test.go index 7bcc980b448..a778590e9f0 100644 --- a/adapters/programmaticxortb/params_test.go +++ b/adapters/px/params_test.go @@ -1,4 +1,4 @@ -package programmaticxortb +package px import ( "encoding/json" @@ -14,7 +14,7 @@ func TestValidParams(t *testing.T) { } for _, validParam := range validParams { - if err := validator.Validate(openrtb_ext.BidderProgrammaticxOrtb, json.RawMessage(validParam)); err != nil { + if err := validator.Validate(openrtb_ext.BidderPx, json.RawMessage(validParam)); err != nil { t.Errorf("Schema rejected valid params: %s", validParam) } } @@ -27,7 +27,7 @@ func TestInvalidParams(t *testing.T) { } for _, p := range invalidParams { - if err := validator.Validate(openrtb_ext.BidderProgrammaticxOrtb, json.RawMessage(p)); err == nil { + if err := validator.Validate(openrtb_ext.BidderPx, json.RawMessage(p)); err == nil { t.Errorf("Schema allowed invalid params: %s", p) } } diff --git a/adapters/programmaticxortb/programmaticxortb.go b/adapters/px/px.go similarity index 93% rename from adapters/programmaticxortb/programmaticxortb.go rename to adapters/px/px.go index 2c6c29cf574..170e88fe6fa 100644 --- a/adapters/programmaticxortb/programmaticxortb.go +++ b/adapters/px/px.go @@ -1,4 +1,4 @@ -package programmaticxortb +package px import ( "encoding/json" @@ -18,7 +18,7 @@ type adapter struct { endpoint string } -// Builder builds a new instance of the programmaticx for the given bidder with the given config. +// Builder builds a new instance of the px for the given bidder with the given config. func Builder(bidderName openrtb_ext.BidderName, config config.Adapter, server config.Server) (adapters.Bidder, error) { bidder := &adapter{ endpoint: config.Endpoint, @@ -111,9 +111,9 @@ func extractCid(imp *openrtb2.Imp) (string, error) { return "", fmt.Errorf("unmarshal bidderExt: %w", err) } - var impExt openrtb_ext.ImpExtProgrammaticxOrtb + var impExt openrtb_ext.ImpExtPx if err := jsonutil.Unmarshal(bidderExt.Bidder, &impExt); err != nil { - return "", fmt.Errorf("unmarshal ImpExtProgrammaticxOrtb: %w", err) + return "", fmt.Errorf("unmarshal ImpExtPx: %w", err) } return impExt.ConnectionId, nil } diff --git a/adapters/programmaticxortb/programmaticxortb_test.go b/adapters/px/px_test.go similarity index 71% rename from adapters/programmaticxortb/programmaticxortb_test.go rename to adapters/px/px_test.go index df79688a1c3..9eb7ecfcb05 100644 --- a/adapters/programmaticxortb/programmaticxortb_test.go +++ b/adapters/px/px_test.go @@ -1,4 +1,4 @@ -package programmaticxortb +package px import ( "testing" @@ -9,7 +9,7 @@ import ( ) func TestJsonSamples(t *testing.T) { - bidder, buildErr := Builder(openrtb_ext.BidderProgrammaticxOrtb, config.Adapter{ + bidder, buildErr := Builder(openrtb_ext.BidderPx, config.Adapter{ Endpoint: "https://programmaticx.ai/", }, config.Server{ @@ -20,5 +20,5 @@ func TestJsonSamples(t *testing.T) { t.Fatalf("Builder returned unexpected error %v", buildErr) } - adapterstest.RunJSONBidderTest(t, "programmaticxortbtest", bidder) + adapterstest.RunJSONBidderTest(t, "pxtest", bidder) } diff --git a/adapters/programmaticxortb/programmaticxortbtest/exemplary/banner.json b/adapters/px/pxtest/exemplary/banner.json similarity index 100% rename from adapters/programmaticxortb/programmaticxortbtest/exemplary/banner.json rename to adapters/px/pxtest/exemplary/banner.json diff --git a/adapters/programmaticxortb/programmaticxortbtest/exemplary/multi-imp.json b/adapters/px/pxtest/exemplary/multi-imp.json similarity index 100% rename from adapters/programmaticxortb/programmaticxortbtest/exemplary/multi-imp.json rename to adapters/px/pxtest/exemplary/multi-imp.json diff --git a/adapters/programmaticxortb/programmaticxortbtest/exemplary/video.json b/adapters/px/pxtest/exemplary/video.json similarity index 100% rename from adapters/programmaticxortb/programmaticxortbtest/exemplary/video.json rename to adapters/px/pxtest/exemplary/video.json diff --git a/adapters/programmaticxortb/programmaticxortbtest/supplemental/bad-request.json b/adapters/px/pxtest/supplemental/bad-request.json similarity index 100% rename from adapters/programmaticxortb/programmaticxortbtest/supplemental/bad-request.json rename to adapters/px/pxtest/supplemental/bad-request.json diff --git a/adapters/programmaticxortb/programmaticxortbtest/supplemental/body-unmarshal-fail.json b/adapters/px/pxtest/supplemental/body-unmarshal-fail.json similarity index 100% rename from adapters/programmaticxortb/programmaticxortbtest/supplemental/body-unmarshal-fail.json rename to adapters/px/pxtest/supplemental/body-unmarshal-fail.json diff --git a/adapters/programmaticxortb/programmaticxortbtest/supplemental/internal-error.json b/adapters/px/pxtest/supplemental/internal-error.json similarity index 100% rename from adapters/programmaticxortb/programmaticxortbtest/supplemental/internal-error.json rename to adapters/px/pxtest/supplemental/internal-error.json diff --git a/adapters/programmaticxortb/programmaticxortbtest/supplemental/no-content.json b/adapters/px/pxtest/supplemental/no-content.json similarity index 100% rename from adapters/programmaticxortb/programmaticxortbtest/supplemental/no-content.json rename to adapters/px/pxtest/supplemental/no-content.json diff --git a/adapters/programmaticxortb/programmaticxortbtest/supplemental/unknown-bid-type.json b/adapters/px/pxtest/supplemental/unknown-bid-type.json similarity index 100% rename from adapters/programmaticxortb/programmaticxortbtest/supplemental/unknown-bid-type.json rename to adapters/px/pxtest/supplemental/unknown-bid-type.json diff --git a/exchange/adapter_builders.go b/exchange/adapter_builders.go index 40e1d52d6e3..8567efeed43 100755 --- a/exchange/adapter_builders.go +++ b/exchange/adapter_builders.go @@ -177,12 +177,12 @@ import ( "github.com/prebid/prebid-server/v3/adapters/pangle" "github.com/prebid/prebid-server/v3/adapters/pgamssp" "github.com/prebid/prebid-server/v3/adapters/playdigo" - "github.com/prebid/prebid-server/v3/adapters/programmaticxortb" "github.com/prebid/prebid-server/v3/adapters/pubmatic" "github.com/prebid/prebid-server/v3/adapters/pubnative" "github.com/prebid/prebid-server/v3/adapters/pubrise" "github.com/prebid/prebid-server/v3/adapters/pulsepoint" "github.com/prebid/prebid-server/v3/adapters/pwbid" + "github.com/prebid/prebid-server/v3/adapters/px" "github.com/prebid/prebid-server/v3/adapters/qt" "github.com/prebid/prebid-server/v3/adapters/readpeak" "github.com/prebid/prebid-server/v3/adapters/relevantdigital" @@ -437,7 +437,7 @@ func newAdapterBuilders() map[openrtb_ext.BidderName]adapters.Builder { openrtb_ext.BidderPangle: pangle.Builder, openrtb_ext.BidderPGAMSsp: pgamssp.Builder, openrtb_ext.BidderPlaydigo: playdigo.Builder, - openrtb_ext.BidderProgrammaticxOrtb: programmaticxortb.Builder, + openrtb_ext.BidderPx: px.Builder, openrtb_ext.BidderPubmatic: pubmatic.Builder, openrtb_ext.BidderPubnative: pubnative.Builder, openrtb_ext.BidderPubrise: pubrise.Builder, diff --git a/openrtb_ext/bidders.go b/openrtb_ext/bidders.go index 2a7e16309aa..a334f25e291 100644 --- a/openrtb_ext/bidders.go +++ b/openrtb_ext/bidders.go @@ -195,7 +195,7 @@ var coreBidderNames []BidderName = []BidderName{ BidderPangle, BidderPGAMSsp, BidderPlaydigo, - BidderProgrammaticxOrtb, + BidderPx, BidderPubmatic, BidderPubrise, BidderPubnative, @@ -559,7 +559,7 @@ const ( BidderPangle BidderName = "pangle" BidderPGAMSsp BidderName = "pgamssp" BidderPlaydigo BidderName = "playdigo" - BidderProgrammaticxOrtb BidderName = "programmaticxortb" + BidderPx BidderName = "px" BidderPubmatic BidderName = "pubmatic" BidderPubrise BidderName = "pubrise" BidderPubnative BidderName = "pubnative" diff --git a/openrtb_ext/imp_programmaticxortb.go b/openrtb_ext/imp_programmaticxortb.go deleted file mode 100644 index 6628285cc56..00000000000 --- a/openrtb_ext/imp_programmaticxortb.go +++ /dev/null @@ -1,6 +0,0 @@ -package openrtb_ext - -// ImpExtProgrammaticxOrtb defines the contract for bidrequest.imp[i].ext.prebid.bidder.programmaticx -type ImpExtProgrammaticxOrtb struct { - ConnectionId string `json:"cId"` -} diff --git a/openrtb_ext/imp_px.go b/openrtb_ext/imp_px.go new file mode 100644 index 00000000000..aec5def5eea --- /dev/null +++ b/openrtb_ext/imp_px.go @@ -0,0 +1,6 @@ +package openrtb_ext + +// ImpExtPx defines the contract for bidrequest.imp[i].ext.prebid.bidder.px +type ImpExtPx struct { + ConnectionId string `json:"cId"` +} diff --git a/static/bidder-info/programmaticxortb.yaml b/static/bidder-info/px.yaml similarity index 100% rename from static/bidder-info/programmaticxortb.yaml rename to static/bidder-info/px.yaml diff --git a/static/bidder-params/programmaticxortb.json b/static/bidder-params/px.json similarity index 84% rename from static/bidder-params/programmaticxortb.json rename to static/bidder-params/px.json index 3a46d1dca9a..0fb8a3adb37 100644 --- a/static/bidder-params/programmaticxortb.json +++ b/static/bidder-params/px.json @@ -1,7 +1,7 @@ { "$schema": "http://json-schema.org/draft-04/schema#", - "title": "Programmaticx Adapter Params", - "description": "A schema which validates params accepted by the Programmaticx adapter", + "title": "PX Adapter Params", + "description": "A schema which validates params accepted by the PX adapter", "type": "object", "properties": { "cId": { From 3134da29f51b15588751d444f366b3412b70a961 Mon Sep 17 00:00:00 2001 From: anna-y-perion Date: Wed, 16 Jul 2025 08:46:19 +0300 Subject: [PATCH 4/6] adapter change --- adapters/{px => progx}/params_test.go | 6 +++--- adapters/{px/px.go => progx/progx.go} | 8 ++++---- adapters/{px/px_test.go => progx/progx_test.go} | 6 +++--- .../{px/pxtest => progx/progxtest}/exemplary/banner.json | 0 .../pxtest => progx/progxtest}/exemplary/multi-imp.json | 0 .../{px/pxtest => progx/progxtest}/exemplary/video.json | 0 .../progxtest}/supplemental/bad-request.json | 0 .../progxtest}/supplemental/body-unmarshal-fail.json | 0 .../progxtest}/supplemental/internal-error.json | 0 .../progxtest}/supplemental/no-content.json | 0 .../progxtest}/supplemental/unknown-bid-type.json | 0 exchange/adapter_builders.go | 4 ++-- openrtb_ext/bidders.go | 4 ++-- openrtb_ext/imp_progx.go | 6 ++++++ openrtb_ext/imp_px.go | 6 ------ static/bidder-info/{px.yaml => progx.yaml} | 0 static/bidder-params/{px.json => progx.json} | 4 ++-- 17 files changed, 22 insertions(+), 22 deletions(-) rename adapters/{px => progx}/params_test.go (83%) rename adapters/{px/px.go => progx/progx.go} (94%) rename adapters/{px/px_test.go => progx/progx_test.go} (75%) rename adapters/{px/pxtest => progx/progxtest}/exemplary/banner.json (100%) rename adapters/{px/pxtest => progx/progxtest}/exemplary/multi-imp.json (100%) rename adapters/{px/pxtest => progx/progxtest}/exemplary/video.json (100%) rename adapters/{px/pxtest => progx/progxtest}/supplemental/bad-request.json (100%) rename adapters/{px/pxtest => progx/progxtest}/supplemental/body-unmarshal-fail.json (100%) rename adapters/{px/pxtest => progx/progxtest}/supplemental/internal-error.json (100%) rename adapters/{px/pxtest => progx/progxtest}/supplemental/no-content.json (100%) rename adapters/{px/pxtest => progx/progxtest}/supplemental/unknown-bid-type.json (100%) create mode 100644 openrtb_ext/imp_progx.go delete mode 100644 openrtb_ext/imp_px.go rename static/bidder-info/{px.yaml => progx.yaml} (100%) rename static/bidder-params/{px.json => progx.json} (87%) diff --git a/adapters/px/params_test.go b/adapters/progx/params_test.go similarity index 83% rename from adapters/px/params_test.go rename to adapters/progx/params_test.go index a778590e9f0..8b31c80fb15 100644 --- a/adapters/px/params_test.go +++ b/adapters/progx/params_test.go @@ -1,4 +1,4 @@ -package px +package progx import ( "encoding/json" @@ -14,7 +14,7 @@ func TestValidParams(t *testing.T) { } for _, validParam := range validParams { - if err := validator.Validate(openrtb_ext.BidderPx, json.RawMessage(validParam)); err != nil { + if err := validator.Validate(openrtb_ext.BidderProgX, json.RawMessage(validParam)); err != nil { t.Errorf("Schema rejected valid params: %s", validParam) } } @@ -27,7 +27,7 @@ func TestInvalidParams(t *testing.T) { } for _, p := range invalidParams { - if err := validator.Validate(openrtb_ext.BidderPx, json.RawMessage(p)); err == nil { + if err := validator.Validate(openrtb_ext.BidderProgX, json.RawMessage(p)); err == nil { t.Errorf("Schema allowed invalid params: %s", p) } } diff --git a/adapters/px/px.go b/adapters/progx/progx.go similarity index 94% rename from adapters/px/px.go rename to adapters/progx/progx.go index 170e88fe6fa..636d716a2e2 100644 --- a/adapters/px/px.go +++ b/adapters/progx/progx.go @@ -1,4 +1,4 @@ -package px +package progx import ( "encoding/json" @@ -18,7 +18,7 @@ type adapter struct { endpoint string } -// Builder builds a new instance of the px for the given bidder with the given config. +// Builder builds a new instance of the progx for the given bidder with the given config. func Builder(bidderName openrtb_ext.BidderName, config config.Adapter, server config.Server) (adapters.Bidder, error) { bidder := &adapter{ endpoint: config.Endpoint, @@ -111,9 +111,9 @@ func extractCid(imp *openrtb2.Imp) (string, error) { return "", fmt.Errorf("unmarshal bidderExt: %w", err) } - var impExt openrtb_ext.ImpExtPx + var impExt openrtb_ext.ImpExtProgX if err := jsonutil.Unmarshal(bidderExt.Bidder, &impExt); err != nil { - return "", fmt.Errorf("unmarshal ImpExtPx: %w", err) + return "", fmt.Errorf("unmarshal ImpExtProgX: %w", err) } return impExt.ConnectionId, nil } diff --git a/adapters/px/px_test.go b/adapters/progx/progx_test.go similarity index 75% rename from adapters/px/px_test.go rename to adapters/progx/progx_test.go index 9eb7ecfcb05..8053d9e787f 100644 --- a/adapters/px/px_test.go +++ b/adapters/progx/progx_test.go @@ -1,4 +1,4 @@ -package px +package progx import ( "testing" @@ -9,7 +9,7 @@ import ( ) func TestJsonSamples(t *testing.T) { - bidder, buildErr := Builder(openrtb_ext.BidderPx, config.Adapter{ + bidder, buildErr := Builder(openrtb_ext.BidderProgX, config.Adapter{ Endpoint: "https://programmaticx.ai/", }, config.Server{ @@ -20,5 +20,5 @@ func TestJsonSamples(t *testing.T) { t.Fatalf("Builder returned unexpected error %v", buildErr) } - adapterstest.RunJSONBidderTest(t, "pxtest", bidder) + adapterstest.RunJSONBidderTest(t, "progxtest", bidder) } diff --git a/adapters/px/pxtest/exemplary/banner.json b/adapters/progx/progxtest/exemplary/banner.json similarity index 100% rename from adapters/px/pxtest/exemplary/banner.json rename to adapters/progx/progxtest/exemplary/banner.json diff --git a/adapters/px/pxtest/exemplary/multi-imp.json b/adapters/progx/progxtest/exemplary/multi-imp.json similarity index 100% rename from adapters/px/pxtest/exemplary/multi-imp.json rename to adapters/progx/progxtest/exemplary/multi-imp.json diff --git a/adapters/px/pxtest/exemplary/video.json b/adapters/progx/progxtest/exemplary/video.json similarity index 100% rename from adapters/px/pxtest/exemplary/video.json rename to adapters/progx/progxtest/exemplary/video.json diff --git a/adapters/px/pxtest/supplemental/bad-request.json b/adapters/progx/progxtest/supplemental/bad-request.json similarity index 100% rename from adapters/px/pxtest/supplemental/bad-request.json rename to adapters/progx/progxtest/supplemental/bad-request.json diff --git a/adapters/px/pxtest/supplemental/body-unmarshal-fail.json b/adapters/progx/progxtest/supplemental/body-unmarshal-fail.json similarity index 100% rename from adapters/px/pxtest/supplemental/body-unmarshal-fail.json rename to adapters/progx/progxtest/supplemental/body-unmarshal-fail.json diff --git a/adapters/px/pxtest/supplemental/internal-error.json b/adapters/progx/progxtest/supplemental/internal-error.json similarity index 100% rename from adapters/px/pxtest/supplemental/internal-error.json rename to adapters/progx/progxtest/supplemental/internal-error.json diff --git a/adapters/px/pxtest/supplemental/no-content.json b/adapters/progx/progxtest/supplemental/no-content.json similarity index 100% rename from adapters/px/pxtest/supplemental/no-content.json rename to adapters/progx/progxtest/supplemental/no-content.json diff --git a/adapters/px/pxtest/supplemental/unknown-bid-type.json b/adapters/progx/progxtest/supplemental/unknown-bid-type.json similarity index 100% rename from adapters/px/pxtest/supplemental/unknown-bid-type.json rename to adapters/progx/progxtest/supplemental/unknown-bid-type.json diff --git a/exchange/adapter_builders.go b/exchange/adapter_builders.go index b5c6e0cf030..baf9471efa0 100755 --- a/exchange/adapter_builders.go +++ b/exchange/adapter_builders.go @@ -178,12 +178,12 @@ import ( "github.com/prebid/prebid-server/v3/adapters/pangle" "github.com/prebid/prebid-server/v3/adapters/pgamssp" "github.com/prebid/prebid-server/v3/adapters/playdigo" + "github.com/prebid/prebid-server/v3/adapters/progx" "github.com/prebid/prebid-server/v3/adapters/pubmatic" "github.com/prebid/prebid-server/v3/adapters/pubnative" "github.com/prebid/prebid-server/v3/adapters/pubrise" "github.com/prebid/prebid-server/v3/adapters/pulsepoint" "github.com/prebid/prebid-server/v3/adapters/pwbid" - "github.com/prebid/prebid-server/v3/adapters/px" "github.com/prebid/prebid-server/v3/adapters/qt" "github.com/prebid/prebid-server/v3/adapters/readpeak" "github.com/prebid/prebid-server/v3/adapters/rediads" @@ -441,7 +441,7 @@ func newAdapterBuilders() map[openrtb_ext.BidderName]adapters.Builder { openrtb_ext.BidderPangle: pangle.Builder, openrtb_ext.BidderPGAMSsp: pgamssp.Builder, openrtb_ext.BidderPlaydigo: playdigo.Builder, - openrtb_ext.BidderPx: px.Builder, + openrtb_ext.BidderProgX: progx.Builder, openrtb_ext.BidderPubmatic: pubmatic.Builder, openrtb_ext.BidderPubnative: pubnative.Builder, openrtb_ext.BidderPubrise: pubrise.Builder, diff --git a/openrtb_ext/bidders.go b/openrtb_ext/bidders.go index 72ddfa6c26d..da7ddfecb1a 100644 --- a/openrtb_ext/bidders.go +++ b/openrtb_ext/bidders.go @@ -196,7 +196,7 @@ var coreBidderNames []BidderName = []BidderName{ BidderPangle, BidderPGAMSsp, BidderPlaydigo, - BidderPx, + BidderProgX, BidderPubmatic, BidderPubrise, BidderPubnative, @@ -563,7 +563,7 @@ const ( BidderPangle BidderName = "pangle" BidderPGAMSsp BidderName = "pgamssp" BidderPlaydigo BidderName = "playdigo" - BidderPx BidderName = "px" + BidderProgX BidderName = "progx" BidderPubmatic BidderName = "pubmatic" BidderPubrise BidderName = "pubrise" BidderPubnative BidderName = "pubnative" diff --git a/openrtb_ext/imp_progx.go b/openrtb_ext/imp_progx.go new file mode 100644 index 00000000000..065b8c92d86 --- /dev/null +++ b/openrtb_ext/imp_progx.go @@ -0,0 +1,6 @@ +package openrtb_ext + +// ImpExtProgx defines the contract for bidrequest.imp[i].ext.prebid.bidder.progx +type ImpExtProgX struct { + ConnectionId string `json:"cId"` +} diff --git a/openrtb_ext/imp_px.go b/openrtb_ext/imp_px.go deleted file mode 100644 index aec5def5eea..00000000000 --- a/openrtb_ext/imp_px.go +++ /dev/null @@ -1,6 +0,0 @@ -package openrtb_ext - -// ImpExtPx defines the contract for bidrequest.imp[i].ext.prebid.bidder.px -type ImpExtPx struct { - ConnectionId string `json:"cId"` -} diff --git a/static/bidder-info/px.yaml b/static/bidder-info/progx.yaml similarity index 100% rename from static/bidder-info/px.yaml rename to static/bidder-info/progx.yaml diff --git a/static/bidder-params/px.json b/static/bidder-params/progx.json similarity index 87% rename from static/bidder-params/px.json rename to static/bidder-params/progx.json index 0fb8a3adb37..deafddecd2e 100644 --- a/static/bidder-params/px.json +++ b/static/bidder-params/progx.json @@ -1,7 +1,7 @@ { "$schema": "http://json-schema.org/draft-04/schema#", - "title": "PX Adapter Params", - "description": "A schema which validates params accepted by the PX adapter", + "title": "Progx Adapter Params", + "description": "A schema which validates params accepted by the Progx adapter", "type": "object", "properties": { "cId": { From 62afd39a0da8f751b151d249759744f141ed2a2f Mon Sep 17 00:00:00 2001 From: anna-y-perion Date: Tue, 22 Jul 2025 14:48:47 +0300 Subject: [PATCH 5/6] New Adapter: adding alias adapter --- adapters/progx/params_test.go | 50 ---- adapters/progx/progx.go | 131 --------- adapters/progx/progx_test.go | 24 -- .../progx/progxtest/exemplary/banner.json | 127 --------- .../progx/progxtest/exemplary/multi-imp.json | 265 ------------------ adapters/progx/progxtest/exemplary/video.json | 154 ---------- .../progxtest/supplemental/bad-request.json | 65 ----- .../supplemental/body-unmarshal-fail.json | 65 ----- .../supplemental/internal-error.json | 65 ----- .../progxtest/supplemental/no-content.json | 60 ---- .../supplemental/unknown-bid-type.json | 109 ------- exchange/adapter_builders.go | 2 - openrtb_ext/bidders.go | 2 - openrtb_ext/imp_progx.go | 6 - static/bidder-info/progx.yaml | 15 +- static/bidder-params/progx.json | 18 -- 16 files changed, 3 insertions(+), 1155 deletions(-) delete mode 100644 adapters/progx/params_test.go delete mode 100644 adapters/progx/progx.go delete mode 100644 adapters/progx/progx_test.go delete mode 100644 adapters/progx/progxtest/exemplary/banner.json delete mode 100644 adapters/progx/progxtest/exemplary/multi-imp.json delete mode 100644 adapters/progx/progxtest/exemplary/video.json delete mode 100644 adapters/progx/progxtest/supplemental/bad-request.json delete mode 100644 adapters/progx/progxtest/supplemental/body-unmarshal-fail.json delete mode 100644 adapters/progx/progxtest/supplemental/internal-error.json delete mode 100644 adapters/progx/progxtest/supplemental/no-content.json delete mode 100644 adapters/progx/progxtest/supplemental/unknown-bid-type.json delete mode 100644 openrtb_ext/imp_progx.go delete mode 100644 static/bidder-params/progx.json diff --git a/adapters/progx/params_test.go b/adapters/progx/params_test.go deleted file mode 100644 index 8b31c80fb15..00000000000 --- a/adapters/progx/params_test.go +++ /dev/null @@ -1,50 +0,0 @@ -package progx - -import ( - "encoding/json" - "testing" - - "github.com/prebid/prebid-server/v3/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 schema. %v", err) - } - - for _, validParam := range validParams { - if err := validator.Validate(openrtb_ext.BidderProgX, json.RawMessage(validParam)); err != nil { - t.Errorf("Schema rejected valid 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 schema. %v", err) - } - - for _, p := range invalidParams { - if err := validator.Validate(openrtb_ext.BidderProgX, json.RawMessage(p)); err == nil { - t.Errorf("Schema allowed invalid params: %s", p) - } - } -} - -var validParams = []string{ - `{"cId": "provided_cid_123"}`, -} - -var invalidParams = []string{ - `{"cId": 123}`, - `{"cId": true}`, - `{"cId": ["array"]}`, - `{"cId": {}`, - `{"cId": ""}`, - `{"cId": null}`, - `{"cId": "provided_cid_123", "extra": "field"}`, - `{"cid": "valid_cid"}`, - `{"cId": "invalid_chars_!@#$%^&*()"}`, -} diff --git a/adapters/progx/progx.go b/adapters/progx/progx.go deleted file mode 100644 index 636d716a2e2..00000000000 --- a/adapters/progx/progx.go +++ /dev/null @@ -1,131 +0,0 @@ -package progx - -import ( - "encoding/json" - "fmt" - "github.com/prebid/openrtb/v20/openrtb2" - "github.com/prebid/prebid-server/v3/adapters" - "github.com/prebid/prebid-server/v3/config" - "github.com/prebid/prebid-server/v3/errortypes" - "github.com/prebid/prebid-server/v3/openrtb_ext" - "github.com/prebid/prebid-server/v3/util/jsonutil" - "net/http" - "net/url" - "strings" -) - -type adapter struct { - endpoint string -} - -// Builder builds a new instance of the progx for the given bidder with the given config. -func Builder(bidderName openrtb_ext.BidderName, config config.Adapter, server config.Server) (adapters.Bidder, error) { - bidder := &adapter{ - endpoint: config.Endpoint, - } - return bidder, nil -} - -func (a *adapter) MakeRequests(request *openrtb2.BidRequest, requestInfo *adapters.ExtraRequestInfo) ([]*adapters.RequestData, []error) { - var requests []*adapters.RequestData - var errors []error - - requestCopy := *request - - for _, imp := range request.Imp { - requestCopy.Imp = []openrtb2.Imp{imp} - - requestJSON, err := json.Marshal(&requestCopy) - if err != nil { - errors = append(errors, fmt.Errorf("marshal bidRequest: %w", err)) - return nil, errors - } - - cId, err := extractCid(&imp) - if err != nil { - errors = append(errors, fmt.Errorf("extract cId: %w", err)) - continue - } - - headers := http.Header{} - headers.Add("Content-Type", "application/json;charset=utf-8") - - requestData := &adapters.RequestData{ - Method: http.MethodPost, - Uri: fmt.Sprintf("%s/%s", strings.TrimRight(a.endpoint, "/"), url.QueryEscape(cId)), - Body: requestJSON, - Headers: headers, - ImpIDs: []string{imp.ID}, - } - - requests = append(requests, requestData) - } - - return requests, errors -} - -func (a *adapter) MakeBids(request *openrtb2.BidRequest, requestData *adapters.RequestData, responseData *adapters.ResponseData) (*adapters.BidderResponse, []error) { - var errs []error - - if adapters.IsResponseStatusCodeNoContent(responseData) { - return nil, nil - } - - if err := adapters.CheckResponseStatusCodeForErrors(responseData); err != nil { - return nil, []error{err} - } - - var response openrtb2.BidResponse - if err := jsonutil.Unmarshal(responseData.Body, &response); err != nil { - return nil, []error{&errortypes.BadServerResponse{ - Message: fmt.Sprintf("bad server response: %v. ", err), - }} - } - - bidResponse := adapters.NewBidderResponseWithBidsCapacity(len(response.SeatBid)) - - if response.Cur != "" { - bidResponse.Currency = response.Cur - } - - for _, seatBid := range response.SeatBid { - for i := range seatBid.Bid { - bidType, err := getMediaTypeForBid(seatBid.Bid[i]) - if err != nil { - errs = append(errs, err) - continue - } - bidResponse.Bids = append(bidResponse.Bids, &adapters.TypedBid{ - Bid: &seatBid.Bid[i], - BidType: bidType, - }) - } - } - - return bidResponse, errs -} - -func extractCid(imp *openrtb2.Imp) (string, error) { - var bidderExt adapters.ExtImpBidder - if err := jsonutil.Unmarshal(imp.Ext, &bidderExt); err != nil { - return "", fmt.Errorf("unmarshal bidderExt: %w", err) - } - - var impExt openrtb_ext.ImpExtProgX - if err := jsonutil.Unmarshal(bidderExt.Bidder, &impExt); err != nil { - return "", fmt.Errorf("unmarshal ImpExtProgX: %w", err) - } - return impExt.ConnectionId, nil -} - -func getMediaTypeForBid(bid openrtb2.Bid) (openrtb_ext.BidType, error) { - switch bid.MType { - case openrtb2.MarkupBanner: - return openrtb_ext.BidTypeBanner, nil - case openrtb2.MarkupVideo: - return openrtb_ext.BidTypeVideo, nil - } - return "", &errortypes.BadInput{ - Message: fmt.Sprintf("Could not define bid type for imp: %s", bid.ImpID), - } -} diff --git a/adapters/progx/progx_test.go b/adapters/progx/progx_test.go deleted file mode 100644 index 8053d9e787f..00000000000 --- a/adapters/progx/progx_test.go +++ /dev/null @@ -1,24 +0,0 @@ -package progx - -import ( - "testing" - - "github.com/prebid/prebid-server/v3/adapters/adapterstest" - "github.com/prebid/prebid-server/v3/config" - "github.com/prebid/prebid-server/v3/openrtb_ext" -) - -func TestJsonSamples(t *testing.T) { - bidder, buildErr := Builder(openrtb_ext.BidderProgX, config.Adapter{ - Endpoint: "https://programmaticx.ai/", - }, - config.Server{ - ExternalUrl: "http://hosturl.com", GvlID: 1, DataCenter: "2", - }) - - if buildErr != nil { - t.Fatalf("Builder returned unexpected error %v", buildErr) - } - - adapterstest.RunJSONBidderTest(t, "progxtest", bidder) -} diff --git a/adapters/progx/progxtest/exemplary/banner.json b/adapters/progx/progxtest/exemplary/banner.json deleted file mode 100644 index 128e2ff8c0e..00000000000 --- a/adapters/progx/progxtest/exemplary/banner.json +++ /dev/null @@ -1,127 +0,0 @@ -{ - "mockBidRequest": { - "id": "some-request-id", - "site": { - "page": "prebid.org" - }, - "imp": [ - { - "id": "some-impression-id", - "banner": { - "w": 240, - "h": 400 - }, - "ext": { - "bidder": { - "cId": "test_cid_123" - } - } - } - ], - "tmax": 5000 - }, - "httpCalls": [ - { - "expectedRequest": { - "uri": "https://programmaticx.ai/test_cid_123", - "body": { - "id": "some-request-id", - "site": { - "page": "prebid.org" - }, - "imp": [ - { - "id": "some-impression-id", - "banner": { - "w": 240, - "h": 400 - }, - "ext": { - "bidder": { - "cId": "test_cid_123" - } - } - } - ], - "tmax": 5000 - }, - "impIDs": [ - "some-impression-id" - ] - }, - "mockResponse": { - "status": 200, - "body": { - "id": "some-request-id", - "cur": "", - "bidid": "some-bid-id", - "seatbid": [ - { - "bid": [ - { - "exp": 60, - "adm": "
Some creative
", - "burl": "", - "iurl": "https://programmaticx.ai/creative.jpg", - "lurl": "", - "nurl": "", - "id": "some-bid-id", - "impid": "some-impression-id", - "h": 400, - "w": 240, - "price": 1, - "dealid": "deal123", - "adomain": [ - "test.com" - ], - "adid": "some-ad-id", - "cid": "test", - "attr": [], - "cat": [], - "crid": "some-creative-id", - "ext": {}, - "hratio": 0, - "language": "", - "protocol": 0, - "qagmediarating": 0, - "tactic": "", - "wratio": 0, - "mtype": 1 - } - ] - } - ] - } - } - } - ], - "expectedBidResponses": [ - { - "bids": [ - { - "bid": { - "id": "some-bid-id", - "impid": "some-impression-id", - "price": 1, - "adm": "
Some creative
", - "adid": "some-ad-id", - "cid": "test", - "iurl": "https://programmaticx.ai/creative.jpg", - "crid": "some-creative-id", - "adomain": [ - "test.com" - ], - "dealid": "deal123", - "w": 240, - "h": 400, - "exp": 60, - "ext": {}, - "mtype": 1 - }, - "type": "banner" - } - ] - } - ], - "expectedMakeBidsErrors": [] -} \ No newline at end of file diff --git a/adapters/progx/progxtest/exemplary/multi-imp.json b/adapters/progx/progxtest/exemplary/multi-imp.json deleted file mode 100644 index deff1f18364..00000000000 --- a/adapters/progx/progxtest/exemplary/multi-imp.json +++ /dev/null @@ -1,265 +0,0 @@ -{ - "mockBidRequest": { - "id": "some-request-id", - "site": { - "page": "prebid.org" - }, - "imp": [ - { - "id": "some-impression-id", - "video": { - "mimes": [ - "video/mp4" - ], - "minduration": 1, - "maxduration": 2, - "protocols": [ - 1, - 2, - 5 - ], - "w": 300, - "h": 250, - "startdelay": 1, - "placement": 1, - "playbackmethod": [ - 2 - ], - "api": [ - 1, - 2, - 3, - 4 - ] - }, - "ext": { - "bidder": { - "cId": "test_cid_123" - } - } - }, - { - "id": "some-impression-id_2", - "banner": { - "w": 240, - "h": 400 - }, - "ext": { - "bidder": { - "cId": "test_cid_123" - } - } - } - ], - "tmax": 5000 - }, - "httpCalls": [ - { - "expectedRequest": { - "uri": "https://programmaticx.ai/test_cid_123", - "body": { - "id": "some-request-id", - "site": { - "page": "prebid.org" - }, - "imp": [ - { - "id": "some-impression-id", - "video": { - "mimes": [ - "video/mp4" - ], - "minduration": 1, - "maxduration": 2, - "protocols": [ - 1, - 2, - 5 - ], - "w": 300, - "h": 250, - "startdelay": 1, - "placement": 1, - "playbackmethod": [ - 2 - ], - "api": [ - 1, - 2, - 3, - 4 - ] - }, - "ext": { - "bidder": { - "cId": "test_cid_123" - } - } - } - ], - "tmax": 5000 - }, - "impIDs": [ - "some-impression-id" - ] - }, - "mockResponse": { - "status": 200, - "body": { - "id": "some-request-id", - "cur": "", - "bidid": "some-bid-id", - "seatbid": [ - { - "bid": [ - { - "exp": 60, - "adm": "Some Ad SystemSome Ad Title00:00:02", - "id": "some-bid-id", - "impid": "some-impression-id", - "h": 250, - "w": 300, - "price": 1, - "dealid": "deal123", - "adomain": [ - "test.com" - ], - "adid": "some-ad-id", - "cid": "test", - "crid": "some-creative-id", - "mtype": 2 - } - ] - } - ] - } - } - }, - { - "expectedRequest": { - "uri": "https://programmaticx.ai/test_cid_123", - "body": { - "id": "some-request-id", - "site": { - "page": "prebid.org" - }, - "imp": [ - { - "id": "some-impression-id_2", - "banner": { - "w": 240, - "h": 400 - }, - "ext": { - "bidder": { - "cId": "test_cid_123" - } - } - } - ], - "tmax": 5000 - }, - "impIDs": [ - "some-impression-id_2" - ] - }, - "mockResponse": { - "status": 200, - "body": { - "id": "some-request-id", - "cur": "", - "bidid": "some-bid-id", - "seatbid": [ - { - "bid": [ - { - "exp": 60, - "adm": "
Some creative
", - "burl": "", - "iurl": "https://programmaticx.ai/creative.jpg", - "lurl": "", - "nurl": "", - "id": "some-bid-id", - "impid": "some-impression-id_2", - "h": 400, - "w": 240, - "price": 1, - "dealid": "deal123", - "adomain": [ - "test.com" - ], - "adid": "some-ad-id", - "cid": "test", - "attr": [], - "cat": [], - "crid": "some-creative-id", - "ext": {}, - "hratio": 0, - "language": "", - "protocol": 0, - "qagmediarating": 0, - "tactic": "", - "wratio": 0, - "mtype": 1 - } - ] - } - ] - } - } - } - ], - "expectedBidResponses": [ - { - "bids": [ - { - "bid": { - "exp": 60, - "adm": "Some Ad SystemSome Ad Title00:00:02", - "id": "some-bid-id", - "impid": "some-impression-id", - "h": 250, - "w": 300, - "price": 1, - "dealid": "deal123", - "adomain": [ - "test.com" - ], - "adid": "some-ad-id", - "cid": "test", - "crid": "some-creative-id", - "mtype": 2 - }, - "type": "video" - } - ] - }, - { - "bids": [ - { - "bid": { - "id": "some-bid-id", - "impid": "some-impression-id_2", - "price": 1, - "adm": "
Some creative
", - "adid": "some-ad-id", - "cid": "test", - "iurl": "https://programmaticx.ai/creative.jpg", - "crid": "some-creative-id", - "adomain": [ - "test.com" - ], - "dealid": "deal123", - "w": 240, - "h": 400, - "exp": 60, - "ext": {}, - "mtype": 1 - }, - "type": "banner" - } - ] - } - ], - "expectedMakeBidsErrors": [] -} \ No newline at end of file diff --git a/adapters/progx/progxtest/exemplary/video.json b/adapters/progx/progxtest/exemplary/video.json deleted file mode 100644 index 24f198589a5..00000000000 --- a/adapters/progx/progxtest/exemplary/video.json +++ /dev/null @@ -1,154 +0,0 @@ -{ - "mockBidRequest": { - "id": "some-request-id", - "site": { - "page": "prebid.org" - }, - "imp": [ - { - "id": "some-impression-id", - "video": { - "mimes": [ - "video/mp4" - ], - "minduration": 1, - "maxduration": 2, - "protocols": [ - 1, - 2, - 5 - ], - "w": 300, - "h": 250, - "startdelay": 1, - "placement": 1, - "playbackmethod": [ - 2 - ], - "api": [ - 1, - 2, - 3, - 4 - ] - }, - "ext": { - "bidder": { - "cId": "test_cid_123" - } - } - } - ], - "tmax": 5000 - }, - "httpCalls": [ - { - "expectedRequest": { - "uri": "https://programmaticx.ai/test_cid_123", - "body": { - "id": "some-request-id", - "site": { - "page": "prebid.org" - }, - "imp": [ - { - "id": "some-impression-id", - "video": { - "mimes": [ - "video/mp4" - ], - "minduration": 1, - "maxduration": 2, - "protocols": [ - 1, - 2, - 5 - ], - "w": 300, - "h": 250, - "startdelay": 1, - "placement": 1, - "playbackmethod": [ - 2 - ], - "api": [ - 1, - 2, - 3, - 4 - ] - }, - "ext": { - "bidder": { - "cId": "test_cid_123" - } - } - } - ], - "tmax": 5000 - }, - "impIDs": [ - "some-impression-id" - ] - }, - "mockResponse": { - "status": 200, - "body": { - "id": "some-request-id", - "cur": "", - "bidid": "some-bid-id", - "seatbid": [ - { - "bid": [ - { - "exp": 60, - "adm": "Some Ad SystemSome Ad Title00:00:02", - "id": "some-bid-id", - "impid": "some-impression-id", - "h": 250, - "w": 300, - "price": 1, - "dealid": "deal123", - "adomain": [ - "test.com" - ], - "adid": "some-ad-id", - "cid": "test", - "crid": "some-creative-id", - "mtype": 2 - } - ] - } - ] - } - } - } - ], - "expectedBidResponses": [ - { - "bids": [ - { - "bid": { - "exp": 60, - "adm": "Some Ad SystemSome Ad Title00:00:02", - "id": "some-bid-id", - "impid": "some-impression-id", - "h": 250, - "w": 300, - "price": 1, - "dealid": "deal123", - "adomain": [ - "test.com" - ], - "adid": "some-ad-id", - "cid": "test", - "crid": "some-creative-id", - "mtype": 2 - }, - "type": "video" - } - ] - } - ], - "expectedMakeBidsErrors": [] -} \ No newline at end of file diff --git a/adapters/progx/progxtest/supplemental/bad-request.json b/adapters/progx/progxtest/supplemental/bad-request.json deleted file mode 100644 index 4efa28085dc..00000000000 --- a/adapters/progx/progxtest/supplemental/bad-request.json +++ /dev/null @@ -1,65 +0,0 @@ -{ - "mockBidRequest": { - "id": "some-request-id", - "site": { - "page": "prebid.org" - }, - "imp": [ - { - "id": "some-impression-id", - "banner": { - "w": 240, - "h": 400 - }, - "ext": { - "bidder": { - "cId": "test_cid_123" - } - } - } - ], - "tmax": 5000 - }, - "httpCalls": [ - { - "expectedRequest": { - "uri": "https://programmaticx.ai/test_cid_123", - "body": { - "id": "some-request-id", - "site": { - "page": "prebid.org" - }, - "imp": [ - { - "id": "some-impression-id", - "banner": { - "w": 240, - "h": 400 - }, - "ext": { - "bidder": { - "cId": "test_cid_123" - } - } - } - ], - "tmax": 5000 - }, - "impIDs": [ - "some-impression-id" - ] - }, - "mockResponse": { - "status": 400, - "body": {} - } - } - ], - "expectedBidResponses": [], - "expectedMakeBidsErrors": [ - { - "value": "Unexpected status code: 400. Run with request.debug = 1 for more info", - "comparison": "literal" - } - ] -} \ No newline at end of file diff --git a/adapters/progx/progxtest/supplemental/body-unmarshal-fail.json b/adapters/progx/progxtest/supplemental/body-unmarshal-fail.json deleted file mode 100644 index e4d113683fa..00000000000 --- a/adapters/progx/progxtest/supplemental/body-unmarshal-fail.json +++ /dev/null @@ -1,65 +0,0 @@ -{ - "mockBidRequest": { - "id": "some-request-id", - "site": { - "page": "prebid.org" - }, - "imp": [ - { - "id": "some-impression-id", - "banner": { - "w": 240, - "h": 400 - }, - "ext": { - "bidder": { - "cId": "test_cid_123" - } - } - } - ], - "tmax": 5000 - }, - "httpCalls": [ - { - "expectedRequest": { - "uri": "https://programmaticx.ai/test_cid_123", - "body": { - "id": "some-request-id", - "site": { - "page": "prebid.org" - }, - "imp": [ - { - "id": "some-impression-id", - "banner": { - "w": 240, - "h": 400 - }, - "ext": { - "bidder": { - "cId": "test_cid_123" - } - } - } - ], - "tmax": 5000 - }, - "impIDs": [ - "some-impression-id" - ] - }, - "mockResponse": { - "status": 200, - "body": "invalid json response" - } - } - ], - "expectedBidResponses": [], - "expectedMakeBidsErrors": [ - { - "value": "bad server response:", - "comparison": "regex" - } - ] -} \ No newline at end of file diff --git a/adapters/progx/progxtest/supplemental/internal-error.json b/adapters/progx/progxtest/supplemental/internal-error.json deleted file mode 100644 index 714adfa3711..00000000000 --- a/adapters/progx/progxtest/supplemental/internal-error.json +++ /dev/null @@ -1,65 +0,0 @@ -{ - "mockBidRequest": { - "id": "some-request-id", - "site": { - "page": "prebid.org" - }, - "imp": [ - { - "id": "some-impression-id", - "banner": { - "w": 240, - "h": 400 - }, - "ext": { - "bidder": { - "cId": "test_cid_123" - } - } - } - ], - "tmax": 5000 - }, - "httpCalls": [ - { - "expectedRequest": { - "uri": "https://programmaticx.ai/test_cid_123", - "body": { - "id": "some-request-id", - "site": { - "page": "prebid.org" - }, - "imp": [ - { - "id": "some-impression-id", - "banner": { - "w": 240, - "h": 400 - }, - "ext": { - "bidder": { - "cId": "test_cid_123" - } - } - } - ], - "tmax": 5000 - }, - "impIDs": [ - "some-impression-id" - ] - }, - "mockResponse": { - "status": 500, - "body": {} - } - } - ], - "expectedBidResponses": [], - "expectedMakeBidsErrors": [ - { - "value": "Unexpected status code: 500. Run with request.debug = 1 for more info", - "comparison": "literal" - } - ] -} \ No newline at end of file diff --git a/adapters/progx/progxtest/supplemental/no-content.json b/adapters/progx/progxtest/supplemental/no-content.json deleted file mode 100644 index f6340271e7d..00000000000 --- a/adapters/progx/progxtest/supplemental/no-content.json +++ /dev/null @@ -1,60 +0,0 @@ -{ - "mockBidRequest": { - "id": "some-request-id", - "site": { - "page": "prebid.org" - }, - "imp": [ - { - "id": "some-impression-id", - "banner": { - "w": 240, - "h": 400 - }, - "ext": { - "bidder": { - "cId": "test_cid_123" - } - } - } - ], - "tmax": 5000 - }, - "httpCalls": [ - { - "expectedRequest": { - "uri": "https://programmaticx.ai/test_cid_123", - "body": { - "id": "some-request-id", - "site": { - "page": "prebid.org" - }, - "imp": [ - { - "id": "some-impression-id", - "banner": { - "w": 240, - "h": 400 - }, - "ext": { - "bidder": { - "cId": "test_cid_123" - } - } - } - ], - "tmax": 5000 - }, - "impIDs": [ - "some-impression-id" - ] - }, - "mockResponse": { - "status": 204, - "body": {} - } - } - ], - "expectedBidResponses": [], - "expectedMakeBidsErrors": [] -} \ No newline at end of file diff --git a/adapters/progx/progxtest/supplemental/unknown-bid-type.json b/adapters/progx/progxtest/supplemental/unknown-bid-type.json deleted file mode 100644 index bc5bf4b1d9e..00000000000 --- a/adapters/progx/progxtest/supplemental/unknown-bid-type.json +++ /dev/null @@ -1,109 +0,0 @@ -{ - "mockBidRequest": { - "id": "some-request-id", - "site": { - "page": "prebid.org" - }, - "imp": [ - { - "id": "some-impression-id", - "banner": { - "w": 240, - "h": 400 - }, - "ext": { - "bidder": { - "cId": "test_cid_123" - } - } - } - ], - "tmax": 5000 - }, - "httpCalls": [ - { - "expectedRequest": { - "uri": "https://programmaticx.ai/test_cid_123", - "body": { - "id": "some-request-id", - "site": { - "page": "prebid.org" - }, - "imp": [ - { - "id": "some-impression-id", - "banner": { - "w": 240, - "h": 400 - }, - "ext": { - "bidder": { - "cId": "test_cid_123" - } - } - } - ], - "tmax": 5000 - }, - "impIDs": [ - "some-impression-id" - ] - }, - "mockResponse": { - "status": 200, - "body": { - "id": "some-request-id", - "cur": "", - "bidid": "some-bid-id", - "seatbid": [ - { - "bid": [ - { - "exp": 60, - "adm": "
Some creative
", - "burl": "", - "iurl": "https://programmaticx.ai/creative.jpg", - "lurl": "", - "nurl": "", - "id": "some-bid-id", - "impid": "some-impression-id", - "h": 400, - "w": 240, - "price": 1, - "dealid": "deal123", - "adomain": [ - "test.com" - ], - "adid": "some-ad-id", - "cid": "test", - "attr": [], - "cat": [], - "crid": "some-creative-id", - "ext": {}, - "hratio": 0, - "language": "", - "protocol": 0, - "qagmediarating": 0, - "tactic": "", - "wratio": 0, - "mtype": 8 - } - ] - } - ] - } - } - } - ], - "expectedBidResponses": [ - { - "bids": [] - } - ], - "expectedMakeBidsErrors": [ - { - "value": "Could not define bid type for imp: some-impression-id", - "comparison": "literal" - } - ] -} \ No newline at end of file diff --git a/exchange/adapter_builders.go b/exchange/adapter_builders.go index 380ca3e511d..f7920a7e7c2 100755 --- a/exchange/adapter_builders.go +++ b/exchange/adapter_builders.go @@ -179,7 +179,6 @@ import ( "github.com/prebid/prebid-server/v3/adapters/pangle" "github.com/prebid/prebid-server/v3/adapters/pgamssp" "github.com/prebid/prebid-server/v3/adapters/playdigo" - "github.com/prebid/prebid-server/v3/adapters/progx" "github.com/prebid/prebid-server/v3/adapters/pubmatic" "github.com/prebid/prebid-server/v3/adapters/pubnative" "github.com/prebid/prebid-server/v3/adapters/pubrise" @@ -443,7 +442,6 @@ func newAdapterBuilders() map[openrtb_ext.BidderName]adapters.Builder { openrtb_ext.BidderPangle: pangle.Builder, openrtb_ext.BidderPGAMSsp: pgamssp.Builder, openrtb_ext.BidderPlaydigo: playdigo.Builder, - openrtb_ext.BidderProgX: progx.Builder, openrtb_ext.BidderPubmatic: pubmatic.Builder, openrtb_ext.BidderPubnative: pubnative.Builder, openrtb_ext.BidderPubrise: pubrise.Builder, diff --git a/openrtb_ext/bidders.go b/openrtb_ext/bidders.go index d8c6aff95c7..be86afd66a8 100644 --- a/openrtb_ext/bidders.go +++ b/openrtb_ext/bidders.go @@ -197,7 +197,6 @@ var coreBidderNames []BidderName = []BidderName{ BidderPangle, BidderPGAMSsp, BidderPlaydigo, - BidderProgX, BidderPubmatic, BidderPubrise, BidderPubnative, @@ -565,7 +564,6 @@ const ( BidderPangle BidderName = "pangle" BidderPGAMSsp BidderName = "pgamssp" BidderPlaydigo BidderName = "playdigo" - BidderProgX BidderName = "progx" BidderPubmatic BidderName = "pubmatic" BidderPubrise BidderName = "pubrise" BidderPubnative BidderName = "pubnative" diff --git a/openrtb_ext/imp_progx.go b/openrtb_ext/imp_progx.go deleted file mode 100644 index 065b8c92d86..00000000000 --- a/openrtb_ext/imp_progx.go +++ /dev/null @@ -1,6 +0,0 @@ -package openrtb_ext - -// ImpExtProgx defines the contract for bidrequest.imp[i].ext.prebid.bidder.progx -type ImpExtProgX struct { - ConnectionId string `json:"cId"` -} diff --git a/static/bidder-info/progx.yaml b/static/bidder-info/progx.yaml index ac61011feb5..3c4b6f821c1 100644 --- a/static/bidder-info/progx.yaml +++ b/static/bidder-info/progx.yaml @@ -1,20 +1,11 @@ +aliasOf: "vidazoo" endpoint: "https://exchange.programmaticx.ai/openrtb/" maintainer: email: "pxteam@programmaticx.ai" -endpointCompression: gzip -capabilities: - app: - mediaTypes: - - banner - - video - site: - mediaTypes: - - banner - - video +gvlVendorID: 1344 userSync: iframe: - url: https://sync.programmaticx.ai/api/user/html/685297194d85991a5e6e36dd?pbs=true&gdpr={{.GDPR}}&gdpr_consent={{.GDPRConsent}}&us_privacy={{.USPrivacy}}&redirect={{.RedirectURL}}&gpp={{.GPP}}&gpp_sid={{.GPPSID}} + url: https://sync.tagoras.io/api/user/html/685297194d85991a5e6e36dd?pbs=true&gdpr={{.GDPR}}&gdpr_consent={{.GDPRConsent}}&us_privacy={{.USPrivacy}}&redirect={{.RedirectURL}}&gpp={{.GPP}}&gpp_sid={{.GPPSID}} userMacro: ${userId} openrtb: - gpp_supported: true version: 2.6 \ No newline at end of file diff --git a/static/bidder-params/progx.json b/static/bidder-params/progx.json deleted file mode 100644 index deafddecd2e..00000000000 --- a/static/bidder-params/progx.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-04/schema#", - "title": "Progx Adapter Params", - "description": "A schema which validates params accepted by the Progx adapter", - "type": "object", - "properties": { - "cId": { - "type": "string", - "description": "The connection id.", - "minLength": 1, - "pattern": "^[a-zA-Z0-9_]+$" - } - }, - "required": [ - "cId" - ], - "additionalProperties": false -} \ No newline at end of file From ec822e08f03adf4853385fb812bd1277b203cad9 Mon Sep 17 00:00:00 2001 From: anna-y-perion Date: Wed, 23 Jul 2025 11:08:49 +0300 Subject: [PATCH 6/6] inheriting openrtb from parent --- static/bidder-info/progx.yaml | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/static/bidder-info/progx.yaml b/static/bidder-info/progx.yaml index 3c4b6f821c1..0e203e8e465 100644 --- a/static/bidder-info/progx.yaml +++ b/static/bidder-info/progx.yaml @@ -5,7 +5,5 @@ maintainer: gvlVendorID: 1344 userSync: iframe: - url: https://sync.tagoras.io/api/user/html/685297194d85991a5e6e36dd?pbs=true&gdpr={{.GDPR}}&gdpr_consent={{.GDPRConsent}}&us_privacy={{.USPrivacy}}&redirect={{.RedirectURL}}&gpp={{.GPP}}&gpp_sid={{.GPPSID}} - userMacro: ${userId} -openrtb: - version: 2.6 \ No newline at end of file + url: https://sync.programmaticx.ai/api/user/html/685297194d85991a5e6e36dd?pbs=true&gdpr={{.GDPR}}&gdpr_consent={{.GDPRConsent}}&us_privacy={{.USPrivacy}}&redirect={{.RedirectURL}}&gpp={{.GPP}}&gpp_sid={{.GPPSID}} + userMacro: ${userId} \ No newline at end of file