Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master' into speedup-jsonpatch
Browse files Browse the repository at this point in the history
  • Loading branch information
scr-oath committed Dec 13, 2024
2 parents 867b85f + 35e389f commit 54f4257
Show file tree
Hide file tree
Showing 209 changed files with 7,619 additions and 1,088 deletions.
2 changes: 1 addition & 1 deletion adapters/adnuntius/adnuntius.go
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ func makeEndpointUrl(ortbRequest openrtb2.BidRequest, a *adapter, noCookies bool
}

q.Set("tzo", fmt.Sprint(tzo))
q.Set("format", "prebid")
q.Set("format", "prebidServer")

url := endpointUrl + "?" + q.Encode()
return url, nil
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
"httpCalls": [
{
"expectedRequest": {
"uri": "http://whatever.url?format=prebid&tzo=0",
"uri": "http://whatever.url?format=prebidServer&tzo=0",
"body": {
"adUnits": [
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
"httpCalls": [
{
"expectedRequest": {
"uri": "http://whatever.url?format=prebid&tzo=0",
"uri": "http://whatever.url?format=prebidServer&tzo=0",
"body": {
"adUnits": [
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
"httpCalls": [
{
"expectedRequest": {
"uri": "http://whatever.url?format=prebid&tzo=0",
"uri": "http://whatever.url?format=prebidServer&tzo=0",
"body": {
"adUnits": [
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
"httpCalls": [
{
"expectedRequest": {
"uri": "http://whatever.url?format=prebid&tzo=0",
"uri": "http://whatever.url?format=prebidServer&tzo=0",
"body": {
"adUnits": [
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
"httpCalls": [
{
"expectedRequest": {
"uri": "http://whatever.url?format=prebid&tzo=0",
"uri": "http://whatever.url?format=prebidServer&tzo=0",
"body": {
"adUnits": [
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
"httpCalls": [
{
"expectedRequest": {
"uri": "http://gdpr.url?consentString=CONSENT_STRING&format=prebid&gdpr=1&tzo=0",
"uri": "http://gdpr.url?consentString=CONSENT_STRING&format=prebidServer&gdpr=1&tzo=0",
"body": {
"adUnits": [
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
"httpCalls": [
{
"expectedRequest": {
"uri": "http://whatever.url?format=prebid&tzo=0",
"uri": "http://whatever.url?format=prebidServer&tzo=0",
"body": {
"adUnits": [
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
"httpCalls": [
{
"expectedRequest": {
"uri": "http://whatever.url?format=prebid&tzo=0",
"uri": "http://whatever.url?format=prebidServer&tzo=0",
"body": {
"adUnits": [
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
"httpCalls": [
{
"expectedRequest": {
"uri": "http://whatever.url?format=prebid&noCookies=true&tzo=0",
"uri": "http://whatever.url?format=prebidServer&noCookies=true&tzo=0",
"body": {
"adUnits": [
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
"httpCalls": [
{
"expectedRequest": {
"uri": "http://whatever.url?format=prebid&noCookies=true&tzo=0",
"uri": "http://whatever.url?format=prebidServer&noCookies=true&tzo=0",
"body": {
"adUnits": [
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
"httpCalls": [
{
"expectedRequest": {
"uri": "http://whatever.url?format=prebid&tzo=0",
"uri": "http://whatever.url?format=prebidServer&tzo=0",
"body": {
"adUnits": [
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
"httpCalls": [
{
"expectedRequest": {
"uri": "http://whatever.url?format=prebid&tzo=0",
"uri": "http://whatever.url?format=prebidServer&tzo=0",
"body": {
"adUnits": [
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
"httpCalls": [
{
"expectedRequest": {
"uri": "http://whatever.url?format=prebid&tzo=0",
"uri": "http://whatever.url?format=prebidServer&tzo=0",
"body": {
"adUnits": [
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
"httpCalls": [
{
"expectedRequest": {
"uri": "http://whatever.url?format=prebid&tzo=0",
"uri": "http://whatever.url?format=prebidServer&tzo=0",
"body": {
"adUnits": [
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
"httpCalls": [
{
"expectedRequest": {
"uri": "http://whatever.url?format=prebid&tzo=0",
"uri": "http://whatever.url?format=prebidServer&tzo=0",
"body": {
"adUnits": [
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
"httpCalls": [
{
"expectedRequest": {
"uri": "http://whatever.url?format=prebid&tzo=0",
"uri": "http://whatever.url?format=prebidServer&tzo=0",
"body": {
"adUnits": [
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
"Mozilla/5.0 (Linux; Android 8.0; Pixel 2 Build/OPD3.170816.012) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/96.0.4664.93 Mobile Safari/537.36"
]
},
"uri": "http://whatever.url?format=prebid&tzo=0",
"uri": "http://whatever.url?format=prebidServer&tzo=0",
"body": {
"adUnits": [
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
"httpCalls": [
{
"expectedRequest": {
"uri": "http://whatever.url?format=prebid&tzo=0",
"uri": "http://whatever.url?format=prebidServer&tzo=0",
"body": {
"adUnits": [
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
"httpCalls": [
{
"expectedRequest": {
"uri": "http://whatever.url?format=prebid&noCookies=true&tzo=0",
"uri": "http://whatever.url?format=prebidServer&noCookies=true&tzo=0",
"body": {
"adUnits": [
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
"httpCalls": [
{
"expectedRequest": {
"uri": "http://whatever.url?format=prebid&tzo=0",
"uri": "http://whatever.url?format=prebidServer&tzo=0",
"body": {
"adUnits": [
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
"httpCalls": [
{
"expectedRequest": {
"uri": "http://whatever.url?format=prebid&tzo=0",
"uri": "http://whatever.url?format=prebidServer&tzo=0",
"body": {
"adUnits": [
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
"httpCalls": [
{
"expectedRequest": {
"uri": "http://whatever.url?format=prebid&tzo=0",
"uri": "http://whatever.url?format=prebidServer&tzo=0",
"body": {
"adUnits": [
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
"httpCalls": [
{
"expectedRequest": {
"uri": "http://whatever.url?format=prebid&tzo=0",
"uri": "http://whatever.url?format=prebidServer&tzo=0",
"body": {
"adUnits": [
{
Expand Down
51 changes: 51 additions & 0 deletions adapters/blue/params_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
package blue

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-schemas. %v", err)
}

for _, validParam := range validParams {
if err := validator.Validate(openrtb_ext.BidderBlue, json.RawMessage(validParam)); err != nil {
t.Errorf("Schema rejected blue 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-schemas. %v", err)
}

for _, invalidParam := range invalidParams {
if err := validator.Validate(openrtb_ext.BidderBlue, json.RawMessage(invalidParam)); err == nil {
t.Errorf("Schema allowed unexpected params: %s", invalidParam)
}
}
}

var validParams = []string{
`{"publisherId":"1234"}`,
`{"publisherId":"1234", "placementId":"12345"}`,
`{"publisherId":"", "placementId":""}`,
}

var invalidParams = []string{
``,
`null`,
`true`,
`5`,
`4.2`,
`[]`,
`{}`,
`{"placementId":"12345"}`,
}
Loading

0 comments on commit 54f4257

Please sign in to comment.