diff --git a/adapters/clydo/clydo.go b/adapters/clydo/clydo.go new file mode 100644 index 00000000000..0b06bd74d8e --- /dev/null +++ b/adapters/clydo/clydo.go @@ -0,0 +1,273 @@ +package clydo + +import ( + "fmt" + "net/http" + "text/template" + + "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/macros" + "github.com/prebid/prebid-server/v3/openrtb_ext" + "github.com/prebid/prebid-server/v3/util/jsonutil" +) + +type adapter struct { + endpoint *template.Template +} + +func Builder(bidderName openrtb_ext.BidderName, config config.Adapter, server config.Server) (adapters.Bidder, error) { + template, err := template.New("endpointTemplate").Parse(config.Endpoint) + if err != nil { + return nil, fmt.Errorf("Failed to parse endpoint url: %v", err) + } + bidder := &adapter{ + endpoint: template, + } + return bidder, nil +} + +func (a *adapter) MakeRequests(request *openrtb2.BidRequest, requestInfo *adapters.ExtraRequestInfo) ([]*adapters.RequestData, []error) { + var requests []*adapters.RequestData + var errors []error + + impIds, err := prepareImpIds(request) + if err != nil { + return nil, append(errors, err) + } + + headers, err := prepareHeaders(request) + if err != nil { + return nil, append(errors, err) + } + + for _, imp := range request.Imp { + reqData, err := a.prepareRequest(request, imp, impIds, headers) + if err != nil { + errors = append(errors, err) + continue + } + requests = append(requests, reqData) + } + return requests, errors +} + +func (a *adapter) MakeBids( + request *openrtb2.BidRequest, + requestData *adapters.RequestData, + responseData *adapters.ResponseData, +) (*adapters.BidderResponse, []error) { + if adapters.IsResponseStatusCodeNoContent(responseData) { + return nil, nil + } + + if errResp := adapters.CheckResponseStatusCodeForErrors(responseData); errResp != nil { + return nil, []error{errResp} + } + response, err := prepareBidResponse(responseData.Body) + if err != nil { + return nil, []error{err} + } + + bidResponse := adapters.NewBidderResponseWithBidsCapacity(len(request.Imp)) + if response.Cur != "" { + bidResponse.Currency = response.Cur + } + + bidTypeMap, err := buildBidTypeMap(request.Imp) + if err != nil { + return nil, []error{err} + } + bids := prepareSeatBids(response.SeatBid, bidTypeMap) + bidResponse.Bids = bids + + return bidResponse, nil +} + +func (a *adapter) prepareRequest(request *openrtb2.BidRequest, imp openrtb2.Imp, impIds []string, headers http.Header) (*adapters.RequestData, error) { + params, err := prepareExtParams(imp) + if err != nil { + return nil, err + } + endpoint, err := a.prepareEndpoint(params) + if err != nil { + return nil, err + } + body, err := prepareBody(request, imp) + if err != nil { + return nil, err + } + + return &adapters.RequestData{ + Method: "POST", + Uri: endpoint, + Body: body, + Headers: headers, + ImpIDs: impIds, + }, nil +} + +func prepareExtParams(imp openrtb2.Imp) (*openrtb_ext.ImpExtClydo, error) { + var clydoImpExt openrtb_ext.ImpExtClydo + var bidderExt adapters.ExtImpBidder + if len(imp.Ext) == 0 { + return nil, &errortypes.BadInput{ + Message: "missing ext", + } + } + if err := jsonutil.Unmarshal(imp.Ext, &bidderExt); err != nil { + return nil, &errortypes.BadInput{ + Message: "invalid ext", + } + } + if len(bidderExt.Bidder) == 0 { + return nil, &errortypes.BadInput{ + Message: "missing ext.bidder", + } + } + if err := jsonutil.Unmarshal(bidderExt.Bidder, &clydoImpExt); err != nil { + return nil, &errortypes.BadInput{ + Message: "invalid ext.bidder", + } + } + return &clydoImpExt, nil +} + +func (a *adapter) prepareEndpoint(params *openrtb_ext.ImpExtClydo) (string, error) { + partnerId := params.PartnerId + if partnerId == "" { + return "", &errortypes.BadInput{ + Message: "invalid partnerId", + } + } + + region := params.Region + if region == "" { + region = "us" + } + + endpointParams := macros.EndpointTemplateParams{ + PartnerId: partnerId, + Region: region, + } + return macros.ResolveMacros(a.endpoint, endpointParams) +} + +func prepareBody(request *openrtb2.BidRequest, imp openrtb2.Imp) ([]byte, error) { + reqCopy := *request + reqCopy.Imp = []openrtb2.Imp{imp} + + body, err := jsonutil.Marshal(&reqCopy) + if err != nil { + return nil, err + } + + return body, nil +} + +func prepareHeaders(request *openrtb2.BidRequest) (http.Header, error) { + allHeaders := map[string]string{ + "X-OpenRTB-Version": "2.5", + "Accept": "application/json", + "Content-Type": "application/json; charset=utf-8", + } + + allHeaders, err := appendDeviceHeaders(allHeaders, request) + if err != nil { + return nil, err + } + + headers := make(http.Header) + for k, v := range allHeaders { + headers.Add(k, v) + } + + return headers, nil +} + +func appendDeviceHeaders(headers map[string]string, request *openrtb2.BidRequest) (map[string]string, error) { + if request.Device == nil { + return nil, &errortypes.BadInput{Message: "Failed to get device headers"} + } + + if ipv6 := request.Device.IPv6; ipv6 != "" { + headers["X-Forwarded-For"] = ipv6 + } + if ip := request.Device.IP; ip != "" { + headers["X-Forwarded-For"] = ip + } + if ua := request.Device.UA; ua != "" { + headers["User-Agent"] = ua + } + + return headers, nil +} + +func prepareImpIds(request *openrtb2.BidRequest) ([]string, error) { + impIds := openrtb_ext.GetImpIDs(request.Imp) + if impIds == nil { + return nil, &errortypes.BadInput{Message: "Failed to get imp ids"} + } + return impIds, nil +} + +func prepareBidResponse(body []byte) (openrtb2.BidResponse, error) { + var response openrtb2.BidResponse + if err := jsonutil.Unmarshal(body, &response); err != nil { + return response, err + } + return response, nil +} + +func prepareSeatBids(seatBids []openrtb2.SeatBid, bidTypeMap map[string]openrtb_ext.BidType) []*adapters.TypedBid { + var typedBids []*adapters.TypedBid + + for _, seatBid := range seatBids { + for i := range seatBid.Bid { + bid := &seatBid.Bid[i] + bidType := getMediaTypeForBid(bid, bidTypeMap) + typedBids = append(typedBids, &adapters.TypedBid{ + Bid: bid, + BidType: bidType, + }) + } + } + + return typedBids +} + +func buildBidTypeMap(imps []openrtb2.Imp) (map[string]openrtb_ext.BidType, error) { + bidTypeMap := make(map[string]openrtb_ext.BidType, len(imps)) + for _, imp := range imps { + if _, exists := bidTypeMap[imp.ID]; exists { + return nil, &errortypes.BadInput{ + Message: "Duplicate impression ID found", + } + } + + switch { + case imp.Audio != nil: + bidTypeMap[imp.ID] = openrtb_ext.BidTypeAudio + case imp.Video != nil: + bidTypeMap[imp.ID] = openrtb_ext.BidTypeVideo + case imp.Native != nil: + bidTypeMap[imp.ID] = openrtb_ext.BidTypeNative + case imp.Banner != nil: + bidTypeMap[imp.ID] = openrtb_ext.BidTypeBanner + default: + return nil, &errortypes.BadInput{ + Message: "Failed to get media type", + } + } + } + return bidTypeMap, nil +} + +func getMediaTypeForBid(bid *openrtb2.Bid, bidTypeMap map[string]openrtb_ext.BidType) openrtb_ext.BidType { + if mediaType, ok := bidTypeMap[bid.ImpID]; ok { + return mediaType + } + return openrtb_ext.BidTypeBanner +} diff --git a/adapters/clydo/clydo_test.go b/adapters/clydo/clydo_test.go new file mode 100644 index 00000000000..ef21d1e4863 --- /dev/null +++ b/adapters/clydo/clydo_test.go @@ -0,0 +1,30 @@ +package clydo + +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" + "github.com/stretchr/testify/assert" +) + +func TestJsonSamples(t *testing.T) { + bidder, buildErr := Builder(openrtb_ext.BidderClydo, config.Adapter{ + Endpoint: "http://{{.Region}}.clydo.io/{{.PartnerId}}"}, + config.Server{ExternalUrl: "http://hosturl.com"}) + + if buildErr != nil { + t.Fatalf("Builder returned unexpected error %v", buildErr) + } + + adapterstest.RunJSONBidderTest(t, "clydotest", bidder) +} + +func TestEndpointTemplateMalformed(t *testing.T) { + _, buildErr := Builder(openrtb_ext.BidderClydo, config.Adapter{ + Endpoint: "{{Malformed}}"}, + config.Server{ExternalUrl: "http://hosturl.com"}) + + assert.Error(t, buildErr) +} diff --git a/adapters/clydo/clydotest/exemplary/banner-multiple-app.json b/adapters/clydo/clydotest/exemplary/banner-multiple-app.json new file mode 100644 index 00000000000..0cae24f6ca2 --- /dev/null +++ b/adapters/clydo/clydotest/exemplary/banner-multiple-app.json @@ -0,0 +1,264 @@ +{ + "mockBidRequest": { + "id": "de825c88-282e-439a-bcf1-3108344f260c", + "imp": [{ + "id": "224b15d9-c927-4cf7-aee3-9bea24c6f3e3", + "banner": { + "format": [{ + "w": 320, + "h": 50 + }], + "w": 320, + "h": 50 + }, + "bidfloor": 0.111, + "bidfloorcur": "USD", + "ext": { + "bidder": { + "partnerId": "rh7cnxlpvbjqU5ff", + "region": "us" + } + } + }, + { + "id": "1753f913-d9ac-4d2b-93d2-475ff35c6ada", + "banner": { + "format": [{ + "w": 320, + "h": 50 + }], + "w": 320, + "h": 50 + }, + "bidfloor": 0.111, + "bidfloorcur": "USD", + "ext": { + "bidder": { + "partnerId": "rh7cnxlpvbjqU5ff", + "region": "us" + } + } + } + ], + "app": { + "bundle": "com.bundle.app", + "storeurl": "https://play.google.com/store/apps/details?id=com.bundle.app&hl=en", + "publisher": { + "id": "1122334444" + } + }, + "device": { + "lmt": 0, + "ua": "test-ua", + "ip": "111.222.333.444", + "h": 2082, + "w": 1080, + "ifa": "eb6685ef-b9d0-48b9-a1c2-db7894790f93" + }, + "user": { + "id": "f102c5fe-3d9e-4d14-89f3-8d55248246c7" + }, + "tmax": 1000, + "regs": { + "ext": { + "coppa": 0, + "gdpr": 0, + "us_privacy": "1YN-" + } + } + }, + "httpCalls": [{ + "expectedRequest": { + "headers": { + "Content-Type": ["application/json; charset=utf-8"], + "User-Agent": ["test-ua"], + "Accept": ["application/json"], + "X-Forwarded-For": ["111.222.333.444"], + "X-Openrtb-Version": ["2.5"] + }, + "uri": "http://us.clydo.io/rh7cnxlpvbjqU5ff", + "body": { + "id": "de825c88-282e-439a-bcf1-3108344f260c", + "imp": [{ + "id": "224b15d9-c927-4cf7-aee3-9bea24c6f3e3", + "banner": { + "format": [{ + "w": 320, + "h": 50 + }], + "w": 320, + "h": 50 + }, + "bidfloor": 0.111, + "bidfloorcur": "USD", + "ext": { + "bidder": { + "partnerId": "rh7cnxlpvbjqU5ff", + "region": "us" + } + } + }], + "app": { + "bundle": "com.bundle.app", + "storeurl": "https://play.google.com/store/apps/details?id=com.bundle.app&hl=en", + "publisher": { + "id": "1122334444" + } + }, + "device": { + "lmt": 0, + "ua": "test-ua", + "ip": "111.222.333.444", + "h": 2082, + "w": 1080, + "ifa": "eb6685ef-b9d0-48b9-a1c2-db7894790f93" + }, + "user": { + "id": "f102c5fe-3d9e-4d14-89f3-8d55248246c7" + }, + "tmax": 1000, + "regs": { + "ext": { + "coppa": 0, + "gdpr": 0, + "us_privacy": "1YN-" + } + } + }, + "impIDs": ["224b15d9-c927-4cf7-aee3-9bea24c6f3e3", "1753f913-d9ac-4d2b-93d2-475ff35c6ada"] + }, + "mockResponse": { + "status": 200, + "body": { + "id": "test-response-id", + "seatbid": [{ + "bid": [{ + "id": "test-id", + "impid": "224b15d9-c927-4cf7-aee3-9bea24c6f3e3", + "price": 1.5, + "adm": "test-adm", + "adomain": ["test.com"], + "crid": "test-crid", + "w": 320, + "h": 50 + }], + "type": "banner", + "seat": "clydo" + }], + "cur": "USD" + } + } + }, { + "expectedRequest": { + "headers": { + "Content-Type": ["application/json; charset=utf-8"], + "User-Agent": ["test-ua"], + "Accept": ["application/json"], + "X-Forwarded-For": ["111.222.333.444"], + "X-Openrtb-Version": ["2.5"] + }, + "uri": "http://us.clydo.io/rh7cnxlpvbjqU5ff", + "body": { + "id": "de825c88-282e-439a-bcf1-3108344f260c", + "imp": [{ + "id": "224b15d9-c927-4cf7-aee3-9bea24c6f3e3", + "banner": { + "format": [{ + "w": 320, + "h": 50 + }], + "w": 320, + "h": 50 + }, + "bidfloor": 0.111, + "bidfloorcur": "USD", + "ext": { + "bidder": { + "partnerId": "rh7cnxlpvbjqU5ff", + "region": "us" + } + } + }], + "app": { + "bundle": "com.bundle.app", + "storeurl": "https://play.google.com/store/apps/details?id=com.bundle.app&hl=en", + "publisher": { + "id": "1122334444" + } + }, + "device": { + "lmt": 0, + "ua": "test-ua", + "ip": "111.222.333.444", + "h": 2082, + "w": 1080, + "ifa": "eb6685ef-b9d0-48b9-a1c2-db7894790f93" + }, + "user": { + "id": "f102c5fe-3d9e-4d14-89f3-8d55248246c7" + }, + "tmax": 1000, + "regs": { + "ext": { + "coppa": 0, + "gdpr": 0, + "us_privacy": "1YN-" + } + } + }, + "impIDs": ["224b15d9-c927-4cf7-aee3-9bea24c6f3e3", "1753f913-d9ac-4d2b-93d2-475ff35c6ada"] + }, + "mockResponse": { + "status": 200, + "body": { + "id": "test-response-id", + "seatbid": [{ + "bid": [{ + "id": "test-id", + "impid": "1753f913-d9ac-4d2b-93d2-475ff35c6ada", + "price": 1.5, + "adm": "test-adm", + "adomain": ["test.com"], + "crid": "test-crid", + "w": 320, + "h": 50 + }], + "type": "banner", + "seat": "clydo" + }], + "cur": "USD" + } + } + }], + "expectedBidResponses": [{ + "bids": [{ + "bid": { + "id": "test-id", + "impid": "224b15d9-c927-4cf7-aee3-9bea24c6f3e3", + "price": 1.5, + "adm": "test-adm", + "adomain": ["test.com"], + "crid": "test-crid", + "w": 320, + "h": 50 + }, + "type": "banner" + }] + }, + { + "bids": [{ + "bid": { + "id": "test-id", + "impid": "1753f913-d9ac-4d2b-93d2-475ff35c6ada", + "price": 1.5, + "adm": "test-adm", + "adomain": ["test.com"], + "crid": "test-crid", + "w": 320, + "h": 50 + }, + "type": "banner" + }] + } + ] +} \ No newline at end of file diff --git a/adapters/clydo/clydotest/exemplary/banner-multiple-web.json b/adapters/clydo/clydotest/exemplary/banner-multiple-web.json new file mode 100644 index 00000000000..6c5a5a81600 --- /dev/null +++ b/adapters/clydo/clydotest/exemplary/banner-multiple-web.json @@ -0,0 +1,261 @@ +{ + "mockBidRequest": { + "id": "de825c88-282e-439a-bcf1-3108344f260c", + "imp": [{ + "id": "224b15d9-c927-4cf7-aee3-9bea24c6f3e3", + "banner": { + "format": [{ + "w": 320, + "h": 50 + }], + "w": 320, + "h": 50 + }, + "bidfloor": 0.111, + "bidfloorcur": "USD", + "ext": { + "bidder": { + "partnerId": "rh7cnxlpvbjqU5ff", + "region": "us" + } + } + }, + { + "id": "1753f913-d9ac-4d2b-93d2-475ff35c6ada", + "banner": { + "format": [{ + "w": 320, + "h": 50 + }], + "w": 320, + "h": 50 + }, + "bidfloor": 0.111, + "bidfloorcur": "USD", + "ext": { + "bidder": { + "partnerId": "rh7cnxlpvbjqU5ff", + "region": "us" + } + } + } + ], + "site": { + "domain": "site.com", + "publisher": { + "id": "1122334444" + } + }, + "device": { + "lmt": 0, + "ua": "test-ua", + "ip": "111.222.333.444", + "h": 2082, + "w": 1080, + "ifa": "eb6685ef-b9d0-48b9-a1c2-db7894790f93" + }, + "user": { + "id": "f102c5fe-3d9e-4d14-89f3-8d55248246c7" + }, + "tmax": 1000, + "regs": { + "ext": { + "coppa": 0, + "gdpr": 0, + "us_privacy": "1YN-" + } + } + }, + "httpCalls": [{ + "expectedRequest": { + "headers": { + "Content-Type": ["application/json; charset=utf-8"], + "User-Agent": ["test-ua"], + "Accept": ["application/json"], + "X-Forwarded-For": ["111.222.333.444"], + "X-Openrtb-Version": ["2.5"] + }, + "uri": "http://us.clydo.io/rh7cnxlpvbjqU5ff", + "body": { + "id": "de825c88-282e-439a-bcf1-3108344f260c", + "imp": [{ + "id": "224b15d9-c927-4cf7-aee3-9bea24c6f3e3", + "banner": { + "format": [{ + "w": 320, + "h": 50 + }], + "w": 320, + "h": 50 + }, + "bidfloor": 0.111, + "bidfloorcur": "USD", + "ext": { + "bidder": { + "partnerId": "rh7cnxlpvbjqU5ff", + "region": "us" + } + } + }], + "site": { + "domain": "site.com", + "publisher": { + "id": "1122334444" + } + }, + "device": { + "lmt": 0, + "ua": "test-ua", + "ip": "111.222.333.444", + "h": 2082, + "w": 1080, + "ifa": "eb6685ef-b9d0-48b9-a1c2-db7894790f93" + }, + "user": { + "id": "f102c5fe-3d9e-4d14-89f3-8d55248246c7" + }, + "tmax": 1000, + "regs": { + "ext": { + "coppa": 0, + "gdpr": 0, + "us_privacy": "1YN-" + } + } + }, + "impIDs": ["224b15d9-c927-4cf7-aee3-9bea24c6f3e3", "1753f913-d9ac-4d2b-93d2-475ff35c6ada"] + }, + "mockResponse": { + "status": 200, + "body": { + "id": "test-response-id", + "seatbid": [{ + "bid": [{ + "id": "test-id", + "impid": "224b15d9-c927-4cf7-aee3-9bea24c6f3e3", + "price": 1.5, + "adm": "test-adm", + "adomain": ["test.com"], + "crid": "test-crid", + "w": 320, + "h": 50 + }], + "type": "banner", + "seat": "clydo" + }], + "cur": "USD" + } + } + }, { + "expectedRequest": { + "headers": { + "Content-Type": ["application/json; charset=utf-8"], + "User-Agent": ["test-ua"], + "Accept": ["application/json"], + "X-Forwarded-For": ["111.222.333.444"], + "X-Openrtb-Version": ["2.5"] + }, + "uri": "http://us.clydo.io/rh7cnxlpvbjqU5ff", + "body": { + "id": "de825c88-282e-439a-bcf1-3108344f260c", + "imp": [{ + "id": "224b15d9-c927-4cf7-aee3-9bea24c6f3e3", + "banner": { + "format": [{ + "w": 320, + "h": 50 + }], + "w": 320, + "h": 50 + }, + "bidfloor": 0.111, + "bidfloorcur": "USD", + "ext": { + "bidder": { + "partnerId": "rh7cnxlpvbjqU5ff", + "region": "us" + } + } + }], + "site": { + "domain": "site.com", + "publisher": { + "id": "1122334444" + } + }, + "device": { + "lmt": 0, + "ua": "test-ua", + "ip": "111.222.333.444", + "h": 2082, + "w": 1080, + "ifa": "eb6685ef-b9d0-48b9-a1c2-db7894790f93" + }, + "user": { + "id": "f102c5fe-3d9e-4d14-89f3-8d55248246c7" + }, + "tmax": 1000, + "regs": { + "ext": { + "coppa": 0, + "gdpr": 0, + "us_privacy": "1YN-" + } + } + }, + "impIDs": ["224b15d9-c927-4cf7-aee3-9bea24c6f3e3", "1753f913-d9ac-4d2b-93d2-475ff35c6ada"] + }, + "mockResponse": { + "status": 200, + "body": { + "id": "test-response-id", + "seatbid": [{ + "bid": [{ + "id": "test-id", + "impid": "1753f913-d9ac-4d2b-93d2-475ff35c6ada", + "price": 1.5, + "adm": "test-adm", + "adomain": ["test.com"], + "crid": "test-crid", + "w": 320, + "h": 50 + }], + "type": "banner", + "seat": "clydo" + }], + "cur": "USD" + } + } + }], + "expectedBidResponses": [{ + "bids": [{ + "bid": { + "id": "test-id", + "impid": "224b15d9-c927-4cf7-aee3-9bea24c6f3e3", + "price": 1.5, + "adm": "test-adm", + "adomain": ["test.com"], + "crid": "test-crid", + "w": 320, + "h": 50 + }, + "type": "banner" + }] + }, + { + "bids": [{ + "bid": { + "id": "test-id", + "impid": "1753f913-d9ac-4d2b-93d2-475ff35c6ada", + "price": 1.5, + "adm": "test-adm", + "adomain": ["test.com"], + "crid": "test-crid", + "w": 320, + "h": 50 + }, + "type": "banner" + }] + } + ] +} \ No newline at end of file diff --git a/adapters/clydo/clydotest/exemplary/banner-single-app.json b/adapters/clydo/clydotest/exemplary/banner-single-app.json new file mode 100644 index 00000000000..5c3f4c0ec31 --- /dev/null +++ b/adapters/clydo/clydotest/exemplary/banner-single-app.json @@ -0,0 +1,147 @@ +{ + "mockBidRequest": { + "id": "de825c88-282e-439a-bcf1-3108344f260c", + "imp": [{ + "id": "224b15d9-c927-4cf7-aee3-9bea24c6f3e3", + "banner": { + "format": [{ + "w": 320, + "h": 50 + }], + "w": 320, + "h": 50 + }, + "bidfloor": 0.111, + "bidfloorcur": "USD", + "ext": { + "bidder": { + "partnerId": "rh7cnxlpvbjqU5ff", + "region": "us" + } + } + }], + "app": { + "bundle": "com.bundle.app", + "storeurl": "https://play.google.com/store/apps/details?id=com.bundle.app&hl=en", + "publisher": { + "id": "1122334444" + } + }, + "device": { + "lmt": 0, + "ua": "test-ua", + "ip": "111.222.333.444", + "h": 2082, + "w": 1080, + "ifa": "eb6685ef-b9d0-48b9-a1c2-db7894790f93" + }, + "user": { + "id": "f102c5fe-3d9e-4d14-89f3-8d55248246c7" + }, + "tmax": 1000, + "regs": { + "ext": { + "coppa": 0, + "gdpr": 0, + "us_privacy": "1YN-" + } + } + }, + "httpCalls": [{ + "expectedRequest": { + "headers": { + "Content-Type": ["application/json; charset=utf-8"], + "User-Agent": ["test-ua"], + "Accept": ["application/json"], + "X-Forwarded-For": ["111.222.333.444"], + "X-Openrtb-Version": ["2.5"] + }, + "uri": "http://us.clydo.io/rh7cnxlpvbjqU5ff", + "body": { + "id": "de825c88-282e-439a-bcf1-3108344f260c", + "imp": [{ + "id": "224b15d9-c927-4cf7-aee3-9bea24c6f3e3", + "banner": { + "format": [{ + "w": 320, + "h": 50 + }], + "w": 320, + "h": 50 + }, + "bidfloor": 0.111, + "bidfloorcur": "USD", + "ext": { + "bidder": { + "partnerId": "rh7cnxlpvbjqU5ff", + "region": "us" + } + } + }], + "app": { + "bundle": "com.bundle.app", + "storeurl": "https://play.google.com/store/apps/details?id=com.bundle.app&hl=en", + "publisher": { + "id": "1122334444" + } + }, + "device": { + "lmt": 0, + "ua": "test-ua", + "ip": "111.222.333.444", + "h": 2082, + "w": 1080, + "ifa": "eb6685ef-b9d0-48b9-a1c2-db7894790f93" + }, + "user": { + "id": "f102c5fe-3d9e-4d14-89f3-8d55248246c7" + }, + "tmax": 1000, + "regs": { + "ext": { + "coppa": 0, + "gdpr": 0, + "us_privacy": "1YN-" + } + } + }, + "impIDs": ["224b15d9-c927-4cf7-aee3-9bea24c6f3e3"] + }, + "mockResponse": { + "status": 200, + "body": { + "id": "test-response-id", + "seatbid": [{ + "bid": [{ + "id": "test-id", + "impid": "224b15d9-c927-4cf7-aee3-9bea24c6f3e3", + "price": 1.5, + "adm": "test-adm", + "adomain": ["test.com"], + "crid": "test-crid", + "w": 320, + "h": 50 + }], + "type": "banner", + "seat": "clydo" + }], + "cur": "USD" + } + } + }], + "expectedBidResponses": [{ + "bids": [{ + "bid": { + "id": "test-id", + "impid": "224b15d9-c927-4cf7-aee3-9bea24c6f3e3", + "price": 1.5, + "adm": "test-adm", + "adomain": ["test.com"], + "crid": "test-crid", + "w": 320, + "h": 50 + }, + "type": "banner" + }] + }] +} \ No newline at end of file diff --git a/adapters/clydo/clydotest/exemplary/banner-single-web.json b/adapters/clydo/clydotest/exemplary/banner-single-web.json new file mode 100644 index 00000000000..8bca61e84df --- /dev/null +++ b/adapters/clydo/clydotest/exemplary/banner-single-web.json @@ -0,0 +1,145 @@ +{ + "mockBidRequest": { + "id": "de825c88-282e-439a-bcf1-3108344f260c", + "imp": [{ + "id": "224b15d9-c927-4cf7-aee3-9bea24c6f3e3", + "banner": { + "format": [{ + "w": 320, + "h": 50 + }], + "w": 320, + "h": 50 + }, + "bidfloor": 0.111, + "bidfloorcur": "USD", + "ext": { + "bidder": { + "partnerId": "rh7cnxlpvbjqU5ff", + "region": "us" + } + } + }], + "site": { + "domain": "site.com", + "publisher": { + "id": "1122334444" + } + }, + "device": { + "lmt": 0, + "ua": "test-ua", + "ip": "111.222.333.444", + "h": 2082, + "w": 1080, + "ifa": "eb6685ef-b9d0-48b9-a1c2-db7894790f93" + }, + "user": { + "id": "f102c5fe-3d9e-4d14-89f3-8d55248246c7" + }, + "tmax": 1000, + "regs": { + "ext": { + "coppa": 0, + "gdpr": 0, + "us_privacy": "1YN-" + } + } + }, + "httpCalls": [{ + "expectedRequest": { + "headers": { + "Content-Type": ["application/json; charset=utf-8"], + "User-Agent": ["test-ua"], + "Accept": ["application/json"], + "X-Forwarded-For": ["111.222.333.444"], + "X-Openrtb-Version": ["2.5"] + }, + "uri": "http://us.clydo.io/rh7cnxlpvbjqU5ff", + "body": { + "id": "de825c88-282e-439a-bcf1-3108344f260c", + "imp": [{ + "id": "224b15d9-c927-4cf7-aee3-9bea24c6f3e3", + "banner": { + "format": [{ + "w": 320, + "h": 50 + }], + "w": 320, + "h": 50 + }, + "bidfloor": 0.111, + "bidfloorcur": "USD", + "ext": { + "bidder": { + "partnerId": "rh7cnxlpvbjqU5ff", + "region": "us" + } + } + }], + "site": { + "domain": "site.com", + "publisher": { + "id": "1122334444" + } + }, + "device": { + "lmt": 0, + "ua": "test-ua", + "ip": "111.222.333.444", + "h": 2082, + "w": 1080, + "ifa": "eb6685ef-b9d0-48b9-a1c2-db7894790f93" + }, + "user": { + "id": "f102c5fe-3d9e-4d14-89f3-8d55248246c7" + }, + "tmax": 1000, + "regs": { + "ext": { + "coppa": 0, + "gdpr": 0, + "us_privacy": "1YN-" + } + } + }, + "impIDs": ["224b15d9-c927-4cf7-aee3-9bea24c6f3e3"] + }, + "mockResponse": { + "status": 200, + "body": { + "id": "test-response-id", + "seatbid": [{ + "bid": [{ + "id": "test-id", + "impid": "224b15d9-c927-4cf7-aee3-9bea24c6f3e3", + "price": 1.5, + "adm": "test-adm", + "adomain": ["test.com"], + "crid": "test-crid", + "w": 320, + "h": 50 + }], + "type": "banner", + "seat": "clydo" + }], + "cur": "USD" + } + } + }], + "expectedBidResponses": [{ + "bids": [{ + "bid": { + "id": "test-id", + "impid": "224b15d9-c927-4cf7-aee3-9bea24c6f3e3", + "price": 1.5, + "adm": "test-adm", + "adomain": ["test.com"], + "crid": "test-crid", + "w": 320, + "h": 50 + }, + "type": "banner" + }] + }] +} \ No newline at end of file diff --git a/adapters/clydo/clydotest/exemplary/native-multiple-app.json b/adapters/clydo/clydotest/exemplary/native-multiple-app.json new file mode 100644 index 00000000000..180da2ea352 --- /dev/null +++ b/adapters/clydo/clydotest/exemplary/native-multiple-app.json @@ -0,0 +1,272 @@ +{ + "mockBidRequest": { + "id": "de825c88-282e-439a-bcf1-3108344f260c", + "imp": [{ + "id": "224b15d9-c927-4cf7-aee3-9bea24c6f3e3", + "native": { + "request": "{\"ver\":\"1.1\",\"plcmtcnt\":1,\"assets\":[{\"id\":1,\"data\":{\"type\":12}},{\"id\":2,\"required\":1,\"title\":{\"len\":100}},{\"id\":3,\"required\":1,\"img\":{\"type\":1,\"w\":80,\"h\":80}},{\"id\":4,\"required\":1,\"img\":{\"type\":3,\"w\":1200,\"h\":627}},{\"id\":5,\"data\":{\"type\":3}},{\"id\":6,\"required\":1,\"data\":{\"type\":2,\"len\":150}}]}", + "ver": "1.2", + "api": [ + 3, + 5, + 6, + 7 + ] + }, + "bidfloor": 0.111, + "bidfloorcur": "USD", + "ext": { + "bidder": { + "partnerId": "rh7cnxlpvbjqU5ff", + "region": "us" + } + } + }, + { + "id": "1753f913-d9ac-4d2b-93d2-475ff35c6ada", + "native": { + "request": "{\"ver\":\"1.1\",\"plcmtcnt\":1,\"assets\":[{\"id\":1,\"data\":{\"type\":12}},{\"id\":2,\"required\":1,\"title\":{\"len\":100}},{\"id\":3,\"required\":1,\"img\":{\"type\":1,\"w\":80,\"h\":80}},{\"id\":4,\"required\":1,\"img\":{\"type\":3,\"w\":1200,\"h\":627}},{\"id\":5,\"data\":{\"type\":3}},{\"id\":6,\"required\":1,\"data\":{\"type\":2,\"len\":150}}]}", + "ver": "1.2", + "api": [ + 3, + 5, + 6, + 7 + ] + }, + "bidfloor": 0.111, + "bidfloorcur": "USD", + "ext": { + "bidder": { + "partnerId": "rh7cnxlpvbjqU5ff", + "region": "us" + } + } + } + ], + "app": { + "bundle": "com.bundle.app", + "storeurl": "https://play.google.com/store/apps/details?id=com.bundle.app&hl=en", + "publisher": { + "id": "1122334444" + } + }, + "device": { + "lmt": 0, + "ua": "test-ua", + "ipv6": "5165:6c58:9bc0:bb13:8b4f:01a1:2c55:ddb2", + "h": 2082, + "w": 1080, + "ifa": "eb6685ef-b9d0-48b9-a1c2-db7894790f93" + }, + "user": { + "id": "f102c5fe-3d9e-4d14-89f3-8d55248246c7" + }, + "tmax": 1000, + "regs": { + "ext": { + "coppa": 0, + "gdpr": 0, + "us_privacy": "1YN-" + } + } + }, + "httpCalls": [{ + "expectedRequest": { + "headers": { + "Content-Type": ["application/json; charset=utf-8"], + "User-Agent": ["test-ua"], + "Accept": ["application/json"], + "X-Forwarded-For": ["5165:6c58:9bc0:bb13:8b4f:01a1:2c55:ddb2"], + "X-Openrtb-Version": ["2.5"] + }, + "uri": "http://us.clydo.io/rh7cnxlpvbjqU5ff", + "body": { + "id": "de825c88-282e-439a-bcf1-3108344f260c", + "imp": [{ + "id": "224b15d9-c927-4cf7-aee3-9bea24c6f3e3", + "native": { + "request": "{\"ver\":\"1.1\",\"plcmtcnt\":1,\"assets\":[{\"id\":1,\"data\":{\"type\":12}},{\"id\":2,\"required\":1,\"title\":{\"len\":100}},{\"id\":3,\"required\":1,\"img\":{\"type\":1,\"w\":80,\"h\":80}},{\"id\":4,\"required\":1,\"img\":{\"type\":3,\"w\":1200,\"h\":627}},{\"id\":5,\"data\":{\"type\":3}},{\"id\":6,\"required\":1,\"data\":{\"type\":2,\"len\":150}}]}", + "ver": "1.2", + "api": [ + 3, + 5, + 6, + 7 + ] + }, + "bidfloor": 0.111, + "bidfloorcur": "USD", + "ext": { + "bidder": { + "partnerId": "rh7cnxlpvbjqU5ff", + "region": "us" + } + } + }], + "app": { + "bundle": "com.bundle.app", + "storeurl": "https://play.google.com/store/apps/details?id=com.bundle.app&hl=en", + "publisher": { + "id": "1122334444" + } + }, + "device": { + "lmt": 0, + "ua": "test-ua", + "ipv6": "5165:6c58:9bc0:bb13:8b4f:01a1:2c55:ddb2", + "h": 2082, + "w": 1080, + "ifa": "eb6685ef-b9d0-48b9-a1c2-db7894790f93" + }, + "user": { + "id": "f102c5fe-3d9e-4d14-89f3-8d55248246c7" + }, + "tmax": 1000, + "regs": { + "ext": { + "coppa": 0, + "gdpr": 0, + "us_privacy": "1YN-" + } + } + }, + "impIDs": ["224b15d9-c927-4cf7-aee3-9bea24c6f3e3", "1753f913-d9ac-4d2b-93d2-475ff35c6ada"] + }, + "mockResponse": { + "status": 200, + "body": { + "id": "test-response-id", + "seatbid": [{ + "bid": [{ + "id": "test-id", + "impid": "224b15d9-c927-4cf7-aee3-9bea24c6f3e3", + "price": 1.5, + "adm": "test-adm", + "adomain": ["test.com"], + "crid": "test-crid", + "w": 320, + "h": 50 + }], + "type": "native", + "seat": "clydo" + }], + "cur": "USD" + } + } + }, { + "expectedRequest": { + "headers": { + "Content-Type": ["application/json; charset=utf-8"], + "User-Agent": ["test-ua"], + "Accept": ["application/json"], + "X-Forwarded-For": ["5165:6c58:9bc0:bb13:8b4f:01a1:2c55:ddb2"], + "X-Openrtb-Version": ["2.5"] + }, + "uri": "http://us.clydo.io/rh7cnxlpvbjqU5ff", + "body": { + "id": "de825c88-282e-439a-bcf1-3108344f260c", + "imp": [{ + "id": "224b15d9-c927-4cf7-aee3-9bea24c6f3e3", + "native": { + "request": "{\"ver\":\"1.1\",\"plcmtcnt\":1,\"assets\":[{\"id\":1,\"data\":{\"type\":12}},{\"id\":2,\"required\":1,\"title\":{\"len\":100}},{\"id\":3,\"required\":1,\"img\":{\"type\":1,\"w\":80,\"h\":80}},{\"id\":4,\"required\":1,\"img\":{\"type\":3,\"w\":1200,\"h\":627}},{\"id\":5,\"data\":{\"type\":3}},{\"id\":6,\"required\":1,\"data\":{\"type\":2,\"len\":150}}]}", + "ver": "1.2", + "api": [ + 3, + 5, + 6, + 7 + ] + }, + "bidfloor": 0.111, + "bidfloorcur": "USD", + "ext": { + "bidder": { + "partnerId": "rh7cnxlpvbjqU5ff", + "region": "us" + } + } + }], + "app": { + "bundle": "com.bundle.app", + "storeurl": "https://play.google.com/store/apps/details?id=com.bundle.app&hl=en", + "publisher": { + "id": "1122334444" + } + }, + "device": { + "lmt": 0, + "ua": "test-ua", + "ipv6": "5165:6c58:9bc0:bb13:8b4f:01a1:2c55:ddb2", + "h": 2082, + "w": 1080, + "ifa": "eb6685ef-b9d0-48b9-a1c2-db7894790f93" + }, + "user": { + "id": "f102c5fe-3d9e-4d14-89f3-8d55248246c7" + }, + "tmax": 1000, + "regs": { + "ext": { + "coppa": 0, + "gdpr": 0, + "us_privacy": "1YN-" + } + } + }, + "impIDs": ["224b15d9-c927-4cf7-aee3-9bea24c6f3e3", "1753f913-d9ac-4d2b-93d2-475ff35c6ada"] + }, + "mockResponse": { + "status": 200, + "body": { + "id": "test-response-id", + "seatbid": [{ + "bid": [{ + "id": "test-id", + "impid": "1753f913-d9ac-4d2b-93d2-475ff35c6ada", + "price": 1.5, + "adm": "test-adm", + "adomain": ["test.com"], + "crid": "test-crid", + "w": 320, + "h": 50 + }], + "type": "native", + "seat": "clydo" + }], + "cur": "USD" + } + } + }], + "expectedBidResponses": [{ + "bids": [{ + "bid": { + "id": "test-id", + "impid": "224b15d9-c927-4cf7-aee3-9bea24c6f3e3", + "price": 1.5, + "adm": "test-adm", + "adomain": ["test.com"], + "crid": "test-crid", + "w": 320, + "h": 50 + }, + "type": "native" + }] + }, + { + "bids": [{ + "bid": { + "id": "test-id", + "impid": "1753f913-d9ac-4d2b-93d2-475ff35c6ada", + "price": 1.5, + "adm": "test-adm", + "adomain": ["test.com"], + "crid": "test-crid", + "w": 320, + "h": 50 + }, + "type": "native" + }] + } + ] +} \ No newline at end of file diff --git a/adapters/clydo/clydotest/exemplary/native-multiple-web.json b/adapters/clydo/clydotest/exemplary/native-multiple-web.json new file mode 100644 index 00000000000..7c8f51cd98b --- /dev/null +++ b/adapters/clydo/clydotest/exemplary/native-multiple-web.json @@ -0,0 +1,269 @@ +{ + "mockBidRequest": { + "id": "de825c88-282e-439a-bcf1-3108344f260c", + "imp": [{ + "id": "224b15d9-c927-4cf7-aee3-9bea24c6f3e3", + "native": { + "request": "{\"ver\":\"1.1\",\"plcmtcnt\":1,\"assets\":[{\"id\":1,\"data\":{\"type\":12}},{\"id\":2,\"required\":1,\"title\":{\"len\":100}},{\"id\":3,\"required\":1,\"img\":{\"type\":1,\"w\":80,\"h\":80}},{\"id\":4,\"required\":1,\"img\":{\"type\":3,\"w\":1200,\"h\":627}},{\"id\":5,\"data\":{\"type\":3}},{\"id\":6,\"required\":1,\"data\":{\"type\":2,\"len\":150}}]}", + "ver": "1.2", + "api": [ + 3, + 5, + 6, + 7 + ] + }, + "bidfloor": 0.111, + "bidfloorcur": "USD", + "ext": { + "bidder": { + "partnerId": "rh7cnxlpvbjqU5ff", + "region": "us" + } + } + }, + { + "id": "1753f913-d9ac-4d2b-93d2-475ff35c6ada", + "native": { + "request": "{\"ver\":\"1.1\",\"plcmtcnt\":1,\"assets\":[{\"id\":1,\"data\":{\"type\":12}},{\"id\":2,\"required\":1,\"title\":{\"len\":100}},{\"id\":3,\"required\":1,\"img\":{\"type\":1,\"w\":80,\"h\":80}},{\"id\":4,\"required\":1,\"img\":{\"type\":3,\"w\":1200,\"h\":627}},{\"id\":5,\"data\":{\"type\":3}},{\"id\":6,\"required\":1,\"data\":{\"type\":2,\"len\":150}}]}", + "ver": "1.2", + "api": [ + 3, + 5, + 6, + 7 + ] + }, + "bidfloor": 0.111, + "bidfloorcur": "USD", + "ext": { + "bidder": { + "partnerId": "rh7cnxlpvbjqU5ff", + "region": "us" + } + } + } + ], + "site": { + "domain": "site.com", + "publisher": { + "id": "1122334444" + } + }, + "device": { + "lmt": 0, + "ua": "test-ua", + "ip": "111.222.333.444", + "h": 2082, + "w": 1080, + "ifa": "eb6685ef-b9d0-48b9-a1c2-db7894790f93" + }, + "user": { + "id": "f102c5fe-3d9e-4d14-89f3-8d55248246c7" + }, + "tmax": 1000, + "regs": { + "ext": { + "coppa": 0, + "gdpr": 0, + "us_privacy": "1YN-" + } + } + }, + "httpCalls": [{ + "expectedRequest": { + "headers": { + "Content-Type": ["application/json; charset=utf-8"], + "User-Agent": ["test-ua"], + "Accept": ["application/json"], + "X-Forwarded-For": ["111.222.333.444"], + "X-Openrtb-Version": ["2.5"] + }, + "uri": "http://us.clydo.io/rh7cnxlpvbjqU5ff", + "body": { + "id": "de825c88-282e-439a-bcf1-3108344f260c", + "imp": [{ + "id": "224b15d9-c927-4cf7-aee3-9bea24c6f3e3", + "native": { + "request": "{\"ver\":\"1.1\",\"plcmtcnt\":1,\"assets\":[{\"id\":1,\"data\":{\"type\":12}},{\"id\":2,\"required\":1,\"title\":{\"len\":100}},{\"id\":3,\"required\":1,\"img\":{\"type\":1,\"w\":80,\"h\":80}},{\"id\":4,\"required\":1,\"img\":{\"type\":3,\"w\":1200,\"h\":627}},{\"id\":5,\"data\":{\"type\":3}},{\"id\":6,\"required\":1,\"data\":{\"type\":2,\"len\":150}}]}", + "ver": "1.2", + "api": [ + 3, + 5, + 6, + 7 + ] + }, + "bidfloor": 0.111, + "bidfloorcur": "USD", + "ext": { + "bidder": { + "partnerId": "rh7cnxlpvbjqU5ff", + "region": "us" + } + } + }], + "site": { + "domain": "site.com", + "publisher": { + "id": "1122334444" + } + }, + "device": { + "lmt": 0, + "ua": "test-ua", + "ip": "111.222.333.444", + "h": 2082, + "w": 1080, + "ifa": "eb6685ef-b9d0-48b9-a1c2-db7894790f93" + }, + "user": { + "id": "f102c5fe-3d9e-4d14-89f3-8d55248246c7" + }, + "tmax": 1000, + "regs": { + "ext": { + "coppa": 0, + "gdpr": 0, + "us_privacy": "1YN-" + } + } + }, + "impIDs": ["224b15d9-c927-4cf7-aee3-9bea24c6f3e3", "1753f913-d9ac-4d2b-93d2-475ff35c6ada"] + }, + "mockResponse": { + "status": 200, + "body": { + "id": "test-response-id", + "seatbid": [{ + "bid": [{ + "id": "test-id", + "impid": "224b15d9-c927-4cf7-aee3-9bea24c6f3e3", + "price": 1.5, + "adm": "test-adm", + "adomain": ["test.com"], + "crid": "test-crid", + "w": 320, + "h": 50 + }], + "type": "native", + "seat": "clydo" + }], + "cur": "USD" + } + } + }, { + "expectedRequest": { + "headers": { + "Content-Type": ["application/json; charset=utf-8"], + "User-Agent": ["test-ua"], + "Accept": ["application/json"], + "X-Forwarded-For": ["111.222.333.444"], + "X-Openrtb-Version": ["2.5"] + }, + "uri": "http://us.clydo.io/rh7cnxlpvbjqU5ff", + "body": { + "id": "de825c88-282e-439a-bcf1-3108344f260c", + "imp": [{ + "id": "224b15d9-c927-4cf7-aee3-9bea24c6f3e3", + "native": { + "request": "{\"ver\":\"1.1\",\"plcmtcnt\":1,\"assets\":[{\"id\":1,\"data\":{\"type\":12}},{\"id\":2,\"required\":1,\"title\":{\"len\":100}},{\"id\":3,\"required\":1,\"img\":{\"type\":1,\"w\":80,\"h\":80}},{\"id\":4,\"required\":1,\"img\":{\"type\":3,\"w\":1200,\"h\":627}},{\"id\":5,\"data\":{\"type\":3}},{\"id\":6,\"required\":1,\"data\":{\"type\":2,\"len\":150}}]}", + "ver": "1.2", + "api": [ + 3, + 5, + 6, + 7 + ] + }, + "bidfloor": 0.111, + "bidfloorcur": "USD", + "ext": { + "bidder": { + "partnerId": "rh7cnxlpvbjqU5ff", + "region": "us" + } + } + }], + "site": { + "domain": "site.com", + "publisher": { + "id": "1122334444" + } + }, + "device": { + "lmt": 0, + "ua": "test-ua", + "ip": "111.222.333.444", + "h": 2082, + "w": 1080, + "ifa": "eb6685ef-b9d0-48b9-a1c2-db7894790f93" + }, + "user": { + "id": "f102c5fe-3d9e-4d14-89f3-8d55248246c7" + }, + "tmax": 1000, + "regs": { + "ext": { + "coppa": 0, + "gdpr": 0, + "us_privacy": "1YN-" + } + } + }, + "impIDs": ["224b15d9-c927-4cf7-aee3-9bea24c6f3e3", "1753f913-d9ac-4d2b-93d2-475ff35c6ada"] + }, + "mockResponse": { + "status": 200, + "body": { + "id": "test-response-id", + "seatbid": [{ + "bid": [{ + "id": "test-id", + "impid": "1753f913-d9ac-4d2b-93d2-475ff35c6ada", + "price": 1.5, + "adm": "test-adm", + "adomain": ["test.com"], + "crid": "test-crid", + "w": 320, + "h": 50 + }], + "type": "native", + "seat": "clydo" + }], + "cur": "USD" + } + } + }], + "expectedBidResponses": [{ + "bids": [{ + "bid": { + "id": "test-id", + "impid": "224b15d9-c927-4cf7-aee3-9bea24c6f3e3", + "price": 1.5, + "adm": "test-adm", + "adomain": ["test.com"], + "crid": "test-crid", + "w": 320, + "h": 50 + }, + "type": "native" + }] + }, + { + "bids": [{ + "bid": { + "id": "test-id", + "impid": "1753f913-d9ac-4d2b-93d2-475ff35c6ada", + "price": 1.5, + "adm": "test-adm", + "adomain": ["test.com"], + "crid": "test-crid", + "w": 320, + "h": 50 + }, + "type": "native" + }] + } + ] +} \ No newline at end of file diff --git a/adapters/clydo/clydotest/exemplary/native-single-app.json b/adapters/clydo/clydotest/exemplary/native-single-app.json new file mode 100644 index 00000000000..97affd3f629 --- /dev/null +++ b/adapters/clydo/clydotest/exemplary/native-single-app.json @@ -0,0 +1,151 @@ +{ + "mockBidRequest": { + "id": "de825c88-282e-439a-bcf1-3108344f260c", + "imp": [{ + "id": "224b15d9-c927-4cf7-aee3-9bea24c6f3e3", + "native": { + "request": "{\"ver\":\"1.1\",\"plcmtcnt\":1,\"assets\":[{\"id\":1,\"data\":{\"type\":12}},{\"id\":2,\"required\":1,\"title\":{\"len\":100}},{\"id\":3,\"required\":1,\"img\":{\"type\":1,\"w\":80,\"h\":80}},{\"id\":4,\"required\":1,\"img\":{\"type\":3,\"w\":1200,\"h\":627}},{\"id\":5,\"data\":{\"type\":3}},{\"id\":6,\"required\":1,\"data\":{\"type\":2,\"len\":150}}]}", + "ver": "1.2", + "api": [ + 3, + 5, + 6, + 7 + ] + }, + "bidfloor": 0.111, + "bidfloorcur": "USD", + "ext": { + "bidder": { + "partnerId": "rh7cnxlpvbjqU5ff", + "region": "us" + } + } + }], + "app": { + "bundle": "com.bundle.app", + "storeurl": "https://play.google.com/store/apps/details?id=com.bundle.app&hl=en", + "publisher": { + "id": "1122334444" + } + }, + "device": { + "lmt": 0, + "ua": "test-ua", + "ip": "111.222.333.444", + "h": 2082, + "w": 1080, + "ifa": "eb6685ef-b9d0-48b9-a1c2-db7894790f93" + }, + "user": { + "id": "f102c5fe-3d9e-4d14-89f3-8d55248246c7" + }, + "tmax": 1000, + "regs": { + "ext": { + "coppa": 0, + "gdpr": 0, + "us_privacy": "1YN-" + } + } + }, + "httpCalls": [{ + "expectedRequest": { + "headers": { + "Content-Type": ["application/json; charset=utf-8"], + "User-Agent": ["test-ua"], + "Accept": ["application/json"], + "X-Forwarded-For": ["111.222.333.444"], + "X-Openrtb-Version": ["2.5"] + }, + "uri": "http://us.clydo.io/rh7cnxlpvbjqU5ff", + "body": { + "id": "de825c88-282e-439a-bcf1-3108344f260c", + "imp": [{ + "id": "224b15d9-c927-4cf7-aee3-9bea24c6f3e3", + "native": { + "request": "{\"ver\":\"1.1\",\"plcmtcnt\":1,\"assets\":[{\"id\":1,\"data\":{\"type\":12}},{\"id\":2,\"required\":1,\"title\":{\"len\":100}},{\"id\":3,\"required\":1,\"img\":{\"type\":1,\"w\":80,\"h\":80}},{\"id\":4,\"required\":1,\"img\":{\"type\":3,\"w\":1200,\"h\":627}},{\"id\":5,\"data\":{\"type\":3}},{\"id\":6,\"required\":1,\"data\":{\"type\":2,\"len\":150}}]}", + "ver": "1.2", + "api": [ + 3, + 5, + 6, + 7 + ] + }, + "bidfloor": 0.111, + "bidfloorcur": "USD", + "ext": { + "bidder": { + "partnerId": "rh7cnxlpvbjqU5ff", + "region": "us" + } + } + }], + "app": { + "bundle": "com.bundle.app", + "storeurl": "https://play.google.com/store/apps/details?id=com.bundle.app&hl=en", + "publisher": { + "id": "1122334444" + } + }, + "device": { + "lmt": 0, + "ua": "test-ua", + "ip": "111.222.333.444", + "h": 2082, + "w": 1080, + "ifa": "eb6685ef-b9d0-48b9-a1c2-db7894790f93" + }, + "user": { + "id": "f102c5fe-3d9e-4d14-89f3-8d55248246c7" + }, + "tmax": 1000, + "regs": { + "ext": { + "coppa": 0, + "gdpr": 0, + "us_privacy": "1YN-" + } + } + }, + "impIDs": ["224b15d9-c927-4cf7-aee3-9bea24c6f3e3"] + }, + "mockResponse": { + "status": 200, + "body": { + "id": "test-response-id", + "seatbid": [{ + "bid": [{ + "id": "test-id", + "impid": "224b15d9-c927-4cf7-aee3-9bea24c6f3e3", + "price": 1.5, + "adm": "test-adm", + "adomain": ["test.com"], + "crid": "test-crid", + "w": 320, + "h": 50 + }], + "type": "native", + "seat": "clydo" + }], + "cur": "USD" + } + } + }], + "expectedBidResponses": [{ + "bids": [{ + "bid": { + "id": "test-id", + "impid": "224b15d9-c927-4cf7-aee3-9bea24c6f3e3", + "price": 1.5, + "adm": "test-adm", + "adomain": ["test.com"], + "crid": "test-crid", + "w": 320, + "h": 50 + }, + "type": "native" + }] + }] +} \ No newline at end of file diff --git a/adapters/clydo/clydotest/exemplary/native-single-web.json b/adapters/clydo/clydotest/exemplary/native-single-web.json new file mode 100644 index 00000000000..9d9286f31ba --- /dev/null +++ b/adapters/clydo/clydotest/exemplary/native-single-web.json @@ -0,0 +1,149 @@ +{ + "mockBidRequest": { + "id": "de825c88-282e-439a-bcf1-3108344f260c", + "imp": [{ + "id": "224b15d9-c927-4cf7-aee3-9bea24c6f3e3", + "native": { + "request": "{\"ver\":\"1.1\",\"plcmtcnt\":1,\"assets\":[{\"id\":1,\"data\":{\"type\":12}},{\"id\":2,\"required\":1,\"title\":{\"len\":100}},{\"id\":3,\"required\":1,\"img\":{\"type\":1,\"w\":80,\"h\":80}},{\"id\":4,\"required\":1,\"img\":{\"type\":3,\"w\":1200,\"h\":627}},{\"id\":5,\"data\":{\"type\":3}},{\"id\":6,\"required\":1,\"data\":{\"type\":2,\"len\":150}}]}", + "ver": "1.2", + "api": [ + 3, + 5, + 6, + 7 + ] + }, + "bidfloor": 0.111, + "bidfloorcur": "USD", + "ext": { + "bidder": { + "partnerId": "rh7cnxlpvbjqU5ff", + "region": "us" + } + } + }], + "site": { + "domain": "site.com", + "publisher": { + "id": "1122334444" + } + }, + "device": { + "lmt": 0, + "ua": "test-ua", + "ip": "111.222.333.444", + "h": 2082, + "w": 1080, + "ifa": "eb6685ef-b9d0-48b9-a1c2-db7894790f93" + }, + "user": { + "id": "f102c5fe-3d9e-4d14-89f3-8d55248246c7" + }, + "tmax": 1000, + "regs": { + "ext": { + "coppa": 0, + "gdpr": 0, + "us_privacy": "1YN-" + } + } + }, + "httpCalls": [{ + "expectedRequest": { + "headers": { + "Content-Type": ["application/json; charset=utf-8"], + "User-Agent": ["test-ua"], + "Accept": ["application/json"], + "X-Forwarded-For": ["111.222.333.444"], + "X-Openrtb-Version": ["2.5"] + }, + "uri": "http://us.clydo.io/rh7cnxlpvbjqU5ff", + "body": { + "id": "de825c88-282e-439a-bcf1-3108344f260c", + "imp": [{ + "id": "224b15d9-c927-4cf7-aee3-9bea24c6f3e3", + "native": { + "request": "{\"ver\":\"1.1\",\"plcmtcnt\":1,\"assets\":[{\"id\":1,\"data\":{\"type\":12}},{\"id\":2,\"required\":1,\"title\":{\"len\":100}},{\"id\":3,\"required\":1,\"img\":{\"type\":1,\"w\":80,\"h\":80}},{\"id\":4,\"required\":1,\"img\":{\"type\":3,\"w\":1200,\"h\":627}},{\"id\":5,\"data\":{\"type\":3}},{\"id\":6,\"required\":1,\"data\":{\"type\":2,\"len\":150}}]}", + "ver": "1.2", + "api": [ + 3, + 5, + 6, + 7 + ] + }, + "bidfloor": 0.111, + "bidfloorcur": "USD", + "ext": { + "bidder": { + "partnerId": "rh7cnxlpvbjqU5ff", + "region": "us" + } + } + }], + "site": { + "domain": "site.com", + "publisher": { + "id": "1122334444" + } + }, + "device": { + "lmt": 0, + "ua": "test-ua", + "ip": "111.222.333.444", + "h": 2082, + "w": 1080, + "ifa": "eb6685ef-b9d0-48b9-a1c2-db7894790f93" + }, + "user": { + "id": "f102c5fe-3d9e-4d14-89f3-8d55248246c7" + }, + "tmax": 1000, + "regs": { + "ext": { + "coppa": 0, + "gdpr": 0, + "us_privacy": "1YN-" + } + } + }, + "impIDs": ["224b15d9-c927-4cf7-aee3-9bea24c6f3e3"] + }, + "mockResponse": { + "status": 200, + "body": { + "id": "test-response-id", + "seatbid": [{ + "bid": [{ + "id": "test-id", + "impid": "224b15d9-c927-4cf7-aee3-9bea24c6f3e3", + "price": 1.5, + "adm": "test-adm", + "adomain": ["test.com"], + "crid": "test-crid", + "w": 320, + "h": 50 + }], + "type": "native", + "seat": "clydo" + }], + "cur": "USD" + } + } + }], + "expectedBidResponses": [{ + "bids": [{ + "bid": { + "id": "test-id", + "impid": "224b15d9-c927-4cf7-aee3-9bea24c6f3e3", + "price": 1.5, + "adm": "test-adm", + "adomain": ["test.com"], + "crid": "test-crid", + "w": 320, + "h": 50 + }, + "type": "native" + }] + }] +} \ No newline at end of file diff --git a/adapters/clydo/clydotest/exemplary/video-multiple-app.json b/adapters/clydo/clydotest/exemplary/video-multiple-app.json new file mode 100644 index 00000000000..a09b2ba6824 --- /dev/null +++ b/adapters/clydo/clydotest/exemplary/video-multiple-app.json @@ -0,0 +1,264 @@ +{ + "mockBidRequest": { + "id": "de825c88-282e-439a-bcf1-3108344f260c", + "imp": [{ + "id": "224b15d9-c927-4cf7-aee3-9bea24c6f3e3", + "video": { + "mimes": [ + "video/mp4" + ], + "placement": 1, + "w": 320, + "h": 50 + }, + "bidfloor": 0.111, + "bidfloorcur": "USD", + "ext": { + "bidder": { + "partnerId": "rh7cnxlpvbjqU5ff", + "region": "us" + } + } + }, + { + "id": "1753f913-d9ac-4d2b-93d2-475ff35c6ada", + "video": { + "mimes": [ + "video/mp4" + ], + "placement": 1, + "w": 320, + "h": 50 + }, + "bidfloor": 0.111, + "bidfloorcur": "USD", + "ext": { + "bidder": { + "partnerId": "rh7cnxlpvbjqU5ff", + "region": "us" + } + } + } + ], + "app": { + "bundle": "com.bundle.app", + "storeurl": "https://play.google.com/store/apps/details?id=com.bundle.app&hl=en", + "publisher": { + "id": "1122334444" + } + }, + "device": { + "lmt": 0, + "ua": "test-ua", + "ip": "111.222.333.444", + "h": 2082, + "w": 1080, + "ifa": "eb6685ef-b9d0-48b9-a1c2-db7894790f93" + }, + "user": { + "id": "f102c5fe-3d9e-4d14-89f3-8d55248246c7" + }, + "tmax": 1000, + "regs": { + "ext": { + "coppa": 0, + "gdpr": 0, + "us_privacy": "1YN-" + } + } + }, + "httpCalls": [{ + "expectedRequest": { + "headers": { + "Content-Type": ["application/json; charset=utf-8"], + "User-Agent": ["test-ua"], + "Accept": ["application/json"], + "X-Forwarded-For": ["111.222.333.444"], + "X-Openrtb-Version": ["2.5"] + }, + "uri": "http://us.clydo.io/rh7cnxlpvbjqU5ff", + "body": { + "id": "de825c88-282e-439a-bcf1-3108344f260c", + "imp": [{ + "id": "224b15d9-c927-4cf7-aee3-9bea24c6f3e3", + "video": { + "mimes": [ + "video/mp4" + ], + "placement": 1, + "w": 320, + "h": 50 + }, + "bidfloor": 0.111, + "bidfloorcur": "USD", + "ext": { + "bidder": { + "partnerId": "rh7cnxlpvbjqU5ff", + "region": "us" + } + } + }], + "app": { + "bundle": "com.bundle.app", + "storeurl": "https://play.google.com/store/apps/details?id=com.bundle.app&hl=en", + "publisher": { + "id": "1122334444" + } + }, + "device": { + "lmt": 0, + "ua": "test-ua", + "ip": "111.222.333.444", + "h": 2082, + "w": 1080, + "ifa": "eb6685ef-b9d0-48b9-a1c2-db7894790f93" + }, + "user": { + "id": "f102c5fe-3d9e-4d14-89f3-8d55248246c7" + }, + "tmax": 1000, + "regs": { + "ext": { + "coppa": 0, + "gdpr": 0, + "us_privacy": "1YN-" + } + } + }, + "impIDs": ["224b15d9-c927-4cf7-aee3-9bea24c6f3e3", "1753f913-d9ac-4d2b-93d2-475ff35c6ada"] + }, + "mockResponse": { + "status": 200, + "body": { + "id": "test-response-id", + "seatbid": [{ + "bid": [{ + "id": "test-id", + "impid": "224b15d9-c927-4cf7-aee3-9bea24c6f3e3", + "price": 1.5, + "adm": "test-adm", + "adomain": ["test.com"], + "crid": "test-crid", + "w": 320, + "h": 50 + }], + "type": "video", + "seat": "clydo" + }], + "cur": "USD" + } + } + }, { + "expectedRequest": { + "headers": { + "Content-Type": ["application/json; charset=utf-8"], + "User-Agent": ["test-ua"], + "Accept": ["application/json"], + "X-Forwarded-For": ["111.222.333.444"], + "X-Openrtb-Version": ["2.5"] + }, + "uri": "http://us.clydo.io/rh7cnxlpvbjqU5ff", + "body": { + "id": "de825c88-282e-439a-bcf1-3108344f260c", + "imp": [{ + "id": "224b15d9-c927-4cf7-aee3-9bea24c6f3e3", + "video": { + "mimes": [ + "video/mp4" + ], + "placement": 1, + "w": 320, + "h": 50 + }, + "bidfloor": 0.111, + "bidfloorcur": "USD", + "ext": { + "bidder": { + "partnerId": "rh7cnxlpvbjqU5ff", + "region": "us" + } + } + }], + "app": { + "bundle": "com.bundle.app", + "storeurl": "https://play.google.com/store/apps/details?id=com.bundle.app&hl=en", + "publisher": { + "id": "1122334444" + } + }, + "device": { + "lmt": 0, + "ua": "test-ua", + "ip": "111.222.333.444", + "h": 2082, + "w": 1080, + "ifa": "eb6685ef-b9d0-48b9-a1c2-db7894790f93" + }, + "user": { + "id": "f102c5fe-3d9e-4d14-89f3-8d55248246c7" + }, + "tmax": 1000, + "regs": { + "ext": { + "coppa": 0, + "gdpr": 0, + "us_privacy": "1YN-" + } + } + }, + "impIDs": ["224b15d9-c927-4cf7-aee3-9bea24c6f3e3", "1753f913-d9ac-4d2b-93d2-475ff35c6ada"] + }, + "mockResponse": { + "status": 200, + "body": { + "id": "test-response-id", + "seatbid": [{ + "bid": [{ + "id": "test-id", + "impid": "1753f913-d9ac-4d2b-93d2-475ff35c6ada", + "price": 1.5, + "adm": "test-adm", + "adomain": ["test.com"], + "crid": "test-crid", + "w": 320, + "h": 50 + }], + "type": "video", + "seat": "clydo" + }], + "cur": "USD" + } + } + }], + "expectedBidResponses": [{ + "bids": [{ + "bid": { + "id": "test-id", + "impid": "224b15d9-c927-4cf7-aee3-9bea24c6f3e3", + "price": 1.5, + "adm": "test-adm", + "adomain": ["test.com"], + "crid": "test-crid", + "w": 320, + "h": 50 + }, + "type": "video" + }] + }, + { + "bids": [{ + "bid": { + "id": "test-id", + "impid": "1753f913-d9ac-4d2b-93d2-475ff35c6ada", + "price": 1.5, + "adm": "test-adm", + "adomain": ["test.com"], + "crid": "test-crid", + "w": 320, + "h": 50 + }, + "type": "video" + }] + } + ] +} \ No newline at end of file diff --git a/adapters/clydo/clydotest/exemplary/video-multiple-web.json b/adapters/clydo/clydotest/exemplary/video-multiple-web.json new file mode 100644 index 00000000000..4298965d1a7 --- /dev/null +++ b/adapters/clydo/clydotest/exemplary/video-multiple-web.json @@ -0,0 +1,261 @@ +{ + "mockBidRequest": { + "id": "de825c88-282e-439a-bcf1-3108344f260c", + "imp": [{ + "id": "224b15d9-c927-4cf7-aee3-9bea24c6f3e3", + "video": { + "mimes": [ + "video/mp4" + ], + "placement": 1, + "w": 320, + "h": 50 + }, + "bidfloor": 0.111, + "bidfloorcur": "USD", + "ext": { + "bidder": { + "partnerId": "rh7cnxlpvbjqU5ff", + "region": "us" + } + } + }, + { + "id": "1753f913-d9ac-4d2b-93d2-475ff35c6ada", + "video": { + "mimes": [ + "video/mp4" + ], + "placement": 1, + "w": 320, + "h": 50 + }, + "bidfloor": 0.111, + "bidfloorcur": "USD", + "ext": { + "bidder": { + "partnerId": "rh7cnxlpvbjqU5ff", + "region": "us" + } + } + } + ], + "site": { + "domain": "site.com", + "publisher": { + "id": "1122334444" + } + }, + "device": { + "lmt": 0, + "ua": "test-ua", + "ip": "111.222.333.444", + "h": 2082, + "w": 1080, + "ifa": "eb6685ef-b9d0-48b9-a1c2-db7894790f93" + }, + "user": { + "id": "f102c5fe-3d9e-4d14-89f3-8d55248246c7" + }, + "tmax": 1000, + "regs": { + "ext": { + "coppa": 0, + "gdpr": 0, + "us_privacy": "1YN-" + } + } + }, + "httpCalls": [{ + "expectedRequest": { + "headers": { + "Content-Type": ["application/json; charset=utf-8"], + "User-Agent": ["test-ua"], + "Accept": ["application/json"], + "X-Forwarded-For": ["111.222.333.444"], + "X-Openrtb-Version": ["2.5"] + }, + "uri": "http://us.clydo.io/rh7cnxlpvbjqU5ff", + "body": { + "id": "de825c88-282e-439a-bcf1-3108344f260c", + "imp": [{ + "id": "224b15d9-c927-4cf7-aee3-9bea24c6f3e3", + "video": { + "mimes": [ + "video/mp4" + ], + "placement": 1, + "w": 320, + "h": 50 + }, + "bidfloor": 0.111, + "bidfloorcur": "USD", + "ext": { + "bidder": { + "partnerId": "rh7cnxlpvbjqU5ff", + "region": "us" + } + } + }], + "site": { + "domain": "site.com", + "publisher": { + "id": "1122334444" + } + }, + "device": { + "lmt": 0, + "ua": "test-ua", + "ip": "111.222.333.444", + "h": 2082, + "w": 1080, + "ifa": "eb6685ef-b9d0-48b9-a1c2-db7894790f93" + }, + "user": { + "id": "f102c5fe-3d9e-4d14-89f3-8d55248246c7" + }, + "tmax": 1000, + "regs": { + "ext": { + "coppa": 0, + "gdpr": 0, + "us_privacy": "1YN-" + } + } + }, + "impIDs": ["224b15d9-c927-4cf7-aee3-9bea24c6f3e3", "1753f913-d9ac-4d2b-93d2-475ff35c6ada"] + }, + "mockResponse": { + "status": 200, + "body": { + "id": "test-response-id", + "seatbid": [{ + "bid": [{ + "id": "test-id", + "impid": "224b15d9-c927-4cf7-aee3-9bea24c6f3e3", + "price": 1.5, + "adm": "test-adm", + "adomain": ["test.com"], + "crid": "test-crid", + "w": 320, + "h": 50 + }], + "type": "video", + "seat": "clydo" + }], + "cur": "USD" + } + } + }, { + "expectedRequest": { + "headers": { + "Content-Type": ["application/json; charset=utf-8"], + "User-Agent": ["test-ua"], + "Accept": ["application/json"], + "X-Forwarded-For": ["111.222.333.444"], + "X-Openrtb-Version": ["2.5"] + }, + "uri": "http://us.clydo.io/rh7cnxlpvbjqU5ff", + "body": { + "id": "de825c88-282e-439a-bcf1-3108344f260c", + "imp": [{ + "id": "224b15d9-c927-4cf7-aee3-9bea24c6f3e3", + "video": { + "mimes": [ + "video/mp4" + ], + "placement": 1, + "w": 320, + "h": 50 + }, + "bidfloor": 0.111, + "bidfloorcur": "USD", + "ext": { + "bidder": { + "partnerId": "rh7cnxlpvbjqU5ff", + "region": "us" + } + } + }], + "site": { + "domain": "site.com", + "publisher": { + "id": "1122334444" + } + }, + "device": { + "lmt": 0, + "ua": "test-ua", + "ip": "111.222.333.444", + "h": 2082, + "w": 1080, + "ifa": "eb6685ef-b9d0-48b9-a1c2-db7894790f93" + }, + "user": { + "id": "f102c5fe-3d9e-4d14-89f3-8d55248246c7" + }, + "tmax": 1000, + "regs": { + "ext": { + "coppa": 0, + "gdpr": 0, + "us_privacy": "1YN-" + } + } + }, + "impIDs": ["224b15d9-c927-4cf7-aee3-9bea24c6f3e3", "1753f913-d9ac-4d2b-93d2-475ff35c6ada"] + }, + "mockResponse": { + "status": 200, + "body": { + "id": "test-response-id", + "seatbid": [{ + "bid": [{ + "id": "test-id", + "impid": "1753f913-d9ac-4d2b-93d2-475ff35c6ada", + "price": 1.5, + "adm": "test-adm", + "adomain": ["test.com"], + "crid": "test-crid", + "w": 320, + "h": 50 + }], + "type": "video", + "seat": "clydo" + }], + "cur": "USD" + } + } + }], + "expectedBidResponses": [{ + "bids": [{ + "bid": { + "id": "test-id", + "impid": "224b15d9-c927-4cf7-aee3-9bea24c6f3e3", + "price": 1.5, + "adm": "test-adm", + "adomain": ["test.com"], + "crid": "test-crid", + "w": 320, + "h": 50 + }, + "type": "video" + }] + }, + { + "bids": [{ + "bid": { + "id": "test-id", + "impid": "1753f913-d9ac-4d2b-93d2-475ff35c6ada", + "price": 1.5, + "adm": "test-adm", + "adomain": ["test.com"], + "crid": "test-crid", + "w": 320, + "h": 50 + }, + "type": "video" + }] + } + ] +} \ No newline at end of file diff --git a/adapters/clydo/clydotest/exemplary/video-single-app.json b/adapters/clydo/clydotest/exemplary/video-single-app.json new file mode 100644 index 00000000000..e6a3e519f05 --- /dev/null +++ b/adapters/clydo/clydotest/exemplary/video-single-app.json @@ -0,0 +1,147 @@ +{ + "mockBidRequest": { + "id": "de825c88-282e-439a-bcf1-3108344f260c", + "imp": [{ + "id": "224b15d9-c927-4cf7-aee3-9bea24c6f3e3", + "video": { + "mimes": [ + "video/mp4" + ], + "placement": 1, + "w": 320, + "h": 50 + }, + "bidfloor": 0.111, + "bidfloorcur": "USD", + "ext": { + "bidder": { + "partnerId": "rh7cnxlpvbjqU5ff", + "region": "us" + } + } + }], + "app": { + "bundle": "com.bundle.app", + "storeurl": "https://play.google.com/store/apps/details?id=com.bundle.app&hl=en", + "publisher": { + "id": "1122334444" + } + }, + "device": { + "lmt": 0, + "ua": "test-ua", + "ip": "111.222.333.444", + "h": 2082, + "w": 1080, + "ifa": "eb6685ef-b9d0-48b9-a1c2-db7894790f93" + }, + "user": { + "id": "f102c5fe-3d9e-4d14-89f3-8d55248246c7" + }, + "tmax": 1000, + "regs": { + "ext": { + "coppa": 0, + "gdpr": 0, + "us_privacy": "1YN-" + } + } + }, + "httpCalls": [{ + "expectedRequest": { + "headers": { + "Content-Type": ["application/json; charset=utf-8"], + "User-Agent": ["test-ua"], + "Accept": ["application/json"], + "X-Forwarded-For": ["111.222.333.444"], + "X-Openrtb-Version": ["2.5"] + }, + "uri": "http://us.clydo.io/rh7cnxlpvbjqU5ff", + "body": { + "id": "de825c88-282e-439a-bcf1-3108344f260c", + "imp": [{ + "id": "224b15d9-c927-4cf7-aee3-9bea24c6f3e3", + "video": { + "mimes": [ + "video/mp4" + ], + "placement": 1, + "w": 320, + "h": 50 + }, + "bidfloor": 0.111, + "bidfloorcur": "USD", + "ext": { + "bidder": { + "partnerId": "rh7cnxlpvbjqU5ff", + "region": "us" + } + } + }], + "app": { + "bundle": "com.bundle.app", + "storeurl": "https://play.google.com/store/apps/details?id=com.bundle.app&hl=en", + "publisher": { + "id": "1122334444" + } + }, + "device": { + "lmt": 0, + "ua": "test-ua", + "ip": "111.222.333.444", + "h": 2082, + "w": 1080, + "ifa": "eb6685ef-b9d0-48b9-a1c2-db7894790f93" + }, + "user": { + "id": "f102c5fe-3d9e-4d14-89f3-8d55248246c7" + }, + "tmax": 1000, + "regs": { + "ext": { + "coppa": 0, + "gdpr": 0, + "us_privacy": "1YN-" + } + } + }, + "impIDs": ["224b15d9-c927-4cf7-aee3-9bea24c6f3e3"] + }, + "mockResponse": { + "status": 200, + "body": { + "id": "test-response-id", + "seatbid": [{ + "bid": [{ + "id": "test-id", + "impid": "224b15d9-c927-4cf7-aee3-9bea24c6f3e3", + "price": 1.5, + "adm": "test-adm", + "adomain": ["test.com"], + "crid": "test-crid", + "w": 320, + "h": 50 + }], + "type": "video", + "seat": "clydo" + }], + "cur": "USD" + } + } + }], + "expectedBidResponses": [{ + "bids": [{ + "bid": { + "id": "test-id", + "impid": "224b15d9-c927-4cf7-aee3-9bea24c6f3e3", + "price": 1.5, + "adm": "test-adm", + "adomain": ["test.com"], + "crid": "test-crid", + "w": 320, + "h": 50 + }, + "type": "video" + }] + }] +} \ No newline at end of file diff --git a/adapters/clydo/clydotest/exemplary/video-single-web.json b/adapters/clydo/clydotest/exemplary/video-single-web.json new file mode 100644 index 00000000000..7861c2e683b --- /dev/null +++ b/adapters/clydo/clydotest/exemplary/video-single-web.json @@ -0,0 +1,145 @@ +{ + "mockBidRequest": { + "id": "de825c88-282e-439a-bcf1-3108344f260c", + "imp": [{ + "id": "224b15d9-c927-4cf7-aee3-9bea24c6f3e3", + "video": { + "mimes": [ + "video/mp4" + ], + "placement": 1, + "w": 320, + "h": 50 + }, + "bidfloor": 0.111, + "bidfloorcur": "USD", + "ext": { + "bidder": { + "partnerId": "rh7cnxlpvbjqU5ff", + "region": "us" + } + } + }], + "site": { + "domain": "site.com", + "publisher": { + "id": "1122334444" + } + }, + "device": { + "lmt": 0, + "ua": "test-ua", + "ip": "111.222.333.444", + "h": 2082, + "w": 1080, + "ifa": "eb6685ef-b9d0-48b9-a1c2-db7894790f93" + }, + "user": { + "id": "f102c5fe-3d9e-4d14-89f3-8d55248246c7" + }, + "tmax": 1000, + "regs": { + "ext": { + "coppa": 0, + "gdpr": 0, + "us_privacy": "1YN-" + } + } + }, + "httpCalls": [{ + "expectedRequest": { + "headers": { + "Content-Type": ["application/json; charset=utf-8"], + "User-Agent": ["test-ua"], + "Accept": ["application/json"], + "X-Forwarded-For": ["111.222.333.444"], + "X-Openrtb-Version": ["2.5"] + }, + "uri": "http://us.clydo.io/rh7cnxlpvbjqU5ff", + "body": { + "id": "de825c88-282e-439a-bcf1-3108344f260c", + "imp": [{ + "id": "224b15d9-c927-4cf7-aee3-9bea24c6f3e3", + "video": { + "mimes": [ + "video/mp4" + ], + "placement": 1, + "w": 320, + "h": 50 + }, + "bidfloor": 0.111, + "bidfloorcur": "USD", + "ext": { + "bidder": { + "partnerId": "rh7cnxlpvbjqU5ff", + "region": "us" + } + } + }], + "site": { + "domain": "site.com", + "publisher": { + "id": "1122334444" + } + }, + "device": { + "lmt": 0, + "ua": "test-ua", + "ip": "111.222.333.444", + "h": 2082, + "w": 1080, + "ifa": "eb6685ef-b9d0-48b9-a1c2-db7894790f93" + }, + "user": { + "id": "f102c5fe-3d9e-4d14-89f3-8d55248246c7" + }, + "tmax": 1000, + "regs": { + "ext": { + "coppa": 0, + "gdpr": 0, + "us_privacy": "1YN-" + } + } + }, + "impIDs": ["224b15d9-c927-4cf7-aee3-9bea24c6f3e3"] + }, + "mockResponse": { + "status": 200, + "body": { + "id": "test-response-id", + "seatbid": [{ + "bid": [{ + "id": "test-id", + "impid": "224b15d9-c927-4cf7-aee3-9bea24c6f3e3", + "price": 1.5, + "adm": "test-adm", + "adomain": ["test.com"], + "crid": "test-crid", + "w": 320, + "h": 50 + }], + "type": "video", + "seat": "clydo" + }], + "cur": "USD" + } + } + }], + "expectedBidResponses": [{ + "bids": [{ + "bid": { + "id": "test-id", + "impid": "224b15d9-c927-4cf7-aee3-9bea24c6f3e3", + "price": 1.5, + "adm": "test-adm", + "adomain": ["test.com"], + "crid": "test-crid", + "w": 320, + "h": 50 + }, + "type": "video" + }] + }] +} \ No newline at end of file diff --git a/adapters/clydo/clydotest/supplemental/ext-bidder-invalid.json b/adapters/clydo/clydotest/supplemental/ext-bidder-invalid.json new file mode 100644 index 00000000000..78f9ad01f24 --- /dev/null +++ b/adapters/clydo/clydotest/supplemental/ext-bidder-invalid.json @@ -0,0 +1,56 @@ +{ + "expectedMakeRequestsErrors": [ + { + "value": "invalid ext.bidder", + "comparison": "literal" + } + ], + "mockBidRequest": { + "id": "de825c88-282e-439a-bcf1-3108344f260c", + "imp": [{ + "id": "224b15d9-c927-4cf7-aee3-9bea24c6f3e3", + "banner": { + "format": [{ + "w": 320, + "h": 50 + }], + "w": 320, + "h": 50 + }, + "bidfloor": 0.111, + "bidfloorcur": "USD", + "ext": { + "bidder": { + "partnerId": 1 + } + } + }], + "app": { + "bundle": "com.bundle.app", + "storeurl": "https://play.google.com/store/apps/details?id=com.bundle.app&hl=en", + "publisher": { + "id": "1122334444" + } + }, + "device": { + "lmt": 0, + "ua": "test-ua", + "ip": "111.222.333.444", + "h": 2082, + "w": 1080, + "ifa": "eb6685ef-b9d0-48b9-a1c2-db7894790f93" + }, + "user": { + "id": "f102c5fe-3d9e-4d14-89f3-8d55248246c7" + }, + "tmax": 1000, + "regs": { + "ext": { + "coppa": 0, + "gdpr": 0, + "us_privacy": "1YN-" + } + } + }, + "httpCalls": [] +} \ No newline at end of file diff --git a/adapters/clydo/clydotest/supplemental/ext-bidder-missing.json b/adapters/clydo/clydotest/supplemental/ext-bidder-missing.json new file mode 100644 index 00000000000..1b46c60f7b9 --- /dev/null +++ b/adapters/clydo/clydotest/supplemental/ext-bidder-missing.json @@ -0,0 +1,54 @@ +{ + "expectedMakeRequestsErrors": [ + { + "value": "missing ext.bidder", + "comparison": "literal" + } + ], + "mockBidRequest": { + "id": "de825c88-282e-439a-bcf1-3108344f260c", + "imp": [{ + "id": "224b15d9-c927-4cf7-aee3-9bea24c6f3e3", + "banner": { + "format": [{ + "w": 320, + "h": 50 + }], + "w": 320, + "h": 50 + }, + "bidfloor": 0.111, + "bidfloorcur": "USD", + "ext": { + "prebid": {} + } + }], + "app": { + "bundle": "com.bundle.app", + "storeurl": "https://play.google.com/store/apps/details?id=com.bundle.app&hl=en", + "publisher": { + "id": "1122334444" + } + }, + "device": { + "lmt": 0, + "ua": "test-ua", + "ip": "111.222.333.444", + "h": 2082, + "w": 1080, + "ifa": "eb6685ef-b9d0-48b9-a1c2-db7894790f93" + }, + "user": { + "id": "f102c5fe-3d9e-4d14-89f3-8d55248246c7" + }, + "tmax": 1000, + "regs": { + "ext": { + "coppa": 0, + "gdpr": 0, + "us_privacy": "1YN-" + } + } + }, + "httpCalls": [] +} \ No newline at end of file diff --git a/adapters/clydo/clydotest/supplemental/ext-invalid-partner.json b/adapters/clydo/clydotest/supplemental/ext-invalid-partner.json new file mode 100644 index 00000000000..10591df1e55 --- /dev/null +++ b/adapters/clydo/clydotest/supplemental/ext-invalid-partner.json @@ -0,0 +1,56 @@ +{ + "expectedMakeRequestsErrors": [ + { + "value": "invalid partnerId", + "comparison": "literal" + } + ], + "mockBidRequest": { + "id": "de825c88-282e-439a-bcf1-3108344f260c", + "imp": [{ + "id": "224b15d9-c927-4cf7-aee3-9bea24c6f3e3", + "banner": { + "format": [{ + "w": 320, + "h": 50 + }], + "w": 320, + "h": 50 + }, + "bidfloor": 0.111, + "bidfloorcur": "USD", + "ext": { + "bidder": { + "placement": "rh7cnxlpvbjqU5ff" + } + } + }], + "app": { + "bundle": "com.bundle.app", + "storeurl": "https://play.google.com/store/apps/details?id=com.bundle.app&hl=en", + "publisher": { + "id": "1122334444" + } + }, + "device": { + "lmt": 0, + "ua": "test-ua", + "ip": "111.222.333.444", + "h": 2082, + "w": 1080, + "ifa": "eb6685ef-b9d0-48b9-a1c2-db7894790f93" + }, + "user": { + "id": "f102c5fe-3d9e-4d14-89f3-8d55248246c7" + }, + "tmax": 1000, + "regs": { + "ext": { + "coppa": 0, + "gdpr": 0, + "us_privacy": "1YN-" + } + } + }, + "httpCalls": [] +} \ No newline at end of file diff --git a/adapters/clydo/clydotest/supplemental/ext-missing.json b/adapters/clydo/clydotest/supplemental/ext-missing.json new file mode 100644 index 00000000000..7ee73546d69 --- /dev/null +++ b/adapters/clydo/clydotest/supplemental/ext-missing.json @@ -0,0 +1,51 @@ +{ + "expectedMakeRequestsErrors": [ + { + "value": "missing ext", + "comparison": "literal" + } + ], + "mockBidRequest": { + "id": "de825c88-282e-439a-bcf1-3108344f260c", + "imp": [{ + "id": "224b15d9-c927-4cf7-aee3-9bea24c6f3e3", + "banner": { + "format": [{ + "w": 320, + "h": 50 + }], + "w": 320, + "h": 50 + }, + "bidfloor": 0.111, + "bidfloorcur": "USD" + }], + "app": { + "bundle": "com.bundle.app", + "storeurl": "https://play.google.com/store/apps/details?id=com.bundle.app&hl=en", + "publisher": { + "id": "1122334444" + } + }, + "device": { + "lmt": 0, + "ua": "test-ua", + "ip": "111.222.333.444", + "h": 2082, + "w": 1080, + "ifa": "eb6685ef-b9d0-48b9-a1c2-db7894790f93" + }, + "user": { + "id": "f102c5fe-3d9e-4d14-89f3-8d55248246c7" + }, + "tmax": 1000, + "regs": { + "ext": { + "coppa": 0, + "gdpr": 0, + "us_privacy": "1YN-" + } + } + }, + "httpCalls": [] +} \ No newline at end of file diff --git a/adapters/clydo/clydotest/supplemental/no-currency.json b/adapters/clydo/clydotest/supplemental/no-currency.json new file mode 100644 index 00000000000..bf86963b436 --- /dev/null +++ b/adapters/clydo/clydotest/supplemental/no-currency.json @@ -0,0 +1,144 @@ +{ + "mockBidRequest": { + "id": "de825c88-282e-439a-bcf1-3108344f260c", + "imp": [{ + "id": "224b15d9-c927-4cf7-aee3-9bea24c6f3e3", + "banner": { + "format": [{ + "w": 320, + "h": 50 + }], + "w": 320, + "h": 50 + }, + "bidfloor": 0.111, + "ext": { + "bidder": { + "partnerId": "rh7cnxlpvbjqU5ff", + "region": "us" + } + } + }], + "app": { + "bundle": "com.bundle.app", + "storeurl": "https://play.google.com/store/apps/details?id=com.bundle.app&hl=en", + "publisher": { + "id": "1122334444" + } + }, + "device": { + "lmt": 0, + "ua": "test-ua", + "ip": "111.222.333.444", + "h": 2082, + "w": 1080, + "ifa": "eb6685ef-b9d0-48b9-a1c2-db7894790f93" + }, + "user": { + "id": "f102c5fe-3d9e-4d14-89f3-8d55248246c7" + }, + "tmax": 1000, + "regs": { + "ext": { + "coppa": 0, + "gdpr": 0, + "us_privacy": "1YN-" + } + } + }, + "httpCalls": [{ + "expectedRequest": { + "headers": { + "Content-Type": ["application/json; charset=utf-8"], + "User-Agent": ["test-ua"], + "Accept": ["application/json"], + "X-Forwarded-For": ["111.222.333.444"], + "X-Openrtb-Version": ["2.5"] + }, + "uri": "http://us.clydo.io/rh7cnxlpvbjqU5ff", + "body": { + "id": "de825c88-282e-439a-bcf1-3108344f260c", + "imp": [{ + "id": "224b15d9-c927-4cf7-aee3-9bea24c6f3e3", + "banner": { + "format": [{ + "w": 320, + "h": 50 + }], + "w": 320, + "h": 50 + }, + "bidfloor": 0.111, + "ext": { + "bidder": { + "partnerId": "rh7cnxlpvbjqU5ff", + "region": "us" + } + } + }], + "app": { + "bundle": "com.bundle.app", + "storeurl": "https://play.google.com/store/apps/details?id=com.bundle.app&hl=en", + "publisher": { + "id": "1122334444" + } + }, + "device": { + "lmt": 0, + "ua": "test-ua", + "ip": "111.222.333.444", + "h": 2082, + "w": 1080, + "ifa": "eb6685ef-b9d0-48b9-a1c2-db7894790f93" + }, + "user": { + "id": "f102c5fe-3d9e-4d14-89f3-8d55248246c7" + }, + "tmax": 1000, + "regs": { + "ext": { + "coppa": 0, + "gdpr": 0, + "us_privacy": "1YN-" + } + } + }, + "impIDs": ["224b15d9-c927-4cf7-aee3-9bea24c6f3e3"] + }, + "mockResponse": { + "status": 200, + "body": { + "id": "test-response-id", + "seatbid": [{ + "bid": [{ + "id": "test-id", + "impid": "224b15d9-c927-4cf7-aee3-9bea24c6f3e3", + "price": 1.5, + "adm": "test-adm", + "adomain": ["test.com"], + "crid": "test-crid", + "w": 320, + "h": 50 + }], + "type": "banner", + "seat": "clydo" + }] + } + } + }], + "expectedBidResponses": [{ + "bids": [{ + "bid": { + "id": "test-id", + "impid": "224b15d9-c927-4cf7-aee3-9bea24c6f3e3", + "price": 1.5, + "adm": "test-adm", + "adomain": ["test.com"], + "crid": "test-crid", + "w": 320, + "h": 50 + }, + "type": "banner" + }] + }] +} \ No newline at end of file diff --git a/adapters/clydo/clydotest/supplemental/no-device.json b/adapters/clydo/clydotest/supplemental/no-device.json new file mode 100644 index 00000000000..6364a635556 --- /dev/null +++ b/adapters/clydo/clydotest/supplemental/no-device.json @@ -0,0 +1,49 @@ +{ + "expectedMakeRequestsErrors": [ + { + "value": "Failed to get device headers", + "comparison": "literal" + } + ], + "mockBidRequest": { + "id": "de825c88-282e-439a-bcf1-3108344f260c", + "imp": [{ + "id": "224b15d9-c927-4cf7-aee3-9bea24c6f3e3", + "banner": { + "format": [{ + "w": 320, + "h": 50 + }], + "w": 320, + "h": 50 + }, + "bidfloor": 0.111, + "bidfloorcur": "USD", + "ext": { + "bidder": { + "partnerId": "rh7cnxlpvbjqU5ff", + "region": "us" + } + } + }], + "app": { + "bundle": "com.bundle.app", + "storeurl": "https://play.google.com/store/apps/details?id=com.bundle.app&hl=en", + "publisher": { + "id": "1122334444" + } + }, + "user": { + "id": "f102c5fe-3d9e-4d14-89f3-8d55248246c7" + }, + "tmax": 1000, + "regs": { + "ext": { + "coppa": 0, + "gdpr": 0, + "us_privacy": "1YN-" + } + } + }, + "httpCalls": [] +} \ No newline at end of file diff --git a/adapters/clydo/clydotest/supplemental/status-204.json b/adapters/clydo/clydotest/supplemental/status-204.json new file mode 100644 index 00000000000..d4d774e3b8f --- /dev/null +++ b/adapters/clydo/clydotest/supplemental/status-204.json @@ -0,0 +1,113 @@ +{ + "mockBidRequest": { + "id": "de825c88-282e-439a-bcf1-3108344f260c", + "imp": [{ + "id": "224b15d9-c927-4cf7-aee3-9bea24c6f3e3", + "banner": { + "format": [{ + "w": 320, + "h": 50 + }], + "w": 320, + "h": 50 + }, + "bidfloor": 0.111, + "bidfloorcur": "USD", + "ext": { + "bidder": { + "partnerId": "rh7cnxlpvbjqU5ff" + } + } + }], + "app": { + "bundle": "com.bundle.app", + "storeurl": "https://play.google.com/store/apps/details?id=com.bundle.app&hl=en", + "publisher": { + "id": "1122334444" + } + }, + "device": { + "lmt": 0, + "ua": "test-ua", + "ip": "111.222.333.444", + "h": 2082, + "w": 1080, + "ifa": "eb6685ef-b9d0-48b9-a1c2-db7894790f93" + }, + "user": { + "id": "f102c5fe-3d9e-4d14-89f3-8d55248246c7" + }, + "tmax": 1000, + "regs": { + "ext": { + "coppa": 0, + "gdpr": 0, + "us_privacy": "1YN-" + } + } + }, + "httpCalls": [{ + "expectedRequest": { + "headers": { + "Content-Type": ["application/json; charset=utf-8"], + "User-Agent": ["test-ua"], + "Accept": ["application/json"], + "X-Forwarded-For": ["111.222.333.444"], + "X-Openrtb-Version": ["2.5"] + }, + "uri": "http://us.clydo.io/rh7cnxlpvbjqU5ff", + "body": { + "id": "de825c88-282e-439a-bcf1-3108344f260c", + "imp": [{ + "id": "224b15d9-c927-4cf7-aee3-9bea24c6f3e3", + "banner": { + "format": [{ + "w": 320, + "h": 50 + }], + "w": 320, + "h": 50 + }, + "bidfloor": 0.111, + "bidfloorcur": "USD", + "ext": { + "bidder": { + "partnerId": "rh7cnxlpvbjqU5ff" + } + } + }], + "app": { + "bundle": "com.bundle.app", + "storeurl": "https://play.google.com/store/apps/details?id=com.bundle.app&hl=en", + "publisher": { + "id": "1122334444" + } + }, + "device": { + "lmt": 0, + "ua": "test-ua", + "ip": "111.222.333.444", + "h": 2082, + "w": 1080, + "ifa": "eb6685ef-b9d0-48b9-a1c2-db7894790f93" + }, + "user": { + "id": "f102c5fe-3d9e-4d14-89f3-8d55248246c7" + }, + "tmax": 1000, + "regs": { + "ext": { + "coppa": 0, + "gdpr": 0, + "us_privacy": "1YN-" + } + } + }, + "impIDs": ["224b15d9-c927-4cf7-aee3-9bea24c6f3e3"] + }, + "mockResponse": { + "status": 204 + } + }], + "expectedMakeBidsErrors": [] +} \ No newline at end of file diff --git a/adapters/clydo/clydotest/supplemental/status-400.json b/adapters/clydo/clydotest/supplemental/status-400.json new file mode 100644 index 00000000000..391fc0353d5 --- /dev/null +++ b/adapters/clydo/clydotest/supplemental/status-400.json @@ -0,0 +1,116 @@ +{ + "mockBidRequest": { + "id": "de825c88-282e-439a-bcf1-3108344f260c", + "imp": [{ + "id": "224b15d9-c927-4cf7-aee3-9bea24c6f3e3", + "banner": { + "format": [{ + "w": 320, + "h": 50 + }], + "w": 320, + "h": 50 + }, + "bidfloor": 0.111, + "bidfloorcur": "USD", + "ext": { + "bidder": { + "partnerId": "rh7cnxlpvbjqU5ff" + } + } + }], + "app": { + "bundle": "com.bundle.app", + "storeurl": "https://play.google.com/store/apps/details?id=com.bundle.app&hl=en", + "publisher": { + "id": "1122334444" + } + }, + "device": { + "lmt": 0, + "ua": "test-ua", + "ip": "111.222.333.444", + "h": 2082, + "w": 1080, + "ifa": "eb6685ef-b9d0-48b9-a1c2-db7894790f93" + }, + "user": { + "id": "f102c5fe-3d9e-4d14-89f3-8d55248246c7" + }, + "tmax": 1000, + "regs": { + "ext": { + "coppa": 0, + "gdpr": 0, + "us_privacy": "1YN-" + } + } + }, + "httpCalls": [{ + "expectedRequest": { + "headers": { + "Content-Type": ["application/json; charset=utf-8"], + "User-Agent": ["test-ua"], + "Accept": ["application/json"], + "X-Forwarded-For": ["111.222.333.444"], + "X-Openrtb-Version": ["2.5"] + }, + "uri": "http://us.clydo.io/rh7cnxlpvbjqU5ff", + "body": { + "id": "de825c88-282e-439a-bcf1-3108344f260c", + "imp": [{ + "id": "224b15d9-c927-4cf7-aee3-9bea24c6f3e3", + "banner": { + "format": [{ + "w": 320, + "h": 50 + }], + "w": 320, + "h": 50 + }, + "bidfloor": 0.111, + "bidfloorcur": "USD", + "ext": { + "bidder": { + "partnerId": "rh7cnxlpvbjqU5ff" + } + } + }], + "app": { + "bundle": "com.bundle.app", + "storeurl": "https://play.google.com/store/apps/details?id=com.bundle.app&hl=en", + "publisher": { + "id": "1122334444" + } + }, + "device": { + "lmt": 0, + "ua": "test-ua", + "ip": "111.222.333.444", + "h": 2082, + "w": 1080, + "ifa": "eb6685ef-b9d0-48b9-a1c2-db7894790f93" + }, + "user": { + "id": "f102c5fe-3d9e-4d14-89f3-8d55248246c7" + }, + "tmax": 1000, + "regs": { + "ext": { + "coppa": 0, + "gdpr": 0, + "us_privacy": "1YN-" + } + } + }, + "impIDs": ["224b15d9-c927-4cf7-aee3-9bea24c6f3e3"] + }, + "mockResponse": { + "status": 400 + } + }], + "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/clydo/clydotest/supplemental/status-500.json b/adapters/clydo/clydotest/supplemental/status-500.json new file mode 100644 index 00000000000..9747fcf79fb --- /dev/null +++ b/adapters/clydo/clydotest/supplemental/status-500.json @@ -0,0 +1,116 @@ +{ + "mockBidRequest": { + "id": "de825c88-282e-439a-bcf1-3108344f260c", + "imp": [{ + "id": "224b15d9-c927-4cf7-aee3-9bea24c6f3e3", + "banner": { + "format": [{ + "w": 320, + "h": 50 + }], + "w": 320, + "h": 50 + }, + "bidfloor": 0.111, + "bidfloorcur": "USD", + "ext": { + "bidder": { + "partnerId": "rh7cnxlpvbjqU5ff" + } + } + }], + "app": { + "bundle": "com.bundle.app", + "storeurl": "https://play.google.com/store/apps/details?id=com.bundle.app&hl=en", + "publisher": { + "id": "1122334444" + } + }, + "device": { + "lmt": 0, + "ua": "test-ua", + "ip": "111.222.333.444", + "h": 2082, + "w": 1080, + "ifa": "eb6685ef-b9d0-48b9-a1c2-db7894790f93" + }, + "user": { + "id": "f102c5fe-3d9e-4d14-89f3-8d55248246c7" + }, + "tmax": 1000, + "regs": { + "ext": { + "coppa": 0, + "gdpr": 0, + "us_privacy": "1YN-" + } + } + }, + "httpCalls": [{ + "expectedRequest": { + "headers": { + "Content-Type": ["application/json; charset=utf-8"], + "User-Agent": ["test-ua"], + "Accept": ["application/json"], + "X-Forwarded-For": ["111.222.333.444"], + "X-Openrtb-Version": ["2.5"] + }, + "uri": "http://us.clydo.io/rh7cnxlpvbjqU5ff", + "body": { + "id": "de825c88-282e-439a-bcf1-3108344f260c", + "imp": [{ + "id": "224b15d9-c927-4cf7-aee3-9bea24c6f3e3", + "banner": { + "format": [{ + "w": 320, + "h": 50 + }], + "w": 320, + "h": 50 + }, + "bidfloor": 0.111, + "bidfloorcur": "USD", + "ext": { + "bidder": { + "partnerId": "rh7cnxlpvbjqU5ff" + } + } + }], + "app": { + "bundle": "com.bundle.app", + "storeurl": "https://play.google.com/store/apps/details?id=com.bundle.app&hl=en", + "publisher": { + "id": "1122334444" + } + }, + "device": { + "lmt": 0, + "ua": "test-ua", + "ip": "111.222.333.444", + "h": 2082, + "w": 1080, + "ifa": "eb6685ef-b9d0-48b9-a1c2-db7894790f93" + }, + "user": { + "id": "f102c5fe-3d9e-4d14-89f3-8d55248246c7" + }, + "tmax": 1000, + "regs": { + "ext": { + "coppa": 0, + "gdpr": 0, + "us_privacy": "1YN-" + } + } + }, + "impIDs": ["224b15d9-c927-4cf7-aee3-9bea24c6f3e3"] + }, + "mockResponse": { + "status": 500 + } + }], + "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/clydo/params_test.go b/adapters/clydo/params_test.go new file mode 100644 index 00000000000..779c7eeaddb --- /dev/null +++ b/adapters/clydo/params_test.go @@ -0,0 +1,52 @@ +package clydo + +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 _, p := range validParams { + if err := validator.Validate(openrtb_ext.BidderClydo, json.RawMessage(p)); err != nil { + t.Errorf("Schema rejected valid params: %s", p) + } + } +} + +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.BidderClydo, json.RawMessage(p)); err == nil { + t.Errorf("Schema allowed invalid params: %s", p) + } + } +} + +var validParams = []string{ + `{"partnerId": "rxeMfUb992Ocxm9C"}`, + `{"partnerId": "jDrTOH0ADArSEqrR"}`, + `{"partnerId": "MZP6aFUyHqjoqMCs"}`, + `{"partnerId": "rxeMfUb992Ocxm9C", "region": "us"}`, + `{"partnerId": "rxeMfUb992Ocxm9C", "region": "usw"}`, + `{"partnerId": "jDrTOH0ADArSEqrR", "region": "eu"}`, + `{"partnerId": "MZP6aFUyHqjoqMCs", "region": "apac"}`, +} + +var invalidParams = []string{ + `{"partnerId": ""}`, + `{"partnerId": 111}`, + `{"partnerId": "rxeMfUb992Ocxm9C", "region": "uswest"}`, + `{"partnerId": "rxeMfUb992Ocxm9C", "region": "europa"}`, + `{"partnerId": "rxeMfUb992Ocxm9C", "region": "singapore"}`, +} diff --git a/config/bidderinfo.go b/config/bidderinfo.go index ff38be125dc..8e873cbd04b 100644 --- a/config/bidderinfo.go +++ b/config/bidderinfo.go @@ -438,6 +438,8 @@ var testEndpointTemplateParams = macros.EndpointTemplateParams{ SourceId: "anySourceID", AdUnit: "anyAdUnit", MediaType: "MediaType", + Region: "anyRegion", + PartnerId: "anyPartnerId", } // validateAdapterEndpoint makes sure that an adapter has a valid endpoint diff --git a/exchange/adapter_builders.go b/exchange/adapter_builders.go index fa3f6d83707..4533be19f96 100755 --- a/exchange/adapter_builders.go +++ b/exchange/adapter_builders.go @@ -76,6 +76,7 @@ import ( "github.com/prebid/prebid-server/v3/adapters/bwx" cadentaperturemx "github.com/prebid/prebid-server/v3/adapters/cadent_aperture_mx" "github.com/prebid/prebid-server/v3/adapters/ccx" + "github.com/prebid/prebid-server/v3/adapters/clydo" "github.com/prebid/prebid-server/v3/adapters/cointraffic" "github.com/prebid/prebid-server/v3/adapters/coinzilla" "github.com/prebid/prebid-server/v3/adapters/colossus" @@ -344,6 +345,7 @@ func newAdapterBuilders() map[openrtb_ext.BidderName]adapters.Builder { openrtb_ext.BidderBWX: bwx.Builder, openrtb_ext.BidderCadentApertureMX: cadentaperturemx.Builder, openrtb_ext.BidderCcx: ccx.Builder, + openrtb_ext.BidderClydo: clydo.Builder, openrtb_ext.BidderCointraffic: cointraffic.Builder, openrtb_ext.BidderCoinzilla: coinzilla.Builder, openrtb_ext.BidderColossus: colossus.Builder, diff --git a/macros/macros.go b/macros/macros.go index f24974b572a..0c6e08cae0e 100644 --- a/macros/macros.go +++ b/macros/macros.go @@ -22,6 +22,8 @@ type EndpointTemplateParams struct { SspID string SeatID string TokenID string + PartnerId string + Region string PlacementID string } diff --git a/openrtb_ext/bidders.go b/openrtb_ext/bidders.go index d9df5e89094..7ccc446d79d 100644 --- a/openrtb_ext/bidders.go +++ b/openrtb_ext/bidders.go @@ -92,6 +92,7 @@ var coreBidderNames []BidderName = []BidderName{ BidderBWX, BidderCadentApertureMX, BidderCcx, + BidderClydo, BidderCointraffic, BidderCoinzilla, BidderColossus, @@ -467,6 +468,7 @@ const ( BidderBWX BidderName = "bwx" BidderCadentApertureMX BidderName = "cadent_aperture_mx" BidderCcx BidderName = "ccx" + BidderClydo BidderName = "clydo" BidderCointraffic BidderName = "cointraffic" BidderCoinzilla BidderName = "coinzilla" BidderColossus BidderName = "colossus" diff --git a/openrtb_ext/imp_clydo.go b/openrtb_ext/imp_clydo.go new file mode 100644 index 00000000000..74f244e438c --- /dev/null +++ b/openrtb_ext/imp_clydo.go @@ -0,0 +1,6 @@ +package openrtb_ext + +type ImpExtClydo struct { + PartnerId string `json:"partnerId"` + Region string `json:"region,omitempty"` +} diff --git a/static/bidder-info/clydo.yaml b/static/bidder-info/clydo.yaml new file mode 100644 index 00000000000..906f2417999 --- /dev/null +++ b/static/bidder-info/clydo.yaml @@ -0,0 +1,26 @@ +# We have the following regional endpoint domains: +# US East: us +# US West: usw +# EU: eu +# APAC: apac +# Please deploy this config in each of your datacenters with the appropriate regional subdomain +endpoint: 'http://{{.Region}}.clydo.io/{{.PartnerId}}' +endpointCompression: gzip +geoscope: + - global +maintainer: + email: cto@clydo.io +modifyingVastXmlAllowed: true +capabilities: + app: + mediaTypes: + - banner + - video + - audio + - native + site: + mediaTypes: + - banner + - video + - audio + - native \ No newline at end of file diff --git a/static/bidder-params/clydo.json b/static/bidder-params/clydo.json new file mode 100644 index 00000000000..8d7e016391e --- /dev/null +++ b/static/bidder-params/clydo.json @@ -0,0 +1,21 @@ +{ + "$schema": "http://json-schema.org/draft-04/schema#", + "title": "Clydo Adapter Params", + "description": "A schema which validates params accepted by the Clydo adapter", + "type": "object", + + "properties": { + "partnerId": { + "type": "string", + "description": "Partner ID", + "minLength": 1 + }, + "region": { + "type": "string", + "description": "Regional endpoint identifier (us, usw, eu, apac)", + "enum": ["us", "usw", "eu", "apac"] + } + }, + + "required": ["partnerId"] +} \ No newline at end of file