-
Notifications
You must be signed in to change notification settings - Fork 801
Fix Beachfront data race condition #1915
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 4 commits
7b09f06
5b2f164
60bfad9
d6743f7
5cc9bcc
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,124 @@ | ||
{ | ||
"mockBidRequest": { | ||
"id": "adm-video", | ||
"imp": [ | ||
{ | ||
"id": "video1", | ||
"ext": { | ||
"bidder": { | ||
"bidfloor": 3.01, | ||
"appId": "videoAppId1" | ||
} | ||
}, | ||
"video": { | ||
"mimes": [ | ||
"video/mp4" | ||
], | ||
"context": "instream", | ||
"w": 300, | ||
"h": 250 | ||
} | ||
} | ||
], | ||
"app": { | ||
"bundle": "com.domain.some" | ||
}, | ||
"device":{ | ||
"ip":"192.168.168.168" | ||
} | ||
}, | ||
|
||
"httpCalls": [ | ||
{ | ||
"expectedRequest": { | ||
"uri": "https://qa.beachrtb.com/bid.json?exchange_id=videoAppId1", | ||
"body": { | ||
"id": "adm-video", | ||
"imp": [ | ||
{ | ||
"video": { | ||
"w": 300, | ||
"h": 250, | ||
"mimes": [ | ||
"video/mp4" | ||
] | ||
}, | ||
"bidfloor": 3.01, | ||
"id": "video1", | ||
"secure": 0 | ||
} | ||
], | ||
"app": { | ||
"bundle": "com.domain.some", | ||
"domain": "domain.us" | ||
}, | ||
"cur": [ | ||
"USD" | ||
], | ||
"device":{ | ||
"devicetype": 1, | ||
"ip":"192.168.168.168" | ||
} | ||
} | ||
}, | ||
"mockResponse": { | ||
"status": 200, | ||
"body": { | ||
"id": "adm-video", | ||
"seatBid": [ | ||
{ | ||
"bid": [ | ||
{ | ||
"id": "5fd7c8a6ff2f1f0d42ee6427", | ||
"impid": "video1", | ||
"price": 20, | ||
"adm": "<VAST version=\"2.0\"><Ad><Wrapper>http://example.com/vast.xml</Wrapper></Ad></VAST>", | ||
"adid": "1088", | ||
"adomain": [ | ||
"beachfront.io" | ||
], | ||
"cid": "277", | ||
"crid": "532", | ||
"w": 300, | ||
"h": 250, | ||
"ext": { | ||
"duration": 30 | ||
} | ||
} | ||
], | ||
"seat": "bfio-s-1" | ||
} | ||
] | ||
} | ||
} | ||
} | ||
], | ||
|
||
"expectedBidResponses": [ | ||
{ | ||
"currency": "USD", | ||
"bids": [ | ||
{ | ||
"bid": { | ||
"id": "video1AdmVideo", | ||
"impid": "video1", | ||
"price": 20, | ||
"adm": "<VAST version=\"2.0\"><Ad><Wrapper>http://example.com/vast.xml</Wrapper></Ad></VAST>", | ||
"adid": "1088", | ||
"adomain": [ | ||
"beachfront.io" | ||
], | ||
"cid": "277", | ||
"crid": "532", | ||
"w": 300, | ||
"h": 250, | ||
"ext": { | ||
"duration": 30 | ||
} | ||
}, | ||
"type": "video" | ||
} | ||
] | ||
} | ||
] | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,123 @@ | ||
{ | ||
"mockBidRequest": { | ||
"id": "adm-video", | ||
"imp": [ | ||
{ | ||
"id": "video1", | ||
"ext": { | ||
"bidder": { | ||
"bidfloor": 3.01, | ||
"appId": "videoAppId1" | ||
} | ||
}, | ||
"video": { | ||
"mimes": [ | ||
"video/mp4" | ||
], | ||
"context": "instream", | ||
"w": 300, | ||
"h": 250 | ||
} | ||
} | ||
], | ||
"app": { | ||
"bundle": "id1234567890" | ||
}, | ||
"device":{ | ||
"ip":"192.168.168.168" | ||
} | ||
}, | ||
|
||
"httpCalls": [ | ||
{ | ||
"expectedRequest": { | ||
"uri": "https://qa.beachrtb.com/bid.json?exchange_id=videoAppId1", | ||
"body": { | ||
"id": "adm-video", | ||
"imp": [ | ||
{ | ||
"video": { | ||
"w": 300, | ||
"h": 250, | ||
"mimes": [ | ||
"video/mp4" | ||
] | ||
}, | ||
"bidfloor": 3.01, | ||
"id": "video1", | ||
"secure": 0 | ||
} | ||
], | ||
"app": { | ||
"bundle": "id1234567890" | ||
}, | ||
"cur": [ | ||
"USD" | ||
], | ||
"device":{ | ||
"devicetype": 1, | ||
"ip":"192.168.168.168" | ||
} | ||
} | ||
}, | ||
"mockResponse": { | ||
"status": 200, | ||
"body": { | ||
"id": "adm-video", | ||
"seatBid": [ | ||
{ | ||
"bid": [ | ||
{ | ||
"id": "5fd7c8a6ff2f1f0d42ee6427", | ||
"impid": "video1", | ||
"price": 20, | ||
"adm": "<VAST version=\"2.0\"><Ad><Wrapper>http://example.com/vast.xml</Wrapper></Ad></VAST>", | ||
"adid": "1088", | ||
"adomain": [ | ||
"beachfront.io" | ||
], | ||
"cid": "277", | ||
"crid": "532", | ||
"w": 300, | ||
"h": 250, | ||
"ext": { | ||
"duration": 30 | ||
} | ||
} | ||
], | ||
"seat": "bfio-s-1" | ||
} | ||
] | ||
} | ||
} | ||
} | ||
], | ||
|
||
"expectedBidResponses": [ | ||
{ | ||
"currency": "USD", | ||
"bids": [ | ||
{ | ||
"bid": { | ||
"id": "video1AdmVideo", | ||
"impid": "video1", | ||
"price": 20, | ||
"adm": "<VAST version=\"2.0\"><Ad><Wrapper>http://example.com/vast.xml</Wrapper></Ad></VAST>", | ||
"adid": "1088", | ||
"adomain": [ | ||
"beachfront.io" | ||
], | ||
"cid": "277", | ||
"crid": "532", | ||
"w": 300, | ||
"h": 250, | ||
"ext": { | ||
"duration": 30 | ||
} | ||
}, | ||
"type": "video" | ||
} | ||
] | ||
} | ||
] | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,123 @@ | ||
{ | ||
"mockBidRequest": { | ||
"id": "adm-video", | ||
"imp": [ | ||
{ | ||
"id": "video1", | ||
"ext": { | ||
"bidder": { | ||
"bidfloor": 3.01, | ||
"appId": "videoAppId1" | ||
} | ||
}, | ||
"video": { | ||
"mimes": [ | ||
"video/mp4" | ||
], | ||
"context": "instream", | ||
"w": 300, | ||
"h": 250 | ||
} | ||
} | ||
], | ||
"app": { | ||
"bundle": "some.domain.us/some/page.html" | ||
}, | ||
"device":{ | ||
"ip":"192.168.168.168" | ||
} | ||
}, | ||
|
||
"httpCalls": [ | ||
{ | ||
"expectedRequest": { | ||
"uri": "https://qa.beachrtb.com/bid.json?exchange_id=videoAppId1", | ||
"body": { | ||
"id": "adm-video", | ||
"imp": [ | ||
{ | ||
"video": { | ||
"w": 300, | ||
"h": 250, | ||
"mimes": [ | ||
"video/mp4" | ||
] | ||
}, | ||
"bidfloor": 3.01, | ||
"id": "video1", | ||
"secure": 0 | ||
} | ||
], | ||
"app": { | ||
"bundle": "qwerty" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @muncha thanks for the clarification. I pushed your commits on this branch but I believe this test will fail because based on the malformed There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @mansinahar There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @mansinahar Just Googled a bit, and the Android bundle is not required to start with a TLD, which might be an expensive thing to validate completely without false positives. Say someone has an app developed by the Vatican - .va has to pass, but what about .lu? It's much simpler than that. Maybe this suggests some validation at an application level? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @muncha Well, Prebid Server just passes the app bundle information as is. In this case the beachfront adapter is using that to resolve the app domain and if sending an invalid app domain would cause the request to be marked invalid on your end then I'd say it'd be the beachfront adapter's responsibility to do that validation. If this won't affect anything on your side and you're okay with an invalid domain being sent in case of an invalid app bundle then the way you have the code right now should be fine. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @mansinahar There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @mansinahar ...or just add it in here if needed, if you think that's better. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @mansinahar It seems to do what it needs to do. Maybe you want to merge it in here, maybe I do a PR once this is merged? I still need to find out from beachfront if I should delete seemingly invalid bundle values or just pass it on, plus a test or two. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @mansinahar There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @muncha So let's get this one in and you can do a follow-up PR for validation as needed. We are cutting out a tag today and I would like to get this in if possible |
||
}, | ||
"cur": [ | ||
"USD" | ||
], | ||
"device":{ | ||
"devicetype": 1, | ||
"ip":"192.168.168.168" | ||
} | ||
} | ||
}, | ||
"mockResponse": { | ||
"status": 200, | ||
"body": { | ||
"id": "adm-video", | ||
"seatBid": [ | ||
{ | ||
"bid": [ | ||
{ | ||
"id": "5fd7c8a6ff2f1f0d42ee6427", | ||
"impid": "video1", | ||
"price": 20, | ||
"adm": "<VAST version=\"2.0\"><Ad><Wrapper>http://example.com/vast.xml</Wrapper></Ad></VAST>", | ||
"adid": "1088", | ||
"adomain": [ | ||
"beachfront.io" | ||
], | ||
"cid": "277", | ||
"crid": "532", | ||
"w": 300, | ||
"h": 250, | ||
"ext": { | ||
"duration": 30 | ||
} | ||
} | ||
], | ||
"seat": "bfio-s-1" | ||
} | ||
] | ||
} | ||
} | ||
} | ||
], | ||
|
||
"expectedBidResponses": [ | ||
{ | ||
"currency": "USD", | ||
"bids": [ | ||
{ | ||
"bid": { | ||
"id": "video1AdmVideo", | ||
"impid": "video1", | ||
"price": 20, | ||
"adm": "<VAST version=\"2.0\"><Ad><Wrapper>http://example.com/vast.xml</Wrapper></Ad></VAST>", | ||
"adid": "1088", | ||
"adomain": [ | ||
"beachfront.io" | ||
], | ||
"cid": "277", | ||
"crid": "532", | ||
"w": 300, | ||
"h": 250, | ||
"ext": { | ||
"duration": 30 | ||
} | ||
}, | ||
"type": "video" | ||
} | ||
] | ||
} | ||
] | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I confirmed that without these changes, the following JSON test fails with a data race condition as expected. Thanks @guscarreon