From 5fa54f04c6576a4fc6d3ebe4803f840129f6888f Mon Sep 17 00:00:00 2001 From: bsardo <1168933+bsardo@users.noreply.github.com> Date: Mon, 9 Feb 2026 22:50:22 -0500 Subject: [PATCH] Drop supportCors user sync YAML config option --- analytics/core.go | 5 +- config/bidderinfo.go | 9 ---- config/bidderinfo_test.go | 32 ----------- config/config_test.go | 4 -- .../test/bidder-info-valid/stroeerCore.yaml | 3 +- endpoints/cookie_sync.go | 15 +++--- endpoints/cookie_sync_test.go | 54 +++++++++---------- static/bidder-info/imds.yaml | 1 - static/bidder-info/orbidder.yaml | 1 - static/bidder-info/resetdigital.yaml | 1 - static/bidder-info/sparteo.yaml | 3 +- usersync/syncer.go | 12 ++--- usersync/syncer_test.go | 7 +-- usersync/syncersbuilder_test.go | 17 ++---- 14 files changed, 46 insertions(+), 118 deletions(-) diff --git a/analytics/core.go b/analytics/core.go index 25ff46c8247..7f700774fd6 100644 --- a/analytics/core.go +++ b/analytics/core.go @@ -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 diff --git a/config/bidderinfo.go b/config/bidderinfo.go index d3873bf2e94..d72042fcb0f 100644 --- a/config/bidderinfo.go +++ b/config/bidderinfo.go @@ -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"` @@ -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) @@ -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 } @@ -805,10 +800,6 @@ func (s *Syncer) Override(original *Syncer) *Syncer { copy.ExternalURL = s.ExternalURL } - if s.SupportCORS != nil { - copy.SupportCORS = s.SupportCORS - } - return © } diff --git a/config/bidderinfo_test.go b/config/bidderinfo_test.go index 8c251842c71..6d6792472e3 100644 --- a/config/bidderinfo_test.go +++ b/config/bidderinfo_test.go @@ -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{} @@ -115,7 +114,6 @@ func TestLoadBidderInfoFromDisk(t *testing.T) { ExternalURL: "https://redirect.host", UserMacro: "#UID", }, - SupportCORS: &trueValue, }, }, } @@ -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 @@ -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"}, @@ -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{ @@ -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{ @@ -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{ @@ -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"}, diff --git a/config/config_test.go b/config/config_test.go index b216fe4a48d..3d0f3605a3c 100644 --- a/config/config_test.go +++ b/config/config_test.go @@ -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) @@ -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) { diff --git a/config/test/bidder-info-valid/stroeerCore.yaml b/config/test/bidder-info-valid/stroeerCore.yaml index ef95d2388a5..47314187ba0 100644 --- a/config/test/bidder-info-valid/stroeerCore.yaml +++ b/config/test/bidder-info-valid/stroeerCore.yaml @@ -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 \ No newline at end of file + userMacro: "#UID" \ No newline at end of file diff --git a/endpoints/cookie_sync.go b/endpoints/cookie_sync.go index a90bc6117da..6c71072e7cd 100644 --- a/endpoints/cookie_sync.go +++ b/endpoints/cookie_sync.go @@ -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), }, }) } @@ -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, }, } } @@ -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 { diff --git a/endpoints/cookie_sync_test.go b/endpoints/cookie_sync_test.go index 6fc56f797b2..208627ab8f6 100644 --- a/endpoints/cookie_sync_test.go +++ b/endpoints/cookie_sync_test.go @@ -114,7 +114,7 @@ func TestNewCookieSyncEndpoint(t *testing.T) { func TestCookieSyncHandle(t *testing.T) { syncTypeExpected := []usersync.SyncType{usersync.SyncTypeIFrame, usersync.SyncTypeRedirect} - sync := usersync.Sync{URL: "aURL", Type: usersync.SyncTypeRedirect, SupportCORS: true} + sync := usersync.Sync{URL: "aURL", Type: usersync.SyncTypeRedirect} syncer := MockSyncer{} syncer.On("GetSync", syncTypeExpected, macros.UserSyncPrivacy{}).Return(sync, nil).Maybe() @@ -144,7 +144,7 @@ func TestCookieSyncHandle(t *testing.T) { }, expectedStatusCode: 200, expectedBody: `{"status":"ok","bidder_status":[` + - `{"bidder":"a","no_cookie":true,"usersync":{"url":"aURL","type":"redirect","supportCORS":true}}` + + `{"bidder":"a","no_cookie":true,"usersync":{"url":"aURL","type":"redirect"}}` + `]}` + "\n", setMetricsExpectations: func(m *metrics.MetricsEngineMock) { m.On("RecordCookieSync", metrics.CookieSyncOK).Once() @@ -158,7 +158,7 @@ func TestCookieSyncHandle(t *testing.T) { { BidderCode: "a", NoCookie: true, - UsersyncInfo: &analytics.UsersyncInfo{URL: "aURL", Type: "redirect", SupportCORS: true}, + UsersyncInfo: &analytics.UsersyncInfo{URL: "aURL", Type: "redirect"}, }, }, } @@ -176,7 +176,7 @@ func TestCookieSyncHandle(t *testing.T) { }, expectedStatusCode: 200, expectedBody: `{"status":"no_cookie","bidder_status":[` + - `{"bidder":"a","no_cookie":true,"usersync":{"url":"aURL","type":"redirect","supportCORS":true}}` + + `{"bidder":"a","no_cookie":true,"usersync":{"url":"aURL","type":"redirect"}}` + `]}` + "\n", setMetricsExpectations: func(m *metrics.MetricsEngineMock) { m.On("RecordCookieSync", metrics.CookieSyncOK).Once() @@ -190,7 +190,7 @@ func TestCookieSyncHandle(t *testing.T) { { BidderCode: "a", NoCookie: true, - UsersyncInfo: &analytics.UsersyncInfo{URL: "aURL", Type: "redirect", SupportCORS: true}, + UsersyncInfo: &analytics.UsersyncInfo{URL: "aURL", Type: "redirect"}, }, }, } @@ -277,7 +277,7 @@ func TestCookieSyncHandle(t *testing.T) { }, expectedStatusCode: 200, expectedBody: `{"status":"ok","bidder_status":[` + - `{"bidder":"a","no_cookie":true,"usersync":{"url":"aURL","type":"redirect","supportCORS":true}}` + + `{"bidder":"a","no_cookie":true,"usersync":{"url":"aURL","type":"redirect"}}` + `],"debug":[{"bidder":"a","error":"Already in sync"}]}` + "\n", setMetricsExpectations: func(m *metrics.MetricsEngineMock) { m.On("RecordCookieSync", metrics.CookieSyncOK).Once() @@ -291,7 +291,7 @@ func TestCookieSyncHandle(t *testing.T) { { BidderCode: "a", NoCookie: true, - UsersyncInfo: &analytics.UsersyncInfo{URL: "aURL", Type: "redirect", SupportCORS: true}, + UsersyncInfo: &analytics.UsersyncInfo{URL: "aURL", Type: "redirect"}, }, }, } @@ -313,7 +313,7 @@ func TestCookieSyncHandle(t *testing.T) { expectedStatusCode: 200, expectedCookieDeprecationHeader: true, expectedBody: `{"status":"ok","bidder_status":[` + - `{"bidder":"a","no_cookie":true,"usersync":{"url":"aURL","type":"redirect","supportCORS":true}}` + + `{"bidder":"a","no_cookie":true,"usersync":{"url":"aURL","type":"redirect"}}` + `]}` + "\n", setMetricsExpectations: func(m *metrics.MetricsEngineMock) { m.On("RecordCookieSync", metrics.CookieSyncOK).Once() @@ -327,7 +327,7 @@ func TestCookieSyncHandle(t *testing.T) { { BidderCode: "a", NoCookie: true, - UsersyncInfo: &analytics.UsersyncInfo{URL: "aURL", Type: "redirect", SupportCORS: true}, + UsersyncInfo: &analytics.UsersyncInfo{URL: "aURL", Type: "redirect"}, }, }, } @@ -1793,12 +1793,12 @@ func TestCookieSyncHandleResponse(t *testing.T) { privacyMacros := macros.UserSyncPrivacy{USPrivacy: "anyConsent"} // The & in the URL is necessary to test proper JSON encoding. - syncA := usersync.Sync{URL: "https://syncA.com/sync?a=1&b=2", Type: usersync.SyncTypeRedirect, SupportCORS: true} + syncA := usersync.Sync{URL: "https://syncA.com/sync?a=1&b=2", Type: usersync.SyncTypeRedirect} syncerA := MockSyncer{} syncerA.On("GetSync", syncTypeExpected, privacyMacros).Return(syncA, nil).Maybe() // The & in the URL is necessary to test proper JSON encoding. - syncB := usersync.Sync{URL: "https://syncB.com/sync?a=1&b=2", Type: usersync.SyncTypeRedirect, SupportCORS: false} + syncB := usersync.Sync{URL: "https://syncB.com/sync?a=1&b=2", Type: usersync.SyncTypeRedirect} syncerB := MockSyncer{} syncerB.On("GetSync", syncTypeExpected, privacyMacros).Return(syncB, nil).Maybe() @@ -1837,7 +1837,7 @@ func TestCookieSyncHandleResponse(t *testing.T) { givenCookieHasSyncs: true, givenSyncersChosen: []usersync.SyncerChoice{{Bidder: "foo", Syncer: &syncerA}}, expectedJSON: `{"status":"ok","bidder_status":[` + - `{"bidder":"foo","no_cookie":true,"usersync":{"url":"https://syncA.com/sync?a=1&b=2","type":"redirect","supportCORS":true}}` + + `{"bidder":"foo","no_cookie":true,"usersync":{"url":"https://syncA.com/sync?a=1&b=2","type":"redirect"}}` + `]}` + "\n", expectedAnalytics: analytics.CookieSyncObject{ Status: 200, @@ -1845,7 +1845,7 @@ func TestCookieSyncHandleResponse(t *testing.T) { { BidderCode: "foo", NoCookie: true, - UsersyncInfo: &analytics.UsersyncInfo{URL: "https://syncA.com/sync?a=1&b=2", Type: "redirect", SupportCORS: true}, + UsersyncInfo: &analytics.UsersyncInfo{URL: "https://syncA.com/sync?a=1&b=2", Type: "redirect"}, }, }, }, @@ -1855,7 +1855,7 @@ func TestCookieSyncHandleResponse(t *testing.T) { givenCookieHasSyncs: true, givenSyncersChosen: []usersync.SyncerChoice{{Bidder: "foo", Syncer: &syncerA}, {Bidder: "bar", Syncer: &syncerB}}, expectedJSON: `{"status":"ok","bidder_status":[` + - `{"bidder":"foo","no_cookie":true,"usersync":{"url":"https://syncA.com/sync?a=1&b=2","type":"redirect","supportCORS":true}},` + + `{"bidder":"foo","no_cookie":true,"usersync":{"url":"https://syncA.com/sync?a=1&b=2","type":"redirect"}},` + `{"bidder":"bar","no_cookie":true,"usersync":{"url":"https://syncB.com/sync?a=1&b=2","type":"redirect"}}` + `]}` + "\n", expectedAnalytics: analytics.CookieSyncObject{ @@ -1864,12 +1864,12 @@ func TestCookieSyncHandleResponse(t *testing.T) { { BidderCode: "foo", NoCookie: true, - UsersyncInfo: &analytics.UsersyncInfo{URL: "https://syncA.com/sync?a=1&b=2", Type: "redirect", SupportCORS: true}, + UsersyncInfo: &analytics.UsersyncInfo{URL: "https://syncA.com/sync?a=1&b=2", Type: "redirect"}, }, { BidderCode: "bar", NoCookie: true, - UsersyncInfo: &analytics.UsersyncInfo{URL: "https://syncB.com/sync?a=1&b=2", Type: "redirect", SupportCORS: false}, + UsersyncInfo: &analytics.UsersyncInfo{URL: "https://syncB.com/sync?a=1&b=2", Type: "redirect"}, }, }, }, @@ -1887,7 +1887,7 @@ func TestCookieSyncHandleResponse(t *testing.T) { { BidderCode: "bar", NoCookie: true, - UsersyncInfo: &analytics.UsersyncInfo{URL: "https://syncB.com/sync?a=1&b=2", Type: "redirect", SupportCORS: false}, + UsersyncInfo: &analytics.UsersyncInfo{URL: "https://syncB.com/sync?a=1&b=2", Type: "redirect"}, }, }, }, @@ -1956,14 +1956,14 @@ func TestMapBidderStatusToAnalytics(t *testing.T) { { BidderCode: "a", NoCookie: true, - UsersyncInfo: cookieSyncResponseSync{URL: "aURL", Type: "aType", SupportCORS: false}, + UsersyncInfo: cookieSyncResponseSync{URL: "aURL", Type: "aType"}, }, }, expected: []*analytics.CookieSyncBidder{ { BidderCode: "a", NoCookie: true, - UsersyncInfo: &analytics.UsersyncInfo{URL: "aURL", Type: "aType", SupportCORS: false}, + UsersyncInfo: &analytics.UsersyncInfo{URL: "aURL", Type: "aType"}, }, }, }, @@ -1973,24 +1973,24 @@ func TestMapBidderStatusToAnalytics(t *testing.T) { { BidderCode: "a", NoCookie: true, - UsersyncInfo: cookieSyncResponseSync{URL: "aURL", Type: "aType", SupportCORS: false}, + UsersyncInfo: cookieSyncResponseSync{URL: "aURL", Type: "aType"}, }, { BidderCode: "b", NoCookie: false, - UsersyncInfo: cookieSyncResponseSync{URL: "bURL", Type: "bType", SupportCORS: true}, + UsersyncInfo: cookieSyncResponseSync{URL: "bURL", Type: "bType"}, }, }, expected: []*analytics.CookieSyncBidder{ { BidderCode: "a", NoCookie: true, - UsersyncInfo: &analytics.UsersyncInfo{URL: "aURL", Type: "aType", SupportCORS: false}, + UsersyncInfo: &analytics.UsersyncInfo{URL: "aURL", Type: "aType"}, }, { BidderCode: "b", NoCookie: false, - UsersyncInfo: &analytics.UsersyncInfo{URL: "bURL", Type: "bType", SupportCORS: true}, + UsersyncInfo: &analytics.UsersyncInfo{URL: "bURL", Type: "bType"}, }, }, }, @@ -2621,15 +2621,15 @@ func createAccountJSON(priorityGroups [][]string, defaultCoopSync *bool) json.Ra func TestCookieSyncPriorityGroupsIntegration(t *testing.T) { // Setup test syncers syncerA := MockSyncer{} - syncerA.On("GetSync", mock.Anything, mock.Anything).Return(usersync.Sync{URL: "https://sync.bidderA.com", Type: usersync.SyncTypeRedirect, SupportCORS: false}, nil).Maybe() + syncerA.On("GetSync", mock.Anything, mock.Anything).Return(usersync.Sync{URL: "https://sync.bidderA.com", Type: usersync.SyncTypeRedirect}, nil).Maybe() syncerA.On("Key").Return("appnexus").Maybe() syncerA.On("SupportsType", mock.Anything).Return(true).Maybe() syncerB := MockSyncer{} - syncerB.On("GetSync", mock.Anything, mock.Anything).Return(usersync.Sync{URL: "https://sync.bidderB.com", Type: usersync.SyncTypeRedirect, SupportCORS: false}, nil).Maybe() + syncerB.On("GetSync", mock.Anything, mock.Anything).Return(usersync.Sync{URL: "https://sync.bidderB.com", Type: usersync.SyncTypeRedirect}, nil).Maybe() syncerB.On("Key").Return("rubicon").Maybe() syncerB.On("SupportsType", mock.Anything).Return(true).Maybe() syncerC := MockSyncer{} - syncerC.On("GetSync", mock.Anything, mock.Anything).Return(usersync.Sync{URL: "https://sync.bidderC.com", Type: usersync.SyncTypeRedirect, SupportCORS: false}, nil).Maybe() + syncerC.On("GetSync", mock.Anything, mock.Anything).Return(usersync.Sync{URL: "https://sync.bidderC.com", Type: usersync.SyncTypeRedirect}, nil).Maybe() syncerC.On("Key").Return("pubmatic").Maybe() syncerC.On("SupportsType", mock.Anything).Return(true).Maybe() // Need to choose real bidder names because the standard chooser is hardcoded to validate against them @@ -2788,7 +2788,7 @@ func TestCookieSyncPriorityGroupsEdgeCases(t *testing.T) { // Setup basic syncers syncerA := MockSyncer{} syncerA.On("Key").Return("bidderA") - syncerA.On("GetSync", mock.Anything, mock.Anything).Return(usersync.Sync{URL: "https://sync.bidderA.com", Type: usersync.SyncTypeRedirect, SupportCORS: false}, nil).Maybe() + syncerA.On("GetSync", mock.Anything, mock.Anything).Return(usersync.Sync{URL: "https://sync.bidderA.com", Type: usersync.SyncTypeRedirect}, nil).Maybe() syncerA.On("SupportsType", mock.Anything).Return(true).Maybe() syncersByBidder := map[string]usersync.Syncer{ diff --git a/static/bidder-info/imds.yaml b/static/bidder-info/imds.yaml index 135b67fc1f9..73f20995480 100644 --- a/static/bidder-info/imds.yaml +++ b/static/bidder-info/imds.yaml @@ -15,7 +15,6 @@ capabilities: - banner - video userSync: - supportCors: true iframe: url: "https://ad-cdn.technoratimedia.com/html/usersync.html?gdpr={{.GDPR}}&consent={{.GDPRConsent}}&us_privacy={{.USPrivacy}}&gpp={{.GPP}}&gppsid={{.GPPSID}}&cb={{.RedirectURL}}" userMacro: "[USER_ID]" diff --git a/static/bidder-info/orbidder.yaml b/static/bidder-info/orbidder.yaml index c42fb91de44..74348c75d7f 100644 --- a/static/bidder-info/orbidder.yaml +++ b/static/bidder-info/orbidder.yaml @@ -11,7 +11,6 @@ capabilities: - banner - native userSync: - supportCors: true redirect: url: "https://orbidder.otto.de/pbs-usersync?gdpr={{.GDPR}}&consent={{.GDPRConsent}}&redirect={{.RedirectURL}}" userMacro: "[ODN_ID]" \ No newline at end of file diff --git a/static/bidder-info/resetdigital.yaml b/static/bidder-info/resetdigital.yaml index db85d114a35..0651791dc0b 100644 --- a/static/bidder-info/resetdigital.yaml +++ b/static/bidder-info/resetdigital.yaml @@ -21,4 +21,3 @@ usersync: redirect: url: "https://sync.resetdigital.co/usersync?gdpr={{.GDPR}}&gdpr_consent={{.GDPRConsent}}&us_privacy={{.USPrivacy}}&redirect={{.RedirectURL}}" userMacro: "$UID" - supportCORS: true diff --git a/static/bidder-info/sparteo.yaml b/static/bidder-info/sparteo.yaml index 1ad61ab0725..c1f862ed06a 100644 --- a/static/bidder-info/sparteo.yaml +++ b/static/bidder-info/sparteo.yaml @@ -16,5 +16,4 @@ capabilities: endpoint: "https://bid.sparteo.com/s2s-auction" userSync: iframe: - url: "https://sync.sparteo.com/s2s_sync?gdpr={{.GDPR}}&gdpr_consent={{.GDPRConsent}}&us_privacy={{.USPrivacy}}&redirect_url={{.RedirectURL}}" - supportCors: true \ No newline at end of file + url: "https://sync.sparteo.com/s2s_sync?gdpr={{.GDPR}}&gdpr_consent={{.GDPRConsent}}&us_privacy={{.USPrivacy}}&redirect_url={{.RedirectURL}}" \ No newline at end of file diff --git a/usersync/syncer.go b/usersync/syncer.go index b2fec616102..b96b79cce29 100644 --- a/usersync/syncer.go +++ b/usersync/syncer.go @@ -39,9 +39,8 @@ type Syncer interface { // Sync represents a user sync to be performed by the user's device. type Sync struct { - URL string - Type SyncType - SupportCORS bool + URL string + Type SyncType } type standardSyncer struct { @@ -49,7 +48,6 @@ type standardSyncer struct { defaultSyncType SyncType iframe *template.Template redirect *template.Template - supportCORS bool formatOverride string } @@ -67,7 +65,6 @@ func NewSyncer(hostConfig config.UserSync, syncerConfig config.Syncer, bidder st syncer := standardSyncer{ key: syncerConfig.Key, defaultSyncType: resolveDefaultSyncType(syncerConfig), - supportCORS: syncerConfig.SupportCORS != nil && *syncerConfig.SupportCORS, formatOverride: syncerConfig.FormatOverride, } @@ -237,9 +234,8 @@ func (s standardSyncer) GetSync(syncTypes []SyncType, userSyncMacros macros.User } sync := Sync{ - URL: url, - Type: syncType, - SupportCORS: s.supportCORS, + URL: url, + Type: syncType, } return sync, nil } diff --git a/usersync/syncer_test.go b/usersync/syncer_test.go index 020fb26df66..1670a3452eb 100644 --- a/usersync/syncer_test.go +++ b/usersync/syncer_test.go @@ -11,7 +11,6 @@ import ( func TestNewSyncer(t *testing.T) { var ( - supportCORS = true hostConfig = config.UserSync{ExternalURL: "http://host.com", RedirectURL: "{{.ExternalURL}}/host"} macroValues = macros.UserSyncPrivacy{GDPR: "A", GDPRConsent: "B", USPrivacy: "C"} iframeConfig = &config.SyncerEndpoint{URL: "https://bidder.com/iframe?redirect={{.RedirectURL}}"} @@ -107,7 +106,6 @@ func TestNewSyncer(t *testing.T) { for _, test := range testCases { syncerConfig := config.Syncer{ Key: test.givenKey, - SupportCORS: &supportCORS, IFrame: test.givenIFrameConfig, Redirect: test.givenRedirectConfig, ExternalURL: test.givenExternalURL, @@ -120,7 +118,6 @@ func TestNewSyncer(t *testing.T) { if assert.IsType(t, standardSyncer{}, result, test.description+":result_type") { result := result.(standardSyncer) assert.Equal(t, test.givenKey, result.key, test.description+":key") - assert.Equal(t, supportCORS, result.supportCORS, test.description+":cors") assert.Equal(t, test.expectedDefault, result.defaultSyncType, test.description+":default_sync") if test.expectedIFrame == "" { @@ -682,14 +679,14 @@ func TestSyncerGetSync(t *testing.T) { givenSyncer: standardSyncer{iframe: iframeTemplate, redirect: redirectTemplate}, givenSyncTypes: []SyncType{SyncTypeIFrame}, givenMacros: macros.UserSyncPrivacy{GDPR: "A", GDPRConsent: "B", USPrivacy: "C"}, - expectedSync: Sync{URL: "iframe,gdpr:A,gdprconsent:B,ccpa:C", Type: SyncTypeIFrame, SupportCORS: false}, + expectedSync: Sync{URL: "iframe,gdpr:A,gdprconsent:B,ccpa:C", Type: SyncTypeIFrame}, }, { description: "Redirect", givenSyncer: standardSyncer{iframe: iframeTemplate, redirect: redirectTemplate}, givenSyncTypes: []SyncType{SyncTypeRedirect}, givenMacros: macros.UserSyncPrivacy{GDPR: "A", GDPRConsent: "B", USPrivacy: "C"}, - expectedSync: Sync{URL: "redirect,gdpr:A,gdprconsent:B,ccpa:C", Type: SyncTypeRedirect, SupportCORS: false}, + expectedSync: Sync{URL: "redirect,gdpr:A,gdprconsent:B,ccpa:C", Type: SyncTypeRedirect}, }, { description: "Macro Error", diff --git a/usersync/syncersbuilder_test.go b/usersync/syncersbuilder_test.go index a08df081729..f86808a21f3 100644 --- a/usersync/syncersbuilder_test.go +++ b/usersync/syncersbuilder_test.go @@ -192,7 +192,6 @@ func TestShouldCreateSyncer(t *testing.T) { var ( anySupports = []string{"iframe"} anyEndpoint = &config.SyncerEndpoint{} - anyCORS = true ) testCases := []struct { @@ -212,7 +211,7 @@ func TestShouldCreateSyncer(t *testing.T) { }, { description: "Enabled, Syncer - Fully Loaded", - given: config.BidderInfo{Disabled: false, Syncer: &config.Syncer{Key: "anyKey", Supports: anySupports, IFrame: anyEndpoint, Redirect: anyEndpoint, SupportCORS: &anyCORS}}, + given: config.BidderInfo{Disabled: false, Syncer: &config.Syncer{Key: "anyKey", Supports: anySupports, IFrame: anyEndpoint, Redirect: anyEndpoint}}, expected: true, }, { @@ -235,11 +234,6 @@ func TestShouldCreateSyncer(t *testing.T) { given: config.BidderInfo{Disabled: false, Syncer: &config.Syncer{Redirect: anyEndpoint}}, expected: true, }, - { - description: "Enabled, Syncer - Only SupportCORS", - given: config.BidderInfo{Disabled: false, Syncer: &config.Syncer{SupportCORS: &anyCORS}}, - expected: true, - }, { description: "Disabled, No Syncer", given: config.BidderInfo{Disabled: true, Syncer: nil}, @@ -252,7 +246,7 @@ func TestShouldCreateSyncer(t *testing.T) { }, { description: "Disabled, Syncer - Fully Loaded", - given: config.BidderInfo{Disabled: true, Syncer: &config.Syncer{Key: "anyKey", Supports: anySupports, IFrame: anyEndpoint, Redirect: anyEndpoint, SupportCORS: &anyCORS}}, + given: config.BidderInfo{Disabled: true, Syncer: &config.Syncer{Key: "anyKey", Supports: anySupports, IFrame: anyEndpoint, Redirect: anyEndpoint}}, expected: false, }, { @@ -275,11 +269,6 @@ func TestShouldCreateSyncer(t *testing.T) { given: config.BidderInfo{Disabled: true, Syncer: &config.Syncer{Redirect: anyEndpoint}}, expected: false, }, - { - description: "Disabled, Syncer - Only SupportCORS", - given: config.BidderInfo{Disabled: true, Syncer: &config.Syncer{SupportCORS: &anyCORS}}, - expected: false, - }, { description: "WhiteLabelOnly, No Syncer", given: config.BidderInfo{WhiteLabelOnly: true, Syncer: nil}, @@ -292,7 +281,7 @@ func TestShouldCreateSyncer(t *testing.T) { }, { description: "WhiteLabelOnly, Syncer - Fully Loaded", - given: config.BidderInfo{WhiteLabelOnly: true, Syncer: &config.Syncer{Key: "anyKey", Supports: anySupports, IFrame: anyEndpoint, Redirect: anyEndpoint, SupportCORS: &anyCORS}}, + given: config.BidderInfo{WhiteLabelOnly: true, Syncer: &config.Syncer{Key: "anyKey", Supports: anySupports, IFrame: anyEndpoint, Redirect: anyEndpoint}}, expected: false, }, }