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

CCPA Publisher No Sale Relationships #1465

Merged
merged 33 commits into from
Sep 17, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
39516e9
CCPA NoSale Publisher Override
SyntaxNode May 26, 2020
68e0eb6
Added JSON Tests
SyntaxNode May 26, 2020
c3482be
Expanded Test Cases
SyntaxNode May 27, 2020
2cdc538
Allow Non-Schema JSON In Req.Ext
SyntaxNode May 28, 2020
15a81a6
Enhanced Read Tests
SyntaxNode May 28, 2020
38e770b
Merge branch 'master' into ccpa_options
SyntaxNode Jun 1, 2020
6f422cc
Minor Refactor + Test Update
SyntaxNode Jun 1, 2020
41dff0c
Code Review Feedback
SyntaxNode Jun 2, 2020
c4e0433
WIP
SyntaxNode Jun 3, 2020
c2766b7
Merge branch 'master' into ccpa_options
SyntaxNode Jun 23, 2020
b625439
Merge branch 'master' into ccpa_options
SyntaxNode Jul 2, 2020
bf4f968
Merge branch 'master' into ccpa_options
SyntaxNode Aug 6, 2020
d00742f
Updated CCPA Policy
SyntaxNode Aug 18, 2020
fa6488f
Updated CCPA Policy (Missing Files)
SyntaxNode Aug 18, 2020
8994fc1
Better Error Messages
SyntaxNode Aug 18, 2020
b17d345
Added Parsed Policy
SyntaxNode Aug 18, 2020
fb2a114
Refactored Policy + Implemented ParsedPolicy
SyntaxNode Aug 21, 2020
ee6aebb
WIP - Change In Direction For Writes
SyntaxNode Aug 26, 2020
74c7765
WIP
SyntaxNode Aug 27, 2020
c1496e6
Final? Pass At Privacy Package Update
SyntaxNode Aug 27, 2020
6cf462f
Updated UserSync Package + Adatper Calls
SyntaxNode Aug 27, 2020
8e9a7a8
Back To Building
SyntaxNode Aug 27, 2020
4e36e02
Always Pass Valid Bidders To CCPA Parse
SyntaxNode Aug 27, 2020
986670a
Reverted Unnecessary Changes + Fix Error Check Bug
SyntaxNode Aug 27, 2020
1dcf17a
Corrected Test Expecations
SyntaxNode Aug 27, 2020
e06c133
Expand Test Coverage
SyntaxNode Aug 27, 2020
420a2af
Merge branch 'master' into ccpa_options
SyntaxNode Aug 27, 2020
74441c8
Fix Merge Conflict
SyntaxNode Aug 27, 2020
7160c66
Revert Behavior Change
SyntaxNode Aug 27, 2020
12ae724
Introduced Privacy Enforcer
SyntaxNode Aug 28, 2020
c2f9154
Merge branch 'master' into ccpa_options
SyntaxNode Sep 3, 2020
923e524
Fixed Merge Conflict
SyntaxNode Sep 3, 2020
293e163
Rename Method To Improve Clarity
SyntaxNode Sep 4, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion adapters/33across/usersync_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ func Test33AcrossSyncer(t *testing.T) {
Consent: "B",
},
CCPA: ccpa.Policy{
Value: "C",
Consent: "C",
},
})

Expand Down
2 changes: 1 addition & 1 deletion adapters/adkernel/usersync_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ func TestAdkernelAdnSyncer(t *testing.T) {
Consent: "BONciguONcjGKADACHENAOLS1rAHDAFAAEAASABQAMwAeACEAFw",
},
CCPA: ccpa.Policy{
Value: "1NYN",
Consent: "1NYN",
},
})

Expand Down
2 changes: 1 addition & 1 deletion adapters/adkernelAdn/usersync_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ func TestAdkernelAdnSyncer(t *testing.T) {
Consent: "BONciguONcjGKADACHENAOLS1rAHDAFAAEAASABQAMwAeACEAFw",
},
CCPA: ccpa.Policy{
Value: "1NYN",
Consent: "1NYN",
},
})

Expand Down
2 changes: 1 addition & 1 deletion adapters/adman/usersync_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ func TestAdmanSyncer(t *testing.T) {
Consent: "ANDFJDS",
},
CCPA: ccpa.Policy{
Value: "1-YY",
Consent: "1-YY",
},
})

Expand Down
7 changes: 4 additions & 3 deletions adapters/admixer/usersync_test.go
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
package admixer

