Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
5 changes: 2 additions & 3 deletions analytics/core.go
Original file line number Diff line number Diff line change
Expand Up @@ -82,9 +82,8 @@ type CookieSyncBidder struct {
}

type UsersyncInfo struct {
URL string `json:"url,omitempty"`
Type string `json:"type,omitempty"`
SupportCORS bool `json:"supportCORS,omitempty"`
URL string `json:"url,omitempty"`
Type string `json:"type,omitempty"`
}

// NotificationEvent object of a transaction at /event
Expand Down
9 changes: 0 additions & 9 deletions config/bidderinfo.go
Original file line number Diff line number Diff line change
Expand Up @@ -127,9 +127,6 @@ type Syncer struct {
// ExternalURL is available as a macro to the RedirectURL template.
ExternalURL string `yaml:"externalUrl" mapstructure:"external_url"`

// SupportCORS identifies if CORS is supported for the user syncing endpoints.
SupportCORS *bool `yaml:"supportCors" mapstructure:"support_cors"`

// FormatOverride allows a bidder to override their callback type "b" for iframe, "i" for redirect
FormatOverride string `yaml:"formatOverride" mapstructure:"format_override"`

Expand All @@ -154,7 +151,6 @@ func (s *Syncer) Equal(other *Syncer) bool {
s.IFrame.Equal(other.IFrame) &&
s.Redirect.Equal(other.Redirect) &&
s.ExternalURL == other.ExternalURL &&
ptrutil.Equal(s.SupportCORS, other.SupportCORS) &&
s.FormatOverride == other.FormatOverride &&
ptrutil.Equal(s.Enabled, other.Enabled) &&
s.SkipWhen.Equal(other.SkipWhen)
Expand Down Expand Up @@ -264,7 +260,6 @@ func (s *Syncer) Defined() bool {
s.IFrame != nil ||
s.Redirect != nil ||
s.ExternalURL != "" ||
s.SupportCORS != nil ||
s.FormatOverride != "" ||
s.SkipWhen != nil
}
Expand Down Expand Up @@ -805,10 +800,6 @@ func (s *Syncer) Override(original *Syncer) *Syncer {
copy.ExternalURL = s.ExternalURL
}

if s.SupportCORS != nil {
copy.SupportCORS = s.SupportCORS
}

return &copy
}

Expand Down
32 changes: 0 additions & 32 deletions config/bidderinfo_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,6 @@ aliasOf: bidderA
func TestLoadBidderInfoFromDisk(t *testing.T) {
// should appear in result in mixed case
bidder := "stroeerCore"
trueValue := true

adapterConfigs := make(map[string]Adapter)
adapterConfigs[strings.ToLower(bidder)] = Adapter{}
Expand Down Expand Up @@ -115,7 +114,6 @@ func TestLoadBidderInfoFromDisk(t *testing.T) {
ExternalURL: "https://redirect.host",
UserMacro: "#UID",
},
SupportCORS: &trueValue,
},
},
}
Expand Down Expand Up @@ -1402,11 +1400,6 @@ func TestBidderInfoValidationNegative(t *testing.T) {
}

