diff --git a/cmd/cli/cmd/root.go b/cmd/cli/cmd/root.go index dd6ce77..60ffda3 100644 --- a/cmd/cli/cmd/root.go +++ b/cmd/cli/cmd/root.go @@ -4,18 +4,22 @@ import ( "encoding/json" "fmt" "os" + "path/filepath" "reflect" + "runtime/debug" "strings" "text/tabwriter" + "time" "github.com/TylerBrock/colorjson" "github.com/Yamashou/gqlgenc/clientv2" homedir "github.com/mitchellh/go-homedir" + "github.com/rs/zerolog" + "github.com/rs/zerolog/log" "github.com/spf13/cobra" "github.com/spf13/pflag" "github.com/spf13/viper" "github.com/theopenlane/utils/cli/rows" - "go.uber.org/zap" "github.com/theopenlane/dbx/pkg/dbxclient" ) @@ -28,7 +32,6 @@ const ( var ( cfgFile string - Logger *zap.SugaredLogger ) var ( @@ -96,35 +99,49 @@ func initConfig() { viper.AutomaticEnv() // read in environment variables that match err := viper.ReadInConfig() + if err == nil { + log.Info().Str("file", viper.ConfigFileUsed()).Msg("using config file") + } GraphAPIHost = fmt.Sprintf("%s%s", RootHost, graphEndpoint) setupLogging() - - if err == nil { - Logger.Infow("using config file", "file", viper.ConfigFileUsed()) - } } +// setupLogging sets up the logging defaults for the application func setupLogging() { - cfg := zap.NewProductionConfig() - if viper.GetBool("logging.pretty") { - cfg = zap.NewDevelopmentConfig() - } + // setup logging with time and app name + log.Logger = zerolog.New(os.Stderr). + With().Timestamp(). + Logger(). + With().Str("app", appName). + Logger() + + // set the log level + zerolog.SetGlobalLevel(zerolog.InfoLevel) + // set the log level to debug if the debug flag is set and add additional information if viper.GetBool("logging.debug") { - cfg.Level = zap.NewAtomicLevelAt(zap.DebugLevel) - } else { - cfg.Level = zap.NewAtomicLevelAt(zap.InfoLevel) - } + zerolog.SetGlobalLevel(zerolog.DebugLevel) - l, err := cfg.Build() - if err != nil { - panic(err) + buildInfo, _ := debug.ReadBuildInfo() + + log.Logger = log.Logger.With(). + Caller(). + Int("pid", os.Getpid()). + Str("go_version", buildInfo.GoVersion).Logger() } - Logger = l.Sugar().With("app", appName) - defer Logger.Sync() //nolint:errcheck + // pretty logging for development + if viper.GetBool("logging.pretty") { + log.Logger = log.Output(zerolog.ConsoleWriter{ + Out: os.Stderr, + TimeFormat: time.RFC3339, + FormatCaller: func(i interface{}) string { + return filepath.Base(fmt.Sprintf("%s", i)) + }, + }) + } } // ViperBindFlag provides a wrapper around the viper bindings that panics if an error occurs diff --git a/cmd/root.go b/cmd/root.go index 9962c01..3ca6a71 100644 --- a/cmd/root.go +++ b/cmd/root.go @@ -1,18 +1,21 @@ package cmd import ( + "fmt" + "os" + "path/filepath" + "runtime/debug" + "time" + + "github.com/rs/zerolog" + "github.com/rs/zerolog/log" "github.com/spf13/cobra" "github.com/spf13/pflag" "github.com/spf13/viper" - "go.uber.org/zap" ) const appName = "dbx" -var ( - logger *zap.SugaredLogger -) - // rootCmd represents the base command when called without any subcommands var rootCmd = &cobra.Command{ Use: appName, @@ -40,12 +43,11 @@ func init() { // refer to the README.md for more information func initConfig() { err := viper.ReadInConfig() - - logger = newLogger() - - if err == nil { - logger.Infow("using config file", "file", viper.ConfigFileUsed()) + if err != nil { + log.Info().Err(err).Str("file", viper.ConfigFileUsed()).Msg("error reading config file") } + + setupLogging() } // viperBindFlag provides a wrapper around the viper bindings that panics if an error occurs @@ -56,23 +58,38 @@ func viperBindFlag(name string, flag *pflag.Flag) { } } -// newLogger creates a new zap logger with the appropriate configuration based on the viper settings for pretty and debug -func newLogger() *zap.SugaredLogger { - cfg := zap.NewProductionConfig() - if viper.GetBool("pretty") { - cfg = zap.NewDevelopmentConfig() - } +// setupLogging sets up the logging defaults for the application +func setupLogging() { + // setup logging with time and app name + log.Logger = zerolog.New(os.Stderr). + With().Timestamp(). + Logger(). + With().Str("app", appName). + Logger() + // set the log level + zerolog.SetGlobalLevel(zerolog.InfoLevel) + + // set the log level to debug if the debug flag is set and add additional information if viper.GetBool("debug") { - cfg.Level = zap.NewAtomicLevelAt(zap.DebugLevel) - } else { - cfg.Level = zap.NewAtomicLevelAt(zap.InfoLevel) - } + zerolog.SetGlobalLevel(zerolog.DebugLevel) - logger, err := cfg.Build() - if err != nil { - panic(err) + buildInfo, _ := debug.ReadBuildInfo() + + log.Logger = log.Logger.With(). + Caller(). + Int("pid", os.Getpid()). + Str("go_version", buildInfo.GoVersion).Logger() } - return logger.Sugar() + // pretty logging for development + if viper.GetBool("pretty") { + log.Logger = log.Output(zerolog.ConsoleWriter{ + Out: os.Stderr, + TimeFormat: time.RFC3339, + FormatCaller: func(i interface{}) string { + return filepath.Base(fmt.Sprintf("%s", i)) + }, + }) + } } diff --git a/cmd/serve.go b/cmd/serve.go index eb06a8b..a8f6078 100644 --- a/cmd/serve.go +++ b/cmd/serve.go @@ -3,11 +3,10 @@ package cmd import ( "context" + "github.com/rs/zerolog/log" "github.com/spf13/cobra" "github.com/spf13/viper" "github.com/theopenlane/beacon/otelx" - "go.uber.org/zap" - "github.com/theopenlane/go-turso" "github.com/theopenlane/utils/cache" @@ -42,7 +41,6 @@ func serve(ctx context.Context) error { serverOpts := []serveropts.ServerOption{} serverOpts = append(serverOpts, serveropts.WithConfigProvider(&config.ConfigProviderWithRefresh{}), - serveropts.WithLogger(logger), serveropts.WithHTTPS(), serveropts.WithMiddleware(), ) @@ -51,23 +49,23 @@ func serve(ctx context.Context) error { err = otelx.NewTracer(so.Config.Settings.Tracer, appName) if err != nil { - logger.Fatalw("failed to initialize tracer", "error", err) + log.Fatal().Err(err).Msg("failed to initialize tracer") } // create ent dependency injection - entOpts := []ent.Option{ent.Logger(*logger)} + entOpts := []ent.Option{} if so.Config.Settings.Providers.TursoEnabled { tursoClient, err := turso.NewClient(so.Config.Settings.Turso) if err != nil { - logger.Fatalw("failed to initialize turso client", "error", err) + log.Fatal().Err(err).Msg("failed to initialize turso client") } entOpts = append(entOpts, ent.Turso(tursoClient)) } // Setup DB connection - entdbClient, dbConfig, err := entdb.NewMultiDriverDBClient(ctx, so.Config.Settings.DB, logger, entOpts) + entdbClient, dbConfig, err := entdb.NewMultiDriverDBClient(ctx, so.Config.Settings.DB, entOpts) if err != nil { return err } @@ -89,13 +87,13 @@ func serve(ctx context.Context) error { serveropts.WithReadyChecks(dbConfig, redisClient), ) - srv := server.NewServer(so.Config, so.Config.Logger) + srv := server.NewServer(so.Config) // Setup Graph API Handlers so.AddServerOptions(serveropts.WithGraphRoute(srv, entdbClient)) if err := srv.StartEchoServer(ctx); err != nil { - logger.Error("failed to run server", zap.Error(err)) + log.Error().Err(err).Msg("failed to run server") } return nil diff --git a/go.mod b/go.mod index 82d67bb..d1067d6 100644 --- a/go.mod +++ b/go.mod @@ -24,73 +24,62 @@ require ( github.com/prometheus/client_golang v1.20.3 github.com/ravilushqa/otelgqlgen v0.17.0 github.com/redis/go-redis/v9 v9.6.1 + github.com/rs/zerolog v1.33.0 github.com/samber/lo v1.47.0 github.com/spf13/cobra v1.8.1 github.com/spf13/pflag v1.0.5 github.com/spf13/viper v1.19.0 github.com/stretchr/testify v1.9.0 github.com/theopenlane/beacon v0.1.0 - github.com/theopenlane/core v0.1.9 + github.com/theopenlane/core v0.1.10-0.20240913205734-41bd730e20cf github.com/theopenlane/echo-prometheus v0.1.0 github.com/theopenlane/echox v0.2.0 - github.com/theopenlane/echozap v0.1.0 - github.com/theopenlane/entx v0.1.7 + github.com/theopenlane/entx v0.2.0 github.com/theopenlane/go-turso v0.1.0 - github.com/theopenlane/iam v0.1.6 + github.com/theopenlane/iam v0.2.0 github.com/vektah/gqlparser/v2 v2.5.16 github.com/wundergraph/graphql-go-tools v1.67.4 - go.uber.org/zap v1.27.0 gocloud.dev v0.39.0 golang.org/x/crypto v0.27.0 ) require ( - github.com/alitto/pond v1.9.2 // indirect - github.com/boombuler/barcode v1.0.2 // indirect - github.com/dustinkirkland/golang-petname v0.0.0-20240428194347-eebcea082ee0 // indirect - github.com/fxamacker/cbor/v2 v2.7.0 // indirect - github.com/go-webauthn/webauthn v0.11.2 // indirect - github.com/go-webauthn/x v0.1.14 // indirect - github.com/gocarina/gocsv v0.0.0-20240520201108-78e41c74b4b1 // indirect - github.com/google/go-querystring v1.1.0 // indirect - github.com/google/go-tpm v0.9.1 // indirect + github.com/Azure/go-ansiterm v0.0.0-20230124172434-306776ec8161 // indirect + github.com/Microsoft/go-winio v0.6.2 // indirect + github.com/Nvveen/Gotty v0.0.0-20120604004816-cd527374f1e5 // indirect + github.com/cenkalti/backoff v2.2.1+incompatible // indirect + github.com/containerd/continuity v0.4.3 // indirect + github.com/docker/go-connections v0.5.0 // indirect + github.com/docker/go-units v0.5.0 // indirect github.com/hokaccha/go-prettyjson v0.0.0-20211117102719-0474bc63780f // indirect - github.com/nyaruka/phonenumbers v1.4.0 // indirect - github.com/posthog/posthog-go v1.2.21 // indirect - github.com/pquerna/otp v1.4.0 // indirect - github.com/sendgrid/rest v2.6.9+incompatible // indirect - github.com/sendgrid/sendgrid-go v3.16.0+incompatible // indirect - github.com/theopenlane/httpsling v0.2.0 // indirect - github.com/x448/float16 v0.8.4 // indirect + github.com/lib/pq v1.10.9 // indirect + github.com/opencontainers/go-digest v1.0.0 // indirect + github.com/opencontainers/image-spec v1.1.0 // indirect + github.com/opencontainers/runc v1.1.14 // indirect + github.com/ory/dockertest v3.3.5+incompatible // indirect + github.com/sirupsen/logrus v1.9.3 // indirect + go.uber.org/zap v1.27.0 // indirect + modernc.org/libc v1.60.0 // indirect ) require ( ariga.io/atlas v0.26.1 // indirect - github.com/Azure/go-ansiterm v0.0.0-20230124172434-306776ec8161 // indirect - github.com/Microsoft/go-winio v0.6.2 // indirect - github.com/Nvveen/Gotty v0.0.0-20120604004816-cd527374f1e5 // indirect github.com/XSAM/otelsql v0.33.0 // indirect github.com/agext/levenshtein v1.2.3 // indirect github.com/agnivade/levenshtein v1.1.1 // indirect - github.com/alicebob/gopher-json v0.0.0-20230218143504-906a9b012302 // indirect - github.com/alicebob/miniredis/v2 v2.33.0 // indirect github.com/antlr4-go/antlr/v4 v4.13.1 // indirect github.com/apparentlymart/go-textseg/v15 v15.0.0 // indirect github.com/bahlo/generic-list-go v0.2.0 // indirect github.com/beorn7/perks v1.0.1 // indirect github.com/buger/jsonparser v1.1.1 // indirect - github.com/cenkalti/backoff v2.2.1+incompatible // indirect github.com/cenkalti/backoff/v4 v4.3.0 // indirect github.com/cespare/xxhash/v2 v2.3.0 // indirect github.com/coder/websocket v1.8.12 // indirect - github.com/containerd/continuity v0.4.3 // indirect github.com/cpuguy83/go-md2man/v2 v2.0.4 // indirect github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect github.com/decred/dcrd/dcrec/secp256k1/v4 v4.3.0 // indirect github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f // indirect github.com/dlclark/regexp2 v1.11.4 // indirect - github.com/docker/go-connections v0.5.0 // indirect - github.com/docker/go-units v0.5.0 // indirect github.com/dustin/go-humanize v1.0.1 // indirect github.com/emirpasic/gods v1.18.1 // indirect github.com/envoyproxy/protoc-gen-validate v1.1.0 // indirect @@ -128,7 +117,6 @@ require ( github.com/lestrrat-go/iter v1.0.2 // indirect github.com/lestrrat-go/jwx/v2 v2.1.1 // indirect github.com/lestrrat-go/option v1.0.1 // indirect - github.com/lib/pq v1.10.9 // indirect github.com/magiconair/properties v1.8.7 // indirect github.com/mailru/easyjson v0.7.7 // indirect github.com/mattn/go-colorable v0.1.13 // indirect @@ -144,14 +132,10 @@ require ( github.com/ncruces/go-strftime v0.1.9 // indirect github.com/ogen-go/ogen v1.3.0 // indirect github.com/oklog/ulid/v2 v2.1.0 // indirect - github.com/opencontainers/go-digest v1.0.0 // indirect - github.com/opencontainers/image-spec v1.1.0 // indirect - github.com/opencontainers/runc v1.1.14 // indirect - github.com/openfga/api/proto v0.0.0-20240807201305-c96ec773cae9 // indirect + github.com/openfga/api/proto v0.0.0-20240906203051-102620ef2a66 // indirect github.com/openfga/go-sdk v0.6.0 // indirect - github.com/openfga/language/pkg/go v0.2.0-beta.0 // indirect - github.com/openfga/openfga v1.5.9 // indirect - github.com/ory/dockertest v3.3.5+incompatible // indirect + github.com/openfga/language/pkg/go v0.2.0-beta.2 // indirect + github.com/openfga/openfga v1.6.1 // indirect github.com/pelletier/go-toml/v2 v2.2.3 // indirect github.com/pkg/errors v0.9.1 // indirect github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect @@ -164,7 +148,6 @@ require ( github.com/sagikazarmark/slog-shim v0.1.0 // indirect github.com/segmentio/asm v1.2.0 // indirect github.com/sethvargo/go-retry v0.3.0 // indirect - github.com/sirupsen/logrus v1.9.3 // indirect github.com/sosodev/duration v1.3.1 // indirect github.com/sourcegraph/conc v0.3.0 // indirect github.com/spf13/afero v1.11.0 // indirect @@ -172,7 +155,7 @@ require ( github.com/stoewer/go-strcase v1.3.0 // indirect github.com/stretchr/objx v0.5.2 // indirect github.com/subosito/gotenv v1.6.0 // indirect - github.com/theopenlane/utils v0.1.5 + github.com/theopenlane/utils v0.2.0 github.com/tursodatabase/libsql-client-go v0.0.0-20240902231107-85af5b9d094d // indirect github.com/urfave/cli/v2 v2.27.4 // indirect github.com/valyala/bytebufferpool v1.0.0 // indirect @@ -182,21 +165,20 @@ require ( github.com/wk8/go-ordered-map/v2 v2.1.8 // indirect github.com/xhit/go-str2duration/v2 v2.1.0 // indirect github.com/xrash/smetrics v0.0.0-20240521201337-686a1a2994c1 // indirect - github.com/yuin/gopher-lua v1.1.1 // indirect github.com/zclconf/go-cty v1.15.0 // indirect go.opencensus.io v0.24.0 // indirect go.opentelemetry.io/contrib v1.29.0 // indirect - go.opentelemetry.io/otel v1.29.0 // indirect + go.opentelemetry.io/otel v1.30.0 // indirect go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.29.0 // indirect go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.29.0 // indirect go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.29.0 // indirect go.opentelemetry.io/otel/exporters/stdout/stdouttrace v1.29.0 // indirect - go.opentelemetry.io/otel/metric v1.29.0 // indirect + go.opentelemetry.io/otel/metric v1.30.0 // indirect go.opentelemetry.io/otel/sdk v1.29.0 // indirect - go.opentelemetry.io/otel/trace v1.29.0 // indirect + go.opentelemetry.io/otel/trace v1.30.0 // indirect go.opentelemetry.io/proto/otlp v1.3.1 // indirect go.uber.org/multierr v1.11.0 // indirect - golang.org/x/exp v0.0.0-20240823005443-9b4947da3948 // indirect + golang.org/x/exp v0.0.0-20240904232852-e7e105dedf7e // indirect golang.org/x/mod v0.21.0 // indirect golang.org/x/net v0.29.0 // indirect golang.org/x/oauth2 v0.23.0 // indirect @@ -206,10 +188,10 @@ require ( golang.org/x/time v0.6.0 // indirect golang.org/x/tools v0.25.0 // indirect golang.org/x/xerrors v0.0.0-20240716161551-93cc26a95ae9 // indirect - google.golang.org/api v0.195.0 // indirect - google.golang.org/genproto/googleapis/api v0.0.0-20240827150818-7e3bb234dfed // indirect - google.golang.org/genproto/googleapis/rpc v0.0.0-20240827150818-7e3bb234dfed // indirect - google.golang.org/grpc v1.66.0 // indirect + google.golang.org/api v0.197.0 // indirect + google.golang.org/genproto/googleapis/api v0.0.0-20240903143218-8af14fe29dc1 // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20240903143218-8af14fe29dc1 // indirect + google.golang.org/grpc v1.66.1 // indirect google.golang.org/protobuf v1.34.2 // indirect gopkg.in/ini.v1 v1.67.0 // indirect gopkg.in/yaml.v2 v2.4.0 // indirect @@ -217,7 +199,7 @@ require ( modernc.org/gc/v3 v3.0.0-20240801135723-a856999a2e4a // indirect modernc.org/mathutil v1.6.0 // indirect modernc.org/memory v1.8.0 // indirect - modernc.org/sqlite v1.33.0 // indirect + modernc.org/sqlite v1.33.1 // indirect modernc.org/strutil v1.2.0 // indirect modernc.org/token v1.1.0 // indirect ) diff --git a/go.sum b/go.sum index 5b65aeb..878affd 100644 --- a/go.sum +++ b/go.sum @@ -5,8 +5,8 @@ ariga.io/entcache v0.1.0/go.mod h1:3Z1Sql5bcqPA1YV/jvMlZyh9T+ntSFOclaASAm1TiKQ= cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= cloud.google.com/go v0.115.1 h1:Jo0SM9cQnSkYfp44+v+NQXHpcHqlnRJk2qxh6yvxxxQ= cloud.google.com/go v0.115.1/go.mod h1:DuujITeaufu3gL68/lOFIirVNJwQeyf5UXyi+Wbgknc= -cloud.google.com/go/auth v0.9.1 h1:+pMtLEV2k0AXKvs/tGZojuj6QaioxfUjOpMsG5Gtx+w= -cloud.google.com/go/auth v0.9.1/go.mod h1:Sw8ocT5mhhXxFklyhT12Eiy0ed6tTrPMCJjSI8KhYLk= +cloud.google.com/go/auth v0.9.3 h1:VOEUIAADkkLtyfr3BLa3R8Ed/j6w1jTBmARx+wb5w5U= +cloud.google.com/go/auth v0.9.3/go.mod h1:7z6VY+7h3KUdRov5F1i8NDP5ZzWKYmEPO842BgCsmTk= cloud.google.com/go/auth/oauth2adapt v0.2.4 h1:0GWE/FUsXhf6C+jAkWgYm7X9tK8cuEIfy19DBn6B6bY= cloud.google.com/go/auth/oauth2adapt v0.2.4/go.mod h1:jC/jOpwFP6JBxhB3P5Rr0a9HLMC/Pe3eaL4NmdvqPtc= cloud.google.com/go/compute v1.24.0 h1:phWcR2eWzRJaL/kOiJwfFsPs4BaKq1j6vnpZrc1YlVg= @@ -47,8 +47,6 @@ github.com/alicebob/gopher-json v0.0.0-20230218143504-906a9b012302 h1:uvdUDbHQHO github.com/alicebob/gopher-json v0.0.0-20230218143504-906a9b012302/go.mod h1:SGnFV6hVsYE877CKEZ6tDNTjaSXYUk6QqoIK6PrAtcc= github.com/alicebob/miniredis/v2 v2.33.0 h1:uvTF0EDeu9RLnUEG27Db5I68ESoIxTiXbNUiji6lZrA= github.com/alicebob/miniredis/v2 v2.33.0/go.mod h1:MhP4a3EU7aENRi9aO+tHfTBZicLqQevyi/DJpoj6mi0= -github.com/alitto/pond v1.9.2 h1:9Qb75z/scEZVCoSU+osVmQ0I0JOeLfdTDafrbcJ8CLs= -github.com/alitto/pond v1.9.2/go.mod h1:xQn3P/sHTYcU/1BR3i86IGIrilcrGC2LiS+E2+CJWsI= github.com/andreyvit/diff v0.0.0-20170406064948-c7f18ee00883 h1:bvNMNQO63//z+xNgfBlViaCIJKLlCJ6/fmUseuG0wVQ= github.com/andreyvit/diff v0.0.0-20170406064948-c7f18ee00883/go.mod h1:rCTlJbsFo29Kk6CurOXKm700vrz8f0KW0JNfpkRJY/8= github.com/antlr4-go/antlr/v4 v4.13.1 h1:SqQKkuVZ+zWkMMNkjy5FZe5mr5WURWnlpmOuzYWrPrQ= @@ -61,9 +59,6 @@ github.com/bahlo/generic-list-go v0.2.0 h1:5sz/EEAK+ls5wF+NeqDpk5+iNdMDXrh3z3nPn github.com/bahlo/generic-list-go v0.2.0/go.mod h1:2KvAjgMlE5NNynlg/5iLrrCCZ2+5xWbdbCW3pNTGyYg= github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw= -github.com/boombuler/barcode v1.0.1-0.20190219062509-6c824513bacc/go.mod h1:paBWMcWSl3LHKBqUq+rly7CNSldXjb2rDl3JlRe0mD8= -github.com/boombuler/barcode v1.0.2 h1:79yrbttoZrLGkL/oOI8hBrUKucwOL0oOjUgEguGMcJ4= -github.com/boombuler/barcode v1.0.2/go.mod h1:paBWMcWSl3LHKBqUq+rly7CNSldXjb2rDl3JlRe0mD8= github.com/brianvoe/gofakeit/v7 v7.0.4 h1:Mkxwz9jYg8Ad8NvT9HA27pCMZGFQo08MK6jD0QTKEww= github.com/brianvoe/gofakeit/v7 v7.0.4/go.mod h1:QXuPeBw164PJCzCUZVmgpgHJ3Llj49jSLVkKPMtxtxA= github.com/bsm/ginkgo/v2 v2.12.0 h1:Ny8MWAHyOepLGlLKYmXG4IEkioBysk6GpaRTLC8zwWs= @@ -85,6 +80,7 @@ github.com/coder/websocket v1.8.12 h1:5bUXkEPPIbewrnkU8LTCLVaxi4N4J8ahufH2vlo4NA github.com/coder/websocket v1.8.12/go.mod h1:LNVeNrXQZfe5qhS9ALED3uA+l5pPqvwXg3CKoDBB2gs= github.com/containerd/continuity v0.4.3 h1:6HVkalIp+2u1ZLH1J/pYX2oBVXlJZvh1X1A7bEZ9Su8= github.com/containerd/continuity v0.4.3/go.mod h1:F6PTNCKepoxEaXLQp3wDAjygEnImnZ/7o4JzpodfroQ= +github.com/coreos/go-systemd/v22 v22.5.0/go.mod h1:Y58oyj3AT4RCenI/lSvhwexgC+NSVTIJ3seZv2GcEnc= github.com/cpuguy83/go-md2man/v2 v2.0.4 h1:wfIWP927BUkWJb2NmU/kNDYIBTh/ziUX91+lVfRxZq4= github.com/cpuguy83/go-md2man/v2 v2.0.4/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= @@ -105,8 +101,6 @@ github.com/docker/go-units v0.5.0 h1:69rxXcBk27SvSaaxTtLh/8llcHD8vYHT7WSdRZ/jvr4 github.com/docker/go-units v0.5.0/go.mod h1:fgPhTUdO+D/Jk86RDLlptpiXQzgHJF7gydDDbaIK4Dk= github.com/dustin/go-humanize v1.0.1 h1:GzkhY7T5VNhEkwH0PVJgjz+fX1rhBrR7pRT3mDkpeCY= github.com/dustin/go-humanize v1.0.1/go.mod h1:Mu1zIs6XwVuF/gI1OepvI0qD18qycQx+mFykh5fBlto= -github.com/dustinkirkland/golang-petname v0.0.0-20240428194347-eebcea082ee0 h1:aYo8nnk3ojoQkP5iErif5Xxv0Mo0Ga/FR5+ffl/7+Nk= -github.com/dustinkirkland/golang-petname v0.0.0-20240428194347-eebcea082ee0/go.mod h1:8AuBTZBRSFqEYBPYULd+NN474/zZBLP+6WeT5S9xlAc= github.com/emirpasic/gods v1.18.1 h1:FXtiHYKDGKCW2KzwZKx0iC0PQmdlorYgdFG9jPXJ1Bc= github.com/emirpasic/gods v1.18.1/go.mod h1:8tpGGwCnJ5H4r6BWwaV6OrWmMoPhUl5jm/FMNAnJvWQ= github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= @@ -123,8 +117,6 @@ github.com/frankban/quicktest v1.14.6 h1:7Xjx+VpznH+oBnejlPUj8oUpdxnVs4f8XU8WnHk 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.7.0 h1:iM5WgngdRBanHcxugY4JySA0nk1wZorNOpTgCMedv5E= -github.com/fxamacker/cbor/v2 v2.7.0/go.mod h1:pxXPTn3joSm21Gbwsv0w9OSA2y1HFR9qXEeXQVeNoDQ= github.com/ghodss/yaml v1.0.0 h1:wQHKEahhL6wmXdzwWG11gIVCkOv05bNOh+Rxn0yngAk= github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= github.com/go-faster/errors v0.7.1 h1:MkJTnDoEdi9pDabt1dpWf7AA8/BaSYZqibYyhZ20AYg= @@ -148,14 +140,9 @@ github.com/go-test/deep v1.0.8 h1:TDsG77qcSprGbC6vTN8OuXp5g+J+b5Pcguhf7Zt61VM= github.com/go-test/deep v1.0.8/go.mod h1:5C2ZWiW0ErCdrYzpqxLbTX7MG14M9iiw8DgHncVwcsE= github.com/go-viper/mapstructure/v2 v2.1.0 h1:gHnMa2Y/pIxElCH2GlZZ1lZSsn6XMtufpGyP1XxdC/w= github.com/go-viper/mapstructure/v2 v2.1.0/go.mod h1:oJDH3BJKyqBA2TXFhDsKDGDTlndYOZ6rGS0BRZIxGhM= -github.com/go-webauthn/webauthn v0.11.2 h1:Fgx0/wlmkClTKlnOsdOQ+K5HcHDsDcYIvtYmfhEOSUc= -github.com/go-webauthn/webauthn v0.11.2/go.mod h1:aOtudaF94pM71g3jRwTYYwQTG1KyTILTcZqN1srkmD0= -github.com/go-webauthn/x v0.1.14 h1:1wrB8jzXAofojJPAaRxnZhRgagvLGnLjhCAwg3kTpT0= -github.com/go-webauthn/x v0.1.14/go.mod h1:UuVvFZ8/NbOnkDz3y1NaxtUN87pmtpC1PQ+/5BBQRdc= -github.com/gocarina/gocsv v0.0.0-20240520201108-78e41c74b4b1 h1:FWNFq4fM1wPfcK40yHE5UO3RUdSNPaBC+j3PokzA6OQ= -github.com/gocarina/gocsv v0.0.0-20240520201108-78e41c74b4b1/go.mod h1:5YoVOkjYAQumqlV356Hj3xeYh4BdZuLE0/nRkf2NKkI= github.com/goccy/go-json v0.10.3 h1:KZ5WoDbxAIgm2HNbYckL0se1fHD6rz5j4ywS6ebzDqA= github.com/goccy/go-json v0.10.3/go.mod h1:oq7eo15ShAhp70Anwd5lgX2pLfOS3QCiwU/PULtXL6M= +github.com/godbus/dbus/v5 v5.0.4/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA= github.com/golang-jwt/jwt/v5 v5.2.1 h1:OuVbFODueb089Lh128TAcimifWaLhJwVflnrgM17wHk= github.com/golang-jwt/jwt/v5 v5.2.1/go.mod h1:pqrtFR0X4osieyHYxtmOUWsAWrfe1Q5UVIyoH402zdk= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= @@ -181,14 +168,9 @@ github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMyw github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.3/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= -github.com/google/go-querystring v1.1.0 h1:AnCroh3fv4ZBgVIf1Iwtovgjaw/GiKJo8M8yD/fhyJ8= -github.com/google/go-querystring v1.1.0/go.mod h1:Kcdr2DB4koayq7X8pmAG4sNG59So17icRSOU623lUBU= -github.com/google/go-tpm v0.9.1 h1:0pGc4X//bAlmZzMKf8iz6IsDo1nYTbYJ6FZN/rg4zdM= -github.com/google/go-tpm v0.9.1/go.mod h1:h9jEsEECg7gtLis0upRBQU+GhYVH6jMjrFxI8u6bVUY= github.com/google/gofuzz v1.2.0 h1:xRy4A+RhZaiKjJ1bPfwQ8sedCA+YS2YcCHW6ec7JMi0= github.com/google/gofuzz v1.2.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= github.com/google/pprof v0.0.0-20240409012703-83162a5b38cd h1:gbpYu9NMq8jhDVbvlGkMFWCjLFlqqEZjEmObmhUy6Vo= @@ -200,8 +182,8 @@ github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/wire v0.6.0 h1:HBkoIh4BdSxoyo9PveV8giw7ZsaBOvzWKfcg/6MrVwI= github.com/google/wire v0.6.0/go.mod h1:F4QhpQ9EDIdJ1Mbop/NZBRB+5yrR6qg3BnctaoUk6NA= -github.com/googleapis/enterprise-certificate-proxy v0.3.3 h1:QRje2j5GZimBzlbhGA2V2QlGNgL8G6e+wGo/+/2bWI0= -github.com/googleapis/enterprise-certificate-proxy v0.3.3/go.mod h1:YKe7cfqYXjKGpGvmSg28/fFvhNzinZQm8DGnaburhGA= +github.com/googleapis/enterprise-certificate-proxy v0.3.4 h1:XYIDZApgAnrN1c855gTgghdIA6Stxb52D5RnLI1SLyw= +github.com/googleapis/enterprise-certificate-proxy v0.3.4/go.mod h1:YKe7cfqYXjKGpGvmSg28/fFvhNzinZQm8DGnaburhGA= github.com/googleapis/gax-go/v2 v2.13.0 h1:yitjD5f7jQHhyDsnhKEBU52NdvvdSeGzlAnDPT0hH1s= github.com/googleapis/gax-go/v2 v2.13.0/go.mod h1:Z/fvTZXF8/uw7Xu5GuslPw+bplx6SS338j1Is2S+B7A= github.com/gorilla/securecookie v1.1.2 h1:YCIWL56dvtr73r6715mJs5ZvhtnY73hBvEF8kXD8ePA= @@ -283,10 +265,11 @@ github.com/mailru/easyjson v0.7.7/go.mod h1:xzfreul335JAWq5oZzymOObrkdz5UnU4kGfJ github.com/mattn/go-colorable v0.1.13 h1:fFA4WZxdEF4tXPZVKMLwD8oUnCTTo08duU7wxecdEvA= github.com/mattn/go-colorable v0.1.13/go.mod h1:7S9/ev0klgBDR4GtXTXX8a3vIGJpMovkB8vQcUbaXHg= github.com/mattn/go-isatty v0.0.16/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM= +github.com/mattn/go-isatty v0.0.19/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y= github.com/mattn/go-isatty v0.0.20 h1:xfD0iDuEKnDkl03q4limB+vH+GxLEtL/jb4xVJSWWEY= github.com/mattn/go-isatty v0.0.20/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y= -github.com/mattn/go-sqlite3 v1.14.22 h1:2gZY6PC6kBnID23Tichd1K+Z0oS6nE/XwU+Vz/5o4kU= -github.com/mattn/go-sqlite3 v1.14.22/go.mod h1:Uh1q+B4BYcTPb+yiD3kU8Ct7aC0hY9fxUwlHK0RXw+Y= +github.com/mattn/go-sqlite3 v1.14.23 h1:gbShiuAP1W5j9UOksQ06aiiqPMxYecovVGwmTxWtuw0= +github.com/mattn/go-sqlite3 v1.14.23/go.mod h1:Uh1q+B4BYcTPb+yiD3kU8Ct7aC0hY9fxUwlHK0RXw+Y= github.com/mcuadros/go-defaults v1.2.0 h1:FODb8WSf0uGaY8elWJAkoLL0Ri6AlZ1bFlenk56oZtc= github.com/mcuadros/go-defaults v1.2.0/go.mod h1:WEZtHEVIGYVDqkKSWBdWKUVdRyKlMfulPaGDWIVeCWY= github.com/mfridman/interpolate v0.0.2 h1:pnuTK7MQIxxFz1Gr+rjSIx9u7qVjf5VOoM/u6BbAxPY= @@ -312,8 +295,6 @@ github.com/ncruces/go-strftime v0.1.9/go.mod h1:Fwc5htZGVVkseilnfgOVb9mKy6w1naJm github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno= github.com/nxadm/tail v1.4.11 h1:8feyoE3OzPrcshW5/MJ4sGESc5cqmGkGCWlco4l0bqY= github.com/nxadm/tail v1.4.11/go.mod h1:OTaG3NK980DZzxbRq6lEuzgU+mug70nY11sMd4JXXHc= -github.com/nyaruka/phonenumbers v1.4.0 h1:ddhWiHnHCIX3n6ETDA58Zq5dkxkjlvgrDWM2OHHPCzU= -github.com/nyaruka/phonenumbers v1.4.0/go.mod h1:gv+CtldaFz+G3vHHnasBSirAi3O2XLqZzVWz4V1pl2E= github.com/ogen-go/ogen v1.3.0 h1:c0+CvdbwvKmaHQUqbPpRKflvkiJ/NAsEw3L3HhofDso= github.com/ogen-go/ogen v1.3.0/go.mod h1:421U7mQVAE+7uaCc4tkq2uT0HDfZL13UTpL16CBrFt0= github.com/oklog/ulid/v2 v2.1.0 h1:+9lhoxAP56we25tyYETBBY1YLA2SaoLvUFgrP2miPJU= @@ -328,14 +309,14 @@ github.com/opencontainers/image-spec v1.1.0 h1:8SG7/vwALn54lVB/0yZ/MMwhFrPYtpEHQ github.com/opencontainers/image-spec v1.1.0/go.mod h1:W4s4sFTMaBeK1BQLXbG4AdM2szdn85PY75RI83NrTrM= github.com/opencontainers/runc v1.1.14 h1:rgSuzbmgz5DUJjeSnw337TxDbRuqjs6iqQck/2weR6w= github.com/opencontainers/runc v1.1.14/go.mod h1:E4C2z+7BxR7GHXp0hAY53mek+x49X1LjPNeMTfRGvOA= -github.com/openfga/api/proto v0.0.0-20240807201305-c96ec773cae9 h1:Y0fIAHrYECcf5lpa/o1AbH21bS7rsco/FoH4A4NGlZE= -github.com/openfga/api/proto v0.0.0-20240807201305-c96ec773cae9/go.mod h1:gil5LBD8tSdFQbUkCQdnXsoeU9kDJdJgbGdHkgJfcd0= +github.com/openfga/api/proto v0.0.0-20240906203051-102620ef2a66 h1:pAYrdyIKxPsMs/nRcTEnS9za2io11g7Rt7ng7HK82hk= +github.com/openfga/api/proto v0.0.0-20240906203051-102620ef2a66/go.mod h1:gil5LBD8tSdFQbUkCQdnXsoeU9kDJdJgbGdHkgJfcd0= github.com/openfga/go-sdk v0.6.0 h1:AzfIByBk2niW5gbN5fm9A8WnDz/vW8wT1Zv4cZwWbww= github.com/openfga/go-sdk v0.6.0/go.mod h1:L4ss/4HEMmehyV2WIuBEPMdeh686MqIEJcnoUk3Lhd8= -github.com/openfga/language/pkg/go v0.2.0-beta.0 h1:dTvgDkQImfNnH1iDvxnUIbz4INvKr4kS46dI12oAEzM= -github.com/openfga/language/pkg/go v0.2.0-beta.0/go.mod h1:mCwEY2IQvyNgfEwbfH0C0ERUwtL8z6UjSAF8zgn5Xbg= -github.com/openfga/openfga v1.5.9 h1:1x+9YdBOzbYPbkEUZjPPYt255GXDUbouC0ConpMRtL8= -github.com/openfga/openfga v1.5.9/go.mod h1:1OF1qR8nXdIirtosRZq0mPx5B6nuY5phPGk61Yh+9Lc= +github.com/openfga/language/pkg/go v0.2.0-beta.2 h1:PH4AOYSREgkMZSHO+RLOwkCLcg/i1cTxrVJraM6/YT4= +github.com/openfga/language/pkg/go v0.2.0-beta.2/go.mod h1:ll/hN6kS4EE6B/7J/PbZqac9Nuv7ZHpI+Jfh36JLrbs= +github.com/openfga/openfga v1.6.1 h1:I4xlmmaFbi1Z2otdZs22D6kr3O1n4WFQLjFZeJQmEkE= +github.com/openfga/openfga v1.6.1/go.mod h1:nfldf6oWZWKOXKc8NHy7VDWUd3wil8JtXLSh89aARng= github.com/ory/dockertest v3.3.5+incompatible h1:iLLK6SQwIhcbrG783Dghaaa3WPzGc+4Emza6EbVUUGA= github.com/ory/dockertest v3.3.5+incompatible/go.mod h1:1vX4m9wsvi00u5bseYwXaSnhNrne+V0E6LAcBILJdPs= github.com/pborman/getopt v0.0.0-20170112200414-7148bc3a4c30/go.mod h1:85jBQOZwpVEaDAr341tbn15RS4fCAsIst0qp7i8ex1o= @@ -346,10 +327,6 @@ github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINE github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 h1:Jamvg5psRIccs7FGNTlIRMkT8wgtp5eCXdBlqhYGL6U= github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/posthog/posthog-go v1.2.21 h1:p2ea0l+Qwtk+VC2LCAI87Dz36vwj9i+QHw5s6CpRikA= -github.com/posthog/posthog-go v1.2.21/go.mod h1:uYC2l1Yktc8E+9FAHJ9QZG4vQf/NHJPD800Hsm7DzoM= -github.com/pquerna/otp v1.4.0 h1:wZvl1TIVxKRThZIBiwOOHOGP/1+nZyWBil9Y2XNEDzg= -github.com/pquerna/otp v1.4.0/go.mod h1:dkJfzwRKNiegxyNb54X/3fLwhCynbMspSyWKnvi1AEg= github.com/pressly/goose/v3 v3.22.0 h1:wd/7kNiPTuNAztWun7iaB98DrhulbWPrzMAaw2DEZNw= github.com/pressly/goose/v3 v3.22.0/go.mod h1:yJM3qwSj2pp7aAaCvso096sguezamNb2OBgxCnh/EYg= github.com/prometheus/client_golang v1.20.3 h1:oPksm4K8B+Vt35tUhw6GbSNSgVlVSBH0qELP/7u83l4= @@ -369,6 +346,9 @@ github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec h1:W09IVJc94 github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec/go.mod h1:qqbHyh8v60DhA7CoWK5oRCqLrMHRGoxYCSS9EjAz6Eo= github.com/rogpeppe/go-internal v1.12.0 h1:exVL4IDcn6na9z1rAb56Vxr+CgyK3nn3O+epU5NdKM8= github.com/rogpeppe/go-internal v1.12.0/go.mod h1:E+RYuTGaKKdloAfM02xzb0FW3Paa99yedzYV+kq4uf4= +github.com/rs/xid v1.5.0/go.mod h1:trrq9SKmegXys3aeAKXMUTdJsYXVwGY3RLcfgqegfbg= +github.com/rs/zerolog v1.33.0 h1:1cU2KZkvPxNyfgEmhHAz/1A9Bz+llsdYzklWFzgp0r8= +github.com/rs/zerolog v1.33.0/go.mod h1:/7mN4D5sKwJLZQ2b/znpjC3/GQWY/xaDXUM0kKWRHss= github.com/russross/blackfriday/v2 v2.1.0 h1:JIOH55/0cWyOuilr9/qlrm0BSXldqnqwMsf35Ld67mk= github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= github.com/sagikazarmark/locafero v0.6.0 h1:ON7AQg37yzcRPU69mt7gwhFEBwxI6P9T4Qu3N51bwOk= @@ -381,10 +361,6 @@ github.com/sebdah/goldie/v2 v2.5.3 h1:9ES/mNN+HNUbNWpVAlrzuZ7jE+Nrczbj8uFRjM7624 github.com/sebdah/goldie/v2 v2.5.3/go.mod h1:oZ9fp0+se1eapSRjfYbsV/0Hqhbuu3bJVvKI/NNtssI= github.com/segmentio/asm v1.2.0 h1:9BQrFxC+YOHJlTlHGkTrFWf59nbL3XnCoFLTwDCI7ys= github.com/segmentio/asm v1.2.0/go.mod h1:BqMnlJP91P8d+4ibuonYZw9mfnzI9HfxselHZr5aAcs= -github.com/sendgrid/rest v2.6.9+incompatible h1:1EyIcsNdn9KIisLW50MKwmSRSK+ekueiEMJ7NEoxJo0= -github.com/sendgrid/rest v2.6.9+incompatible/go.mod h1:kXX7q3jZtJXK5c5qK83bSGMdV6tsOE70KbHoqJls4lE= -github.com/sendgrid/sendgrid-go v3.16.0+incompatible h1:i8eE6IMkiCy7vusSdacHHSBUpXyTcTXy/Rl9N9aZ/Qw= -github.com/sendgrid/sendgrid-go v3.16.0+incompatible/go.mod h1:QRQt+LX/NmgVEvmdRw0VT/QgUn499+iza2FnDca9fg8= github.com/sergi/go-diff v1.3.1 h1:xkr+Oxo4BOQKmkn/B9eMK0g5Kg/983T9DqqPHwYqD+8= github.com/sergi/go-diff v1.3.1/go.mod h1:aMJSSKb2lpPvRNec0+w3fl7LP9IOFzdc9Pa4NFbPK1I= github.com/sethvargo/go-retry v0.3.0 h1:EEt31A35QhrcRZtrYFDTBg91cqZVnFL2navjDrah2SE= @@ -412,7 +388,6 @@ github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSS github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo= github.com/stretchr/objx v0.5.2 h1:xuMeJ0Sdp5ZMRXx/aWO6RZxdr3beISkG5/G/aIRr3pY= github.com/stretchr/objx v0.5.2/go.mod h1:FRsXN1f5AsAjCGJKqEizvkpNtU+EGNCLh3NxZ/8L+MA= -github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= @@ -424,24 +399,20 @@ github.com/subosito/gotenv v1.6.0 h1:9NlTDc1FTs4qu0DDq7AEtTPNw6SVm7uBMsUCUjABIf8 github.com/subosito/gotenv v1.6.0/go.mod h1:Dk4QP5c2W3ibzajGcXpNraDfq2IrhjMIvMSWPKKo0FU= github.com/theopenlane/beacon v0.1.0 h1:cyGx18rbaJTZT8pRcqMMvg+kN6uh86X4OoDahQp6VnE= github.com/theopenlane/beacon v0.1.0/go.mod h1:gOJAanQzfmDF3FIyv7Lwx16bKI7YPkJx1iRT4SdcBW4= -github.com/theopenlane/core v0.1.9 h1:1D34xKoqKMqrRoiPjNru/CHpsOvKB9fiLLJFfpmOVos= -github.com/theopenlane/core v0.1.9/go.mod h1:z5sNm0rEmP3dASfbLxFnEZWviur0vdtVLqs1TNSK+bs= +github.com/theopenlane/core v0.1.10-0.20240913205734-41bd730e20cf h1:jaRi4/Mmi+mFG+HYUKIoZh6iGqCuTdzNLPHfWkKdiJQ= +github.com/theopenlane/core v0.1.10-0.20240913205734-41bd730e20cf/go.mod h1:pFQbbCPMgnLoNrOu8ab/nENSBqppb2qMFf9wnQHbGDU= github.com/theopenlane/echo-prometheus v0.1.0 h1:1zMejBVHe5w4zLHS+k5FV9S/46QBiwO6ggTSKi6r/7E= github.com/theopenlane/echo-prometheus v0.1.0/go.mod h1:Eiiv1ZLXKMsteQ3T+H1tFfSSZuXSvQfZp95qr5hmGkA= github.com/theopenlane/echox v0.2.0 h1:s9DJJrsLOSPsXVfgmQxgXmSVtxzztBnSmcVX4ax7tIM= github.com/theopenlane/echox v0.2.0/go.mod h1:nfxwQpwvqYYI/pFHJKDs3/HLvjYKEGCih4XDgLSma64= -github.com/theopenlane/echozap v0.1.0 h1:qoD1tEGQoTMPrzleOymk6auLHJcQmzPLprCEvoXNKDE= -github.com/theopenlane/echozap v0.1.0/go.mod h1:E3Fkzb6QvEsx9KxxpUv9dpxUvKjxAEUZSEtkYeCXLok= -github.com/theopenlane/entx v0.1.7 h1:H1123YtVR2nFjqDY0SlJsjQrX8aDn5DEWFNuU/M8lNA= -github.com/theopenlane/entx v0.1.7/go.mod h1:h978z5xgldvaL/dIX7E2zQZ3rJ6cFDKnuVpi9wKRSGc= +github.com/theopenlane/entx v0.2.0 h1:ymsaHXlG43visg84QH6ULmNNHKdYBYUY7jDumVImtEw= +github.com/theopenlane/entx v0.2.0/go.mod h1:eW5p++QXhTc8qv5/cbeeRTxKSVWkJ0jxmijZd4RpZxQ= github.com/theopenlane/go-turso v0.1.0 h1:FoxZMwL1W0b1DAaZTzVrXn6KOh2bKX33nKRHinytaAQ= github.com/theopenlane/go-turso v0.1.0/go.mod h1:+EE7wZGdCm+DGLv/KphVdFE7YjmqGH8/mqHpzS/Tbps= -github.com/theopenlane/httpsling v0.2.0 h1:5k/PoFA5jjak9dnijATFvTVTvgUSMFdEZeyctyv1cWU= -github.com/theopenlane/httpsling v0.2.0/go.mod h1:Ta/8bjv4JhKT0Xk1hD2Iott9BKLCqXvscmjolSB/bBY= -github.com/theopenlane/iam v0.1.6 h1:ps6xLXHpnGy687uLPRZiD7034DRVqaWEfJLCJVMx95o= -github.com/theopenlane/iam v0.1.6/go.mod h1:mOtYjuqUD7SX4EkwXFAYwf8+mwPDsRvTsLhAngqVIxM= -github.com/theopenlane/utils v0.1.5 h1:4DRieQmsBF87n4lPjEkTt6s4iVRQaCGYlk2+C05lt3o= -github.com/theopenlane/utils v0.1.5/go.mod h1:LWJzG9FfklsLlqWx/VdmfBMuNk700cWqHAwQL0299FM= +github.com/theopenlane/iam v0.2.0 h1:TGFk4ToN6XVKQXJvyA2cNiVQfWmDnpDD9oV2B2qJndk= +github.com/theopenlane/iam v0.2.0/go.mod h1:8nPT57sPCoOzf5QeSbfEonDkZBTQpwIYnN8L8ibJbW8= +github.com/theopenlane/utils v0.2.0 h1:+O5pBWA9cvlCjdwHDaJKwnSMAVRUh1Jgkzl4nYU3h7E= +github.com/theopenlane/utils v0.2.0/go.mod h1:GdjAWxjiMavAMgRNqC6y5v4LUdCcCJlfuHHYU6LrrUw= github.com/tursodatabase/libsql-client-go v0.0.0-20240902231107-85af5b9d094d h1:dOMI4+zEbDI37KGb0TI44GUAwxHF9cMsIoDTJ7UmgfU= github.com/tursodatabase/libsql-client-go v0.0.0-20240902231107-85af5b9d094d/go.mod h1:l8xTsYB90uaVdMHXMCxKKLSgw5wLYBwBKKefNIUnm9s= github.com/urfave/cli/v2 v2.27.4 h1:o1owoI+02Eb+K107p27wEX9Bb8eqIoZCfLXloLUSWJ8= @@ -460,8 +431,6 @@ github.com/wk8/go-ordered-map/v2 v2.1.8 h1:5h/BUHu93oj4gIdvHHHGsScSTMijfx5PeYkE/ github.com/wk8/go-ordered-map/v2 v2.1.8/go.mod h1:5nJHM5DyteebpVlHnWMV0rPz6Zp7+xBAnxjb1X5vnTw= github.com/wundergraph/graphql-go-tools v1.67.4 h1:1QtoftaZz5sScV/J6XLZ/oTfi1lMHp6UmFkYRQfY2/g= github.com/wundergraph/graphql-go-tools v1.67.4/go.mod h1:UFvflYjB/qnSCdgcHQuE6dTfwZ6viJB7yPnGOtBuibo= -github.com/x448/float16 v0.8.4 h1:qLwI1I70+NjRFUR3zs1JPUCgaCXSh3SW62uAKT1mSBM= -github.com/x448/float16 v0.8.4/go.mod h1:14CWIYCyZA/cWjXOioeEpHeN/83MdbZDRQHoFcYsOfg= github.com/xhit/go-str2duration/v2 v2.1.0 h1:lxklc02Drh6ynqX+DdPyp5pCKLUQpRT8bp8Ydu2Bstc= github.com/xhit/go-str2duration/v2 v2.1.0/go.mod h1:ohY8p+0f07DiV6Em5LKB0s2YpLtXVyJfNt1+BlmyAsU= github.com/xrash/smetrics v0.0.0-20240521201337-686a1a2994c1 h1:gEOO8jv9F4OT7lGCjxCBTO/36wtF6j2nSip77qHd4x4= @@ -476,12 +445,12 @@ go.opencensus.io v0.24.0 h1:y73uSU6J157QMP2kn2r30vwW1A2W2WFwSCGnAVxeaD0= go.opencensus.io v0.24.0/go.mod h1:vNK8G9p7aAivkbmorf4v+7Hgx+Zs0yY+0fOtgBfjQKo= go.opentelemetry.io/contrib v1.29.0 h1:fLxD2N918DFRlES8q9iv2yE7iIFlaIMZ7ek0D6qJMqk= go.opentelemetry.io/contrib v1.29.0/go.mod h1:Tmhw9grdWtmXy6DxZNpIAudzYJqLeEM2P6QTZQSRwU8= -go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.53.0 h1:9G6E0TXzGFVfTnawRzrPl83iHOAV7L8NJiR8RSGYV1g= -go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.53.0/go.mod h1:azvtTADFQJA8mX80jIH/akaE7h+dbm/sVuaHqN13w74= +go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.54.0 h1:r6I7RJCN86bpD/FQwedZ0vSixDpwuWREjW9oRMsmqDc= +go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.54.0/go.mod h1:B9yO6b04uB80CzjedvewuqDhxJxi11s7/GtiGa8bAjI= go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.54.0 h1:TT4fX+nBOA/+LUkobKGW1ydGcn+G3vRw9+g5HwCphpk= go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.54.0/go.mod h1:L7UH0GbB0p47T4Rri3uHjbpCFYrVrwc1I25QhNPiGK8= -go.opentelemetry.io/otel v1.29.0 h1:PdomN/Al4q/lN6iBJEN3AwPvUiHPMlt93c8bqTG5Llw= -go.opentelemetry.io/otel v1.29.0/go.mod h1:N/WtXPs1CNCUEx+Agz5uouwCba+i+bJGFicT8SR4NP8= +go.opentelemetry.io/otel v1.30.0 h1:F2t8sK4qf1fAmY9ua4ohFS/K+FUuOPemHUIXHtktrts= +go.opentelemetry.io/otel v1.30.0/go.mod h1:tFw4Br9b7fOS+uEao81PJjVMjW/5fvNCbpsDIXqP0pc= go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.29.0 h1:dIIDULZJpgdiHz5tXrTgKIMLkus6jEFa7x5SOKcyR7E= go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.29.0/go.mod h1:jlRVBe7+Z1wyxFSUs48L6OBQZ5JwH2Hg/Vbl+t9rAgI= go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.29.0 h1:nSiV3s7wiCam610XcLbYOmMfJxB9gO4uK3Xgv5gmTgg= @@ -490,14 +459,14 @@ go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.29.0 h1:JAv0J go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.29.0/go.mod h1:QNKLmUEAq2QUbPQUfvw4fmv0bgbK7UlOSFCnXyfvSNc= go.opentelemetry.io/otel/exporters/stdout/stdouttrace v1.29.0 h1:X3ZjNp36/WlkSYx0ul2jw4PtbNEDDeLskw3VPsrpYM0= go.opentelemetry.io/otel/exporters/stdout/stdouttrace v1.29.0/go.mod h1:2uL/xnOXh0CHOBFCWXz5u1A4GXLiW+0IQIzVbeOEQ0U= -go.opentelemetry.io/otel/metric v1.29.0 h1:vPf/HFWTNkPu1aYeIsc98l4ktOQaL6LeSoeV2g+8YLc= -go.opentelemetry.io/otel/metric v1.29.0/go.mod h1:auu/QWieFVWx+DmQOUMgj0F8LHWdgalxXqvp7BII/W8= +go.opentelemetry.io/otel/metric v1.30.0 h1:4xNulvn9gjzo4hjg+wzIKG7iNFEaBMX00Qd4QIZs7+w= +go.opentelemetry.io/otel/metric v1.30.0/go.mod h1:aXTfST94tswhWEb+5QjlSqG+cZlmyXy/u8jFpor3WqQ= go.opentelemetry.io/otel/sdk v1.29.0 h1:vkqKjk7gwhS8VaWb0POZKmIEDimRCMsopNYnriHyryo= go.opentelemetry.io/otel/sdk v1.29.0/go.mod h1:pM8Dx5WKnvxLCb+8lG1PRNIDxu9g9b9g59Qr7hfAAok= go.opentelemetry.io/otel/sdk/metric v1.29.0 h1:K2CfmJohnRgvZ9UAj2/FhIf/okdWcNdBwe1m8xFXiSY= go.opentelemetry.io/otel/sdk/metric v1.29.0/go.mod h1:6zZLdCl2fkauYoZIOn/soQIDSWFmNSRcICarHfuhNJQ= -go.opentelemetry.io/otel/trace v1.29.0 h1:J/8ZNK4XgR7a21DZUAsbF8pZ5Jcw1VhACmnYt39JTi4= -go.opentelemetry.io/otel/trace v1.29.0/go.mod h1:eHl3w0sp3paPkYstJOmAimxhiFXPg+MMTlEh3nsQgWQ= +go.opentelemetry.io/otel/trace v1.30.0 h1:7UBkkYzeg3C7kQX8VAidWh2biiQbtAKjyIML8dQ9wmc= +go.opentelemetry.io/otel/trace v1.30.0/go.mod h1:5EyKqTzzmyqB9bwtCCq6pDLktPK6fmGf/Dph+8VI02o= go.opentelemetry.io/proto/otlp v1.3.1 h1:TrMUixzpM0yuc/znrFTP9MMRh8trP93mkCiDVeXrui0= go.opentelemetry.io/proto/otlp v1.3.1/go.mod h1:0X1WI4de4ZsLrrJNLAQbFeLCm3T7yBkR0XqQ7niQU+8= go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto= @@ -515,8 +484,8 @@ golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPh golang.org/x/crypto v0.27.0 h1:GXm2NjJrPaiv/h1tb2UH8QfgC/hOf/+z0p6PT8o1w7A= golang.org/x/crypto v0.27.0/go.mod h1:1Xngt8kV6Dvbssa53Ziq6Eqn0HqbZi5Z6R0ZpwQzt70= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= -golang.org/x/exp v0.0.0-20240823005443-9b4947da3948 h1:kx6Ds3MlpiUHKj7syVnbp57++8WpuKPcR5yjLBjvLEA= -golang.org/x/exp v0.0.0-20240823005443-9b4947da3948/go.mod h1:akd2r19cwCdwSwWeIdzYQGa/EZZyqcOdwWiwj5L5eKQ= +golang.org/x/exp v0.0.0-20240904232852-e7e105dedf7e h1:I88y4caeGeuDQxgdoFPUq097j7kNfw6uvuiNxUBfcBk= +golang.org/x/exp v0.0.0-20240904232852-e7e105dedf7e/go.mod h1:akd2r19cwCdwSwWeIdzYQGa/EZZyqcOdwWiwj5L5eKQ= golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= @@ -546,6 +515,7 @@ golang.org/x/sys v0.0.0-20210616094352-59db8d763f22/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.12.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.25.0 h1:r+8e+loiHxRqhXVl6ML1nO3l1+oFoWbnlu2Ehimmi34= golang.org/x/sys v0.25.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= @@ -564,26 +534,26 @@ golang.org/x/tools v0.25.0/go.mod h1:/vtpO8WL1N9cQC3FN5zPqb//fRXskFHbLKk4OW1Q7rg golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20240716161551-93cc26a95ae9 h1:LLhsEBxRTBLuKlQxFBYUOU8xyFgXv6cOTp2HASDlsDk= golang.org/x/xerrors v0.0.0-20240716161551-93cc26a95ae9/go.mod h1:NDW/Ps6MPRej6fsCIbMTohpP40sJ/P/vI1MoTEGwX90= -google.golang.org/api v0.195.0 h1:Ude4N8FvTKnnQJHU48RFI40jOBgIrL8Zqr3/QeST6yU= -google.golang.org/api v0.195.0/go.mod h1:DOGRWuv3P8TU8Lnz7uQc4hyNqrBpMtD9ppW3wBJurgc= +google.golang.org/api v0.197.0 h1:x6CwqQLsFiA5JKAiGyGBjc2bNtHtLddhJCE2IKuhhcQ= +google.golang.org/api v0.197.0/go.mod h1:AuOuo20GoQ331nq7DquGHlU6d+2wN2fZ8O0ta60nRNw= google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo= -google.golang.org/genproto v0.0.0-20240823204242-4ba0660f739c h1:TYOEhrQMrNDTAd2rX9m+WgGr8Ku6YNuj1D7OX6rWSok= -google.golang.org/genproto v0.0.0-20240823204242-4ba0660f739c/go.mod h1:2rC5OendXvZ8wGEo/cSLheztrZDZaSoHanUcd1xtZnw= -google.golang.org/genproto/googleapis/api v0.0.0-20240827150818-7e3bb234dfed h1:3RgNmBoI9MZhsj3QxC+AP/qQhNwpCLOvYDYYsFrhFt0= -google.golang.org/genproto/googleapis/api v0.0.0-20240827150818-7e3bb234dfed/go.mod h1:OCdP9MfskevB/rbYvHTsXTtKC+3bHWajPdoKgjcYkfo= -google.golang.org/genproto/googleapis/rpc v0.0.0-20240827150818-7e3bb234dfed h1:J6izYgfBXAI3xTKLgxzTmUltdYaLsuBxFCgDHWJ/eXg= -google.golang.org/genproto/googleapis/rpc v0.0.0-20240827150818-7e3bb234dfed/go.mod h1:UqMtugtsSgubUsoxbuAoiCXvqvErP7Gf0so0mK9tHxU= +google.golang.org/genproto v0.0.0-20240903143218-8af14fe29dc1 h1:BulPr26Jqjnd4eYDVe+YvyR7Yc2vJGkO5/0UxD0/jZU= +google.golang.org/genproto v0.0.0-20240903143218-8af14fe29dc1/go.mod h1:hL97c3SYopEHblzpxRL4lSs523++l8DYxGM1FQiYmb4= +google.golang.org/genproto/googleapis/api v0.0.0-20240903143218-8af14fe29dc1 h1:hjSy6tcFQZ171igDaN5QHOw2n6vx40juYbC/x67CEhc= +google.golang.org/genproto/googleapis/api v0.0.0-20240903143218-8af14fe29dc1/go.mod h1:qpvKtACPCQhAdu3PyQgV4l3LMXZEtft7y8QcarRsp9I= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240903143218-8af14fe29dc1 h1:pPJltXNxVzT4pK9yD8vR9X75DaWYYmLGMsEvBfFQZzQ= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240903143218-8af14fe29dc1/go.mod h1:UqMtugtsSgubUsoxbuAoiCXvqvErP7Gf0so0mK9tHxU= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQciAY= google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= google.golang.org/grpc v1.33.2/go.mod h1:JMHMWHQWaTccqQQlmk3MJZS+GWXOdAesneDmEnv2fbc= -google.golang.org/grpc v1.66.0 h1:DibZuoBznOxbDQxRINckZcUvnCEvrW9pcWIE2yF9r1c= -google.golang.org/grpc v1.66.0/go.mod h1:s3/l6xSSCURdVfAnL+TqCNMyTDAGN6+lZeVxnZR128Y= +google.golang.org/grpc v1.66.1 h1:hO5qAXR19+/Z44hmvIM4dQFMSYX9XcWsByfoxutBpAM= +google.golang.org/grpc v1.66.1/go.mod h1:s3/l6xSSCURdVfAnL+TqCNMyTDAGN6+lZeVxnZR128Y= google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM= @@ -612,16 +582,28 @@ gotest.tools v2.2.0+incompatible h1:VsBPFP1AI068pPrMxtb/S8Zkgf9xEmTLJjfM+P5UIEo= gotest.tools v2.2.0+incompatible/go.mod h1:DsYFclhRJ6vuDpmuTbkuFWG+y2sxOXAzmJt81HFBacw= honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= +modernc.org/cc/v4 v4.21.4 h1:3Be/Rdo1fpr8GrQ7IVw9OHtplU4gWbb+wNgeoBMmGLQ= +modernc.org/cc/v4 v4.21.4/go.mod h1:HM7VJTZbUCR3rV8EYBi9wxnJ0ZBRiGE5OeGXNA0IsLQ= +modernc.org/ccgo/v4 v4.21.0 h1:kKPI3dF7RIag8YcToh5ZwDcVMIv6VGa0ED5cvh0LMW4= +modernc.org/ccgo/v4 v4.21.0/go.mod h1:h6kt6H/A2+ew/3MW/p6KEoQmrq/i3pr0J/SiwiaF/g0= modernc.org/fileutil v1.3.0 h1:gQ5SIzK3H9kdfai/5x41oQiKValumqNTDXMvKo62HvE= modernc.org/fileutil v1.3.0/go.mod h1:XatxS8fZi3pS8/hKG2GH/ArUogfxjpEKs3Ku3aK4JyQ= +modernc.org/gc/v2 v2.5.0 h1:bJ9ChznK1L1mUtAQtxi0wi5AtAs5jQuw4PrPHO5pb6M= +modernc.org/gc/v2 v2.5.0/go.mod h1:wzN5dK1AzVGoH6XOzc3YZ+ey/jPgYHLuVckd62P0GYU= modernc.org/gc/v3 v3.0.0-20240801135723-a856999a2e4a h1:CfbpOLEo2IwNzJdMvE8aiRbPMxoTpgAJeyePh0SmO8M= modernc.org/gc/v3 v3.0.0-20240801135723-a856999a2e4a/go.mod h1:Qz0X07sNOR1jWYCrJMEnbW/X55x206Q7Vt4mz6/wHp4= +modernc.org/libc v1.60.0 h1:XeRF1gXky7JE5E8IErtYAdKj+ykZPdYUsgJNQ8RFWIA= +modernc.org/libc v1.60.0/go.mod h1:xJuobKuNxKH3RUatS7GjR+suWj+5c2K7bi4m/S5arOY= modernc.org/mathutil v1.6.0 h1:fRe9+AmYlaej+64JsEEhoWuAYBkOtQiMEU7n/XgfYi4= modernc.org/mathutil v1.6.0/go.mod h1:Ui5Q9q1TR2gFm0AQRqQUaBWFLAhQpCwNcuhBOSedWPo= modernc.org/memory v1.8.0 h1:IqGTL6eFMaDZZhEWwcREgeMXYwmW83LYW8cROZYkg+E= modernc.org/memory v1.8.0/go.mod h1:XPZ936zp5OMKGWPqbD3JShgd/ZoQ7899TUuQqxY+peU= -modernc.org/sqlite v1.33.0 h1:WWkA/T2G17okiLGgKAj4/RMIvgyMT19yQ038160IeYk= -modernc.org/sqlite v1.33.0/go.mod h1:9uQ9hF/pCZoYZK73D/ud5Z7cIRIILSZI8NdIemVMTX8= +modernc.org/opt v0.1.3 h1:3XOZf2yznlhC+ibLltsDGzABUGVx8J6pnFMS3E4dcq4= +modernc.org/opt v0.1.3/go.mod h1:WdSiB5evDcignE70guQKxYUl14mgWtbClRi5wmkkTX0= +modernc.org/sortutil v1.2.0 h1:jQiD3PfS2REGJNzNCMMaLSp/wdMNieTbKX920Cqdgqc= +modernc.org/sortutil v1.2.0/go.mod h1:TKU2s7kJMf1AE84OoiGppNHJwvB753OYfNl2WRb++Ss= +modernc.org/sqlite v1.33.1 h1:trb6Z3YYoeM9eDL1O8do81kP+0ejv+YzgyFo+Gwy0nM= +modernc.org/sqlite v1.33.1/go.mod h1:pXV2xHxhzXZsgT/RtTFAPY6JJDEvOTcTdwADQCCWD4k= modernc.org/strutil v1.2.0 h1:agBi9dp1I+eOnxXeiZawM8F4LawKv4NzGWSaLfyeNZA= modernc.org/strutil v1.2.0/go.mod h1:/mdcBmfOibveCTBxUl5B5l6W+TTH1FXPLHZE6bTosX0= modernc.org/token v1.1.0 h1:Xl7Ap9dKaEs5kLoOQeQmPWevfnk/DM5qcLcYlA8ys6Y= diff --git a/internal/ent/entc.go b/internal/ent/entc.go index 741e99a..ea7d613 100644 --- a/internal/ent/entc.go +++ b/internal/ent/entc.go @@ -17,7 +17,6 @@ import ( "github.com/theopenlane/go-turso" "github.com/theopenlane/iam/entfga" "github.com/theopenlane/iam/fgax" - "go.uber.org/zap" "gocloud.dev/secrets" ) @@ -74,10 +73,6 @@ func main() { entc.DependencyName("Authz"), entc.DependencyType(fgax.Client{}), ), - entc.Dependency( - entc.DependencyName("Logger"), - entc.DependencyType(zap.SugaredLogger{}), - ), entc.Dependency( entc.DependencyName("Turso"), entc.DependencyType(&turso.Client{}), diff --git a/internal/ent/generated/client.go b/internal/ent/generated/client.go index 6f9e245..749c4b0 100644 --- a/internal/ent/generated/client.go +++ b/internal/ent/generated/client.go @@ -21,7 +21,6 @@ import ( "github.com/theopenlane/dbx/internal/ent/generated/group" "github.com/theopenlane/go-turso" "github.com/theopenlane/iam/fgax" - "go.uber.org/zap" "gocloud.dev/secrets" "github.com/theopenlane/dbx/internal/ent/generated/internal" @@ -79,7 +78,6 @@ type ( inters *inters SecretsKeeper *secrets.Keeper Authz fgax.Client - Logger zap.SugaredLogger Turso *turso.Client HTTPClient *http.Client // schemaConfig contains alternative names for all tables. @@ -141,13 +139,6 @@ func Authz(v fgax.Client) Option { } } -// Logger configures the Logger. -func Logger(v zap.SugaredLogger) Option { - return func(c *config) { - c.Logger = v - } -} - // Turso configures the Turso. func Turso(v *turso.Client) Option { return func(c *config) { diff --git a/internal/ent/generated/edge_cleanup.go b/internal/ent/generated/edge_cleanup.go index c62118f..a541c39 100644 --- a/internal/ent/generated/edge_cleanup.go +++ b/internal/ent/generated/edge_cleanup.go @@ -5,6 +5,7 @@ package generated import ( "context" + "github.com/rs/zerolog/log" "github.com/theopenlane/dbx/internal/ent/generated/database" "github.com/theopenlane/dbx/internal/ent/generated/group" ) @@ -18,7 +19,7 @@ func GroupEdgeCleanup(ctx context.Context, id string) error { if exists, err := FromContext(ctx).Database.Query().Where((database.HasGroupWith(group.ID(id)))).Exist(ctx); err == nil && exists { if databaseCount, err := FromContext(ctx).Database.Delete().Where(database.HasGroupWith(group.ID(id))).Exec(ctx); err != nil { - FromContext(ctx).Logger.Debugw("deleting database", "count", databaseCount, "err", err) + log.Debug().Err(err).Int("count", databaseCount).Msg("deleting database") return err } } diff --git a/internal/ent/hooks/database.go b/internal/ent/hooks/database.go index f9647db..132eddc 100644 --- a/internal/ent/hooks/database.go +++ b/internal/ent/hooks/database.go @@ -8,6 +8,7 @@ import ( "entgo.io/ent" "github.com/99designs/gqlgen/graphql" + "github.com/rs/zerolog/log" "github.com/theopenlane/go-turso" "github.com/theopenlane/utils/rout" @@ -49,7 +50,7 @@ func HookCreateDatabase() ent.Hook { return nil, err } - mutation.Logger.Infow("created turso db", "db", db.Database.DatabaseID, "hostname", db.Database.Hostname) + log.Info().Str("db", db.Database.DatabaseID).Str("hostname", db.Database.Hostname).Msg("created turso db") mutation.SetDsn(db.Database.Hostname) } else { @@ -76,7 +77,7 @@ func HookDatabaseDelete() ent.Hook { name := gtx.Variables["name"].(string) if name == "" { - mutation.Logger.Errorw("unable to delete database, no name provided") + log.Error().Msg("unable to delete database, no name provided") return nil, rout.InvalidField("name") } @@ -86,7 +87,7 @@ func HookDatabaseDelete() ent.Hook { return nil, err } - mutation.Logger.Infow("deleted turso database", "database", db.Database) + log.Info().Str("db", db.Database).Msg("deleted turso db") } // write things that we need to the database @@ -103,7 +104,7 @@ func getGroupName(ctx context.Context, mutation *generated.DatabaseMutation) (st if ok && groupID != "" { g, err := mutation.Client().Group.Get(ctx, groupID) if err != nil { - mutation.Logger.Errorw("unable to get group, invalid group ID", "error", err) + log.Error().Err(err).Msg("unable to get group, invalid group ID") return "", err } @@ -115,20 +116,20 @@ func getGroupName(ctx context.Context, mutation *generated.DatabaseMutation) (st geo, ok := mutation.Geo() if !ok || geo == "" { - mutation.Logger.Errorw("unable to get geo or group id, cannot create database") + log.Error().Msg("unable to get geo or group id, cannot create database") return "", rout.InvalidField("geo") } g, err := mutation.Client().Group.Query().Where(group.RegionEQ(enums.Region(geo))).Only(ctx) if err != nil { - mutation.Logger.Errorw("unable to get associated group", "error", err) + log.Error().Err(err).Msg("unable to get associated group") return "", err } if g == nil { - mutation.Logger.Errorw("unable to get associated group", "geo", geo) + log.Error().Str("geo", geo).Msg("unable to get associated group, invalid geo") return "", rout.InvalidField("geo") } diff --git a/internal/ent/hooks/group.go b/internal/ent/hooks/group.go index 3ddbe36..e0be1a0 100644 --- a/internal/ent/hooks/group.go +++ b/internal/ent/hooks/group.go @@ -6,6 +6,7 @@ import ( "entgo.io/ent" "github.com/99designs/gqlgen/graphql" + "github.com/rs/zerolog/log" "github.com/theopenlane/go-turso" "github.com/theopenlane/utils/rout" @@ -30,7 +31,7 @@ func HookGroupCreate() ent.Hook { return nil, err } - mutation.Logger.Infow("created turso group", "group", group.Group.Name, "locations", group.Group.Locations) + log.Info().Str("group", group.Group.Name).Strs("locations", group.Group.Locations).Msg("created turso group") // write things that we need to the database return next.Mutate(ctx, mutation) @@ -60,7 +61,7 @@ func HookGroupUpdate() ent.Hook { } if _, err := mutation.Turso.Group.AddLocation(ctx, req); err != nil { - mutation.Logger.Errorw("failed to add location to group", "group", name, "location", loc, "error", err) + log.Error().Str("group", name).Str("location", loc).Err(err).Msg("failed to add location to group") return nil, err } @@ -81,7 +82,7 @@ func HookGroupDelete() ent.Hook { name := gtx.Variables["name"].(string) if name == "" { - mutation.Logger.Errorw("unable to delete group, no name provided") + log.Error().Msg("unable to delete group, no name provided") return nil, rout.InvalidField("name") } @@ -91,7 +92,7 @@ func HookGroupDelete() ent.Hook { return nil, err } - mutation.Logger.Infow("deleted turso group", "group", group.Group) + log.Info().Interface("group", group.Group).Msg("deleted turso group") } // write things that we need to the database diff --git a/internal/ent/templates/edge_cleanup.tmpl b/internal/ent/templates/edge_cleanup.tmpl index 3737e3f..99c6119 100644 --- a/internal/ent/templates/edge_cleanup.tmpl +++ b/internal/ent/templates/edge_cleanup.tmpl @@ -18,7 +18,7 @@ {{/* use the client to delete records where the edge schema has a field (provided by the annotation) containing the ID provided by the func */}} if exists, err := FromContext(ctx).{{ $edge.Type.Name }}.Query().Where(({{ $edge.Type.Name | lower }}.Has{{ $annotation.Field }}With({{ $node.Name | lower }}.ID(id)))).Exist(ctx); err == nil && exists { if {{ $edge.Type.Name | lower }}Count, err := FromContext(ctx).{{ $edge.Type.Name }}.Delete().Where({{ $edge.Type.Name | lower }}.Has{{ $annotation.Field }}With({{ $node.Name | lower }}.ID(id))).Exec(ctx); err != nil { - FromContext(ctx).Logger.Debugw("deleting {{ $edge.Type.Name | lower }}", "count", {{ $edge.Type.Name | lower }}Count, "err", err) + log.Debug().Err(err).Int("count", {{ $edge.Type.Name | lower }}Count).Msg("deleting {{ $edge.Type.Name | lower }}") return err } } @@ -30,7 +30,7 @@ {{/* use the client to delete records where the edge has a field and a through schema (provided by the annotation) containing the ID provided by the func */}} if exists, err := FromContext(ctx).{{ $field }}.Query().Where(({{ $field | lower }}.Has{{ $schema.Field }}With({{ $node.Name | lower }}.ID(id)))).Exist(ctx); err == nil && exists { if {{ $field | lower }}Count, err := FromContext(ctx).{{ $field }}.Delete().Where({{ $field | lower }}.Has{{ $schema.Field }}With({{ $node.Name | lower }}.ID(id))).Exec(ctx); err != nil { - FromContext(ctx).Logger.Debugw("deleting {{ $field | lower }}", "count", {{ $field | lower }}Count, "err", err) + log.Debug().Err(err).Int("count", {{ $field | lower }}Count).Msg("deleting {{ $field | lower }}") return err } } diff --git a/internal/entdb/client.go b/internal/entdb/client.go index 0add76d..f151cbb 100644 --- a/internal/entdb/client.go +++ b/internal/entdb/client.go @@ -12,10 +12,10 @@ import ( "entgo.io/ent/dialect" entsql "entgo.io/ent/dialect/sql" "github.com/pressly/goose/v3" + "github.com/rs/zerolog/log" "github.com/theopenlane/entx" - "go.uber.org/zap" - "github.com/theopenlane/core/pkg/testutils" + "github.com/theopenlane/utils/testutils" migratedb "github.com/theopenlane/dbx/db" ent "github.com/theopenlane/dbx/internal/ent/generated" @@ -33,20 +33,15 @@ type client struct { pc *ent.Client // sc is the secondary ent client sc *ent.Client - // logger holds the zap logger - logger *zap.SugaredLogger } // NewMultiDriverDBClient returns a ent client with a primary and secondary, if configured, write database -func NewMultiDriverDBClient(ctx context.Context, c entx.Config, l *zap.SugaredLogger, opts []ent.Option) (*ent.Client, *entx.EntClientConfig, error) { +func NewMultiDriverDBClient(ctx context.Context, c entx.Config, opts []ent.Option) (*ent.Client, *entx.EntClientConfig, error) { client := &client{ config: &c, - logger: l, } - dbOpts := []entx.DBOption{ - entx.WithLogger(l), - } + dbOpts := []entx.DBOption{} if c.MultiWrite { dbOpts = append(dbOpts, entx.WithSecondaryDB()) @@ -67,7 +62,7 @@ func NewMultiDriverDBClient(ctx context.Context, c entx.Config, l *zap.SugaredLo if c.RunMigrations { if err := client.runMigrations(ctx); err != nil { - client.logger.Errorf("failed running migrations", zap.Error(err)) + log.Error().Err(err).Msg("failed running migrations") return nil, nil, err } @@ -86,7 +81,7 @@ func NewMultiDriverDBClient(ctx context.Context, c entx.Config, l *zap.SugaredLo if c.RunMigrations { if err := client.runMigrations(ctx); err != nil { - client.logger.Errorf("failed running migrations", zap.Error(err)) + log.Error().Err(err).Msg("failed running migrations") return nil, nil, err } @@ -102,7 +97,7 @@ func NewMultiDriverDBClient(ctx context.Context, c entx.Config, l *zap.SugaredLo if c.Debug { cOpts = append(cOpts, - ent.Log(client.logger.Named("ent").Debugln), + ent.Log(log.Print), ent.Debug(), ent.Driver(drvPrimary), ) @@ -122,7 +117,7 @@ func (c *client) createEntDBClient(db *entsql.Driver) *ent.Client { if c.config.Debug { cOpts = append(cOpts, - ent.Log(c.logger.Named("ent").Debugln), + ent.Log(log.Print), ent.Debug(), ) } @@ -154,9 +149,6 @@ func NewTestFixture() *testutils.TestFixture { // NewTestClient creates a entdb client that can be used for TEST purposes ONLY func NewTestClient(ctx context.Context, ctr *testutils.TestFixture, entOpts []ent.Option) (*ent.Client, error) { - // setup logger - logger := zap.NewNop().Sugar() - dbconf := entx.Config{ Debug: true, DriverName: ctr.Dialect, @@ -164,8 +156,6 @@ func NewTestClient(ctx context.Context, ctr *testutils.TestFixture, entOpts []en CacheTTL: -1 * time.Second, // do not cache results in tests } - entOpts = append(entOpts, ent.Logger(*logger)) - var db *ent.Client // Retry the connection to the database to ensure it is up and running @@ -176,7 +166,7 @@ func NewTestClient(ctx context.Context, ctr *testutils.TestFixture, entOpts []en err = ctr.Pool.Retry(func() error { fmt.Println("connecting to database...") - db, _, err = NewMultiDriverDBClient(ctx, dbconf, logger, entOpts) + db, _, err = NewMultiDriverDBClient(ctx, dbconf, entOpts) if err != nil { fmt.Printf("retrying connection to database: %v", err) } @@ -184,7 +174,7 @@ func NewTestClient(ctx context.Context, ctr *testutils.TestFixture, entOpts []en return err }) } else { - db, _, err = NewMultiDriverDBClient(ctx, dbconf, logger, entOpts) + db, _, err = NewMultiDriverDBClient(ctx, dbconf, entOpts) } if err != nil { @@ -264,7 +254,7 @@ func (c *client) runAtlasMigrations(ctx context.Context) error { // Run the automatic migration tool to create all schema resources. // entcache.Driver will skip the caching layer when running the schema migration if err := c.pc.Schema.Create(entcache.Skip(ctx)); err != nil { - c.logger.Errorf("failed creating schema resources", zap.Error(err)) + log.Error().Err(err).Msg("failed creating schema resources") return err } diff --git a/internal/graphapi/database.resolvers.go b/internal/graphapi/database.resolvers.go index 53652c5..b0ba399 100644 --- a/internal/graphapi/database.resolvers.go +++ b/internal/graphapi/database.resolvers.go @@ -8,6 +8,7 @@ import ( "context" "fmt" + "github.com/rs/zerolog/log" "github.com/theopenlane/dbx/internal/ent/generated" "github.com/theopenlane/dbx/internal/ent/generated/database" "github.com/theopenlane/utils/rout" @@ -20,7 +21,7 @@ func (r *mutationResolver) CreateDatabase(ctx context.Context, input generated.C if generated.IsConstraintError(err) { constraintError := err.(*generated.ConstraintError) - r.logger.Debugw("constraint error", "error", constraintError.Error()) + log.Debug().Err(constraintError).Msg("constraint error") return nil, constraintError } @@ -31,7 +32,7 @@ func (r *mutationResolver) CreateDatabase(ctx context.Context, input generated.C return nil, rout.InvalidField(ve.Name) } - r.logger.Errorw("failed to create database", "error", err) + log.Error().Err(err).Msg("failed to create database") return nil, err } @@ -48,13 +49,13 @@ func (r *mutationResolver) UpdateDatabase(ctx context.Context, name string, inpu func (r *mutationResolver) DeleteDatabase(ctx context.Context, name string) (*DatabaseDeletePayload, error) { db, err := withTransactionalMutation(ctx).Database.Query().Where(database.NameEQ(name)).Only(ctx) if err != nil { - r.logger.Errorw("failed to get database", "error", err) + log.Error().Err(err).Msg("failed to get database") return nil, err } if err := withTransactionalMutation(ctx).Database.DeleteOneID(db.ID).Exec(ctx); err != nil { - r.logger.Errorw("failed to delete database", "error", err) + log.Error().Err(err).Msg("failed to delete database") return nil, err } @@ -66,7 +67,7 @@ func (r *mutationResolver) DeleteDatabase(ctx context.Context, name string) (*Da func (r *queryResolver) Database(ctx context.Context, name string) (*generated.Database, error) { db, err := withTransactionalMutation(ctx).Database.Query().Where(database.NameEQ(name)).Only(ctx) if err != nil { - r.logger.Errorw("failed to get database", "error", err) + log.Error().Err(err).Msg("failed to get database") return nil, err } diff --git a/internal/graphapi/group.resolvers.go b/internal/graphapi/group.resolvers.go index f70b18f..8d166a5 100644 --- a/internal/graphapi/group.resolvers.go +++ b/internal/graphapi/group.resolvers.go @@ -7,6 +7,7 @@ package graphapi import ( "context" + "github.com/rs/zerolog/log" "github.com/theopenlane/dbx/internal/ent/generated" "github.com/theopenlane/dbx/internal/ent/generated/group" "github.com/theopenlane/utils/rout" @@ -19,7 +20,7 @@ func (r *mutationResolver) CreateGroup(ctx context.Context, input generated.Crea if generated.IsConstraintError(err) { constraintError := err.(*generated.ConstraintError) - r.logger.Debugw("constraint error", "error", constraintError.Error()) + log.Debug().Err(constraintError).Msg("constraint error") return nil, constraintError } @@ -30,7 +31,7 @@ func (r *mutationResolver) CreateGroup(ctx context.Context, input generated.Crea return nil, rout.InvalidField(ve.Name) } - r.logger.Errorw("failed to create group", "error", err) + log.Error().Err(err).Msg("failed to create group") return nil, err } @@ -45,7 +46,7 @@ func (r *mutationResolver) UpdateGroup(ctx context.Context, name string, input g Where(group.NameEQ(name)). Only(ctx) if err != nil { - r.logger.Errorw("failed to get group", "error", err) + log.Error().Err(err).Msg("failed to get group") return nil, err } @@ -54,7 +55,7 @@ func (r *mutationResolver) UpdateGroup(ctx context.Context, name string, input g SetInput(input). Save(ctx) if err != nil { - r.logger.Errorw("failed to update group", "error", err) + log.Error().Err(err).Msg("failed to update group") return nil, err } @@ -66,7 +67,7 @@ func (r *mutationResolver) UpdateGroup(ctx context.Context, name string, input g func (r *mutationResolver) DeleteGroup(ctx context.Context, name string) (*GroupDeletePayload, error) { group, err := withTransactionalMutation(ctx).Group.Query().Where(group.NameEQ(name)).Only(ctx) if err != nil { - r.logger.Errorw("failed to get group", "error", err) + log.Error().Err(err).Msg("failed to get group") return nil, err } @@ -76,7 +77,7 @@ func (r *mutationResolver) DeleteGroup(ctx context.Context, name string) (*Group } if err := withTransactionalMutation(ctx).Group.DeleteOneID(group.ID).Exec(ctx); err != nil { - r.logger.Errorw("failed to delete group", "error", err) + log.Error().Err(err).Msg("failed to delete group") return nil, err } @@ -88,7 +89,7 @@ func (r *mutationResolver) DeleteGroup(ctx context.Context, name string) (*Group func (r *queryResolver) Group(ctx context.Context, name string) (*generated.Group, error) { group, err := withTransactionalMutation(ctx).Group.Query().Where(group.NameEQ(name)).Only(ctx) if err != nil { - r.logger.Errorw("failed to get group", "error", err) + log.Error().Err(err).Msg("failed to get group") return nil, err } diff --git a/internal/graphapi/resolver.go b/internal/graphapi/resolver.go index c298701..bbd291f 100644 --- a/internal/graphapi/resolver.go +++ b/internal/graphapi/resolver.go @@ -12,9 +12,9 @@ import ( "github.com/99designs/gqlgen/graphql/handler/transport" "github.com/gorilla/websocket" "github.com/ravilushqa/otelgqlgen" + "github.com/rs/zerolog/log" echo "github.com/theopenlane/echox" "github.com/wundergraph/graphql-go-tools/pkg/playground" - "go.uber.org/zap" ent "github.com/theopenlane/dbx/internal/ent/generated" ) @@ -40,7 +40,6 @@ var ( // Resolver provides a graph response resolver type Resolver struct { client *ent.Client - logger *zap.SugaredLogger } // NewResolver returns a resolver configured with the given ent client @@ -50,12 +49,6 @@ func NewResolver(client *ent.Client) *Resolver { } } -func (r Resolver) WithLogger(l *zap.SugaredLogger) *Resolver { - r.logger = l - - return &r -} - // Handler is an http handler wrapping a Resolver type Handler struct { r *Resolver @@ -145,7 +138,7 @@ func (h *Handler) Routes(e *echo.Group) { if h.playground != nil { handlers, err := h.playground.Handlers() if err != nil { - h.r.logger.Fatal("error configuring playground handlers", "error", err) + log.Fatal().Err(err).Msg("error configuring playground handlers") return } diff --git a/internal/graphapi/tools_test.go b/internal/graphapi/tools_test.go index 9790dd0..4c3c9be 100644 --- a/internal/graphapi/tools_test.go +++ b/internal/graphapi/tools_test.go @@ -2,20 +2,19 @@ package graphapi_test import ( "context" - "log" "net/http" "net/http/httptest" "testing" + "github.com/rs/zerolog" + "github.com/rs/zerolog/log" "github.com/stretchr/testify/require" "github.com/stretchr/testify/suite" "github.com/99designs/gqlgen/graphql/handler" "github.com/Yamashou/gqlgenc/clientv2" - "github.com/theopenlane/core/pkg/testutils" "github.com/theopenlane/go-turso" - "go.uber.org/zap" - "go.uber.org/zap/zaptest" + "github.com/theopenlane/utils/testutils" ent "github.com/theopenlane/dbx/internal/ent/generated" "github.com/theopenlane/dbx/internal/entdb" @@ -47,6 +46,8 @@ type graphClient struct { } func (suite *GraphTestSuite) SetupSuite() { + zerolog.SetGlobalLevel(zerolog.Disabled) + suite.tf = entdb.NewTestFixture() } @@ -55,14 +56,10 @@ func (suite *GraphTestSuite) SetupTest() { ctx := context.Background() - // setup logger - logger := zap.NewNop().Sugar() - // setup mock turso client tc := turso.NewMockClient() opts := []ent.Option{ - ent.Logger(*logger), ent.Turso(tc), } @@ -84,7 +81,7 @@ func (suite *GraphTestSuite) SetupTest() { func (suite *GraphTestSuite) TearDownTest() { if suite.client.db != nil { if err := suite.client.db.Close(); err != nil { - log.Fatalf("failed to close database: %s", err) + log.Fatal().Err(err).Msg("failed to close database") } } } @@ -94,11 +91,9 @@ func (suite *GraphTestSuite) TearDownSuite() { } func graphTestClient(t *testing.T, c *ent.Client) dbxclient.Dbxclient { - logger := zaptest.NewLogger(t, zaptest.Level(zap.ErrorLevel)).Sugar() - srv := handler.NewDefaultServer( graphapi.NewExecutableSchema( - graphapi.Config{Resolvers: graphapi.NewResolver(c).WithLogger(logger)}, + graphapi.Config{Resolvers: graphapi.NewResolver(c)}, )) graphapi.WithTransactions(srv, c) diff --git a/internal/httpserve/config/config.go b/internal/httpserve/config/config.go index d57dfd8..bff9c10 100644 --- a/internal/httpserve/config/config.go +++ b/internal/httpserve/config/config.go @@ -6,7 +6,6 @@ import ( "time" echo "github.com/theopenlane/echox" - "go.uber.org/zap" "golang.org/x/crypto/acme" "golang.org/x/crypto/acme/autocert" @@ -36,9 +35,6 @@ type ( Config struct { // add all the configuration settings for the openlane server Settings config.Config - - // Logger contains the logger used by echo functions - Logger *zap.SugaredLogger // Routes contains the handler functions Routes []http.Handler // DefaultMiddleware to enable on the echo server used on all requests diff --git a/internal/httpserve/config/configproviderrefresh.go b/internal/httpserve/config/configproviderrefresh.go index 32a65b2..946ed71 100644 --- a/internal/httpserve/config/configproviderrefresh.go +++ b/internal/httpserve/config/configproviderrefresh.go @@ -3,6 +3,8 @@ package config import ( "sync" "time" + + "github.com/rs/zerolog/log" ) // ConfigProviderWithRefresh shows a config provider with automatic refresh; it contains fields and methods to manage the configuration, @@ -65,11 +67,11 @@ func (s *ConfigProviderWithRefresh) refreshConfig() { newConfig, err := s.configProvider.GetConfig() if err != nil { - s.config.Logger.Error("failed to load new server configuration") + log.Error().Err(err).Msg("failed to load new server configuration") continue } - s.config.Logger.Info("loaded new server configuration") + log.Info().Msg("loaded new server configuration") s.Lock() s.config = newConfig diff --git a/internal/httpserve/handlers/handlers.go b/internal/httpserve/handlers/handlers.go index 5fb0246..24023f8 100644 --- a/internal/httpserve/handlers/handlers.go +++ b/internal/httpserve/handlers/handlers.go @@ -3,7 +3,6 @@ package handlers import ( "github.com/redis/go-redis/v9" echo "github.com/theopenlane/echox" - "go.uber.org/zap" "github.com/theopenlane/iam/sessions" @@ -18,8 +17,6 @@ type Handler struct { DBClient *ent.Client // RedisClient to interact with redis RedisClient *redis.Client - // Logger provides the zap logger to do logging things from the handlers - Logger *zap.SugaredLogger // ReadyChecks is a set of checkFuncs to determine if the application is "ready" upon startup ReadyChecks Checks // SessionConfig to handle sessions diff --git a/internal/httpserve/server/server.go b/internal/httpserve/server/server.go index 9017838..c7aebac 100644 --- a/internal/httpserve/server/server.go +++ b/internal/httpserve/server/server.go @@ -3,8 +3,8 @@ package server import ( "context" + "github.com/rs/zerolog/log" echo "github.com/theopenlane/echox" - "go.uber.org/zap" echodebug "github.com/theopenlane/core/pkg/middleware/debug" @@ -15,8 +15,6 @@ import ( type Server struct { // config contains the base server settings config config.Config - // logger contains the zap logger - logger *zap.SugaredLogger // handlers contains additional handlers to register with the echo server handlers []handler } @@ -33,10 +31,9 @@ func (s *Server) AddHandler(r handler) { } // NewServer returns a new Server configuration -func NewServer(c config.Config, l *zap.SugaredLogger) *Server { +func NewServer(c config.Config) *Server { return &Server{ config: c, - logger: l, } } @@ -55,7 +52,7 @@ func (s *Server) StartEchoServer(ctx context.Context) error { srv.Debug = s.config.Settings.Server.Debug if srv.Debug { - srv.Use(echodebug.BodyDump(s.logger)) + srv.Use(echodebug.BodyDump()) } for _, m := range s.config.DefaultMiddleware { @@ -75,12 +72,12 @@ func (s *Server) StartEchoServer(ctx context.Context) error { // Print routes on startup routes := srv.Router().Routes() for _, r := range routes { - s.logger.Infow("registered route", "route", r.Path(), "method", r.Method()) + log.Info().Str("route", r.Path()).Str("method", r.Method()).Msg("registered route") } // if TLS is enabled, start new echo server with TLS if s.config.Settings.Server.TLS.Enabled { - s.logger.Infow("starting in https mode") + log.Info().Msg("starting in https mode") return sc.StartTLS(srv, s.config.Settings.Server.TLS.CertFile, s.config.Settings.Server.TLS.CertKey) } diff --git a/internal/httpserve/serveropts/hooks.go b/internal/httpserve/serveropts/hooks.go new file mode 100644 index 0000000..d61cfca --- /dev/null +++ b/internal/httpserve/serveropts/hooks.go @@ -0,0 +1,15 @@ +package serveropts + +import ( + "github.com/rs/zerolog" +) + +// LevelNameHook is a hook that sets the level name field to "info" if the level is not set. +type LevelNameHook struct{} + +// Run satisfies the zerolog.Hook interface. +func (h LevelNameHook) Run(e *zerolog.Event, l zerolog.Level, msg string) { + if l == zerolog.NoLevel { + e.Str(zerolog.LevelFieldName, zerolog.InfoLevel.String()) + } +} diff --git a/internal/httpserve/serveropts/option.go b/internal/httpserve/serveropts/option.go index df9af71..2c510ad 100644 --- a/internal/httpserve/serveropts/option.go +++ b/internal/httpserve/serveropts/option.go @@ -2,12 +2,11 @@ package serveropts import ( "github.com/redis/go-redis/v9" + "github.com/rs/zerolog/log" echoprometheus "github.com/theopenlane/echo-prometheus" echo "github.com/theopenlane/echox" "github.com/theopenlane/echox/middleware" - "github.com/theopenlane/echozap" "github.com/theopenlane/entx" - "go.uber.org/zap" "github.com/theopenlane/dbx/internal/ent/generated" "github.com/theopenlane/dbx/internal/graphapi" @@ -16,11 +15,11 @@ import ( "github.com/theopenlane/core/pkg/middleware/cachecontrol" "github.com/theopenlane/core/pkg/middleware/cors" - "github.com/theopenlane/core/pkg/middleware/echocontext" "github.com/theopenlane/core/pkg/middleware/mime" "github.com/theopenlane/core/pkg/middleware/ratelimit" "github.com/theopenlane/core/pkg/middleware/redirect" "github.com/theopenlane/core/pkg/middleware/secure" + "github.com/theopenlane/echox/middleware/echocontext" "github.com/theopenlane/iam/sessions" "github.com/theopenlane/utils/cache" ) @@ -50,16 +49,6 @@ func WithConfigProvider(cfgProvider config.ConfigProvider) ServerOption { }) } -// WithLogger supplies the logger for the server -func WithLogger(l *zap.SugaredLogger) ServerOption { - return newApplyFunc(func(s *ServerOptions) { - // Add logger to main config - s.Config.Logger = l - // Add logger to the handlers config - s.Config.Handler.Logger = l - }) -} - // WithHTTPS sets up TLS config settings for the server func WithHTTPS() ServerOption { return newApplyFunc(func(s *ServerOptions) { @@ -99,8 +88,7 @@ func WithReadyChecks(c *entx.EntClientConfig, r *redis.Client) ServerOption { func WithGraphRoute(srv *server.Server, c *generated.Client) ServerOption { return newApplyFunc(func(s *ServerOptions) { // Setup Graph API Handlers - r := graphapi.NewResolver(c). - WithLogger(s.Config.Logger.Named("resolvers")) + r := graphapi.NewResolver(c) handler := r.Handler(s.Config.Settings.Server.Dev) @@ -122,10 +110,10 @@ func WithMiddleware() ServerOption { middleware.RequestID(), // add request id middleware.Recover(), // recover server from any panic/fatal error gracefully middleware.LoggerWithConfig(middleware.LoggerConfig{ - Format: "remote_ip=${remote_ip}, method=${method}, uri=${uri}, status=${status}, session=${header:Set-Cookie}, host=${host}, referer=${referer}, user_agent=${user_agent}, route=${route}, path=${path}, auth=${header:Authorization}\n", + Output: log.Logger.Hook(LevelNameHook{}), + Format: "remote_ip=${remote_ip}, method=${method}, uri=${uri}, status=${status}, session=${header:Set-Cookie}, host=${host}, referer=${referer}, user_agent=${user_agent}, route=${route}, path=${path}", }), echoprometheus.MetricsMiddleware(), // add prometheus metrics - echozap.ZapLogger(s.Config.Logger.Desugar()), // add zap logger, middleware requires the "regular" zap logger echocontext.EchoContextToContextMiddleware(), // adds echo context to parent mime.NewWithConfig(mime.Config{DefaultContentType: echo.MIMEApplicationJSONCharsetUTF8}), // add mime middleware ) @@ -157,8 +145,6 @@ func WithSessionManager(rc *redis.Client) ServerOption { sessionConfig := sessions.NewSessionConfig( sm, sessions.WithPersistence(rc), - sessions.WithLogger(s.Config.Logger), - // sessions.WithSkipperFunc(authmw.SessionSkipperFunc), ) // set cookie config to be used