-
Notifications
You must be signed in to change notification settings - Fork 751
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
Account-level override for the list of EEA countries #3678 #4118
base: master
Are you sure you want to change the base?
Account-level override for the list of EEA countries #3678 #4118
Conversation
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.
@bsardo Configs that can be overridden at the account level are stored in the host level default account object. However, in this case the EEA Countries list is part of a different config area. Curious on your thoughts. Should the current location be deprecated in favor of account level?
@@ -316,8 +316,17 @@ func (e *exchange) HoldAuction(ctx context.Context, r *AuctionRequest, debugLog | |||
|
|||
recordImpMetrics(r.BidRequestWrapper, e.me) | |||
|
|||
// Retrieve host and account-level EEA countries config | |||
eeaCountries := SelectEEACountries(e.privacyConfig.GDPR.EEACountries, r.Account.EEACountries) |
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.
Nitpick: The comment is not necessary. The inputs are clearly host and account level, but if you'd like to make that association clearer consider a revised method name.
eeaCountries := SelectEEACountries(e.privacyConfig.GDPR.EEACountries, r.Account.EEACountries) | ||
|
||
// Create a map for efficient lookup | ||
eeaCountriesMap := make(map[string]struct{}) |
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.
The performance benefit of a map only comes into play when the map is used more than once. As it is now, this map is only referenced once in parseGDPRDefaultValue
. This forces the processing of every element with the overhead of map creation. It would be more efficient to use a linear search in this instance.
Eventually, this map can live in the account config object when that caching layer is improved. Doesn't make sense there right now though.
@@ -381,3 +382,12 @@ func (ip *IPv4) Validate(errs []error) []error { | |||
} | |||
return errs | |||
} | |||
|
|||
func (a *Account) ValidateEEACountries(errs []error) []error { |
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.
This validation method is not called.
@@ -42,6 +42,7 @@ type Account struct { | |||
DefaultBidLimit int `mapstructure:"default_bid_limit" json:"default_bid_limit"` | |||
BidAdjustments *openrtb_ext.ExtRequestPrebidBidAdjustments `mapstructure:"bidadjustments" json:"bidadjustments"` | |||
Privacy AccountPrivacy `mapstructure:"privacy" json:"privacy"` | |||
EEACountries []string `mapstructure:"eea_countries" json:"eea_countries"` |
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.
Perhaps it would be better to include this within the AccountGDPR object since it's only used for GDPR enforcement and to match the host configuration of .privacy.gdpr. eea_countries
.
No description provided.