func TestSyncerOverride(t *testing.T) {
var (
trueValue = true
falseValue = false
)

testCases := []struct {
description string
givenOriginal *Syncer
Expand Down Expand Up @@ -1467,12 +1460,6 @@ func TestSyncerOverride(t *testing.T) {
givenOverride: &Syncer{ExternalURL: "override"},
expected: &Syncer{ExternalURL: "override"},
},
{
description: "Override SupportCORS",
givenOriginal: &Syncer{SupportCORS: &trueValue},
givenOverride: &Syncer{SupportCORS: &falseValue},
expected: &Syncer{SupportCORS: &falseValue},
},
{
description: "Override Partial - Other Fields Untouched",
givenOriginal: &Syncer{Key: "originalKey", ExternalURL: "originalExternalURL"},
Expand Down Expand Up @@ -1715,18 +1702,6 @@ func TestSyncerEqual(t *testing.T) {
},
expected: false,
},
{
name: "different-support-cors",
syncer1: &Syncer{
Key: "key",
SupportCORS: ptrutil.ToPtr(true),
},
syncer2: &Syncer{
Key: "key",
SupportCORS: ptrutil.ToPtr(false),
},
expected: false,
},
{
name: "different-format-override",
syncer1: &Syncer{
Expand Down Expand Up @@ -1782,7 +1757,6 @@ func TestSyncerEqual(t *testing.T) {
UserMacro: "$UID",
},
ExternalURL: "https://external.com",
SupportCORS: ptrutil.ToPtr(true),
FormatOverride: "i",
Enabled: ptrutil.ToPtr(true),
SkipWhen: &SkipWhen{
Expand All @@ -1803,7 +1777,6 @@ func TestSyncerEqual(t *testing.T) {
UserMacro: "$UID",
},
ExternalURL: "https://external.com",
SupportCORS: ptrutil.ToPtr(true),
FormatOverride: "i",
Enabled: ptrutil.ToPtr(true),
SkipWhen: &SkipWhen{
Expand Down Expand Up @@ -2073,11 +2046,6 @@ func TestSyncerDefined(t *testing.T) {
givenSyncer: &Syncer{ExternalURL: "anyURL"},
expected: true,
},
{
name: "supportscors-only",
givenSyncer: &Syncer{SupportCORS: ptrutil.ToPtr(false)},
expected: true,
},
{
name: "formatoverride-only",
givenSyncer: &Syncer{FormatOverride: "anyFormat"},
Expand Down
4 changes: 0 additions & 4 deletions config/config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1019,8 +1019,6 @@ func TestMigrateConfigFromEnv(t *testing.T) {
}

func TestUserSyncFromEnv(t *testing.T) {
truePtr := true

// setup env vars for testing
if oldval, ok := os.LookupEnv("PBS_ADAPTERS_BIDDER1_USERSYNC_REDIRECT_URL"); ok {
defer os.Setenv("PBS_ADAPTERS_BIDDER1_USERSYNC_REDIRECT_URL", oldval)
Expand Down Expand Up @@ -1057,11 +1055,9 @@ func TestUserSyncFromEnv(t *testing.T) {
assert.Equal(t, "http://some.url/sync?redirect={{.RedirectURL}}", cfg.BidderInfos["bidder1"].Syncer.Redirect.URL)
assert.Equal(t, "[UID]", cfg.BidderInfos["bidder1"].Syncer.Redirect.UserMacro)
assert.Nil(t, cfg.BidderInfos["bidder1"].Syncer.IFrame)
assert.Equal(t, &truePtr, cfg.BidderInfos["bidder1"].Syncer.SupportCORS)

assert.Equal(t, "http://somedifferent.url/sync?redirect={{.RedirectURL}}", cfg.BidderInfos["bidder2"].Syncer.IFrame.URL)
assert.Nil(t, cfg.BidderInfos["bidder2"].Syncer.Redirect)
assert.Nil(t, cfg.BidderInfos["bidder2"].Syncer.SupportCORS)
}

func TestBidderInfoFromEnv(t *testing.T) {
Expand Down
3 changes: 1 addition & 2 deletions config/test/bidder-info-valid/stroeerCore.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,5 +27,4 @@ userSync:
url: "https://foo.com/sync?mode=redirect&r={{.RedirectURL}}"
redirectUrl: "{{.ExternalURL}}/setuid/redirect"
externalUrl: "https://redirect.host"
userMacro: "#UID"
supportCors: true
userMacro: "#UID"
15 changes: 6 additions & 9 deletions endpoints/cookie_sync.go
Original file line number Diff line number Diff line change
Expand Up @@ -466,9 +466,8 @@ func (c *cookieSyncEndpoint) handleResponse(w http.ResponseWriter, tf usersync.S
BidderCode: syncerChoice.Bidder,
NoCookie: true,
UsersyncInfo: cookieSyncResponseSync{
URL: sync.URL,
Type: string(sync.Type),
SupportCORS: sync.SupportCORS,
URL: sync.URL,
Type: string(sync.Type),
},
})
}
Expand Down Expand Up @@ -536,9 +535,8 @@ func mapBidderStatusToAnalytics(from []cookieSyncResponseBidder) []*analytics.Co
BidderCode: b.BidderCode,
NoCookie: b.NoCookie,
UsersyncInfo: &analytics.UsersyncInfo{
URL: b.UsersyncInfo.URL,
Type: b.UsersyncInfo.Type,
SupportCORS: b.UsersyncInfo.SupportCORS,
URL: b.UsersyncInfo.URL,
Type: b.UsersyncInfo.Type,
},
}
}
Expand Down Expand Up @@ -604,9 +602,8 @@ type cookieSyncResponseBidder struct {
}

type cookieSyncResponseSync struct {
URL string `json:"url,omitempty"`
Type string `json:"type,omitempty"`
SupportCORS bool `json:"supportCORS,omitempty"`
URL string `json:"url,omitempty"`
Type string `json:"type,omitempty"`
}

type cookieSyncResponseDebug struct {
Expand Down
Loading
Loading