Skip to content

Commit c365b2a

Browse files
hhhjortsachin-pubmatic
authored andcommitted
Restore the AMP privacy exception as an option. (prebid#1311)
* Restore the AMP privacy exception as an option. * Adds missing test case * More PR feedback * Remove unused constant * Comment tweak
1 parent 3099dd7 commit c365b2a

File tree

4 files changed

+20
-0
lines changed

4 files changed

+20
-0
lines changed

endpoints/auction_test.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -458,6 +458,10 @@ func (m *auctionMockPermissions) PersonalInfoAllowed(ctx context.Context, bidder
458458
return m.allowPI, m.allowGeo, m.allowID, nil
459459
}
460460

461+
func (m *auctionMockPermissions) AMPException() bool {
462+
return false
463+
}
464+
461465
func TestBidSizeValidate(t *testing.T) {
462466
bids := make(pbs.PBSBidSlice, 0)
463467
// bid1 will be rejected due to undefined size when adunit has multiple sizes

endpoints/cookie_sync_test.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -257,3 +257,7 @@ func (g *gdprPerms) BidderSyncAllowed(ctx context.Context, bidder openrtb_ext.Bi
257257
func (g *gdprPerms) PersonalInfoAllowed(ctx context.Context, bidder openrtb_ext.BidderName, PublisherID string, gdprSignal gdpr.Signal, consent string, weakVendorEnforcement bool) (bool, bool, bool, error) {
258258
return true, true, true, nil
259259
}
260+
261+
func (g *gdprPerms) AMPException() bool {
262+
return false
263+
}

endpoints/setuid_test.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -443,6 +443,10 @@ func (g *mockPermsSetUID) PersonalInfoAllowed(ctx context.Context, bidder openrt
443443
return g.allowPI, g.allowPI, g.allowPI, nil
444444
}
445445

446+
func (g *mockPermsSetUID) AMPException() bool {
447+
return false
448+
}
449+
446450
func newFakeSyncer(familyName string) usersync.Usersyncer {
447451
return fakeSyncer{
448452
familyName: familyName,

gdpr/impl.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,10 @@ func (p *permissionsImpl) normalizeGDPR(gdprSignal Signal) Signal {
101101
return SignalYes
102102
}
103103

104+
func (p *permissionsImpl) AMPException() bool {
105+
return p.cfg.AMPException
106+
}
107+
104108
func (p *permissionsImpl) allowSync(ctx context.Context, vendorID uint16, consent string) (bool, error) {
105109

106110
if consent == "" {
@@ -283,3 +287,7 @@ func (a AlwaysFail) BidderSyncAllowed(ctx context.Context, bidder openrtb_ext.Bi
283287
func (a AlwaysFail) PersonalInfoAllowed(ctx context.Context, bidder openrtb_ext.BidderName, PublisherID string, gdprSignal Signal, consent string, weakVendorEnforcement bool) (bool, bool, bool, error) {
284288
return false, false, false, nil
285289
}
290+
291+
func (a AlwaysAllow) AMPException() bool {
292+
return false
293+
}

0 commit comments

Comments
 (0)