Skip to content

Commit

Permalink
update gomod
Browse files Browse the repository at this point in the history
  • Loading branch information
tigrato committed Jul 30, 2024
1 parent 183e7f6 commit 3e6e2a5
Show file tree
Hide file tree
Showing 8 changed files with 1,242 additions and 985 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 @@ -4369,6 +4369,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,186 changes: 1,219 additions & 967 deletions api/types/events/events.pb.go

Large diffs are not rendered by default.

3 changes: 2 additions & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -233,6 +233,8 @@ require (
// Updating causes breaking changes.
require github.com/mailgun/minheap v0.0.0-20170619185613-3dbe6c6bf55f // indirect

require github.com/fsnotify/fsnotify v1.7.0

require (
cloud.google.com/go v0.112.2 // indirect
cloud.google.com/go/auth v0.3.0 // indirect
Expand Down Expand Up @@ -317,7 +319,6 @@ 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/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
2 changes: 0 additions & 2 deletions lib/client/proxy/insecure/insecure_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,11 @@ import (
"github.com/gravitational/teleport/api/types"
"github.com/gravitational/teleport/lib/auth"
"github.com/gravitational/teleport/lib/defaults"
"github.com/gravitational/teleport/lib/modules"
"github.com/gravitational/teleport/lib/srv/alpnproxy/common"
"github.com/gravitational/teleport/lib/utils"
)

func TestMain(m *testing.M) {
modules.SetInsecureTestMode(true)
os.Exit(m.Run())
}

Expand Down
3 changes: 3 additions & 0 deletions lib/services/local/access_graph_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ import (
"google.golang.org/protobuf/testing/protocmp"

accessgraphsecretspb "github.com/gravitational/teleport/api/gen/proto/go/teleport/accessgraph/v1"
headerv1 "github.com/gravitational/teleport/api/gen/proto/go/teleport/header/v1"
"github.com/gravitational/teleport/api/types/accessgraph"
"github.com/gravitational/teleport/lib/backend/memory"
)
Expand Down Expand Up @@ -89,6 +90,7 @@ func TestAccessGraphAuthorizedKeys(t *testing.T) {
require.NoError(t, err)
require.Empty(t, cmp.Diff(authKeys, keys,
protocmp.Transform(),
protocmp.IgnoreFields(&headerv1.Metadata{}, "id"),
cmpopts.SortSlices(func(a, b *accessgraphsecretspb.AuthorizedKey) bool {
return a.Metadata.Name < b.Metadata.Name
})))
Expand Down Expand Up @@ -196,6 +198,7 @@ func TestAccessGraphPrivateKeys(t *testing.T) {
require.NoError(t, err)
require.Empty(t, cmp.Diff(authKeys, keys,
protocmp.Transform(),
protocmp.IgnoreFields(&headerv1.Metadata{}, "id"),
cmpopts.SortSlices(func(a, b *accessgraphsecretspb.PrivateKey) bool {
return a.Metadata.Name < b.Metadata.Name
})))
Expand Down
8 changes: 4 additions & 4 deletions lib/services/local/generic/generic_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -364,14 +364,14 @@ func TestGenericListResourcesWithMultiplePrefixes(t *testing.T) {
page, next, err := service.ListResources(ctx, 1, "")
require.NoError(t, err)
require.Empty(t, cmp.Diff([]*testResource{r1}, page,
cmpopts.IgnoreFields(types.Metadata{}, "Revision"),
cmpopts.IgnoreFields(types.Metadata{}, "Revision", "ID"),
))
require.Equal(t, next, "another-unique-prefix"+string(backend.Separator)+r2.GetName())

page, next, err = service.ListResources(ctx, 1, next)
require.NoError(t, err)
require.Empty(t, cmp.Diff([]*testResource{r2}, page,
cmpopts.IgnoreFields(types.Metadata{}, "Revision"),
cmpopts.IgnoreFields(types.Metadata{}, "Revision", "ID"),
))
require.Empty(t, next)

Expand All @@ -380,14 +380,14 @@ func TestGenericListResourcesWithMultiplePrefixes(t *testing.T) {
page, next, err = service.WithPrefix("a-unique-prefix").ListResources(ctx, 1, "")
require.NoError(t, err)
require.Empty(t, cmp.Diff([]*testResource{r1}, page,
cmpopts.IgnoreFields(types.Metadata{}, "Revision"),
cmpopts.IgnoreFields(types.Metadata{}, "Revision", "ID"),
))
require.Equal(t, next, r2.GetName())

page, next, err = service.WithPrefix("a-unique-prefix").ListResources(ctx, 1, next)
require.NoError(t, err)
require.Empty(t, cmp.Diff([]*testResource{r2}, page,
cmpopts.IgnoreFields(types.Metadata{}, "Revision"),
cmpopts.IgnoreFields(types.Metadata{}, "Revision", "ID"),
))
require.Empty(t, next)
}
Expand Down

0 comments on commit 3e6e2a5

Please sign in to comment.