diff --git a/exchange/exchange.go b/exchange/exchange.go index 034eb9b67b4..438292063e8 100644 --- a/exchange/exchange.go +++ b/exchange/exchange.go @@ -92,14 +92,17 @@ func NewExchange(adapters map[openrtb_ext.BidderName]adaptedBidder, cache prebid GDPR: cfg.GDPR, LMT: cfg.LMT, }, + } +} + // AuctionRequest holds the bid request for the auction // and all other information needed to process that request type AuctionRequest struct { BidRequest *openrtb.BidRequest Account config.Account UserSyncs IdFetcher - StartTime time.Time RequestType pbsmetrics.RequestType + StartTime time.Time // LegacyLabels is included here for temporary compatability with cleanOpenRTBRequests // in HoldAuction until we get to factoring it away. Do not use for anything new. @@ -107,15 +110,13 @@ type AuctionRequest struct { } // BidderRequest holds the bidder specific request and all other -// information needed by to process that request. +// information needed to process that bidder request. type BidderRequest struct { BidRequest *openrtb.BidRequest BidderName openrtb_ext.BidderName BidderCoreName openrtb_ext.BidderName BidderLabels pbsmetrics.AdapterLabels } - } -} func (e *exchange) HoldAuction(ctx context.Context, r AuctionRequest, debugLog *DebugLog) (*openrtb.BidResponse, error) { var err error @@ -881,11 +882,11 @@ func buildCacheURL(cache prebid_cache_client.Client, uuid string) string { return strings.TrimPrefix(cacheURL.String(), "//") } -func listBiddersWithRequests(bidders []BidderRequest) []openrtb_ext.BidderName { +func listBiddersWithRequests(bidderRequests []BidderRequest) []openrtb_ext.BidderName { liveAdapters := make([]openrtb_ext.BidderName, len(bidders)) i := 0 - for _, bidder := range bidders { - liveAdapters[i] = bidder.BidderName + for _, bidderRequest := range bidderRequests { + liveAdapters[i] = bidderRequest.BidderName i++ } // Randomize the list of adapters to make the auction more fair diff --git a/exchange/utils.go b/exchange/utils.go index f571650059b..68b7cecbce4 100644 --- a/exchange/utils.go +++ b/exchange/utils.go @@ -111,14 +111,14 @@ func cleanOpenRTBRequests(ctx context.Context, } // bidder level privacy policies - for _, bidder := range bidderRequests { + for _, bidderRequest := range bidderRequests { // CCPA - privacyEnforcement.CCPA = ccpaEnforcer.ShouldEnforce(bidder.BidderName.String()) + privacyEnforcement.CCPA = ccpaEnforcer.ShouldEnforce(bidderRequest.BidderName.String()) // GDPR if gdpr == 1 && gdprEnabled { var publisherID = req.LegacyLabels.PubID - _, geo, id, err := gDPR.PersonalInfoAllowed(ctx, bidder.BidderCoreName, publisherID, consent) + _, geo, id, err := gDPR.PersonalInfoAllowed(ctx, bidderRequest.BidderCoreName, publisherID, consent) privacyEnforcement.GDPRGeo = !geo && err == nil privacyEnforcement.GDPRID = !id && err == nil } else { @@ -126,7 +126,7 @@ func cleanOpenRTBRequests(ctx context.Context, privacyEnforcement.GDPRID = false } - privacyEnforcement.Apply(bidder.BidRequest, ampGDPRException) + privacyEnforcement.Apply(bidderRequest.BidRequest, ampGDPRException) } return