import (
"testing"
"text/template"

"github.com/prebid/prebid-server/privacy"
"github.com/prebid/prebid-server/privacy/ccpa"
"github.com/prebid/prebid-server/privacy/gdpr"
"github.com/stretchr/testify/assert"
"testing"
"text/template"
)

func TestAdmixerSyncer(t *testing.T) {
Expand All @@ -22,7 +23,7 @@ func TestAdmixerSyncer(t *testing.T) {
Consent: "B",
},
CCPA: ccpa.Policy{
Value: "C",
Consent: "C",
},
})

Expand Down
5 changes: 3 additions & 2 deletions adapters/adtarget/usersync_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,11 @@ package adtarget

import (
"fmt"
"github.com/prebid/prebid-server/privacy/ccpa"
"testing"
"text/template"

"github.com/prebid/prebid-server/privacy/ccpa"

"github.com/prebid/prebid-server/privacy"
"github.com/prebid/prebid-server/privacy/gdpr"
"github.com/stretchr/testify/assert"
Expand All @@ -25,7 +26,7 @@ func TestAdtargetSyncer(t *testing.T) {
Consent: "123",
},
CCPA: ccpa.Policy{
Value: "1-YY",
Consent: "1-YY",
},
})

Expand Down
5 changes: 3 additions & 2 deletions adapters/aja/usersync_test.go
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
package aja

import (
"github.com/prebid/prebid-server/privacy/ccpa"
"testing"
"text/template"

"github.com/prebid/prebid-server/privacy/ccpa"

"github.com/prebid/prebid-server/privacy"
"github.com/prebid/prebid-server/privacy/gdpr"
"github.com/stretchr/testify/assert"
Expand All @@ -23,7 +24,7 @@ func TestAJASyncer(t *testing.T) {
Consent: "BOPVK28OVJoTBABABAENBs-AAAAhuAKAANAAoACwAGgAPAAxAB0AHgAQAAiABOADkA",
},
CCPA: ccpa.Policy{
Value: "C",
Consent: "C",
},
})

Expand Down
2 changes: 1 addition & 1 deletion adapters/avocet/usersync_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ func TestAvocetSyncer(t *testing.T) {
Consent: "ConsentString",
},
CCPA: ccpa.Policy{
Value: "PrivacyString",
Consent: "PrivacyString",
},
})

Expand Down
2 changes: 1 addition & 1 deletion adapters/beachfront/usersync_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ func TestBeachfrontSyncer(t *testing.T) {
Consent: "B",
},
CCPA: ccpa.Policy{
Value: "C",
Consent: "C",
},
})

Expand Down
2 changes: 1 addition & 1 deletion adapters/beintoo/usersync_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ func TestBeintooSyncer(t *testing.T) {
Consent: "BOPVK28OVJoTBABABAENBs-AAAAhuAKAANAAoACwAGgAPAAxAB0AHgAQAAiABOADkA",
},
CCPA: ccpa.Policy{
Value: "1NYN",
Consent: "1NYN",
},
})

Expand Down
13 changes: 7 additions & 6 deletions adapters/consumable/consumable.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,16 @@ package consumable
import (
"encoding/json"
"fmt"
"net/http"
"net/url"
"strconv"
"strings"

"github.com/mxmCherry/openrtb"
"github.com/prebid/prebid-server/adapters"
"github.com/prebid/prebid-server/errortypes"
"github.com/prebid/prebid-server/openrtb_ext"
"github.com/prebid/prebid-server/privacy/ccpa"
"net/http"
"net/url"
"strconv"
"strings"
)

type ConsumableAdapter struct {
Expand Down Expand Up @@ -136,9 +137,9 @@ func (a *ConsumableAdapter) MakeRequests(request *openrtb.BidRequest, reqInfo *a

gdpr := bidGdpr{}

ccpaPolicy, err := ccpa.ReadPolicy(request)
ccpaPolicy, err := ccpa.ReadFromRequest(request)
if err == nil {
body.CCPA = ccpaPolicy.Value
body.CCPA = ccpaPolicy.Consent
}

// TODO: Replace with gdpr.ReadPolicy when it is available
Expand Down
2 changes: 1 addition & 1 deletion adapters/consumable/usersync_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ func TestConsumableSyncer(t *testing.T) {
Consent: "B",
},
CCPA: ccpa.Policy{
Value: "C",
Consent: "C",
},
})

