diff --git a/go.mod b/go.mod index e865a43bdeae8..35aab3a2177db 100644 --- a/go.mod +++ b/go.mod @@ -317,7 +317,7 @@ require ( github.com/fatih/color v1.16.0 // indirect github.com/felixge/httpsnoop v1.0.4 // indirect github.com/form3tech-oss/jwt-go v3.2.5+incompatible // indirect - github.com/fsnotify/fsnotify v1.7.0 // indirect + github.com/fsnotify/fsnotify v1.7.0 github.com/fvbommel/sortorder v1.1.0 // indirect github.com/gabriel-vasile/mimetype v1.4.3 // indirect github.com/go-asn1-ber/asn1-ber v1.5.5 // indirect diff --git a/lib/auth/clusterconfig/clusterconfigv1/service.go b/lib/auth/clusterconfig/clusterconfigv1/service.go index 8a98b855996cd..8edecb8757bea 100644 --- a/lib/auth/clusterconfig/clusterconfigv1/service.go +++ b/lib/auth/clusterconfig/clusterconfigv1/service.go @@ -1030,7 +1030,7 @@ func (s *Service) UpdateAccessGraphSettings(ctx context.Context, req *clustercon return nil, trace.Wrap(err) } - if !modules.GetModules().Features().GetEntitlement(entitlements.Policy).Enabled && !modules.GetModules().Features().AccessGraph { + if !modules.GetModules().Features().Policy.Enabled && !modules.GetModules().Features().AccessGraph { return nil, trace.AccessDenied("access graph is feature isn't enabled") } @@ -1074,7 +1074,7 @@ func (s *Service) UpsertAccessGraphSettings(ctx context.Context, req *clustercon return nil, trace.Wrap(err) } - if !modules.GetModules().Features().GetEntitlement(entitlements.Policy).Enabled && !modules.GetModules().Features().AccessGraph { + if !modules.GetModules().Features().Policy.Enabled && !modules.GetModules().Features().AccessGraph { return nil, trace.AccessDenied("access graph is feature isn't enabled") } @@ -1118,7 +1118,7 @@ func (s *Service) ResetAccessGraphSettings(ctx context.Context, _ *clusterconfig return nil, trace.Wrap(err) } - if !modules.GetModules().Features().GetEntitlement(entitlements.Policy).Enabled && !modules.GetModules().Features().AccessGraph { + if !modules.GetModules().Features().Policy.Enabled && !modules.GetModules().Features().AccessGraph { return nil, trace.AccessDenied("access graph is feature isn't enabled") } diff --git a/lib/auth/clusterconfig/clusterconfigv1/service_test.go b/lib/auth/clusterconfig/clusterconfigv1/service_test.go index 714567f3fb505..b3ac67e1cc342 100644 --- a/lib/auth/clusterconfig/clusterconfigv1/service_test.go +++ b/lib/auth/clusterconfig/clusterconfigv1/service_test.go @@ -1902,8 +1902,8 @@ func TestGetAccessGraphConfig(t *testing.T) { testSetup: func(t *testing.T) { m := modules.TestModules{ TestFeatures: modules.Features{ - Entitlements: map[entitlements.EntitlementKind]modules.EntitlementInfo{ - entitlements.Policy: {Enabled: true}, + Policy: modules.PolicyFeature{ + Enabled: true, }, }, } @@ -2060,8 +2060,8 @@ func TestUpdateAccessGraphSettings(t *testing.T) { testSetup: func(t *testing.T) { m := modules.TestModules{ TestFeatures: modules.Features{ - Entitlements: map[entitlements.EntitlementKind]modules.EntitlementInfo{ - entitlements.Policy: {Enabled: true}, + Policy: modules.PolicyFeature{ + Enabled: true, }, }, } @@ -2185,8 +2185,8 @@ func TestUpsertAccessGraphSettings(t *testing.T) { testSetup: func(t *testing.T) { m := modules.TestModules{ TestFeatures: modules.Features{ - Entitlements: map[entitlements.EntitlementKind]modules.EntitlementInfo{ - entitlements.Policy: {Enabled: true}, + Policy: modules.PolicyFeature{ + Enabled: true, }, }, } @@ -2279,8 +2279,8 @@ func TestResetAccessGraphSettings(t *testing.T) { testSetup: func(t *testing.T) { m := modules.TestModules{ TestFeatures: modules.Features{ - Entitlements: map[entitlements.EntitlementKind]modules.EntitlementInfo{ - entitlements.Policy: {Enabled: true}, + Policy: modules.PolicyFeature{ + Enabled: true, }, }, }