Skip to content

Commit

Permalink
fix api module
Browse files Browse the repository at this point in the history
  • Loading branch information
tigrato committed Jul 30, 2024
1 parent 1028828 commit 25a6b98
Show file tree
Hide file tree
Showing 6 changed files with 1,255 additions and 1,002 deletions.
3 changes: 3 additions & 0 deletions api/proto/teleport/legacy/types/events/events.proto
Original file line number Diff line number Diff line change
Expand Up @@ -4442,6 +4442,9 @@ message OneOf {
events.DiscoveryConfigDelete DiscoveryConfigDelete = 162;
events.DiscoveryConfigDeleteAll DiscoveryConfigDeleteAll = 163;
events.AccessGraphSettingsUpdate AccessGraphSettingsUpdate = 164;
events.IntegrationCreate IntegrationCreate = 165;
events.IntegrationUpdate IntegrationUpdate = 166;
events.IntegrationDelete IntegrationDelete = 167;
}
}

Expand Down
2,229 changes: 1,240 additions & 989 deletions api/types/events/events.pb.go

Large diffs are not rendered by default.

1 change: 0 additions & 1 deletion api/types/events/oneof.go
Original file line number Diff line number Diff line change
Expand Up @@ -704,7 +704,6 @@ func ToOneOf(in AuditEvent) (*OneOf, error) {
out.Event = &OneOf_IntegrationDelete{
IntegrationDelete: e,
}

default:
slog.ErrorContext(context.Background(), "Attempted to convert dynamic event of unknown type into protobuf event.", "event_type", in.GetType())
unknown := &Unknown{}
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions lib/auth/clusterconfig/clusterconfigv1/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -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")
}

Expand Down Expand Up @@ -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")
}

Expand Down Expand Up @@ -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")
}

Expand Down
16 changes: 8 additions & 8 deletions lib/auth/clusterconfig/clusterconfigv1/service_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
},
},
}
Expand Down Expand Up @@ -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,
},
},
}
Expand Down Expand Up @@ -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,
},
},
}
Expand Down Expand Up @@ -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,
},
},
}
Expand Down

0 comments on commit 25a6b98

Please sign in to comment.