Expand Down
2 changes: 1 addition & 1 deletion adapters/datablocks/usersync_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ func TestDatablocksSyncer(t *testing.T) {
Consent: "BONciguONcjGKADACHENAOLS1rAHDAFAAEAASABQAMwAeACEAFw",
},
CCPA: ccpa.Policy{
Value: "1NYN",
Consent: "1NYN",
},
})

Expand Down
2 changes: 1 addition & 1 deletion adapters/emx_digital/usersync_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ func TestEMXDigitalSyncer(t *testing.T) {
Consent: "BOPVK28OVJoTBABABAENBs-AAAAhuAKAANAAoACwAGgAPAAxAB0AHgAQAAiABOADkA",
},
CCPA: ccpa.Policy{
Value: "1NYN",
Consent: "1NYN",
},
})

Expand Down
2 changes: 1 addition & 1 deletion adapters/engagebdr/usersync_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ func TestEngageBDRSyncer(t *testing.T) {
Consent: "BOPVK28OVJoTBABABAENBs-AAAAhuAKAANAAoACwAGgAPAAxAB0AHgAQAAiABOADkA",
},
CCPA: ccpa.Policy{
Value: "1NYN",
Consent: "1NYN",
},
})

Expand Down
2 changes: 1 addition & 1 deletion adapters/gamoshi/usersync_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ func TestGamoshiSyncer(t *testing.T) {
syncer := NewGamoshiSyncer(syncURLTemplate)
syncInfo, err := syncer.GetUsersyncInfo(privacy.Policies{
CCPA: ccpa.Policy{
Value: "anyValue",
Consent: "anyValue",
},
})

Expand Down
2 changes: 1 addition & 1 deletion adapters/gumgum/usersync_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ func TestGumGumSyncer(t *testing.T) {
Consent: "BOPVK28OVJoTBABABAENBs-AAAAhuAKAANAAoACwAGgAPAAxAB0AHgAQAAiABOADkA",
},
CCPA: ccpa.Policy{
Value: "1NYN",
Consent: "1NYN",
},
})

Expand Down
2 changes: 1 addition & 1 deletion adapters/improvedigital/usersync_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ func TestImprovedigitalSyncer(t *testing.T) {
Consent: "B",
},
CCPA: ccpa.Policy{
Value: "C",
Consent: "C",
},
})

Expand Down
2 changes: 1 addition & 1 deletion adapters/marsmedia/usersync_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ func TestMarsmediaSyncer(t *testing.T) {
Consent: "B",
},
CCPA: ccpa.Policy{
Value: "C",
Consent: "C",
},
})

Expand Down
24 changes: 12 additions & 12 deletions adapters/nanointeractive/usersync_test.go
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
package nanointeractive

import (
"github.com/prebid/prebid-server/privacy/ccpa"
"github.com/prebid/prebid-server/privacy/gdpr"
"testing"
"text/template"

"github.com/prebid/prebid-server/privacy/ccpa"
"github.com/prebid/prebid-server/privacy/gdpr"

"github.com/prebid/prebid-server/privacy"
"github.com/stretchr/testify/assert"
)
Expand All @@ -17,16 +18,15 @@ func TestNewNanoInteractiveSyncer(t *testing.T) {
)

userSync := NewNanoInteractiveSyncer(syncURLTemplate)
syncInfo, err := userSync.GetUsersyncInfo(
privacy.Policies{
GDPR: gdpr.Policy{
Signal: "1",
Consent: "BONciguONcjGKADACHENAOLS1rAHDAFAAEAASABQAMwAeACEAFw",
},
CCPA: ccpa.Policy{
Value: "1NYN",
},
})
syncInfo, err := userSync.GetUsersyncInfo(privacy.Policies{
GDPR: gdpr.Policy{
Signal: "1",
Consent: "BONciguONcjGKADACHENAOLS1rAHDAFAAEAASABQAMwAeACEAFw",
},
CCPA: ccpa.Policy{
Consent: "1NYN",
},
})

assert.NoError(t, err)
assert.Equal(t, "https://ad.audiencemanager.de/hbs/cookie_sync?gdpr=1&consent=BONciguONcjGKADACHENAOLS1rAHDAFAAEAASABQAMwAeACEAFw&us_privacy=1NYN&redirectUri=http%3A%2F%2Flocalhost%2Fsetuid%3Fbidder%3Dnanointeractive%26gdpr%3D1%26gdpr_consent%3DBONciguONcjGKADACHENAOLS1rAHDAFAAEAASABQAMwAeACEAFw%26uid%3D%24UID", syncInfo.URL)
Expand Down
2 changes: 1 addition & 1 deletion adapters/pubmatic/usersync_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ func TestPubmaticSyncer(t *testing.T) {
Consent: "B",
},
CCPA: ccpa.Policy{
Value: "C",
Consent: "C",
},
})

