Skip to content

Commit

Permalink
Merge confict mistake
Browse files Browse the repository at this point in the history
  • Loading branch information
mansinahar committed Dec 4, 2020
1 parent f8bbf0f commit 8f45c6d
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 11 deletions.
15 changes: 8 additions & 7 deletions exchange/exchange.go
Original file line number Diff line number Diff line change
Expand Up @@ -92,30 +92,31 @@ 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.
LegacyLabels pbsmetrics.Labels
}

// 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
Expand Down Expand Up @@ -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
Expand Down
8 changes: 4 additions & 4 deletions exchange/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -111,22 +111,22 @@ 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 {
privacyEnforcement.GDPRGeo = false
privacyEnforcement.GDPRID = false
}

privacyEnforcement.Apply(bidder.BidRequest, ampGDPRException)
privacyEnforcement.Apply(bidderRequest.BidRequest, ampGDPRException)
}

return
Expand Down

0 comments on commit 8f45c6d

Please sign in to comment.