-
Notifications
You must be signed in to change notification settings - Fork 735
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
Pass Global Privacy Control header to bidders #1789
Merged
hhhjort
merged 9 commits into
prebid:master
from
viveknarang:1712_feature_pass_GPC_header
May 19, 2021
Merged
Changes from 4 commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
822f326
Feature Request: Ability to pass Sec-GPC header to the bidder endpoin…
viveknarang d89f2b1
making Sec-GPC value check more strict
viveknarang c9104c2
minor syntax change
viveknarang 3bbbe24
gofmt fixes
viveknarang f50e184
updates against draft-code-review:one, more to come soon.
viveknarang b4d342e
adding a unit test
viveknarang 1dcff62
Adding a test and request header clone update
viveknarang 40daf2a
modified one test and related logic
viveknarang 050413a
modifying the last test added with slight more modification of the logic
viveknarang 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -108,6 +108,7 @@ type AuctionRequest struct { | |
RequestType metrics.RequestType | ||
StartTime time.Time | ||
Warnings []error | ||
SecGPCFlag string | ||
|
||
// LegacyLabels is included here for temporary compatability with cleanOpenRTBRequests | ||
// in HoldAuction until we get to factoring it away. Do not use for anything new. | ||
|
@@ -172,7 +173,7 @@ func (e *exchange) HoldAuction(ctx context.Context, r AuctionRequest, debugLog * | |
// Get currency rates conversions for the auction | ||
conversions := e.currencyConverter.Rates() | ||
|
||
adapterBids, adapterExtra, anyBidsReturned := e.getAllBids(auctionCtx, bidderRequests, bidAdjustmentFactors, conversions, r.Account.DebugAllow) | ||
adapterBids, adapterExtra, anyBidsReturned := e.getAllBids(auctionCtx, bidderRequests, bidAdjustmentFactors, conversions, r.Account.DebugAllow, r.SecGPCFlag) | ||
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. This looks like a good approach to me. We might refactor this in the future since |
||
|
||
var auc *auction | ||
var cacheErrs []error | ||
|
@@ -370,7 +371,7 @@ func (e *exchange) getAllBids( | |
bidderRequests []BidderRequest, | ||
bidAdjustments map[string]float64, | ||
conversions currency.Conversions, | ||
accountDebugAllowed bool) ( | ||
accountDebugAllowed bool, secGPCFlag string) ( | ||
map[openrtb_ext.BidderName]*pbsOrtbSeatBid, | ||
map[openrtb_ext.BidderName]*seatResponseExtra, bool) { | ||
// Set up pointers to the bid results | ||
|
@@ -401,6 +402,7 @@ func (e *exchange) getAllBids( | |
} | ||
var reqInfo adapters.ExtraRequestInfo | ||
reqInfo.PbsEntryPoint = bidderRequest.BidderLabels.RType | ||
reqInfo.SecGPCFlag = secGPCFlag | ||
bids, err := e.adapterMap[bidderRequest.BidderCoreName].requestBid(ctx, bidderRequest.BidRequest, bidderRequest.BidderName, adjustmentFactor, conversions, &reqInfo, accountDebugAllowed) | ||
|
||
// Add in time reporting | ||
|
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.
I'm not sure we need to use the exact cookie name as the variable. IMHO, a more straight forward name, such as "GlobalPrivacyControl" or "GlobalPrivacyControlHeader" would be easier to read in adapter code.
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.
Thanks for spending your time reviewing this draft PR. I am new to the community and I hope to contribute regularly. I have updated this with your recommendation. Thanks!
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.
Welcome to the community. We're very welcoming of new regular contributors. Please let us know via a comment on the GitHub Issues what you'd like to work on next so there's no duplicate effort.