Repository: prebid/prebid-server
Pull request #3125 (2023-09-22 20:04:06)

Remove Config Backwards Compatibility: Enable GZIP
The upcoming 2.0 release will remove backwards compatibility for deprecated host and account configuration options. This PR removes support for the following host options:
`enable_gzip`

Instead, hosts should use `compression.response.enable_gzip`.

It should be noted that the migration logic being deleted here probably never worked to begin with because `compression.response.enable_gzip` was always set since it was being assigned a default value in viper.


Patch:
diff --git a/account/account.go b/account/account.go
index 156ad5e6..36b6da51 100644
--- a/account/account.go
+++ b/account/account.go
@@ -111,9 +111,6 @@ func GetAccount(ctx context.Context, cfg *config.Configuration, fetcher stored_r
 		account.Privacy.IPv4Config.AnonKeepBits = iputil.IPv4DefaultMaskingBitSize
 	}
 
-	// set the value of events.enabled field based on deprecated events_enabled field and ensure backward compatibility
-	deprecateEventsEnabledField(account)
-
 	return account, nil
 }
 
@@ -264,16 +261,3 @@ func useGDPRChannelEnabled(account *config.Account) bool {
 func useCCPAChannelEnabled(account *config.Account) bool {
 	return account.CCPA.ChannelEnabled.IsSet() && !account.CCPA.IntegrationEnabled.IsSet()
 }
-
-// deprecateEventsEnabledField is responsible for ensuring backwards compatibility of "events_enabled" field.
-// This function favors "events.enabled" field over deprecated "events_enabled" field, if values for both are set.
-// If only deprecated "events_enabled" field is set then it sets the same value to "events.enabled" field.
-func deprecateEventsEnabledField(account *config.Account) {
-	if account != nil {
-		if account.Events.Enabled == nil {
-			account.Events.Enabled = account.EventsEnabled
-		}
-		// assign the old value to the new value so old and new are always the same even though the new value is what is used in the application code.
-		account.EventsEnabled = account.Events.Enabled
-	}
-}
diff --git a/config/account.go b/config/account.go
index 4b0ceeef..d57fdb90 100644
--- a/config/account.go
+++ b/config/account.go
@@ -28,7 +28,6 @@ type Account struct {
 	ID                      string                                      `mapstructure:"id" json:"id"`
 	Disabled                bool                                        `mapstructure:"disabled" json:"disabled"`
 	CacheTTL                DefaultTTLs                                 `mapstructure:"cache_ttl" json:"cache_ttl"`
-	EventsEnabled           *bool                                       `mapstructure:"events_enabled" json:"events_enabled"` // Deprecated: Use events.enabled instead.
 	CCPA                    AccountCCPA                                 `mapstructure:"ccpa" json:"ccpa"`
 	GDPR                    AccountGDPR                                 `mapstructure:"gdpr" json:"gdpr"`
 	DebugAllow              bool                                        `mapstructure:"debug_allow" json:"debug_allow"`
diff --git a/config/config.go b/config/config.go
index dd7671c1..df4d53f1 100644
--- a/config/config.go
+++ b/config/config.go
@@ -15,7 +15,6 @@ import (
 	"github.com/prebid/openrtb/v19/openrtb2"
 	"github.com/prebid/prebid-server/errortypes"
 	"github.com/prebid/prebid-server/openrtb_ext"
-	"github.com/prebid/prebid-server/util/ptrutil"
 	"github.com/spf13/viper"
 )
 
@@ -29,7 +28,6 @@ type Configuration struct {
 	Client           HTTPClient  `mapstructure:"http_client"`
 	CacheClient      HTTPClient  `mapstructure:"http_client_cache"`
 	AdminPort        int         `mapstructure:"admin_port"`
-	EnableGzip       bool        `mapstructure:"enable_gzip"`
 	Compression      Compression `mapstructure:"compression"`
 	// GarbageCollectorThreshold allocates virtual memory (in bytes) which is not used by PBS but
 	// serves as a hack to trigger the garbage collector only when the heap reaches at least this size.
@@ -141,12 +139,12 @@ func (cfg *Configuration) validate(v *viper.Viper) []error {
 		glog.Warning(`With account_defaults.disabled=true, host-defined accounts must exist and have "disabled":false. All other requests will be rejected.`)
 	}
 
-	if cfg.PriceFloors.Enabled {
-		glog.Warning(`cfg.PriceFloors.Enabled will currently not do anything as price floors feature is still under development.`)
+	if cfg.AccountDefaults.Events.Enabled {
+		glog.Warning(`account_defaults.events has no effect as the feature is under development.`)
 	}
 
-	if len(cfg.AccountDefaults.Events.VASTEvents) > 0 {
-		errs = append(errs, errors.New("account_defaults.Events.VASTEvents has no effect as the feature is under development."))
+	if cfg.PriceFloors.Enabled {
+		glog.Warning(`cfg.PriceFloors.Enabled will currently not do anything as price floors feature is still under development.`)
 	}
 
 	errs = cfg.Experiment.validate(errs)
@@ -695,9 +693,6 @@ func New(v *viper.Viper, bidderInfos BidderInfos, normalizeBidderName func(strin
 	// Update account defaults and generate base json for patch
 	c.AccountDefaults.CacheTTL = c.CacheURL.DefaultTTLs // comment this out to set explicitly in config
 
-	// Update the deprecated and new events enabled values for account defaults.
-	c.AccountDefaults.EventsEnabled, c.AccountDefaults.Events.Enabled = migrateConfigEventsEnabled(c.AccountDefaults.EventsEnabled, c.AccountDefaults.Events.Enabled)
-
 	if err := c.MarshalAccountDefaults(); err != nil {
 		return nil, err
 	}
@@ -1019,7 +1014,6 @@ func SetupViper(v *viper.Viper, filename string, bidderInfos BidderInfos) {
 	v.SetDefault("account_defaults.price_floors.use_dynamic_data", false)
 	v.SetDefault("account_defaults.price_floors.max_rules", 100)
 	v.SetDefault("account_defaults.price_floors.max_schema_dims", 3)
-	v.SetDefault("account_defaults.events_enabled", false)
 	v.SetDefault("account_defaults.privacy.ipv6.anon_keep_bits", 56)
 	v.SetDefault("account_defaults.privacy.ipv4.anon_keep_bits", 24)
 
@@ -1073,7 +1067,6 @@ func SetupViper(v *viper.Viper, filename string, bidderInfos BidderInfos) {
 	migrateConfigSpecialFeature1(v)
 	migrateConfigTCF2PurposeFlags(v)
 	migrateConfigDatabaseConnection(v)
-	migrateConfigCompression(v)
 
 	// These defaults must be set after the migrate functions because those functions look for the presence of these
 	// config fields and there isn't a way to detect presence of a config field using the viper package if a default
@@ -1114,10 +1107,9 @@ func SetupViper(v *viper.Viper, filename string, bidderInfos BidderInfos) {
 	v.SetDefault("gdpr.tcf2.special_feature1.vendor_exceptions", []openrtb_ext.BidderName{})
 	v.SetDefault("price_floors.enabled", false)
 
-	v.SetDefault("enable_gzip", false)
-
 	// Defaults for account_defaults.events.default_url
 	v.SetDefault("account_defaults.events.default_url", "https://PBS_HOST/event?t=##PBS-EVENTTYPE##&vtype=##PBS-VASTEVENT##&b=##PBS-BIDID##&f=i&a=##PBS-ACCOUNTID##&ts=##PBS-TIMESTAMP##&bidder=##PBS-BIDDER##&int=##PBS-INTEGRATION##&mt=##PBS-MEDIATYPE##&ch=##PBS-CHANNEL##&aid=##PBS-AUCTIONID##&l=##PBS-LINEID##")
+	v.SetDefault("account_defaults.events.enabled", false)
 
 	v.SetDefault("experiment.adscert.mode", "off")
 	v.SetDefault("experiment.adscert.inprocess.origin", "")
@@ -1134,20 +1126,6 @@ func SetupViper(v *viper.Viper, filename string, bidderInfos BidderInfos) {
 	}
 }
 
-func migrateConfigCompression(v *viper.Viper) {
-	oldField := "enable_gzip"
-	newField := "compression.response.enable_gzip"
-	if v.IsSet(oldField) {
-		oldConfig := v.GetBool(oldField)
-		if v.IsSet(newField) {
-			glog.Warningf("using %s and ignoring deprecated %s", newField, oldField)
-		} else {
-			glog.Warningf("%s is deprecated and should be changed to %s", oldField, newField)
-			v.Set(newField, oldConfig)
-		}
-	}
-}
-
 func migrateConfigPurposeOneTreatment(v *viper.Viper) {
 	if oldConfig, ok := v.Get("gdpr.tcf2.purpose_one_treatement").(map[string]interface{}); ok {
 		if v.IsSet("gdpr.tcf2.purpose_one_treatment") {
@@ -1396,28 +1374,6 @@ func migrateConfigDatabaseConnection(v *viper.Viper) {
 	}
 }
 
-// migrateConfigEventsEnabled is responsible for ensuring backward compatibility of events_enabled field.
-// This function copies the value of newField "events.enabled" and set it to the oldField "events_enabled".
-// This is necessary to achieve the desired order of precedence favoring the account values over the host values
-// given the account fetcher JSON merge mechanics.
-func migrateConfigEventsEnabled(oldFieldValue *bool, newFieldValue *bool) (updatedOldFieldValue, updatedNewFieldValue *bool) {
-	newField := "account_defaults.events.enabled"
-	oldField := "account_defaults.events_enabled"
-
-	updatedOldFieldValue = oldFieldValue
-	if oldFieldValue != nil {
-		glog.Warningf("%s is deprecated and should be changed to %s", oldField, newField)
-	}
-	if newFieldValue != nil {
-		if oldFieldValue != nil {
-			glog.Warningf("using %s and ignoring deprecated %s", newField, oldField)
-		}
-		updatedOldFieldValue = ptrutil.ToPtr(*newFieldValue)
-	}
-
-	return updatedOldFieldValue, nil
-}
-
 func isConfigInfoPresent(v *viper.Viper, prefix string, fields []string) bool {
 	prefix = prefix + "."
 	for _, field := range fields {
diff --git a/config/events.go b/config/events.go
index 83d2df4b..cf3139d8 100644
--- a/config/events.go
+++ b/config/events.go
@@ -61,14 +61,14 @@ type VASTEvent struct {
 // within the VAST XML
 // Don't enable this feature. It is still under developmment. Please follow https://github.com/prebid/prebid-server/issues/1725 for more updates
 type Events struct {
-	Enabled    *bool       `mapstructure:"enabled" json:"enabled"`
+	Enabled    bool        `mapstructure:"enabled" json:"enabled"`
 	DefaultURL string      `mapstructure:"default_url" json:"default_url"`
 	VASTEvents []VASTEvent `mapstructure:"vast_events" json:"vast_events,omitempty"`
 }
 
 // validate verifies the events object  and returns error if at least one is invalid.
 func (e Events) validate(errs []error) []error {
-	if e.IsEnabled() {
+	if e.Enabled {
 		if !isValidURL(e.DefaultURL) {
 			return append(errs, errors.New("Invalid events.default_url"))
 		}
@@ -147,8 +147,3 @@ func isValidURL(eventURL string) bool {
 func (e VASTEvent) isTrackingEvent() bool {
 	return e.CreateElement == TrackingVASTElement
 }
-
-// IsEnabled function returns the value of events.enabled field
-func (e Events) IsEnabled() bool {
-	return e.Enabled != nil && *e.Enabled
-}
diff --git a/endpoints/events/event.go b/endpoints/events/event.go
index 089d5606..e8084f1b 100644
--- a/endpoints/events/event.go
+++ b/endpoints/events/event.go
@@ -108,7 +108,7 @@ func (e *eventEndpoint) Handle(w http.ResponseWriter, r *http.Request, _ httprou
 	}
 
 	// Check if events are enabled for the account
-	if !account.Events.IsEnabled() {
+	if !account.Events.Enabled {
 		w.WriteHeader(http.StatusUnauthorized)
 		w.Write([]byte(fmt.Sprintf("Account '%s' doesn't support events", eventRequest.AccountID)))
 		return
diff --git a/exchange/events.go b/exchange/events.go
index fd52d6b6..e4f6b0d5 100644
--- a/exchange/events.go
+++ b/exchange/events.go
@@ -28,7 +28,7 @@ type eventTracking struct {
 func getEventTracking(requestExtPrebid *openrtb_ext.ExtRequestPrebid, ts time.Time, account *config.Account, bidderInfos config.BidderInfos, externalURL string) *eventTracking {
 	return &eventTracking{
 		accountID:          account.ID,
-		enabledForAccount:  account.Events.IsEnabled(),
+		enabledForAccount:  account.Events.Enabled,
 		enabledForRequest:  requestExtPrebid != nil && requestExtPrebid.Events != nil,
 		auctionTimestampMs: ts.UnixNano() / 1e+6,
 		integrationType:    getIntegrationType(requestExtPrebid),
@@ -130,7 +130,7 @@ func (ev *eventTracking) makeEventURL(evType analytics.EventType, pbsBid *entiti
 		})
 }
 
-// isEnabled checks if events are enabled by default or on account/request level
+// isEventAllowed checks if events are enabled by default or on account/request level
 func (ev *eventTracking) isEventAllowed() bool {
 	return ev.enabledForAccount || ev.enabledForRequest
 }


Test patch:
diff --git a/account/account_test.go b/account/account_test.go
index d2694abc..b527dee1 100644
--- a/account/account_test.go
+++ b/account/account_test.go
@@ -13,7 +13,6 @@ import (
 	"github.com/prebid/prebid-server/openrtb_ext"
 	"github.com/prebid/prebid-server/stored_requests"
 	"github.com/prebid/prebid-server/util/iputil"
-	"github.com/prebid/prebid-server/util/ptrutil"
 	"github.com/stretchr/testify/assert"
 	"github.com/stretchr/testify/mock"
 )
@@ -590,66 +589,3 @@ func TestAccountUpgradeStatusGetAccount(t *testing.T) {
 		})
 	}
 }
-
-func TestDeprecateEventsEnabledField(t *testing.T) {
-	testCases := []struct {
-		name    string
-		account *config.Account
-		want    *bool
-	}{
-		{
-			name:    "account is nil",
-			account: nil,
-			want:    nil,
-		},
-		{
-			name: "account.EventsEnabled is nil, account.Events.Enabled is nil",
-			account: &config.Account{
-				EventsEnabled: nil,
-				Events: config.Events{
-					Enabled: nil,
-				},
-			},
-			want: nil,
-		},
-		{
-			name: "account.EventsEnabled is nil, account.Events.Enabled is non-nil",
-			account: &config.Account{
-				EventsEnabled: nil,
-				Events: config.Events{
-					Enabled: ptrutil.ToPtr(true),
-				},
-			},
-			want: ptrutil.ToPtr(true),
-		},
-		{
-			name: "account.EventsEnabled is non-nil, account.Events.Enabled is nil",
-			account: &config.Account{
-				EventsEnabled: ptrutil.ToPtr(true),
-				Events: config.Events{
-					Enabled: nil,
-				},
-			},
-			want: ptrutil.ToPtr(true),
-		},
-		{
-			name: "account.EventsEnabled is non-nil, account.Events.Enabled is non-nil",
-			account: &config.Account{
-				EventsEnabled: ptrutil.ToPtr(false),
-				Events: config.Events{
-					Enabled: ptrutil.ToPtr(true),
-				},
-			},
-			want: ptrutil.ToPtr(true),
-		},
-	}
-
-	for _, test := range testCases {
-		t.Run(test.name, func(t *testing.T) {
-			deprecateEventsEnabledField(test.account)
-			if test.account != nil {
-				assert.Equal(t, test.want, test.account.Events.Enabled)
-			}
-		})
-	}
-}
diff --git a/config/config_test.go b/config/config_test.go
index 325c59f6..69bd1213 100644
--- a/config/config_test.go
+++ b/config/config_test.go
@@ -12,7 +12,6 @@ import (
 
 	"github.com/prebid/go-gdpr/consentconstants"
 	"github.com/prebid/prebid-server/openrtb_ext"
-	"github.com/prebid/prebid-server/util/ptrutil"
 	"github.com/spf13/viper"
 	"github.com/stretchr/testify/assert"
 )
@@ -180,7 +179,6 @@ func TestDefaults(t *testing.T) {
 	cmpBools(t, "price_floors.enabled", false, cfg.PriceFloors.Enabled)
 
 	// Assert compression related defaults
-	cmpBools(t, "enable_gzip", false, cfg.EnableGzip)
 	cmpBools(t, "compression.request.enable_gzip", false, cfg.Compression.Request.GZIP)
 	cmpBools(t, "compression.response.enable_gzip", false, cfg.Compression.Response.GZIP)
 
@@ -191,8 +189,7 @@ func TestDefaults(t *testing.T) {
 	cmpBools(t, "account_defaults.price_floors.use_dynamic_data", false, cfg.AccountDefaults.PriceFloors.UseDynamicData)
 	cmpInts(t, "account_defaults.price_floors.max_rules", 100, cfg.AccountDefaults.PriceFloors.MaxRule)
 	cmpInts(t, "account_defaults.price_floors.max_schema_dims", 3, cfg.AccountDefaults.PriceFloors.MaxSchemaDims)
-	cmpBools(t, "account_defaults.events_enabled", *cfg.AccountDefaults.EventsEnabled, false)
-	cmpNils(t, "account_defaults.events.enabled", cfg.AccountDefaults.Events.Enabled)
+	cmpBools(t, "account_defaults.events.enabled", false, cfg.AccountDefaults.Events.Enabled)
 
 	cmpBools(t, "hooks.enabled", false, cfg.Hooks.Enabled)
 	cmpStrings(t, "validations.banner_creative_max_size", "skip", cfg.Validations.BannerCreativeMaxSize)
@@ -386,7 +383,6 @@ external_url: http://prebid-server.prebid.org/
 host: prebid-server.prebid.org
 port: 1234
 admin_port: 5678
-enable_gzip: false
 compression:
     request:
         enable_gzip: true
@@ -469,7 +465,6 @@ hooks:
 price_floors:
     enabled: true
 account_defaults:
-    events_enabled: false
     events:
         enabled: true
     price_floors:
@@ -582,14 +577,12 @@ func TestFullConfig(t *testing.T) {
 	cmpBools(t, "account_defaults.price_floors.use_dynamic_data", true, cfg.AccountDefaults.PriceFloors.UseDynamicData)
 	cmpInts(t, "account_defaults.price_floors.max_rules", 120, cfg.AccountDefaults.PriceFloors.MaxRule)
 	cmpInts(t, "account_defaults.price_floors.max_schema_dims", 5, cfg.AccountDefaults.PriceFloors.MaxSchemaDims)
-	cmpBools(t, "account_defaults.events_enabled", *cfg.AccountDefaults.EventsEnabled, true)
-	cmpNils(t, "account_defaults.events.enabled", cfg.AccountDefaults.Events.Enabled)
+	cmpBools(t, "account_defaults.events.enabled", true, cfg.AccountDefaults.Events.Enabled)
 
 	cmpInts(t, "account_defaults.privacy.ipv6.anon_keep_bits", 50, cfg.AccountDefaults.Privacy.IPv6Config.AnonKeepBits)
 	cmpInts(t, "account_defaults.privacy.ipv4.anon_keep_bits", 20, cfg.AccountDefaults.Privacy.IPv4Config.AnonKeepBits)
 
 	// Assert compression related defaults
-	cmpBools(t, "enable_gzip", false, cfg.EnableGzip)
 	cmpBools(t, "compression.request.enable_gzip", true, cfg.Compression.Request.GZIP)
 	cmpBools(t, "compression.response.enable_gzip", false, cfg.Compression.Response.GZIP)
 
@@ -2570,74 +2563,6 @@ func TestMigrateConfigDatabaseQueryParams(t *testing.T) {
 	assert.Equal(t, want_queries.poll_for_updates_amp_query, v.GetString("stored_responses.database.poll_for_updates.amp_query"))
 }
 
-func TestMigrateConfigCompression(t *testing.T) {
-	testCases := []struct {
-		desc                string
-		config              []byte
-		wantEnableGZIP      bool
-		wantReqGZIPEnabled  bool
-		wantRespGZIPEnabled bool
-	}{
-
-		{
-			desc:                "New config and old config not set",
-			config:              []byte{},
-			wantEnableGZIP:      false,
-			wantReqGZIPEnabled:  false,
-			wantRespGZIPEnabled: false,
-		},
-		{
-			desc: "Old config set, new config not set",
-			config: []byte(`
-                    enable_gzip: true
-                    `),
-			wantEnableGZIP:      true,
-			wantRespGZIPEnabled: true,
-			wantReqGZIPEnabled:  false,
-		},
-		{
-			desc: "Old config not set, new config set",
-			config: []byte(`
-                    compression:
-                        response:
-                            enable_gzip: true
-                        request:
-                            enable_gzip: false
-                    `),
-			wantEnableGZIP:      false,
-			wantRespGZIPEnabled: true,
-			wantReqGZIPEnabled:  false,
-		},
-		{
-			desc: "Old config set and new config set",
-			config: []byte(`
-                    enable_gzip: true
-                    compression:
-                        response:
-                            enable_gzip: false
-                        request:
-                            enable_gzip: true
-                    `),
-			wantEnableGZIP:      true,
-			wantRespGZIPEnabled: false,
-			wantReqGZIPEnabled:  true,
-		},
-	}
-
-	for _, test := range testCases {
-		v := viper.New()
-		v.SetConfigType("yaml")
-		err := v.ReadConfig(bytes.NewBuffer(test.config))
-		assert.NoError(t, err)
-
-		migrateConfigCompression(v)
-
-		assert.Equal(t, test.wantEnableGZIP, v.GetBool("enable_gzip"), test.desc)
-		assert.Equal(t, test.wantReqGZIPEnabled, v.GetBool("compression.request.enable_gzip"), test.desc)
-		assert.Equal(t, test.wantRespGZIPEnabled, v.GetBool("compression.response.enable_gzip"), test.desc)
-	}
-}
-
 func TestIsConfigInfoPresent(t *testing.T) {
 	configPrefix1Field2Only := []byte(`
       prefix1:
@@ -3287,52 +3212,3 @@ func TestTCF2FeatureOneVendorException(t *testing.T) {
 		assert.Equal(t, tt.wantIsVendorException, value, tt.description)
 	}
 }
-
-func TestMigrateConfigEventsEnabled(t *testing.T) {
-	testCases := []struct {
-		name                  string
-		oldFieldValue         *bool
-		newFieldValue         *bool
-		expectedOldFieldValue *bool
-		expectedNewFieldValue *bool
-	}{
-		{
-			name:                  "Both old and new fields are nil",
-			oldFieldValue:         nil,
-			newFieldValue:         nil,
-			expectedOldFieldValue: nil,
-			expectedNewFieldValue: nil,
-		},
-		{
-			name:                  "Only old field is set",
-			oldFieldValue:         ptrutil.ToPtr(true),
-			newFieldValue:         nil,
-			expectedOldFieldValue: ptrutil.ToPtr(true),
-			expectedNewFieldValue: nil,
-		},
-		{
-			name:                  "Only new field is set",
-			oldFieldValue:         nil,
-			newFieldValue:         ptrutil.ToPtr(true),
-			expectedOldFieldValue: ptrutil.ToPtr(true),
-			expectedNewFieldValue: nil,
-		},
-		{
-			name:                  "Both old and new fields are set, override old field with new field value",
-			oldFieldValue:         ptrutil.ToPtr(false),
-			newFieldValue:         ptrutil.ToPtr(true),
-			expectedOldFieldValue: ptrutil.ToPtr(true),
-			expectedNewFieldValue: nil,
-		},
-	}
-
-	for _, tc := range testCases {
-		t.Run(tc.name, func(t *testing.T) {
-			updatedOldFieldValue, updatedNewFieldValue := migrateConfigEventsEnabled(tc.oldFieldValue, tc.newFieldValue)
-
-			assert.Equal(t, tc.expectedOldFieldValue, updatedOldFieldValue)
-			assert.Nil(t, updatedNewFieldValue)
-			assert.Nil(t, tc.expectedNewFieldValue)
-		})
-	}
-}
diff --git a/config/events_test.go b/config/events_test.go
index 4baa9066..b4c196e9 100644
--- a/config/events_test.go
+++ b/config/events_test.go
@@ -3,7 +3,6 @@ package config
 import (
 	"testing"
 
-	"github.com/prebid/prebid-server/util/ptrutil"
 	"github.com/stretchr/testify/assert"
 )
 
@@ -262,29 +261,22 @@ func TestValidate(t *testing.T) {
 		{
 			description: "Empty default URL",
 			events: Events{
-				Enabled: ptrutil.ToPtr(true),
+				Enabled: true,
 			},
 			expectErr: true,
 		},
 		{
 			description: "Events are disabled. Skips validations",
 			events: Events{
-				Enabled:    ptrutil.ToPtr(false),
+				Enabled:    false,
 				DefaultURL: "",
 			},
 			expectErr: false,
 		},
-		{
-			description: "Events are nil. Skip validations",
-			events: Events{
-				Enabled: nil,
-			},
-			expectErr: false,
-		},
 		{
 			description: "No VAST Events and default URL present",
 			events: Events{
-				Enabled:    ptrutil.ToPtr(true),
+				Enabled:    true,
 				DefaultURL: "http://prebid.org",
 			},
 			expectErr: false,
@@ -292,7 +284,7 @@ func TestValidate(t *testing.T) {
 		{
 			description: "Invalid VAST Event",
 			events: Events{
-				Enabled:    ptrutil.ToPtr(true),
+				Enabled:    true,
 				DefaultURL: "http://prebid.org",
 				VASTEvents: []VASTEvent{
 					{},
@@ -335,34 +327,3 @@ func TestValidateVASTEvents(t *testing.T) {
 		assert.Equal(t, !test.expectErr, err == nil, test.description)
 	}
 }
-
-func TestIsEnabled(t *testing.T) {
-	testCases := []struct {
-		name     string
-		events   Events
-		expected bool
-	}{
-		{
-			name:     "nil pointer",
-			events:   Events{},
-			expected: false,
-		},
-		{
-			name:     "event false",
-			events:   Events{Enabled: ptrutil.ToPtr(false)},
-			expected: false,
-		},
-		{
-			name:     "event true",
-			events:   Events{Enabled: ptrutil.ToPtr(true)},
-			expected: true,
-		},
-	}
-
-	for _, tc := range testCases {
-		t.Run(tc.name, func(t *testing.T) {
-			actual := tc.events.IsEnabled()
-			assert.Equal(t, tc.expected, actual)
-		})
-	}
-}
diff --git a/exchange/exchange_test.go b/exchange/exchange_test.go
index c4b85ebe..6e6e8afe 100644
--- a/exchange/exchange_test.go
+++ b/exchange/exchange_test.go
@@ -2359,7 +2359,7 @@ func runSpec(t *testing.T, filename string, spec *exchangeSpec) {
 		Account: config.Account{
 			ID: "testaccount",
 			Events: config.Events{
-				Enabled: &spec.EventsEnabled,
+				Enabled: spec.EventsEnabled,
 			},
 			DebugAllow:  true,
 			PriceFloors: config.AccountPriceFloors{Enabled: spec.AccountFloorsEnabled},
diff --git a/server/server_test.go b/server/server_test.go
index 23b45656..7af892d3 100644
--- a/server/server_test.go
+++ b/server/server_test.go
@@ -192,7 +192,6 @@ func TestListen(t *testing.T) {
 			Port:             8000,
 			UnixSocketEnable: false,
 			UnixSocketName:   "prebid_socket",
-			EnableGzip:       false,
 		}
 	)