Expand Down
2 changes: 1 addition & 1 deletion adapters/rhythmone/usersync_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ func TestRhythmoneSyncer(t *testing.T) {
Consent: "BOPVK28OVJoTBABABAENBs-AAAAhuAKAANAAoACwAGgAPAAxAB0AHgAQAAiABOADkA",
},
CCPA: ccpa.Policy{
Value: "1NYN",
Consent: "1NYN",
},
})

Expand Down
15 changes: 8 additions & 7 deletions adapters/sharethrough/butler.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,17 @@ package sharethrough
import (
"encoding/json"
"fmt"
"github.com/mxmCherry/openrtb"
"github.com/prebid/prebid-server/adapters"
"github.com/prebid/prebid-server/errortypes"
"github.com/prebid/prebid-server/openrtb_ext"
"github.com/prebid/prebid-server/privacy/ccpa"
"net/http"
"net/url"
"regexp"
"strconv"
"time"

"github.com/mxmCherry/openrtb"
"github.com/prebid/prebid-server/adapters"
"github.com/prebid/prebid-server/errortypes"
"github.com/prebid/prebid-server/openrtb_ext"
"github.com/prebid/prebid-server/privacy/ccpa"
)

const defaultTmax = 10000 // 10 sec
Expand Down Expand Up @@ -97,8 +98,8 @@ func (s StrOpenRTBTranslator) requestFromOpenRTB(imp openrtb.Imp, request *openr
}

usPolicySignal := ""
if usPolicy, err := ccpa.ReadPolicy(request); err == nil {
usPolicySignal = usPolicy.Value
if usPolicy, err := ccpa.ReadFromRequest(request); err == nil {
usPolicySignal = usPolicy.Consent
}

return &adapters.RequestData{
Expand Down
2 changes: 1 addition & 1 deletion adapters/smartadserver/usersync_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ func TestSmartadserverSyncer(t *testing.T) {
Consent: "COyASAoOyASAoAfAAAENAfCAAAAAAAAAAAAAAAAAAAAA",
},
CCPA: ccpa.Policy{
Value: "1YNN",
Consent: "1YNN",
},
})

Expand Down
2 changes: 1 addition & 1 deletion adapters/syncer.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ func (s *Syncer) GetUsersyncInfo(privacyPolicies privacy.Policies) (*usersync.Us
syncURL, err := macros.ResolveMacros(*s.urlTemplate, macros.UserSyncTemplateParams{
GDPR: privacyPolicies.GDPR.Signal,
GDPRConsent: privacyPolicies.GDPR.Consent,
USPrivacy: privacyPolicies.CCPA.Value,
USPrivacy: privacyPolicies.CCPA.Consent,
})
if err != nil {
return nil, err
Expand Down
2 changes: 1 addition & 1 deletion adapters/syncer_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ func TestGetUsersyncInfo(t *testing.T) {
Consent: "B",
},
CCPA: ccpa.Policy{
Value: "C",
Consent: "C",
},
}

Expand Down
2 changes: 1 addition & 1 deletion adapters/unruly/usersync_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ func TestUnrulySyncer(t *testing.T) {
Consent: "B",
},
CCPA: ccpa.Policy{
Value: "C",
Consent: "C",
},
})

Expand Down
2 changes: 1 addition & 1 deletion adapters/valueimpression/usersync_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ func TestValueImpressionSyncer(t *testing.T) {
Consent: "BOPVK28OVJoTBABABAENBs-AAAAhuAKAANAAoACwAGgAPAAxAB0AHgAQAAiABOADkA",
},
CCPA: ccpa.Policy{
Value: "1NYN",
Consent: "1NYN",
},
})

Expand Down
2 changes: 1 addition & 1 deletion adapters/visx/usersync_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ func TestVisxSyncer(t *testing.T) {
Consent: "B",
},
CCPA: ccpa.Policy{
Value: "C",
Consent: "C",
},
})

Expand Down
2 changes: 1 addition & 1 deletion adapters/zeroclickfraud/usersync_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ func TestZeroClickFraudSyncer(t *testing.T) {
Consent: "BONciguONcjGKADACHENAOLS1rAHDAFAAEAASABQAMwAeACEAFw",
},
CCPA: ccpa.Policy{
Value: "1NYN",
Consent: "1NYN",
},
})

Expand Down
Loading