Skip to content
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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

przemkaczmarek
Copy link
Collaborator

No description provided.

@przemkaczmarek przemkaczmarek self-assigned this Dec 20, 2024
Copy link
Contributor

@SyntaxNode SyntaxNode left a 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)
Copy link
Contributor

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{})
Copy link
Contributor

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 {
Copy link
Contributor

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"`
Copy link
Contributor

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants