diff --git a/config/config.go b/config/config.go index 69113cc3c01..1d25b65a055 100755 --- a/config/config.go +++ b/config/config.go @@ -218,7 +218,6 @@ type GDPR struct { NonStandardPublisherMap map[string]struct{} TCF1 TCF1 `mapstructure:"tcf1"` TCF2 TCF2 `mapstructure:"tcf2"` - AMPException bool `mapstructure:"amp_exception"` // EEACountries (EEA = European Economic Area) are a list of countries where we should assume GDPR applies. // If the gdpr flag is unset in a request, but geo.country is set, we will assume GDPR applies if and only // if the country matches one on this list. If both the GDPR flag and country are not set, we default @@ -1036,7 +1035,6 @@ func SetupViper(v *viper.Viper, filename string) { v.SetDefault("gdpr.tcf2.special_purpose1.enabled", true) v.SetDefault("gdpr.tcf2.purpose_one_treatement.enabled", true) v.SetDefault("gdpr.tcf2.purpose_one_treatement.access_allowed", true) - v.SetDefault("gdpr.amp_exception", false) v.SetDefault("gdpr.eea_countries", []string{"ALA", "AUT", "BEL", "BGR", "HRV", "CYP", "CZE", "DNK", "EST", "FIN", "FRA", "GUF", "DEU", "GIB", "GRC", "GLP", "GGY", "HUN", "ISL", "IRL", "IMN", "ITA", "JEY", "LVA", "LIE", "LTU", "LUX", "MLT", "MTQ", "MYT", "NLD", "NOR", "POL", "PRT", "REU", "ROU", "BLM", "MAF", "SPM", diff --git a/exchange/utils.go b/exchange/utils.go index bc813df0520..6bb5d75ab4f 100644 --- a/exchange/utils.go +++ b/exchange/utils.go @@ -81,7 +81,6 @@ func cleanOpenRTBRequests(ctx context.Context, gdpr := extractGDPR(orig, usersyncIfAmbiguous) consent := extractConsent(orig) - ampGDPRException := (labels.RType == pbsmetrics.ReqTypeAMP) && gDPR.AMPException() ccpaEnforcer, err := extractCCPA(orig, privacyConfig, aliases) if err != nil { @@ -131,7 +130,7 @@ func cleanOpenRTBRequests(ctx context.Context, privacyEnforcement.GDPRID = false } - privacyEnforcement.Apply(bidReq, ampGDPRException) + privacyEnforcement.Apply(bidReq) } return diff --git a/gdpr/gdpr.go b/gdpr/gdpr.go index 6d447beb438..60a7cc1e2c0 100644 --- a/gdpr/gdpr.go +++ b/gdpr/gdpr.go @@ -24,9 +24,6 @@ type Permissions interface { // // If the consent string was nonsensical, the returned error will be an ErrorMalformedConsent. PersonalInfoAllowed(ctx context.Context, bidder openrtb_ext.BidderName, PublisherID string, consent string) (bool, bool, bool, error) - - // Exposes the AMP execption flag - AMPException() bool } // Versions of the GDPR TCF technical specification. diff --git a/gdpr/impl.go b/gdpr/impl.go index 2fbd9c5a07c..5b3b86fe557 100644 --- a/gdpr/impl.go +++ b/gdpr/impl.go @@ -60,10 +60,6 @@ func (p *permissionsImpl) PersonalInfoAllowed(ctx context.Context, bidder openrt return false, false, false, nil } -func (p *permissionsImpl) AMPException() bool { - return p.cfg.AMPException -} - func (p *permissionsImpl) allowSync(ctx context.Context, vendorID uint16, consent string) (bool, error) { // If we're not given a consent string, respect the preferences in the app config. if consent == "" { @@ -225,10 +221,6 @@ func (a AlwaysAllow) PersonalInfoAllowed(ctx context.Context, bidder openrtb_ext return true, true, true, nil } -func (a AlwaysAllow) AMPException() bool { - return false -} - // Exporting to allow for easy test setups type AlwaysFail struct{} @@ -243,7 +235,3 @@ func (a AlwaysFail) BidderSyncAllowed(ctx context.Context, bidder openrtb_ext.Bi func (a AlwaysFail) PersonalInfoAllowed(ctx context.Context, bidder openrtb_ext.BidderName, PublisherID string, consent string) (bool, bool, bool, error) { return false, false, false, nil } - -func (a AlwaysFail) AMPException() bool { - return false -} diff --git a/privacy/enforcement.go b/privacy/enforcement.go index 3f157329cf6..64070ae3a6a 100644 --- a/privacy/enforcement.go +++ b/privacy/enforcement.go @@ -19,14 +19,14 @@ func (e Enforcement) Any() bool { } // Apply cleans personally identifiable information from an OpenRTB bid request. -func (e Enforcement) Apply(bidRequest *openrtb.BidRequest, ampGDPRException bool) { - e.apply(bidRequest, ampGDPRException, NewScrubber()) +func (e Enforcement) Apply(bidRequest *openrtb.BidRequest) { + e.apply(bidRequest, NewScrubber()) } -func (e Enforcement) apply(bidRequest *openrtb.BidRequest, ampGDPRException bool, scrubber Scrubber) { +func (e Enforcement) apply(bidRequest *openrtb.BidRequest, scrubber Scrubber) { if bidRequest != nil && e.Any() { bidRequest.Device = scrubber.ScrubDevice(bidRequest.Device, e.getDeviceIDScrubStrategy(), e.getIPv4ScrubStrategy(), e.getIPv6ScrubStrategy(), e.getGeoScrubStrategy()) - bidRequest.User = scrubber.ScrubUser(bidRequest.User, e.getUserScrubStrategy(ampGDPRException), e.getGeoScrubStrategy()) + bidRequest.User = scrubber.ScrubUser(bidRequest.User, e.getUserScrubStrategy(), e.getGeoScrubStrategy()) } } @@ -70,7 +70,7 @@ func (e Enforcement) getGeoScrubStrategy() ScrubStrategyGeo { return ScrubStrategyGeoNone } -func (e Enforcement) getUserScrubStrategy(ampGDPRException bool) ScrubStrategyUser { +func (e Enforcement) getUserScrubStrategy() ScrubStrategyUser { if e.COPPA { return ScrubStrategyUserIDAndDemographic } @@ -79,7 +79,7 @@ func (e Enforcement) getUserScrubStrategy(ampGDPRException bool) ScrubStrategyUs return ScrubStrategyUserID } - if e.GDPRID && !ampGDPRException { + if e.GDPRID { return ScrubStrategyUserID } diff --git a/privacy/enforcement_test.go b/privacy/enforcement_test.go index 0cf36a614c4..a55ab357960 100644 --- a/privacy/enforcement_test.go +++ b/privacy/enforcement_test.go @@ -132,23 +132,6 @@ func TestApply(t *testing.T) { expectedUser: ScrubStrategyUserID, expectedUserGeo: ScrubStrategyGeoReducedPrecision, }, - { - description: "GDPR Only - Full - AMP Exception", - enforcement: Enforcement{ - CCPA: false, - COPPA: false, - GDPRGeo: true, - GDPRID: true, - LMT: false, - }, - ampGDPRException: true, - expectedDeviceID: ScrubStrategyDeviceIDAll, - expectedDeviceIPv4: ScrubStrategyIPV4Lowest8, - expectedDeviceIPv6: ScrubStrategyIPV6Lowest16, - expectedDeviceGeo: ScrubStrategyGeoReducedPrecision, - expectedUser: ScrubStrategyUserNone, - expectedUserGeo: ScrubStrategyGeoReducedPrecision, - }, { description: "GDPR Only - ID Only", enforcement: Enforcement{ @@ -166,23 +149,6 @@ func TestApply(t *testing.T) { expectedUser: ScrubStrategyUserID, expectedUserGeo: ScrubStrategyGeoNone, }, - { - description: "GDPR Only - ID Only - AMP Exception", - enforcement: Enforcement{ - CCPA: false, - COPPA: false, - GDPRGeo: false, - GDPRID: true, - LMT: false, - }, - ampGDPRException: true, - expectedDeviceID: ScrubStrategyDeviceIDAll, - expectedDeviceIPv4: ScrubStrategyIPV4None, - expectedDeviceIPv6: ScrubStrategyIPV6None, - expectedDeviceGeo: ScrubStrategyGeoNone, - expectedUser: ScrubStrategyUserNone, - expectedUserGeo: ScrubStrategyGeoNone, - }, { description: "GDPR Only - Geo Only", enforcement: Enforcement{ @@ -216,23 +182,6 @@ func TestApply(t *testing.T) { expectedUser: ScrubStrategyUserID, expectedUserGeo: ScrubStrategyGeoReducedPrecision, }, - { - description: "Interactions: COPPA Only + AMP Exception", - enforcement: Enforcement{ - CCPA: false, - COPPA: true, - GDPRGeo: false, - GDPRID: false, - LMT: false, - }, - ampGDPRException: true, - expectedDeviceID: ScrubStrategyDeviceIDAll, - expectedDeviceIPv4: ScrubStrategyIPV4Lowest8, - expectedDeviceIPv6: ScrubStrategyIPV6Lowest32, - expectedDeviceGeo: ScrubStrategyGeoFull, - expectedUser: ScrubStrategyUserIDAndDemographic, - expectedUserGeo: ScrubStrategyGeoFull, - }, { description: "Interactions: COPPA + GDPR Full + AMP Exception", enforcement: Enforcement{ @@ -264,7 +213,7 @@ func TestApply(t *testing.T) { m.On("ScrubDevice", req.Device, test.expectedDeviceID, test.expectedDeviceIPv4, test.expectedDeviceIPv6, test.expectedDeviceGeo).Return(replacedDevice).Once() m.On("ScrubUser", req.User, test.expectedUser, test.expectedUserGeo).Return(replacedUser).Once() - test.enforcement.apply(req, test.ampGDPRException, m) + test.enforcement.apply(req, m) m.AssertExpectations(t) assert.Same(t, replacedDevice, req.Device, "Device") @@ -284,7 +233,7 @@ func TestApplyNoneApplicable(t *testing.T) { GDPRID: false, LMT: false, } - enforcement.apply(req, false, m) + enforcement.apply(req, m) m.AssertNotCalled(t, "ScrubDevice") m.AssertNotCalled(t, "ScrubUser") @@ -294,7 +243,7 @@ func TestApplyNil(t *testing.T) { m := &mockScrubber{} enforcement := Enforcement{} - enforcement.apply(nil, false, m) + enforcement.apply(nil, m) m.AssertNotCalled(t, "ScrubDevice") m.AssertNotCalled(t, "ScrubUser")