Skip to content

Commit

Permalink
fold on-demand edge sync message (#429)
Browse files Browse the repository at this point in the history
* refactor on-demand sync, adds folding of on-demand edge sync messages
* update go-edge-ds 
  * go-directory v0.31.6 (pb-directory v0.31.4)
  * go-authorizer v0.20.17 (pb-authorizer v0.20.9)
  * errors v0.0.9
  • Loading branch information
gertd committed Jul 23, 2024
1 parent ac92246 commit 1312ac6
Show file tree
Hide file tree
Showing 14 changed files with 252 additions and 142 deletions.
2 changes: 2 additions & 0 deletions builtins/edge/ds/check.go
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@ func RegisterCheckRelation(logger *zerolog.Logger, fnName string, dr resolvers.D
return nil, errors.Wrapf(err, "get directory client")
}

//nolint: staticcheck // SA1019: client.CheckRelation is deprecated
resp, err := client.CheckRelation(bctx.Context, &args)
if err != nil {
traceError(&bctx, fnName, err)
Expand Down Expand Up @@ -151,6 +152,7 @@ func RegisterCheckPermission(logger *zerolog.Logger, fnName string, dr resolvers
return nil, errors.Wrapf(err, "get directory client")
}

//nolint: staticcheck // SA1019: client.CheckPermission is deprecated
resp, err := client.CheckPermission(bctx.Context, &args)
if err != nil {
traceError(&bctx, fnName, err)
Expand Down
11 changes: 3 additions & 8 deletions cmd/topazd/topaz_run.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import (
"github.com/aserto-dev/topaz/pkg/cc/config"
"github.com/aserto-dev/topaz/pkg/debug"
"github.com/spf13/cobra"
"golang.org/x/sync/errgroup"
)

var (
Expand All @@ -19,7 +18,6 @@ var (
flagRunIgnorePaths []string
flagRunDebug bool
debugService *debug.Server
errGroup *errgroup.Group
)

var cmdRun = &cobra.Command{
Expand All @@ -44,9 +42,7 @@ var cmdRun = &cobra.Command{
}

if flagRunDebug {
cfg.Debug.Enabled = true
cfg.Debug.ListenAddress = "localhost:6060"
cfg.Debug.ShutdownTimeout = 5
cfg.Common.DebugService.Enabled = flagRunDebug
}
})
defer func() {
Expand All @@ -63,9 +59,8 @@ var cmdRun = &cobra.Command{
return err
}

if topazApp.Configuration.Debug.Enabled {
errGroup = new(errgroup.Group)
debugService = debug.NewServer(&topazApp.Configuration.Debug, topazApp.Logger, errGroup)
if topazApp.Configuration.DebugService.Enabled {
debugService = debug.NewServer(&topazApp.Configuration.DebugService, topazApp.Logger)
debugService.Start()
}

Expand Down
35 changes: 18 additions & 17 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ toolchain go1.22.5
// replace github.com/aserto-dev/go-directory => ../go-directory
// replace github.com/aserto-dev/go-directory-cli => ../go-directory-cli
// replace github.com/aserto-dev/go-edge-ds => ../go-edge-ds

// replace github.com/aserto-dev/azm => ../azm
// replace github.com/aserto-dev/go-topaz-ui => ../go-topaz-ui
// replace github.com/aserto-dev/service-host => ../service-host
Expand All @@ -21,13 +22,13 @@ require (
github.com/aserto-dev/aserto-management v0.9.4
github.com/aserto-dev/azm v0.1.11
github.com/aserto-dev/certs v0.0.6
github.com/aserto-dev/errors v0.0.8
github.com/aserto-dev/errors v0.0.9
github.com/aserto-dev/go-aserto v0.31.4
github.com/aserto-dev/go-authorizer v0.20.6
github.com/aserto-dev/go-directory v0.31.5
github.com/aserto-dev/go-authorizer v0.20.7
github.com/aserto-dev/go-directory v0.31.6
github.com/aserto-dev/go-directory-cli v0.31.3-0.20240711215128-477b23ffcb75
github.com/aserto-dev/go-edge-ds v0.32.1
github.com/aserto-dev/go-grpc v0.8.65
github.com/aserto-dev/go-edge-ds v0.32.3
github.com/aserto-dev/go-grpc v0.8.67
github.com/aserto-dev/go-topaz-ui v0.1.11
github.com/aserto-dev/header v0.0.7
github.com/aserto-dev/logger v0.0.4
Expand All @@ -37,7 +38,7 @@ require (
github.com/aserto-dev/self-decision-logger v0.0.5
github.com/aserto-dev/service-host v0.0.14
github.com/cli/browser v1.3.0
github.com/docker/docker v27.0.3+incompatible
github.com/docker/docker v27.1.0+incompatible
github.com/docker/go-connections v0.5.0
github.com/fatih/color v1.17.0
github.com/fullstorydev/grpcurl v1.9.1
Expand All @@ -59,7 +60,7 @@ require (
github.com/pkg/errors v0.9.1
github.com/rivo/tview v0.0.0-20240625185742-b0a7293b8130
github.com/rs/zerolog v1.33.0
github.com/samber/lo v1.44.0
github.com/samber/lo v1.46.0
github.com/spf13/cobra v1.8.1
github.com/spf13/viper v1.19.0
github.com/stretchr/testify v1.9.0
Expand All @@ -73,7 +74,7 @@ require (
)

require (
buf.build/gen/go/bufbuild/protovalidate/protocolbuffers/go v1.34.2-20240508200655-46a4cf4ba109.2 // indirect
buf.build/gen/go/bufbuild/protovalidate/protocolbuffers/go v1.34.2-20240717164558-a6c49f84cc0f.2 // indirect
contrib.go.opencensus.io/exporter/prometheus v0.4.2 // indirect
github.com/AdaLogics/go-fuzz-headers v0.0.0-20230811130428-ced1acdcaa24 // indirect
github.com/Azure/go-ansiterm v0.0.0-20230124172434-306776ec8161 // indirect
Expand All @@ -85,7 +86,7 @@ require (
github.com/aserto-dev/go-decision-logs v0.0.4 // indirect
github.com/beorn7/perks v1.0.1 // indirect
github.com/bufbuild/protocompile v0.13.0 // indirect
github.com/bufbuild/protovalidate-go v0.6.2 // indirect
github.com/bufbuild/protovalidate-go v0.6.3 // indirect
github.com/bytecodealliance/wasmtime-go/v3 v3.0.2 // indirect
github.com/cespare/xxhash/v2 v2.3.0 // indirect
github.com/cncf/xds/go v0.0.0-20240423153145-555b57ec207b // indirect
Expand Down Expand Up @@ -187,16 +188,16 @@ require (
go.opentelemetry.io/otel/sdk v1.27.0 // indirect
go.opentelemetry.io/otel/trace v1.27.0 // indirect
go.uber.org/multierr v1.11.0 // indirect
golang.org/x/crypto v0.24.0 // indirect
golang.org/x/exp v0.0.0-20240613232115-7f521ea00fb8 // indirect
golang.org/x/mod v0.18.0 // indirect
golang.org/x/net v0.26.0 // indirect
golang.org/x/term v0.21.0 // indirect
golang.org/x/crypto v0.25.0 // indirect
golang.org/x/exp v0.0.0-20240719175910-8a7402abbf56 // indirect
golang.org/x/mod v0.19.0 // indirect
golang.org/x/net v0.27.0 // indirect
golang.org/x/term v0.22.0 // indirect
golang.org/x/text v0.16.0 // indirect
golang.org/x/time v0.5.0 // indirect
golang.org/x/tools v0.22.0 // indirect
google.golang.org/genproto/googleapis/api v0.0.0-20240624140628-dc46fd24d27d // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20240624140628-dc46fd24d27d // indirect
golang.org/x/tools v0.23.0 // indirect
google.golang.org/genproto/googleapis/api v0.0.0-20240722135656-d784300faade // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20240722135656-d784300faade // indirect
gopkg.in/ini.v1 v1.67.0 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
Expand Down
Loading

0 comments on commit 1312ac6

Please sign in to comment.