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 16e8f68
Show file tree
Hide file tree
Showing 7 changed files with 1,257 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
2 changes: 2 additions & 0 deletions integrations/terraform/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -1024,6 +1024,8 @@ github.com/foxcpp/go-mockdns v1.0.0 h1:7jBqxd3WDWwi/6WhDvacvH1XsN3rOLXyHM1uhvIx6
github.com/foxcpp/go-mockdns v1.0.0/go.mod h1:lgRN6+KxQBawyIghpnl5CezHFGS9VLzvtVlwxvzXTQ4=
github.com/frankban/quicktest v1.14.6 h1:7Xjx+VpznH+oBnejlPUj8oUpdxnVs4f8XU8WnHkI4W8=
github.com/frankban/quicktest v1.14.6/go.mod h1:4ptaffx2x8+WTWXmUCuVU6aPUX1/Mz7zb5vbUoiM6w0=
github.com/fsnotify/fsnotify v1.7.0 h1:8JEhPFa5W2WU7YfeZzPNqzMP6Lwt7L2715Ggo0nosvA=
github.com/fsnotify/fsnotify v1.7.0/go.mod h1:40Bi/Hjc2AVfZrqy+aj+yEI+/bRxZnMJyTJwOpGvigM=
github.com/fxamacker/cbor/v2 v2.6.0 h1:sU6J2usfADwWlYDAFhZBQ6TnLFBHxgesMrQfQgk1tWA=
github.com/fxamacker/cbor/v2 v2.6.0/go.mod h1:pxXPTn3joSm21Gbwsv0w9OSA2y1HFR9qXEeXQVeNoDQ=
github.com/ghodss/yaml v1.0.0 h1:wQHKEahhL6wmXdzwWG11gIVCkOv05bNOh+Rxn0yngAk=
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 16e8f68

Please sign in to comment.