-
Notifications
You must be signed in to change notification settings - Fork 769
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
TransmitUserFPD and TransmitPreciseGeo activity integration #2906
Conversation
4225f2f
to
e4e9d80
Compare
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.
LGTM
exchange/utils.go
Outdated
privacyEnforcement.CCPA = ccpaEnforcer.ShouldEnforce(bidderRequest.BidderName.String()) | ||
// potentially block passing IDs based on COPPA | ||
if req.BidRequest.Regs != nil && req.BidRequest.Regs.COPPA == 1 { | ||
privacyEnforcement.COPPA = true | ||
} |
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.
COPPA is already set at the start of the loop. Why do we need to include it again here?
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.
Right, removed
exchange/utils.go
Outdated
privacyEnforcement.COPPA = true | ||
} | ||
// potentially block passing geo based on LMT | ||
privacyEnforcement.LMT = lmtEnforcer.ShouldEnforce(unknownBidder) |
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.
COPPA and LMT are already set at the start of the loop. Why do we need to include it again here?
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.
Removed
} | ||
if test.expectedScrubDeviceExecuted { | ||
m.On("ScrubDevice", req.Device, ScrubStrategyDeviceIDAll, ScrubStrategyIPV4Lowest8, ScrubStrategyIPV6Lowest32, ScrubStrategyGeoFull).Return(replacedDevice).Once() | ||
} |
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.
Nice use of the mock library.
privacy/scrubber.go
Outdated
//transmitEids covers user.eids and user.ext.eids | ||
if bidRequest.User != nil { | ||
bidRequest.User.EIDs = nil | ||
bidRequest.User.Ext = scrubExtIDs(bidRequest.User.Ext, "eids") |
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.
We could unmarshal user.ext
at the start of this method if either UFPD or Eids are true, modify as necessary throughout the function, and at the end marshal it back once more if either UFPD or Eids are true. That would bring us down to at most 1 unmarshal/marshal pair for each ext. Thoughts?
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.
Done. Please see this change in this commit bf4b27b
privacy/scrubber.go
Outdated
} | ||
} | ||
|
||
if userExtModified { | ||
userExt, _ := json.Marshal(userExtParsed) | ||
bidRequest.User.Ext = userExt |
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.
Are we sure that User
is not a shared object at this point?
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 bidRequest is absolutely at least a shallow copy at this point. I'm good with adding a shallow clone here to be certain if it's not otherwise proven. We'll replace it in the near future with the RequestWrapper and the cost of cloning the User object doesn't seem too concerning.
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.
Added clones.
Will it be ok if I put a follow up PR with this change only? |
Yup. Let's go with the stricter 32 bits for now. |
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.
LGTM
This PR contains existing GDPR related code refactoring due to activity integration.
I deviate from existing scrubber strategy implementation. New scrubber function
ScrubRequest
receives enforcer data, not a strategy. There are couple of reasons for this:bidRequest.User.EIDs = nil
,bidRequest.User.Data = nil
and in User.Ext remove "data" instead of "eids".With this implementation all existing unit tests pass, local testing of activities looks good.