-
Notifications
You must be signed in to change notification settings - Fork 764
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
Add an app.id blacklist to PBS and reject requests from it #969
Merged
Merged
Changes from 17 commits
Commits
Show all changes
19 commits
Select commit
Hold shift + click to select a range
bb491aa
first draft, blacklist in yaml file
58cd8db
return if found in blacklist
05f5ea8
added error code check
73afa02
tests run smoothly now
ff515b3
Added default value to blacklisted_apps field
4763e18
Rolled back to use testify after Mansi's review
4215141
additional test case
d68adf9
updated so merge conflicts with maste don't exist
ffe35a8
resolving conflicts in a couple of files
05cb920
travis correction
80e0986
Merge branch 'master' into PBS-418
guscarreon 2eff679
corrected writeErrors() and handleErrors() as suggested by Mansi
3b22e7d
resolving conflicts before updating PR
89572f1
removed comment
9809852
Merge branch 'PBS-418' of https://github.com/guscarreon/prebid-server…
3953b3b
Finished Mansi's corrections
00be651
Boolean value correction
bcc65a8
Removed comment
187980c
Correct typo
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
84 changes: 84 additions & 0 deletions
84
endpoints/openrtb2/sample-requests/blacklisted/blacklisted-app.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,84 @@ | ||
{ | ||
"description": "This is a perfectly valid request except that it comes from a blacklisted App", | ||
"message": "Invalid request: Prebid-server does not process requests from App ID: spam_app\n", | ||
|
||
"requestPayload": { | ||
"id": "some-request-id", | ||
"user": { | ||
"ext": { | ||
"consent": "gdpr-consent-string", | ||
"prebid": { | ||
"buyeruids": { | ||
"appnexus": "override-appnexus-id-in-cookie" | ||
} | ||
} | ||
} | ||
}, | ||
"app": { | ||
"id": "spam_app" | ||
}, | ||
"regs": { | ||
"ext": { | ||
"gdpr": 1 | ||
} | ||
}, | ||
"imp": [ | ||
{ | ||
"id": "some-impression-id", | ||
"banner": { | ||
"format": [ | ||
{ | ||
"w": 300, | ||
"h": 250 | ||
}, | ||
{ | ||
"w": 300, | ||
"h": 600 | ||
} | ||
] | ||
}, | ||
"ext": { | ||
"appnexus": { | ||
"placementId": 10433394 | ||
}, | ||
"districtm": { | ||
"placementId": 105 | ||
}, | ||
"rubicon": { | ||
"accountId": 1001, | ||
"siteId": 113932, | ||
"zoneId": 535510 | ||
} | ||
} | ||
} | ||
], | ||
"tmax": 500, | ||
"ext": { | ||
"prebid": { | ||
"aliases": { | ||
"districtm": "appnexus" | ||
}, | ||
"bidadjustmentfactors": { | ||
"appnexus": 1.01, | ||
"districtm": 0.98, | ||
"rubicon": 0.99 | ||
}, | ||
"cache": { | ||
"bids": {} | ||
}, | ||
"targeting": { | ||
"includewinners": false, | ||
"pricegranularity": { | ||
"precision": 2, | ||
"ranges": [ | ||
{ | ||
"max": 20, | ||
"increment": 0.10 | ||
} | ||
] | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,6 +9,9 @@ | |
"mimes": [] | ||
} | ||
} | ||
] | ||
], | ||
"app": { | ||
"id": "app_001" | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,6 +9,9 @@ | |
"hmax":50 | ||
} | ||
} | ||
] | ||
], | ||
"app": { | ||
"id": "app_001" | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,6 +9,9 @@ | |
"hmin":50 | ||
} | ||
} | ||
] | ||
], | ||
"app": { | ||
"id": "app_001" | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,6 +7,9 @@ | |
"id": "imp-id", | ||
"banner": null | ||
} | ||
] | ||
], | ||
"app": { | ||
"id": "app_001" | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,6 +9,9 @@ | |
"wmax": 50 | ||
} | ||
} | ||
] | ||
], | ||
"app": { | ||
"id": "app_001" | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,6 +9,9 @@ | |
"wmin":50 | ||
} | ||
} | ||
] | ||
], | ||
"app": { | ||
"id": "app_001" | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -19,6 +19,9 @@ | |
] | ||
} | ||
} | ||
] | ||
], | ||
"app": { | ||
"id": "app_001" | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,6 +9,9 @@ | |
"format": [{}] | ||
} | ||
} | ||
] | ||
], | ||
"app": { | ||
"id": "app_001" | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,6 +14,9 @@ | |
] | ||
} | ||
} | ||
] | ||
], | ||
"app": { | ||
"id": "app_001" | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,6 +13,9 @@ | |
] | ||
} | ||
} | ||
] | ||
], | ||
"app": { | ||
"id": "app_001" | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,6 +14,9 @@ | |
] | ||
} | ||
} | ||
] | ||
], | ||
"app": { | ||
"id": "app_001" | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,6 +4,9 @@ | |
"id": "req-id", | ||
"imp": [ | ||
{ } | ||
] | ||
], | ||
"app": { | ||
"id": "app_001" | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,6 +12,9 @@ | |
}, | ||
"ext": {} | ||
} | ||
] | ||
], | ||
"app": { | ||
"id": "app_001" | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,6 +14,9 @@ | |
"appnexus": "invalidParams" | ||
} | ||
} | ||
] | ||
], | ||
"app": { | ||
"id": "app_001" | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,6 +16,9 @@ | |
} | ||
} | ||
} | ||
] | ||
], | ||
"app": { | ||
"id": "app_001" | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,6 +11,9 @@ | |
] | ||
} | ||
} | ||
] | ||
], | ||
"app": { | ||
"id": "app_001" | ||
} | ||
} | ||
} |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
@guscarreon Do we need a slice with empty string as default? I mean why can't it be just an empty slice?
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.
Since the
flow
keyword was added, theBlacklistedApps
field in line 55 below expects an array of strings.Therefore, I figured it was better to add a slice with an empty string because other
string
fields of theConfiguration
struct add an empty string instead of a nil string as default. Take theHost
field for example, inconfig/config.go
its default is set to an empty string as well asStatusResponse
andRecaptchaSecret
to name a few: