From 27b6d14403ca1a47052fa283a3f851296c6e834d Mon Sep 17 00:00:00 2001 From: Parham Alvani <1995parham@tuta.io> Date: Tue, 24 Aug 2021 22:40:01 +0430 Subject: [PATCH 001/660] fix: Correct Lint Issue --- internal/web/rest/api/auth.go | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/internal/web/rest/api/auth.go b/internal/web/rest/api/auth.go index bc7fe499..ee8f5228 100644 --- a/internal/web/rest/api/auth.go +++ b/internal/web/rest/api/auth.go @@ -1,23 +1,24 @@ package api import ( + "net/http" + "time" + "github.com/gin-gonic/gin" "github.com/opentracing/opentracing-go" "gitlab.snapp.ir/dispatching/soteria/v3/internal" "gitlab.snapp.ir/dispatching/soteria/v3/internal/app" "go.uber.org/zap" - "net/http" - "time" ) -// authRequest is the body payload structure of the auth endpoint +// authRequest is the body payload structure of the auth endpoint. type authRequest struct { Token string `form:"token"` Username string `from:"username"` Password string `form:"password"` } -// Auth is the handler responsible for authentication +// Auth is the handler responsible for authentication. func Auth(ctx *gin.Context) { authSpan := app.GetInstance().Tracer.StartSpan("api.rest.auth") defer authSpan.Finish() From 06cfa8010e53633b9e2ac691c6fe2b667252e35f Mon Sep 17 00:00:00 2001 From: Parham Alvani <1995parham@tuta.io> Date: Tue, 24 Aug 2021 23:05:46 +0430 Subject: [PATCH 002/660] feat: Update jwt Package to Version 4 --- go.mod | 2 +- go.sum | 2 ++ internal/config/config.go | 2 +- pkg/acl/token.go | 2 +- 4 files changed, 5 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index 5c0559a3..ec917dce 100644 --- a/go.mod +++ b/go.mod @@ -5,12 +5,12 @@ go 1.15 require ( github.com/HdrHistogram/hdrhistogram-go v1.1.0 // indirect github.com/alicebob/miniredis/v2 v2.13.1 - github.com/dgrijalva/jwt-go v3.2.0+incompatible github.com/gin-contrib/zap v0.0.1 github.com/gin-gonic/gin v1.6.3 github.com/go-ozzo/ozzo-validation/v4 v4.3.0 // indirect github.com/go-playground/validator/v10 v10.3.0 // indirect github.com/go-redis/redis/v8 v8.3.2 + github.com/golang-jwt/jwt/v4 v4.0.0 // indirect github.com/golang/protobuf v1.4.2 github.com/google/uuid v1.1.2 github.com/kelseyhightower/envconfig v1.4.0 diff --git a/go.sum b/go.sum index 6a496d2c..c92cdfca 100644 --- a/go.sum +++ b/go.sum @@ -114,6 +114,8 @@ github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/me github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= github.com/gogo/protobuf v1.2.1 h1:/s5zKNz0uPFCZ5hddgPdo2TK2TVrUNMn0OOX8/aZMTE= github.com/gogo/protobuf v1.2.1/go.mod h1:hp+jE20tsWTFYpLwKvXlhS1hjn+gTNwPg2I6zVXpSg4= +github.com/golang-jwt/jwt/v4 v4.0.0 h1:RAqyYixv1p7uEnocuy8P1nru5wprCh/MH2BIlW5z5/o= +github.com/golang-jwt/jwt/v4 v4.0.0/go.mod h1:/xlHOz8bRuivTWchD4jCa+NbatV+wEUSzwAxVc6locg= github.com/golang/freetype v0.0.0-20170609003504-e2365dfdc4a0 h1:DACJavvAHhabrF08vX0COfcOBJRhZ8lUbR+ZWIs0Y5g= github.com/golang/freetype v0.0.0-20170609003504-e2365dfdc4a0/go.mod h1:E/TSTwGwJL78qG/PmXZO1EjYhfJinVAhrmmHX6Z8B9k= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b h1:VKtxabqXZkF25pY9ekfRL6a582T4P37/31XEstQ5p58= diff --git a/internal/config/config.go b/internal/config/config.go index a0fb72b1..9fe5fd4e 100644 --- a/internal/config/config.go +++ b/internal/config/config.go @@ -6,7 +6,7 @@ import ( "io/ioutil" "time" - "github.com/dgrijalva/jwt-go" + "github.com/golang-jwt/jwt/v4" "github.com/kelseyhightower/envconfig" "gitlab.snapp.ir/dispatching/soteria/v3/pkg/acl" "gitlab.snapp.ir/dispatching/soteria/v3/pkg/user" diff --git a/pkg/acl/token.go b/pkg/acl/token.go index 604c395d..973896d1 100644 --- a/pkg/acl/token.go +++ b/pkg/acl/token.go @@ -1,7 +1,7 @@ package acl import ( - "github.com/dgrijalva/jwt-go" + "github.com/golang-jwt/jwt/v4" "gitlab.snapp.ir/dispatching/soteria/v3/internal/topics" ) From ef4d332e53849a0c4b42e4b055d87ec5b05eb76f Mon Sep 17 00:00:00 2001 From: Parham Alvani <1995parham@tuta.io> Date: Tue, 24 Aug 2021 23:21:55 +0430 Subject: [PATCH 003/660] feat: Add Issuer to find out the issuer without validation --- internal/authenticator/authenticator.go | 18 +++++++++++++++++- internal/authenticator/authenticator_test.go | 12 ++++++++++-- 2 files changed, 27 insertions(+), 3 deletions(-) diff --git a/internal/authenticator/authenticator.go b/internal/authenticator/authenticator.go index b7a5505a..d9410f5f 100644 --- a/internal/authenticator/authenticator.go +++ b/internal/authenticator/authenticator.go @@ -7,7 +7,7 @@ import ( "fmt" "time" - "github.com/dgrijalva/jwt-go" + "github.com/golang-jwt/jwt/v4" "gitlab.snapp.ir/dispatching/snappids/v2" "gitlab.snapp.ir/dispatching/soteria/v3/internal/db" "gitlab.snapp.ir/dispatching/soteria/v3/internal/topics" @@ -66,6 +66,22 @@ type Authenticator struct { HashIDSManager *snappids.HashIDSManager CompareHashAndPassword func([]byte, []byte) error Company string + JWTParser jwt.Parser +} + +// Issuer returns the iss field of the given token without validating the token. +func (a Authenticator) Issuer(ctx context.Context, tokenString string) (user.Issuer, error) { + var claims jwt.MapClaims + + if _, _, err := a.JWTParser.ParseUnverified(tokenString, &claims); err != nil { + return user.Issuer(""), fmt.Errorf("cannot parse the token claims %w", err) + } + + if claims["iss"] == nil { + return user.Issuer(""), ErrIssNotFound + } + + return user.Issuer(fmt.Sprintf("%v", claims["iss"])), nil } // Auth check user authentication by checking the user's token diff --git a/internal/authenticator/authenticator_test.go b/internal/authenticator/authenticator_test.go index 5cc52db8..b10fa6a8 100644 --- a/internal/authenticator/authenticator_test.go +++ b/internal/authenticator/authenticator_test.go @@ -8,7 +8,7 @@ import ( "testing" "time" - "github.com/dgrijalva/jwt-go" + "github.com/golang-jwt/jwt/v4" "github.com/google/uuid" "github.com/stretchr/testify/assert" snappids "gitlab.snapp.ir/dispatching/snappids/v2" @@ -123,6 +123,12 @@ func TestAuthenticator_Auth(t *testing.T) { assert.Error(t, err) assert.False(t, ok) }) + + t.Run("testing issuer for third party token", func(t *testing.T) { + iss, err := authenticator.Issuer(context.Background(), thirdPartyToken) + assert.NoError(t, err) + assert.Equal(t, user.ThirdParty, iss) + }) } func TestAuthenticator_Token(t *testing.T) { @@ -143,6 +149,7 @@ func TestAuthenticator_Token(t *testing.T) { ModelHandler: MockModelHandler{}, CompareHashAndPassword: passwordChecker, } + t.Run("testing getting token with valid inputs", func(t *testing.T) { tokenString, err := authenticator.Token(context.Background(), acl.ClientCredentials, "snappbox", "KJIikjIKbIYVGj)YihYUGIB&") token, err := jwt.Parse(tokenString, func(token *jwt.Token) (interface{}, error) { @@ -154,6 +161,7 @@ func TestAuthenticator_Token(t *testing.T) { assert.Equal(t, "100", claims["iss"].(string)) }) + t.Run("testing getting token with valid inputs", func(t *testing.T) { tokenString, err := authenticator.Token(context.Background(), acl.ClientCredentials, "snappbox", "invalid secret") token, err := jwt.Parse(tokenString, func(token *jwt.Token) (interface{}, error) { @@ -331,7 +339,7 @@ func TestAuthenticator_Acl(t *testing.T) { ok, err := authenticator.ACL(context.Background(), acl.Pub, invalidToken, validDriverCabEventTopic) assert.False(t, ok) assert.Error(t, err) - assert.Equal(t, "token is invalid illegal base64 data at input byte 37", err.Error()) + assert.Equal(t, "token is invalid illegal base64 data at input byte 36", err.Error()) }) t.Run("testing acl with valid inputs", func(t *testing.T) { ok, err := authenticator.ACL(context.Background(), acl.Sub, passengerToken, validPassengerCabEventTopic) From 199b6d8e7ba4d17227f6d3f7fcc20aa1df4edf1b Mon Sep 17 00:00:00 2001 From: Parham Alvani <1995parham@tuta.io> Date: Tue, 24 Aug 2021 23:23:57 +0430 Subject: [PATCH 004/660] feat: Update jwt package --- internal/db/main/main.go | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/internal/db/main/main.go b/internal/db/main/main.go index 74f2e44c..23dd2daa 100644 --- a/internal/db/main/main.go +++ b/internal/db/main/main.go @@ -4,15 +4,16 @@ import ( "crypto/rsa" "encoding/json" "fmt" - "github.com/dgrijalva/jwt-go" + "io/ioutil" + "os" + "time" + + "github.com/golang-jwt/jwt/v4" "github.com/google/uuid" "gitlab.snapp.ir/dispatching/soteria/v3/internal/db" "gitlab.snapp.ir/dispatching/soteria/v3/internal/topics" "gitlab.snapp.ir/dispatching/soteria/v3/pkg/acl" "gitlab.snapp.ir/dispatching/soteria/v3/pkg/user" - "io/ioutil" - "os" - "time" ) func main() { From 9b6c0c0e12b61cc5c684548b52eeffbbe17284c0 Mon Sep 17 00:00:00 2001 From: Parham Alvani <1995parham@tuta.io> Date: Tue, 24 Aug 2021 23:35:56 +0430 Subject: [PATCH 005/660] feat: Add Superuser Handler --- internal/constants.go | 1 + internal/web/rest/api/superuser.go | 122 +++++++++++++++++++++++++++++ 2 files changed, 123 insertions(+) create mode 100644 internal/web/rest/api/superuser.go diff --git a/internal/constants.go b/internal/constants.go index 5515900e..ad915a80 100644 --- a/internal/constants.go +++ b/internal/constants.go @@ -4,6 +4,7 @@ const ( Soteria = "soteria" Acl = "acl" Auth = "auth" + Superuser = "superuser" Token = "token" Success = "success" Failure = "failure" diff --git a/internal/web/rest/api/superuser.go b/internal/web/rest/api/superuser.go new file mode 100644 index 00000000..eed3b0e0 --- /dev/null +++ b/internal/web/rest/api/superuser.go @@ -0,0 +1,122 @@ +package api + +import ( + "net/http" + "time" + + "github.com/gin-gonic/gin" + "github.com/opentracing/opentracing-go" + "gitlab.snapp.ir/dispatching/soteria/v3/internal" + "gitlab.snapp.ir/dispatching/soteria/v3/internal/app" + "gitlab.snapp.ir/dispatching/soteria/v3/pkg/user" + "go.uber.org/zap" +) + +// Superuser is the handler responsible for authentication a superuser. +// it uses the exact same request payload as authentication endpoint. +func Superuser(ctx *gin.Context) { + authSpan := app.GetInstance().Tracer.StartSpan("api.rest.auth") + defer authSpan.Finish() + + s := time.Now() + + var request authRequest + + if err := ctx.ShouldBind(&request); err != nil { + zap.L(). + Warn("bad request", + zap.Error(err), + ) + + app.GetInstance().Metrics.ObserveStatusCode(internal.HttpApi, internal.Soteria, internal.Superuser, http.StatusBadRequest) + app.GetInstance().Metrics.ObserveStatus(internal.HttpApi, internal.Soteria, internal.Superuser, internal.Failure, "bad request") + app.GetInstance().Metrics.ObserveResponseTime(internal.HttpApi, internal.Soteria, internal.Superuser, float64(time.Since(s).Nanoseconds())) + ctx.String(http.StatusBadRequest, "bad request") + return + } + + tokenString := request.Token + + if len(tokenString) == 0 { + tokenString = request.Username + } + + if len(tokenString) == 0 { + tokenString = request.Password + } + + authCheckSpan := app.GetInstance().Tracer.StartSpan("auth check", opentracing.ChildOf(authSpan.Context())) + defer authCheckSpan.Finish() + + iss, err := app.GetInstance().Authenticator.Issuer(ctx, tokenString) + if err != nil { + authCheckSpan.SetTag("success", false) + authCheckSpan.SetTag("error", err.Error()) + + zap.L(). + Error("superuser request is not authorized", + zap.Error(err), + zap.String("token", request.Token), + zap.String("username", request.Password), + zap.String("password", request.Username), + ) + + app.GetInstance().Metrics.ObserveStatusCode(internal.HttpApi, internal.Soteria, internal.Superuser, http.StatusUnauthorized) + app.GetInstance().Metrics.ObserveStatus(internal.HttpApi, internal.Soteria, internal.Superuser, internal.Failure, "request is not authorized") + app.GetInstance().Metrics.ObserveResponseTime(internal.HttpApi, internal.Soteria, internal.Superuser, float64(time.Since(s).Nanoseconds())) + ctx.String(http.StatusUnauthorized, "request is not authorized") + + return + } + + if iss != user.ThirdParty { + zap.L(). + Error("superuser request is not authorized", + zap.String("token", request.Token), + zap.String("username", request.Password), + zap.String("password", request.Username), + ) + + app.GetInstance().Metrics.ObserveStatusCode(internal.HttpApi, internal.Soteria, internal.Superuser, http.StatusUnauthorized) + app.GetInstance().Metrics.ObserveStatus(internal.HttpApi, internal.Soteria, internal.Superuser, internal.Failure, "request is not authorized") + app.GetInstance().Metrics.ObserveResponseTime(internal.HttpApi, internal.Soteria, internal.Superuser, float64(time.Since(s).Nanoseconds())) + ctx.String(http.StatusUnauthorized, "request is not authorized") + + return + } + + if _, err := app.GetInstance().Authenticator.Auth(ctx, tokenString); err != nil { + authCheckSpan.SetTag("success", false) + authCheckSpan.SetTag("error", err.Error()) + + zap.L(). + Error("superuser request is not authorized", + zap.Error(err), + zap.String("token", request.Token), + zap.String("username", request.Password), + zap.String("password", request.Username), + ) + + app.GetInstance().Metrics.ObserveStatusCode(internal.HttpApi, internal.Soteria, internal.Superuser, http.StatusUnauthorized) + app.GetInstance().Metrics.ObserveStatus(internal.HttpApi, internal.Soteria, internal.Superuser, internal.Failure, "request is not authorized") + app.GetInstance().Metrics.ObserveResponseTime(internal.HttpApi, internal.Soteria, internal.Superuser, float64(time.Since(s).Nanoseconds())) + ctx.String(http.StatusUnauthorized, "request is not authorized") + + return + } + + zap.L(). + Info("superuser ok", + zap.String("token", request.Token), + zap.String("username", request.Password), + zap.String("password", request.Username), + ) + + app.GetInstance().Metrics.ObserveStatusCode(internal.HttpApi, internal.Soteria, internal.Superuser, http.StatusOK) + app.GetInstance().Metrics.ObserveStatus(internal.HttpApi, internal.Soteria, internal.Superuser, internal.Success, "ok") + app.GetInstance().Metrics.ObserveResponseTime(internal.HttpApi, internal.Soteria, internal.Superuser, float64(time.Since(s).Nanoseconds())) + + authSpan.SetTag("success", true) + + ctx.String(http.StatusOK, "ok") +} From 1a53eb1f1897856b3d993c58fbb3101a6858f662 Mon Sep 17 00:00:00 2001 From: Parham Alvani <1995parham@tuta.io> Date: Tue, 24 Aug 2021 23:36:31 +0430 Subject: [PATCH 006/660] feat: Register Superuser Endpoint --- internal/web/rest/api/api.go | 1 + 1 file changed, 1 insertion(+) diff --git a/internal/web/rest/api/api.go b/internal/web/rest/api/api.go index 9641cf73..e9b83c5a 100644 --- a/internal/web/rest/api/api.go +++ b/internal/web/rest/api/api.go @@ -42,6 +42,7 @@ func setupRouter(mode string) *gin.Engine { router.POST("/auth", Auth) router.POST("/acl", ACL) + router.POST("/superuser", Superuser) router.POST("/token", Token) router.GET("/metrics", gin.WrapH(promhttp.Handler())) From dcaef1aab799e328080ccae8eb79bac1b15e7323 Mon Sep 17 00:00:00 2001 From: Parham Alvani <1995parham@tuta.io> Date: Tue, 24 Aug 2021 23:45:59 +0430 Subject: [PATCH 007/660] feat: Update Go Version --- .gitlab/ci/templates/compile.giltab-ci.yml | 4 +- .gitlab/ci/templates/test.giltab-ci.yml | 6 +- go.mod | 50 +++++++++- go.sum | 105 +-------------------- 4 files changed, 52 insertions(+), 113 deletions(-) diff --git a/.gitlab/ci/templates/compile.giltab-ci.yml b/.gitlab/ci/templates/compile.giltab-ci.yml index 03dae838..47559c5d 100644 --- a/.gitlab/ci/templates/compile.giltab-ci.yml +++ b/.gitlab/ci/templates/compile.giltab-ci.yml @@ -1,6 +1,6 @@ - +--- .go_mod_config: &go_mod - image: registry.snapp.tech/docker/golang:1.13.5-alpine3.10 + image: golang:1.17-alpine cache: policy: pull paths: diff --git a/.gitlab/ci/templates/test.giltab-ci.yml b/.gitlab/ci/templates/test.giltab-ci.yml index 58e9c092..adf83d19 100644 --- a/.gitlab/ci/templates/test.giltab-ci.yml +++ b/.gitlab/ci/templates/test.giltab-ci.yml @@ -1,6 +1,6 @@ - +--- .go_mod_config: &go_mod - image: registry.snapp.tech/docker/golang:1.13.5-alpine3.10 + image: golang:1.17-alpine cache: policy: pull paths: @@ -22,4 +22,4 @@ unit_tests: - compile except: variables: - - $UPDATE_ENVIRONMENT_VARIABLE \ No newline at end of file + - $UPDATE_ENVIRONMENT_VARIABLE diff --git a/go.mod b/go.mod index ec917dce..ca047e17 100644 --- a/go.mod +++ b/go.mod @@ -1,23 +1,22 @@ module gitlab.snapp.ir/dispatching/soteria/v3 -go 1.15 +go 1.17 require ( github.com/HdrHistogram/hdrhistogram-go v1.1.0 // indirect github.com/alicebob/miniredis/v2 v2.13.1 github.com/gin-contrib/zap v0.0.1 github.com/gin-gonic/gin v1.6.3 - github.com/go-ozzo/ozzo-validation/v4 v4.3.0 // indirect + github.com/go-ozzo/ozzo-validation/v4 v4.3.0 github.com/go-playground/validator/v10 v10.3.0 // indirect github.com/go-redis/redis/v8 v8.3.2 - github.com/golang-jwt/jwt/v4 v4.0.0 // indirect + github.com/golang-jwt/jwt/v4 v4.0.0 github.com/golang/protobuf v1.4.2 github.com/google/uuid v1.1.2 github.com/kelseyhightower/envconfig v1.4.0 github.com/opentracing/opentracing-go v1.2.0 github.com/patrickmn/go-cache v2.1.0+incompatible github.com/prometheus/client_golang v1.7.1 - github.com/speps/go-hashids v2.0.0+incompatible // indirect github.com/spf13/cobra v1.0.0 github.com/stretchr/testify v1.7.0 github.com/uber/jaeger-client-go v2.25.0+incompatible @@ -30,3 +29,46 @@ require ( google.golang.org/grpc v1.27.0 google.golang.org/protobuf v1.25.0 // indirect ) + +require ( + github.com/BurntSushi/toml v0.3.1 // indirect + github.com/alicebob/gopher-json v0.0.0-20200520072559-a9ecdc9d1d3a // indirect + github.com/beorn7/perks v1.0.1 // indirect + github.com/cespare/xxhash/v2 v2.1.1 // indirect + github.com/davecgh/go-spew v1.1.1 // indirect + github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f // indirect + github.com/gin-contrib/sse v0.1.0 // indirect + github.com/go-playground/locales v0.13.0 // indirect + github.com/go-playground/universal-translator v0.17.0 // indirect + github.com/google/go-cmp v0.5.4 // indirect + github.com/inconshreveable/mousetrap v1.0.0 // indirect + github.com/json-iterator/go v1.1.10 // indirect + github.com/leodido/go-urn v1.2.0 // indirect + github.com/mattn/go-isatty v0.0.12 // indirect + github.com/matttproud/golang_protobuf_extensions v1.0.1 // indirect + github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect + github.com/modern-go/reflect2 v1.0.1 // indirect + github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e // indirect + github.com/pkg/errors v0.8.1 // indirect + github.com/pmezard/go-difflib v1.0.0 // indirect + github.com/prometheus/client_model v0.2.0 // indirect + github.com/prometheus/common v0.10.0 // indirect + github.com/prometheus/procfs v0.1.3 // indirect + github.com/speps/go-hashids/v2 v2.0.1 // indirect + github.com/spf13/pflag v1.0.3 // indirect + github.com/ugorji/go/codec v1.1.7 // indirect + github.com/yuin/gopher-lua v0.0.0-20191220021717-ab39c6098bdb // indirect + go.opentelemetry.io/otel v0.13.0 // indirect + go.uber.org/multierr v1.5.0 // indirect + golang.org/x/lint v0.0.0-20191125180803-fdd1cda4f05f // indirect + golang.org/x/net v0.0.0-20201006153459-a7d1128ccaa0 // indirect + golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f // indirect + golang.org/x/text v0.3.3 // indirect + golang.org/x/tools v0.0.0-20191125144606-a911d9008d1f // indirect + golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 // indirect + google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013 // indirect + gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f // indirect + gopkg.in/yaml.v2 v2.3.0 // indirect + gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c // indirect + honnef.co/go/tools v0.0.1-2019.2.3 // indirect +) diff --git a/go.sum b/go.sum index c92cdfca..8dc449a7 100644 --- a/go.sum +++ b/go.sum @@ -1,83 +1,58 @@ bou.ke/monkey v1.0.2 h1:kWcnsrCNUatbxncxR/ThdYqbytgOIArtYWqcQLQzKLI= bou.ke/monkey v1.0.2/go.mod h1:OqickVX3tNx6t33n1xvtTtu85YN5s6cKwVug+oHMaIA= -cloud.google.com/go v0.26.0 h1:e0WKqKTd5BnrG8aKH3J3h+QvEIQtSUcf2n5UZ5ZgLtQ= cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= -dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9 h1:VpgP7xuJadIUuKccphEpTJnWhS2jkQyMt6Y7pJCD7fY= dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= github.com/BurntSushi/toml v0.3.1 h1:WXkYYl6Yr3qBf1K79EBnL4mak0OimBfB0XUf9Vl28OQ= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= -github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802 h1:1BDTz0u9nC3//pOCMdNH+CiXJVYJh5UQNCOBG7jbELc= github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= github.com/HdrHistogram/hdrhistogram-go v1.1.0 h1:6dpdDPTRoo78HxAJ6T1HfMiKSnqhgRRqzCuPshRkQ7I= github.com/HdrHistogram/hdrhistogram-go v1.1.0/go.mod h1:yDgFjdqOqDEKOvasDdhWNXYg9BVp4O+o5f6V/ehm6Oo= -github.com/OneOfOne/xxhash v1.2.2 h1:KMrpdQIwFcEqXDklaen+P1axHaj9BSKzvpUUfnHldSE= github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU= -github.com/ajstarks/svgo v0.0.0-20180226025133-644b8db467af h1:wVe6/Ea46ZMeNkQjjBW6xcqyQA/j5e0D6GytH95g0gQ= github.com/ajstarks/svgo v0.0.0-20180226025133-644b8db467af/go.mod h1:K08gAheRH3/J6wwsYMMT4xOr94bZjxIelGM0+d/wbFw= github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= -github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751 h1:JYp7IbQjafoB+tBA3gMyHYHrpOtNuDiK/uB5uXxq5wM= github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= -github.com/alecthomas/units v0.0.0-20190717042225-c3de453c63f4 h1:Hs82Z41s6SdL1CELW+XaDYmOH4hkBN4/N9og/AsOv7E= github.com/alecthomas/units v0.0.0-20190717042225-c3de453c63f4/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= github.com/alicebob/gopher-json v0.0.0-20200520072559-a9ecdc9d1d3a h1:HbKu58rmZpUGpz5+4FfNmIU+FmZg2P3Xaj2v2bfNWmk= github.com/alicebob/gopher-json v0.0.0-20200520072559-a9ecdc9d1d3a/go.mod h1:SGnFV6hVsYE877CKEZ6tDNTjaSXYUk6QqoIK6PrAtcc= github.com/alicebob/miniredis/v2 v2.13.1 h1:twArGFW9kCdxe0K1Ga+iWrZc9RdWalf7V5bQerNoPK0= github.com/alicebob/miniredis/v2 v2.13.1/go.mod h1:0UIBNuf97uxrWhdVBpJvPtafKyGpL2NS2pYe0tYM97k= -github.com/armon/consul-api v0.0.0-20180202201655-eb2c6b5be1b6 h1:G1bPvciwNyF7IUmKXNt9Ak3m6u9DE1rF+RmtIkBpVdA= github.com/armon/consul-api v0.0.0-20180202201655-eb2c6b5be1b6/go.mod h1:grANhF5doyWs3UAsr3K4I6qtAmlQcZDesFNEHPZAzj8= +github.com/asaskevich/govalidator v0.0.0-20200108200545-475eaeb16496 h1:zV3ejI06GQ59hwDQAvmK1qxOQGB3WuVTRoY0okPTAv0= github.com/asaskevich/govalidator v0.0.0-20200108200545-475eaeb16496/go.mod h1:oGkLhpf+kjZl6xBf758TQhh5XrAeiJv/7FRz/2spLIg= github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q= github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8= 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/census-instrumentation/opencensus-proto v0.2.1 h1:glEXhBS5PSLLv4IXzLA5yPRVX4bilULVyxxbrfOtDAk= github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= github.com/cespare/xxhash v1.1.0 h1:a6HrQnmkObjyL+Gs60czilIUGqrzKutQD6XZog3p+ko= github.com/cespare/xxhash v1.1.0/go.mod h1:XrSqR1VqqWfGrhpAt58auRo0WTKS1nRRg3ghfAqPWnc= github.com/cespare/xxhash/v2 v2.1.1 h1:6MnRN8NT7+YBpUIWxHtefFZOKTAPgGjpQSxqLNn0+qY= github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= -github.com/chzyer/logex v1.1.10 h1:Swpa1K6QvQznwJRcfTfQJmTE72DqScAa40E+fbHEXEE= github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI= -github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e h1:fY5BOSpyZCqRo5OhCuC+XN+r/bBCmeuuJtjz+bCNIf8= github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI= -github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1 h1:q763qf9huN11kDQavWsoZXJNW3xEE4JJyHa5Q25/sd8= github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU= -github.com/client9/misspell v0.3.4 h1:ta993UF76GwbvJcIo3Y68y/M3WxlpEHPWIGDkJYwzJI= github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= -github.com/coreos/bbolt v1.3.2 h1:wZwiHHUieZCquLkDL0B8UhzreNWsPHooDAG3q34zk0s= github.com/coreos/bbolt v1.3.2/go.mod h1:iRUV2dpdMOn7Bo10OQBFzIJO9kkE559Wcmn+qkEiiKk= -github.com/coreos/etcd v3.3.10+incompatible h1:jFneRYjIvLMLhDLCzuTuU4rSJUjRplcJQ7pD7MnhC04= github.com/coreos/etcd v3.3.10+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE= -github.com/coreos/go-semver v0.2.0 h1:3Jm3tLmsgAYcjC+4Up7hJrFBPr+n7rAqYeSw/SZazuY= github.com/coreos/go-semver v0.2.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk= -github.com/coreos/go-systemd v0.0.0-20190321100706-95778dfbb74e h1:Wf6HqHfScWJN9/ZjdUKyjop4mf3Qdd+1TvvltAvM3m8= github.com/coreos/go-systemd v0.0.0-20190321100706-95778dfbb74e/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4= -github.com/coreos/pkg v0.0.0-20180928190104-399ea9e2e55f h1:lBNOc5arjvs8E5mO2tbpBpLoyyu8B6e44T7hJy6potg= github.com/coreos/pkg v0.0.0-20180928190104-399ea9e2e55f/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA= -github.com/cpuguy83/go-md2man/v2 v2.0.0 h1:EoUDS0afbrsXAZ9YQ9jdu/mZ2sXgT1/2yyNng4PGlyM= github.com/cpuguy83/go-md2man/v2 v2.0.0/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU= -github.com/creack/pty v1.1.9 h1:uDmaGzcdjhF4i/plgjmEsriH11Y0o7RKapEf/LDaM3w= github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/dgrijalva/jwt-go v3.2.0+incompatible h1:7qlOGliEKZXTDg6OTjfoBKDXWrumCAMpl/TFQ4/5kLM= github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ= github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f h1:lO4WD4F/rVNCu3HqELle0jiPLLBs70cWOduZpkS1E78= github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f/go.mod h1:cuUVRXasLTGF7a8hSLbxyZXjz+1KgoB3wDUb6vlszIc= -github.com/dgryski/go-sip13 v0.0.0-20181026042036-e10d5fee7954 h1:RMLoZVzv4GliuWafOuPuQDKSm1SJph7uCRnnS61JAn4= github.com/dgryski/go-sip13 v0.0.0-20181026042036-e10d5fee7954/go.mod h1:vAd38F8PWV+bWy6jNmig1y/TA+kYO4g3RSRF0IAv0no= -github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473 h1:4cmBvAEBNJaGARUEs3/suWRyfyBfhf7I60WBZq+bv2w= github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= -github.com/envoyproxy/protoc-gen-validate v0.1.0 h1:EQciDnbrYxy13PgWoY8AqoxGiPrpgBZ1R8UNe3ddc+A= github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= -github.com/fogleman/gg v1.2.1-0.20190220221249-0403632d5b90 h1:WXb3TSNmHp2vHoCroCIB1foO/yQ36swABL8aOVeDpgg= github.com/fogleman/gg v1.2.1-0.20190220221249-0403632d5b90/go.mod h1:R/bRT+9gY/C5z7JzPU0zXsXHKM4/ayA+zqcVNZzPa1k= github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= github.com/fsnotify/fsnotify v1.4.9 h1:hsms1Qyu0jgnwNXIxa+/V/PDsU6CfLf6CNO8H7IWoS4= github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ= -github.com/ghodss/yaml v1.0.0 h1:wQHKEahhL6wmXdzwWG11gIVCkOv05bNOh+Rxn0yngAk= github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= github.com/gin-contrib/sse v0.1.0 h1:Y/yl/+YNO8GZSjAhjMsSuLt29uWRFHdHYUb5lYOV9qE= github.com/gin-contrib/sse v0.1.0/go.mod h1:RHrZQHXnP2xjPF+u1gW/2HnVO7nvIa9PG3Gm+fLHvGI= @@ -86,13 +61,10 @@ github.com/gin-contrib/zap v0.0.1/go.mod h1:vJJndZ8f44gsTHQrDPIB4YOZzwOwiEIdE0mM github.com/gin-gonic/gin v1.5.0/go.mod h1:Nd6IXA8m5kNZdNEHMBd93KT+mdY3+bewLgRvmCsR2Do= github.com/gin-gonic/gin v1.6.3 h1:ahKqKTFpO5KTPHxWZjEdPScmYaGtLo8Y4DMHoEsnp14= github.com/gin-gonic/gin v1.6.3/go.mod h1:75u5sXoLsGZoRN5Sgbi1eraJ4GU3++wFwWzhwvtwp4M= -github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1 h1:QbL/5oDUmRBzO9/Z7Seo6zf912W/a6Sr4Eu0G/3Jho0= github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU= github.com/go-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= -github.com/go-kit/kit v0.9.0 h1:wDJmvq38kDhkVxi50ni9ykkdUr1PKgqKOoi01fa0Mdk= github.com/go-kit/kit v0.9.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= github.com/go-logfmt/logfmt v0.3.0/go.mod h1:Qt1PoO58o5twSAckw1HlFXLmHsOX5/0LbT9GBnD5lWE= -github.com/go-logfmt/logfmt v0.4.0 h1:MP4Eh7ZCb31lleYCFuwm0oe4/YGak+5l1vA2NOE80nA= github.com/go-logfmt/logfmt v0.4.0/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V4qmtdjCk= github.com/go-ozzo/ozzo-validation/v4 v4.3.0 h1:byhDUpfEwjsVQb1vBunvIjh2BHQ9ead57VkAEY4V+Es= github.com/go-ozzo/ozzo-validation/v4 v4.3.0/go.mod h1:2NKgrcHl3z6cJs+3Oo940FPRiTzuqKbvfrL2RxCj6Ew= @@ -109,20 +81,15 @@ github.com/go-playground/validator/v10 v10.3.0 h1:nZU+7q+yJoFmwvNgv/LnPUkwPal62+ github.com/go-playground/validator/v10 v10.3.0/go.mod h1:uOYAAleCW8F/7oMFd6aG0GOhaH6EGOAJShg8Id5JGkI= github.com/go-redis/redis/v8 v8.3.2 h1:1bJscgN2yGtKLW6MsTRosa2LHyeq94j0hnNAgRZzj/M= github.com/go-redis/redis/v8 v8.3.2/go.mod h1:jszGxBCez8QA1HWSmQxJO9Y82kNibbUmeYhKWrBejTU= -github.com/go-stack/stack v1.8.0 h1:5SgMzNM5HxrEjV0ww2lTmX6E2Izsfxas4+YHWRs3Lsk= github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= -github.com/gogo/protobuf v1.2.1 h1:/s5zKNz0uPFCZ5hddgPdo2TK2TVrUNMn0OOX8/aZMTE= github.com/gogo/protobuf v1.2.1/go.mod h1:hp+jE20tsWTFYpLwKvXlhS1hjn+gTNwPg2I6zVXpSg4= github.com/golang-jwt/jwt/v4 v4.0.0 h1:RAqyYixv1p7uEnocuy8P1nru5wprCh/MH2BIlW5z5/o= github.com/golang-jwt/jwt/v4 v4.0.0/go.mod h1:/xlHOz8bRuivTWchD4jCa+NbatV+wEUSzwAxVc6locg= -github.com/golang/freetype v0.0.0-20170609003504-e2365dfdc4a0 h1:DACJavvAHhabrF08vX0COfcOBJRhZ8lUbR+ZWIs0Y5g= github.com/golang/freetype v0.0.0-20170609003504-e2365dfdc4a0/go.mod h1:E/TSTwGwJL78qG/PmXZO1EjYhfJinVAhrmmHX6Z8B9k= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b h1:VKtxabqXZkF25pY9ekfRL6a582T4P37/31XEstQ5p58= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= -github.com/golang/groupcache v0.0.0-20190129154638-5b532d6fd5ef h1:veQD95Isof8w9/WXiA+pa3tz3fJXkt5B7QaRBrM62gk= github.com/golang/groupcache v0.0.0-20190129154638-5b532d6fd5ef/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= -github.com/golang/mock v1.1.1 h1:G5FRp8JnTd7RQH5kemVNlMeyXQAztQ3mOWV95KxsXH8= github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= @@ -138,7 +105,6 @@ github.com/golang/protobuf v1.4.2 h1:+Z5KGCizgyZCbGh1KZqA0fcLLkwbsjIzS4aV2v7wJX0 github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= github.com/gomodule/redigo v1.8.1 h1:Abmo0bI7Xf0IhdIPc7HZQzZcShdnmxeoVuDDtIQp8N8= github.com/gomodule/redigo v1.8.1/go.mod h1:P9dn9mFrCBvWhGE1wpxx6fgq7BAeLBk+UUUzlpkBYO0= -github.com/google/btree v1.0.0 h1:0udJVsspx3VBr5FwtLhQQtuAsVc79tTq0ocGIPAU6qo= github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= @@ -148,50 +114,33 @@ github.com/google/go-cmp v0.5.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/ github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.4 h1:L8R9j+yAqZuZjsqh/z+F1NCffTKKLShY6zXTItVIZ8M= github.com/google/go-cmp v0.5.4/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/gofuzz v1.0.0 h1:A8PeW59pxE9IoFRqBp37U+mSNaQoZ46F1f0f863XSXw= github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= -github.com/google/renameio v0.1.0 h1:GOZbcHa3HfsPKPlmyPyN2KEohoMXOhdMbHrvbpl2QaA= github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= github.com/google/uuid v1.1.2 h1:EVhdT+1Kseyi1/pUmXKaFxYsDNy9RQYkMWRH68J/W7Y= github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/gorilla/websocket v1.4.0 h1:WDFjx/TMzVgy9VdMMQi2K2Emtwi2QcUQsztZ/zLaH/Q= github.com/gorilla/websocket v1.4.0/go.mod h1:E7qHFY5m1UJ88s3WnNqhKjPHQ0heANvMoAMk2YaljkQ= -github.com/grpc-ecosystem/go-grpc-middleware v1.0.0 h1:Iju5GlWwrvL6UBg4zJJt3btmonfrMlCDdsejg4CZE7c= github.com/grpc-ecosystem/go-grpc-middleware v1.0.0/go.mod h1:FiyG127CGDf3tlThmgyCl78X/SZQqEOJBCDaAfeWzPs= -github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0 h1:Ovs26xHkKqVztRpIrF/92BcuyuQ/YW4NSIpoGtfXNho= github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0/go.mod h1:8NvIoxWQoOIhqOTXgfV/d3M/q6VIi02HzZEHgUlZvzk= -github.com/grpc-ecosystem/grpc-gateway v1.9.0 h1:bM6ZAFZmc/wPFaRDi0d5L7hGEZEx/2u+Tmr2evNHDiI= github.com/grpc-ecosystem/grpc-gateway v1.9.0/go.mod h1:vNeuVxBJEsws4ogUvrchl83t/GYV9WGTSLVdBhOQFDY= -github.com/hashicorp/hcl v1.0.0 h1:0Anlzjpi4vEasTeNFn2mLJgTSwt0+6sfsiTG8qcWGx4= github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ= -github.com/hpcloud/tail v1.0.0 h1:nfCOvKYfkgYP8hkirhJocXT2+zOD8yUNjXaWfTlyFKI= github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= github.com/inconshreveable/mousetrap v1.0.0 h1:Z8tu5sraLXCXIcARxBp/8cbvlwVa7Z1NHg9XEKhtSvM= github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8= -github.com/jonboulle/clockwork v0.1.0 h1:VKV+ZcuP6l3yW9doeqz6ziZGgcynBVQO+obU0+0hcPo= github.com/jonboulle/clockwork v0.1.0/go.mod h1:Ii8DK3G1RaLaWxj9trq07+26W01tbo22gdxWY5EU2bo= github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= github.com/json-iterator/go v1.1.7/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= github.com/json-iterator/go v1.1.9/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= github.com/json-iterator/go v1.1.10 h1:Kz6Cvnvv2wGdaG/V8yMvfkmNiXq9Ya2KUv4rouJJr68= github.com/json-iterator/go v1.1.10/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= -github.com/julienschmidt/httprouter v1.2.0 h1:TDTW5Yz1mjftljbcKqRcrYhd4XeOoI98t+9HbQbYf7g= github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w= -github.com/jung-kurt/gofpdf v1.0.3-0.20190309125859-24315acbbda5 h1:PJr+ZMXIecYc1Ey2zucXdR73SMBtgjPgwa31099IMv0= github.com/jung-kurt/gofpdf v1.0.3-0.20190309125859-24315acbbda5/go.mod h1:7Id9E/uU8ce6rXgefFLlgrJj/GYY22cpxn+r32jIOes= github.com/kelseyhightower/envconfig v1.4.0 h1:Im6hONhd3pLkfDFsbRgu68RDNkGF1r3dvMUtDTo2cv8= github.com/kelseyhightower/envconfig v1.4.0/go.mod h1:cccZRl6mQpaq41TPp5QxidR+Sa3axMbJDNb//FQX6Gg= -github.com/kisielk/errcheck v1.1.0 h1:ZqfnKyx9KGpRcW04j5nnPDgRgoXUeLh2YFBeFzphcA0= github.com/kisielk/errcheck v1.1.0/go.mod h1:EZBBE59ingxPouuu3KfxchcWSUPOHkagtvWXihfKN4Q= -github.com/kisielk/gotool v1.0.0 h1:AV2c/EiW3KqPNT9ZKl07ehoAGi4C5/01Cfbblndcapg= github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= -github.com/konsorten/go-windows-terminal-sequences v1.0.1 h1:mweAR1A6xJ3oS2pRaGiHgQ4OO8tzTaLawm8vnODuwDk= github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= -github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515 h1:T+h1c/A9Gawja4Y9mFVWj2vyii2bbUNDw3kt9VxK2EY= github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc= -github.com/kr/pretty v0.1.0 h1:L/CwN0zerZDmRFUapSPitk6f+Q3+0za1rQkzVuMiMFI= github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= -github.com/kr/pty v1.1.1 h1:VkoXIwSboBpnk99O/KFauAEILuNHv5DVFKZMBN/gUgw= github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= @@ -199,16 +148,13 @@ github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= github.com/leodido/go-urn v1.1.0/go.mod h1:+cyI34gQWZcE1eQU7NVgKkkzdXDQHr1dBMtdAPozLkw= github.com/leodido/go-urn v1.2.0 h1:hpXL4XnriNwQ/ABnpepYM/1vCLWNDfUNts8dX3xTG6Y= github.com/leodido/go-urn v1.2.0/go.mod h1:+8+nEpDfqqsY+g338gtMEUOtuK+4dEMhiQEgxpxOKII= -github.com/magiconair/properties v1.8.0 h1:LLgXmsheXeRoUOBOjtwPQCWIYqM/LU1ayDtDePerRcY= github.com/magiconair/properties v1.8.0/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= github.com/mattn/go-isatty v0.0.9/go.mod h1:YNRxwqDuOph6SZLI9vUUz6OYw3QyUt7WiY2yME+cCiQ= github.com/mattn/go-isatty v0.0.12 h1:wuysRhFDzyxgEmMf5xjvJ2M9dZoWAXNNr5LSBS7uHXY= github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU= github.com/matttproud/golang_protobuf_extensions v1.0.1 h1:4hp9jkHxhMHkqkrB3Ix0jegS5sx/RkqARlsWZ6pIwiU= github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= -github.com/mitchellh/go-homedir v1.1.0 h1:lukF9ziXFxDFPkA1vsr5zpc1XuPDn/wFntq5mG+4E0Y= github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= -github.com/mitchellh/mapstructure v1.1.2 h1:fmNYVwqnSfB9mZU6OS2O6GsXM+wcskZDuKQzvN1EDeE= github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w8PVh93nsPXa1VrQ6jlwL5oN8l14QlcNfg= @@ -216,13 +162,11 @@ github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJ github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= github.com/modern-go/reflect2 v1.0.1 h1:9f412s+6RmYXLWZSEzVVgPGK7C2PphHj5RJrvfx9AWI= github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= -github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223 h1:F9x/1yl3T2AeKLr2AMdilSD8+f9bvMnNN8VS5iDtovc= github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e h1:fD57ERR4JtEqsWbfPhv4DMiApHyliiK5xCTNVSPiaAs= github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno= github.com/nxadm/tail v1.4.4 h1:DQuhQpB1tVlglWS2hLQ5OV6B5r8aGxSrPc5Qo6uTN78= github.com/nxadm/tail v1.4.4/go.mod h1:kenIhsEOeOJmVchQTgglprH7qJGnHDVpk1VPCcaMI8A= -github.com/oklog/ulid v1.3.1 h1:EGfNDEx6MqHz8B3uNV6QAib1UR2Lm97sHi3ocA6ESJ4= github.com/oklog/ulid v1.3.1/go.mod h1:CirwcVhetQ6Lv90oh/F+FBtV6XMibvdAFo93nm5qn4U= github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.12.1/go.mod h1:zj2OWP4+oCPe1qIXoGWkgMRwljMUYCdkwsT2108oapk= @@ -236,7 +180,6 @@ github.com/opentracing/opentracing-go v1.2.0 h1:uEJPy/1a5RIPAJ0Ov+OIO8OxWu77jEv+ github.com/opentracing/opentracing-go v1.2.0/go.mod h1:GxEUsuufX4nBwe+T+Wl9TAgYrxe9dPLANfrWvHYVTgc= github.com/patrickmn/go-cache v2.1.0+incompatible h1:HRMgzkcYKYpi3C8ajMPV8OFXaaRUnok+kx1WdO15EQc= github.com/patrickmn/go-cache v2.1.0+incompatible/go.mod h1:3Qf8kWWT7OJRJbdiICTKqZju1ZixQ/KpMGzzAfe6+WQ= -github.com/pelletier/go-toml v1.2.0 h1:T5zMGML61Wp+FlcbWjRDT7yAxhJNAiPPLOFECq181zc= github.com/pelletier/go-toml v1.2.0/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/94hg7ilaic= github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.8.1 h1:iURUrRGxPUNPdy5/HRSm+Yj6okJ6UtLINN0Q9M4+h3I= @@ -263,38 +206,24 @@ github.com/prometheus/procfs v0.0.0-20190507164030-5867b95ac084/go.mod h1:TjEm7z github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= github.com/prometheus/procfs v0.1.3 h1:F0+tqvhOksq22sc6iCHF5WGlWjdwj92p0udFh1VFBS8= github.com/prometheus/procfs v0.1.3/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU= -github.com/prometheus/tsdb v0.7.1 h1:YZcsG11NqnK4czYLrWd9mpEuAJIHVQLwdrleYfszMAA= github.com/prometheus/tsdb v0.7.1/go.mod h1:qhTCs0VvXwvX/y3TZrWD7rabWM+ijKTux40TwIPHuXU= -github.com/rogpeppe/fastuuid v0.0.0-20150106093220-6724a57986af h1:gu+uRPtBe88sKxUCEXRoeCvVG90TJmwhiqRpvdhQFng= github.com/rogpeppe/fastuuid v0.0.0-20150106093220-6724a57986af/go.mod h1:XWv6SoW27p1b0cqNHllgS5HIMJraePCO15w5zCzIWYg= -github.com/rogpeppe/go-internal v1.3.0 h1:RR9dF3JtopPvtkroDZuVD7qquD0bnHlKSqaQhgwt8yk= github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= -github.com/russross/blackfriday/v2 v2.0.1 h1:lPqVAte+HuHNfhJ/0LC98ESWRz8afy9tM/0RK8m9o+Q= github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= -github.com/shurcooL/sanitized_anchor_name v1.0.0 h1:PdmoCO6wvbs+7yrJyMORt4/BmY5IYyJwS/kOiWx8mHo= github.com/shurcooL/sanitized_anchor_name v1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc= github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= -github.com/sirupsen/logrus v1.4.2 h1:SPIRibHv4MatM3XXNO2BJeFLZwZ2LvZgfQ5+UNI2im4= github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE= -github.com/soheilhy/cmux v0.1.4 h1:0HKaf1o97UwFjHH9o5XsHUOF+tqmdA7KEzXLpiyaw0E= github.com/soheilhy/cmux v0.1.4/go.mod h1:IM3LyeVVIOuxMH7sFAkER9+bJ4dT7Ms6E4xg4kGIyLM= -github.com/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72 h1:qLC7fQah7D6K1B0ujays3HV9gkFtllcxhzImRR7ArPQ= github.com/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA= -github.com/speps/go-hashids v2.0.0+incompatible h1:kSfxGfESueJKTx0mpER9Y/1XHl+FVQjtCqRyYcviFbw= -github.com/speps/go-hashids v2.0.0+incompatible/go.mod h1:P7hqPzMdnZOfyIk+xrlG1QaSMw+gCBdHKsBDnhpaZvc= github.com/speps/go-hashids/v2 v2.0.1 h1:ViWOEqWES/pdOSq+C1SLVa8/Tnsd52XC34RY7lt7m4g= github.com/speps/go-hashids/v2 v2.0.1/go.mod h1:47LKunwvDZki/uRVD6NImtyk712yFzIs3UF3KlHohGw= -github.com/spf13/afero v1.1.2 h1:m8/z1t7/fwjysjQRYbP0RD+bUIF/8tJwPdEZsI83ACI= github.com/spf13/afero v1.1.2/go.mod h1:j4pytiNVoe2o6bmDsKpLACNPDBIoEAkihy7loJ1B0CQ= -github.com/spf13/cast v1.3.0 h1:oget//CVOEoFewqQxwr0Ej5yjygnqGkvggSE/gB35Q8= github.com/spf13/cast v1.3.0/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE= github.com/spf13/cobra v1.0.0 h1:6m/oheQuQ13N9ks4hubMG6BnvwOeaJrqSPLahSnczz8= github.com/spf13/cobra v1.0.0/go.mod h1:/6GTrnGXV9HjY+aR4k0oJ5tcvakLuG6EuKReYlHNrgE= -github.com/spf13/jwalterweatherman v1.0.0 h1:XHEdyB+EcvlqZamSM4ZOMGlc93t6AcsBEu9Gc1vn7yk= github.com/spf13/jwalterweatherman v1.0.0/go.mod h1:cQK4TGJAtQXfYWX+Ddv3mKDzgVb68N+wFjFa4jdeBTo= github.com/spf13/pflag v1.0.3 h1:zPAT6CGy6wXeQ7NtTnaTerfKOsV6V6F8agHXFiazDkg= github.com/spf13/pflag v1.0.3/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= -github.com/spf13/viper v1.4.0 h1:yXHLWeravcrgGyFSyCgdYpXQ9dR9c/WED3pg1RhxqEU= github.com/spf13/viper v1.4.0/go.mod h1:PTJ7Z/lr49W6bUbkmS1V3by4uWynFiR9p7+dSq/yZzE= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.1.1 h1:2vfRuCMp5sSVIDSqO8oNnWJq7mPa6KVP3iPIwFBuy8A= @@ -306,7 +235,6 @@ github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5 github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.7.0 h1:nwc3DEeHmmLAfoZucVR881uASk0Mfjw8xYJ99tb5CcY= github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= -github.com/tmc/grpc-websocket-proxy v0.0.0-20190109142713-0ad062ec5ee5 h1:LnC5Kc/wtumK+WB441p7ynQJzVuNRJiqddSIE3IlSEQ= github.com/tmc/grpc-websocket-proxy v0.0.0-20190109142713-0ad062ec5ee5/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U= github.com/uber/jaeger-client-go v2.25.0+incompatible h1:IxcNZ7WRY1Y3G4poYlx24szfsn/3LvK9QHCq9oQw8+U= github.com/uber/jaeger-client-go v2.25.0+incompatible/go.mod h1:WVhlPFC8FDjOFMMWRy2pZqQJSXxYSwNYOkTr/Z6d3Kk= @@ -317,25 +245,12 @@ github.com/ugorji/go v1.1.7 h1:/68gy2h+1mWMrwZFeD1kQialdSzAb432dtpeJ42ovdo= github.com/ugorji/go v1.1.7/go.mod h1:kZn38zHttfInRq0xu/PH0az30d+z6vm202qpg1oXVMw= github.com/ugorji/go/codec v1.1.7 h1:2SvQaVZ1ouYrrKKwoSk2pzd4A9evlKJb9oTL+OaLUSs= github.com/ugorji/go/codec v1.1.7/go.mod h1:Ax+UKWsSmolVDwsd+7N3ZtXu+yMGCf907BLYF3GoBXY= -github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2 h1:eY9dn8+vbi4tKz5Qo6v2eYzo7kUS51QINcR5jNpbZS8= github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2/go.mod h1:UETIi67q53MR2AWcXfiuqkDkRtnGDLqkBTpCHuJHxtU= -github.com/xordataexchange/crypt v0.0.3-0.20170626215501-b2862e3d0a77 h1:ESFSdwYZvkeru3RtdrYueztKhOBCSAAzS4Gf+k0tEow= github.com/xordataexchange/crypt v0.0.3-0.20170626215501-b2862e3d0a77/go.mod h1:aYKd//L2LvnjZzWKhF00oedf4jCCReLcmhLdhm1A27Q= github.com/yuin/gopher-lua v0.0.0-20191220021717-ab39c6098bdb h1:ZkM6LRnq40pR1Ox0hTHlnpkcOTuFIDQpZ1IN8rKKhX0= github.com/yuin/gopher-lua v0.0.0-20191220021717-ab39c6098bdb/go.mod h1:gqRgreBUhTSL0GeU64rtZ3Uq3wtjOa/TB2YfrtkCbVQ= -gitlab.snapp.ir/dispatching/snappids/v2 v2.4.0 h1:8D/t3baH3OCNXoAtWFb23p9jh3kyJM+wdRkmkc5/1RE= -gitlab.snapp.ir/dispatching/snappids/v2 v2.4.0/go.mod h1:p9EBmjqBXuImZ5NeoN3SXV8kZ1/6QYAeUu0e7oQkGQc= -gitlab.snapp.ir/dispatching/snappids/v2 v2.5.0 h1:z3s9L1kcNBGpmTI//BTElJ6EAaq1lOH8tOxU2urgpdI= -gitlab.snapp.ir/dispatching/snappids/v2 v2.5.0/go.mod h1:p9EBmjqBXuImZ5NeoN3SXV8kZ1/6QYAeUu0e7oQkGQc= -gitlab.snapp.ir/dispatching/snappids/v2 v2.5.1 h1:jK9/w2o7+5qlQWwss7MqZfH5XGL9mJDfE/q+GXlPluM= -gitlab.snapp.ir/dispatching/snappids/v2 v2.5.1/go.mod h1:p9EBmjqBXuImZ5NeoN3SXV8kZ1/6QYAeUu0e7oQkGQc= -gitlab.snapp.ir/dispatching/snappids/v2 v2.5.2 h1:P+PNVwppAee0XzYP9jXPevCyMJO9ESxH+XdoA2IztJY= -gitlab.snapp.ir/dispatching/snappids/v2 v2.5.2/go.mod h1:p9EBmjqBXuImZ5NeoN3SXV8kZ1/6QYAeUu0e7oQkGQc= -gitlab.snapp.ir/dispatching/snappids/v2 v2.6.0-beta h1:ztJ35NxA0desQqH8ZRPqQSL/iPuvqqO2HV6XWjepKGA= -gitlab.snapp.ir/dispatching/snappids/v2 v2.6.0-beta/go.mod h1:U7lxAuqPifdXkUNcCXhtk9+6HFAyw5qy8LrF1DQDMuQ= gitlab.snapp.ir/dispatching/snappids/v2 v2.6.1 h1:G782ZLXcCTI5Kby/s3YPur9S6cJxtLds1NVemWrgzi8= gitlab.snapp.ir/dispatching/snappids/v2 v2.6.1/go.mod h1:U7lxAuqPifdXkUNcCXhtk9+6HFAyw5qy8LrF1DQDMuQ= -go.etcd.io/bbolt v1.3.2 h1:Z/90sZLPOeCy2PwprqkFa25PdkusRzaj9P8zm/KNyvk= go.etcd.io/bbolt v1.3.2/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU= go.opentelemetry.io/otel v0.13.0 h1:2isEnyzjjJZq6r2EKMsFj4TxiQiexsM04AVhwbR/oBA= go.opentelemetry.io/otel v0.13.0/go.mod h1:dlSNewoRYikTkotEnxdmuBHgzT+k/idJSfDv/FxEnOY= @@ -365,11 +280,9 @@ golang.org/x/exp v0.0.0-20180807140117-3d87b88a115f/go.mod h1:CJ0aWSM057203Lf6IL golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190125153040-c74c464bbbf2/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= -golang.org/x/exp v0.0.0-20191030013958-a1ab85dbe136 h1:A1gGSx58LAGVHUUsOf7IiR0u8Xb6W51gRwfDBhkdcaw= golang.org/x/exp v0.0.0-20191030013958-a1ab85dbe136/go.mod h1:JXzH8nQsPlswgeRAPE3MuO9GYsAcnJvJ4vnMwN/5qkY= golang.org/x/image v0.0.0-20180708004352-c73c2afc3b81/go.mod h1:ux5Hcp/YLpHSI86hEcLt0YII63i6oz57MZXIpbrjZUs= golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js= -golang.org/x/image v0.0.0-20190802002840-cff245a6509b h1:+qEpEAPhDZ1o0x3tHzZTQDArnOixOzGD9HUJfcg0mb4= golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= 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= @@ -377,10 +290,8 @@ golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHl golang.org/x/lint v0.0.0-20190930215403-16217165b5de/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= golang.org/x/lint v0.0.0-20191125180803-fdd1cda4f05f h1:J5lckAjkw6qYlOZNj90mLYNTEKDvWeuc1yieZ8qUzUE= golang.org/x/lint v0.0.0-20191125180803-fdd1cda4f05f/go.mod h1:5qLYkcX4OjUUV8bRuDixDT3tpyyb+LUpUlRWLxfhWrs= -golang.org/x/mobile v0.0.0-20190719004257-d2bd2a29d028 h1:4+4C/Iv2U4fMZBiMCc98MG1In4gJY5YRhtpDNeDeHWs= golang.org/x/mobile v0.0.0-20190719004257-d2bd2a29d028/go.mod h1:E/iHnbuqvinMTCcRqshq8CkpyQDoeVncDDYHnLhea+o= golang.org/x/mod v0.0.0-20190513183733-4bf6d317e70e/go.mod h1:mXi4GBBbnImb6dmsKGUJ2LatrhH/nqhxcFungHvyanc= -golang.org/x/mod v0.1.0 h1:sfUMP1Gu8qASkorDVjnMuvgJzwFbTZSeXFiGBYAVdl4= golang.org/x/mod v0.1.0/go.mod h1:0QHyrYULN0/3qlju5TqG8bIK38QM8yzMo5ekMj3DlcY= golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= @@ -396,13 +307,11 @@ golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLL golang.org/x/net v0.0.0-20200520004742-59133d7f0dd7/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= golang.org/x/net v0.0.0-20201006153459-a7d1128ccaa0 h1:wBouT66WTYFXdxfVdz9sVWARVd/2vfGcmI45D2gj45M= golang.org/x/net v0.0.0-20201006153459-a7d1128ccaa0/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= -golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be h1:vEDujvNQGv4jgYKudGeI/+DAX4Jffq6hpD55MmoEvKs= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e h1:vcxGaoTs7kV8m5Np9uUNQin4BrLOthgV7252N8V+FwY= golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= @@ -429,7 +338,6 @@ golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= golang.org/x/text v0.3.3 h1:cokOdA+Jmi5PJGXLlLllQSgYigAEfHXJAERHVMaCc2k= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/time v0.0.0-20190308202827-9d24e82272b4 h1:SvFZT6jyqRaOeXpc5h/JSfZenJ2O330aBsf7JfSUXmQ= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/tools v0.0.0-20180221164845-07fd8470d635/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20180525024113-a5b4c53f6e8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= @@ -450,14 +358,10 @@ golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8T golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 h1:go1bK/D/BFZV2I8cIQd1NKEZ+0owSTG1fDTci4IqFcE= golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= gonum.org/v1/gonum v0.0.0-20180816165407-929014505bf4/go.mod h1:Y+Yx5eoAFn32cQvJDxZx5Dpnq+c3wtXuadVZAcxbbBo= -gonum.org/v1/gonum v0.8.2 h1:CCXrcPKiGGotvnN6jfUsKk4rRqm7q09/YbKb5xCEvtM= gonum.org/v1/gonum v0.8.2/go.mod h1:oe/vMfY3deqTw+1EZJhuvEW2iwGF1bW9wwu7XCu0+v0= -gonum.org/v1/netlib v0.0.0-20190313105609-8cb42192e0e0 h1:OE9mWmgKkjJyEmDAAtGMPjXu+YNeGvK9VTSHY6+Qihc= gonum.org/v1/netlib v0.0.0-20190313105609-8cb42192e0e0/go.mod h1:wa6Ws7BG/ESfp6dHfk7C6KdzKA7wR7u/rKwOGE66zvw= -gonum.org/v1/plot v0.0.0-20190515093506-e2840ee46a6b h1:Qh4dB5D/WpoUUp3lSod7qgoyEHbDGPUWjIbnqdqqe1k= gonum.org/v1/plot v0.0.0-20190515093506-e2840ee46a6b/go.mod h1:Wt8AAjI+ypCyYX3nZBvf6cAIx93T+c/OS2HFAYskSZc= google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= -google.golang.org/appengine v1.4.0 h1:/wp5JvzpHIxhs/dumFmF7BXTf3Z+dd4uXta4kVyO508= 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= @@ -478,22 +382,16 @@ google.golang.org/protobuf v1.23.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2 google.golang.org/protobuf v1.23.1-0.20200526195155-81db48ad09cc/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= google.golang.org/protobuf v1.25.0 h1:Ejskq+SyPohKW+1uil0JJMtmHCgJPJ/qWTxr8qp+R4c= google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c= -gopkg.in/alecthomas/kingpin.v2 v2.2.6 h1:jMFz6MfLP0/4fUyZle81rXUoxOBFi19VUFKVDOQfozc= gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f h1:BLraFXnmrev5lT+xlilqcH8XK9/i0At2xKjWk4p6zsU= gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/errgo.v2 v2.1.0 h1:0vLT13EuvQ0hNvakwLuFZ/jYrLp5F3kcWHXdRggjCE8= gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= -gopkg.in/fsnotify.v1 v1.4.7 h1:xOHLXZwVvI9hhs+cLKq5+I5onOuwQLhQwiu63xxlHs4= gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys= -gopkg.in/go-playground/assert.v1 v1.2.1 h1:xoYuJVE7KT85PYWrN730RguIQO0ePzVRfFMXadIrXTM= gopkg.in/go-playground/assert.v1 v1.2.1/go.mod h1:9RXL0bg/zibRAgZUYszZSwO/z8Y/a8bDuhia5mkpMnE= -gopkg.in/go-playground/validator.v9 v9.29.1 h1:SvGtYmN60a5CVKTOzMSyfzWDeZRxRuGvRQyEAKbw1xc= gopkg.in/go-playground/validator.v9 v9.29.1/go.mod h1:+c9/zcJMFNgbLvly1L1V+PpxWdVbfP1avr/N00E2vyQ= -gopkg.in/resty.v1 v1.12.0 h1:CuXP0Pjfw9rOuY6EP+UvtNvt5DSqHpIxILZKT/quCZI= gopkg.in/resty.v1 v1.12.0/go.mod h1:mDo4pnntr5jdWRML875a/NmxYqAlA73dVijT2AXvQQo= gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 h1:uRGJdciOHaEIrze2W8Q3AKkepLTh2hOroT7a+7czfdQ= gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw= @@ -511,5 +409,4 @@ honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWh honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.1-2019.2.3 h1:3JgtbtFHMiCmsznwGVTUWbgGov+pVqnlf1dEJTNAXeM= honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg= -rsc.io/pdf v0.1.1 h1:k1MczvYDUvJBe93bYd7wrZLLUEcLZAuF824/I4e5Xr4= rsc.io/pdf v0.1.1/go.mod h1:n8OzWcQ6Sp37PL01nO98y4iUCRdTGarVfzxY20ICaU4= From 2ea561a73031e310f5fd7e3548096333e940f4e3 Mon Sep 17 00:00:00 2001 From: Parham Alvani <1995parham@tuta.io> Date: Wed, 25 Aug 2021 00:05:05 +0430 Subject: [PATCH 008/660] feat: Switch back to local images --- .gitlab/ci/templates/compile.giltab-ci.yml | 2 +- .gitlab/ci/templates/test.giltab-ci.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.gitlab/ci/templates/compile.giltab-ci.yml b/.gitlab/ci/templates/compile.giltab-ci.yml index 47559c5d..2996e8d6 100644 --- a/.gitlab/ci/templates/compile.giltab-ci.yml +++ b/.gitlab/ci/templates/compile.giltab-ci.yml @@ -1,6 +1,6 @@ --- .go_mod_config: &go_mod - image: golang:1.17-alpine + image: registry.snapp.tech/docker/golang:1.17-alpine3.14 cache: policy: pull paths: diff --git a/.gitlab/ci/templates/test.giltab-ci.yml b/.gitlab/ci/templates/test.giltab-ci.yml index adf83d19..3cf93ad5 100644 --- a/.gitlab/ci/templates/test.giltab-ci.yml +++ b/.gitlab/ci/templates/test.giltab-ci.yml @@ -1,6 +1,6 @@ --- .go_mod_config: &go_mod - image: golang:1.17-alpine + image: registry.snapp.tech/docker/golang:1.17-alpine3.14 cache: policy: pull paths: From e0a8de9166d8b8ae1e406a964d923241ca06e07e Mon Sep 17 00:00:00 2001 From: Parham Alvani Date: Wed, 25 Aug 2021 06:06:20 +0430 Subject: [PATCH 009/660] feat: Add Release for OKD4 Staging --- .gitlab/ci/templates/release.giltab-ci.yml | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/.gitlab/ci/templates/release.giltab-ci.yml b/.gitlab/ci/templates/release.giltab-ci.yml index 17bc823f..66c6f482 100644 --- a/.gitlab/ci/templates/release.giltab-ci.yml +++ b/.gitlab/ci/templates/release.giltab-ci.yml @@ -16,6 +16,23 @@ release:staging: variables: - $UPDATE_ENVIRONMENT_VARIABLE +release:staging:okd4:teh-1: + extends: .easy_ci:release:docker + variables: + OKD4_TEH1_REGISTRY: "image-registry.apps.private.okd4.teh-1.snappcloud.io" + RELEASE_CONTAINER_REGISTRY_ADDRESS: "$OKD4_TEH1_REGISTRY" + RELEASE_CONTAINER_REGISTRY_IMAGE: "$OKD4_TEH1_REGISTRY/realtime-staging/$CI_PROJECT_NAME" + RELEASE_CONTAINER_REGISTRY_USERNAME: "gitlab-ci" + RELEASE_CONTAINER_REGISTRY_PASSWORD: ${OKD4_TEH1_REALTIME_STAGING_TOKEN} + dependencies: + - build + only: + - tags + - branches + except: + variables: + - $UPDATE_ENVIRONMENT_VARIABLE + release:mozart: extends: .easy_ci:release:docker variables: From cdf5cb44abcf4351ea6a64b400e14cb1adf14d27 Mon Sep 17 00:00:00 2001 From: Parham Alvani Date: Wed, 25 Aug 2021 13:30:42 +0430 Subject: [PATCH 010/660] feat: Add Comment for better describe the workflow --- internal/web/rest/api/superuser.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/internal/web/rest/api/superuser.go b/internal/web/rest/api/superuser.go index eed3b0e0..66d2fe3d 100644 --- a/internal/web/rest/api/superuser.go +++ b/internal/web/rest/api/superuser.go @@ -14,6 +14,8 @@ import ( // Superuser is the handler responsible for authentication a superuser. // it uses the exact same request payload as authentication endpoint. +// emq calls the superuser endpoint after success auth based on: +// https://github.com/emqx/emqx-auth-http/blob/master/src/emqx_auth_http.erl#L45. func Superuser(ctx *gin.Context) { authSpan := app.GetInstance().Tracer.StartSpan("api.rest.auth") defer authSpan.Finish() From a5bd7ec2b535f3644c21601b0a87d62c611617a2 Mon Sep 17 00:00:00 2001 From: Parham Alvani <1995parham@tuta.io> Date: Wed, 25 Aug 2021 23:00:03 +0430 Subject: [PATCH 011/660] chore: Remove Superuser Endpoint --- internal/authenticator/authenticator.go | 16 --- internal/authenticator/authenticator_test.go | 16 ++- internal/constants.go | 1 - internal/web/rest/api/api.go | 1 - internal/web/rest/api/superuser.go | 124 ------------------- 5 files changed, 10 insertions(+), 148 deletions(-) delete mode 100644 internal/web/rest/api/superuser.go diff --git a/internal/authenticator/authenticator.go b/internal/authenticator/authenticator.go index d9410f5f..58f2b7df 100644 --- a/internal/authenticator/authenticator.go +++ b/internal/authenticator/authenticator.go @@ -66,22 +66,6 @@ type Authenticator struct { HashIDSManager *snappids.HashIDSManager CompareHashAndPassword func([]byte, []byte) error Company string - JWTParser jwt.Parser -} - -// Issuer returns the iss field of the given token without validating the token. -func (a Authenticator) Issuer(ctx context.Context, tokenString string) (user.Issuer, error) { - var claims jwt.MapClaims - - if _, _, err := a.JWTParser.ParseUnverified(tokenString, &claims); err != nil { - return user.Issuer(""), fmt.Errorf("cannot parse the token claims %w", err) - } - - if claims["iss"] == nil { - return user.Issuer(""), ErrIssNotFound - } - - return user.Issuer(fmt.Sprintf("%v", claims["iss"])), nil } // Auth check user authentication by checking the user's token diff --git a/internal/authenticator/authenticator_test.go b/internal/authenticator/authenticator_test.go index b10fa6a8..4cc3e3ed 100644 --- a/internal/authenticator/authenticator_test.go +++ b/internal/authenticator/authenticator_test.go @@ -53,35 +53,44 @@ func TestAuthenticator_Auth(t *testing.T) { if err != nil { t.Fatal(err) } + passengerToken, err := getSampleToken(user.Passenger, false) if err != nil { t.Fatal(err) } + thirdPartyToken, err := getSampleToken(user.ThirdParty, false) if err != nil { t.Fatal(err) } + superuserToken, err := getSampleToken(user.ThirdParty, true) if err != nil { t.Fatal(err) } + pkey0, err := getPublicKey(user.Driver) if err != nil { t.Fatal(err) } + pkey1, err := getPublicKey(user.Passenger) if err != nil { t.Fatal(err) } + pkey100, err := getPublicKey(user.ThirdParty) if err != nil { t.Fatal(err) } + key100, err := getPrivateKey(user.ThirdParty) if err != nil { t.Fatal(err) } + passwordChecker := memoize.MemoizedCompareHashAndPassword() + authenticator := Authenticator{ PrivateKeys: map[user.Issuer]*rsa.PrivateKey{ user.ThirdParty: key100, @@ -94,6 +103,7 @@ func TestAuthenticator_Auth(t *testing.T) { ModelHandler: MockModelHandler{}, CompareHashAndPassword: passwordChecker, } + t.Run("testing driver token auth", func(t *testing.T) { ok, err := authenticator.Auth(context.Background(), driverToken) assert.NoError(t, err) @@ -123,12 +133,6 @@ func TestAuthenticator_Auth(t *testing.T) { assert.Error(t, err) assert.False(t, ok) }) - - t.Run("testing issuer for third party token", func(t *testing.T) { - iss, err := authenticator.Issuer(context.Background(), thirdPartyToken) - assert.NoError(t, err) - assert.Equal(t, user.ThirdParty, iss) - }) } func TestAuthenticator_Token(t *testing.T) { diff --git a/internal/constants.go b/internal/constants.go index ad915a80..5515900e 100644 --- a/internal/constants.go +++ b/internal/constants.go @@ -4,7 +4,6 @@ const ( Soteria = "soteria" Acl = "acl" Auth = "auth" - Superuser = "superuser" Token = "token" Success = "success" Failure = "failure" diff --git a/internal/web/rest/api/api.go b/internal/web/rest/api/api.go index e9b83c5a..9641cf73 100644 --- a/internal/web/rest/api/api.go +++ b/internal/web/rest/api/api.go @@ -42,7 +42,6 @@ func setupRouter(mode string) *gin.Engine { router.POST("/auth", Auth) router.POST("/acl", ACL) - router.POST("/superuser", Superuser) router.POST("/token", Token) router.GET("/metrics", gin.WrapH(promhttp.Handler())) diff --git a/internal/web/rest/api/superuser.go b/internal/web/rest/api/superuser.go deleted file mode 100644 index 66d2fe3d..00000000 --- a/internal/web/rest/api/superuser.go +++ /dev/null @@ -1,124 +0,0 @@ -package api - -import ( - "net/http" - "time" - - "github.com/gin-gonic/gin" - "github.com/opentracing/opentracing-go" - "gitlab.snapp.ir/dispatching/soteria/v3/internal" - "gitlab.snapp.ir/dispatching/soteria/v3/internal/app" - "gitlab.snapp.ir/dispatching/soteria/v3/pkg/user" - "go.uber.org/zap" -) - -// Superuser is the handler responsible for authentication a superuser. -// it uses the exact same request payload as authentication endpoint. -// emq calls the superuser endpoint after success auth based on: -// https://github.com/emqx/emqx-auth-http/blob/master/src/emqx_auth_http.erl#L45. -func Superuser(ctx *gin.Context) { - authSpan := app.GetInstance().Tracer.StartSpan("api.rest.auth") - defer authSpan.Finish() - - s := time.Now() - - var request authRequest - - if err := ctx.ShouldBind(&request); err != nil { - zap.L(). - Warn("bad request", - zap.Error(err), - ) - - app.GetInstance().Metrics.ObserveStatusCode(internal.HttpApi, internal.Soteria, internal.Superuser, http.StatusBadRequest) - app.GetInstance().Metrics.ObserveStatus(internal.HttpApi, internal.Soteria, internal.Superuser, internal.Failure, "bad request") - app.GetInstance().Metrics.ObserveResponseTime(internal.HttpApi, internal.Soteria, internal.Superuser, float64(time.Since(s).Nanoseconds())) - ctx.String(http.StatusBadRequest, "bad request") - return - } - - tokenString := request.Token - - if len(tokenString) == 0 { - tokenString = request.Username - } - - if len(tokenString) == 0 { - tokenString = request.Password - } - - authCheckSpan := app.GetInstance().Tracer.StartSpan("auth check", opentracing.ChildOf(authSpan.Context())) - defer authCheckSpan.Finish() - - iss, err := app.GetInstance().Authenticator.Issuer(ctx, tokenString) - if err != nil { - authCheckSpan.SetTag("success", false) - authCheckSpan.SetTag("error", err.Error()) - - zap.L(). - Error("superuser request is not authorized", - zap.Error(err), - zap.String("token", request.Token), - zap.String("username", request.Password), - zap.String("password", request.Username), - ) - - app.GetInstance().Metrics.ObserveStatusCode(internal.HttpApi, internal.Soteria, internal.Superuser, http.StatusUnauthorized) - app.GetInstance().Metrics.ObserveStatus(internal.HttpApi, internal.Soteria, internal.Superuser, internal.Failure, "request is not authorized") - app.GetInstance().Metrics.ObserveResponseTime(internal.HttpApi, internal.Soteria, internal.Superuser, float64(time.Since(s).Nanoseconds())) - ctx.String(http.StatusUnauthorized, "request is not authorized") - - return - } - - if iss != user.ThirdParty { - zap.L(). - Error("superuser request is not authorized", - zap.String("token", request.Token), - zap.String("username", request.Password), - zap.String("password", request.Username), - ) - - app.GetInstance().Metrics.ObserveStatusCode(internal.HttpApi, internal.Soteria, internal.Superuser, http.StatusUnauthorized) - app.GetInstance().Metrics.ObserveStatus(internal.HttpApi, internal.Soteria, internal.Superuser, internal.Failure, "request is not authorized") - app.GetInstance().Metrics.ObserveResponseTime(internal.HttpApi, internal.Soteria, internal.Superuser, float64(time.Since(s).Nanoseconds())) - ctx.String(http.StatusUnauthorized, "request is not authorized") - - return - } - - if _, err := app.GetInstance().Authenticator.Auth(ctx, tokenString); err != nil { - authCheckSpan.SetTag("success", false) - authCheckSpan.SetTag("error", err.Error()) - - zap.L(). - Error("superuser request is not authorized", - zap.Error(err), - zap.String("token", request.Token), - zap.String("username", request.Password), - zap.String("password", request.Username), - ) - - app.GetInstance().Metrics.ObserveStatusCode(internal.HttpApi, internal.Soteria, internal.Superuser, http.StatusUnauthorized) - app.GetInstance().Metrics.ObserveStatus(internal.HttpApi, internal.Soteria, internal.Superuser, internal.Failure, "request is not authorized") - app.GetInstance().Metrics.ObserveResponseTime(internal.HttpApi, internal.Soteria, internal.Superuser, float64(time.Since(s).Nanoseconds())) - ctx.String(http.StatusUnauthorized, "request is not authorized") - - return - } - - zap.L(). - Info("superuser ok", - zap.String("token", request.Token), - zap.String("username", request.Password), - zap.String("password", request.Username), - ) - - app.GetInstance().Metrics.ObserveStatusCode(internal.HttpApi, internal.Soteria, internal.Superuser, http.StatusOK) - app.GetInstance().Metrics.ObserveStatus(internal.HttpApi, internal.Soteria, internal.Superuser, internal.Success, "ok") - app.GetInstance().Metrics.ObserveResponseTime(internal.HttpApi, internal.Soteria, internal.Superuser, float64(time.Since(s).Nanoseconds())) - - authSpan.SetTag("success", true) - - ctx.String(http.StatusOK, "ok") -} From 99ca0953ff85ef2934c5552413d7e6a5d3b024fb Mon Sep 17 00:00:00 2001 From: Parham Alvani <1995parham@tuta.io> Date: Wed, 25 Aug 2021 23:04:06 +0430 Subject: [PATCH 012/660] feat: Update Auth Endpoint Document --- internal/web/rest/api/auth.go | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/internal/web/rest/api/auth.go b/internal/web/rest/api/auth.go index ee8f5228..1833bf4a 100644 --- a/internal/web/rest/api/auth.go +++ b/internal/web/rest/api/auth.go @@ -11,6 +11,8 @@ import ( "go.uber.org/zap" ) +const EMQAuthIgnore = "ignore" + // authRequest is the body payload structure of the auth endpoint. type authRequest struct { Token string `form:"token"` @@ -19,6 +21,7 @@ type authRequest struct { } // Auth is the handler responsible for authentication. +// it will returns "ignore" for superusers to pass them to redis. func Auth(ctx *gin.Context) { authSpan := app.GetInstance().Tracer.StartSpan("api.rest.auth") defer authSpan.Finish() @@ -35,12 +38,15 @@ func Auth(ctx *gin.Context) { app.GetInstance().Metrics.ObserveStatus(internal.HttpApi, internal.Soteria, internal.Auth, internal.Failure, "bad request") app.GetInstance().Metrics.ObserveResponseTime(internal.HttpApi, internal.Soteria, internal.Auth, float64(time.Since(s).Nanoseconds())) ctx.String(http.StatusBadRequest, "bad request") + return } + tokenString := request.Token if len(tokenString) == 0 { tokenString = request.Username } + if len(tokenString) == 0 { tokenString = request.Password } @@ -87,7 +93,7 @@ func Auth(ctx *gin.Context) { app.GetInstance().Metrics.ObserveStatus(internal.HttpApi, internal.Soteria, internal.Auth, internal.Ignore, "request is ignored") app.GetInstance().Metrics.ObserveResponseTime(internal.HttpApi, internal.Soteria, internal.Auth, float64(time.Since(s).Nanoseconds())) - ctx.String(http.StatusOK, "ignore") + ctx.String(http.StatusOK, EMQAuthIgnore) authCheckSpan.Finish() From c71017ac04cb62ab235f6dadf1961c638c86e7b7 Mon Sep 17 00:00:00 2001 From: Parham Alvani <1995parham@tuta.io> Date: Thu, 26 Aug 2021 00:09:50 +0430 Subject: [PATCH 013/660] fix: Correct is superuser field in redis --- internal/emq/store.go | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/internal/emq/store.go b/internal/emq/store.go index a08adb25..5fcbb399 100644 --- a/internal/emq/store.go +++ b/internal/emq/store.go @@ -4,7 +4,6 @@ import ( "context" "errors" "fmt" - "strconv" "strings" "github.com/go-redis/redis/v8" @@ -28,9 +27,17 @@ func Key(username string) string { return fmt.Sprintf("mqtt_user:%s", username) } +func booleanToOneZero(b bool) int { + if b { + return 1 + } + + return 0 +} + func (s *Store) Save(ctx context.Context, u User) error { if err := s.Client.HSet(ctx, Key(u.Username), PasswordHKey, u.Password, - IsSuperuserHKey, strconv.FormatBool(u.IsSuperuser)).Err(); err != nil { + IsSuperuserHKey, booleanToOneZero(u.IsSuperuser)).Err(); err != nil { return fmt.Errorf("failed to save into redis %w", err) } @@ -57,9 +64,9 @@ func (s *Store) Load(ctx context.Context, username string) (User, error) { return User{}, ErrInvalidHResult } - iss, err := strconv.ParseBool(siss) - if err != nil { - return User{}, fmt.Errorf("invalid is_superuser %w", err) + iss := false + if siss == "1" { + iss = true } return User{ From cca354de086f8490857cd3c8092b1efb765db0cb Mon Sep 17 00:00:00 2001 From: Parham Alvani <1995parham@tuta.io> Date: Thu, 26 Aug 2021 01:05:23 +0430 Subject: [PATCH 014/660] fix: Correct Log Level for Ignored Auth --- internal/web/rest/api/auth.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/internal/web/rest/api/auth.go b/internal/web/rest/api/auth.go index 1833bf4a..a4584a59 100644 --- a/internal/web/rest/api/auth.go +++ b/internal/web/rest/api/auth.go @@ -81,8 +81,7 @@ func Auth(ctx *gin.Context) { authCheckSpan.SetTag("ignored", true) zap.L(). - Error("auth request is ignored", - zap.Error(err), + Info("auth request is ignored", zap.String("token", request.Token), zap.String("username", request.Password), zap.String("password", request.Username), From a7f5e910fbe7ded21b318b1ef1c9806b0218bedb Mon Sep 17 00:00:00 2001 From: "mohammadreza.modares" Date: Fri, 27 Aug 2021 18:03:02 +0430 Subject: [PATCH 015/660] Add access check for call topic acl requests --- go.mod | 2 +- go.sum | 8 +++- internal/authenticator/authenticator.go | 2 + internal/authenticator/authenticator_test.go | 43 +++++++++++++++++++- internal/commands/token.go | 1 + internal/db/main/main.go | 10 +++++ internal/topics/t.go | 4 ++ internal/topics/t_test.go | 10 +++++ 8 files changed, 75 insertions(+), 5 deletions(-) diff --git a/go.mod b/go.mod index ca047e17..cf72c0e3 100644 --- a/go.mod +++ b/go.mod @@ -21,7 +21,7 @@ require ( github.com/stretchr/testify v1.7.0 github.com/uber/jaeger-client-go v2.25.0+incompatible github.com/uber/jaeger-lib v2.4.0+incompatible // indirect - gitlab.snapp.ir/dispatching/snappids/v2 v2.6.1 + gitlab.snapp.ir/dispatching/snappids/v2 v2.7.0 go.uber.org/atomic v1.7.0 // indirect go.uber.org/automaxprocs v1.3.0 go.uber.org/zap v1.16.0 diff --git a/go.sum b/go.sum index 8dc449a7..9c6534d6 100644 --- a/go.sum +++ b/go.sum @@ -43,6 +43,7 @@ github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ3 github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/dgrijalva/jwt-go v3.2.0+incompatible h1:7qlOGliEKZXTDg6OTjfoBKDXWrumCAMpl/TFQ4/5kLM= github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ= github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f h1:lO4WD4F/rVNCu3HqELle0jiPLLBs70cWOduZpkS1E78= github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f/go.mod h1:cuUVRXasLTGF7a8hSLbxyZXjz+1KgoB3wDUb6vlszIc= @@ -249,8 +250,8 @@ github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2/go.mod h1:UETIi67q github.com/xordataexchange/crypt v0.0.3-0.20170626215501-b2862e3d0a77/go.mod h1:aYKd//L2LvnjZzWKhF00oedf4jCCReLcmhLdhm1A27Q= github.com/yuin/gopher-lua v0.0.0-20191220021717-ab39c6098bdb h1:ZkM6LRnq40pR1Ox0hTHlnpkcOTuFIDQpZ1IN8rKKhX0= github.com/yuin/gopher-lua v0.0.0-20191220021717-ab39c6098bdb/go.mod h1:gqRgreBUhTSL0GeU64rtZ3Uq3wtjOa/TB2YfrtkCbVQ= -gitlab.snapp.ir/dispatching/snappids/v2 v2.6.1 h1:G782ZLXcCTI5Kby/s3YPur9S6cJxtLds1NVemWrgzi8= -gitlab.snapp.ir/dispatching/snappids/v2 v2.6.1/go.mod h1:U7lxAuqPifdXkUNcCXhtk9+6HFAyw5qy8LrF1DQDMuQ= +gitlab.snapp.ir/dispatching/snappids/v2 v2.7.0 h1:7PUdeNgPzvtiuKqQ6DjJD78FEGYI2jnxu3ROyV48jEc= +gitlab.snapp.ir/dispatching/snappids/v2 v2.7.0/go.mod h1:U7lxAuqPifdXkUNcCXhtk9+6HFAyw5qy8LrF1DQDMuQ= go.etcd.io/bbolt v1.3.2/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU= go.opentelemetry.io/otel v0.13.0 h1:2isEnyzjjJZq6r2EKMsFj4TxiQiexsM04AVhwbR/oBA= go.opentelemetry.io/otel v0.13.0/go.mod h1:dlSNewoRYikTkotEnxdmuBHgzT+k/idJSfDv/FxEnOY= @@ -280,6 +281,7 @@ golang.org/x/exp v0.0.0-20180807140117-3d87b88a115f/go.mod h1:CJ0aWSM057203Lf6IL golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190125153040-c74c464bbbf2/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= +golang.org/x/exp v0.0.0-20191030013958-a1ab85dbe136 h1:A1gGSx58LAGVHUUsOf7IiR0u8Xb6W51gRwfDBhkdcaw= golang.org/x/exp v0.0.0-20191030013958-a1ab85dbe136/go.mod h1:JXzH8nQsPlswgeRAPE3MuO9GYsAcnJvJ4vnMwN/5qkY= golang.org/x/image v0.0.0-20180708004352-c73c2afc3b81/go.mod h1:ux5Hcp/YLpHSI86hEcLt0YII63i6oz57MZXIpbrjZUs= golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js= @@ -358,7 +360,9 @@ golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8T golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 h1:go1bK/D/BFZV2I8cIQd1NKEZ+0owSTG1fDTci4IqFcE= golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= gonum.org/v1/gonum v0.0.0-20180816165407-929014505bf4/go.mod h1:Y+Yx5eoAFn32cQvJDxZx5Dpnq+c3wtXuadVZAcxbbBo= +gonum.org/v1/gonum v0.8.2 h1:CCXrcPKiGGotvnN6jfUsKk4rRqm7q09/YbKb5xCEvtM= gonum.org/v1/gonum v0.8.2/go.mod h1:oe/vMfY3deqTw+1EZJhuvEW2iwGF1bW9wwu7XCu0+v0= +gonum.org/v1/netlib v0.0.0-20190313105609-8cb42192e0e0 h1:OE9mWmgKkjJyEmDAAtGMPjXu+YNeGvK9VTSHY6+Qihc= gonum.org/v1/netlib v0.0.0-20190313105609-8cb42192e0e0/go.mod h1:wa6Ws7BG/ESfp6dHfk7C6KdzKA7wR7u/rKwOGE66zvw= gonum.org/v1/plot v0.0.0-20190515093506-e2840ee46a6b/go.mod h1:Wt8AAjI+ypCyYX3nZBvf6cAIx93T+c/OS2HFAYskSZc= google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= diff --git a/internal/authenticator/authenticator.go b/internal/authenticator/authenticator.go index 58f2b7df..569534d7 100644 --- a/internal/authenticator/authenticator.go +++ b/internal/authenticator/authenticator.go @@ -320,6 +320,8 @@ func (a Authenticator) ValidateTopicBySender(topic topics.Topic, audience snappi ch, _ = a.EMQTopicManager.CreateSharedLocationTopic(id, audience) case topics.Chat: ch, _ = a.EMQTopicManager.CreateChatTopic(id, audience) + case topics.Call: + ch, _ = a.EMQTopicManager.CreateCallTopic(id, audience) case topics.DaghighSys: return true case topics.BoxEvent: diff --git a/internal/authenticator/authenticator_test.go b/internal/authenticator/authenticator_test.go index 4cc3e3ed..8bc5cfc4 100644 --- a/internal/authenticator/authenticator_test.go +++ b/internal/authenticator/authenticator_test.go @@ -46,6 +46,11 @@ const ( validPassengerChatTopic = "snapp/passenger/DXKgaNQa7N5Y7bo/chat" invalidDriverChatTopic = "snapp/driver/0596923be632d673560af9adadd2f78a/chat" invalidPassengerChatTopic = "snapp/passenger/0596923be632d673560af9adadd2f78a/chat" + + validDriverCallTopic = "snapp/driver/DXKgaNQa7N5Y7bo/call" + validPassengerCallTopic = "snapp/passenger/DXKgaNQa7N5Y7bo/call" + invalidDriverCallTopic = "snapp/driver/0596923be632d673560af9adadd2f78a/call" + invalidPassengerCallTopic = "snapp/passenger/0596923be632d673560af9adadd2f78a/call" ) func TestAuthenticator_Auth(t *testing.T) { @@ -327,14 +332,14 @@ func TestAuthenticator_Acl(t *testing.T) { user.Passenger: pkey1, user.ThirdParty: pkey100, }, - AllowedAccessTypes: []acl.AccessType{acl.Pub, acl.Sub}, + AllowedAccessTypes: []acl.AccessType{acl.Pub, acl.Sub, acl.PubSub}, ModelHandler: MockModelHandler{}, EMQTopicManager: snappids.NewEMQManager(hid), HashIDSManager: hid, CompareHashAndPassword: passwordChecker, } t.Run("testing acl with invalid access type", func(t *testing.T) { - ok, err := authenticator.ACL(context.Background(), acl.PubSub, passengerToken, "test") + ok, err := authenticator.ACL(context.Background(), "invalid-access", passengerToken, "test") assert.Error(t, err) assert.False(t, ok) assert.Equal(t, ErrInvalidAccessType.Error(), err.Error()) @@ -456,6 +461,30 @@ func TestAuthenticator_Acl(t *testing.T) { assert.Error(t, err) assert.False(t, ok) }) + + t.Run("testing driver subscribe on valid call topic", func(t *testing.T) { + ok, err := authenticator.ACL(context.Background(), acl.PubSub, driverToken, validDriverCallTopic) + assert.NoError(t, err) + assert.True(t, ok) + }) + + t.Run("testing passenger subscribe on valid call topic", func(t *testing.T) { + ok, err := authenticator.ACL(context.Background(), acl.PubSub, passengerToken, validPassengerCallTopic) + assert.NoError(t, err) + assert.True(t, ok) + }) + + t.Run("testing driver subscribe on invalid call topic", func(t *testing.T) { + ok, err := authenticator.ACL(context.Background(), acl.PubSub, driverToken, invalidDriverCallTopic) + assert.Error(t, err) + assert.False(t, ok) + }) + + t.Run("testing passenger subscribe on invalid call topic", func(t *testing.T) { + ok, err := authenticator.ACL(context.Background(), acl.PubSub, passengerToken, invalidPassengerCallTopic) + assert.Error(t, err) + assert.False(t, ok) + }) } func TestAuthenticator_ValidateTopicBySender(t *testing.T) { @@ -607,6 +636,11 @@ func (rmh MockModelHandler) Get(ctx context.Context, modelName, pk string, v db. Topic: topics.Chat, AccessType: acl.Sub, }, + { + UUID: uuid.New(), + Topic: topics.Call, + AccessType: acl.PubSub, + }, }, } case "driver": @@ -647,6 +681,11 @@ func (rmh MockModelHandler) Get(ctx context.Context, modelName, pk string, v db. Topic: topics.Chat, AccessType: acl.Sub, }, + { + UUID: uuid.New(), + Topic: topics.Call, + AccessType: acl.PubSub, + }, }, } case "snappbox": diff --git a/internal/commands/token.go b/internal/commands/token.go index 559a355f..90d9db9f 100644 --- a/internal/commands/token.go +++ b/internal/commands/token.go @@ -105,6 +105,7 @@ func heraldToken(cmd *cobra.Command, args []string) error { "5": topics.PassengerLocation, "6": topics.SharedLocation, "7": topics.Chat, + "8": topics.Call, } accessTypes := map[string]acl.AccessType{ "1": acl.Sub, diff --git a/internal/db/main/main.go b/internal/db/main/main.go index 23dd2daa..eb6a7b72 100644 --- a/internal/db/main/main.go +++ b/internal/db/main/main.go @@ -58,6 +58,11 @@ func main() { Topic: topics.Chat, AccessType: acl.PubSub, }, + user.Rule{ + UUID: uuid.New(), + Topic: topics.Call, + AccessType: acl.PubSub, + }, }, } @@ -98,6 +103,11 @@ func main() { Topic: topics.Chat, AccessType: acl.PubSub, }, + { + UUID: uuid.New(), + Topic: topics.Call, + AccessType: acl.PubSub, + }, }, } box := user.User{ diff --git a/internal/topics/t.go b/internal/topics/t.go index 8db908a5..714332fc 100644 --- a/internal/topics/t.go +++ b/internal/topics/t.go @@ -18,6 +18,7 @@ const ( DaghighSys Type = "daghigh_sys" SharedLocation Type = "shared_location" Chat Type = "chat" + Call Type = "call" ) // Topic regular expressions which are used for detecting the topic name. @@ -31,6 +32,7 @@ var ( SharedLocationRegexp = regexp.MustCompile(`/(driver|passenger)+/[a-zA-Z0-9]+/(driver-location|passenger-location)`) DaghighSysRegexp = regexp.MustCompile(`\$SYS/brokers/\+/clients/\+/(connected|disconnected)`) ChatRegexp = regexp.MustCompile(`/(driver|passenger)+/[a-zA-Z0-9]+/chat`) + CallRegexp = regexp.MustCompile(`/(driver|passenger)+/[a-zA-Z0-9]+/call`) ) func (t Topic) GetType() Type { @@ -52,6 +54,8 @@ func (t Topic) GetTypeWithCompany(company string) Type { return SharedLocation case ChatRegexp.MatchString(topic): return Chat + case CallRegexp.MatchString(topic): + return Call case SuperappEventRegexp.MatchString(topic): return SuperappEvent case topic == "bucks": diff --git a/internal/topics/t_test.go b/internal/topics/t_test.go index c37f25e7..20dffb9d 100644 --- a/internal/topics/t_test.go +++ b/internal/topics/t_test.go @@ -86,6 +86,16 @@ func TestTopic_GetType(t1 *testing.T) { arg: "snapp/driver/py9kdjLYB35RP4q/chat", want: Chat, }, + { + name: "testing passenger call", + arg: "snapp/passenger/py9kdjLYB35RP4q/call", + want: Call, + }, + { + name: "testing driver call", + arg: "snapp/driver/py9kdjLYB35RP4q/call", + want: Call, + }, } for i, tt := range tests { t1.Run(fmt.Sprintf("#%d %s", i, tt.name), func(t1 *testing.T) { From 7154489d8bf21e77dced848ca87a2f119b058737 Mon Sep 17 00:00:00 2001 From: Parham Alvani <1995parham@tuta.io> Date: Sun, 29 Aug 2021 12:42:02 +0430 Subject: [PATCH 016/660] feat: Update chart versions --- deployments/soteria-init/Chart.yaml | 4 ++-- deployments/soteria/Chart.yaml | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/deployments/soteria-init/Chart.yaml b/deployments/soteria-init/Chart.yaml index 5c21d685..3d534646 100644 --- a/deployments/soteria-init/Chart.yaml +++ b/deployments/soteria-init/Chart.yaml @@ -15,10 +15,10 @@ type: application # This is the chart version. This version number should be incremented each time you make changes # to the chart and its templates, including the app version. # Versions are expected to follow Semantic Versioning (https://semver.org/) -version: 0.1.0 +version: 4.0.0 # This is the version number of the application being deployed. This version number should be # incremented each time you make changes to the application. Versions are not expected to # follow Semantic Versioning. They should reflect the version the application is using. # It is recommended to use it with quotes. -appVersion: "1.16.0" +appVersion: "v4-0-0" diff --git a/deployments/soteria/Chart.yaml b/deployments/soteria/Chart.yaml index aed4a1bf..23884713 100644 --- a/deployments/soteria/Chart.yaml +++ b/deployments/soteria/Chart.yaml @@ -15,10 +15,10 @@ type: application # This is the chart version. This version number should be incremented each time you make changes # to the chart and its templates, including the app version. # Versions are expected to follow Semantic Versioning (https://semver.org/) -version: 3.8.4 +version: 4.0.0 # This is the version number of the application being deployed. This version number should be # incremented each time you make changes to the application. Versions are not expected to # follow Semantic Versioning. They should reflect the version the application is using. # It is recommended to use it with quotes. -appVersion: "v3-8-4" +appVersion: "v4-0-0" From ec4e5c4d5601c94c3337e25b19650c664801c8c8 Mon Sep 17 00:00:00 2001 From: Parham Alvani <1995parham@tuta.io> Date: Mon, 30 Aug 2021 17:32:06 +0430 Subject: [PATCH 017/660] feat: add service label to pods --- deployments/soteria/templates/_helpers.tpl | 5 +++++ deployments/soteria/templates/deployment.yaml | 1 + 2 files changed, 6 insertions(+) diff --git a/deployments/soteria/templates/_helpers.tpl b/deployments/soteria/templates/_helpers.tpl index 183046af..8cefe88a 100644 --- a/deployments/soteria/templates/_helpers.tpl +++ b/deployments/soteria/templates/_helpers.tpl @@ -42,6 +42,11 @@ app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} app.kubernetes.io/managed-by: {{ .Release.Service }} {{- end }} +{{- define "soteria.podLabels" -}} +service: soteria +owned-by: dispatching +{{- end }} + {{/* Selector labels */}} diff --git a/deployments/soteria/templates/deployment.yaml b/deployments/soteria/templates/deployment.yaml index 4d70dd49..06118e50 100644 --- a/deployments/soteria/templates/deployment.yaml +++ b/deployments/soteria/templates/deployment.yaml @@ -25,6 +25,7 @@ spec: {{ end }} labels: {{- include "soteria.selectorLabels" . | nindent 8 }} + {{- include "soteria.podLabels" . | nindent 8 }} spec: containers: - name: app From fecb7fce2e7bf9320ee9cf3696195533934e8541 Mon Sep 17 00:00:00 2001 From: Amin Talebi Date: Sun, 5 Sep 2021 12:54:03 +0430 Subject: [PATCH 018/660] add chat topic accesses for passenger and driver --- deployments/soteria-init/values.yaml | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/deployments/soteria-init/values.yaml b/deployments/soteria-init/values.yaml index 7f8b1f35..a503df31 100644 --- a/deployments/soteria-init/values.yaml +++ b/deployments/soteria-init/values.yaml @@ -5,7 +5,7 @@ image: registry: docker-registry.default.svc:5000 - repository: realtime-staging/soteria + repository: mozart/soteria tag: dev pullPolicy: Always @@ -21,7 +21,7 @@ envs: http_port: "9999" grpc_port: "50051" mode: "debug" - redis_address: "main-redis-master.dispatching-staging.svc:6379" + redis_address: "rediscentral:6379" redis_pass: "" redis_pool_size: "10" redis_max_retries: "0" @@ -53,6 +53,10 @@ db: secret: secret token_expiration_duration: 2592000000000000 rules: + - uuid: c57553f1-5675-4998-ae07-a9204db76e7c + endpoint: '' + topic: chat + access_type: '2' - uuid: 84df6017-a850-42a3-a06f-22306a006a8d endpoint: '' topic: cab_event @@ -80,6 +84,10 @@ db: secret: secret token_expiration_duration: 2592000000000000 rules: + - uuid: 0cae4792-7002-4d7f-88be-2ffb069835a3 + endpoint: '' + topic: chat + access_type: '2' - uuid: a51f1898-3381-456f-a5fe-0e9d80b5bee0 endpoint: '' topic: cab_event From 98f0538587eb7e5c2a10f08bd4467d16b8dff2f4 Mon Sep 17 00:00:00 2001 From: Amin Talebi Date: Sun, 5 Sep 2021 12:56:13 +0430 Subject: [PATCH 019/660] fix access type --- deployments/soteria-init/values.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/deployments/soteria-init/values.yaml b/deployments/soteria-init/values.yaml index a503df31..ca2143b3 100644 --- a/deployments/soteria-init/values.yaml +++ b/deployments/soteria-init/values.yaml @@ -56,7 +56,7 @@ db: - uuid: c57553f1-5675-4998-ae07-a9204db76e7c endpoint: '' topic: chat - access_type: '2' + access_type: '1' - uuid: 84df6017-a850-42a3-a06f-22306a006a8d endpoint: '' topic: cab_event @@ -87,7 +87,7 @@ db: - uuid: 0cae4792-7002-4d7f-88be-2ffb069835a3 endpoint: '' topic: chat - access_type: '2' + access_type: '1' - uuid: a51f1898-3381-456f-a5fe-0e9d80b5bee0 endpoint: '' topic: cab_event From 87ef88b9290d42eaa3fafae70bb26fd810481faf Mon Sep 17 00:00:00 2001 From: Parham Alvani <1995parham@tuta.io> Date: Mon, 6 Sep 2021 15:56:20 +0430 Subject: [PATCH 020/660] fix: support regex on topics --- internal/topics/t.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/internal/topics/t.go b/internal/topics/t.go index 714332fc..dd5586ac 100644 --- a/internal/topics/t.go +++ b/internal/topics/t.go @@ -31,8 +31,8 @@ var ( SuperappEventRegexp = regexp.MustCompile(`/(driver|passenger)/[a-zA-Z0-9]+/(superapp)`) SharedLocationRegexp = regexp.MustCompile(`/(driver|passenger)+/[a-zA-Z0-9]+/(driver-location|passenger-location)`) DaghighSysRegexp = regexp.MustCompile(`\$SYS/brokers/\+/clients/\+/(connected|disconnected)`) - ChatRegexp = regexp.MustCompile(`/(driver|passenger)+/[a-zA-Z0-9]+/chat`) - CallRegexp = regexp.MustCompile(`/(driver|passenger)+/[a-zA-Z0-9]+/call`) + ChatRegexp = regexp.MustCompile(`/(driver|passenger)+/[a-zA-Z0-9+]+/chat`) + CallRegexp = regexp.MustCompile(`/(driver|passenger)+/[a-zA-Z0-9+]+/call`) ) func (t Topic) GetType() Type { From 363d7b67de2fdd8216b96068286eabe6925a2c7e Mon Sep 17 00:00:00 2001 From: Parham Alvani <1995parham@tuta.io> Date: Wed, 8 Sep 2021 13:04:29 +0430 Subject: [PATCH 021/660] feat: add timezone package and values --- Dockerfile | 4 ++-- deployments/soteria/templates/deployment.yaml | 3 +++ deployments/soteria/values.yaml | 2 ++ 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index 057f0305..800a66de 100644 --- a/Dockerfile +++ b/Dockerfile @@ -4,7 +4,7 @@ ARG VCS_REF ARG BUILD_VERSION RUN echo -e "https://repo.snapp.tech/repository/alpine/v3.12/main\nhttps://repo.snapp.tech/repository/alpine/v3.12/community" > /etc/apk/repositories -RUN apk --no-cache --update add ca-certificates +RUN apk --no-cache --update add ca-certificates tzdata RUN mkdir /app @@ -13,4 +13,4 @@ WORKDIR /app ENV SOTERIA_BUILD_DATE=${BUILD_DATE} ENV SOTERIA_VCS_REF=${VCS_REF} ENV SOTERIA_BUILD_VERSION=${BUILD_VERSION} -CMD ["/app/soteria", "serve"] \ No newline at end of file +CMD ["/app/soteria", "serve"] diff --git a/deployments/soteria/templates/deployment.yaml b/deployments/soteria/templates/deployment.yaml index 06118e50..b71c0fff 100644 --- a/deployments/soteria/templates/deployment.yaml +++ b/deployments/soteria/templates/deployment.yaml @@ -69,6 +69,9 @@ spec: periodSeconds: 23 successThreshold: 1 timeoutSeconds: 2 + env: + name: TZ + value: {{ .Values.timezone }} envFrom: - configMapRef: name: {{ include "soteria.fullname" . }} diff --git a/deployments/soteria/values.yaml b/deployments/soteria/values.yaml index ff79e2c9..22d3ca84 100644 --- a/deployments/soteria/values.yaml +++ b/deployments/soteria/values.yaml @@ -13,6 +13,8 @@ image: tag: dev pullPolicy: Always +timezone: Asia/Tehran + service: type: ClusterIP ports: From 1d3b640cf103df13da32359f404588f154d09023 Mon Sep 17 00:00:00 2001 From: Parham Alvani <1995parham@tuta.io> Date: Wed, 8 Sep 2021 13:04:38 +0430 Subject: [PATCH 022/660] feat: update chart version --- deployments/soteria/Chart.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/deployments/soteria/Chart.yaml b/deployments/soteria/Chart.yaml index 23884713..e207a9b0 100644 --- a/deployments/soteria/Chart.yaml +++ b/deployments/soteria/Chart.yaml @@ -15,10 +15,10 @@ type: application # This is the chart version. This version number should be incremented each time you make changes # to the chart and its templates, including the app version. # Versions are expected to follow Semantic Versioning (https://semver.org/) -version: 4.0.0 +version: 4.0.1 # This is the version number of the application being deployed. This version number should be # incremented each time you make changes to the application. Versions are not expected to # follow Semantic Versioning. They should reflect the version the application is using. # It is recommended to use it with quotes. -appVersion: "v4-0-0" +appVersion: "v4-0-1" From bbf38c35c39c683313476c61622c08181598fbb5 Mon Sep 17 00:00:00 2001 From: Parham Alvani <1995parham@tuta.io> Date: Wed, 8 Sep 2021 13:20:47 +0430 Subject: [PATCH 023/660] fix: correct chart --- deployments/soteria/templates/deployment.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/deployments/soteria/templates/deployment.yaml b/deployments/soteria/templates/deployment.yaml index b71c0fff..c791adc5 100644 --- a/deployments/soteria/templates/deployment.yaml +++ b/deployments/soteria/templates/deployment.yaml @@ -70,8 +70,8 @@ spec: successThreshold: 1 timeoutSeconds: 2 env: - name: TZ - value: {{ .Values.timezone }} + - name: TZ + value: {{ .Values.timezone }} envFrom: - configMapRef: name: {{ include "soteria.fullname" . }} From 8b2ae380adf58dde6bdf6e049aaa3e38d3577d82 Mon Sep 17 00:00:00 2001 From: "mohammadreza.modares" Date: Mon, 4 Oct 2021 16:07:00 +0330 Subject: [PATCH 024/660] Split call topic to two separate topics --- .okd/mozart/Secret.yaml | 2 +- go.mod | 2 +- go.sum | 8 +-- internal/authenticator/authenticator.go | 6 +- internal/authenticator/authenticator_test.go | 70 +++++++++++++++----- internal/commands/token.go | 3 +- internal/db/main/main.go | 18 +++-- internal/topics/t.go | 12 ++-- internal/topics/t_test.go | 18 +++-- 9 files changed, 100 insertions(+), 39 deletions(-) diff --git a/.okd/mozart/Secret.yaml b/.okd/mozart/Secret.yaml index 9fbb3430..7a5a376b 100644 --- a/.okd/mozart/Secret.yaml +++ b/.okd/mozart/Secret.yaml @@ -149,4 +149,4 @@ parameters: description: Initial database state required: true value: |- - [{"meta_data":{"model_name":"user","date_created":"2020-09-29T10:44:15.106544359+03:30","date_modified":"2020-09-29T10:44:15.106544423+03:30"},"username":"driver","password":"password","type":"EMQUser","ips":null,"secret":"secret","token_expiration_duration":2592000000000000,"rules":[{"uuid":"84df6017-a850-42a3-a06f-22306a006a8d","endpoint":"","topic":"cab_event","access_type":"1"},{"uuid":"df0b884e-41dc-444e-81d4-67f62ae2174c","endpoint":"","topic":"driver_location","access_type":"2"},{"uuid":"1375192a-6fc5-4409-abd8-0d21ef106bee","endpoint":"","topic":"shared_location","access_type":"1"},{"uuid":"d7aeb294-6271-470a-987a-01ea4f035e5d","endpoint":"","topic":"superapp_event","access_type":"1"}]},{"meta_data":{"model_name":"user","date_created":"2020-09-29T10:44:15.106560757+03:30","date_modified":"2020-09-29T10:44:15.106560814+03:30"},"username":"passenger","password":"password","type":"EMQUser","ips":null,"secret":"secret","token_expiration_duration":2592000000000000,"rules":[{"uuid":"a51f1898-3381-456f-a5fe-0e9d80b5bee0","endpoint":"","topic":"cab_event","access_type":"1"},{"uuid":"8de97e3f-e772-4da4-8f15-4dc048f5c06e","endpoint":"","topic":"superapp_event","access_type":"1"},{"uuid":"c41260ed-70eb-4554-bc15-5714fc1bf3f8","endpoint":"","topic":"passenger_location","access_type":"2"},{"uuid":"1375192a-6fc5-4409-abd8-0d21ef106bee","endpoint":"","topic":"shared_location","access_type":"1"}]},{"meta_data":{"model_name":"user","date_created":"2020-09-29T10:44:15.106567252+03:30","date_modified":"2020-09-29T10:44:15.106567311+03:30"},"username":"box","password":"password","type":"EMQUser","ips":null,"secret":"secret","token_expiration_duration":2592000000000000,"rules":[{"uuid":"e591af90-8191-4118-941a-7ef4434414ee","endpoint":"","topic":"box_event","access_type":"1"}]},{"meta_data":{"model_name":"user","date_created":"2020-09-29T10:44:15.106569957+03:30","date_modified":"2020-09-29T10:44:15.106570022+03:30"},"username":"colony-subscriber","password":"password","type":"EMQUser","ips":null,"secret":"secret","token_expiration_duration":2592000000000000,"rules":[{"uuid":"bcbe0a57-1706-4de7-a948-71c56c9700c4","endpoint":"","topic":"driver_location","access_type":"1"}]},{"meta_data":{"model_name":"user","date_created":"2020-09-29T10:44:15.106573104+03:30","date_modified":"2020-09-29T10:44:15.106573162+03:30"},"username":"gabriel","password":"password","type":"HeraldUser","ips":null,"secret":"secret","token_expiration_duration":2592000000000000,"rules":[{"uuid":"305dc844-5df0-42dc-849b-deccfe2dab96","endpoint":"/notification","topic":"","access_type":"2"},{"uuid":"5795227f-10a8-4822-ba5e-a1fc057a0a95","endpoint":"/event","topic":"","access_type":"2"}]},{"meta_data":{"model_name":"user","date_created":"2021-06-23T08:42:24.722521722Z","date_modified":"2021-07-06T18:40:10.074710788Z"},"username":"gossiper","password":"password","type":"EMQUser","ips":null,"secret":"secret","token_expiration_duration":30758400000000000,"rules":[{"uuid":"ec6f659e-fe73-41cd-805e-c5285bd92a8d","endpoint":"","topic":"shared_location","access_type":"2"},{"uuid":"a8dc06c4-bb11-4cb9-8da7-84ae34d2d14a","endpoint":"","topic":"driver_location","access_type":"1"},{"uuid":"cda59530-d412-4c6d-bb3b-7a89c6bf58c5","endpoint":"","topic":"passenger_location","access_type":"1"}]}] + [{"meta_data":{"model_name":"user","date_created":"2020-09-29T10:44:15.106544359+03:30","date_modified":"2020-09-29T10:44:15.106544423+03:30"},"username":"driver","password":"password","type":"EMQUser","ips":null,"secret":"secret","token_expiration_duration":2592000000000000,"rules":[{"uuid":"84df6017-a850-42a3-a06f-22306a006a8d","endpoint":"","topic":"cab_event","access_type":"1"},{"uuid":"df0b884e-41dc-444e-81d4-67f62ae2174c","endpoint":"","topic":"driver_location","access_type":"2"},{"uuid":"1375192a-6fc5-4409-abd8-0d21ef106bee","endpoint":"","topic":"shared_location","access_type":"1"},{"uuid":"d7aeb294-6271-470a-987a-01ea4f035e5d","endpoint":"","topic":"superapp_event","access_type":"1"},{"uuid":"d7aeb294-6271-470a-987a-04ea4fw35e4d","endpoint":"","topic":"call_entry","access_type":"2"},{"uuid":"d7aeb193-6271-470b-987a-04ca4fw35e4z","endpoint":"","topic":"call_outgoing","access_type":"1"}]},{"meta_data":{"model_name":"user","date_created":"2020-09-29T10:44:15.106560757+03:30","date_modified":"2020-09-29T10:44:15.106560814+03:30"},"username":"passenger","password":"password","type":"EMQUser","ips":null,"secret":"secret","token_expiration_duration":2592000000000000,"rules":[{"uuid":"a51f1898-3381-456f-a5fe-0e9d80b5bee0","endpoint":"","topic":"cab_event","access_type":"1"},{"uuid":"8de97e3f-e772-4da4-8f15-4dc048f5c06e","endpoint":"","topic":"superapp_event","access_type":"1"},{"uuid":"c41260ed-70eb-4554-bc15-5714fc1bf3f8","endpoint":"","topic":"passenger_location","access_type":"2"},{"uuid":"1375192a-6fc5-4409-abd8-0d21ef106bee","endpoint":"","topic":"shared_location","access_type":"1"},{"uuid":"d7eeb394-6271-470a-987a-04ea4fw35w4f","endpoint":"","topic":"call_entry","access_type":"2"},{"uuid":"d7aeb18r-6271-470b-982c-04cb4fz35e4c","endpoint":"","topic":"call_outgoing","access_type":"1"}]},{"meta_data":{"model_name":"user","date_created":"2020-09-29T10:44:15.106567252+03:30","date_modified":"2020-09-29T10:44:15.106567311+03:30"},"username":"box","password":"password","type":"EMQUser","ips":null,"secret":"secret","token_expiration_duration":2592000000000000,"rules":[{"uuid":"e591af90-8191-4118-941a-7ef4434414ee","endpoint":"","topic":"box_event","access_type":"1"}]},{"meta_data":{"model_name":"user","date_created":"2020-09-29T10:44:15.106569957+03:30","date_modified":"2020-09-29T10:44:15.106570022+03:30"},"username":"colony-subscriber","password":"password","type":"EMQUser","ips":null,"secret":"secret","token_expiration_duration":2592000000000000,"rules":[{"uuid":"bcbe0a57-1706-4de7-a948-71c56c9700c4","endpoint":"","topic":"driver_location","access_type":"1"}]},{"meta_data":{"model_name":"user","date_created":"2020-09-29T10:44:15.106573104+03:30","date_modified":"2020-09-29T10:44:15.106573162+03:30"},"username":"gabriel","password":"password","type":"HeraldUser","ips":null,"secret":"secret","token_expiration_duration":2592000000000000,"rules":[{"uuid":"305dc844-5df0-42dc-849b-deccfe2dab96","endpoint":"\/notification","topic":"","access_type":"2"},{"uuid":"5795227f-10a8-4822-ba5e-a1fc057a0a95","endpoint":"\/event","topic":"","access_type":"2"}]},{"meta_data":{"model_name":"user","date_created":"2021-06-23T08:42:24.722521722Z","date_modified":"2021-07-06T18:40:10.074710788Z"},"username":"gossiper","password":"password","type":"EMQUser","ips":null,"secret":"secret","token_expiration_duration":30758400000000000,"rules":[{"uuid":"ec6f659e-fe73-41cd-805e-c5285bd92a8d","endpoint":"","topic":"shared_location","access_type":"2"},{"uuid":"a8dc06c4-bb11-4cb9-8da7-84ae34d2d14a","endpoint":"","topic":"driver_location","access_type":"1"},{"uuid":"cda59530-d412-4c6d-bb3b-7a89c6bf58c5","endpoint":"","topic":"passenger_location","access_type":"1"}]}] diff --git a/go.mod b/go.mod index cf72c0e3..5124d407 100644 --- a/go.mod +++ b/go.mod @@ -21,7 +21,7 @@ require ( github.com/stretchr/testify v1.7.0 github.com/uber/jaeger-client-go v2.25.0+incompatible github.com/uber/jaeger-lib v2.4.0+incompatible // indirect - gitlab.snapp.ir/dispatching/snappids/v2 v2.7.0 + gitlab.snapp.ir/dispatching/snappids/v2 v2.8.0 go.uber.org/atomic v1.7.0 // indirect go.uber.org/automaxprocs v1.3.0 go.uber.org/zap v1.16.0 diff --git a/go.sum b/go.sum index 9c6534d6..9bd9319b 100644 --- a/go.sum +++ b/go.sum @@ -43,7 +43,6 @@ github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ3 github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/dgrijalva/jwt-go v3.2.0+incompatible h1:7qlOGliEKZXTDg6OTjfoBKDXWrumCAMpl/TFQ4/5kLM= github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ= github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f h1:lO4WD4F/rVNCu3HqELle0jiPLLBs70cWOduZpkS1E78= github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f/go.mod h1:cuUVRXasLTGF7a8hSLbxyZXjz+1KgoB3wDUb6vlszIc= @@ -250,8 +249,8 @@ github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2/go.mod h1:UETIi67q github.com/xordataexchange/crypt v0.0.3-0.20170626215501-b2862e3d0a77/go.mod h1:aYKd//L2LvnjZzWKhF00oedf4jCCReLcmhLdhm1A27Q= github.com/yuin/gopher-lua v0.0.0-20191220021717-ab39c6098bdb h1:ZkM6LRnq40pR1Ox0hTHlnpkcOTuFIDQpZ1IN8rKKhX0= github.com/yuin/gopher-lua v0.0.0-20191220021717-ab39c6098bdb/go.mod h1:gqRgreBUhTSL0GeU64rtZ3Uq3wtjOa/TB2YfrtkCbVQ= -gitlab.snapp.ir/dispatching/snappids/v2 v2.7.0 h1:7PUdeNgPzvtiuKqQ6DjJD78FEGYI2jnxu3ROyV48jEc= -gitlab.snapp.ir/dispatching/snappids/v2 v2.7.0/go.mod h1:U7lxAuqPifdXkUNcCXhtk9+6HFAyw5qy8LrF1DQDMuQ= +gitlab.snapp.ir/dispatching/snappids/v2 v2.8.0 h1:5BzBqfPB59hEHfHzfU4gcWKfiDBjNWcf68GAUgeRPu4= +gitlab.snapp.ir/dispatching/snappids/v2 v2.8.0/go.mod h1:U7lxAuqPifdXkUNcCXhtk9+6HFAyw5qy8LrF1DQDMuQ= go.etcd.io/bbolt v1.3.2/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU= go.opentelemetry.io/otel v0.13.0 h1:2isEnyzjjJZq6r2EKMsFj4TxiQiexsM04AVhwbR/oBA= go.opentelemetry.io/otel v0.13.0/go.mod h1:dlSNewoRYikTkotEnxdmuBHgzT+k/idJSfDv/FxEnOY= @@ -281,7 +280,6 @@ golang.org/x/exp v0.0.0-20180807140117-3d87b88a115f/go.mod h1:CJ0aWSM057203Lf6IL golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190125153040-c74c464bbbf2/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= -golang.org/x/exp v0.0.0-20191030013958-a1ab85dbe136 h1:A1gGSx58LAGVHUUsOf7IiR0u8Xb6W51gRwfDBhkdcaw= golang.org/x/exp v0.0.0-20191030013958-a1ab85dbe136/go.mod h1:JXzH8nQsPlswgeRAPE3MuO9GYsAcnJvJ4vnMwN/5qkY= golang.org/x/image v0.0.0-20180708004352-c73c2afc3b81/go.mod h1:ux5Hcp/YLpHSI86hEcLt0YII63i6oz57MZXIpbrjZUs= golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js= @@ -360,9 +358,7 @@ golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8T golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 h1:go1bK/D/BFZV2I8cIQd1NKEZ+0owSTG1fDTci4IqFcE= golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= gonum.org/v1/gonum v0.0.0-20180816165407-929014505bf4/go.mod h1:Y+Yx5eoAFn32cQvJDxZx5Dpnq+c3wtXuadVZAcxbbBo= -gonum.org/v1/gonum v0.8.2 h1:CCXrcPKiGGotvnN6jfUsKk4rRqm7q09/YbKb5xCEvtM= gonum.org/v1/gonum v0.8.2/go.mod h1:oe/vMfY3deqTw+1EZJhuvEW2iwGF1bW9wwu7XCu0+v0= -gonum.org/v1/netlib v0.0.0-20190313105609-8cb42192e0e0 h1:OE9mWmgKkjJyEmDAAtGMPjXu+YNeGvK9VTSHY6+Qihc= gonum.org/v1/netlib v0.0.0-20190313105609-8cb42192e0e0/go.mod h1:wa6Ws7BG/ESfp6dHfk7C6KdzKA7wR7u/rKwOGE66zvw= gonum.org/v1/plot v0.0.0-20190515093506-e2840ee46a6b/go.mod h1:Wt8AAjI+ypCyYX3nZBvf6cAIx93T+c/OS2HFAYskSZc= google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= diff --git a/internal/authenticator/authenticator.go b/internal/authenticator/authenticator.go index 569534d7..ff07501d 100644 --- a/internal/authenticator/authenticator.go +++ b/internal/authenticator/authenticator.go @@ -320,8 +320,10 @@ func (a Authenticator) ValidateTopicBySender(topic topics.Topic, audience snappi ch, _ = a.EMQTopicManager.CreateSharedLocationTopic(id, audience) case topics.Chat: ch, _ = a.EMQTopicManager.CreateChatTopic(id, audience) - case topics.Call: - ch, _ = a.EMQTopicManager.CreateCallTopic(id, audience) + case topics.CallEntry: + ch, _ = a.EMQTopicManager.CreateCallEntryTopic(id, audience) + case topics.CallOutgoing: + ch, _ = a.EMQTopicManager.CreateCallOutgoingTopic(id, audience) case topics.DaghighSys: return true case topics.BoxEvent: diff --git a/internal/authenticator/authenticator_test.go b/internal/authenticator/authenticator_test.go index 8bc5cfc4..8444f1cd 100644 --- a/internal/authenticator/authenticator_test.go +++ b/internal/authenticator/authenticator_test.go @@ -47,10 +47,14 @@ const ( invalidDriverChatTopic = "snapp/driver/0596923be632d673560af9adadd2f78a/chat" invalidPassengerChatTopic = "snapp/passenger/0596923be632d673560af9adadd2f78a/chat" - validDriverCallTopic = "snapp/driver/DXKgaNQa7N5Y7bo/call" - validPassengerCallTopic = "snapp/passenger/DXKgaNQa7N5Y7bo/call" - invalidDriverCallTopic = "snapp/driver/0596923be632d673560af9adadd2f78a/call" - invalidPassengerCallTopic = "snapp/passenger/0596923be632d673560af9adadd2f78a/call" + validDriverCallEntryTopic = "snapp/driver/DXKgaNQa7N5Y7bo/call/send" + validPassengerCallEntryTopic = "snapp/passenger/DXKgaNQa7N5Y7bo/call/send" + invalidDriverCallEntryTopic = "snapp/driver/0596923be632d673560af9adadd2f78a/call/send" + invalidPassengerCallEntryTopic = "snapp/passenger/0596923be632d673560af9adadd2f78a/call/send" + validDriverCallOutgoingTopic = "snapp/driver/DXKgaNQa7N5Y7bo/call/receive" + validPassengerCallOutgoingTopic = "snapp/passenger/DXKgaNQa7N5Y7bo/call/receive" + invalidDriverCallOutgoingTopic = "snapp/driver/0596923be632d673560af9adadd2f78a/call/receive" + invalidPassengerCallOutgoingTopic = "snapp/passenger/0596923be632d673560af9adadd2f78a/call/receive" ) func TestAuthenticator_Auth(t *testing.T) { @@ -462,26 +466,50 @@ func TestAuthenticator_Acl(t *testing.T) { assert.False(t, ok) }) - t.Run("testing driver subscribe on valid call topic", func(t *testing.T) { - ok, err := authenticator.ACL(context.Background(), acl.PubSub, driverToken, validDriverCallTopic) + t.Run("testing driver subscribe on valid call entry topic", func(t *testing.T) { + ok, err := authenticator.ACL(context.Background(), acl.Pub, driverToken, validDriverCallEntryTopic) assert.NoError(t, err) assert.True(t, ok) }) - t.Run("testing passenger subscribe on valid call topic", func(t *testing.T) { - ok, err := authenticator.ACL(context.Background(), acl.PubSub, passengerToken, validPassengerCallTopic) + t.Run("testing passenger subscribe on valid entry call topic", func(t *testing.T) { + ok, err := authenticator.ACL(context.Background(), acl.Pub, passengerToken, validPassengerCallEntryTopic) assert.NoError(t, err) assert.True(t, ok) }) - t.Run("testing driver subscribe on invalid call topic", func(t *testing.T) { - ok, err := authenticator.ACL(context.Background(), acl.PubSub, driverToken, invalidDriverCallTopic) + t.Run("testing driver subscribe on invalid call entry topic", func(t *testing.T) { + ok, err := authenticator.ACL(context.Background(), acl.Pub, driverToken, invalidDriverCallEntryTopic) assert.Error(t, err) assert.False(t, ok) }) - t.Run("testing passenger subscribe on invalid call topic", func(t *testing.T) { - ok, err := authenticator.ACL(context.Background(), acl.PubSub, passengerToken, invalidPassengerCallTopic) + t.Run("testing passenger subscribe on invalid call entry topic", func(t *testing.T) { + ok, err := authenticator.ACL(context.Background(), acl.Pub, passengerToken, invalidPassengerCallEntryTopic) + assert.Error(t, err) + assert.False(t, ok) + }) + + t.Run("testing driver subscribe on valid call outgoing topic", func(t *testing.T) { + ok, err := authenticator.ACL(context.Background(), acl.Sub, driverToken, validDriverCallOutgoingTopic) + assert.NoError(t, err) + assert.True(t, ok) + }) + + t.Run("testing passenger subscribe on valid outgoing call topic", func(t *testing.T) { + ok, err := authenticator.ACL(context.Background(), acl.Sub, passengerToken, validPassengerCallOutgoingTopic) + assert.NoError(t, err) + assert.True(t, ok) + }) + + t.Run("testing driver subscribe on invalid call outgoing topic", func(t *testing.T) { + ok, err := authenticator.ACL(context.Background(), acl.Sub, driverToken, invalidDriverCallOutgoingTopic) + assert.Error(t, err) + assert.False(t, ok) + }) + + t.Run("testing passenger subscribe on invalid call outgoing topic", func(t *testing.T) { + ok, err := authenticator.ACL(context.Background(), acl.Sub, passengerToken, invalidPassengerCallOutgoingTopic) assert.Error(t, err) assert.False(t, ok) }) @@ -638,8 +666,13 @@ func (rmh MockModelHandler) Get(ctx context.Context, modelName, pk string, v db. }, { UUID: uuid.New(), - Topic: topics.Call, - AccessType: acl.PubSub, + Topic: topics.CallEntry, + AccessType: acl.Pub, + }, + { + UUID: uuid.New(), + Topic: topics.CallOutgoing, + AccessType: acl.Sub, }, }, } @@ -683,8 +716,13 @@ func (rmh MockModelHandler) Get(ctx context.Context, modelName, pk string, v db. }, { UUID: uuid.New(), - Topic: topics.Call, - AccessType: acl.PubSub, + Topic: topics.CallEntry, + AccessType: acl.Pub, + }, + { + UUID: uuid.New(), + Topic: topics.CallOutgoing, + AccessType: acl.Sub, }, }, } diff --git a/internal/commands/token.go b/internal/commands/token.go index 90d9db9f..02255435 100644 --- a/internal/commands/token.go +++ b/internal/commands/token.go @@ -105,7 +105,8 @@ func heraldToken(cmd *cobra.Command, args []string) error { "5": topics.PassengerLocation, "6": topics.SharedLocation, "7": topics.Chat, - "8": topics.Call, + "8": topics.CallEntry, + "9": topics.CallOutgoing, } accessTypes := map[string]acl.AccessType{ "1": acl.Sub, diff --git a/internal/db/main/main.go b/internal/db/main/main.go index eb6a7b72..14f37928 100644 --- a/internal/db/main/main.go +++ b/internal/db/main/main.go @@ -60,8 +60,13 @@ func main() { }, user.Rule{ UUID: uuid.New(), - Topic: topics.Call, - AccessType: acl.PubSub, + Topic: topics.CallEntry, + AccessType: acl.Pub, + }, + user.Rule{ + UUID: uuid.New(), + Topic: topics.CallOutgoing, + AccessType: acl.Sub, }, }, } @@ -105,8 +110,13 @@ func main() { }, { UUID: uuid.New(), - Topic: topics.Call, - AccessType: acl.PubSub, + Topic: topics.CallEntry, + AccessType: acl.Pub, + }, + { + UUID: uuid.New(), + Topic: topics.CallOutgoing, + AccessType: acl.Sub, }, }, } diff --git a/internal/topics/t.go b/internal/topics/t.go index dd5586ac..a9517499 100644 --- a/internal/topics/t.go +++ b/internal/topics/t.go @@ -18,7 +18,8 @@ const ( DaghighSys Type = "daghigh_sys" SharedLocation Type = "shared_location" Chat Type = "chat" - Call Type = "call" + CallEntry Type = "call_entry" + CallOutgoing Type = "call_outgoing" ) // Topic regular expressions which are used for detecting the topic name. @@ -32,7 +33,8 @@ var ( SharedLocationRegexp = regexp.MustCompile(`/(driver|passenger)+/[a-zA-Z0-9]+/(driver-location|passenger-location)`) DaghighSysRegexp = regexp.MustCompile(`\$SYS/brokers/\+/clients/\+/(connected|disconnected)`) ChatRegexp = regexp.MustCompile(`/(driver|passenger)+/[a-zA-Z0-9+]+/chat`) - CallRegexp = regexp.MustCompile(`/(driver|passenger)+/[a-zA-Z0-9+]+/call`) + CallEntryRegexp = regexp.MustCompile(`/(driver|passenger)+/[a-zA-Z0-9+]+/call/send`) + CallOutgoingRegexp = regexp.MustCompile(`/(driver|passenger)+/[a-zA-Z0-9+]+/call/receive`) ) func (t Topic) GetType() Type { @@ -54,8 +56,10 @@ func (t Topic) GetTypeWithCompany(company string) Type { return SharedLocation case ChatRegexp.MatchString(topic): return Chat - case CallRegexp.MatchString(topic): - return Call + case CallEntryRegexp.MatchString(topic): + return CallEntry + case CallOutgoingRegexp.MatchString(topic): + return CallOutgoing case SuperappEventRegexp.MatchString(topic): return SuperappEvent case topic == "bucks": diff --git a/internal/topics/t_test.go b/internal/topics/t_test.go index 20dffb9d..d8ed750c 100644 --- a/internal/topics/t_test.go +++ b/internal/topics/t_test.go @@ -86,15 +86,25 @@ func TestTopic_GetType(t1 *testing.T) { arg: "snapp/driver/py9kdjLYB35RP4q/chat", want: Chat, }, + { + name: "testing passenger call entry", + arg: "snapp/passenger/py9kdjLYB35RP4q/call/send", + want: CallEntry, + }, + { + name: "testing driver call entry", + arg: "snapp/driver/py9kdjLYB35RP4q/call/send", + want: CallEntry, + }, { name: "testing passenger call", - arg: "snapp/passenger/py9kdjLYB35RP4q/call", - want: Call, + arg: "snapp/passenger/py9kdjLYB35RP4q/call/receive", + want: CallOutgoing, }, { name: "testing driver call", - arg: "snapp/driver/py9kdjLYB35RP4q/call", - want: Call, + arg: "snapp/driver/py9kdjLYB35RP4q/call/receive", + want: CallOutgoing, }, } for i, tt := range tests { From 388e42e68fb4114f6d56d950311846c8b5717a66 Mon Sep 17 00:00:00 2001 From: "mohammadreza.modares" Date: Mon, 4 Oct 2021 17:33:48 +0330 Subject: [PATCH 025/660] Use correct uuid in db.json --- .okd/mozart/Secret.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.okd/mozart/Secret.yaml b/.okd/mozart/Secret.yaml index 7a5a376b..22030e57 100644 --- a/.okd/mozart/Secret.yaml +++ b/.okd/mozart/Secret.yaml @@ -149,4 +149,4 @@ parameters: description: Initial database state required: true value: |- - [{"meta_data":{"model_name":"user","date_created":"2020-09-29T10:44:15.106544359+03:30","date_modified":"2020-09-29T10:44:15.106544423+03:30"},"username":"driver","password":"password","type":"EMQUser","ips":null,"secret":"secret","token_expiration_duration":2592000000000000,"rules":[{"uuid":"84df6017-a850-42a3-a06f-22306a006a8d","endpoint":"","topic":"cab_event","access_type":"1"},{"uuid":"df0b884e-41dc-444e-81d4-67f62ae2174c","endpoint":"","topic":"driver_location","access_type":"2"},{"uuid":"1375192a-6fc5-4409-abd8-0d21ef106bee","endpoint":"","topic":"shared_location","access_type":"1"},{"uuid":"d7aeb294-6271-470a-987a-01ea4f035e5d","endpoint":"","topic":"superapp_event","access_type":"1"},{"uuid":"d7aeb294-6271-470a-987a-04ea4fw35e4d","endpoint":"","topic":"call_entry","access_type":"2"},{"uuid":"d7aeb193-6271-470b-987a-04ca4fw35e4z","endpoint":"","topic":"call_outgoing","access_type":"1"}]},{"meta_data":{"model_name":"user","date_created":"2020-09-29T10:44:15.106560757+03:30","date_modified":"2020-09-29T10:44:15.106560814+03:30"},"username":"passenger","password":"password","type":"EMQUser","ips":null,"secret":"secret","token_expiration_duration":2592000000000000,"rules":[{"uuid":"a51f1898-3381-456f-a5fe-0e9d80b5bee0","endpoint":"","topic":"cab_event","access_type":"1"},{"uuid":"8de97e3f-e772-4da4-8f15-4dc048f5c06e","endpoint":"","topic":"superapp_event","access_type":"1"},{"uuid":"c41260ed-70eb-4554-bc15-5714fc1bf3f8","endpoint":"","topic":"passenger_location","access_type":"2"},{"uuid":"1375192a-6fc5-4409-abd8-0d21ef106bee","endpoint":"","topic":"shared_location","access_type":"1"},{"uuid":"d7eeb394-6271-470a-987a-04ea4fw35w4f","endpoint":"","topic":"call_entry","access_type":"2"},{"uuid":"d7aeb18r-6271-470b-982c-04cb4fz35e4c","endpoint":"","topic":"call_outgoing","access_type":"1"}]},{"meta_data":{"model_name":"user","date_created":"2020-09-29T10:44:15.106567252+03:30","date_modified":"2020-09-29T10:44:15.106567311+03:30"},"username":"box","password":"password","type":"EMQUser","ips":null,"secret":"secret","token_expiration_duration":2592000000000000,"rules":[{"uuid":"e591af90-8191-4118-941a-7ef4434414ee","endpoint":"","topic":"box_event","access_type":"1"}]},{"meta_data":{"model_name":"user","date_created":"2020-09-29T10:44:15.106569957+03:30","date_modified":"2020-09-29T10:44:15.106570022+03:30"},"username":"colony-subscriber","password":"password","type":"EMQUser","ips":null,"secret":"secret","token_expiration_duration":2592000000000000,"rules":[{"uuid":"bcbe0a57-1706-4de7-a948-71c56c9700c4","endpoint":"","topic":"driver_location","access_type":"1"}]},{"meta_data":{"model_name":"user","date_created":"2020-09-29T10:44:15.106573104+03:30","date_modified":"2020-09-29T10:44:15.106573162+03:30"},"username":"gabriel","password":"password","type":"HeraldUser","ips":null,"secret":"secret","token_expiration_duration":2592000000000000,"rules":[{"uuid":"305dc844-5df0-42dc-849b-deccfe2dab96","endpoint":"\/notification","topic":"","access_type":"2"},{"uuid":"5795227f-10a8-4822-ba5e-a1fc057a0a95","endpoint":"\/event","topic":"","access_type":"2"}]},{"meta_data":{"model_name":"user","date_created":"2021-06-23T08:42:24.722521722Z","date_modified":"2021-07-06T18:40:10.074710788Z"},"username":"gossiper","password":"password","type":"EMQUser","ips":null,"secret":"secret","token_expiration_duration":30758400000000000,"rules":[{"uuid":"ec6f659e-fe73-41cd-805e-c5285bd92a8d","endpoint":"","topic":"shared_location","access_type":"2"},{"uuid":"a8dc06c4-bb11-4cb9-8da7-84ae34d2d14a","endpoint":"","topic":"driver_location","access_type":"1"},{"uuid":"cda59530-d412-4c6d-bb3b-7a89c6bf58c5","endpoint":"","topic":"passenger_location","access_type":"1"}]}] + [{"meta_data":{"model_name":"user","date_created":"2020-09-29T10:44:15.106544359+03:30","date_modified":"2020-09-29T10:44:15.106544423+03:30"},"username":"driver","password":"password","type":"EMQUser","ips":null,"secret":"secret","token_expiration_duration":2592000000000000,"rules":[{"uuid":"84df6017-a850-42a3-a06f-22306a006a8d","endpoint":"","topic":"cab_event","access_type":"1"},{"uuid":"df0b884e-41dc-444e-81d4-67f62ae2174c","endpoint":"","topic":"driver_location","access_type":"2"},{"uuid":"1375192a-6fc5-4409-abd8-0d21ef106bee","endpoint":"","topic":"shared_location","access_type":"1"},{"uuid":"d7aeb294-6271-470a-987a-01ea4f035e5d","endpoint":"","topic":"superapp_event","access_type":"1"},{"uuid":"702dfb02-251a-11ec-9621-0242ac130002","endpoint":"","topic":"call_entry","access_type":"2"},{"uuid":"9582c554-251a-11ec-9621-0242ac130002","endpoint":"","topic":"call_outgoing","access_type":"1"}]},{"meta_data":{"model_name":"user","date_created":"2020-09-29T10:44:15.106560757+03:30","date_modified":"2020-09-29T10:44:15.106560814+03:30"},"username":"passenger","password":"password","type":"EMQUser","ips":null,"secret":"secret","token_expiration_duration":2592000000000000,"rules":[{"uuid":"a51f1898-3381-456f-a5fe-0e9d80b5bee0","endpoint":"","topic":"cab_event","access_type":"1"},{"uuid":"8de97e3f-e772-4da4-8f15-4dc048f5c06e","endpoint":"","topic":"superapp_event","access_type":"1"},{"uuid":"c41260ed-70eb-4554-bc15-5714fc1bf3f8","endpoint":"","topic":"passenger_location","access_type":"2"},{"uuid":"1375192a-6fc5-4409-abd8-0d21ef106bee","endpoint":"","topic":"shared_location","access_type":"1"},{"uuid":"a6a87996-251a-11ec-9621-0242ac130002","endpoint":"","topic":"call_entry","access_type":"2"},{"uuid":"ad368bc2-251a-11ec-9621-0242ac130002","endpoint":"","topic":"call_outgoing","access_type":"1"}]},{"meta_data":{"model_name":"user","date_created":"2020-09-29T10:44:15.106567252+03:30","date_modified":"2020-09-29T10:44:15.106567311+03:30"},"username":"box","password":"password","type":"EMQUser","ips":null,"secret":"secret","token_expiration_duration":2592000000000000,"rules":[{"uuid":"e591af90-8191-4118-941a-7ef4434414ee","endpoint":"","topic":"box_event","access_type":"1"}]},{"meta_data":{"model_name":"user","date_created":"2020-09-29T10:44:15.106569957+03:30","date_modified":"2020-09-29T10:44:15.106570022+03:30"},"username":"colony-subscriber","password":"password","type":"EMQUser","ips":null,"secret":"secret","token_expiration_duration":2592000000000000,"rules":[{"uuid":"bcbe0a57-1706-4de7-a948-71c56c9700c4","endpoint":"","topic":"driver_location","access_type":"1"}]},{"meta_data":{"model_name":"user","date_created":"2020-09-29T10:44:15.106573104+03:30","date_modified":"2020-09-29T10:44:15.106573162+03:30"},"username":"gabriel","password":"password","type":"HeraldUser","ips":null,"secret":"secret","token_expiration_duration":2592000000000000,"rules":[{"uuid":"305dc844-5df0-42dc-849b-deccfe2dab96","endpoint":"\/notification","topic":"","access_type":"2"},{"uuid":"5795227f-10a8-4822-ba5e-a1fc057a0a95","endpoint":"\/event","topic":"","access_type":"2"}]},{"meta_data":{"model_name":"user","date_created":"2021-06-23T08:42:24.722521722Z","date_modified":"2021-07-06T18:40:10.074710788Z"},"username":"gossiper","password":"password","type":"EMQUser","ips":null,"secret":"secret","token_expiration_duration":30758400000000000,"rules":[{"uuid":"ec6f659e-fe73-41cd-805e-c5285bd92a8d","endpoint":"","topic":"shared_location","access_type":"2"},{"uuid":"a8dc06c4-bb11-4cb9-8da7-84ae34d2d14a","endpoint":"","topic":"driver_location","access_type":"1"},{"uuid":"cda59530-d412-4c6d-bb3b-7a89c6bf58c5","endpoint":"","topic":"passenger_location","access_type":"1"}]}] From 34a383dc1050e2498fa6d8034ec6356b931d0859 Mon Sep 17 00:00:00 2001 From: Parham Alvani Date: Tue, 12 Oct 2021 18:05:38 +0330 Subject: [PATCH 026/660] fix: reduce soteria init job resources --- deployments/soteria-init/values.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/deployments/soteria-init/values.yaml b/deployments/soteria-init/values.yaml index ca2143b3..0de9b130 100644 --- a/deployments/soteria-init/values.yaml +++ b/deployments/soteria-init/values.yaml @@ -12,10 +12,10 @@ image: resources: limits: memory: 128Mi - cpu: 2 + cpu: 100m requests: memory: 128Mi - cpu: 1 + cpu: 100m envs: http_port: "9999" From d604f2008bab3d1fec9409070b27df0ff5b725f9 Mon Sep 17 00:00:00 2001 From: Parham Alvani Date: Tue, 12 Oct 2021 18:34:28 +0330 Subject: [PATCH 027/660] feat: better default values --- deployments/soteria/values.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/deployments/soteria/values.yaml b/deployments/soteria/values.yaml index 22d3ca84..6d7a1704 100644 --- a/deployments/soteria/values.yaml +++ b/deployments/soteria/values.yaml @@ -103,8 +103,8 @@ jwtKeys: authEnvs: jwt_keys_path: "/jwt_pems/" - driver_salt: "12345678901234567890123456789012" - passenger_salt: "12345678901234567890123456789012" + driver_salt: "secret" + passenger_salt: "secret" driver_hash_length: "15" passenger_hash_length: "15" From 83db0a15c022971479e5a5c0063fe169fac72cda Mon Sep 17 00:00:00 2001 From: Parham Alvani Date: Tue, 12 Oct 2021 18:45:12 +0330 Subject: [PATCH 028/660] feat: add baly company in commented way --- deployments/soteria/values.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/deployments/soteria/values.yaml b/deployments/soteria/values.yaml index 6d7a1704..a0866e70 100644 --- a/deployments/soteria/values.yaml +++ b/deployments/soteria/values.yaml @@ -109,6 +109,7 @@ authEnvs: passenger_hash_length: "15" envs: + # company: "baly" http_port: "9999" grpc_port: "50051" mode: "debug" From cc5338a49ade22b8197ed4a5a3740de0b3230d28 Mon Sep 17 00:00:00 2001 From: Parham Alvani Date: Mon, 18 Oct 2021 09:11:36 +0330 Subject: [PATCH 029/660] feat: switch to harbor for charts --- .gitlab-ci.yml | 2 +- .../ci/templates/deploy.chart.giltab-ci.yml | 21 ++----------------- 2 files changed, 3 insertions(+), 20 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index cdf2ae0b..61afd64b 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -36,7 +36,7 @@ include: - local: .gitlab/ci/templates/deploy.chart.giltab-ci.yml - project: dispatching/igniteg/easy-ci - ref: master + ref: main file: "easy-ci.yml" - project: templates/gitlab-templates diff --git a/.gitlab/ci/templates/deploy.chart.giltab-ci.yml b/.gitlab/ci/templates/deploy.chart.giltab-ci.yml index 3ac95901..cfee2e67 100644 --- a/.gitlab/ci/templates/deploy.chart.giltab-ci.yml +++ b/.gitlab/ci/templates/deploy.chart.giltab-ci.yml @@ -8,31 +8,14 @@ lint:helm:soteria: - tags when: manual -package:helm:soteria: - stage: build - extends: .easy_ci:helm:package - variables: - HELM_CHARTS_DIR: "deployments" - HELM_PACKAGE_DIR: "helm_packages" - needs: ["lint:helm:soteria"] - artifacts: - name: "HELM_PACKAGES-$CI_COMMIT_REF_SLUG" - paths: - - $HELM_PACKAGE_DIR - expire_in: 1h - only: - - tags - when: manual - chart:helm::soteria: stage: release extends: .easy_ci:helm:push variables: - HELM_PACKAGE_DIR: "helm_packages" - HELM_REPO_ADDRESS: "$DISPATCHING_HELM_REPO_ADDRESS" + HELM_CHARTS_DIR: "deployments" HELM_REPO_USER: "$DISPATCHING_HELM_REPO_USER" HELM_REPO_PASS: "$DISPATCHING_HELM_REPO_PASS" - needs: ["package:helm:soteria"] + needs: ["package:lint:soteria"] only: - tags when: manual From 4e085ec201e55b537fa2c0b1d02869fc93500fb0 Mon Sep 17 00:00:00 2001 From: Parham Alvani Date: Mon, 18 Oct 2021 09:12:47 +0330 Subject: [PATCH 030/660] feat: update chart version --- deployments/soteria/Chart.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/deployments/soteria/Chart.yaml b/deployments/soteria/Chart.yaml index e207a9b0..09167cc0 100644 --- a/deployments/soteria/Chart.yaml +++ b/deployments/soteria/Chart.yaml @@ -15,10 +15,10 @@ type: application # This is the chart version. This version number should be incremented each time you make changes # to the chart and its templates, including the app version. # Versions are expected to follow Semantic Versioning (https://semver.org/) -version: 4.0.1 +version: 4.0.2 # This is the version number of the application being deployed. This version number should be # incremented each time you make changes to the application. Versions are not expected to # follow Semantic Versioning. They should reflect the version the application is using. # It is recommended to use it with quotes. -appVersion: "v4-0-1" +appVersion: "v4-0-2" From 26fb178b44708aef51209d8c61f47136ffbe24b5 Mon Sep 17 00:00:00 2001 From: Parham Alvani Date: Mon, 18 Oct 2021 09:20:04 +0330 Subject: [PATCH 031/660] fix: correct gitlab filename --- .gitlab/ci/templates/{build.giltab-ci.yml => build.gitlab-ci.yml} | 0 .../templates/{deploy.chart.giltab-ci.yml => chart.gitlab-ci.yml} | 0 .../ci/templates/{compile.giltab-ci.yml => compile.gitlab-ci.yml} | 0 .../{deploy.cloud.giltab-ci.yml => deploy.cloud.gitlab-ci.yml} | 0 .../{deploy.env.giltab-ci.yml => deploy.env.gitlab-ci.yml} | 0 .../{deploy.vm.giltab-ci.yml => deploy.vm.gitlab-ci.yml} | 0 .../{precompile.giltab-ci.yml => precompile.gitlab-ci.yml} | 0 .../ci/templates/{release.giltab-ci.yml => release.gitlab-ci.yml} | 0 .gitlab/ci/templates/{test.giltab-ci.yml => test.gitlab-ci.yml} | 0 9 files changed, 0 insertions(+), 0 deletions(-) rename .gitlab/ci/templates/{build.giltab-ci.yml => build.gitlab-ci.yml} (100%) rename .gitlab/ci/templates/{deploy.chart.giltab-ci.yml => chart.gitlab-ci.yml} (100%) rename .gitlab/ci/templates/{compile.giltab-ci.yml => compile.gitlab-ci.yml} (100%) rename .gitlab/ci/templates/{deploy.cloud.giltab-ci.yml => deploy.cloud.gitlab-ci.yml} (100%) rename .gitlab/ci/templates/{deploy.env.giltab-ci.yml => deploy.env.gitlab-ci.yml} (100%) rename .gitlab/ci/templates/{deploy.vm.giltab-ci.yml => deploy.vm.gitlab-ci.yml} (100%) rename .gitlab/ci/templates/{precompile.giltab-ci.yml => precompile.gitlab-ci.yml} (100%) rename .gitlab/ci/templates/{release.giltab-ci.yml => release.gitlab-ci.yml} (100%) rename .gitlab/ci/templates/{test.giltab-ci.yml => test.gitlab-ci.yml} (100%) diff --git a/.gitlab/ci/templates/build.giltab-ci.yml b/.gitlab/ci/templates/build.gitlab-ci.yml similarity index 100% rename from .gitlab/ci/templates/build.giltab-ci.yml rename to .gitlab/ci/templates/build.gitlab-ci.yml diff --git a/.gitlab/ci/templates/deploy.chart.giltab-ci.yml b/.gitlab/ci/templates/chart.gitlab-ci.yml similarity index 100% rename from .gitlab/ci/templates/deploy.chart.giltab-ci.yml rename to .gitlab/ci/templates/chart.gitlab-ci.yml diff --git a/.gitlab/ci/templates/compile.giltab-ci.yml b/.gitlab/ci/templates/compile.gitlab-ci.yml similarity index 100% rename from .gitlab/ci/templates/compile.giltab-ci.yml rename to .gitlab/ci/templates/compile.gitlab-ci.yml diff --git a/.gitlab/ci/templates/deploy.cloud.giltab-ci.yml b/.gitlab/ci/templates/deploy.cloud.gitlab-ci.yml similarity index 100% rename from .gitlab/ci/templates/deploy.cloud.giltab-ci.yml rename to .gitlab/ci/templates/deploy.cloud.gitlab-ci.yml diff --git a/.gitlab/ci/templates/deploy.env.giltab-ci.yml b/.gitlab/ci/templates/deploy.env.gitlab-ci.yml similarity index 100% rename from .gitlab/ci/templates/deploy.env.giltab-ci.yml rename to .gitlab/ci/templates/deploy.env.gitlab-ci.yml diff --git a/.gitlab/ci/templates/deploy.vm.giltab-ci.yml b/.gitlab/ci/templates/deploy.vm.gitlab-ci.yml similarity index 100% rename from .gitlab/ci/templates/deploy.vm.giltab-ci.yml rename to .gitlab/ci/templates/deploy.vm.gitlab-ci.yml diff --git a/.gitlab/ci/templates/precompile.giltab-ci.yml b/.gitlab/ci/templates/precompile.gitlab-ci.yml similarity index 100% rename from .gitlab/ci/templates/precompile.giltab-ci.yml rename to .gitlab/ci/templates/precompile.gitlab-ci.yml diff --git a/.gitlab/ci/templates/release.giltab-ci.yml b/.gitlab/ci/templates/release.gitlab-ci.yml similarity index 100% rename from .gitlab/ci/templates/release.giltab-ci.yml rename to .gitlab/ci/templates/release.gitlab-ci.yml diff --git a/.gitlab/ci/templates/test.giltab-ci.yml b/.gitlab/ci/templates/test.gitlab-ci.yml similarity index 100% rename from .gitlab/ci/templates/test.giltab-ci.yml rename to .gitlab/ci/templates/test.gitlab-ci.yml From fce714ac8d2633ef687a3d06ba07083dcf563a17 Mon Sep 17 00:00:00 2001 From: Parham Alvani Date: Mon, 18 Oct 2021 09:21:00 +0330 Subject: [PATCH 032/660] fix: correct gitlab filename --- .gitlab-ci.yml | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 61afd64b..bc8e1745 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -25,15 +25,15 @@ variables: include: - - local: .gitlab/ci/templates/precompile.giltab-ci.yml - - local: .gitlab/ci/templates/compile.giltab-ci.yml - - local: .gitlab/ci/templates/test.giltab-ci.yml - - local: .gitlab/ci/templates/build.giltab-ci.yml - - local: .gitlab/ci/templates/release.giltab-ci.yml - - local: .gitlab/ci/templates/deploy.vm.giltab-ci.yml - - local: .gitlab/ci/templates/deploy.env.giltab-ci.yml - - local: .gitlab/ci/templates/deploy.cloud.giltab-ci.yml - - local: .gitlab/ci/templates/deploy.chart.giltab-ci.yml + - local: .gitlab/ci/templates/precompile.gitlab-ci.yml + - local: .gitlab/ci/templates/compile.gitlab-ci.yml + - local: .gitlab/ci/templates/test.gitlab-ci.yml + - local: .gitlab/ci/templates/build.gitlab-ci.yml + - local: .gitlab/ci/templates/release.gitlab-ci.yml + - local: .gitlab/ci/templates/deploy.vm.gitlab-ci.yml + - local: .gitlab/ci/templates/deploy.env.gitlab-ci.yml + - local: .gitlab/ci/templates/deploy.cloud.gitlab-ci.yml + - local: .gitlab/ci/templates/deploy.chart.gitlab-ci.yml - project: dispatching/igniteg/easy-ci ref: main From cdc9090f1c04b755cc2d8ab248c1abbb97fcef15 Mon Sep 17 00:00:00 2001 From: Parham Alvani Date: Mon, 18 Oct 2021 09:21:46 +0330 Subject: [PATCH 033/660] fix: correct chart needs --- .gitlab/ci/templates/chart.gitlab-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitlab/ci/templates/chart.gitlab-ci.yml b/.gitlab/ci/templates/chart.gitlab-ci.yml index cfee2e67..97f02e40 100644 --- a/.gitlab/ci/templates/chart.gitlab-ci.yml +++ b/.gitlab/ci/templates/chart.gitlab-ci.yml @@ -15,7 +15,7 @@ chart:helm::soteria: HELM_CHARTS_DIR: "deployments" HELM_REPO_USER: "$DISPATCHING_HELM_REPO_USER" HELM_REPO_PASS: "$DISPATCHING_HELM_REPO_PASS" - needs: ["package:lint:soteria"] + needs: ["lint:helm:soteria"] only: - tags when: manual From 9658b608d8108b3dd3dba1616e3fd4616284721b Mon Sep 17 00:00:00 2001 From: Parham Alvani Date: Mon, 18 Oct 2021 09:23:34 +0330 Subject: [PATCH 034/660] fix: correct gitlab filename --- .gitlab-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index bc8e1745..3a0f4fb7 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -30,10 +30,10 @@ include: - local: .gitlab/ci/templates/test.gitlab-ci.yml - local: .gitlab/ci/templates/build.gitlab-ci.yml - local: .gitlab/ci/templates/release.gitlab-ci.yml + - local: .gitlab/ci/templates/chart.gitlab-ci.yml - local: .gitlab/ci/templates/deploy.vm.gitlab-ci.yml - local: .gitlab/ci/templates/deploy.env.gitlab-ci.yml - local: .gitlab/ci/templates/deploy.cloud.gitlab-ci.yml - - local: .gitlab/ci/templates/deploy.chart.gitlab-ci.yml - project: dispatching/igniteg/easy-ci ref: main From 6c033cf9bf1eb2158944352e66002be51c756f55 Mon Sep 17 00:00:00 2001 From: Parham Alvani Date: Mon, 18 Oct 2021 10:13:58 +0330 Subject: [PATCH 035/660] feat: update packages --- go.mod | 79 +++---- go.sum | 658 +++++++++++++++++++++++++++++++++++++++++++++++---------- 2 files changed, 578 insertions(+), 159 deletions(-) diff --git a/go.mod b/go.mod index 5124d407..1fb5f4ad 100644 --- a/go.mod +++ b/go.mod @@ -6,69 +6,60 @@ require ( github.com/HdrHistogram/hdrhistogram-go v1.1.0 // indirect github.com/alicebob/miniredis/v2 v2.13.1 github.com/gin-contrib/zap v0.0.1 - github.com/gin-gonic/gin v1.6.3 + github.com/gin-gonic/gin v1.7.4 github.com/go-ozzo/ozzo-validation/v4 v4.3.0 - github.com/go-playground/validator/v10 v10.3.0 // indirect - github.com/go-redis/redis/v8 v8.3.2 - github.com/golang-jwt/jwt/v4 v4.0.0 - github.com/golang/protobuf v1.4.2 - github.com/google/uuid v1.1.2 + github.com/go-playground/validator/v10 v10.9.0 // indirect + github.com/go-redis/redis/v8 v8.11.4 + github.com/golang-jwt/jwt/v4 v4.1.0 + github.com/golang/protobuf v1.5.2 + github.com/google/uuid v1.3.0 github.com/kelseyhightower/envconfig v1.4.0 github.com/opentracing/opentracing-go v1.2.0 github.com/patrickmn/go-cache v2.1.0+incompatible - github.com/prometheus/client_golang v1.7.1 - github.com/spf13/cobra v1.0.0 + github.com/prometheus/client_golang v1.11.0 + github.com/spf13/cobra v1.2.1 github.com/stretchr/testify v1.7.0 - github.com/uber/jaeger-client-go v2.25.0+incompatible - github.com/uber/jaeger-lib v2.4.0+incompatible // indirect + github.com/uber/jaeger-client-go v2.29.1+incompatible + github.com/uber/jaeger-lib v2.4.1+incompatible // indirect gitlab.snapp.ir/dispatching/snappids/v2 v2.8.0 - go.uber.org/atomic v1.7.0 // indirect - go.uber.org/automaxprocs v1.3.0 - go.uber.org/zap v1.16.0 - golang.org/x/crypto v0.0.0-20200709230013-948cd5f35899 - google.golang.org/grpc v1.27.0 - google.golang.org/protobuf v1.25.0 // indirect + go.uber.org/atomic v1.9.0 // indirect + go.uber.org/automaxprocs v1.4.0 + go.uber.org/zap v1.19.1 + golang.org/x/crypto v0.0.0-20210921155107-089bfa567519 + google.golang.org/grpc v1.41.0 + google.golang.org/protobuf v1.27.1 // indirect ) require ( - github.com/BurntSushi/toml v0.3.1 // indirect github.com/alicebob/gopher-json v0.0.0-20200520072559-a9ecdc9d1d3a // indirect github.com/beorn7/perks v1.0.1 // indirect - github.com/cespare/xxhash/v2 v2.1.1 // indirect + github.com/cespare/xxhash/v2 v2.1.2 // indirect github.com/davecgh/go-spew v1.1.1 // indirect github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f // indirect github.com/gin-contrib/sse v0.1.0 // indirect - github.com/go-playground/locales v0.13.0 // indirect - github.com/go-playground/universal-translator v0.17.0 // indirect - github.com/google/go-cmp v0.5.4 // indirect + github.com/go-playground/locales v0.14.0 // indirect + github.com/go-playground/universal-translator v0.18.0 // indirect github.com/inconshreveable/mousetrap v1.0.0 // indirect - github.com/json-iterator/go v1.1.10 // indirect - github.com/leodido/go-urn v1.2.0 // indirect - github.com/mattn/go-isatty v0.0.12 // indirect + github.com/json-iterator/go v1.1.12 // indirect + github.com/leodido/go-urn v1.2.1 // indirect + github.com/mattn/go-isatty v0.0.14 // indirect github.com/matttproud/golang_protobuf_extensions v1.0.1 // indirect github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect - github.com/modern-go/reflect2 v1.0.1 // indirect - github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e // indirect - github.com/pkg/errors v0.8.1 // indirect + github.com/modern-go/reflect2 v1.0.2 // indirect + github.com/pkg/errors v0.9.1 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect github.com/prometheus/client_model v0.2.0 // indirect - github.com/prometheus/common v0.10.0 // indirect - github.com/prometheus/procfs v0.1.3 // indirect + github.com/prometheus/common v0.31.1 // indirect + github.com/prometheus/procfs v0.7.3 // indirect github.com/speps/go-hashids/v2 v2.0.1 // indirect - github.com/spf13/pflag v1.0.3 // indirect - github.com/ugorji/go/codec v1.1.7 // indirect + github.com/spf13/pflag v1.0.5 // indirect + github.com/ugorji/go/codec v1.2.6 // indirect github.com/yuin/gopher-lua v0.0.0-20191220021717-ab39c6098bdb // indirect - go.opentelemetry.io/otel v0.13.0 // indirect - go.uber.org/multierr v1.5.0 // indirect - golang.org/x/lint v0.0.0-20191125180803-fdd1cda4f05f // indirect - golang.org/x/net v0.0.0-20201006153459-a7d1128ccaa0 // indirect - golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f // indirect - golang.org/x/text v0.3.3 // indirect - golang.org/x/tools v0.0.0-20191125144606-a911d9008d1f // indirect - golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 // indirect - google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013 // indirect - gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f // indirect - gopkg.in/yaml.v2 v2.3.0 // indirect - gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c // indirect - honnef.co/go/tools v0.0.1-2019.2.3 // indirect + go.uber.org/multierr v1.7.0 // indirect + golang.org/x/net v0.0.0-20211015210444-4f30a5c0130f // indirect + golang.org/x/sys v0.0.0-20211015200801-69063c4bb744 // indirect + golang.org/x/text v0.3.7 // indirect + google.golang.org/genproto v0.0.0-20211016002631-37fc39342514 // indirect + gopkg.in/yaml.v2 v2.4.0 // indirect + gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b // indirect ) diff --git a/go.sum b/go.sum index 9bd9319b..4e250619 100644 --- a/go.sum +++ b/go.sum @@ -1,8 +1,44 @@ bou.ke/monkey v1.0.2 h1:kWcnsrCNUatbxncxR/ThdYqbytgOIArtYWqcQLQzKLI= bou.ke/monkey v1.0.2/go.mod h1:OqickVX3tNx6t33n1xvtTtu85YN5s6cKwVug+oHMaIA= cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= +cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= +cloud.google.com/go v0.38.0/go.mod h1:990N+gfupTy94rShfmMCWGDn0LpTmnzTp2qbd1dvSRU= +cloud.google.com/go v0.44.1/go.mod h1:iSa0KzasP4Uvy3f1mN/7PiObzGgflwredwwASm/v6AU= +cloud.google.com/go v0.44.2/go.mod h1:60680Gw3Yr4ikxnPRS/oxxkBccT6SA1yMk63TGekxKY= +cloud.google.com/go v0.45.1/go.mod h1:RpBamKRgapWJb87xiFSdk4g1CME7QZg3uwTez+TSTjc= +cloud.google.com/go v0.46.3/go.mod h1:a6bKKbmY7er1mI7TEI4lsAkts/mkhTSZK8w33B4RAg0= +cloud.google.com/go v0.50.0/go.mod h1:r9sluTvynVuxRIOHXQEHMFffphuXHOMZMycpNR5e6To= +cloud.google.com/go v0.52.0/go.mod h1:pXajvRH/6o3+F9jDHZWQ5PbGhn+o8w9qiu/CffaVdO4= +cloud.google.com/go v0.53.0/go.mod h1:fp/UouUEsRkN6ryDKNW/Upv/JBKnv6WDthjR6+vze6M= +cloud.google.com/go v0.54.0/go.mod h1:1rq2OEkV3YMf6n/9ZvGWI3GWw0VoqH/1x2nd8Is/bPc= +cloud.google.com/go v0.56.0/go.mod h1:jr7tqZxxKOVYizybht9+26Z/gUq7tiRzu+ACVAMbKVk= +cloud.google.com/go v0.57.0/go.mod h1:oXiQ6Rzq3RAkkY7N6t3TcE6jE+CIBBbA36lwQ1JyzZs= +cloud.google.com/go v0.62.0/go.mod h1:jmCYTdRCQuc1PHIIJ/maLInMho30T/Y0M4hTdTShOYc= +cloud.google.com/go v0.65.0/go.mod h1:O5N8zS7uWy9vkA9vayVHs65eM1ubvY4h553ofrNHObY= +cloud.google.com/go v0.72.0/go.mod h1:M+5Vjvlc2wnp6tjzE102Dw08nGShTscUx2nZMufOKPI= +cloud.google.com/go v0.74.0/go.mod h1:VV1xSbzvo+9QJOxLDaJfTjx5e+MePCpCWwvftOeQmWk= +cloud.google.com/go v0.78.0/go.mod h1:QjdrLG0uq+YwhjoVOLsS1t7TW8fs36kLs4XO5R5ECHg= +cloud.google.com/go v0.79.0/go.mod h1:3bzgcEeQlzbuEAYu4mrWhKqWjmpprinYgKJLgKHnbb8= +cloud.google.com/go v0.81.0/go.mod h1:mk/AM35KwGk/Nm2YSeZbxXdrNK3KZOYHmLkOqC2V6E0= +cloud.google.com/go/bigquery v1.0.1/go.mod h1:i/xbL2UlR5RvWAURpBYZTtm/cXjCha9lbfbpx4poX+o= +cloud.google.com/go/bigquery v1.3.0/go.mod h1:PjpwJnslEMmckchkHFfq+HTD2DmtT67aNFKH1/VBDHE= +cloud.google.com/go/bigquery v1.4.0/go.mod h1:S8dzgnTigyfTmLBfrtrhyYhwRxG72rYxvftPBK2Dvzc= +cloud.google.com/go/bigquery v1.5.0/go.mod h1:snEHRnqQbz117VIFhE8bmtwIDY80NLUZUMb4Nv6dBIg= +cloud.google.com/go/bigquery v1.7.0/go.mod h1://okPTzCYNXSlb24MZs83e2Do+h+VXtc4gLoIoXIAPc= +cloud.google.com/go/bigquery v1.8.0/go.mod h1:J5hqkt3O0uAFnINi6JXValWIb1v0goeZM77hZzJN/fQ= +cloud.google.com/go/datastore v1.0.0/go.mod h1:LXYbyblFSglQ5pkeyhO+Qmw7ukd3C+pD7TKLgZqpHYE= +cloud.google.com/go/datastore v1.1.0/go.mod h1:umbIZjpQpHh4hmRpGhH4tLFup+FVzqBi1b3c64qFpCk= +cloud.google.com/go/firestore v1.1.0/go.mod h1:ulACoGHTpvq5r8rxGJ4ddJZBZqakUQqClKRT5SZwBmk= +cloud.google.com/go/pubsub v1.0.1/go.mod h1:R0Gpsv3s54REJCy4fxDixWD93lHJMoZTyQ2kNxGRt3I= +cloud.google.com/go/pubsub v1.1.0/go.mod h1:EwwdRX2sKPjnvnqCa270oGRyludottCI76h+R3AArQw= +cloud.google.com/go/pubsub v1.2.0/go.mod h1:jhfEVHT8odbXTkndysNHCcx0awwzvfOlguIAii9o8iA= +cloud.google.com/go/pubsub v1.3.1/go.mod h1:i+ucay31+CNRpDW4Lu78I4xXG+O1r/MAHgjpRVR+TSU= +cloud.google.com/go/storage v1.0.0/go.mod h1:IhtSnM/ZTZV8YYJWCY8RULGVqBDmpoyjwiyrjsg+URw= +cloud.google.com/go/storage v1.5.0/go.mod h1:tpKbwo567HUNpVclU5sGELwQWBDZ8gh0ZeosJ0Rtdos= +cloud.google.com/go/storage v1.6.0/go.mod h1:N7U0C8pVQ/+NIKOBQyamJIeKQKkZ+mxpohlUTyfDhBk= +cloud.google.com/go/storage v1.8.0/go.mod h1:Wv1Oy7z6Yz3DshWRJFhqM/UCfaWIRTdp0RXyy7KQOVs= +cloud.google.com/go/storage v1.10.0/go.mod h1:FLPqc6j+Ki4BU591ie1oL6qBQGu2Bl/tZ9ullr3+Kg0= dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= -github.com/BurntSushi/toml v0.3.1 h1:WXkYYl6Yr3qBf1K79EBnL4mak0OimBfB0XUf9Vl28OQ= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= github.com/HdrHistogram/hdrhistogram-go v1.1.0 h1:6dpdDPTRoo78HxAJ6T1HfMiKSnqhgRRqzCuPshRkQ7I= @@ -13,42 +49,59 @@ github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuy github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= github.com/alecthomas/units v0.0.0-20190717042225-c3de453c63f4/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= +github.com/alecthomas/units v0.0.0-20190924025748-f65c72e2690d/go.mod h1:rBZYJk541a8SKzHPHnH3zbiI+7dagKZ0cgpgrD7Fyho= github.com/alicebob/gopher-json v0.0.0-20200520072559-a9ecdc9d1d3a h1:HbKu58rmZpUGpz5+4FfNmIU+FmZg2P3Xaj2v2bfNWmk= github.com/alicebob/gopher-json v0.0.0-20200520072559-a9ecdc9d1d3a/go.mod h1:SGnFV6hVsYE877CKEZ6tDNTjaSXYUk6QqoIK6PrAtcc= github.com/alicebob/miniredis/v2 v2.13.1 h1:twArGFW9kCdxe0K1Ga+iWrZc9RdWalf7V5bQerNoPK0= github.com/alicebob/miniredis/v2 v2.13.1/go.mod h1:0UIBNuf97uxrWhdVBpJvPtafKyGpL2NS2pYe0tYM97k= -github.com/armon/consul-api v0.0.0-20180202201655-eb2c6b5be1b6/go.mod h1:grANhF5doyWs3UAsr3K4I6qtAmlQcZDesFNEHPZAzj8= +github.com/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kdvxnR2qWY= +github.com/armon/circbuf v0.0.0-20150827004946-bbbad097214e/go.mod h1:3U/XgcO3hCbHZ8TKRvWD2dDTCfh9M9ya+I9JpbB7O8o= +github.com/armon/go-metrics v0.0.0-20180917152333-f0300d1749da/go.mod h1:Q73ZrmVTwzkszR9V5SSuryQ31EELlFMUz1kKyl939pY= +github.com/armon/go-radix v0.0.0-20180808171621-7fddfc383310/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8= github.com/asaskevich/govalidator v0.0.0-20200108200545-475eaeb16496 h1:zV3ejI06GQ59hwDQAvmK1qxOQGB3WuVTRoY0okPTAv0= github.com/asaskevich/govalidator v0.0.0-20200108200545-475eaeb16496/go.mod h1:oGkLhpf+kjZl6xBf758TQhh5XrAeiJv/7FRz/2spLIg= +github.com/benbjohnson/clock v1.1.0 h1:Q92kusRqC1XV2MjkWETPvjJVqKetz1OzxZB7mHJLju8= +github.com/benbjohnson/clock v1.1.0/go.mod h1:J11/hYXuz8f4ySSvYwY0FKfm+ezbsZBKZxNJlLklBHA= github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q= github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8= 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/bgentry/speakeasy v0.1.0/go.mod h1:+zsyZBPWlz7T6j88CTgSN5bM796AkVf0kBD4zp0CCIs= +github.com/bketelsen/crypt v0.0.4/go.mod h1:aI6NrJ0pMGgvZKL1iVgXLnfIFJtfV+bKCoqOes/6LfM= github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= github.com/cespare/xxhash v1.1.0 h1:a6HrQnmkObjyL+Gs60czilIUGqrzKutQD6XZog3p+ko= github.com/cespare/xxhash v1.1.0/go.mod h1:XrSqR1VqqWfGrhpAt58auRo0WTKS1nRRg3ghfAqPWnc= -github.com/cespare/xxhash/v2 v2.1.1 h1:6MnRN8NT7+YBpUIWxHtefFZOKTAPgGjpQSxqLNn0+qY= github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= +github.com/cespare/xxhash/v2 v2.1.2 h1:YRXhKfTDauu4ajMg1TPgFO5jnlC2HCbmLXMcTG5cbYE= +github.com/cespare/xxhash/v2 v2.1.2/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI= github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI= github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU= github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= -github.com/coreos/bbolt v1.3.2/go.mod h1:iRUV2dpdMOn7Bo10OQBFzIJO9kkE559Wcmn+qkEiiKk= -github.com/coreos/etcd v3.3.10+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE= -github.com/coreos/go-semver v0.2.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk= -github.com/coreos/go-systemd v0.0.0-20190321100706-95778dfbb74e/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4= -github.com/coreos/pkg v0.0.0-20180928190104-399ea9e2e55f/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA= +github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc= +github.com/cncf/udpa/go v0.0.0-20200629203442-efcf912fb354/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= +github.com/cncf/udpa/go v0.0.0-20201120205902-5459f2c99403/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= +github.com/cncf/xds/go v0.0.0-20210312221358-fbca930ec8ed/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= +github.com/cncf/xds/go v0.0.0-20210805033703-aa0b78936158/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= +github.com/coreos/go-semver v0.3.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk= +github.com/coreos/go-systemd/v22 v22.3.2/go.mod h1:Y58oyj3AT4RCenI/lSvhwexgC+NSVTIJ3seZv2GcEnc= github.com/cpuguy83/go-md2man/v2 v2.0.0/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU= github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ= github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f h1:lO4WD4F/rVNCu3HqELle0jiPLLBs70cWOduZpkS1E78= github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f/go.mod h1:cuUVRXasLTGF7a8hSLbxyZXjz+1KgoB3wDUb6vlszIc= -github.com/dgryski/go-sip13 v0.0.0-20181026042036-e10d5fee7954/go.mod h1:vAd38F8PWV+bWy6jNmig1y/TA+kYO4g3RSRF0IAv0no= +github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= +github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98= +github.com/envoyproxy/go-control-plane v0.9.7/go.mod h1:cwu0lG7PUMfa9snN8LXBig5ynNVH9qI8YYLbd1fK2po= +github.com/envoyproxy/go-control-plane v0.9.9-0.20201210154907-fd9021fe5dad/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk= +github.com/envoyproxy/go-control-plane v0.9.9-0.20210217033140-668b12f5399d/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk= +github.com/envoyproxy/go-control-plane v0.9.9-0.20210512163311-63b5d3c536b0/go.mod h1:hliV/p42l8fGbc6Y9bQ70uLwIvmJyVE5k4iMKlh8wCQ= +github.com/envoyproxy/go-control-plane v0.9.10-0.20210907150352-cf90f659a021/go.mod h1:AFq3mo9L8Lqqiid3OhADV3RfLJnjiw63cSpi+fDTRC0= github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= +github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= github.com/fogleman/gg v1.2.1-0.20190220221249-0403632d5b90/go.mod h1:R/bRT+9gY/C5z7JzPU0zXsXHKM4/ayA+zqcVNZzPa1k= github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= github.com/fsnotify/fsnotify v1.4.9 h1:hsms1Qyu0jgnwNXIxa+/V/PDsU6CfLf6CNO8H7IWoS4= @@ -59,172 +112,271 @@ github.com/gin-contrib/sse v0.1.0/go.mod h1:RHrZQHXnP2xjPF+u1gW/2HnVO7nvIa9PG3Gm github.com/gin-contrib/zap v0.0.1 h1:wsX/ahRftxPiXpiUw0YqyHj+TQTKtv+DAFWH84G1Uvg= github.com/gin-contrib/zap v0.0.1/go.mod h1:vJJndZ8f44gsTHQrDPIB4YOZzwOwiEIdE0mMrZLOogk= github.com/gin-gonic/gin v1.5.0/go.mod h1:Nd6IXA8m5kNZdNEHMBd93KT+mdY3+bewLgRvmCsR2Do= -github.com/gin-gonic/gin v1.6.3 h1:ahKqKTFpO5KTPHxWZjEdPScmYaGtLo8Y4DMHoEsnp14= -github.com/gin-gonic/gin v1.6.3/go.mod h1:75u5sXoLsGZoRN5Sgbi1eraJ4GU3++wFwWzhwvtwp4M= +github.com/gin-gonic/gin v1.7.4 h1:QmUZXrvJ9qZ3GfWvQ+2wnW/1ePrTEJqPKMYEU3lD/DM= +github.com/gin-gonic/gin v1.7.4/go.mod h1:jD2toBW3GZUr5UMcdrwQA10I7RuaFOl/SGeDjXkfUtY= github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU= +github.com/go-gl/glfw/v3.3/glfw v0.0.0-20191125211704-12ad95a8df72/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= +github.com/go-gl/glfw/v3.3/glfw v0.0.0-20200222043503-6f7a984d4dc4/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= github.com/go-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= github.com/go-kit/kit v0.9.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= +github.com/go-kit/log v0.1.0/go.mod h1:zbhenjAZHb184qTLMA9ZjW7ThYL0H2mk7Q6pNt4vbaY= github.com/go-logfmt/logfmt v0.3.0/go.mod h1:Qt1PoO58o5twSAckw1HlFXLmHsOX5/0LbT9GBnD5lWE= github.com/go-logfmt/logfmt v0.4.0/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V4qmtdjCk= +github.com/go-logfmt/logfmt v0.5.0/go.mod h1:wCYkCAKZfumFQihp8CzCvQ3paCTfi41vtzG1KdI/P7A= github.com/go-ozzo/ozzo-validation/v4 v4.3.0 h1:byhDUpfEwjsVQb1vBunvIjh2BHQ9ead57VkAEY4V+Es= github.com/go-ozzo/ozzo-validation/v4 v4.3.0/go.mod h1:2NKgrcHl3z6cJs+3Oo940FPRiTzuqKbvfrL2RxCj6Ew= github.com/go-playground/assert/v2 v2.0.1 h1:MsBgLAaY856+nPRTKrp3/OZK38U/wa0CcBYNjji3q3A= github.com/go-playground/assert/v2 v2.0.1/go.mod h1:VDjEfimB/XKnb+ZQfWdccd7VUvScMdVu0Titje2rxJ4= github.com/go-playground/locales v0.12.1/go.mod h1:IUMDtCfWo/w/mtMfIE/IG2K+Ey3ygWanZIBtBW0W2TM= -github.com/go-playground/locales v0.13.0 h1:HyWk6mgj5qFqCT5fjGBuRArbVDfE4hi8+e8ceBS/t7Q= github.com/go-playground/locales v0.13.0/go.mod h1:taPMhCMXrRLJO55olJkUXHZBHCxTMfnGwq/HNwmWNS8= +github.com/go-playground/locales v0.14.0 h1:u50s323jtVGugKlcYeyzC0etD1HifMjqmJqb8WugfUU= +github.com/go-playground/locales v0.14.0/go.mod h1:sawfccIbzZTqEDETgFXqTho0QybSa7l++s0DH+LDiLs= github.com/go-playground/universal-translator v0.16.0/go.mod h1:1AnU7NaIRDWWzGEKwgtJRd2xk99HeFyHw3yid4rvQIY= -github.com/go-playground/universal-translator v0.17.0 h1:icxd5fm+REJzpZx7ZfpaD876Lmtgy7VtROAbHHXk8no= github.com/go-playground/universal-translator v0.17.0/go.mod h1:UkSxE5sNxxRwHyU+Scu5vgOQjsIJAF8j9muTVoKLVtA= -github.com/go-playground/validator/v10 v10.2.0/go.mod h1:uOYAAleCW8F/7oMFd6aG0GOhaH6EGOAJShg8Id5JGkI= -github.com/go-playground/validator/v10 v10.3.0 h1:nZU+7q+yJoFmwvNgv/LnPUkwPal62+b2xXj0AU1Es7o= -github.com/go-playground/validator/v10 v10.3.0/go.mod h1:uOYAAleCW8F/7oMFd6aG0GOhaH6EGOAJShg8Id5JGkI= -github.com/go-redis/redis/v8 v8.3.2 h1:1bJscgN2yGtKLW6MsTRosa2LHyeq94j0hnNAgRZzj/M= -github.com/go-redis/redis/v8 v8.3.2/go.mod h1:jszGxBCez8QA1HWSmQxJO9Y82kNibbUmeYhKWrBejTU= +github.com/go-playground/universal-translator v0.18.0 h1:82dyy6p4OuJq4/CByFNOn/jYrnRPArHwAcmLoJZxyho= +github.com/go-playground/universal-translator v0.18.0/go.mod h1:UvRDBj+xPUEGrFYl+lu/H90nyDXpg0fqeB/AQUGNTVA= +github.com/go-playground/validator/v10 v10.4.1/go.mod h1:nlOn6nFhuKACm19sB/8EGNn9GlaMV7XkbRSipzJ0Ii4= +github.com/go-playground/validator/v10 v10.9.0 h1:NgTtmN58D0m8+UuxtYmGztBJB7VnPgjj221I1QHci2A= +github.com/go-playground/validator/v10 v10.9.0/go.mod h1:74x4gJWsvQexRdW8Pn3dXSGrTK4nAUsbPlLADvpJkos= +github.com/go-redis/redis/v8 v8.11.4 h1:kHoYkfZP6+pe04aFTnhDH6GDROa5yJdHJVNxV3F46Tg= +github.com/go-redis/redis/v8 v8.11.4/go.mod h1:2Z2wHZXdQpCDXEGzqMockDpNyYvi2l4Pxt6RJr792+w= github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= +github.com/go-task/slim-sprig v0.0.0-20210107165309-348f09dbbbc0/go.mod h1:fyg7847qk6SyHyPtNmDHnmrv/HOrqktSC+C9fM+CJOE= +github.com/godbus/dbus/v5 v5.0.4/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA= github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= -github.com/gogo/protobuf v1.2.1/go.mod h1:hp+jE20tsWTFYpLwKvXlhS1hjn+gTNwPg2I6zVXpSg4= -github.com/golang-jwt/jwt/v4 v4.0.0 h1:RAqyYixv1p7uEnocuy8P1nru5wprCh/MH2BIlW5z5/o= -github.com/golang-jwt/jwt/v4 v4.0.0/go.mod h1:/xlHOz8bRuivTWchD4jCa+NbatV+wEUSzwAxVc6locg= +github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q= +github.com/golang-jwt/jwt/v4 v4.1.0 h1:XUgk2Ex5veyVFVeLm0xhusUTQybEbexJXrvPNOKkSY0= +github.com/golang-jwt/jwt/v4 v4.1.0/go.mod h1:/xlHOz8bRuivTWchD4jCa+NbatV+wEUSzwAxVc6locg= github.com/golang/freetype v0.0.0-20170609003504-e2365dfdc4a0/go.mod h1:E/TSTwGwJL78qG/PmXZO1EjYhfJinVAhrmmHX6Z8B9k= -github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b h1:VKtxabqXZkF25pY9ekfRL6a582T4P37/31XEstQ5p58= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= -github.com/golang/groupcache v0.0.0-20190129154638-5b532d6fd5ef/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= +github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= +github.com/golang/groupcache v0.0.0-20191227052852-215e87163ea7/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= +github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= +github.com/golang/mock v1.2.0/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= +github.com/golang/mock v1.3.1/go.mod h1:sBzyDLLjw3U8JLTeZvSv8jJB+tU5PVekmnlKIyFUx0Y= +github.com/golang/mock v1.4.0/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= +github.com/golang/mock v1.4.1/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= +github.com/golang/mock v1.4.3/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= +github.com/golang/mock v1.4.4/go.mod h1:l3mdAwkq5BuhzHwde/uurv3sEJeZMXNpwsxVWU71h+4= +github.com/golang/mock v1.5.0/go.mod h1:CWnOUgYIOo4TcNZ0wHX3YZCqsaM1I1Jvs6v3mP3KVu8= github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.3.3/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw= +github.com/golang/protobuf v1.3.4/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw= +github.com/golang/protobuf v1.3.5/go.mod h1:6O5/vntMXwX2lRkT1hjjk0nAC1IDOTvTlVgjlRvqsdk= github.com/golang/protobuf v1.4.0-rc.1/go.mod h1:ceaxUfeHdC40wWswd/P6IGgMaK3YpKi5j83Wpe3EHw8= github.com/golang/protobuf v1.4.0-rc.1.0.20200221234624-67d41d38c208/go.mod h1:xKAWHe0F5eneWXFV3EuXVDTCmh+JuBKY0li0aMyXATA= github.com/golang/protobuf v1.4.0-rc.2/go.mod h1:LlEzMj4AhA7rCAGe4KMBDvJI+AwstrUpVNzEA03Pprs= github.com/golang/protobuf v1.4.0-rc.4.0.20200313231945-b860323f09d0/go.mod h1:WU3c8KckQ9AFe+yFwt9sWVRKCVIyN9cPHBJSNnbL67w= github.com/golang/protobuf v1.4.0/go.mod h1:jodUvKwWbYaEsadDk5Fwe5c77LiNKVO9IDvqG2KuDX0= github.com/golang/protobuf v1.4.1/go.mod h1:U8fpvMrcmy5pZrNK1lt4xCsGvpyWQ/VVv6QDs8UjoX8= -github.com/golang/protobuf v1.4.2 h1:+Z5KGCizgyZCbGh1KZqA0fcLLkwbsjIzS4aV2v7wJX0= github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= +github.com/golang/protobuf v1.4.3/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= +github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= +github.com/golang/protobuf v1.5.1/go.mod h1:DopwsBzvsk0Fs44TXzsVbJyPhcCPeIwnvohx4u74HPM= +github.com/golang/protobuf v1.5.2 h1:ROPKBNFfQgOUMifHyP+KYbvpjbdoFNs+aK7DXlji0Tw= +github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= github.com/gomodule/redigo v1.8.1 h1:Abmo0bI7Xf0IhdIPc7HZQzZcShdnmxeoVuDDtIQp8N8= github.com/gomodule/redigo v1.8.1/go.mod h1:P9dn9mFrCBvWhGE1wpxx6fgq7BAeLBk+UUUzlpkBYO0= +github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= 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.4.1/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.1/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.4 h1:L8R9j+yAqZuZjsqh/z+F1NCffTKKLShY6zXTItVIZ8M= +github.com/google/go-cmp v0.5.3/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.4/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.6 h1:BKbKCqvP6I+rmFHt06ZmyQtvB8xAkWdhFyr0ZUNZcxQ= +github.com/google/go-cmp v0.5.6/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= +github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs= +github.com/google/martian/v3 v3.0.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0= +github.com/google/martian/v3 v3.1.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0= +github.com/google/pprof v0.0.0-20181206194817-3ea8567a2e57/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= +github.com/google/pprof v0.0.0-20190515194954-54271f7e092f/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= +github.com/google/pprof v0.0.0-20191218002539-d4f498aebedc/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= +github.com/google/pprof v0.0.0-20200212024743-f11f1df84d12/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= +github.com/google/pprof v0.0.0-20200229191704-1ebb73c60ed3/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= +github.com/google/pprof v0.0.0-20200430221834-fc25d7d30c6d/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= +github.com/google/pprof v0.0.0-20200708004538-1a94d8640e99/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= +github.com/google/pprof v0.0.0-20201023163331-3e6fc7fc9c4c/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= +github.com/google/pprof v0.0.0-20201203190320-1bf35d6f28c2/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= +github.com/google/pprof v0.0.0-20210122040257-d980be63207e/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= +github.com/google/pprof v0.0.0-20210226084205-cbba55b83ad5/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= -github.com/google/uuid v1.1.2 h1:EVhdT+1Kseyi1/pUmXKaFxYsDNy9RQYkMWRH68J/W7Y= github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/gorilla/websocket v1.4.0/go.mod h1:E7qHFY5m1UJ88s3WnNqhKjPHQ0heANvMoAMk2YaljkQ= -github.com/grpc-ecosystem/go-grpc-middleware v1.0.0/go.mod h1:FiyG127CGDf3tlThmgyCl78X/SZQqEOJBCDaAfeWzPs= -github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0/go.mod h1:8NvIoxWQoOIhqOTXgfV/d3M/q6VIi02HzZEHgUlZvzk= -github.com/grpc-ecosystem/grpc-gateway v1.9.0/go.mod h1:vNeuVxBJEsws4ogUvrchl83t/GYV9WGTSLVdBhOQFDY= +github.com/google/uuid v1.3.0 h1:t6JiXgmwXMjEs8VusXIJk2BXHsn+wx8BZdTaoZ5fu7I= +github.com/google/uuid v1.3.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg= +github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk= +github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= +github.com/grpc-ecosystem/grpc-gateway v1.16.0/go.mod h1:BDjrQk3hbvj6Nolgz8mAMFbcEtjT1g+wF4CSlocrBnw= +github.com/hashicorp/consul/api v1.1.0/go.mod h1:VmuI/Lkw1nC05EYQWNKwWGbkg+FbDBtguAZLlVdkD9Q= +github.com/hashicorp/consul/sdk v0.1.1/go.mod h1:VKf9jXwCTEY1QZP2MOLRhb5i/I/ssyNV1vwHyQBF0x8= +github.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= +github.com/hashicorp/go-cleanhttp v0.5.1/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtngrth3wmdIIUrZ80= +github.com/hashicorp/go-immutable-radix v1.0.0/go.mod h1:0y9vanUI8NX6FsYoO3zeMjhV/C5i9g4Q3DwcSNZ4P60= +github.com/hashicorp/go-msgpack v0.5.3/go.mod h1:ahLV/dePpqEmjfWmKiqvPkv/twdG7iPBM1vqhUKIvfM= +github.com/hashicorp/go-multierror v1.0.0/go.mod h1:dHtQlpGsu+cZNNAkkCN/P3hoUDHhCYQXV3UM06sGGrk= +github.com/hashicorp/go-rootcerts v1.0.0/go.mod h1:K6zTfqpRlCUIjkwsN4Z+hiSfzSTQa6eBIzfwKfwNnHU= +github.com/hashicorp/go-sockaddr v1.0.0/go.mod h1:7Xibr9yA9JjQq1JpNB2Vw7kxv8xerXegt+ozgdvDeDU= +github.com/hashicorp/go-syslog v1.0.0/go.mod h1:qPfqrKkXGihmCqbJM2mZgkZGvKG1dFdvsLplgctolz4= +github.com/hashicorp/go-uuid v1.0.0/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= +github.com/hashicorp/go-uuid v1.0.1/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= +github.com/hashicorp/go.net v0.0.1/go.mod h1:hjKkEWcCURg++eb33jQU7oqQcI9XDCnUzHA0oac0k90= +github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= +github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ= +github.com/hashicorp/logutils v1.0.0/go.mod h1:QIAnNjmIWmVIIkWDTG1z5v++HQmx9WQRO+LraFDTW64= +github.com/hashicorp/mdns v1.0.0/go.mod h1:tL+uN++7HEJ6SQLQ2/p+z2pH24WQKWjBPkE0mNTz8vQ= +github.com/hashicorp/memberlist v0.1.3/go.mod h1:ajVTdAv/9Im8oMAAj5G31PhhMCZJV2pPBoIllUwCN7I= +github.com/hashicorp/serf v0.8.2/go.mod h1:6hOLApaqBFA1NXqRQAsxw9QxuDEvNxSQRwA/JwenrHc= github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= +github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= +github.com/ianlancetaylor/demangle v0.0.0-20200824232613-28f6c0f3b639/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= github.com/inconshreveable/mousetrap v1.0.0 h1:Z8tu5sraLXCXIcARxBp/8cbvlwVa7Z1NHg9XEKhtSvM= github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8= -github.com/jonboulle/clockwork v0.1.0/go.mod h1:Ii8DK3G1RaLaWxj9trq07+26W01tbo22gdxWY5EU2bo= +github.com/jpillora/backoff v1.0.0/go.mod h1:J/6gKK9jxlEcS3zixgDgUAsiuZ7yrSoa/FX5e0EB2j4= github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= github.com/json-iterator/go v1.1.7/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= github.com/json-iterator/go v1.1.9/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= -github.com/json-iterator/go v1.1.10 h1:Kz6Cvnvv2wGdaG/V8yMvfkmNiXq9Ya2KUv4rouJJr68= github.com/json-iterator/go v1.1.10/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= +github.com/json-iterator/go v1.1.11/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= +github.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnrnM= +github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo= +github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU= +github.com/jstemmer/go-junit-report v0.9.1/go.mod h1:Brl9GWCQeLvo8nXZwPNNblvFj/XSXhF0NWZEnDohbsk= +github.com/jtolds/gls v4.20.0+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfVYBRgL+9YlvaHOwJU= github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w= +github.com/julienschmidt/httprouter v1.3.0/go.mod h1:JR6WtHb+2LUe8TCKY3cZOxFyyO8IZAc4RVcycCCAKdM= github.com/jung-kurt/gofpdf v1.0.3-0.20190309125859-24315acbbda5/go.mod h1:7Id9E/uU8ce6rXgefFLlgrJj/GYY22cpxn+r32jIOes= github.com/kelseyhightower/envconfig v1.4.0 h1:Im6hONhd3pLkfDFsbRgu68RDNkGF1r3dvMUtDTo2cv8= github.com/kelseyhightower/envconfig v1.4.0/go.mod h1:cccZRl6mQpaq41TPp5QxidR+Sa3axMbJDNb//FQX6Gg= -github.com/kisielk/errcheck v1.1.0/go.mod h1:EZBBE59ingxPouuu3KfxchcWSUPOHkagtvWXihfKN4Q= +github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8= github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= +github.com/konsorten/go-windows-terminal-sequences v1.0.3/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= +github.com/kr/fs v0.1.0/go.mod h1:FFnZGqtBN9Gxj7eW1uZ42v5BccTP0vu6NEaFoC2HwRg= github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc= github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= +github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= +github.com/kr/pretty v0.3.0 h1:WgNl7dwNpEZ6jJ9k1snq4pZsg7DOEN8hP9Xw0Tsjwk0= +github.com/kr/pretty v0.3.0/go.mod h1:640gp4NfQd8pI5XOwp5fnNeVWj67G7CFk/SaSQn7NBk= github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= github.com/leodido/go-urn v1.1.0/go.mod h1:+cyI34gQWZcE1eQU7NVgKkkzdXDQHr1dBMtdAPozLkw= -github.com/leodido/go-urn v1.2.0 h1:hpXL4XnriNwQ/ABnpepYM/1vCLWNDfUNts8dX3xTG6Y= github.com/leodido/go-urn v1.2.0/go.mod h1:+8+nEpDfqqsY+g338gtMEUOtuK+4dEMhiQEgxpxOKII= -github.com/magiconair/properties v1.8.0/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= +github.com/leodido/go-urn v1.2.1 h1:BqpAaACuzVSgi/VLzGZIobT2z4v53pjosyNd9Yv6n/w= +github.com/leodido/go-urn v1.2.1/go.mod h1:zt4jvISO2HfUBqxjfIshjdMTYS56ZS/qv49ictyFfxY= +github.com/magiconair/properties v1.8.5/go.mod h1:y3VJvCyxH9uVvJTWEGAELF3aiYNyPKd5NZ3oSwXrF60= +github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU= +github.com/mattn/go-isatty v0.0.3/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= github.com/mattn/go-isatty v0.0.9/go.mod h1:YNRxwqDuOph6SZLI9vUUz6OYw3QyUt7WiY2yME+cCiQ= -github.com/mattn/go-isatty v0.0.12 h1:wuysRhFDzyxgEmMf5xjvJ2M9dZoWAXNNr5LSBS7uHXY= github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU= +github.com/mattn/go-isatty v0.0.14 h1:yVuAays6BHfxijgZPzw+3Zlu5yQgKGP2/hcQbHb7S9Y= +github.com/mattn/go-isatty v0.0.14/go.mod h1:7GGIvUiUoEMVVmxf/4nioHXj79iQHKdU27kJ6hsGG94= github.com/matttproud/golang_protobuf_extensions v1.0.1 h1:4hp9jkHxhMHkqkrB3Ix0jegS5sx/RkqARlsWZ6pIwiU= github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= -github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= +github.com/miekg/dns v1.0.14/go.mod h1:W1PPwlIAgtquWBMBEV9nkV9Cazfe8ScdGz/Lj7v3Nrg= +github.com/mitchellh/cli v1.0.0/go.mod h1:hNIlj7HEI86fIcpObd7a0FcrxTWetlwJDGcceTlRvqc= +github.com/mitchellh/go-homedir v1.0.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= +github.com/mitchellh/go-testing-interface v1.0.0/go.mod h1:kRemZodwjscx+RGhAo8eIhFbs2+BFgRtFPeD/KE+zxI= +github.com/mitchellh/gox v0.4.0/go.mod h1:Sd9lOJ0+aimLBi73mGofS1ycjY8lL3uZM3JPS42BGNg= +github.com/mitchellh/iochan v1.0.0/go.mod h1:JwYml1nuB7xOzsp52dPpHFffvOCDupsG0QubkSMEySY= +github.com/mitchellh/mapstructure v0.0.0-20160808181253-ca63d7c062ee/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= +github.com/mitchellh/mapstructure v1.4.1/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w8PVh93nsPXa1VrQ6jlwL5oN8l14QlcNfg= github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= -github.com/modern-go/reflect2 v1.0.1 h1:9f412s+6RmYXLWZSEzVVgPGK7C2PphHj5RJrvfx9AWI= github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= +github.com/modern-go/reflect2 v1.0.2 h1:xBagoLtFs94CBntxluKeaWgTMpvLxC4ur3nMaC9Gz0M= +github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk= github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= -github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e h1:fD57ERR4JtEqsWbfPhv4DMiApHyliiK5xCTNVSPiaAs= +github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno= -github.com/nxadm/tail v1.4.4 h1:DQuhQpB1tVlglWS2hLQ5OV6B5r8aGxSrPc5Qo6uTN78= github.com/nxadm/tail v1.4.4/go.mod h1:kenIhsEOeOJmVchQTgglprH7qJGnHDVpk1VPCcaMI8A= -github.com/oklog/ulid v1.3.1/go.mod h1:CirwcVhetQ6Lv90oh/F+FBtV6XMibvdAFo93nm5qn4U= +github.com/nxadm/tail v1.4.8 h1:nPr65rt6Y5JFSKQO7qToXr7pePgD6Gwiw05lkbyAQTE= +github.com/nxadm/tail v1.4.8/go.mod h1:+ncqLTQzXmGhMZNUePPaPqPvBxHAIsmXswZKocGu+AU= github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.12.1/go.mod h1:zj2OWP4+oCPe1qIXoGWkgMRwljMUYCdkwsT2108oapk= -github.com/onsi/ginkgo v1.14.2 h1:8mVmC9kjFFmA8H4pKMUhcblgifdkOIXPvbhN1T36q1M= -github.com/onsi/ginkgo v1.14.2/go.mod h1:iSB4RoI2tjJc9BBv4NKIKWKya62Rps+oPG/Lv9klQyY= +github.com/onsi/ginkgo v1.16.4 h1:29JGrr5oVBm5ulCWet69zQkzWipVXIol6ygQUe/EzNc= +github.com/onsi/ginkgo v1.16.4/go.mod h1:dX+/inL/fNMqNlz0e9LfyB9TswhZpCVdJM/Z6Vvnwo0= github.com/onsi/gomega v1.7.1/go.mod h1:XdKZgCCFLUoM/7CFJVPcG8C1xQ1AJ0vpAezJrB7JYyY= github.com/onsi/gomega v1.10.1/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1ybHNo= -github.com/onsi/gomega v1.10.3 h1:gph6h/qe9GSUw1NhH1gp+qb+h8rXD8Cy60Z32Qw3ELA= -github.com/onsi/gomega v1.10.3/go.mod h1:V9xEwhxec5O8UDM77eCW8vLymOMltsqPVYWrpDsH8xc= +github.com/onsi/gomega v1.16.0 h1:6gjqkI8iiRHMvdccRJM8rVKjCWk6ZIm6FTm3ddIe4/c= +github.com/onsi/gomega v1.16.0/go.mod h1:HnhC7FXeEQY45zxNK3PPoIUhzk/80Xly9PcubAlGdZY= github.com/opentracing/opentracing-go v1.2.0 h1:uEJPy/1a5RIPAJ0Ov+OIO8OxWu77jEv+1B0VhjKrZUs= github.com/opentracing/opentracing-go v1.2.0/go.mod h1:GxEUsuufX4nBwe+T+Wl9TAgYrxe9dPLANfrWvHYVTgc= +github.com/pascaldekloe/goe v0.0.0-20180627143212-57f6aae5913c/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc= github.com/patrickmn/go-cache v2.1.0+incompatible h1:HRMgzkcYKYpi3C8ajMPV8OFXaaRUnok+kx1WdO15EQc= github.com/patrickmn/go-cache v2.1.0+incompatible/go.mod h1:3Qf8kWWT7OJRJbdiICTKqZju1ZixQ/KpMGzzAfe6+WQ= -github.com/pelletier/go-toml v1.2.0/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/94hg7ilaic= +github.com/pelletier/go-toml v1.9.3/go.mod h1:u1nR/EPcESfeI/szUZKdtJ0xRNbUoANCkoOuaOx1Y+c= +github.com/pkg/diff v0.0.0-20210226163009-20ebb0f2a09e/go.mod h1:pJLUxLENpZxwdsKMEsNbx1VGcRFpLqf3715MtcvvzbA= github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= -github.com/pkg/errors v0.8.1 h1:iURUrRGxPUNPdy5/HRSm+Yj6okJ6UtLINN0Q9M4+h3I= github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= +github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= +github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= +github.com/pkg/sftp v1.10.1/go.mod h1:lYOWFsE0bwd1+KfKJaKeuokY15vzFx25BLbzYYoAxZI= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/posener/complete v1.1.1/go.mod h1:em0nMJCgc9GFtwrmVmEMR/ZL6WyhyjMBndrE9hABlRI= github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw= -github.com/prometheus/client_golang v0.9.3/go.mod h1:/TN21ttK/J9q6uSwhBd54HahCDft0ttaMvbicHlPoso= github.com/prometheus/client_golang v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5FsnadC4Ky3P0J6CfImo= -github.com/prometheus/client_golang v1.7.1 h1:NTGy1Ja9pByO+xAeH/qiWnLrKtr3hJPNjaVUwnjpdpA= github.com/prometheus/client_golang v1.7.1/go.mod h1:PY5Wy2awLA44sXw4AOSfFBetzPP4j5+D6mVACh+pe2M= +github.com/prometheus/client_golang v1.11.0 h1:HNkLOAEQMIDv/K+04rukrLx6ch7msSRwf3/SASFAGtQ= +github.com/prometheus/client_golang v1.11.0/go.mod h1:Z6t4BnS23TR94PD6BsDNk8yVqroYurpAkEiz0P2BEV0= github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/client_model v0.2.0 h1:uq5h0d+GuxiXLJLNABMgp2qUWDPiLvgCzz2dUR+/W/M= github.com/prometheus/client_model v0.2.0/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= -github.com/prometheus/common v0.0.0-20181113130724-41aa239b4cce/go.mod h1:daVV7qP5qjZbuso7PdcryaAu0sAZbrN9i7WWcTMWvro= -github.com/prometheus/common v0.4.0/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= github.com/prometheus/common v0.4.1/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= -github.com/prometheus/common v0.10.0 h1:RyRA7RzGXQZiW+tGMr7sxa85G1z0yOpM1qq5c8lNawc= github.com/prometheus/common v0.10.0/go.mod h1:Tlit/dnDKsSWFlCLTWaA1cyBgKHSMdTB80sz/V91rCo= +github.com/prometheus/common v0.26.0/go.mod h1:M7rCNAaPfAosfx8veZJCuw84e35h3Cfd9VFqTh1DIvc= +github.com/prometheus/common v0.31.1 h1:d18hG4PkHnNAKNMOmFuXFaiY8Us0nird/2m60uS1AMs= +github.com/prometheus/common v0.31.1/go.mod h1:vu+V0TpY+O6vW9J44gczi3Ap/oXXR10b+M/gUGO4Hls= github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= -github.com/prometheus/procfs v0.0.0-20190507164030-5867b95ac084/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= -github.com/prometheus/procfs v0.1.3 h1:F0+tqvhOksq22sc6iCHF5WGlWjdwj92p0udFh1VFBS8= github.com/prometheus/procfs v0.1.3/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU= -github.com/prometheus/tsdb v0.7.1/go.mod h1:qhTCs0VvXwvX/y3TZrWD7rabWM+ijKTux40TwIPHuXU= -github.com/rogpeppe/fastuuid v0.0.0-20150106093220-6724a57986af/go.mod h1:XWv6SoW27p1b0cqNHllgS5HIMJraePCO15w5zCzIWYg= +github.com/prometheus/procfs v0.6.0/go.mod h1:cz+aTbrPOrUb4q7XlbU9ygM+/jj0fzG6c1xBZuNvfVA= +github.com/prometheus/procfs v0.7.3 h1:4jVXhlkAyzOScmCkXBTOLRLTz8EeU+eyjrwB/EPq0VU= +github.com/prometheus/procfs v0.7.3/go.mod h1:cz+aTbrPOrUb4q7XlbU9ygM+/jj0fzG6c1xBZuNvfVA= +github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6LYCDYWNEvQ= github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= +github.com/rogpeppe/go-internal v1.6.1/go.mod h1:xXDCJY+GAPziupqXw64V24skbSoqbTEfhy4qGm1nDQc= +github.com/rogpeppe/go-internal v1.8.0 h1:FCbCCtXNOY3UtUuHUYaghJg4y7Fd14rXifAYUAtL9R8= +github.com/rogpeppe/go-internal v1.8.0/go.mod h1:WmiCO8CzOY8rg0OYDC4/i/2WRWAB6poM+XZ2dLUbcbE= github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= +github.com/ryanuber/columnize v0.0.0-20160712163229-9b3edd62028f/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts= +github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529/go.mod h1:DxrIzT+xaE7yg65j358z/aeFdxmN0P9QXhEzd20vsDc= github.com/shurcooL/sanitized_anchor_name v1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc= github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE= -github.com/soheilhy/cmux v0.1.4/go.mod h1:IM3LyeVVIOuxMH7sFAkER9+bJ4dT7Ms6E4xg4kGIyLM= +github.com/sirupsen/logrus v1.6.0/go.mod h1:7uNnSEd1DgxDLC74fIahvMZmmYsHGZGEOFrfsX/uA88= +github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc= +github.com/smartystreets/goconvey v1.6.4/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9QV7WQ/tjFTllLA= github.com/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA= github.com/speps/go-hashids/v2 v2.0.1 h1:ViWOEqWES/pdOSq+C1SLVa8/Tnsd52XC34RY7lt7m4g= github.com/speps/go-hashids/v2 v2.0.1/go.mod h1:47LKunwvDZki/uRVD6NImtyk712yFzIs3UF3KlHohGw= -github.com/spf13/afero v1.1.2/go.mod h1:j4pytiNVoe2o6bmDsKpLACNPDBIoEAkihy7loJ1B0CQ= -github.com/spf13/cast v1.3.0/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE= -github.com/spf13/cobra v1.0.0 h1:6m/oheQuQ13N9ks4hubMG6BnvwOeaJrqSPLahSnczz8= -github.com/spf13/cobra v1.0.0/go.mod h1:/6GTrnGXV9HjY+aR4k0oJ5tcvakLuG6EuKReYlHNrgE= -github.com/spf13/jwalterweatherman v1.0.0/go.mod h1:cQK4TGJAtQXfYWX+Ddv3mKDzgVb68N+wFjFa4jdeBTo= -github.com/spf13/pflag v1.0.3 h1:zPAT6CGy6wXeQ7NtTnaTerfKOsV6V6F8agHXFiazDkg= -github.com/spf13/pflag v1.0.3/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= -github.com/spf13/viper v1.4.0/go.mod h1:PTJ7Z/lr49W6bUbkmS1V3by4uWynFiR9p7+dSq/yZzE= +github.com/spf13/afero v1.6.0/go.mod h1:Ai8FlHk4v/PARR026UzYexafAt9roJ7LcLMAmO6Z93I= +github.com/spf13/cast v1.3.1/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE= +github.com/spf13/cobra v1.2.1 h1:+KmjbUw1hriSNMF55oPrkZcb27aECyrj8V2ytv7kWDw= +github.com/spf13/cobra v1.2.1/go.mod h1:ExllRjgxM/piMAM+3tAZvg8fsklGAf3tPfi+i8t68Nk= +github.com/spf13/jwalterweatherman v1.1.0/go.mod h1:aNWZUN0dPAAO/Ljvb5BEdw96iTZ0EXowPYD95IqWIGo= +github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA= +github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= +github.com/spf13/viper v1.8.1/go.mod h1:o0Pch8wJ9BVSWGQMbra6iw0oQ5oktSIBaujf1rJH9Ns= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.1.1 h1:2vfRuCMp5sSVIDSqO8oNnWJq7mPa6KVP3iPIwFBuy8A= github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= @@ -235,125 +387,304 @@ github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5 github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.7.0 h1:nwc3DEeHmmLAfoZucVR881uASk0Mfjw8xYJ99tb5CcY= github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= -github.com/tmc/grpc-websocket-proxy v0.0.0-20190109142713-0ad062ec5ee5/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U= -github.com/uber/jaeger-client-go v2.25.0+incompatible h1:IxcNZ7WRY1Y3G4poYlx24szfsn/3LvK9QHCq9oQw8+U= -github.com/uber/jaeger-client-go v2.25.0+incompatible/go.mod h1:WVhlPFC8FDjOFMMWRy2pZqQJSXxYSwNYOkTr/Z6d3Kk= -github.com/uber/jaeger-lib v2.4.0+incompatible h1:fY7QsGQWiCt8pajv4r7JEvmATdCVaWxXbjwyYwsNaLQ= -github.com/uber/jaeger-lib v2.4.0+incompatible/go.mod h1:ComeNDZlWwrWnDv8aPp0Ba6+uUTzImX/AauajbLI56U= -github.com/ugorji/go v1.1.4/go.mod h1:uQMGLiO92mf5W77hV/PUCpI3pbzQx3CRekS0kk+RGrc= -github.com/ugorji/go v1.1.7 h1:/68gy2h+1mWMrwZFeD1kQialdSzAb432dtpeJ42ovdo= +github.com/subosito/gotenv v1.2.0/go.mod h1:N0PQaV/YGNqwC0u51sEeR/aUtSLEXKX9iv69rRypqCw= +github.com/uber/jaeger-client-go v2.29.1+incompatible h1:R9ec3zO3sGpzs0abd43Y+fBZRJ9uiH6lXyR/+u6brW4= +github.com/uber/jaeger-client-go v2.29.1+incompatible/go.mod h1:WVhlPFC8FDjOFMMWRy2pZqQJSXxYSwNYOkTr/Z6d3Kk= +github.com/uber/jaeger-lib v2.4.1+incompatible h1:td4jdvLcExb4cBISKIpHuGoVXh+dVKhn2Um6rjCsSsg= +github.com/uber/jaeger-lib v2.4.1+incompatible/go.mod h1:ComeNDZlWwrWnDv8aPp0Ba6+uUTzImX/AauajbLI56U= github.com/ugorji/go v1.1.7/go.mod h1:kZn38zHttfInRq0xu/PH0az30d+z6vm202qpg1oXVMw= -github.com/ugorji/go/codec v1.1.7 h1:2SvQaVZ1ouYrrKKwoSk2pzd4A9evlKJb9oTL+OaLUSs= +github.com/ugorji/go v1.2.6 h1:tGiWC9HENWE2tqYycIqFTNorMmFRVhNwCpDOpWqnk8E= +github.com/ugorji/go v1.2.6/go.mod h1:anCg0y61KIhDlPZmnH+so+RQbysYVyDko0IMgJv0Nn0= github.com/ugorji/go/codec v1.1.7/go.mod h1:Ax+UKWsSmolVDwsd+7N3ZtXu+yMGCf907BLYF3GoBXY= -github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2/go.mod h1:UETIi67q53MR2AWcXfiuqkDkRtnGDLqkBTpCHuJHxtU= -github.com/xordataexchange/crypt v0.0.3-0.20170626215501-b2862e3d0a77/go.mod h1:aYKd//L2LvnjZzWKhF00oedf4jCCReLcmhLdhm1A27Q= +github.com/ugorji/go/codec v1.2.6 h1:7kbGefxLoDBuYXOms4yD7223OpNMMPNPZxXk5TvFcyQ= +github.com/ugorji/go/codec v1.2.6/go.mod h1:V6TCNZ4PHqoHGFZuSG1W8nrCzzdgA2DozYxWFFpvxTw= +github.com/yuin/goldmark v1.1.25/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= +github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= +github.com/yuin/goldmark v1.1.32/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= +github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= +github.com/yuin/goldmark v1.3.5/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= github.com/yuin/gopher-lua v0.0.0-20191220021717-ab39c6098bdb h1:ZkM6LRnq40pR1Ox0hTHlnpkcOTuFIDQpZ1IN8rKKhX0= github.com/yuin/gopher-lua v0.0.0-20191220021717-ab39c6098bdb/go.mod h1:gqRgreBUhTSL0GeU64rtZ3Uq3wtjOa/TB2YfrtkCbVQ= gitlab.snapp.ir/dispatching/snappids/v2 v2.8.0 h1:5BzBqfPB59hEHfHzfU4gcWKfiDBjNWcf68GAUgeRPu4= gitlab.snapp.ir/dispatching/snappids/v2 v2.8.0/go.mod h1:U7lxAuqPifdXkUNcCXhtk9+6HFAyw5qy8LrF1DQDMuQ= -go.etcd.io/bbolt v1.3.2/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU= -go.opentelemetry.io/otel v0.13.0 h1:2isEnyzjjJZq6r2EKMsFj4TxiQiexsM04AVhwbR/oBA= -go.opentelemetry.io/otel v0.13.0/go.mod h1:dlSNewoRYikTkotEnxdmuBHgzT+k/idJSfDv/FxEnOY= +go.etcd.io/etcd/api/v3 v3.5.0/go.mod h1:cbVKeC6lCfl7j/8jBhAK6aIYO9XOjdptoxU/nLQcPvs= +go.etcd.io/etcd/client/pkg/v3 v3.5.0/go.mod h1:IJHfcCEKxYu1Os13ZdwCwIUTUVGYTSAM3YSwc9/Ac1g= +go.etcd.io/etcd/client/v2 v2.305.0/go.mod h1:h9puh54ZTgAKtEbut2oe9P4L/oqKCVB6xsXlzd7alYQ= +go.opencensus.io v0.21.0/go.mod h1:mSImk1erAIZhrmZN+AvHh14ztQfjbGwt4TtuofqLduU= +go.opencensus.io v0.22.0/go.mod h1:+kGneAE2xo2IficOXnaByMWTGM9T73dGwxeWcUqIpI8= +go.opencensus.io v0.22.2/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= +go.opencensus.io v0.22.3/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= +go.opencensus.io v0.22.4/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= +go.opencensus.io v0.22.5/go.mod h1:5pWMHQbX5EPX2/62yrJeAkowc+lfs/XD7Uxpq3pI6kk= +go.opencensus.io v0.23.0/go.mod h1:XItmlyltB5F7CS4xOC1DcqMoFqwtC6OG2xF7mCv7P7E= +go.opentelemetry.io/proto/otlp v0.7.0/go.mod h1:PqfVotwruBrMGOCsRd/89rSnXhoiJIqeYNgFYFoEGnI= go.uber.org/atomic v1.3.2/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= -go.uber.org/atomic v1.4.0/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= -go.uber.org/atomic v1.6.0/go.mod h1:sABNBOSYdrvTF6hTgEIbc7YasKWGhgEQZyfxyTvoXHQ= -go.uber.org/atomic v1.7.0 h1:ADUqmZGgLDDfbSL9ZmPxKTybcoEYHgpYfELNoN+7hsw= go.uber.org/atomic v1.7.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc= -go.uber.org/automaxprocs v1.3.0 h1:II28aZoGdaglS5vVNnspf28lnZpXScxtIozx1lAjdb0= -go.uber.org/automaxprocs v1.3.0/go.mod h1:9CWT6lKIep8U41DDaPiH6eFscnTyjfTANNQNx6LrIcA= +go.uber.org/atomic v1.9.0 h1:ECmE8Bn/WFTYwEW/bpKD3M8VtR/zQVbavAoalC1PYyE= +go.uber.org/atomic v1.9.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc= +go.uber.org/automaxprocs v1.4.0 h1:CpDZl6aOlLhReez+8S3eEotD7Jx0Os++lemPlMULQP0= +go.uber.org/automaxprocs v1.4.0/go.mod h1:/mTEdr7LvHhs0v7mjdxDreTz1OG5zdZGqgOnhWiR/+Q= +go.uber.org/goleak v1.1.11-0.20210813005559-691160354723 h1:sHOAIxRGBp443oHZIPB+HsUGaksVCXVQENPxwTfQdH4= +go.uber.org/goleak v1.1.11-0.20210813005559-691160354723/go.mod h1:cwTWslyiVhfpKIDGSZEM2HlOvcqm+tG4zioyIeLoqMQ= go.uber.org/multierr v1.1.0/go.mod h1:wR5kodmAFQ0UK8QlbwjlSNy0Z68gJhDJUG5sjR94q/0= -go.uber.org/multierr v1.5.0 h1:KCa4XfM8CWFCpxXRGok+Q0SS/0XBhMDbHHGABQLvD2A= -go.uber.org/multierr v1.5.0/go.mod h1:FeouvMocqHpRaaGuG9EjoKcStLC43Zu/fmqdUMPcKYU= -go.uber.org/tools v0.0.0-20190618225709-2cfd321de3ee h1:0mgffUl7nfd+FpvXMVz4IDEaUSmT1ysygQC7qYo7sG4= -go.uber.org/tools v0.0.0-20190618225709-2cfd321de3ee/go.mod h1:vJERXedbb3MVM5f9Ejo0C68/HhF8uaILCdgjnY+goOA= +go.uber.org/multierr v1.6.0/go.mod h1:cdWPpRnG4AhwMwsgIHip0KRBQjJy5kYEpYjJxpXp9iU= +go.uber.org/multierr v1.7.0 h1:zaiO/rmgFjbmCXdSYJWQcdvOCsthmdaHfr3Gm2Kx4Ec= +go.uber.org/multierr v1.7.0/go.mod h1:7EAYxJLBy9rStEaz58O2t4Uvip6FSURkq8/ppBp95ak= go.uber.org/zap v1.10.0/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q= -go.uber.org/zap v1.16.0 h1:uFRZXykJGK9lLY4HtgSw44DnIcAM+kRBP7x5m+NpAOM= -go.uber.org/zap v1.16.0/go.mod h1:MA8QOfq0BHJwdXa996Y4dYkAqRKB8/1K1QMMZVaNZjQ= +go.uber.org/zap v1.17.0/go.mod h1:MXVU+bhUf/A7Xi2HNOnopQOrmycQ5Ih87HtOu4q5SSo= +go.uber.org/zap v1.19.1 h1:ue41HOKd1vGURxrmeKIgELGb3jPW9DMUDGtsinblHwI= +go.uber.org/zap v1.19.1/go.mod h1:j3DNczoxDZroyBnOT1L/Q79cfUMGZxlv/9dzN7SM1rI= golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= +golang.org/x/crypto v0.0.0-20181029021203-45a5f77698d3/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +golang.org/x/crypto v0.0.0-20190820162420-60c769a6c586/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/crypto v0.0.0-20200709230013-948cd5f35899 h1:DZhuSZLsGlFL4CmhA8BcRA0mnthyA/nZ00AqCUo7vHg= -golang.org/x/crypto v0.0.0-20200709230013-948cd5f35899/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= +golang.org/x/crypto v0.0.0-20210711020723-a769d52b0f97/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= +golang.org/x/crypto v0.0.0-20210921155107-089bfa567519 h1:7I4JAnoQBe7ZtJcBaYHi5UtiO8tQHbUSXxL+pnGRANg= +golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/exp v0.0.0-20180321215751-8460e604b9de/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20180807140117-3d87b88a115f/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190125153040-c74c464bbbf2/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= +golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= +golang.org/x/exp v0.0.0-20190829153037-c13cbed26979/go.mod h1:86+5VVa7VpoJ4kLfm080zCjGlMRFzhUhsZKEZO7MGek= golang.org/x/exp v0.0.0-20191030013958-a1ab85dbe136/go.mod h1:JXzH8nQsPlswgeRAPE3MuO9GYsAcnJvJ4vnMwN/5qkY= +golang.org/x/exp v0.0.0-20191129062945-2f5052295587/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= +golang.org/x/exp v0.0.0-20191227195350-da58074b4299/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= +golang.org/x/exp v0.0.0-20200119233911-0405dc783f0a/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= +golang.org/x/exp v0.0.0-20200207192155-f17229e696bd/go.mod h1:J/WKrq2StrnmMY6+EHIKF9dgMWnmCNThgcyBT1FY9mM= +golang.org/x/exp v0.0.0-20200224162631-6cc2880d07d6/go.mod h1:3jZMyOhIsHpP37uCMkUooju7aAi5cS1Q23tOzKc+0MU= golang.org/x/image v0.0.0-20180708004352-c73c2afc3b81/go.mod h1:ux5Hcp/YLpHSI86hEcLt0YII63i6oz57MZXIpbrjZUs= golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js= golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= 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-20190301231843-5614ed5bae6f/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= +golang.org/x/lint v0.0.0-20190409202823-959b441ac422/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= +golang.org/x/lint v0.0.0-20190909230951-414d861bb4ac/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= golang.org/x/lint v0.0.0-20190930215403-16217165b5de/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= -golang.org/x/lint v0.0.0-20191125180803-fdd1cda4f05f h1:J5lckAjkw6qYlOZNj90mLYNTEKDvWeuc1yieZ8qUzUE= golang.org/x/lint v0.0.0-20191125180803-fdd1cda4f05f/go.mod h1:5qLYkcX4OjUUV8bRuDixDT3tpyyb+LUpUlRWLxfhWrs= +golang.org/x/lint v0.0.0-20200130185559-910be7a94367/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= +golang.org/x/lint v0.0.0-20200302205851-738671d3881b/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= +golang.org/x/lint v0.0.0-20201208152925-83fdc39ff7b5/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= +golang.org/x/lint v0.0.0-20210508222113-6edffad5e616/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= +golang.org/x/mobile v0.0.0-20190312151609-d3739f865fa6/go.mod h1:z+o9i4GpDbdi3rU15maQ/Ox0txvL9dWGYEHz965HBQE= golang.org/x/mobile v0.0.0-20190719004257-d2bd2a29d028/go.mod h1:E/iHnbuqvinMTCcRqshq8CkpyQDoeVncDDYHnLhea+o= golang.org/x/mod v0.0.0-20190513183733-4bf6d317e70e/go.mod h1:mXi4GBBbnImb6dmsKGUJ2LatrhH/nqhxcFungHvyanc= golang.org/x/mod v0.1.0/go.mod h1:0QHyrYULN0/3qlju5TqG8bIK38QM8yzMo5ekMj3DlcY= +golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= +golang.org/x/mod v0.1.1-0.20191107180719-034126e5016b/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= +golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= +golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= +golang.org/x/mod v0.4.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= +golang.org/x/mod v0.4.1/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= +golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20181023162649-9b4f9f5ad519/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20181114220301-adae6a3d119a/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20181220203305-927f97764cc3/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20181201002055-351d144fa1fc/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= -golang.org/x/net v0.0.0-20190522155817-f3200d17e092/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks= +golang.org/x/net v0.0.0-20190501004415-9ce7a6920f09/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190503192946-f4e77d36d62c/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks= golang.org/x/net v0.0.0-20190613194153-d28f0bde5980/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20190628185345-da137c7871d7/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20190724013045-ca1201d0de80/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20191209160850-c0dbc17a3553/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200114155413-6afb5195e5aa/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200202094626-16171245cfb2/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200222125558-5a598a2470a0/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200301022130-244492dfa37a/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200324143707-d3edc9973b7e/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= +golang.org/x/net v0.0.0-20200501053045-e0ff5e5a1de5/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= +golang.org/x/net v0.0.0-20200506145744-7e3656a0809f/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= +golang.org/x/net v0.0.0-20200513185701-a91f0712d120/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= golang.org/x/net v0.0.0-20200520004742-59133d7f0dd7/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= -golang.org/x/net v0.0.0-20201006153459-a7d1128ccaa0 h1:wBouT66WTYFXdxfVdz9sVWARVd/2vfGcmI45D2gj45M= -golang.org/x/net v0.0.0-20201006153459-a7d1128ccaa0/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= +golang.org/x/net v0.0.0-20200520182314-0ba52f642ac2/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= +golang.org/x/net v0.0.0-20200625001655-4c5254603344/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= +golang.org/x/net v0.0.0-20200707034311-ab3426394381/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= +golang.org/x/net v0.0.0-20200822124328-c89045814202/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= +golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= +golang.org/x/net v0.0.0-20201031054903-ff519b6c9102/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= +golang.org/x/net v0.0.0-20201110031124-69a78807bb2b/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= +golang.org/x/net v0.0.0-20201209123823-ac852fbbde11/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= +golang.org/x/net v0.0.0-20210119194325-5f4716e94777/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= +golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= +golang.org/x/net v0.0.0-20210316092652-d523dce5a7f4/go.mod h1:RBQZq4jEuRlivfhVLdyRGr576XBO4/greRjx4P4O3yc= +golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM= +golang.org/x/net v0.0.0-20210428140749-89ef3d95e781/go.mod h1:OJAsFXCWl8Ukc7SiCT/9KSuxbyM7479/AVlXFRxuMCk= +golang.org/x/net v0.0.0-20210525063256-abc453219eb5/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= +golang.org/x/net v0.0.0-20211015210444-4f30a5c0130f h1:OfiFi4JbukWwe3lzw+xunroH1mnC1e2Gy5cxNJApiSY= +golang.org/x/net v0.0.0-20211015210444-4f30a5c0130f/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= +golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= +golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= +golang.org/x/oauth2 v0.0.0-20191202225959-858c2ad4c8b6/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= +golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= +golang.org/x/oauth2 v0.0.0-20200902213428-5d25da1a8d43/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= +golang.org/x/oauth2 v0.0.0-20201109201403-9fd604954f58/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= +golang.org/x/oauth2 v0.0.0-20201208152858-08078c50e5b5/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= +golang.org/x/oauth2 v0.0.0-20210218202405-ba52d332ba99/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= +golang.org/x/oauth2 v0.0.0-20210220000619-9bb904979d93/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= +golang.org/x/oauth2 v0.0.0-20210313182246-cd4f82c27b84/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= +golang.org/x/oauth2 v0.0.0-20210402161424-2e8d93401602/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= +golang.org/x/oauth2 v0.0.0-20210514164344-f6687ab2804c/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20190227155943-e225da77a7e6/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20200317015054-43a5402ce75a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20200625203802-6e8e738ad208/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20201207232520-09787c993a3a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sys v0.0.0-20180823144017-11551d06cbcc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20181107165924-66b7b1311ac8/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20181026203630-95b1ffbd15a5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20181116152217-5ac8a444bdc5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190204203706-41f3e6584952/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190312061237-fead79001313/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190422165155-953cdadca894/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190502145724-3ef323f4f1fd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190507160741-ecd444e8653b/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190606165138-5da285871e9c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190624142023-c5567b49c5d0/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190726091711-fc99dfbffb4e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190813064441-fde4db37ae7a/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190904154756-749cb33beabd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191001151750-bb3f8db39f24/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191005200804-aed5e4c7ecf9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191120155948-bd437916bb0e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191204072324-ce4227a45e2e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191228213918-04cbcbbfeed8/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200106162015-b016eb3dc98e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200113162924-86b910548bc1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200116001909-b77594299b42/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200122134326-e047566fdf82/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200202164722-d101bd2416d5/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200212091648-12a6c2dcc1e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200302150141-5c8b2ff67527/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200519105757-fe76b779f299/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200331124033-c3d80250170d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200501052902-10377860bb8e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200511232937-7e40ca221e25/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200515095857-1151b9dac4a9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200523222454-059865788121/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200615200032-f1bc736245b1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f h1:+Nyd8tzPX9R7BWHguqsrbFdRx3WQ/1ib8I44HXV5yTA= +golang.org/x/sys v0.0.0-20200625212154-ddb9806d33ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200803210538-64077c9b5642/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200905004654-be1d3432aa8f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20201201145000-ef89a241ccb3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210104204734-6f8348627aad/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210112080510-489259a85091/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210119212857-b64e53b001e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210220050731-9a76102bfb43/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210305230114-8fe3ee5dd75b/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210315160823-c6e025ad8005/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210320140829-1e4c9ba3b0c4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210330210617-4fbd30eecc44/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210403161142-5e06dd20ab57/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20210603081109-ebe580a85c40/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20210806184541-e5e7981a1069/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20211015200801-69063c4bb744 h1:KzbpndAYEM+4oHRp9JmB2ewj0NHHxO3Z0g7Gus2O1kk= +golang.org/x/sys v0.0.0-20211015200801-69063c4bb744/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= +golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= -golang.org/x/text v0.3.3 h1:cokOdA+Jmi5PJGXLlLllQSgYigAEfHXJAERHVMaCc2k= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= +golang.org/x/text v0.3.4/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= +golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= +golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= +golang.org/x/text v0.3.7 h1:olpwvP2KacW1ZWvsR7uQhoyTYvKAupfQrRGBFM352Gk= +golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= +golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= -golang.org/x/tools v0.0.0-20180221164845-07fd8470d635/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/tools v0.0.0-20180525024113-a5b4c53f6e8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190206041539-40960b6deb8e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= +golang.org/x/tools v0.0.0-20190312151545-0bb0c0a6e846/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= +golang.org/x/tools v0.0.0-20190312170243-e65039ee4138/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= +golang.org/x/tools v0.0.0-20190328211700-ab21143f2384/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= +golang.org/x/tools v0.0.0-20190425150028-36563e24a262/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= +golang.org/x/tools v0.0.0-20190506145303-2d16b83fe98c/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= +golang.org/x/tools v0.0.0-20190606124116-d0a3d012864b/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= golang.org/x/tools v0.0.0-20190621195816-6e04913cbbac/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= +golang.org/x/tools v0.0.0-20190628153133-6cdbf07be9d0/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= +golang.org/x/tools v0.0.0-20190816200558-6889da9d5479/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20190911174233-4f2ddba30aff/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191012152004-8de300cfc20a/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191029041327-9cc4af7d6b2c/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191029190741-b9c20aec41a5/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191125144606-a911d9008d1f h1:kDxGY2VmgABOe55qheT/TFqUMtcTHnomIPS1iv3G4Ms= +golang.org/x/tools v0.0.0-20191112195655-aa38f8e97acc/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191113191852-77e3bb0ad9e7/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191115202509-3a792d9c32b2/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191125144606-a911d9008d1f/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191130070609-6e064ea0cf2d/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191216173652-a0e659d51361/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20191227053925-7b8e75db28f4/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200117161641-43d50277825c/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200122220014-bf1340f18c4a/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200130002326-2f3ba24bd6e7/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200204074204-1cc6d1ef6c74/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200207183749-b753a1ba74fa/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200212150539-ea181f53ac56/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200224181240-023911ca70b2/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200227222343-706bc42d1f0d/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200304193943-95d2e580d8eb/go.mod h1:o4KQGtdN14AW+yjsvvwRTJJuXz8XRtIHtEnmAXLyFUw= +golang.org/x/tools v0.0.0-20200312045724-11d5b4c81c7d/go.mod h1:o4KQGtdN14AW+yjsvvwRTJJuXz8XRtIHtEnmAXLyFUw= +golang.org/x/tools v0.0.0-20200331025713-a30bf2db82d4/go.mod h1:Sl4aGygMT6LrqrWclx+PTx3U+LnKx/seiNR+3G19Ar8= +golang.org/x/tools v0.0.0-20200501065659-ab2804fb9c9d/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= +golang.org/x/tools v0.0.0-20200512131952-2bc93b1c0c88/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= +golang.org/x/tools v0.0.0-20200515010526-7d3b6ebf133d/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= +golang.org/x/tools v0.0.0-20200618134242-20370b0cb4b2/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= +golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= +golang.org/x/tools v0.0.0-20200729194436-6467de6f59a7/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= +golang.org/x/tools v0.0.0-20200804011535-6c149bb5ef0d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= +golang.org/x/tools v0.0.0-20200825202427-b303f430e36d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= +golang.org/x/tools v0.0.0-20200904185747-39188db58858/go.mod h1:Cj7w3i3Rnn0Xh82ur9kSqwfTHTeVxaDqrfMjpcNT6bE= +golang.org/x/tools v0.0.0-20201110124207-079ba7bd75cd/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= +golang.org/x/tools v0.0.0-20201201161351-ac6f37ff4c2a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= +golang.org/x/tools v0.0.0-20201208233053-a543418bbed2/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= +golang.org/x/tools v0.0.0-20201224043029-2b0845dc783e/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= +golang.org/x/tools v0.0.0-20210105154028-b0ab187a4818/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= +golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= +golang.org/x/tools v0.1.0/go.mod h1:xkSsbof2nBLbhDlRMhhhyNLN/zl3eTqcnHD5viDpcZ0= +golang.org/x/tools v0.1.2/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= +golang.org/x/tools v0.1.5/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 h1:go1bK/D/BFZV2I8cIQd1NKEZ+0owSTG1fDTci4IqFcE= golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= @@ -361,17 +692,101 @@ gonum.org/v1/gonum v0.0.0-20180816165407-929014505bf4/go.mod h1:Y+Yx5eoAFn32cQvJ gonum.org/v1/gonum v0.8.2/go.mod h1:oe/vMfY3deqTw+1EZJhuvEW2iwGF1bW9wwu7XCu0+v0= gonum.org/v1/netlib v0.0.0-20190313105609-8cb42192e0e0/go.mod h1:wa6Ws7BG/ESfp6dHfk7C6KdzKA7wR7u/rKwOGE66zvw= gonum.org/v1/plot v0.0.0-20190515093506-e2840ee46a6b/go.mod h1:Wt8AAjI+ypCyYX3nZBvf6cAIx93T+c/OS2HFAYskSZc= +google.golang.org/api v0.4.0/go.mod h1:8k5glujaEP+g9n7WNsDg8QP6cUVNI86fCNMcbazEtwE= +google.golang.org/api v0.7.0/go.mod h1:WtwebWUNSVBH/HAw79HIFXZNqEvBhG+Ra+ax0hx3E3M= +google.golang.org/api v0.8.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg= +google.golang.org/api v0.9.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg= +google.golang.org/api v0.13.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI= +google.golang.org/api v0.14.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI= +google.golang.org/api v0.15.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI= +google.golang.org/api v0.17.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= +google.golang.org/api v0.18.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= +google.golang.org/api v0.19.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= +google.golang.org/api v0.20.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= +google.golang.org/api v0.22.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= +google.golang.org/api v0.24.0/go.mod h1:lIXQywCXRcnZPGlsd8NbLnOjtAoL6em04bJ9+z0MncE= +google.golang.org/api v0.28.0/go.mod h1:lIXQywCXRcnZPGlsd8NbLnOjtAoL6em04bJ9+z0MncE= +google.golang.org/api v0.29.0/go.mod h1:Lcubydp8VUV7KeIHD9z2Bys/sm/vGKnG1UHuDBSrHWM= +google.golang.org/api v0.30.0/go.mod h1:QGmEvQ87FHZNiUVJkT14jQNYJ4ZJjdRF23ZXz5138Fc= +google.golang.org/api v0.35.0/go.mod h1:/XrVsuzM0rZmrsbjJutiuftIzeuTQcEeaYcSk/mQ1dg= +google.golang.org/api v0.36.0/go.mod h1:+z5ficQTmoYpPn8LCUNVpK5I7hwkpjbcgqA7I34qYtE= +google.golang.org/api v0.40.0/go.mod h1:fYKFpnQN0DsDSKRVRcQSDQNtqWPfM9i+zNPxepjRCQ8= +google.golang.org/api v0.41.0/go.mod h1:RkxM5lITDfTzmyKFPt+wGrCJbVfniCr2ool8kTBzRTU= +google.golang.org/api v0.43.0/go.mod h1:nQsDGjRXMo4lvh5hP0TKqF244gqhGcr/YSIykhUk/94= +google.golang.org/api v0.44.0/go.mod h1:EBOGZqzyhtvMDoxwS97ctnh0zUmYY6CxqXsc1AvkYD8= 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/appengine v1.5.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= +google.golang.org/appengine v1.6.1/go.mod h1:i06prIuMbXzDqacNJfV5OdTW448YApPu5ww/cMBSeb0= +google.golang.org/appengine v1.6.5/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= +google.golang.org/appengine v1.6.6/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= +google.golang.org/appengine v1.6.7/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= +google.golang.org/genproto v0.0.0-20190307195333-5fe7a883aa19/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= +google.golang.org/genproto v0.0.0-20190418145605-e7d98fc518a7/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= +google.golang.org/genproto v0.0.0-20190425155659-357c62f0e4bb/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= +google.golang.org/genproto v0.0.0-20190502173448-54afdca5d873/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= +google.golang.org/genproto v0.0.0-20190801165951-fa694d86fc64/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= -google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013 h1:+kGHl1aib/qcwaRi1CbqBZ1rk19r85MNUf8HaBghugY= +google.golang.org/genproto v0.0.0-20190911173649-1774047e7e51/go.mod h1:IbNlFCBrqXvoKpeg0TB2l7cyZUmoaFKYIwrEpbDKLA8= +google.golang.org/genproto v0.0.0-20191108220845-16a3f7862a1a/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= +google.golang.org/genproto v0.0.0-20191115194625-c23dd37a84c9/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= +google.golang.org/genproto v0.0.0-20191216164720-4f79533eabd1/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= +google.golang.org/genproto v0.0.0-20191230161307-f3c370f40bfb/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= +google.golang.org/genproto v0.0.0-20200115191322-ca5a22157cba/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= +google.golang.org/genproto v0.0.0-20200122232147-0452cf42e150/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= +google.golang.org/genproto v0.0.0-20200204135345-fa8e72b47b90/go.mod h1:GmwEX6Z4W5gMy59cAlVYjN9JhxgbQH6Gn+gFDQe2lzA= +google.golang.org/genproto v0.0.0-20200212174721-66ed5ce911ce/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200224152610-e50cd9704f63/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200228133532-8c2c7df3a383/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200305110556-506484158171/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200312145019-da6875a35672/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200331122359-1ee6d9798940/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200430143042-b979b6f78d84/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200511104702-f5ebc3bea380/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200513103714-09dca8ec2884/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200515170657-fc4c6c6a6587/go.mod h1:YsZOwe1myG/8QRHRsmBRE1LrgQY60beZKjly0O1fX9U= google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo= +google.golang.org/genproto v0.0.0-20200618031413-b414f8b61790/go.mod h1:jDfRM7FcilCzHH/e9qn6dsT145K34l5v+OpcnNgKAAA= +google.golang.org/genproto v0.0.0-20200729003335-053ba62fc06f/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20200804131852-c06518451d9c/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20200825200019-8632dd797987/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20200904004341-0bd0a958aa1d/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20201109203340-2640f1f9cdfb/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20201201144952-b05cb90ed32e/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20201210142538-e3217bee35cc/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20201214200347-8c77b98c765d/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20210222152913-aa3ee6e6a81c/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20210303154014-9728d6b83eeb/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20210310155132-4ce2db91004e/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20210319143718-93e7006c17a6/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20210402141018-6c239bbf2bb1/go.mod h1:9lPAdzaEmUacj36I+k7YKbEc5CXzPIeORRgDAUOu28A= +google.golang.org/genproto v0.0.0-20210602131652-f16073e35f0c/go.mod h1:UODoCrxHCcBojKKwX1terBiRUaqAsFqJiF615XL43r0= +google.golang.org/genproto v0.0.0-20211016002631-37fc39342514 h1:Rp1vYDPD4TdkMH5S/bZbopsGCsWhPcrLBUwOVhAQCxM= +google.golang.org/genproto v0.0.0-20211016002631-37fc39342514/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= -google.golang.org/grpc v1.21.0/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= +google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38= +google.golang.org/grpc v1.21.1/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= -google.golang.org/grpc v1.27.0 h1:rRYRFMVgRv6E0D70Skyfsr28tDXIuuPZyWGMPdMcnXg= +google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQciAY= +google.golang.org/grpc v1.26.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= +google.golang.org/grpc v1.27.1/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= +google.golang.org/grpc v1.28.0/go.mod h1:rpkK4SK4GF4Ach/+MFLZUBavHOvF2JJB5uozKKal+60= +google.golang.org/grpc v1.29.1/go.mod h1:itym6AZVZYACWQqET3MqgPpjcuV5QH3BxFS3IjizoKk= +google.golang.org/grpc v1.30.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= +google.golang.org/grpc v1.31.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= +google.golang.org/grpc v1.31.1/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= +google.golang.org/grpc v1.33.1/go.mod h1:fr5YgcSWrqhRRxogOsw7RzIpsmvOZ6IcH4kBYTpR3n0= +google.golang.org/grpc v1.33.2/go.mod h1:JMHMWHQWaTccqQQlmk3MJZS+GWXOdAesneDmEnv2fbc= +google.golang.org/grpc v1.34.0/go.mod h1:WotjhfgOW/POjDeRt8vscBtXq+2VjORFy659qA51WJ8= +google.golang.org/grpc v1.35.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= +google.golang.org/grpc v1.36.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= +google.golang.org/grpc v1.36.1/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= +google.golang.org/grpc v1.38.0/go.mod h1:NREThFqKR1f3iQ6oBuvc5LadQuXVGo9rkm5ZGrQdJfM= +google.golang.org/grpc v1.40.0/go.mod h1:ogyxbiOoUXAkP+4+xa6PZSE9DZgIHtSpzjDTB9KAK34= +google.golang.org/grpc v1.41.0 h1:f+PlOh7QV4iIJkPrx5NQ7qaNGFQ3OTse67yaDHfju4E= +google.golang.org/grpc v1.41.0/go.mod h1:U3l9uK9J0sini8mHphKoXyaqDA/8VyGnDee1zzIUK6k= 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= @@ -380,33 +795,46 @@ google.golang.org/protobuf v1.21.0/go.mod h1:47Nbq4nVaFHyn7ilMalzfO3qCViNmqZ2kzi google.golang.org/protobuf v1.22.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= google.golang.org/protobuf v1.23.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= google.golang.org/protobuf v1.23.1-0.20200526195155-81db48ad09cc/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= -google.golang.org/protobuf v1.25.0 h1:Ejskq+SyPohKW+1uil0JJMtmHCgJPJ/qWTxr8qp+R4c= +google.golang.org/protobuf v1.24.0/go.mod h1:r/3tXBNzIEhYS9I1OUVjXDlt8tc493IdKGjtUeSXeh4= google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c= +google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= +google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= +google.golang.org/protobuf v1.27.1 h1:SnqbnDw1V7RiZcXPx5MEeqPv2s79L9i7BJUlG/+RurQ= +google.golang.org/protobuf v1.27.1/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f h1:BLraFXnmrev5lT+xlilqcH8XK9/i0At2xKjWk4p6zsU= gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= +gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys= gopkg.in/go-playground/assert.v1 v1.2.1/go.mod h1:9RXL0bg/zibRAgZUYszZSwO/z8Y/a8bDuhia5mkpMnE= gopkg.in/go-playground/validator.v9 v9.29.1/go.mod h1:+c9/zcJMFNgbLvly1L1V+PpxWdVbfP1avr/N00E2vyQ= -gopkg.in/resty.v1 v1.12.0/go.mod h1:mDo4pnntr5jdWRML875a/NmxYqAlA73dVijT2AXvQQo= +gopkg.in/ini.v1 v1.62.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 h1:uRGJdciOHaEIrze2W8Q3AKkepLTh2hOroT7a+7czfdQ= gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw= -gopkg.in/yaml.v2 v2.0.0-20170812160011-eb3733d160e7/go.mod h1:JAlM8MvJe8wmxCU4Bli9HhUf9+ttbYbLASfIpnQbh74= gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.2.3/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.5/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v2 v2.3.0 h1:clyUAQHOM3G0M3f5vQj7LuJrETvjVot3Z5el9nffUtU= gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c h1:dUUwHk2QECo/6vqA44rthZ8ie2QXMNeKRTHCNY2nXvo= +gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= +gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b h1:h8qDotaEPuJATrMmW04NCwg7v22aHH28wwpauUhK9Oo= +gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= +honnef.co/go/tools v0.0.0-20190106161140-3f1c8253044a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= +honnef.co/go/tools v0.0.0-20190418001031-e561f6794a2a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= -honnef.co/go/tools v0.0.1-2019.2.3 h1:3JgtbtFHMiCmsznwGVTUWbgGov+pVqnlf1dEJTNAXeM= honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg= +honnef.co/go/tools v0.0.1-2020.1.3/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= +honnef.co/go/tools v0.0.1-2020.1.4/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= +rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8= rsc.io/pdf v0.1.1/go.mod h1:n8OzWcQ6Sp37PL01nO98y4iUCRdTGarVfzxY20ICaU4= +rsc.io/quote/v3 v3.1.0/go.mod h1:yEA65RcK8LyAZtP9Kv3t0HmxON59tX3rD+tICJqUlj0= +rsc.io/sampler v1.3.0/go.mod h1:T1hPZKmBbMNahiBKFy5HrXp6adAjACjK9JXDnKaTXpA= From 972c042f4d395c6bddeed393a7cafd821054b749 Mon Sep 17 00:00:00 2001 From: Omid Akhavan Date: Sat, 23 Oct 2021 13:01:23 +0330 Subject: [PATCH 036/660] put dynamic namespace nad change created-by lable --- deployments/soteria/templates/_helpers.tpl | 1 + deployments/soteria/templates/configmap.yaml | 1 + deployments/soteria/templates/deployment.yaml | 1 + deployments/soteria/templates/hpa.yaml | 2 ++ deployments/soteria/templates/ingress.yaml | 1 + deployments/soteria/templates/secret.yaml | 3 +++ deployments/soteria/templates/service.yaml | 1 + deployments/soteria/templates/servicemonitor.yaml | 4 +++- deployments/soteria/templates/tests/test-connection.yaml | 1 + 9 files changed, 14 insertions(+), 1 deletion(-) diff --git a/deployments/soteria/templates/_helpers.tpl b/deployments/soteria/templates/_helpers.tpl index 8cefe88a..2e44edc8 100644 --- a/deployments/soteria/templates/_helpers.tpl +++ b/deployments/soteria/templates/_helpers.tpl @@ -40,6 +40,7 @@ helm.sh/chart: {{ include "soteria.chart" . }} app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} {{- end }} app.kubernetes.io/managed-by: {{ .Release.Service }} +app.snappcloud.io/created-by: mozart {{- end }} {{- define "soteria.podLabels" -}} diff --git a/deployments/soteria/templates/configmap.yaml b/deployments/soteria/templates/configmap.yaml index 3d3a971a..7695dcf6 100644 --- a/deployments/soteria/templates/configmap.yaml +++ b/deployments/soteria/templates/configmap.yaml @@ -2,6 +2,7 @@ apiVersion: v1 kind: ConfigMap metadata: name: {{ include "soteria.fullname" . }} + namespace: {{ $.Release.Namespace }} labels: {{- include "soteria.labels" . | nindent 4 }} data: diff --git a/deployments/soteria/templates/deployment.yaml b/deployments/soteria/templates/deployment.yaml index c791adc5..d9bb7a80 100644 --- a/deployments/soteria/templates/deployment.yaml +++ b/deployments/soteria/templates/deployment.yaml @@ -2,6 +2,7 @@ apiVersion: apps/v1 kind: Deployment metadata: name: {{ include "soteria.fullname" . }} + namespace: {{ $.Release.Namespace }} labels: {{- include "soteria.labels" . | nindent 4 }} spec: replicas: {{ .Values.replicaCount }} diff --git a/deployments/soteria/templates/hpa.yaml b/deployments/soteria/templates/hpa.yaml index 691e8fb4..cb7e6848 100644 --- a/deployments/soteria/templates/hpa.yaml +++ b/deployments/soteria/templates/hpa.yaml @@ -3,6 +3,7 @@ apiVersion: autoscaling/v2beta1 kind: HorizontalPodAutoscaler metadata: name: {{ include "soteria.fullname" . }} + namespace: {{ $.Release.Namespace }} labels: {{- include "soteria.labels" . | nindent 4 }} spec: @@ -10,6 +11,7 @@ spec: apiVersion: apps/v1 kind: Deployment name: {{ include "soteria.fullname" . }} + namespace: {{ $.Release.Namespace }} minReplicas: {{ .Values.autoscaling.minReplicas }} maxReplicas: {{ .Values.autoscaling.maxReplicas }} metrics: diff --git a/deployments/soteria/templates/ingress.yaml b/deployments/soteria/templates/ingress.yaml index b259cd16..b7ab2c75 100644 --- a/deployments/soteria/templates/ingress.yaml +++ b/deployments/soteria/templates/ingress.yaml @@ -9,6 +9,7 @@ apiVersion: extensions/v1beta1 kind: Ingress metadata: name: {{ $fullName }} + namespace: {{ $.Release.Namespace }} labels: {{- include "soteria.labels" . | nindent 4 }} {{- with .Values.ingress.annotations }} diff --git a/deployments/soteria/templates/secret.yaml b/deployments/soteria/templates/secret.yaml index 3bf55f59..07f930a3 100644 --- a/deployments/soteria/templates/secret.yaml +++ b/deployments/soteria/templates/secret.yaml @@ -2,6 +2,7 @@ apiVersion: v1 kind: Secret metadata: name: {{ include "soteria.fullname" . }}-auth-envs + namespace: {{ $.Release.Namespace }} labels: {{- include "soteria.labels" . | nindent 4 }} stringData: @@ -16,8 +17,10 @@ apiVersion: v1 kind: Secret metadata: name: {{ include "soteria.fullname" . }}-jwt-keys + namespace: {{ $.Release.Namespace }} labels: {{- include "soteria.labels" . | nindent 4 }} + stringData: {{- range $key, $value := .Values.jwtKeys }} {{- if $value }} diff --git a/deployments/soteria/templates/service.yaml b/deployments/soteria/templates/service.yaml index 21da2a01..01a8a229 100644 --- a/deployments/soteria/templates/service.yaml +++ b/deployments/soteria/templates/service.yaml @@ -2,6 +2,7 @@ apiVersion: v1 kind: Service metadata: name: {{ include "soteria.fullname" . }} + namespace: {{ $.Release.Namespace }} labels: {{- include "soteria.labels" . | nindent 4 }} spec: diff --git a/deployments/soteria/templates/servicemonitor.yaml b/deployments/soteria/templates/servicemonitor.yaml index e759e7f5..8b494c7f 100644 --- a/deployments/soteria/templates/servicemonitor.yaml +++ b/deployments/soteria/templates/servicemonitor.yaml @@ -5,6 +5,8 @@ metadata: name: {{ template "soteria.fullname" . }} {{- if .Values.serviceMonitor.namespace }} namespace: {{ .Values.serviceMonitor.namespace }} + {{ else }} + namespace: {{ $.Release.Namespace }} {{- end }} labels: {{- include "soteria.labels" . | nindent 4 }} @@ -29,7 +31,7 @@ spec: {{- end }} namespaceSelector: matchNames: - - {{ .Release.Namespace }} + - {{ $.Release.Namespace }} selector: matchLabels: {{- include "soteria.selectorLabels" . | nindent 6 }} diff --git a/deployments/soteria/templates/tests/test-connection.yaml b/deployments/soteria/templates/tests/test-connection.yaml index 7ecafaf8..fb669ce6 100644 --- a/deployments/soteria/templates/tests/test-connection.yaml +++ b/deployments/soteria/templates/tests/test-connection.yaml @@ -2,6 +2,7 @@ apiVersion: v1 kind: Pod metadata: name: {{ include "soteria.fullname" . }}-test-connection + namespace: {{ $.Release.Namespace }} labels: {{- include "soteria.labels" . | nindent 4 }} annotations: From 221c3d264ab6b6df32600b24e5a3909cb226b169 Mon Sep 17 00:00:00 2001 From: Parham Alvani Date: Tue, 16 Nov 2021 20:08:28 +0330 Subject: [PATCH 037/660] feat: update modules --- go.mod | 12 ++++++------ go.sum | 15 +++++++++++++++ 2 files changed, 21 insertions(+), 6 deletions(-) diff --git a/go.mod b/go.mod index 1fb5f4ad..0a6e4747 100644 --- a/go.mod +++ b/go.mod @@ -25,8 +25,8 @@ require ( go.uber.org/atomic v1.9.0 // indirect go.uber.org/automaxprocs v1.4.0 go.uber.org/zap v1.19.1 - golang.org/x/crypto v0.0.0-20210921155107-089bfa567519 - google.golang.org/grpc v1.41.0 + golang.org/x/crypto v0.0.0-20211115234514-b4de73f9ece8 + google.golang.org/grpc v1.42.0 google.golang.org/protobuf v1.27.1 // indirect ) @@ -49,17 +49,17 @@ require ( github.com/pkg/errors v0.9.1 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect github.com/prometheus/client_model v0.2.0 // indirect - github.com/prometheus/common v0.31.1 // indirect + github.com/prometheus/common v0.32.1 // indirect github.com/prometheus/procfs v0.7.3 // indirect github.com/speps/go-hashids/v2 v2.0.1 // indirect github.com/spf13/pflag v1.0.5 // indirect github.com/ugorji/go/codec v1.2.6 // indirect github.com/yuin/gopher-lua v0.0.0-20191220021717-ab39c6098bdb // indirect go.uber.org/multierr v1.7.0 // indirect - golang.org/x/net v0.0.0-20211015210444-4f30a5c0130f // indirect - golang.org/x/sys v0.0.0-20211015200801-69063c4bb744 // indirect + golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2 // indirect + golang.org/x/sys v0.0.0-20211116061358-0a5406a5449c // indirect golang.org/x/text v0.3.7 // indirect - google.golang.org/genproto v0.0.0-20211016002631-37fc39342514 // indirect + google.golang.org/genproto v0.0.0-20211115160612-a5da7257a6f7 // indirect gopkg.in/yaml.v2 v2.4.0 // indirect gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b // indirect ) diff --git a/go.sum b/go.sum index 4e250619..8051f0c4 100644 --- a/go.sum +++ b/go.sum @@ -81,8 +81,11 @@ github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDk github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc= github.com/cncf/udpa/go v0.0.0-20200629203442-efcf912fb354/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= github.com/cncf/udpa/go v0.0.0-20201120205902-5459f2c99403/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= +github.com/cncf/udpa/go v0.0.0-20210930031921-04548b0d99d4/go.mod h1:6pvJx4me5XPnfI9Z40ddWsdw2W/uZgQLFXToKeRcDiI= github.com/cncf/xds/go v0.0.0-20210312221358-fbca930ec8ed/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= github.com/cncf/xds/go v0.0.0-20210805033703-aa0b78936158/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= +github.com/cncf/xds/go v0.0.0-20210922020428-25de7278fc84/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= +github.com/cncf/xds/go v0.0.0-20211011173535-cb28da3451f1/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= github.com/coreos/go-semver v0.3.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk= github.com/coreos/go-systemd/v22 v22.3.2/go.mod h1:Y58oyj3AT4RCenI/lSvhwexgC+NSVTIJ3seZv2GcEnc= github.com/cpuguy83/go-md2man/v2 v2.0.0/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU= @@ -346,6 +349,8 @@ github.com/prometheus/common v0.10.0/go.mod h1:Tlit/dnDKsSWFlCLTWaA1cyBgKHSMdTB8 github.com/prometheus/common v0.26.0/go.mod h1:M7rCNAaPfAosfx8veZJCuw84e35h3Cfd9VFqTh1DIvc= github.com/prometheus/common v0.31.1 h1:d18hG4PkHnNAKNMOmFuXFaiY8Us0nird/2m60uS1AMs= github.com/prometheus/common v0.31.1/go.mod h1:vu+V0TpY+O6vW9J44gczi3Ap/oXXR10b+M/gUGO4Hls= +github.com/prometheus/common v0.32.1 h1:hWIdL3N2HoUx3B8j3YN9mWor0qhY/NlEKZEaXxuIRh4= +github.com/prometheus/common v0.32.1/go.mod h1:vu+V0TpY+O6vW9J44gczi3Ap/oXXR10b+M/gUGO4Hls= github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= github.com/prometheus/procfs v0.1.3/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU= @@ -445,6 +450,8 @@ golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPh golang.org/x/crypto v0.0.0-20210711020723-a769d52b0f97/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.0.0-20210921155107-089bfa567519 h1:7I4JAnoQBe7ZtJcBaYHi5UtiO8tQHbUSXxL+pnGRANg= golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= +golang.org/x/crypto v0.0.0-20211115234514-b4de73f9ece8 h1:5QRxNnVsaJP6NAse0UdkRgL3zHMvCRRkrDVLNdNpdy4= +golang.org/x/crypto v0.0.0-20211115234514-b4de73f9ece8/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/exp v0.0.0-20180321215751-8460e604b9de/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20180807140117-3d87b88a115f/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= @@ -528,6 +535,8 @@ golang.org/x/net v0.0.0-20210428140749-89ef3d95e781/go.mod h1:OJAsFXCWl8Ukc7SiCT golang.org/x/net v0.0.0-20210525063256-abc453219eb5/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20211015210444-4f30a5c0130f h1:OfiFi4JbukWwe3lzw+xunroH1mnC1e2Gy5cxNJApiSY= golang.org/x/net v0.0.0-20211015210444-4f30a5c0130f/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= +golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2 h1:CIJ76btIcR3eFI5EgSo6k1qKw9KJexJuRLI9G7Hp5wE= +golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= @@ -614,6 +623,8 @@ golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20210806184541-e5e7981a1069/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20211015200801-69063c4bb744 h1:KzbpndAYEM+4oHRp9JmB2ewj0NHHxO3Z0g7Gus2O1kk= golang.org/x/sys v0.0.0-20211015200801-69063c4bb744/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20211116061358-0a5406a5449c h1:DHcbWVXeY+0Y8HHKR+rbLwnoh2F4tNCY7rTiHJ30RmA= +golang.org/x/sys v0.0.0-20211116061358-0a5406a5449c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= @@ -764,6 +775,8 @@ google.golang.org/genproto v0.0.0-20210402141018-6c239bbf2bb1/go.mod h1:9lPAdzaE google.golang.org/genproto v0.0.0-20210602131652-f16073e35f0c/go.mod h1:UODoCrxHCcBojKKwX1terBiRUaqAsFqJiF615XL43r0= google.golang.org/genproto v0.0.0-20211016002631-37fc39342514 h1:Rp1vYDPD4TdkMH5S/bZbopsGCsWhPcrLBUwOVhAQCxM= google.golang.org/genproto v0.0.0-20211016002631-37fc39342514/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= +google.golang.org/genproto v0.0.0-20211115160612-a5da7257a6f7 h1:0LoCYJF53PEqtJOntKxGD72X/c8Xto5EZ4HLrt9D80I= +google.golang.org/genproto v0.0.0-20211115160612-a5da7257a6f7/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38= google.golang.org/grpc v1.21.1/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= @@ -787,6 +800,8 @@ google.golang.org/grpc v1.38.0/go.mod h1:NREThFqKR1f3iQ6oBuvc5LadQuXVGo9rkm5ZGrQ google.golang.org/grpc v1.40.0/go.mod h1:ogyxbiOoUXAkP+4+xa6PZSE9DZgIHtSpzjDTB9KAK34= google.golang.org/grpc v1.41.0 h1:f+PlOh7QV4iIJkPrx5NQ7qaNGFQ3OTse67yaDHfju4E= google.golang.org/grpc v1.41.0/go.mod h1:U3l9uK9J0sini8mHphKoXyaqDA/8VyGnDee1zzIUK6k= +google.golang.org/grpc v1.42.0 h1:XT2/MFpuPFsEX2fWh3YQtHkZ+WYZFQRfaUgLZYj/p6A= +google.golang.org/grpc v1.42.0/go.mod h1:k+4IHHFw41K8+bbowsex27ge2rCb65oeWqe4jJ590SU= 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= From c8f5ad933f5373ee280a3bc0a3f51e9af49f4e47 Mon Sep 17 00:00:00 2001 From: Parham Alvani Date: Tue, 16 Nov 2021 20:12:39 +0330 Subject: [PATCH 038/660] feat: update gitlab-ci --- .gitlab-ci.yml | 10 -- .gitlab/ci/env/env.conf | 30 ----- .gitlab/ci/scripts/deploy.sh | 70 ---------- .gitlab/ci/scripts/notify-eye.sh | 14 -- .gitlab/ci/scripts/update-environments.sh | 93 ------------- .../ci/templates/deploy.cloud.gitlab-ci.yml | 124 ------------------ .gitlab/ci/templates/deploy.env.gitlab-ci.yml | 16 --- .gitlab/ci/templates/deploy.vm.gitlab-ci.yml | 45 ------- .gitlab/ci/templates/release.gitlab-ci.yml | 51 +------ 9 files changed, 2 insertions(+), 451 deletions(-) delete mode 100644 .gitlab/ci/env/env.conf delete mode 100644 .gitlab/ci/scripts/deploy.sh delete mode 100644 .gitlab/ci/scripts/notify-eye.sh delete mode 100644 .gitlab/ci/scripts/update-environments.sh delete mode 100644 .gitlab/ci/templates/deploy.cloud.gitlab-ci.yml delete mode 100644 .gitlab/ci/templates/deploy.env.gitlab-ci.yml delete mode 100644 .gitlab/ci/templates/deploy.vm.gitlab-ci.yml diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 3a0f4fb7..431a78fd 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -12,18 +12,8 @@ stages: variables: BUILD_PATH: "./" - OKD_TEH1_CLUSTER_ADDRESS: "okd.private.teh-1.snappcloud.io" - OKD_TEH2_CLUSTER_ADDRESS: "okd.private.teh-2.snappcloud.io" - OKD_TEH1_REGISTRY: 'registry.apps.private.teh-1.snappcloud.io' - OKD_TEH2_REGISTRY: 'registry.apps.private.teh-2.snappcloud.io' - PROJECT_SERVICE_NAME: 'soteria' - PROJECT_STAGING: 'realtime-staging' - PROJECT_PRODUCTION_TEH1: 'realtime-production' - PROJECT_PRODUCTION_TEH2: 'rtc' - PROJECT_MOZART: 'mozart' PROJECT_VERSION: "${CI_COMMIT_SHA}" - include: - local: .gitlab/ci/templates/precompile.gitlab-ci.yml - local: .gitlab/ci/templates/compile.gitlab-ci.yml diff --git a/.gitlab/ci/env/env.conf b/.gitlab/ci/env/env.conf deleted file mode 100644 index 5bdbaa25..00000000 --- a/.gitlab/ci/env/env.conf +++ /dev/null @@ -1,30 +0,0 @@ -# Application: Soteria -# Last update: $(date) -# -GIN_MODE=release -SOTERIA_ALLOWED_ACCESS_TYPES='sub,pub' -SOTERIA_CACHE_ENABLED='true' -SOTERIA_CACHE_EXPIRATION=600s -SOTERIA_GRPC_PORT='50051' -SOTERIA_HTTP_PORT='9999' -SOTERIA_LOGGER_LEVEL=ERROR -SOTERIA_LOGGER_SENTRY_DSN='' -SOTERIA_LOGGER_SENTRY_ENABLED='false' -SOTERIA_LOGGER_SENTRY_TIMEOUT=500ms -SOTERIA_REDIS_ADDRESS='emqx-redis-01.app.afra.snapp.infra:6379' -SOTERIA_REDIS_IDLE_CHECK_FREQUENCY=60s -SOTERIA_REDIS_IDLE_TIMEOUT=300s -SOTERIA_REDIS_MAX_RETRIES='0' -SOTERIA_REDIS_MAX_RETRY_BACKOFF=512ms -SOTERIA_REDIS_MIN_IDLE_CONNECTIONS='5' -SOTERIA_REDIS_MIN_RETRY_BACKOFF=8ms -SOTERIA_REDIS_PASS='' -SOTERIA_REDIS_POOL_SIZE='10' -SOTERIA_REDIS_POOL_TIMEOUT=4s -SOTERIA_REDIS_READ_TIMEOUT=3s -SOTERIA_REDIS_SET_MEMBER_EXP_TIME=300s -SOTERIA_DRIVER_SALT='___' -SOTERIA_PASSENGER_SALT='___' -SOTERIA_JWT_KEYS_PATH="/var/lib/soteria/jwt/" -SOTERIA_PASSENGER_HASH_LENGTH=15 -SOTERIA_DRIVER_HASH_LENGTH=15 diff --git a/.gitlab/ci/scripts/deploy.sh b/.gitlab/ci/scripts/deploy.sh deleted file mode 100644 index 708a4039..00000000 --- a/.gitlab/ci/scripts/deploy.sh +++ /dev/null @@ -1,70 +0,0 @@ -#!/usr/bin/env bash -set -eu - -APP_NAME=soteria -APP_USERNAME=soteria -APP_HOME_PATH=/var/lib/${APP_USERNAME} -APP_PATH=/usr/local/bin/${APP_NAME}/ -APP_GREEN_PATH=/usr/local/bin/${APP_NAME}/${APP_NAME}-green -APP_RELEASES_PATH=${APP_HOME_PATH}/releases -APP_LATEST_RELEASE_PATH=${APP_RELEASES_PATH}/"$CI_COMMIT_REF_SLUG-$CI_COMMIT_SHORT_SHA" -APP_HOSTNAME=${APP_HOSTNAME:?Please specify "APP_HOSTNAME", e.g. "APP_HOSTNAME=emqx-01.app.afra.snapp.infra"}; - -#TOTAL_APP_NODES=5 -UNHEALTHY_NODE_EXISTS=0 - -cat << EOF > /etc/resolv.conf -nameserver 172.16.76.22 -nameserver 172.21.49.230 -EOF - -mkdir -p /root/.ssh && touch /root/.ssh/id_rsa -echo "$DEPLOYER_PRIVATE_KEY" > /root/.ssh/id_rsa -chmod 0600 /root/.ssh/id_rsa - - -echo -e "\e[33m# Deployment on \e[1m$APP_HOSTNAME ...\e[0m" - -if ssh -o StrictHostKeyChecking=no "$APP_USERNAME@$APP_HOSTNAME" "stat $APP_RELEASES_PATH/$CI_COMMIT_REF_SLUG-$CI_COMMIT_SHORT_SHA/$APP_NAME > /dev/null 2>&1" -then - echo -e "\e[33m# The release has alredy exist.\e[0m" -else - echo -e "\e[33m# Sending Artifact to Server\e[0m" - rsync -e 'ssh -o "StrictHostKeyChecking=no"' -avz "./artifacts-$CI_COMMIT_REF_SLUG-$CI_COMMIT_SHORT_SHA.tar.gz" "$APP_USERNAME@$APP_HOSTNAME:$APP_HOME_PATH" -fi - - -ssh -o StrictHostKeyChecking=no "$APP_USERNAME@$APP_HOSTNAME" " - mkdir -p ${APP_RELEASES_PATH} ${APP_LATEST_RELEASE_PATH} - - if [ -f "${APP_HOME_PATH}/artifacts-$CI_COMMIT_REF_SLUG-$CI_COMMIT_SHORT_SHA.tar.gz" ]; then - echo -e '\e[33m# Extract Release\e[0m' - tar -xzf ${APP_HOME_PATH}/artifacts-$CI_COMMIT_REF_SLUG-$CI_COMMIT_SHORT_SHA.tar.gz -C ${APP_LATEST_RELEASE_PATH} - rm -f ${APP_HOME_PATH}/artifacts-$CI_COMMIT_REF_SLUG-$CI_COMMIT_SHORT_SHA.tar.gz - fi - - " - -echo -e "\e[33m# Trying to connect to 'http://$APP_HOSTNAME' ...\e[0m" -timeout=60 - - -#done - -echo -echo - -#for i in $(seq 1 ${TOTAL_APP_NODES}); do -# APP_HOSTNAME=$(printf "${APP_NAME}-%02d.app.afra.snapp.infra" ${i}) -echo -e "\e[33m# Connecting to Server\e[0m" - echo -e "\e[33m# Connecting to Server \e[1m$APP_HOSTNAME\e[0m" - ssh -o StrictHostKeyChecking=no "$APP_USERNAME@$APP_HOSTNAME" " - echo -e '\e[33m# Activating Latest Realese\e[0m' - ln -sf ${APP_LATEST_RELEASE_PATH}/$APP_USERNAME ${APP_PATH} - - echo -e '\e[33m# Restarting $APP_NAME ...\e[0m' - sudo systemctl restart $APP_NAME.service - - " - echo -#done diff --git a/.gitlab/ci/scripts/notify-eye.sh b/.gitlab/ci/scripts/notify-eye.sh deleted file mode 100644 index e6347ca1..00000000 --- a/.gitlab/ci/scripts/notify-eye.sh +++ /dev/null @@ -1,14 +0,0 @@ -# To notify matrix about CI job - -MATRIX_SERVER="https://matrix.snapp.cab" -MATRIX_MSQTYPE=m.text -MX_TXN="`date "+%s"`$(( RANDOM % 9999 ))" - - -BODY="[Gitlab🚀] CI run by *$GITLAB_USER_LOGIN* on the $CI_PROJECT_TITLE project: \n Job name : $CI_JOB_NAME \n Commit : $CI_COMMIT_TITLE \n Job url : $CI_JOB_URL " - -# Post into maint room -curl -X PUT --header 'Content-Type: application/json' --header 'Accept: application/json' -d "{ -\"msgtype\": \"$MATRIX_MSQTYPE\", -\"body\": \"$BODY\" - }" "$MATRIX_SERVER/_matrix/client/unstable/rooms/$MATRIX_ROOM_ID/send/m.room.message/$MX_TXN?access_token=$MATRIX_ACCESS_TOKEN" >/dev/nul 2>&1 diff --git a/.gitlab/ci/scripts/update-environments.sh b/.gitlab/ci/scripts/update-environments.sh deleted file mode 100644 index 50ddbb68..00000000 --- a/.gitlab/ci/scripts/update-environments.sh +++ /dev/null @@ -1,93 +0,0 @@ -#!/usr/bin/env bash -set -eu - -APP_NAME=soteria -APP_USERNAME=soteria -APP_HOSTNAME="emqx-0${CI_NODE_INDEX}.app.afra.snapp.infra" -APP_HOME_PATH=/var/lib/${APP_USERNAME} -APP_CONFIG_PATH="/etc/soteria" -ENV_DEFAULT_FILE=.gitlab/ci/env/env.conf -ENV_HOSTNAME=$APP_HOSTNAME -ENV_SOTERIA_JWT_KEYS_PATH=${ENV_SOTERIA_JWT_KEYS_PATH} -ENV_THIRD_PARTY_JWT_PRIVATE_KEY_PRODUCTION=${THIRD_PARTY_JWT_PRIVATE_KEY_PRODUCTION} -ENV_PASSENGER_JWT_PUBLIC_KEY_PRODUCTION=${ENV_PASSENGER_JWT_PUBLIC_KEY_PRODUCTION} -ENV_DRIVER_JWT_PUBLIC_KEY_PRODUCTION=${DRIVER_JWT_PUBLIC_KEY_PRODUCTION} -ENV_THIRD_PARTY_JWT_PUBLIC_KEY_PRODUCTION=${THIRD_PARTY_JWT_PUBLIC_KEY_PRODUCTION} - -cat << EOF > /etc/resolv.conf -nameserver 172.16.76.22 -nameserver 172.21.49.230 -EOF - -mkdir -p /root/.ssh && touch /root/.ssh/id_rsa -echo "$DEPLOYER_PRIVATE_KEY" > /root/.ssh/id_rsa -chmod 0600 /root/.ssh/id_rsa - -sed -i "2s/\(.*\)/\#Last update\:\ $(date)/" $ENV_DEFAULT_FILE - - -while read LINE -do - - - if echo $LINE | egrep -v "^#|^$" >/dev/null 2>&1 - then - - ENV="$(echo $LINE | sed 's/\(.*\)=\(.*\)/\1/g' )" - ENV_NAME="ENV_$ENV" - ENV_VALUE="$(echo $LINE | sed 's/\(.*\)=\(.*\)/\2/g' )" - - echo -e "\e[33m# Ckeck variable \e[1m$ENV_NAME\e[0m" - - if [ -v $ENV_NAME ] - then - - if [ $ENV_VALUE = "'___'" ] - then - - sed -i "s/$ENV\(\s\)*=\(\s\)*'\(.*\)'/$ENV=\'${!ENV_NAME}\'/g" $ENV_DEFAULT_FILE - [ $? -eq 0 ] && echo -e "\e[32m==> Changed variable \e[1m$ENV_NAME\e[0m \e[32mfrom \e[1m$ENV_VALUE\e[0m \e[32mto \e[1m😜\e[0m " - - else - - sed -i "s/$ENV\(\s\)*=\(\s\)*'\(.*\)'/$ENV=\'${!ENV_NAME}\'/g" $ENV_DEFAULT_FILE - [ $? -eq 0 ] && echo -e "\e[32m==> Changed variable \e[1m$ENV_NAME\e[0m \e[32mfrom \e[1m$ENV_VALUE\e[0m \e[32mto \e[1m${!ENV_NAME}\e[0m " - fi - - fi - - fi - -done < $ENV_DEFAULT_FILE - - - - rsync -e 'ssh -o "StrictHostKeyChecking=no"' -avz "$ENV_DEFAULT_FILE" "$APP_USERNAME@$APP_HOSTNAME:$APP_CONFIG_PATH/$APP_NAME.conf" - [ $? -eq 0 ] && echo -e "\e[32m# Connecting to Server \e[1m$APP_HOSTNAME\e[0m \e[32m and update \e[1m$APP_CONFIG_PATH/$APP_NAME.conf\e[0m" - echo - - if [ -v UPDATE_ENVIRONMENT_VARIABLE ] - then - ssh -o StrictHostKeyChecking=no "$APP_USERNAME@$APP_HOSTNAME" " - - echo -e '\e[33m# Restarting $APP_NAME ...\e[0m' - sudo systemctl restart $APP_NAME.service - - " - fi - -## JWT keys - -mkdir jwt -echo "${ENV_DRIVER_JWT_PUBLIC_KEY_PRODUCTION}" > "jwt"/0.pem -echo "${ENV_PASSENGER_JWT_PUBLIC_KEY_PRODUCTION}" > "jwt"/1.pem -echo "${ENV_THIRD_PARTY_JWT_PUBLIC_KEY_PRODUCTION}" > "jwt"/100.pem -echo "${ENV_THIRD_PARTY_JWT_PRIVATE_KEY_PRODUCTION}" > "jwt"/100.private.pem -rsync -e 'ssh -o "StrictHostKeyChecking=no"' -avz ./jwt/* "$APP_USERNAME@$APP_HOSTNAME:${ENV_SOTERIA_JWT_KEYS_PATH}" -rm -r jwt - -### Green service config file -# sed -i "1s/\(.*\)/\# Application: $APP_NAME-green /" $ENV_DEFAULT_FILE -sed -i "2s/\(.*\)/\# Last update: $(date) /" $ENV_DEFAULT_FILE -sed -i "s/SOTERIA_HTTP_PORT\(\s\)*=\(\s\)*'\(.*\)'/ENV_NAME=\'9998\'/g" $ENV_DEFAULT_FILE -rsync -e 'ssh -o "StrictHostKeyChecking=no"' -avz "$ENV_DEFAULT_FILE" "$APP_USERNAME@$APP_HOSTNAME:$APP_CONFIG_PATH/$APP_NAME-green.conf" diff --git a/.gitlab/ci/templates/deploy.cloud.gitlab-ci.yml b/.gitlab/ci/templates/deploy.cloud.gitlab-ci.yml deleted file mode 100644 index e82f44a8..00000000 --- a/.gitlab/ci/templates/deploy.cloud.gitlab-ci.yml +++ /dev/null @@ -1,124 +0,0 @@ -.deploy_template: &deploy_job_definition - image: openshift/origin-cli:v3.10 - stage: deploy - before_script: - - oc version - - oc login https://${DEPLOY_ADDRESS} --token=${DEPLOY_TOKEN} - - oc project ${DEPLOY_PROJECT} - - - oc process -f .okd/DeploymentConfig.yaml --param APP_IMAGE=${CONTAINER_REGISTRY_IMAGE} --param SERVICE_NAME=${DEPLOY_SERVICE_NAME} | oc apply -f - - - | - oc process -f .okd/ConfigMap.yaml \ - --param SERVICE_NAME="${DEPLOY_SERVICE_NAME}" \ - --param APP_VERSION="${PROJECT_VERSION}" \ - --param REDIS_ADDR="${DEPLOY_REDIS_ADDR}" \ - --param REDIS_PASS="${DEPLOY_REDIS_PASS}" \ - --param TRACER_ENABLED=${DEPLOY_TRACER_ENABLED} \ - --param TRACER_HOST=${DEPLOY_TRACER_HOST} \ - --param CI_COMMIT_REF_SLUG="${CI_COMMIT_REF_SLUG}" | oc apply -f - - - | - oc process -f .okd/Secret.yaml \ - --param SERVICE_NAME="${DEPLOY_SERVICE_NAME}" \ - --param APP_VERSION="${PROJECT_VERSION}" \ - --param CI_COMMIT_REF_SLUG="${CI_COMMIT_REF_SLUG}" \ - --param PASSENGER_HASH_SALT="${DEPLOY_PASSENGER_SALT}" \ - --param PASSENGER_HASH_LENGTH=15 \ - --param DRIVER_HASH_SALT="${DEPLOY_DRIVER_SALT}" \ - --param DRIVER_HASH_LENGTH=15 \ - --param DRIVER_JWT_PUBLIC_KEY="${DEPLOY_DRIVER_JWT_PUBLIC_KEY}" \ - --param PASSENGER_JWT_PUBLIC_KEY="${DEPLOY_PASSENGER_JWT_PUBLIC_KEY}" \ - --param THIRD_PARTY_JWT_PUBLIC_KEY="${DEPLOY_THIRD_PARTY_JWT_PUBLIC_KEY}" \ - --param THIRD_PARTY_JWT_PRIVATE_KEY="${DEPLOY_THIRD_PARTY_JWT_PRIVATE_KEY}" | oc apply -f - - - | - oc process -f .okd/AutoScaler.yaml \ - --param MIN_REPLICA=${DEPLOY_MIN_REPLICA} \ - --param MAX_REPLICA=${DEPLOY_MAX_REPLICA} \ - --param CPU_UTILIZATION=${DEPLOY_CPU_UTILIZATION} | oc apply -f - - - oc process -f .okd/Route.yaml --param APP_HOST=${DEPLOY_SERVICE_NAME} --param SERVICE_NAME=${DEPLOY_SERVICE_NAME} | oc apply -f - - - oc process -f .okd/Service.yaml --param SERVICE_NAME=${DEPLOY_SERVICE_NAME} | oc apply -f - - script: - - oc rollout latest dc/${DEPLOY_SERVICE_NAME} - only: - - tags - except: - variables: - - $UPDATE_ENVIRONMENT_VARIABLE - when: manual - -deploy:staging:teh_1: - <<: *deploy_job_definition - variables: - DEPLOY_MIN_REPLICA: "1" - DEPLOY_MAX_REPLICA: "2" - DEPLOY_CPU_UTILIZATION: "80" - CONTAINER_REGISTRY_IMAGE: "$PROJECT_STAGING/${PROJECT_SERVICE_NAME}:$CI_COMMIT_REF_SLUG" - DEPLOY_ADDRESS: "${OKD_TEH1_CLUSTER_ADDRESS}" - DEPLOY_PROJECT: "${PROJECT_STAGING}" - DEPLOY_TOKEN: "${OKD_STAGING_TOKEN}" - DEPLOY_PASSENGER_SALT: "${PASSENGER_SALT_DEV}" - DEPLOY_DRIVER_SALT: "${DRIVER_SALT_DEV}" - DEPLOY_SERVICE_NAME: "${PROJECT_SERVICE_NAME}-staging" - DEPLOY_DRIVER_JWT_PUBLIC_KEY: "${DRIVER_JWT_PUBLIC_KEY_MOZART}" - DEPLOY_PASSENGER_JWT_PUBLIC_KEY: "${PASSENGER_JWT_PUBLIC_KEY_MOZART}" - DEPLOY_THIRD_PARTY_JWT_PUBLIC_KEY: "${THIRD_PARTY_JWT_PUBLIC_KEY_MOZART}" - DEPLOY_THIRD_PARTY_JWT_PRIVATE_KEY: "${THIRD_PARTY_JWT_PRIVATE_KEY_MOZART}" - DEPLOY_REDIS_ADDR: "soteria-redis-haproxy:6379" - DEPLOY_TRACER_ENABLED: "false" - DEPLOY_TRACER_HOST: "localhost" - - only: - - master - - branches - except: - variables: - - $UPDATE_ENVIRONMENT_VARIABLE - needs: ["release:staging"] - -deploy:production:teh_1: - <<: *deploy_job_definition -# Extends the global template so it add an after_script step for deployment announcement - extends: .deployments_after_script - variables: - DEPLOY_MIN_REPLICA: "3" - DEPLOY_MAX_REPLICA: "20" - DEPLOY_CPU_UTILIZATION: "65" - CONTAINER_REGISTRY_IMAGE: "$PROJECT_PRODUCTION_TEH1/$PROJECT_SERVICE_NAME:$CI_COMMIT_REF_SLUG" - DEPLOY_ADDRESS: "${OKD_TEH1_CLUSTER_ADDRESS}" - DEPLOY_PROJECT: "${PROJECT_PRODUCTION_TEH1}" - DEPLOY_TOKEN: "${OKD_PRODUCTION_TOKEN_TEH1}" - DEPLOY_PASSENGER_SALT: "${PASSENGER_SALT_PRODUCTION}" - DEPLOY_DRIVER_SALT: "${DRIVER_SALT_PRODUCTION}" - DEPLOY_SERVICE_NAME: "${PROJECT_SERVICE_NAME}" - DEPLOY_DRIVER_JWT_PUBLIC_KEY: "${DRIVER_JWT_PUBLIC_KEY_PRODUCTION}" - DEPLOY_PASSENGER_JWT_PUBLIC_KEY: "${PASSENGER_JWT_PUBLIC_KEY_PRODUCTION}" - DEPLOY_THIRD_PARTY_JWT_PUBLIC_KEY: "${THIRD_PARTY_JWT_PUBLIC_KEY_PRODUCTION}" - DEPLOY_THIRD_PARTY_JWT_PRIVATE_KEY: "${THIRD_PARTY_JWT_PRIVATE_KEY_PRODUCTION}" - DEPLOY_REDIS_ADDR: "soteria-redis-haproxy.realtime-production.svc:6379" - CI_DEPLOYMENT_INFRA: "teh-1" - DEPLOY_TRACER_ENABLED: "false" - DEPLOY_TRACER_HOST: "localhost" - needs: ["release:production:teh-1"] - -deploy:production:teh_2: - <<: *deploy_job_definition -# Extends the global template so it add an after_script step for deployment announcement - extends: .deployments_after_script - variables: - DEPLOY_MIN_REPLICA: "3" - DEPLOY_MAX_REPLICA: "20" - DEPLOY_CPU_UTILIZATION: "70" - CONTAINER_REGISTRY_IMAGE: "$PROJECT_PRODUCTION_TEH2/$PROJECT_SERVICE_NAME:$CI_COMMIT_REF_SLUG" - DEPLOY_ADDRESS: "${OKD_TEH2_CLUSTER_ADDRESS}" - DEPLOY_PROJECT: "${PROJECT_PRODUCTION_TEH2}" - DEPLOY_TOKEN: "${OKD_PRODUCTION_TOKEN_TEH2}" - DEPLOY_PASSENGER_SALT: "${PASSENGER_SALT_PRODUCTION}" - DEPLOY_DRIVER_SALT: "${DRIVER_SALT_PRODUCTION}" - DEPLOY_SERVICE_NAME: "${PROJECT_SERVICE_NAME}" - DEPLOY_DRIVER_JWT_PUBLIC_KEY: "${DRIVER_JWT_PUBLIC_KEY_PRODUCTION}" - DEPLOY_PASSENGER_JWT_PUBLIC_KEY: "${PASSENGER_JWT_PUBLIC_KEY_PRODUCTION}" - DEPLOY_THIRD_PARTY_JWT_PUBLIC_KEY: "${THIRD_PARTY_JWT_PUBLIC_KEY_PRODUCTION}" - DEPLOY_THIRD_PARTY_JWT_PRIVATE_KEY: "${THIRD_PARTY_JWT_PRIVATE_KEY_PRODUCTION}" - DEPLOY_REDIS_ADDR: "soteria-redis-haproxy.realtime-production.svc:6379" - CI_DEPLOYMENT_INFRA: "teh-2" - DEPLOY_TRACER_ENABLED: "false" - DEPLOY_TRACER_HOST: "localhost" - needs: ["release:production:teh-2"] diff --git a/.gitlab/ci/templates/deploy.env.gitlab-ci.yml b/.gitlab/ci/templates/deploy.env.gitlab-ci.yml deleted file mode 100644 index 8eaf3e89..00000000 --- a/.gitlab/ci/templates/deploy.env.gitlab-ci.yml +++ /dev/null @@ -1,16 +0,0 @@ -update:env: - image: registry.snapp.tech/docker/deployer:alpine3.11 - stage: deploy - parallel: 5 - variables: - DEPLOYER_PRIVATE_KEY: ${DEPLOYER_PRIVATE_KEY} - script: - - chmod +x .gitlab/ci/scripts/update-environments.sh - - echo "Update ENV Soteria-0${CI_NODE_INDEX}" - - .gitlab/ci/scripts/update-environments.sh - - chmod +x .gitlab/ci/scripts/notify-eye.sh - - echo "Send notif to Dispatching-alert room ..." - - .gitlab/ci/scripts/notify-eye.sh - rules: - - if: '$UPDATE_ENVIRONMENT_VARIABLE == "true"' - when: manual \ No newline at end of file diff --git a/.gitlab/ci/templates/deploy.vm.gitlab-ci.yml b/.gitlab/ci/templates/deploy.vm.gitlab-ci.yml deleted file mode 100644 index 4af5c32c..00000000 --- a/.gitlab/ci/templates/deploy.vm.gitlab-ci.yml +++ /dev/null @@ -1,45 +0,0 @@ -deploy:production:vm: -# Extends the global template so it add an after_script step for deployment announcement - extends: .deployments_after_script - image: registry.snapp.tech/docker/deployer:alpine3.11 - stage: deploy - parallel: 5 - variables: -# Add a variable to specify where deployment will be happened for announcement - CI_DEPLOYMENT_INFRA: "Afranet" - DEPLOYER_PRIVATE_KEY: ${DEPLOYER_PRIVATE_KEY} - APP_HOSTNAME: "emqx-0${CI_NODE_INDEX}.app.afra.snapp.infra" - before_script: - - tar -C ${BUILD_PATH} -cvzf "artifacts-$CI_COMMIT_REF_SLUG-$CI_COMMIT_SHORT_SHA.tar.gz" ${CI_PROJECT_NAME} - script: - - chmod +x ./.gitlab/ci/scripts/deploy.sh - - echo "Deploy Soteria-0${CI_NODE_INDEX}" - - ./.gitlab/ci/scripts/deploy.sh - needs: ["compile"] - only: - - tag - except: - variables: - - $UPDATE_ENVIRONMENT_VARIABLE - when: manual - -deploy:env: - image: registry.snapp.tech/docker/deployer:alpine3.11 - stage: deploy - parallel: 5 - variables: - DEPLOYER_PRIVATE_KEY: ${DEPLOYER_PRIVATE_KEY} - script: - - chmod +x .gitlab/ci/scripts/update-environments.sh - - echo "Update ENV Soteria-0${CI_NODE_INDEX}" - - .gitlab/ci/scripts/update-environments.sh - - chmod +x .gitlab/ci/scripts/notify-eye.sh - - echo "Send notif to Dispatching-alert room ..." - - .gitlab/ci/scripts/notify-eye.sh - needs: ['compile'] - only: - - tag - except: - variables: - - $UPDATE_ENVIRONMENT_VARIABLE - when: manual diff --git a/.gitlab/ci/templates/release.gitlab-ci.yml b/.gitlab/ci/templates/release.gitlab-ci.yml index 66c6f482..b4b0048c 100644 --- a/.gitlab/ci/templates/release.gitlab-ci.yml +++ b/.gitlab/ci/templates/release.gitlab-ci.yml @@ -1,22 +1,5 @@ --- -release:staging: - extends: .easy_ci:release:docker - variables: - RELEASE_CONTAINER_REGISTRY_ADDRESS: "$OKD_TEH1_REGISTRY" - RELEASE_CONTAINER_REGISTRY_IMAGE: "$OKD_TEH1_REGISTRY/$PROJECT_STAGING/$CI_PROJECT_NAME" - RELEASE_CONTAINER_REGISTRY_USERNAME: "gitlab-ci" - RELEASE_CONTAINER_REGISTRY_PASSWORD: "$OKD_STAGING_TOKEN" - dependencies: - - build - only: - - master - - tags - - branches - except: - variables: - - $UPDATE_ENVIRONMENT_VARIABLE - -release:staging:okd4:teh-1: +release:staging:teh-1: extends: .easy_ci:release:docker variables: OKD4_TEH1_REGISTRY: "image-registry.apps.private.okd4.teh-1.snappcloud.io" @@ -37,7 +20,7 @@ release:mozart: extends: .easy_ci:release:docker variables: RELEASE_CONTAINER_REGISTRY_ADDRESS: "$OKD_TEH1_REGISTRY" - RELEASE_CONTAINER_REGISTRY_IMAGE: "$OKD_TEH1_REGISTRY/$PROJECT_MOZART/$CI_PROJECT_NAME" + RELEASE_CONTAINER_REGISTRY_IMAGE: "$OKD_TEH1_REGISTRY/mozart/$CI_PROJECT_NAME" RELEASE_CONTAINER_REGISTRY_USERNAME: "gitlab-ci" RELEASE_CONTAINER_REGISTRY_PASSWORD: "$OKD_MOZART_TOKEN" dependencies: @@ -52,36 +35,6 @@ release:mozart: when: manual release:production:teh-1: - extends: .easy_ci:release:docker - variables: - RELEASE_CONTAINER_REGISTRY_ADDRESS: "$OKD_TEH1_REGISTRY" - RELEASE_CONTAINER_REGISTRY_IMAGE: "$OKD_TEH1_REGISTRY/$PROJECT_PRODUCTION_TEH1/$CI_PROJECT_NAME" - RELEASE_CONTAINER_REGISTRY_USERNAME: "gitlab-ci" - RELEASE_CONTAINER_REGISTRY_PASSWORD: "$OKD_PRODUCTION_TOKEN_TEH1" - dependencies: - - build - only: - - tags - except: - variables: - - $UPDATE_ENVIRONMENT_VARIABLE - -release:production:teh-2: - extends: .easy_ci:release:docker - variables: - RELEASE_CONTAINER_REGISTRY_ADDRESS: "$OKD_TEH2_REGISTRY" - RELEASE_CONTAINER_REGISTRY_IMAGE: "$OKD_TEH2_REGISTRY/$PROJECT_PRODUCTION_TEH2/$CI_PROJECT_NAME" - RELEASE_CONTAINER_REGISTRY_USERNAME: "gitlab-ci" - RELEASE_CONTAINER_REGISTRY_PASSWORD: "$OKD_PRODUCTION_TOKEN_TEH2" - dependencies: - - build - only: - - tags - except: - variables: - - $UPDATE_ENVIRONMENT_VARIABLE - -release:production:okd4:teh-1: extends: .easy_ci:release:docker variables: OKD4_TEH1_REGISTRY: "image-registry.apps.private.okd4.teh-1.snappcloud.io" From 49dbb392e4f37abc82687a17b690ac3e0fcf564c Mon Sep 17 00:00:00 2001 From: Parham Alvani Date: Tue, 16 Nov 2021 20:15:58 +0330 Subject: [PATCH 039/660] feat: update gitlab-ci --- .gitlab-ci.yml | 4 ---- 1 file changed, 4 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 431a78fd..484c3a80 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -8,7 +8,6 @@ stages: - test - build - release - - deploy variables: BUILD_PATH: "./" @@ -21,9 +20,6 @@ include: - local: .gitlab/ci/templates/build.gitlab-ci.yml - local: .gitlab/ci/templates/release.gitlab-ci.yml - local: .gitlab/ci/templates/chart.gitlab-ci.yml - - local: .gitlab/ci/templates/deploy.vm.gitlab-ci.yml - - local: .gitlab/ci/templates/deploy.env.gitlab-ci.yml - - local: .gitlab/ci/templates/deploy.cloud.gitlab-ci.yml - project: dispatching/igniteg/easy-ci ref: main From 2238f2d12222878c5e59d010861ec515957ac262 Mon Sep 17 00:00:00 2001 From: Parham Alvani Date: Tue, 16 Nov 2021 20:22:18 +0330 Subject: [PATCH 040/660] feat: update gitlab-ci --- .gitlab/ci/templates/release.gitlab-ci.yml | 16 +++------------- 1 file changed, 3 insertions(+), 13 deletions(-) diff --git a/.gitlab/ci/templates/release.gitlab-ci.yml b/.gitlab/ci/templates/release.gitlab-ci.yml index b4b0048c..450edb89 100644 --- a/.gitlab/ci/templates/release.gitlab-ci.yml +++ b/.gitlab/ci/templates/release.gitlab-ci.yml @@ -12,9 +12,7 @@ release:staging:teh-1: only: - tags - branches - except: - variables: - - $UPDATE_ENVIRONMENT_VARIABLE + when: manual release:mozart: extends: .easy_ci:release:docker @@ -26,12 +24,8 @@ release:mozart: dependencies: - build only: - - master - tags - branches - except: - variables: - - $UPDATE_ENVIRONMENT_VARIABLE when: manual release:production:teh-1: @@ -46,9 +40,7 @@ release:production:teh-1: - build only: - tags - except: - variables: - - $UPDATE_ENVIRONMENT_VARIABLE + when: manual release:production:baly: extends: .easy_ci:release:docker @@ -62,6 +54,4 @@ release:production:baly: - build only: - tags - except: - variables: - - $UPDATE_ENVIRONMENT_VARIABLE + when: manual From de051cd619b020c813390a5e5a9874290b11a589 Mon Sep 17 00:00:00 2001 From: Parham Alvani Date: Tue, 16 Nov 2021 20:22:27 +0330 Subject: [PATCH 041/660] feat: remove init function --- cmd/soteria/soteria.go | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/cmd/soteria/soteria.go b/cmd/soteria/soteria.go index 2d2c3bf6..3e95c453 100644 --- a/cmd/soteria/soteria.go +++ b/cmd/soteria/soteria.go @@ -7,17 +7,15 @@ import ( "gitlab.snapp.ir/dispatching/soteria/v3/internal/commands/accounts" ) -var cli = commands.Root +func main() { + cli := commands.Root -func init() { cli.AddCommand(commands.Serve) accounts.Accounts.AddCommand(accounts.Init) cli.AddCommand(accounts.Accounts) cli.AddCommand(commands.Token) -} -func main() { if err := cli.Execute(); err != nil { log.Fatal(err) } From 9fc572d016c6a914d72f7262390fa3aa29b27a93 Mon Sep 17 00:00:00 2001 From: Parham Alvani Date: Tue, 16 Nov 2021 21:29:08 +0330 Subject: [PATCH 042/660] feat: remove python client --- scripts/cli/.gitignore | 152 -------------- scripts/cli/acl.py | 18 -- scripts/cli/auth.py | 16 -- scripts/cli/main.py | 267 ------------------------- scripts/cli/poetry.lock | 217 -------------------- scripts/cli/pyproject.toml | 19 -- scripts/cli/soteria/__init__.py | 2 - scripts/cli/soteria/account.py | 14 -- scripts/cli/soteria/account_manager.py | 92 --------- scripts/cli/soteria/emq_store.py | 23 --- scripts/cli/soteria/rule.py | 9 - scripts/cli/vars.py | 11 - 12 files changed, 840 deletions(-) delete mode 100644 scripts/cli/.gitignore delete mode 100644 scripts/cli/acl.py delete mode 100644 scripts/cli/auth.py delete mode 100644 scripts/cli/main.py delete mode 100644 scripts/cli/poetry.lock delete mode 100644 scripts/cli/pyproject.toml delete mode 100644 scripts/cli/soteria/__init__.py delete mode 100644 scripts/cli/soteria/account.py delete mode 100644 scripts/cli/soteria/account_manager.py delete mode 100644 scripts/cli/soteria/emq_store.py delete mode 100644 scripts/cli/soteria/rule.py delete mode 100644 scripts/cli/vars.py diff --git a/scripts/cli/.gitignore b/scripts/cli/.gitignore deleted file mode 100644 index 57feb1a3..00000000 --- a/scripts/cli/.gitignore +++ /dev/null @@ -1,152 +0,0 @@ - -# Created by https://www.toptal.com/developers/gitignore/api/python -# Edit at https://www.toptal.com/developers/gitignore?templates=python - -### Python ### -# Byte-compiled / optimized / DLL files -__pycache__/ -*.py[cod] -*$py.class - -# C extensions -*.so - -# Distribution / packaging -.Python -build/ -develop-eggs/ -dist/ -downloads/ -eggs/ -.eggs/ -parts/ -sdist/ -var/ -wheels/ -pip-wheel-metadata/ -share/python-wheels/ -*.egg-info/ -.installed.cfg -*.egg -MANIFEST - -# PyInstaller -# Usually these files are written by a python script from a template -# before PyInstaller builds the exe, so as to inject date/other infos into it. -*.manifest -*.spec - -# Installer logs -pip-log.txt -pip-delete-this-directory.txt - -# Unit test / coverage reports -htmlcov/ -.tox/ -.nox/ -.coverage -.coverage.* -.cache -nosetests.xml -coverage.xml -*.cover -*.py,cover -.hypothesis/ -.pytest_cache/ -pytestdebug.log - -# Translations -*.mo -*.pot - -# Django stuff: -*.log -local_settings.py -db.sqlite3 -db.sqlite3-journal - -# Flask stuff: -instance/ -.webassets-cache - -# Scrapy stuff: -.scrapy - -# Sphinx documentation -docs/_build/ -doc/_build/ - -# PyBuilder -target/ - -# Jupyter Notebook -.ipynb_checkpoints - -# IPython -profile_default/ -ipython_config.py - -# pyenv -.python-version - -# pipenv -# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control. -# However, in case of collaboration, if having platform-specific dependencies or dependencies -# having no cross-platform support, pipenv may install dependencies that don't work, or not -# install all needed dependencies. -#Pipfile.lock - -# poetry -#poetry.lock - -# PEP 582; used by e.g. github.com/David-OConnor/pyflow -__pypackages__/ - -# Celery stuff -celerybeat-schedule -celerybeat.pid - -# SageMath parsed files -*.sage.py - -# Environments -# .env -.env/ -.venv/ -env/ -venv/ -ENV/ -env.bak/ -venv.bak/ -pythonenv* - -# Spyder project settings -.spyderproject -.spyproject - -# Rope project settings -.ropeproject - -# mkdocs documentation -/site - -# mypy -.mypy_cache/ -.dmypy.json -dmypy.json - -# Pyre type checker -.pyre/ - -# pytype static type analyzer -.pytype/ - -# operating system-related files -*.DS_Store #file properties cache/storage on macOS -Thumbs.db #thumbnail cache on Windows - -# profiling data -.prof - - -# End of https://www.toptal.com/developers/gitignore/api/python diff --git a/scripts/cli/acl.py b/scripts/cli/acl.py deleted file mode 100644 index 11748df6..00000000 --- a/scripts/cli/acl.py +++ /dev/null @@ -1,18 +0,0 @@ -import requests - -from vars import DRIVER_TOKEN, PUBLISH - -base_url = "https://soteria-snapp-ode-012.apps.private.teh-1.snappcloud.io" -acl_url = base_url + "/acl" - - -res = requests.post( - acl_url, - data={ - "access": PUBLISH, - "token": DRIVER_TOKEN, - "topic": "snapp/driver/1234/location", - }, -) - -print(res.content) diff --git a/scripts/cli/auth.py b/scripts/cli/auth.py deleted file mode 100644 index 0131e60b..00000000 --- a/scripts/cli/auth.py +++ /dev/null @@ -1,16 +0,0 @@ -import requests - -from vars import DRIVER_TOKEN - -base_url = "https://soteria-snapp-ode-012.apps.private.teh-1.snappcloud.io" -auth_url = base_url + "/auth" - - -res = requests.post( - auth_url, - data={ - "token": DRIVER_TOKEN, - }, -) - -print(res.content) diff --git a/scripts/cli/main.py b/scripts/cli/main.py deleted file mode 100644 index 7d2651fd..00000000 --- a/scripts/cli/main.py +++ /dev/null @@ -1,267 +0,0 @@ -import pprint - -import click - -import soteria - -pp = pprint.PrettyPrinter(indent=4) - - -@click.group() -@click.option("--base", "-b", required=True, type=str) -@click.pass_context -def cli(ctx, base): - ctx.ensure_object(dict) - - ctx.obj["BASE"] = base - - -@cli.command() -@click.option( - "--username", - "-u", - required=True, - type=str, - help="account username e.g. driver", -) -@click.option( - "--password", - "-p", - required=True, - type=str, - help="account password e.g. password", -) -@click.pass_context -def show(ctx, username: str, password: str): - account_manager = soteria.AccountManager(ctx.obj["BASE"]) - try: - resp = account_manager.show(username, password) - click.echo(pp.pformat(resp)) - except Exception as exep: - raise click.ClickException(str(exep)) - - -@cli.command() -@click.option( - "--username", - "-u", - required=True, - type=str, - help="account username e.g. driver", -) -@click.option( - "--password", - "-p", - required=True, - type=str, - help="account password e.g. password", -) -@click.option( - "--user-type", - "-t", - required=True, - type=click.Choice(["herald", "emq", "staff"]), -) -@click.pass_context -def new(ctx, username: str, password: str, user_type: str): - account_manager = soteria.AccountManager(ctx.obj["BASE"]) - try: - resp = account_manager.new(username, password, user_type) - click.echo(pp.pformat(resp)) - except Exception as exep: - raise click.ClickException(str(exep)) - - -@cli.command() -@click.option( - "--username", - "-u", - required=True, - type=str, - help="account username e.g. driver", -) -@click.option( - "--password", - "-p", - required=True, - type=str, - help="account password e.g. password", -) -@click.option( - "--access-type", - "-a", - required=True, - type=click.Choice(["pub", "sub", "pubsub"]), -) -@click.option( - "--topic", - "-t", - required=True, - type=str, - help="topic regular expressions are defined in soteria and has their name" - "so please refer to soteria", -) -@click.pass_context -def rules_add(ctx, username: str, password: str, access_type: str, topic: str): - account_manager = soteria.AccountManager(ctx.obj["BASE"]) - try: - resp = account_manager.add_rule(username, password, topic, access_type) - click.echo(pp.pformat(resp)) - except Exception as exep: - raise click.ClickException(str(exep)) - - -@cli.command() -@click.option( - "--username", - "-u", - required=True, - type=str, - help="account username e.g. driver", -) -@click.option( - "--password", - "-p", - required=True, - type=str, - help="account password e.g. password", -) -@click.option( - "--expire", - "-e", - required=True, - type=int, - help="token expiration time in nanoseconds", -) -@click.pass_context -def set_expire( - ctx, - username: str, - password: str, - expire: int, -): - account_manager = soteria.AccountManager(ctx.obj["BASE"]) - try: - resp = account_manager.set_expiration(username, password, expire) - click.echo(pp.pformat(resp)) - except Exception as exep: - raise click.ClickException(str(exep)) - - -@cli.command() -@click.option( - "--username", - "-u", - required=True, - type=str, - help="account username e.g. driver", -) -@click.option( - "--password", - "-p", - required=True, - type=str, - help="account password e.g. password", -) -@click.option( - "--secret", - "-s", - required=True, - type=str, - help="account secret which is different from password and" - "is used to generate token", -) -@click.pass_context -def set_secret( - ctx, - username: str, - password: str, - secret: str, -): - account_manager = soteria.AccountManager(ctx.obj["BASE"]) - try: - resp = account_manager.set_secret(username, password, secret) - click.echo(pp.pformat(resp)) - except Exception as exep: - raise click.ClickException(str(exep)) - - -@cli.command() -@click.option( - "--username", - "-u", - required=True, - type=str, - help="account username e.g. driver", -) -@click.option( - "--secret", - "-s", - required=True, - type=str, - help="account secret which is different from password and" - "is used to generate token", -) -@click.option( - "--grant-type", - "-t", - required=True, - type=click.Choice(["pub", "sub", "pubsub"]), -) -@click.pass_context -def token( - ctx, - username: str, - secret: str, - grant_type: str, -): - account_manager = soteria.AccountManager(ctx.obj["BASE"]) - try: - token = account_manager.token(username, secret, grant_type) - click.echo(token) - except Exception as exep: - raise click.ClickException(str(exep)) - -@cli.command() -@click.option( - "--username", - "-u", - required=True, - type=str, - help="account username e.g. driver", -) -@click.option( - "--password", - "-p", - required=True, - type=str, - help="account password e.g. password", -) -@click.option( - "--duration", - "-d", - required=True, - type=int, - help="token expiration time in nanoseconds", -) -@click.pass_context -def superuser(ctx, username: str, password: str, duration: int): - emq_store = soteria.EMQStore(ctx.obj["BASE"]) - try: - resp = emq_store.new(username, password, duration) - click.echo(pp.pformat(resp)) - except Exception as exep: - raise click.ClickException(str(exep)) - -@cli.command() -@click.pass_context -def superusers(ctx): - emq_store = soteria.EMQStore(ctx.obj["BASE"]) - try: - resp = emq_store.get() - click.echo(pp.pformat(resp)) - except Exception as exep: - raise click.ClickException(str(exep)) - -if __name__ == "__main__": - cli(obj={}) diff --git a/scripts/cli/poetry.lock b/scripts/cli/poetry.lock deleted file mode 100644 index 36844897..00000000 --- a/scripts/cli/poetry.lock +++ /dev/null @@ -1,217 +0,0 @@ -[[package]] -name = "certifi" -version = "2021.5.30" -description = "Python package for providing Mozilla's CA Bundle." -category = "main" -optional = false -python-versions = "*" - -[[package]] -name = "chardet" -version = "4.0.0" -description = "Universal encoding detector for Python 2 and 3" -category = "main" -optional = false -python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*" - -[[package]] -name = "click" -version = "8.0.1" -description = "Composable command line interface toolkit" -category = "main" -optional = false -python-versions = ">=3.6" - -[package.dependencies] -colorama = {version = "*", markers = "platform_system == \"Windows\""} - -[[package]] -name = "colorama" -version = "0.4.4" -description = "Cross-platform colored terminal text." -category = "main" -optional = false -python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*" - -[[package]] -name = "dacite" -version = "1.6.0" -description = "Simple creation of data classes from dictionaries." -category = "main" -optional = false -python-versions = ">=3.6" - -[package.extras] -dev = ["pytest (>=5)", "pytest-cov", "coveralls", "black", "mypy", "pylint"] - -[[package]] -name = "idna" -version = "2.10" -description = "Internationalized Domain Names in Applications (IDNA)" -category = "main" -optional = false -python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*" - -[[package]] -name = "mypy" -version = "0.910" -description = "Optional static typing for Python" -category = "main" -optional = false -python-versions = ">=3.5" - -[package.dependencies] -mypy-extensions = ">=0.4.3,<0.5.0" -toml = "*" -typing-extensions = ">=3.7.4" - -[package.extras] -dmypy = ["psutil (>=4.0)"] -python2 = ["typed-ast (>=1.4.0,<1.5.0)"] - -[[package]] -name = "mypy-extensions" -version = "0.4.3" -description = "Experimental type system extensions for programs checked with the mypy typechecker." -category = "main" -optional = false -python-versions = "*" - -[[package]] -name = "requests" -version = "2.25.1" -description = "Python HTTP for Humans." -category = "main" -optional = false -python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*" - -[package.dependencies] -certifi = ">=2017.4.17" -chardet = ">=3.0.2,<5" -idna = ">=2.5,<3" -urllib3 = ">=1.21.1,<1.27" - -[package.extras] -security = ["pyOpenSSL (>=0.14)", "cryptography (>=1.3.4)"] -socks = ["PySocks (>=1.5.6,!=1.5.7)", "win-inet-pton"] - -[[package]] -name = "requests-toolbelt" -version = "0.9.1" -description = "A utility belt for advanced users of python-requests" -category = "main" -optional = false -python-versions = "*" - -[package.dependencies] -requests = ">=2.0.1,<3.0.0" - -[[package]] -name = "toml" -version = "0.10.2" -description = "Python Library for Tom's Obvious, Minimal Language" -category = "main" -optional = false -python-versions = ">=2.6, !=3.0.*, !=3.1.*, !=3.2.*" - -[[package]] -name = "typing-extensions" -version = "3.10.0.0" -description = "Backported and Experimental Type Hints for Python 3.5+" -category = "main" -optional = false -python-versions = "*" - -[[package]] -name = "urllib3" -version = "1.26.6" -description = "HTTP library with thread-safe connection pooling, file post, and more." -category = "main" -optional = false -python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*, <4" - -[package.extras] -brotli = ["brotlipy (>=0.6.0)"] -secure = ["pyOpenSSL (>=0.14)", "cryptography (>=1.3.4)", "idna (>=2.0.0)", "certifi", "ipaddress"] -socks = ["PySocks (>=1.5.6,!=1.5.7,<2.0)"] - -[metadata] -lock-version = "1.1" -python-versions = "^3.9" -content-hash = "aafe737381b5e1135e4a1554f4c893eb297ef5428f84f75e6c5b5cd3006a5c66" - -[metadata.files] -certifi = [ - {file = "certifi-2021.5.30-py2.py3-none-any.whl", hash = "sha256:50b1e4f8446b06f41be7dd6338db18e0990601dce795c2b1686458aa7e8fa7d8"}, - {file = "certifi-2021.5.30.tar.gz", hash = "sha256:2bbf76fd432960138b3ef6dda3dde0544f27cbf8546c458e60baf371917ba9ee"}, -] -chardet = [ - {file = "chardet-4.0.0-py2.py3-none-any.whl", hash = "sha256:f864054d66fd9118f2e67044ac8981a54775ec5b67aed0441892edb553d21da5"}, - {file = "chardet-4.0.0.tar.gz", hash = "sha256:0d6f53a15db4120f2b08c94f11e7d93d2c911ee118b6b30a04ec3ee8310179fa"}, -] -click = [ - {file = "click-8.0.1-py3-none-any.whl", hash = "sha256:fba402a4a47334742d782209a7c79bc448911afe1149d07bdabdf480b3e2f4b6"}, - {file = "click-8.0.1.tar.gz", hash = "sha256:8c04c11192119b1ef78ea049e0a6f0463e4c48ef00a30160c704337586f3ad7a"}, -] -colorama = [ - {file = "colorama-0.4.4-py2.py3-none-any.whl", hash = "sha256:9f47eda37229f68eee03b24b9748937c7dc3868f906e8ba69fbcbdd3bc5dc3e2"}, - {file = "colorama-0.4.4.tar.gz", hash = "sha256:5941b2b48a20143d2267e95b1c2a7603ce057ee39fd88e7329b0c292aa16869b"}, -] -dacite = [ - {file = "dacite-1.6.0-py3-none-any.whl", hash = "sha256:4331535f7aabb505c732fa4c3c094313fc0a1d5ea19907bf4726a7819a68b93f"}, - {file = "dacite-1.6.0.tar.gz", hash = "sha256:d48125ed0a0352d3de9f493bf980038088f45f3f9d7498f090b50a847daaa6df"}, -] -idna = [ - {file = "idna-2.10-py2.py3-none-any.whl", hash = "sha256:b97d804b1e9b523befed77c48dacec60e6dcb0b5391d57af6a65a312a90648c0"}, - {file = "idna-2.10.tar.gz", hash = "sha256:b307872f855b18632ce0c21c5e45be78c0ea7ae4c15c828c20788b26921eb3f6"}, -] -mypy = [ - {file = "mypy-0.910-cp35-cp35m-macosx_10_9_x86_64.whl", hash = "sha256:a155d80ea6cee511a3694b108c4494a39f42de11ee4e61e72bc424c490e46457"}, - {file = "mypy-0.910-cp35-cp35m-manylinux1_x86_64.whl", hash = "sha256:b94e4b785e304a04ea0828759172a15add27088520dc7e49ceade7834275bedb"}, - {file = "mypy-0.910-cp35-cp35m-manylinux2010_x86_64.whl", hash = "sha256:088cd9c7904b4ad80bec811053272986611b84221835e079be5bcad029e79dd9"}, - {file = "mypy-0.910-cp35-cp35m-win_amd64.whl", hash = "sha256:adaeee09bfde366d2c13fe6093a7df5df83c9a2ba98638c7d76b010694db760e"}, - {file = "mypy-0.910-cp36-cp36m-macosx_10_9_x86_64.whl", hash = "sha256:ecd2c3fe726758037234c93df7e98deb257fd15c24c9180dacf1ef829da5f921"}, - {file = "mypy-0.910-cp36-cp36m-manylinux1_x86_64.whl", hash = "sha256:d9dd839eb0dc1bbe866a288ba3c1afc33a202015d2ad83b31e875b5905a079b6"}, - {file = "mypy-0.910-cp36-cp36m-manylinux2010_x86_64.whl", hash = "sha256:3e382b29f8e0ccf19a2df2b29a167591245df90c0b5a2542249873b5c1d78212"}, - {file = "mypy-0.910-cp36-cp36m-win_amd64.whl", hash = "sha256:53fd2eb27a8ee2892614370896956af2ff61254c275aaee4c230ae771cadd885"}, - {file = "mypy-0.910-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:b6fb13123aeef4a3abbcfd7e71773ff3ff1526a7d3dc538f3929a49b42be03f0"}, - {file = "mypy-0.910-cp37-cp37m-manylinux1_x86_64.whl", hash = "sha256:e4dab234478e3bd3ce83bac4193b2ecd9cf94e720ddd95ce69840273bf44f6de"}, - {file = "mypy-0.910-cp37-cp37m-manylinux2010_x86_64.whl", hash = "sha256:7df1ead20c81371ccd6091fa3e2878559b5c4d4caadaf1a484cf88d93ca06703"}, - {file = "mypy-0.910-cp37-cp37m-win_amd64.whl", hash = "sha256:0aadfb2d3935988ec3815952e44058a3100499f5be5b28c34ac9d79f002a4a9a"}, - {file = "mypy-0.910-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:ec4e0cd079db280b6bdabdc807047ff3e199f334050db5cbb91ba3e959a67504"}, - {file = "mypy-0.910-cp38-cp38-manylinux1_x86_64.whl", hash = "sha256:119bed3832d961f3a880787bf621634ba042cb8dc850a7429f643508eeac97b9"}, - {file = "mypy-0.910-cp38-cp38-manylinux2010_x86_64.whl", hash = "sha256:866c41f28cee548475f146aa4d39a51cf3b6a84246969f3759cb3e9c742fc072"}, - {file = "mypy-0.910-cp38-cp38-win_amd64.whl", hash = "sha256:ceb6e0a6e27fb364fb3853389607cf7eb3a126ad335790fa1e14ed02fba50811"}, - {file = "mypy-0.910-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:1a85e280d4d217150ce8cb1a6dddffd14e753a4e0c3cf90baabb32cefa41b59e"}, - {file = "mypy-0.910-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:42c266ced41b65ed40a282c575705325fa7991af370036d3f134518336636f5b"}, - {file = "mypy-0.910-cp39-cp39-manylinux1_x86_64.whl", hash = "sha256:3c4b8ca36877fc75339253721f69603a9c7fdb5d4d5a95a1a1b899d8b86a4de2"}, - {file = "mypy-0.910-cp39-cp39-manylinux2010_x86_64.whl", hash = "sha256:c0df2d30ed496a08de5daed2a9ea807d07c21ae0ab23acf541ab88c24b26ab97"}, - {file = "mypy-0.910-cp39-cp39-win_amd64.whl", hash = "sha256:c6c2602dffb74867498f86e6129fd52a2770c48b7cd3ece77ada4fa38f94eba8"}, - {file = "mypy-0.910-py3-none-any.whl", hash = "sha256:ef565033fa5a958e62796867b1df10c40263ea9ded87164d67572834e57a174d"}, - {file = "mypy-0.910.tar.gz", hash = "sha256:704098302473cb31a218f1775a873b376b30b4c18229421e9e9dc8916fd16150"}, -] -mypy-extensions = [ - {file = "mypy_extensions-0.4.3-py2.py3-none-any.whl", hash = "sha256:090fedd75945a69ae91ce1303b5824f428daf5a028d2f6ab8a299250a846f15d"}, - {file = "mypy_extensions-0.4.3.tar.gz", hash = "sha256:2d82818f5bb3e369420cb3c4060a7970edba416647068eb4c5343488a6c604a8"}, -] -requests = [ - {file = "requests-2.25.1-py2.py3-none-any.whl", hash = "sha256:c210084e36a42ae6b9219e00e48287def368a26d03a048ddad7bfee44f75871e"}, - {file = "requests-2.25.1.tar.gz", hash = "sha256:27973dd4a904a4f13b263a19c866c13b92a39ed1c964655f025f3f8d3d75b804"}, -] -requests-toolbelt = [ - {file = "requests-toolbelt-0.9.1.tar.gz", hash = "sha256:968089d4584ad4ad7c171454f0a5c6dac23971e9472521ea3b6d49d610aa6fc0"}, - {file = "requests_toolbelt-0.9.1-py2.py3-none-any.whl", hash = "sha256:380606e1d10dc85c3bd47bf5a6095f815ec007be7a8b69c878507068df059e6f"}, -] -toml = [ - {file = "toml-0.10.2-py2.py3-none-any.whl", hash = "sha256:806143ae5bfb6a3c6e736a764057db0e6a0e05e338b5630894a5f779cabb4f9b"}, - {file = "toml-0.10.2.tar.gz", hash = "sha256:b3bda1d108d5dd99f4a20d24d9c348e91c4db7ab1b749200bded2f839ccbe68f"}, -] -typing-extensions = [ - {file = "typing_extensions-3.10.0.0-py2-none-any.whl", hash = "sha256:0ac0f89795dd19de6b97debb0c6af1c70987fd80a2d62d1958f7e56fcc31b497"}, - {file = "typing_extensions-3.10.0.0-py3-none-any.whl", hash = "sha256:779383f6086d90c99ae41cf0ff39aac8a7937a9283ce0a414e5dd782f4c94a84"}, - {file = "typing_extensions-3.10.0.0.tar.gz", hash = "sha256:50b6f157849174217d0656f99dc82fe932884fb250826c18350e159ec6cdf342"}, -] -urllib3 = [ - {file = "urllib3-1.26.6-py2.py3-none-any.whl", hash = "sha256:39fb8672126159acb139a7718dd10806104dec1e2f0f6c88aab05d17df10c8d4"}, - {file = "urllib3-1.26.6.tar.gz", hash = "sha256:f57b4c16c62fa2760b7e3d97c35b255512fb6b59a259730f36ba32ce9f8e342f"}, -] diff --git a/scripts/cli/pyproject.toml b/scripts/cli/pyproject.toml deleted file mode 100644 index 0063ee33..00000000 --- a/scripts/cli/pyproject.toml +++ /dev/null @@ -1,19 +0,0 @@ -[tool.poetry] -name = "cli" -version = "0.1.0" -description = "soteria command line client" -authors = ["Parham Alvani "] - -[tool.poetry.dependencies] -python = "^3.9" -requests = "*" -click = "*" -requests-toolbelt = "*" -dacite = "*" - -[tool.poetry.dev-dependencies] -mypy = "^0.910" - -[build-system] -requires = ["poetry-core>=1.0.0"] -build-backend = "poetry.core.masonry.api" diff --git a/scripts/cli/soteria/__init__.py b/scripts/cli/soteria/__init__.py deleted file mode 100644 index c6fb535a..00000000 --- a/scripts/cli/soteria/__init__.py +++ /dev/null @@ -1,2 +0,0 @@ -from .account_manager import * -from .emq_store import * diff --git a/scripts/cli/soteria/account.py b/scripts/cli/soteria/account.py deleted file mode 100644 index 41923a22..00000000 --- a/scripts/cli/soteria/account.py +++ /dev/null @@ -1,14 +0,0 @@ -import dataclasses -import typing - -from .rule import Rule - - -@dataclasses.dataclass -class Account: - password: str - rules: typing.Optional[typing.List[Rule]] - secret: str - type: str - username: str - token_expiration_duration: int diff --git a/scripts/cli/soteria/account_manager.py b/scripts/cli/soteria/account_manager.py deleted file mode 100644 index c9aa575a..00000000 --- a/scripts/cli/soteria/account_manager.py +++ /dev/null @@ -1,92 +0,0 @@ -import dacite -from requests_toolbelt import sessions - -from .account import Account -from .rule import Rule - - -class AccountManager: - user_types = { - "herald": "HeraldUser", - "emq": "EMQUser", - "staff": "Staff", - } - - grant_types = { - "sub": "1", - "pub": "2", - "pubsub": "3", - } - - def __init__(self, base_url: str): - self.session = sessions.BaseUrlSession(base_url=base_url) - - def show(self, username: str, password: str) -> Account: - res = self.session.get( - f"accounts/{username}", auth=(username, password) - ).json() - - if res["data"] is not None: - return dacite.from_dict(data_class=Account, data=res["data"]) - raise Exception(res["message"]) - - def new(self, username: str, password: str, user_type: str): - res = self.session.post( - "accounts/", - json={ - "username": username, - "password": password, - "user_type": self.user_types[user_type], - }, - ) - return res.json() - - def add_rule( - self, username: str, password: str, topic: str, access_type: str - ) -> Rule: - res = self.session.post( - f"accounts/{username}/rules", - json={ - "topic": topic, - "access_type": self.grant_types[access_type], - }, - auth=(username, password), - ).json() - - if res["data"] is not None: - return dacite.from_dict(data_class=Rule, data=res["data"]) - raise Exception(res["message"]) - - def set_secret(self, username: str, password: str, secret: str): - res = self.session.put( - f"accounts/{username}", - json={ - "secret": secret, - }, - auth=(username, password), - ) - return res.json() - - def set_expiration(self, username: str, password: str, expiration: int): - res = self.session.put( - f"accounts/{username}", - json={ - "token_expiration": expiration, - }, - auth=(username, password), - ) - return res.json() - - def token(self, username: str, secret: str, grant_type: str) -> bytes: - """ - Generates a token from soteria. - """ - res = self.session.post( - "token", - json={ - "client_id": username, - "client_secret": secret, - "grant_type": self.grant_types[grant_type], - }, - ) - return res.content diff --git a/scripts/cli/soteria/emq_store.py b/scripts/cli/soteria/emq_store.py deleted file mode 100644 index f998b90c..00000000 --- a/scripts/cli/soteria/emq_store.py +++ /dev/null @@ -1,23 +0,0 @@ -from requests_toolbelt import sessions - - -class EMQStore: - def __init__(self, base_url: str): - self.session = sessions.BaseUrlSession(base_url=base_url) - - def new(self, username: str, password: str, duration: int): - res = self.session.post( - "emq/", - json={ - "username": username, - "password": password, - "duration": duration, - }, - ) - return res.json() - - def get(self): - res = self.session.get( - "emq/", - ) - return res.json() diff --git a/scripts/cli/soteria/rule.py b/scripts/cli/soteria/rule.py deleted file mode 100644 index 7cf507d3..00000000 --- a/scripts/cli/soteria/rule.py +++ /dev/null @@ -1,9 +0,0 @@ -import dataclasses - - -@dataclasses.dataclass -class Rule: - access_type: str - endpoint: str - topic: str - uuid: str diff --git a/scripts/cli/vars.py b/scripts/cli/vars.py deleted file mode 100644 index 035b30cb..00000000 --- a/scripts/cli/vars.py +++ /dev/null @@ -1,11 +0,0 @@ - -COLONY_TOKEN = 'eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjMzMDI3ODM0MjcsImlzcyI6IjEwMCIsInN1YiI6ImNvbG9ueS1zdWJzY3JpYmVyIn0.BChKcMUDFJ_GP9jdd2vl5GtDmtO0ha0EnLsmt4dgIwkxom8LQkpQD1sfAeEw53iClV8RYJOo_qLIdy1M0X7G26ePQuxaqi9FHpIvpM83w6BazINavM3SUZZmvhvoZN412eTwzjSPWr3v6OhJ-l-Lv7HUet7BOZ6D4IUKC3jjchHrJFXE9NKeBz886HE20y6iY5YIeuOqha-bfON3fzD5HcUs3WsvqcPNCL2AydkeafjS0k8SOY3m6vV5QQWGoIL7rRSDKbUf7KJXXs6BV3LFr3LblDxqh9P0zVUaKN8AQf4KnoqJJG8Awxab3OqTioV3OdWDiSuPQkl2s03BW1E-Xw' -DRIVER_TOKEN = 'eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE3NDU4MzQwNjksImlzcyI6IjEwMCIsInN1YiI6ImNvbG9ueS1zdWJzY3JpYmVyIn0.hM3o2Tt2Q6-kshNT43YQh9LMzDZxbYlf11g9XcLkmrsuYokatM1iT1-IsKpcT2wiWQVkf5APtFxyzEYUMB2VGSbzl-C3kFbMicvlpT8fIpOlfo2FzOg_Ey8pLq-qnbWmxW7Mii6bS4m208OH15FM8-25f0Kmv-64TFHpZqpqpZI' -PASSENGER_TOKEN = 'eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE3NDU4MzQwNjksImlzcyI6IjEwMCIsInN1YiI6ImNvbG9ueS1zdWJzY3JpYmVyIn0.hM3o2Tt2Q6-kshNT43YQh9LMzDZxbYlf11g9XcLkmrsuYokatM1iT1-IsKpcT2wiWQVkf5APtFxyzEYUMB2VGSbzl-C3kFbMicvlpT8fIpOlfo2FzOg_Ey8pLq-qnbWmxW7Mii6bS4m208OH15FM8-25f0Kmv-64TFHpZqpqpZI' - - -SUBSCRIE = '1' -PUBLISH = '2' -PUBLISH_SUBSCRIE = '3' - - From 4514d73dd21155ebb7b9247c8f8132aed5ef852d Mon Sep 17 00:00:00 2001 From: Parham Alvani Date: Tue, 16 Nov 2021 21:29:23 +0330 Subject: [PATCH 043/660] feat: remove grpc interface --- internal/{web/rest => }/api/acl.go | 2 +- internal/{web/rest => }/api/api.go | 20 - internal/{web/rest => }/api/auth.go | 26 +- internal/web/grpc/contracts/auth.pb.go | 402 --------------- internal/web/grpc/contracts/auth.proto | 33 -- internal/web/grpc/server.go | 133 ----- internal/web/rest/api/accounts.go | 218 -------- internal/web/rest/api/accounts_test.go | 487 ------------------ internal/web/rest/api/emq/emq.go | 89 ---- internal/web/rest/api/emq/request/create.go | 26 - internal/web/rest/api/emq/response/create.go | 6 - .../web/rest/api/emq/response/response.go | 7 - internal/web/rest/api/middlewares.go | 45 -- internal/web/rest/api/middlewares_test.go | 76 --- internal/web/rest/api/token.go | 97 ---- 15 files changed, 2 insertions(+), 1665 deletions(-) rename internal/{web/rest => }/api/acl.go (98%) rename internal/{web/rest => }/api/api.go (55%) rename internal/{web/rest => }/api/auth.go (77%) delete mode 100644 internal/web/grpc/contracts/auth.pb.go delete mode 100644 internal/web/grpc/contracts/auth.proto delete mode 100644 internal/web/grpc/server.go delete mode 100644 internal/web/rest/api/accounts.go delete mode 100644 internal/web/rest/api/accounts_test.go delete mode 100644 internal/web/rest/api/emq/emq.go delete mode 100644 internal/web/rest/api/emq/request/create.go delete mode 100644 internal/web/rest/api/emq/response/create.go delete mode 100644 internal/web/rest/api/emq/response/response.go delete mode 100644 internal/web/rest/api/middlewares.go delete mode 100644 internal/web/rest/api/middlewares_test.go delete mode 100644 internal/web/rest/api/token.go diff --git a/internal/web/rest/api/acl.go b/internal/api/acl.go similarity index 98% rename from internal/web/rest/api/acl.go rename to internal/api/acl.go index 763e7bec..8c2b473b 100644 --- a/internal/web/rest/api/acl.go +++ b/internal/api/acl.go @@ -89,7 +89,7 @@ func ACL(ctx *gin.Context) { } // nolint: exhaustivestruct - if errors.Is(err, authenticator.ErrTopicNotAllowed{}) { + if errors.Is(err, authenticator.TopicNotAllowedError{}) { zap.L(). Warn("acl request is not authorized", zap.Error(err)) diff --git a/internal/web/rest/api/api.go b/internal/api/api.go similarity index 55% rename from internal/web/rest/api/api.go rename to internal/api/api.go index 9641cf73..899c5b04 100644 --- a/internal/web/rest/api/api.go +++ b/internal/api/api.go @@ -8,7 +8,6 @@ import ( ginzap "github.com/gin-contrib/zap" "github.com/gin-gonic/gin" "github.com/prometheus/client_golang/prometheus/promhttp" - "gitlab.snapp.ir/dispatching/soteria/v3/internal/web/rest/api/emq" "go.uber.org/zap" ) @@ -22,27 +21,8 @@ func setupRouter(mode string) *gin.Engine { router.Use(ginzap.Ginzap(zap.L(), time.RFC3339, false)) router.Use(ginzap.RecoveryWithZap(zap.L(), true)) - a := router.Group("/accounts") - { - a.POST("", CreateAccount) - authorizedRoutes := a.Use(accountsBasicAuth()) - { - authorizedRoutes.GET("/:username", ReadAccount) - authorizedRoutes.PUT("/:username", UpdateAccount) - authorizedRoutes.DELETE("/:username", DeleteAccount) - - authorizedRoutes.POST("/:username/rules", CreateAccountRule) - authorizedRoutes.GET("/:username/rules/:uuid", ReadAccountRule) - authorizedRoutes.PUT("/:username/rules/:uuid", UpdateAccountRule) - authorizedRoutes.DELETE("/:username/rules/:uuid", DeleteAccountRule) - } - } - - emq.Register(router.Group("/emq")) - router.POST("/auth", Auth) router.POST("/acl", ACL) - router.POST("/token", Token) router.GET("/metrics", gin.WrapH(promhttp.Handler())) diff --git a/internal/web/rest/api/auth.go b/internal/api/auth.go similarity index 77% rename from internal/web/rest/api/auth.go rename to internal/api/auth.go index a4584a59..376b91da 100644 --- a/internal/web/rest/api/auth.go +++ b/internal/api/auth.go @@ -53,8 +53,7 @@ func Auth(ctx *gin.Context) { authCheckSpan := app.GetInstance().Tracer.StartSpan("auth check", opentracing.ChildOf(authSpan.Context())) - superuser, err := app.GetInstance().Authenticator.Auth(ctx, tokenString) - if err != nil { + if err := app.GetInstance().Authenticator.Auth(ctx, tokenString); err != nil { authCheckSpan.SetTag("success", false) authCheckSpan.SetTag("error", err.Error()) @@ -76,29 +75,6 @@ func Auth(ctx *gin.Context) { return } - if superuser == true { - authCheckSpan.SetTag("success", false) - authCheckSpan.SetTag("ignored", true) - - zap.L(). - Info("auth request is ignored", - zap.String("token", request.Token), - zap.String("username", request.Password), - zap.String("password", request.Username), - zap.Bool("superuser", superuser), - ) - - app.GetInstance().Metrics.ObserveStatusCode(internal.HttpApi, internal.Soteria, internal.Auth, http.StatusOK) - app.GetInstance().Metrics.ObserveStatus(internal.HttpApi, internal.Soteria, internal.Auth, internal.Ignore, "request is ignored") - app.GetInstance().Metrics.ObserveResponseTime(internal.HttpApi, internal.Soteria, internal.Auth, float64(time.Since(s).Nanoseconds())) - - ctx.String(http.StatusOK, EMQAuthIgnore) - - authCheckSpan.Finish() - - return - } - zap.L(). Info("auth ok", zap.String("token", request.Token), diff --git a/internal/web/grpc/contracts/auth.pb.go b/internal/web/grpc/contracts/auth.pb.go deleted file mode 100644 index cffa4e88..00000000 --- a/internal/web/grpc/contracts/auth.pb.go +++ /dev/null @@ -1,402 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// source: auth.proto - -package contracts - -import ( - context "context" - fmt "fmt" - proto "github.com/golang/protobuf/proto" - grpc "google.golang.org/grpc" - codes "google.golang.org/grpc/codes" - status "google.golang.org/grpc/status" - math "math" -) - -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package - -type AuthContract struct { - ServiceName string `protobuf:"bytes,1,opt,name=ServiceName,proto3" json:"ServiceName,omitempty"` - IPAddress string `protobuf:"bytes,2,opt,name=IPAddress,proto3" json:"IPAddress,omitempty"` - Endpoint string `protobuf:"bytes,3,opt,name=Endpoint,proto3" json:"Endpoint,omitempty"` - Username string `protobuf:"bytes,4,opt,name=Username,proto3" json:"Username,omitempty"` - Password string `protobuf:"bytes,5,opt,name=Password,proto3" json:"Password,omitempty"` - Token string `protobuf:"bytes,6,opt,name=Token,proto3" json:"Token,omitempty"` - Topic string `protobuf:"bytes,7,opt,name=Topic,proto3" json:"Topic,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *AuthContract) Reset() { *m = AuthContract{} } -func (m *AuthContract) String() string { return proto.CompactTextString(m) } -func (*AuthContract) ProtoMessage() {} -func (*AuthContract) Descriptor() ([]byte, []int) { - return fileDescriptor_8bbd6f3875b0e874, []int{0} -} - -func (m *AuthContract) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_AuthContract.Unmarshal(m, b) -} -func (m *AuthContract) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_AuthContract.Marshal(b, m, deterministic) -} -func (m *AuthContract) XXX_Merge(src proto.Message) { - xxx_messageInfo_AuthContract.Merge(m, src) -} -func (m *AuthContract) XXX_Size() int { - return xxx_messageInfo_AuthContract.Size(m) -} -func (m *AuthContract) XXX_DiscardUnknown() { - xxx_messageInfo_AuthContract.DiscardUnknown(m) -} - -var xxx_messageInfo_AuthContract proto.InternalMessageInfo - -func (m *AuthContract) GetServiceName() string { - if m != nil { - return m.ServiceName - } - return "" -} - -func (m *AuthContract) GetIPAddress() string { - if m != nil { - return m.IPAddress - } - return "" -} - -func (m *AuthContract) GetEndpoint() string { - if m != nil { - return m.Endpoint - } - return "" -} - -func (m *AuthContract) GetUsername() string { - if m != nil { - return m.Username - } - return "" -} - -func (m *AuthContract) GetPassword() string { - if m != nil { - return m.Password - } - return "" -} - -func (m *AuthContract) GetToken() string { - if m != nil { - return m.Token - } - return "" -} - -func (m *AuthContract) GetTopic() string { - if m != nil { - return m.Topic - } - return "" -} - -type ServiceResponse struct { - Code int32 `protobuf:"varint,1,opt,name=Code,proto3" json:"Code,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *ServiceResponse) Reset() { *m = ServiceResponse{} } -func (m *ServiceResponse) String() string { return proto.CompactTextString(m) } -func (*ServiceResponse) ProtoMessage() {} -func (*ServiceResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_8bbd6f3875b0e874, []int{1} -} - -func (m *ServiceResponse) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_ServiceResponse.Unmarshal(m, b) -} -func (m *ServiceResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_ServiceResponse.Marshal(b, m, deterministic) -} -func (m *ServiceResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_ServiceResponse.Merge(m, src) -} -func (m *ServiceResponse) XXX_Size() int { - return xxx_messageInfo_ServiceResponse.Size(m) -} -func (m *ServiceResponse) XXX_DiscardUnknown() { - xxx_messageInfo_ServiceResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_ServiceResponse proto.InternalMessageInfo - -func (m *ServiceResponse) GetCode() int32 { - if m != nil { - return m.Code - } - return 0 -} - -type GetTokenContract struct { - GrantType string `protobuf:"bytes,1,opt,name=GrantType,proto3" json:"GrantType,omitempty"` - ClientID string `protobuf:"bytes,2,opt,name=ClientID,proto3" json:"ClientID,omitempty"` - ClientSecret string `protobuf:"bytes,3,opt,name=ClientSecret,proto3" json:"ClientSecret,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *GetTokenContract) Reset() { *m = GetTokenContract{} } -func (m *GetTokenContract) String() string { return proto.CompactTextString(m) } -func (*GetTokenContract) ProtoMessage() {} -func (*GetTokenContract) Descriptor() ([]byte, []int) { - return fileDescriptor_8bbd6f3875b0e874, []int{2} -} - -func (m *GetTokenContract) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_GetTokenContract.Unmarshal(m, b) -} -func (m *GetTokenContract) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_GetTokenContract.Marshal(b, m, deterministic) -} -func (m *GetTokenContract) XXX_Merge(src proto.Message) { - xxx_messageInfo_GetTokenContract.Merge(m, src) -} -func (m *GetTokenContract) XXX_Size() int { - return xxx_messageInfo_GetTokenContract.Size(m) -} -func (m *GetTokenContract) XXX_DiscardUnknown() { - xxx_messageInfo_GetTokenContract.DiscardUnknown(m) -} - -var xxx_messageInfo_GetTokenContract proto.InternalMessageInfo - -func (m *GetTokenContract) GetGrantType() string { - if m != nil { - return m.GrantType - } - return "" -} - -func (m *GetTokenContract) GetClientID() string { - if m != nil { - return m.ClientID - } - return "" -} - -func (m *GetTokenContract) GetClientSecret() string { - if m != nil { - return m.ClientSecret - } - return "" -} - -type GetTokenResponse struct { - Code int32 `protobuf:"varint,1,opt,name=Code,proto3" json:"Code,omitempty"` - Token string `protobuf:"bytes,2,opt,name=Token,proto3" json:"Token,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *GetTokenResponse) Reset() { *m = GetTokenResponse{} } -func (m *GetTokenResponse) String() string { return proto.CompactTextString(m) } -func (*GetTokenResponse) ProtoMessage() {} -func (*GetTokenResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_8bbd6f3875b0e874, []int{3} -} - -func (m *GetTokenResponse) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_GetTokenResponse.Unmarshal(m, b) -} -func (m *GetTokenResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_GetTokenResponse.Marshal(b, m, deterministic) -} -func (m *GetTokenResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_GetTokenResponse.Merge(m, src) -} -func (m *GetTokenResponse) XXX_Size() int { - return xxx_messageInfo_GetTokenResponse.Size(m) -} -func (m *GetTokenResponse) XXX_DiscardUnknown() { - xxx_messageInfo_GetTokenResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_GetTokenResponse proto.InternalMessageInfo - -func (m *GetTokenResponse) GetCode() int32 { - if m != nil { - return m.Code - } - return 0 -} - -func (m *GetTokenResponse) GetToken() string { - if m != nil { - return m.Token - } - return "" -} - -func init() { - proto.RegisterType((*AuthContract)(nil), "contracts.AuthContract") - proto.RegisterType((*ServiceResponse)(nil), "contracts.ServiceResponse") - proto.RegisterType((*GetTokenContract)(nil), "contracts.GetTokenContract") - proto.RegisterType((*GetTokenResponse)(nil), "contracts.GetTokenResponse") -} - -func init() { proto.RegisterFile("auth.proto", fileDescriptor_8bbd6f3875b0e874) } - -var fileDescriptor_8bbd6f3875b0e874 = []byte{ - // 312 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x7c, 0x92, 0xd1, 0x4a, 0xfb, 0x30, - 0x14, 0xc6, 0xff, 0xdd, 0x7f, 0x9b, 0xeb, 0x71, 0xa0, 0x04, 0xc1, 0x50, 0x77, 0x31,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2e, 0xec, 0xe6, 0x43, 0x85, 0xe2, 0xad, 0x51, 0x05, 0x4c, 0x5f, - 0x4a, 0x14, 0x76, 0x79, 0x5b, 0xb7, 0x6e, 0x34, 0x61, 0x30, 0xf6, 0xe7, 0x35, 0x72, 0x8d, 0xa1, - 0xf8, 0x0f, 0x8f, 0x5d, 0xb7, 0x5f, 0xfc, 0x2b, 0x59, 0x5b, 0xb6, 0xd7, 0x29, 0x7b, 0xf9, 0x19, - 0x41, 0xbf, 0xda, 0x13, 0xb9, 0xa9, 0x9f, 0xa7, 0xb3, 0x66, 0x89, 0xb3, 0xee, 0x02, 0x93, 0xa4, - 0x03, 0xf6, 0x6e, 0x82, 0xfd, 0x23, 0xf7, 0x30, 0x0a, 0x29, 0xc8, 0x59, 0xe7, 0xcd, 0xfd, 0xcb, - 0x48, 0x7e, 0x83, 0xed, 0x9c, 0xa7, 0xa1, 0xfb, 0x93, 0xae, 0xbe, 0x03, 0x00, 0x00, 0xff, 0xff, - 0x00, 0x55, 0xf1, 0x67, 0x57, 0x02, 0x00, 0x00, -} - -// Reference imports to suppress errors if they are not otherwise used. -var _ context.Context -var _ grpc.ClientConn - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the grpc package it is being compiled against. -const _ = grpc.SupportPackageIsVersion4 - -// AuthClient is the client API for Auth service. -// -// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. -type AuthClient interface { - Auth(ctx context.Context, in *AuthContract, opts ...grpc.CallOption) (*ServiceResponse, error) - GetToken(ctx context.Context, in *GetTokenContract, opts ...grpc.CallOption) (*GetTokenResponse, error) -} - -type authClient struct { - cc *grpc.ClientConn -} - -func NewAuthClient(cc *grpc.ClientConn) AuthClient { - return &authClient{cc} -} - -func (c *authClient) Auth(ctx context.Context, in *AuthContract, opts ...grpc.CallOption) (*ServiceResponse, error) { - out := new(ServiceResponse) - err := c.cc.Invoke(ctx, "/contracts.Auth/Auth", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *authClient) GetToken(ctx context.Context, in *GetTokenContract, opts ...grpc.CallOption) (*GetTokenResponse, error) { - out := new(GetTokenResponse) - err := c.cc.Invoke(ctx, "/contracts.Auth/GetToken", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -// AuthServer is the server API for Auth service. -type AuthServer interface { - Auth(context.Context, *AuthContract) (*ServiceResponse, error) - GetToken(context.Context, *GetTokenContract) (*GetTokenResponse, error) -} - -// UnimplementedAuthServer can be embedded to have forward compatible implementations. -type UnimplementedAuthServer struct { -} - -func (*UnimplementedAuthServer) Auth(ctx context.Context, req *AuthContract) (*ServiceResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method Auth not implemented") -} -func (*UnimplementedAuthServer) GetToken(ctx context.Context, req *GetTokenContract) (*GetTokenResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method GetToken not implemented") -} - -func RegisterAuthServer(s *grpc.Server, srv AuthServer) { - s.RegisterService(&_Auth_serviceDesc, srv) -} - -func _Auth_Auth_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(AuthContract) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(AuthServer).Auth(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/contracts.Auth/Auth", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(AuthServer).Auth(ctx, req.(*AuthContract)) - } - return interceptor(ctx, in, info, handler) -} - -func _Auth_GetToken_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(GetTokenContract) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(AuthServer).GetToken(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/contracts.Auth/GetToken", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(AuthServer).GetToken(ctx, req.(*GetTokenContract)) - } - return interceptor(ctx, in, info, handler) -} - -var _Auth_serviceDesc = grpc.ServiceDesc{ - ServiceName: "contracts.Auth", - HandlerType: (*AuthServer)(nil), - Methods: []grpc.MethodDesc{ - { - MethodName: "Auth", - Handler: _Auth_Auth_Handler, - }, - { - MethodName: "GetToken", - Handler: _Auth_GetToken_Handler, - }, - }, - Streams: []grpc.StreamDesc{}, - Metadata: "auth.proto", -} diff --git a/internal/web/grpc/contracts/auth.proto b/internal/web/grpc/contracts/auth.proto deleted file mode 100644 index 43e0ecae..00000000 --- a/internal/web/grpc/contracts/auth.proto +++ /dev/null @@ -1,33 +0,0 @@ -syntax = "proto3"; -option go_package = "gitlab.snapp.ir/dispatching/soteria/v3/internal/web/grpc/contracts"; -package contracts; - -message AuthContract { - string ServiceName = 1; - string IPAddress = 2; - string Endpoint = 3; - string Username = 4; - string Password = 5; - string Token = 6; - string Topic = 7; -} - -message ServiceResponse { - int32 Code = 1; -} - -message GetTokenContract { - string GrantType = 1; - string ClientID = 2; - string ClientSecret = 3; -} - -message GetTokenResponse { - int32 Code = 1; - string Token = 2; -} - -service Auth { - rpc Auth(AuthContract) returns (ServiceResponse) {} - rpc GetToken(GetTokenContract) returns (GetTokenResponse) {} -} diff --git a/internal/web/grpc/server.go b/internal/web/grpc/server.go deleted file mode 100644 index 0f816f2e..00000000 --- a/internal/web/grpc/server.go +++ /dev/null @@ -1,133 +0,0 @@ -package grpc - -import ( - "context" - "errors" - "fmt" - "net/http" - "time" - - "gitlab.snapp.ir/dispatching/soteria/v3/internal" - "gitlab.snapp.ir/dispatching/soteria/v3/internal/app" - "gitlab.snapp.ir/dispatching/soteria/v3/internal/db" - "gitlab.snapp.ir/dispatching/soteria/v3/internal/web/grpc/contracts" - "gitlab.snapp.ir/dispatching/soteria/v3/pkg/acl" - "go.uber.org/zap" - "google.golang.org/grpc" -) - -type Server struct { - contracts.AuthContract -} - -func (s *Server) Auth(ctx context.Context, in *contracts.AuthContract) (*contracts.ServiceResponse, error) { - start := time.Now() - - username := in.GetUsername() - password := in.GetPassword() - endpoint := in.GetEndpoint() - ip := in.GetIPAddress() - zap.L().Debug("grpc auth call", - zap.String("username", username), - zap.String("endpoint", endpoint), - zap.String("ip", ip), - ) - - var ok bool - var err error - if len(password) > 0 { - ok, err = app.GetInstance().Authenticator.EndPointBasicAuth(ctx, username, password, endpoint) - } else if len(ip) > 0 { - ok, err = app.GetInstance().Authenticator.EndpointIPAuth(ctx, username, ip, endpoint) - } else { - ok = false - err = fmt.Errorf("both password and ip address are empty") - } - - if !ok { - if errors.Is(err, db.ErrDb) { - app.GetInstance().Metrics.ObserveStatusCode(internal.GrpcApi, internal.Soteria, internal.Auth, http.StatusInternalServerError) - app.GetInstance().Metrics.ObserveStatus(internal.GrpcApi, internal.Soteria, internal.Auth, internal.Failure, "database error happened") - app.GetInstance().Metrics.ObserveResponseTime(internal.GrpcApi, internal.Soteria, internal.Auth, float64(time.Since(start).Nanoseconds())) - - zap.L().Error("grpc auth returned", zap.Int("code", http.StatusInternalServerError), zap.Error(err)) - return &contracts.ServiceResponse{Code: http.StatusInternalServerError}, fmt.Errorf("internal server error") - } - - app.GetInstance().Metrics.ObserveStatusCode(internal.GrpcApi, internal.Soteria, internal.Auth, http.StatusUnauthorized) - app.GetInstance().Metrics.ObserveStatus(internal.GrpcApi, internal.Soteria, internal.Auth, internal.Failure, "request is not authorized") - app.GetInstance().Metrics.ObserveResponseTime(internal.GrpcApi, internal.Soteria, internal.Auth, float64(time.Since(start).Nanoseconds())) - - zap.L().Error("grpc auth returned", zap.Int("code", http.StatusUnauthorized), zap.Error(err)) - return &contracts.ServiceResponse{Code: http.StatusUnauthorized}, fmt.Errorf("request is unauthorized") - } - - zap.L().Info("grpc auth returned", zap.Int("code", http.StatusOK)) - - app.GetInstance().Metrics.ObserveStatusCode(internal.GrpcApi, internal.Soteria, internal.Auth, http.StatusOK) - app.GetInstance().Metrics.ObserveStatus(internal.GrpcApi, internal.Soteria, internal.Auth, internal.Success, "ok") - app.GetInstance().Metrics.ObserveResponseTime(internal.GrpcApi, internal.Soteria, internal.Auth, float64(time.Since(start).Nanoseconds())) - - return &contracts.ServiceResponse{Code: http.StatusOK}, nil -} - -func (s *Server) GetToken(ctx context.Context, in *contracts.GetTokenContract) (*contracts.GetTokenResponse, error) { - start := time.Now() - - grantType := in.GetGrantType() - clientID := in.GetClientID() - clientSecret := in.GetClientSecret() - zap.L().Debug("grpc token call", - zap.String("grant_type", grantType), - zap.String("client_id", clientID), - zap.String("client_secret", clientSecret), - ) - - tokenString, err := app.GetInstance().Authenticator.Token(ctx, acl.AccessType(grantType), clientID, clientSecret) - if err != nil { - if errors.Is(err, db.ErrDb) { - app.GetInstance().Metrics.ObserveStatusCode(internal.GrpcApi, internal.Soteria, internal.Token, http.StatusInternalServerError) - app.GetInstance().Metrics.ObserveStatus(internal.GrpcApi, internal.Soteria, internal.Token, internal.Failure, "database error happened") - app.GetInstance().Metrics.ObserveStatus(internal.GrpcApi, internal.Soteria, internal.Token, internal.Failure, clientID) - app.GetInstance().Metrics.ObserveResponseTime(internal.GrpcApi, internal.Soteria, internal.Token, float64(time.Since(start).Nanoseconds())) - - return &contracts.GetTokenResponse{ - Code: http.StatusInternalServerError, - Token: "", - }, fmt.Errorf("internal server error") - } - - app.GetInstance().Metrics.ObserveStatusCode(internal.GrpcApi, internal.Soteria, internal.Token, http.StatusUnauthorized) - app.GetInstance().Metrics.ObserveStatus(internal.GrpcApi, internal.Soteria, internal.Token, internal.Failure, "request is not authorized") - app.GetInstance().Metrics.ObserveStatus(internal.GrpcApi, internal.Soteria, internal.Token, internal.Failure, clientID) - app.GetInstance().Metrics.ObserveResponseTime(internal.GrpcApi, internal.Soteria, internal.Token, float64(time.Since(start).Nanoseconds())) - - return &contracts.GetTokenResponse{ - Code: http.StatusUnauthorized, - Token: "", - }, fmt.Errorf("request is unauthorized") - } - - zap.L(). - Info("token request accepted", - zap.String("grant_type", grantType), - zap.String("client_id", clientID), - zap.String("client_secret", clientSecret), - ) - - app.GetInstance().Metrics.ObserveStatusCode(internal.GrpcApi, internal.Soteria, internal.Token, http.StatusOK) - app.GetInstance().Metrics.ObserveStatus(internal.GrpcApi, internal.Soteria, internal.Token, internal.Success, "token request accepted") - app.GetInstance().Metrics.ObserveStatus(internal.GrpcApi, internal.Soteria, internal.Token, internal.Success, clientID) - app.GetInstance().Metrics.ObserveResponseTime(internal.GrpcApi, internal.Soteria, internal.Token, float64(time.Since(start).Nanoseconds())) - - return &contracts.GetTokenResponse{ - Code: 200, - Token: tokenString, - }, nil -} - -func NewServer() *grpc.Server { - s := grpc.NewServer() - contracts.RegisterAuthServer(s, &Server{}) - return s -} diff --git a/internal/web/rest/api/accounts.go b/internal/web/rest/api/accounts.go deleted file mode 100644 index bc3e2503..00000000 --- a/internal/web/rest/api/accounts.go +++ /dev/null @@ -1,218 +0,0 @@ -package api - -import ( - "fmt" - "time" - - "github.com/gin-gonic/gin" - "github.com/google/uuid" - "gitlab.snapp.ir/dispatching/soteria/v3/internal/app" - "gitlab.snapp.ir/dispatching/soteria/v3/internal/topics" - "gitlab.snapp.ir/dispatching/soteria/v3/pkg/acl" - accountsInfo "gitlab.snapp.ir/dispatching/soteria/v3/pkg/errors" - "gitlab.snapp.ir/dispatching/soteria/v3/pkg/user" -) - -// Response is the response structure of the REST API. -type Response struct { - Code accountsInfo.Code `json:"code"` - Message string `json:"message"` - Data interface{} `json:"data"` -} - -// CreateResponse returns a HTTP Status Code and a response. -func CreateResponse(code accountsInfo.Code, data interface{}, details ...string) (int, *Response) { - return code.HttpStatusCode(), &Response{ - Code: code, - Message: fmt.Sprintf("%s: %s", code.Message(), details), - Data: data, - } -} - -// createAccountPayload is the body payload structure of create account endpoint -type createAccountPayload struct { - Username string `json:"username" form:"username" binding:"required"` - Password string `json:"password" form:"password" binding:"required"` - UserType user.Type `json:"user_type" form:"user_type" binding:"required"` -} - -// CreateAccount is the handler of the create account endpoint -func CreateAccount(ctx *gin.Context) { - var p createAccountPayload - if err := ctx.ShouldBind(&p); err != nil { - ctx.JSON(CreateResponse(accountsInfo.BadRequestPayload, nil, err.Error())) - return - } - - if err := app.GetInstance().AccountsService.SignUp(ctx, p.Username, p.Password, p.UserType); err != nil { - ctx.JSON(CreateResponse(err.Code, nil, err.Message)) - return - } - - ctx.JSON(CreateResponse(accountsInfo.SuccessfulOperation, nil)) -} - -// ReadAccount is the handler of the read account endpoint -func ReadAccount(ctx *gin.Context) { - username := ctx.MustGet("username").(string) - password := ctx.MustGet("password").(string) - - u, err := app.GetInstance().AccountsService.Info(ctx, username, password) - if err != nil { - ctx.JSON(CreateResponse(err.Code, nil, err.Message)) - return - } - - ctx.JSON(CreateResponse(accountsInfo.SuccessfulOperation, u)) -} - -// updateAccountPayload is the body payload structure of update account endpoint -type updateAccountPayload struct { - NewPassword string `json:"new_password" form:"new_password"` - IPs []string `json:"ips" form:"ips"` - Secret string `json:"secret" form:"secret"` - Type user.Type `json:"type" form:"type"` - TokenExpiration time.Duration `json:"token_expiration" form:"token_expiration"` -} - -// UpdateAccount is the handler of the update account endpoint -func UpdateAccount(ctx *gin.Context) { - username := ctx.MustGet("username").(string) - - var p updateAccountPayload - if err := ctx.ShouldBind(&p); err != nil { - ctx.JSON(CreateResponse(accountsInfo.BadRequestPayload, nil, err.Error())) - return - } - - if err := app.GetInstance().AccountsService.Update(ctx, username, p.NewPassword, p.Type, p.IPs, p.Secret, p.TokenExpiration); err != nil { - ctx.JSON(CreateResponse(err.Code, nil, err.Message)) - return - } - - ctx.JSON(CreateResponse(accountsInfo.SuccessfulOperation, nil)) -} - -// DeleteAccount is the handler of the delete account endpoint -func DeleteAccount(ctx *gin.Context) { - username := ctx.MustGet("username").(string) - - if err := app.GetInstance().AccountsService.Delete(ctx, username); err != nil { - ctx.JSON(CreateResponse(err.Code, nil, err.Message)) - return - } - - ctx.JSON(CreateResponse(accountsInfo.SuccessfulOperation, nil)) -} - -// createAccountRulePayload is the body payload structure of create account rule endpoint -type createAccountRulePayload struct { - Endpoint string `json:"endpoint" form:"endpoint"` - Topic topics.Type `json:"topic" form:"topic"` - AccessType acl.AccessType `json:"access_type" form:"access_type"` -} - -// CreateAccountRule is the handler of the create account rule endpoint -func CreateAccountRule(ctx *gin.Context) { - username := ctx.MustGet("username").(string) - - var p createAccountRulePayload - if err := ctx.ShouldBind(&p); err != nil { - ctx.JSON(CreateResponse(accountsInfo.BadRequestPayload, nil, err.Error())) - return - } - - r, err := app.GetInstance().AccountsService.CreateRule(ctx, username, p.Endpoint, p.Topic, p.AccessType) - if err != nil { - ctx.JSON(CreateResponse(err.Code, nil, err.Message)) - return - } - - ctx.JSON(CreateResponse(accountsInfo.SuccessfulOperation, r)) -} - -// ReadAccountRule is the handler of the read account rule endpoint -func ReadAccountRule(ctx *gin.Context) { - username := ctx.MustGet("username").(string) - - plainUUID := ctx.Param("uuid") - if plainUUID == "" { - ctx.JSON(CreateResponse(accountsInfo.InvalidRuleUUID, nil)) - return - } - - ruleUUID, err := uuid.Parse(plainUUID) - if err != nil { - ctx.JSON(CreateResponse(accountsInfo.InvalidRuleUUID, nil, err.Error())) - return - } - - r, rErr := app.GetInstance().AccountsService.GetRule(ctx, username, ruleUUID) - if rErr != nil { - ctx.JSON(CreateResponse(rErr.Code, nil, rErr.Message)) - return - } - - ctx.JSON(CreateResponse(accountsInfo.SuccessfulOperation, r)) -} - -// updateAccountRulePayload is the body payload structure of update account rule endpoint -type updateAccountRulePayload struct { - Endpoint string `json:"endpoint" form:"endpoint"` - Topic topics.Type `json:"topic" form:"topic"` - AccessType acl.AccessType `json:"access_type" form:"access_type"` -} - -// UpdateAccountRule is the handler of the update account rule endpoint -func UpdateAccountRule(ctx *gin.Context) { - username := ctx.MustGet("username").(string) - - var p updateAccountRulePayload - if err := ctx.ShouldBind(&p); err != nil { - ctx.JSON(CreateResponse(accountsInfo.BadRequestPayload, nil, err.Error())) - return - } - - plainUUID := ctx.Param("uuid") - if plainUUID == "" { - ctx.JSON(CreateResponse(accountsInfo.InvalidRuleUUID, nil)) - return - } - - ruleUUID, err := uuid.Parse(plainUUID) - if err != nil { - ctx.JSON(CreateResponse(accountsInfo.InvalidRuleUUID, nil, err.Error())) - return - } - - if err := app.GetInstance().AccountsService.UpdateRule(ctx, username, ruleUUID, p.Endpoint, p.Topic, p.AccessType); err != nil { - ctx.JSON(CreateResponse(err.Code, nil, err.Message)) - return - } - - ctx.JSON(CreateResponse(accountsInfo.SuccessfulOperation, nil)) -} - -// DeleteAccountRule is the handler of the delete account rule endpoint -func DeleteAccountRule(ctx *gin.Context) { - username := ctx.MustGet("username").(string) - - plainUUID := ctx.Param("uuid") - if plainUUID == "" { - ctx.JSON(CreateResponse(accountsInfo.InvalidRuleUUID, nil)) - return - } - - ruleUUID, err := uuid.Parse(plainUUID) - if err != nil { - ctx.JSON(CreateResponse(accountsInfo.InvalidRuleUUID, nil, err.Error())) - return - } - - if err := app.GetInstance().AccountsService.DeleteRule(ctx, username, ruleUUID); err != nil { - ctx.JSON(CreateResponse(err.Code, nil, err.Message)) - return - } - - ctx.JSON(CreateResponse(accountsInfo.SuccessfulOperation, nil)) -} diff --git a/internal/web/rest/api/accounts_test.go b/internal/web/rest/api/accounts_test.go deleted file mode 100644 index badb1dc5..00000000 --- a/internal/web/rest/api/accounts_test.go +++ /dev/null @@ -1,487 +0,0 @@ -package api - -import ( - "bytes" - "context" - "encoding/json" - "fmt" - "github.com/alicebob/miniredis/v2" - "github.com/go-redis/redis/v8" - "github.com/stretchr/testify/assert" - "gitlab.snapp.ir/dispatching/soteria/v3/internal/accounts" - "gitlab.snapp.ir/dispatching/soteria/v3/internal/app" - redisModel "gitlab.snapp.ir/dispatching/soteria/v3/internal/db/redis" - "gitlab.snapp.ir/dispatching/soteria/v3/internal/topics" - "gitlab.snapp.ir/dispatching/soteria/v3/pkg/acl" - "gitlab.snapp.ir/dispatching/soteria/v3/pkg/errors" - "gitlab.snapp.ir/dispatching/soteria/v3/pkg/user" - "io/ioutil" - "net/http" - "net/http/httptest" - "testing" - "time" -) - -func init() { - mr, err := miniredis.Run() - if err != nil { - panic(err) - } - client := redis.NewClient(&redis.Options{ - Addr: mr.Addr(), - }) - app.GetInstance().SetAccountsService(&accounts.Service{ - Handler: redisModel.ModelHandler{ - Client: client, - }, - }) -} - -func TestCreateAccount(t *testing.T) { - router := setupRouter("debug") - - t.Run("testing successful request", func(t *testing.T) { - w := httptest.NewRecorder() - - payload := []byte(`{"username":"user","password":"123","user_type":"driver"}`) - req, _ := http.NewRequest("POST", "/accounts", bytes.NewBuffer(payload)) - req.Header.Set("Content-Type", "application/json") - - router.ServeHTTP(w, req) - - assert.Equal(t, http.StatusOK, w.Code) - - expectedResponse := Response{ - Code: errors.SuccessfulOperation, - Message: fmt.Sprintf("%s: []", errors.SuccessfulOperation.Message()), - Data: nil, - } - - resBody, err := ioutil.ReadAll(w.Body) - assert.NoError(t, err) - - var actualResponse Response - err = json.Unmarshal(resBody, &actualResponse) - assert.NoError(t, err) - - assert.Equal(t, expectedResponse, actualResponse) - }) - - t.Run("testing without content type header", func(t *testing.T) { - w := httptest.NewRecorder() - - payload := []byte(`{"username":"user","password":"123","user_type":"driver"}`) - req, _ := http.NewRequest(http.MethodPost, "/accounts", bytes.NewBuffer(payload)) - router.ServeHTTP(w, req) - - assert.Equal(t, http.StatusBadRequest, w.Code) - - resBody, err := ioutil.ReadAll(w.Body) - assert.NoError(t, err) - - var actualResponse Response - err = json.Unmarshal(resBody, &actualResponse) - assert.NoError(t, err) - - assert.Equal(t, errors.BadRequestPayload, actualResponse.Code) - }) -} - -func TestReadAccount(t *testing.T) { - router := setupRouter("debug") - - _ = app.GetInstance().AccountsService.SignUp(context.Background(), "user", "password", "passenger") - - t.Run("testing successful request", func(t *testing.T) { - w := httptest.NewRecorder() - - req, _ := http.NewRequest(http.MethodGet, "/accounts/user", nil) - req.SetBasicAuth("user", "password") - - router.ServeHTTP(w, req) - - assert.Equal(t, http.StatusOK, w.Code) - - resBody, err := ioutil.ReadAll(w.Body) - assert.NoError(t, err) - - var actualResponse Response - err = json.Unmarshal(resBody, &actualResponse) - assert.NoError(t, err) - - assert.Equal(t, errors.SuccessfulOperation, actualResponse.Code) - - u := actualResponse.Data.(map[string]interface{}) - assert.Equal(t, "user", u["username"]) - assert.Equal(t, "passenger", u["type"]) - }) -} - -func TestUpdateAccount(t *testing.T) { - router := setupRouter("debug") - - _ = app.GetInstance().AccountsService.SignUp(context.Background(), "user", "password", "passenger") - - t.Run("testing successful request", func(t *testing.T) { - w := httptest.NewRecorder() - - payload := []byte(`{"new_password":"password2","ips":["127.0.0.1"],"secret":"12345678","type":"EMQUser","token_expiration":1000000}`) - req, _ := http.NewRequest(http.MethodPut, "/accounts/user", bytes.NewBuffer(payload)) - req.Header.Set("Content-Type", "application/json") - req.SetBasicAuth("user", "password") - - router.ServeHTTP(w, req) - - assert.Equal(t, http.StatusOK, w.Code) - - resBody, err := ioutil.ReadAll(w.Body) - assert.NoError(t, err) - - var actualResponse Response - err = json.Unmarshal(resBody, &actualResponse) - assert.NoError(t, err) - - assert.Equal(t, errors.SuccessfulOperation, actualResponse.Code) - - u, err := app.GetInstance().AccountsService.Info(context.Background(), "user", "password2") - assert.Nil(t, err) - assert.Equal(t, 1, len(u.IPs)) - assert.Equal(t, "12345678", u.Secret) - assert.Equal(t, user.EMQUser, u.Type) - assert.Equal(t, time.Duration(1000000), u.TokenExpirationDuration) - }) -} - -func TestDeleteAccount(t *testing.T) { - router := setupRouter("debug") - - _ = app.GetInstance().AccountsService.SignUp(context.Background(), "user", "password", "passenger") - - t.Run("testing successful request", func(t *testing.T) { - w := httptest.NewRecorder() - req, _ := http.NewRequest(http.MethodDelete, "/accounts/user", nil) - req.SetBasicAuth("user", "password") - - router.ServeHTTP(w, req) - - assert.Equal(t, http.StatusOK, w.Code) - - resBody, err := ioutil.ReadAll(w.Body) - assert.NoError(t, err) - - var actualResponse Response - err = json.Unmarshal(resBody, &actualResponse) - assert.NoError(t, err) - - assert.Equal(t, errors.SuccessfulOperation, actualResponse.Code) - - _, err = app.GetInstance().AccountsService.Info(context.Background(), "user", "password2") - assert.NotNil(t, err) - }) -} - -func TestCreateAccountRule(t *testing.T) { - router := setupRouter("debug") - - _ = app.GetInstance().AccountsService.SignUp(context.Background(), "user", "password", "passenger") - - t.Run("testing with invalid rule info", func(t *testing.T) { - w := httptest.NewRecorder() - - payload := []byte(`{"endpoint":"/notification","topic":"","access_type":""}`) - req, _ := http.NewRequest(http.MethodPost, "/accounts/user/rules", bytes.NewBuffer(payload)) - req.Header.Set("Content-Type", "application/json") - req.SetBasicAuth("user", "password") - - router.ServeHTTP(w, req) - - assert.Equal(t, http.StatusBadRequest, w.Code) - - resBody, err := ioutil.ReadAll(w.Body) - assert.NoError(t, err) - - var actualResponse Response - err = json.Unmarshal(resBody, &actualResponse) - assert.NoError(t, err) - - assert.Equal(t, errors.InvalidRule, actualResponse.Code) - - u, err := app.GetInstance().AccountsService.Info(context.Background(), "user", "password") - assert.Nil(t, err) - assert.Equal(t, 0, len(u.Rules)) - }) - - t.Run("testing successful request", func(t *testing.T) { - w := httptest.NewRecorder() - - payload := []byte(`{"endpoint":"/notification","topic":"","access_type":"2"}`) - req, _ := http.NewRequest(http.MethodPost, "/accounts/user/rules", bytes.NewBuffer(payload)) - req.Header.Set("Content-Type", "application/json") - req.SetBasicAuth("user", "password") - - router.ServeHTTP(w, req) - - assert.Equal(t, http.StatusOK, w.Code) - - resBody, err := ioutil.ReadAll(w.Body) - assert.NoError(t, err) - - var actualResponse Response - err = json.Unmarshal(resBody, &actualResponse) - assert.NoError(t, err) - - assert.Equal(t, errors.SuccessfulOperation, actualResponse.Code) - - u, err := app.GetInstance().AccountsService.Info(context.Background(), "user", "password") - assert.Nil(t, err) - assert.Equal(t, 1, len(u.Rules)) - assert.Equal(t, "/notification", u.Rules[0].Endpoint) - assert.Equal(t, topics.Type(""), u.Rules[0].Topic) - assert.Equal(t, acl.Pub, u.Rules[0].AccessType) - }) -} - -func TestReadAccountRule(t *testing.T) { - router := setupRouter("debug") - - _ = app.GetInstance().AccountsService.SignUp(context.Background(), "user", "password", "passenger") - createdRule, _ := app.GetInstance().AccountsService.CreateRule(context.Background(), "user", "/notification", "", "2") - - t.Run("testing with invalid UUID", func(t *testing.T) { - w := httptest.NewRecorder() - - req, _ := http.NewRequest(http.MethodGet, "/accounts/user/rules/invalid-uuid", nil) - req.SetBasicAuth("user", "password") - - router.ServeHTTP(w, req) - - assert.Equal(t, http.StatusBadRequest, w.Code) - - resBody, err := ioutil.ReadAll(w.Body) - assert.NoError(t, err) - - var actualResponse Response - err = json.Unmarshal(resBody, &actualResponse) - assert.NoError(t, err) - - assert.Equal(t, errors.InvalidRuleUUID, actualResponse.Code) - }) - - t.Run("testing with undefined rule", func(t *testing.T) { - w := httptest.NewRecorder() - - req, _ := http.NewRequest(http.MethodGet, "/accounts/user/rules/b33a0b78-c8a6-4719-a222-9a3883cc4b7c", nil) - req.SetBasicAuth("user", "password") - - router.ServeHTTP(w, req) - - assert.Equal(t, http.StatusNotFound, w.Code) - - resBody, err := ioutil.ReadAll(w.Body) - assert.NoError(t, err) - - var actualResponse Response - err = json.Unmarshal(resBody, &actualResponse) - assert.NoError(t, err) - - assert.Equal(t, errors.RuleNotFound, actualResponse.Code) - }) - - t.Run("testing successful request", func(t *testing.T) { - w := httptest.NewRecorder() - - req, _ := http.NewRequest(http.MethodGet, fmt.Sprintf("/accounts/user/rules/%s", createdRule.UUID), nil) - req.SetBasicAuth("user", "password") - - router.ServeHTTP(w, req) - - assert.Equal(t, http.StatusOK, w.Code) - - resBody, err := ioutil.ReadAll(w.Body) - assert.NoError(t, err) - - var actualResponse Response - err = json.Unmarshal(resBody, &actualResponse) - assert.NoError(t, err) - - assert.Equal(t, errors.SuccessfulOperation, actualResponse.Code) - - returnedRule := actualResponse.Data.(map[string]interface{}) - assert.Equal(t, createdRule.UUID.String(), returnedRule["uuid"]) - assert.Equal(t, "/notification", returnedRule["endpoint"]) - assert.Equal(t, "", returnedRule["topic"]) - assert.Equal(t, "", returnedRule["topic"]) - }) -} - -func TestUpdateAccountRule(t *testing.T) { - router := setupRouter("debug") - - _ = app.GetInstance().AccountsService.SignUp(context.Background(), "user", "password", "passenger") - createdRule, _ := app.GetInstance().AccountsService.CreateRule(context.Background(), "user", "/notification", "", "2") - - t.Run("testing with no payload", func(t *testing.T) { - w := httptest.NewRecorder() - - req, _ := http.NewRequest(http.MethodPut, "/accounts/user/rules/b33a0b78-c8a6-4719-a222-9a3883cc4b7c", nil) - req.SetBasicAuth("user", "password") - - router.ServeHTTP(w, req) - - assert.Equal(t, http.StatusBadRequest, w.Code) - - resBody, err := ioutil.ReadAll(w.Body) - assert.NoError(t, err) - - var actualResponse Response - err = json.Unmarshal(resBody, &actualResponse) - assert.NoError(t, err) - - assert.Equal(t, errors.BadRequestPayload, actualResponse.Code) - }) - - t.Run("testing with invalid UUID", func(t *testing.T) { - w := httptest.NewRecorder() - - payload := []byte(`{"endpoint":"/notification","topic":"","access_type":""}`) - req, _ := http.NewRequest(http.MethodPut, "/accounts/user/rules/invalid-uuid", bytes.NewBuffer(payload)) - req.SetBasicAuth("user", "password") - req.Header.Set("Content-Type", "application/json") - - router.ServeHTTP(w, req) - - assert.Equal(t, http.StatusBadRequest, w.Code) - - resBody, err := ioutil.ReadAll(w.Body) - assert.NoError(t, err) - - var actualResponse Response - err = json.Unmarshal(resBody, &actualResponse) - assert.NoError(t, err) - - assert.Equal(t, errors.InvalidRuleUUID, actualResponse.Code) - }) - - t.Run("testing with undefined rule", func(t *testing.T) { - w := httptest.NewRecorder() - - payload := []byte(`{"endpoint":"/notification","topic":"","access_type":"2"}`) - req, _ := http.NewRequest(http.MethodPut, "/accounts/user/rules/b33a0b78-c8a6-4719-a222-9a3883cc4b7c", bytes.NewBuffer(payload)) - req.SetBasicAuth("user", "password") - req.Header.Set("Content-Type", "application/json") - - router.ServeHTTP(w, req) - - assert.Equal(t, http.StatusNotFound, w.Code) - - resBody, err := ioutil.ReadAll(w.Body) - assert.NoError(t, err) - - var actualResponse Response - err = json.Unmarshal(resBody, &actualResponse) - assert.NoError(t, err) - - assert.Equal(t, errors.RuleNotFound, actualResponse.Code) - }) - - t.Run("testing successful request", func(t *testing.T) { - w := httptest.NewRecorder() - - payload := []byte(`{"endpoint":"","topic":"cab_event","access_type":"2"}`) - req, _ := http.NewRequest(http.MethodPut, fmt.Sprintf("/accounts/user/rules/%s", createdRule.UUID), bytes.NewBuffer(payload)) - req.SetBasicAuth("user", "password") - req.Header.Set("Content-Type", "application/json") - - router.ServeHTTP(w, req) - - assert.Equal(t, http.StatusOK, w.Code) - - resBody, err := ioutil.ReadAll(w.Body) - assert.NoError(t, err) - - var actualResponse Response - err = json.Unmarshal(resBody, &actualResponse) - assert.NoError(t, err) - - assert.Equal(t, errors.SuccessfulOperation, actualResponse.Code) - - u, err := app.GetInstance().AccountsService.Info(context.Background(), "user", "password") - assert.Nil(t, err) - assert.Equal(t, 1, len(u.Rules)) - assert.Equal(t, createdRule.UUID, u.Rules[0].UUID) - assert.Equal(t, "", u.Rules[0].Endpoint) - assert.Equal(t, topics.CabEvent, u.Rules[0].Topic) - assert.Equal(t, acl.Pub, u.Rules[0].AccessType) - }) -} - -func TestDeleteAccountRule(t *testing.T) { - router := setupRouter("debug") - - _ = app.GetInstance().AccountsService.SignUp(context.Background(), "user", "password", "passenger") - createdRule, _ := app.GetInstance().AccountsService.CreateRule(context.Background(), "user", "/notification", "", "2") - - t.Run("testing with invalid UUID", func(t *testing.T) { - w := httptest.NewRecorder() - - req, _ := http.NewRequest(http.MethodDelete, "/accounts/user/rules/invalid-uuid", nil) - req.SetBasicAuth("user", "password") - - router.ServeHTTP(w, req) - - assert.Equal(t, http.StatusBadRequest, w.Code) - - resBody, err := ioutil.ReadAll(w.Body) - assert.NoError(t, err) - - var actualResponse Response - err = json.Unmarshal(resBody, &actualResponse) - assert.NoError(t, err) - - assert.Equal(t, errors.InvalidRuleUUID, actualResponse.Code) - }) - - t.Run("testing with undefined rule", func(t *testing.T) { - w := httptest.NewRecorder() - - req, _ := http.NewRequest(http.MethodDelete, "/accounts/user/rules/b33a0b78-c8a6-4719-a222-9a3883cc4b7c", nil) - req.SetBasicAuth("user", "password") - - router.ServeHTTP(w, req) - - assert.Equal(t, http.StatusNotFound, w.Code) - - resBody, err := ioutil.ReadAll(w.Body) - assert.NoError(t, err) - - var actualResponse Response - err = json.Unmarshal(resBody, &actualResponse) - assert.NoError(t, err) - - assert.Equal(t, errors.RuleNotFound, actualResponse.Code) - }) - - t.Run("testing successful request", func(t *testing.T) { - w := httptest.NewRecorder() - - req, _ := http.NewRequest(http.MethodDelete, fmt.Sprintf("/accounts/user/rules/%s", createdRule.UUID), nil) - req.SetBasicAuth("user", "password") - - router.ServeHTTP(w, req) - - assert.Equal(t, http.StatusOK, w.Code) - - resBody, err := ioutil.ReadAll(w.Body) - assert.NoError(t, err) - - var actualResponse Response - err = json.Unmarshal(resBody, &actualResponse) - assert.NoError(t, err) - - assert.Equal(t, errors.SuccessfulOperation, actualResponse.Code) - - u, err := app.GetInstance().AccountsService.Info(context.Background(), "user", "password") - assert.Nil(t, err) - assert.Equal(t, 0, len(u.Rules)) - }) -} diff --git a/internal/web/rest/api/emq/emq.go b/internal/web/rest/api/emq/emq.go deleted file mode 100644 index f3cd430d..00000000 --- a/internal/web/rest/api/emq/emq.go +++ /dev/null @@ -1,89 +0,0 @@ -package emq - -import ( - "net/http" - "time" - - "github.com/gin-gonic/gin" - "gitlab.snapp.ir/dispatching/soteria/v3/internal/app" - "gitlab.snapp.ir/dispatching/soteria/v3/internal/emq" - "gitlab.snapp.ir/dispatching/soteria/v3/internal/web/rest/api/emq/request" - "gitlab.snapp.ir/dispatching/soteria/v3/internal/web/rest/api/emq/response" -) - -func Register(group *gin.RouterGroup) { - group.POST("", Create) - group.GET("", List) -} - -// List returns the list of registered users for emqx-redis-auth. -func List(ctx *gin.Context) { - users, err := app.GetInstance().EMQStore.LoadAll(ctx) - if err != nil { - ctx.JSON(http.StatusInternalServerError, response.Response{ - Message: err.Error(), - Data: nil, - }) - - return - } - - ctx.JSON(http.StatusCreated, response.Response{ - Message: "success", - Data: users, - }) -} - -// Create is the handler of the create emq redis account endpoint. -func Create(ctx *gin.Context) { - var p request.Create - - if err := ctx.ShouldBind(&p); err != nil { - ctx.JSON(http.StatusBadRequest, response.Response{ - Message: err.Error(), - Data: nil, - }) - - return - } - - if err := p.Validate(); err != nil { - ctx.JSON(http.StatusBadRequest, response.Response{ - Message: err.Error(), - Data: nil, - }) - - return - } - - token, err := app.GetInstance().Authenticator.SuperuserToken(p.Username, time.Duration(p.Duration)) - if err != nil { - ctx.JSON(http.StatusInternalServerError, response.Response{ - Message: err.Error(), - Data: nil, - }) - - return - } - - if err := app.GetInstance().EMQStore.Save(ctx, emq.User{ - Username: token, - Password: p.Password, - IsSuperuser: true, - }); err != nil { - ctx.JSON(http.StatusInternalServerError, response.Response{ - Message: err.Error(), - Data: nil, - }) - - return - } - - ctx.JSON(http.StatusCreated, response.Response{ - Message: "success", - Data: response.Create{ - Token: token, - Password: p.Password, - }, - }) -} diff --git a/internal/web/rest/api/emq/request/create.go b/internal/web/rest/api/emq/request/create.go deleted file mode 100644 index 7d7b9b23..00000000 --- a/internal/web/rest/api/emq/request/create.go +++ /dev/null @@ -1,26 +0,0 @@ -package request - -import ( - "fmt" - - validation "github.com/go-ozzo/ozzo-validation/v4" -) - -// Create is the body payload structure of create emq endpoint. -type Create struct { - Password string `json:"password"` - Username string `json:"username"` - Duration int64 `json:"duration"` -} - -func (r Create) Validate() error { - if err := validation.ValidateStruct(&r, - validation.Field(&r.Password, validation.Required), - validation.Field(&r.Username, validation.Required), - validation.Field(&r.Duration, validation.Required), - ); err != nil { - return fmt.Errorf("create request validation failed: %w", err) - } - - return nil -} diff --git a/internal/web/rest/api/emq/response/create.go b/internal/web/rest/api/emq/response/create.go deleted file mode 100644 index 358ec09d..00000000 --- a/internal/web/rest/api/emq/response/create.go +++ /dev/null @@ -1,6 +0,0 @@ -package response - -type Create struct { - Token string - Password string -} diff --git a/internal/web/rest/api/emq/response/response.go b/internal/web/rest/api/emq/response/response.go deleted file mode 100644 index 46d17bc6..00000000 --- a/internal/web/rest/api/emq/response/response.go +++ /dev/null @@ -1,7 +0,0 @@ -package response - -// Response is the response structure of the REST API. -type Response struct { - Message string `json:"message"` - Data interface{} `json:"data,omitempty"` -} diff --git a/internal/web/rest/api/middlewares.go b/internal/web/rest/api/middlewares.go deleted file mode 100644 index 9170a535..00000000 --- a/internal/web/rest/api/middlewares.go +++ /dev/null @@ -1,45 +0,0 @@ -package api - -import ( - "encoding/base64" - "github.com/gin-gonic/gin" - "gitlab.snapp.ir/dispatching/soteria/v3/internal/app" - accountsInfo "gitlab.snapp.ir/dispatching/soteria/v3/pkg/errors" - "strings" -) - -// accountsBasicAuth is the authentication middleware for the accounts API -func accountsBasicAuth() gin.HandlerFunc { - return func(ctx *gin.Context) { - auth := strings.SplitN(ctx.Request.Header.Get("Authorization"), " ", 2) - - if len(auth) != 2 || auth[0] != "Basic" { - ctx.AbortWithStatusJSON(CreateResponse(accountsInfo.WrongUsernameOrPassword, nil)) - return - } - - payload, _ := base64.StdEncoding.DecodeString(auth[1]) - pair := strings.SplitN(string(payload), ":", 2) - - if len(pair) != 2 { - ctx.AbortWithStatusJSON(CreateResponse(accountsInfo.WrongUsernameOrPassword, nil)) - return - } - - if pair[0] != ctx.Param("username") { - ctx.AbortWithStatusJSON(CreateResponse(accountsInfo.UsernameMismatch, nil)) - return - } - - _, err := app.GetInstance().AccountsService.Info(ctx, pair[0], pair[1]) - if err != nil { - ctx.AbortWithStatusJSON(CreateResponse(err.Code, nil, err.Message)) - return - } - - ctx.Set("username", pair[0]) - ctx.Set("password", pair[1]) - - ctx.Next() - } -} diff --git a/internal/web/rest/api/middlewares_test.go b/internal/web/rest/api/middlewares_test.go deleted file mode 100644 index 188383ed..00000000 --- a/internal/web/rest/api/middlewares_test.go +++ /dev/null @@ -1,76 +0,0 @@ -package api - -import ( - "context" - "github.com/gin-gonic/gin" - "github.com/stretchr/testify/assert" - "gitlab.snapp.ir/dispatching/soteria/v3/internal/app" - "net/http" - "net/http/httptest" - "testing" -) - -func TestAccountsBasicAuth(t *testing.T) { - router := gin.Default() - router.Use(accountsBasicAuth()) - router.GET("/:username", func(ctx *gin.Context) { - ctx.String(http.StatusOK, "done") - return - }) - - _ = app.GetInstance().AccountsService.SignUp(context.Background(), "user", "password", "passenger") - - t.Run("testing successful authentication", func(t *testing.T) { - w := httptest.NewRecorder() - - req, _ := http.NewRequest(http.MethodGet, "/user", nil) - req.SetBasicAuth("user", "password") - - router.ServeHTTP(w, req) - - assert.Equal(t, http.StatusOK, w.Code) - }) - - t.Run("testing without a Authorization header", func(t *testing.T) { - w := httptest.NewRecorder() - - req, _ := http.NewRequest(http.MethodGet, "/user", nil) - - router.ServeHTTP(w, req) - - assert.Equal(t, http.StatusUnauthorized, w.Code) - }) - - t.Run("testing with an invalid auth", func(t *testing.T) { - w := httptest.NewRecorder() - - req, _ := http.NewRequest(http.MethodGet, "/user", nil) - req.Header.Set("Authorization", "Basic invalid") - - router.ServeHTTP(w, req) - - assert.Equal(t, http.StatusUnauthorized, w.Code) - }) - - t.Run("testing different username in path", func(t *testing.T) { - w := httptest.NewRecorder() - - req, _ := http.NewRequest(http.MethodGet, "/user2", nil) - req.SetBasicAuth("user", "password") - - router.ServeHTTP(w, req) - - assert.Equal(t, http.StatusUnauthorized, w.Code) - }) - - t.Run("testing with wrong password", func(t *testing.T) { - w := httptest.NewRecorder() - - req, _ := http.NewRequest(http.MethodGet, "/user", nil) - req.SetBasicAuth("user", "password2") - - router.ServeHTTP(w, req) - - assert.Equal(t, http.StatusUnauthorized, w.Code) - }) -} diff --git a/internal/web/rest/api/token.go b/internal/web/rest/api/token.go deleted file mode 100644 index 918895fd..00000000 --- a/internal/web/rest/api/token.go +++ /dev/null @@ -1,97 +0,0 @@ -package api - -import ( - "errors" - "github.com/gin-gonic/gin" - "github.com/opentracing/opentracing-go" - "gitlab.snapp.ir/dispatching/soteria/v3/internal" - "gitlab.snapp.ir/dispatching/soteria/v3/internal/app" - "gitlab.snapp.ir/dispatching/soteria/v3/internal/db" - "gitlab.snapp.ir/dispatching/soteria/v3/pkg/acl" - "go.uber.org/zap" - "net/http" - "time" -) - -// TokenRequest is the body payload structure of the token endpoint -type TokenRequest struct { - GrantType acl.AccessType `json:"grant_type" form:"grant_type" query:"grant_type"` - ClientID string `json:"client_id" form:"client_id" query:"client_id"` - ClientSecret string `json:"client_secret" form:"client_secret" query:"client_secret"` -} - -// Token is the handler responsible for Token requests -func Token(ctx *gin.Context) { - tokenSpan := app.GetInstance().Tracer.StartSpan("api.rest.token") - defer tokenSpan.Finish() - - s := time.Now() - request := &TokenRequest{} - err := ctx.Bind(request) - if err != nil { - zap.L(). - Warn("bad request", - zap.Error(err), - ) - app.GetInstance().Metrics.ObserveStatusCode(internal.HttpApi, internal.Soteria, internal.Token, http.StatusBadRequest) - app.GetInstance().Metrics.ObserveStatus(internal.HttpApi, internal.Soteria, internal.Token, internal.Failure, "bad request") - app.GetInstance().Metrics.ObserveResponseTime(internal.HttpApi, internal.Soteria, internal.Token, float64(time.Since(s).Nanoseconds())) - ctx.String(http.StatusBadRequest, "bad request") - return - } - - tokenIssueSpan := app.GetInstance().Tracer.StartSpan("issue token", opentracing.ChildOf(tokenSpan.Context())) - - tokenString, err := app.GetInstance().Authenticator.Token(ctx, request.GrantType, request.ClientID, request.ClientSecret) - if err != nil { - zap.L(). - Error("token request is not authorized", - zap.Error(err), - zap.String("grant_type", request.GrantType.String()), - zap.String("client_id", request.ClientID), - zap.String("client_secret", request.ClientSecret), - ) - - tokenIssueSpan.SetTag("success", false) - - tokenIssueSpan.SetTag("error", err.Error()).Finish() - - if errors.Is(err, db.ErrDb) { - app.GetInstance().Metrics.ObserveStatusCode(internal.HttpApi, internal.Soteria, internal.Token, http.StatusInternalServerError) - app.GetInstance().Metrics.ObserveStatus(internal.HttpApi, internal.Soteria, internal.Token, internal.Failure, "database error happened") - app.GetInstance().Metrics.ObserveStatus(internal.HttpApi, internal.Soteria, internal.Token, internal.Failure, request.ClientID) - app.GetInstance().Metrics.ObserveResponseTime(internal.HttpApi, internal.Soteria, internal.Token, float64(time.Since(s).Nanoseconds())) - ctx.String(http.StatusInternalServerError, "internal server error") - - tokenIssueSpan.Finish() - - return - } - - app.GetInstance().Metrics.ObserveStatusCode(internal.HttpApi, internal.Soteria, internal.Token, http.StatusUnauthorized) - app.GetInstance().Metrics.ObserveStatus(internal.HttpApi, internal.Soteria, internal.Token, internal.Failure, "request is not authorized") - app.GetInstance().Metrics.ObserveStatus(internal.HttpApi, internal.Soteria, internal.Token, internal.Failure, request.ClientID) - app.GetInstance().Metrics.ObserveResponseTime(internal.HttpApi, internal.Soteria, internal.Token, float64(time.Since(s).Nanoseconds())) - ctx.String(http.StatusUnauthorized, "request is not authorized") - - tokenIssueSpan.Finish() - - return - } - - zap.L(). - Info("token request accepted", - zap.String("grant_type", request.GrantType.String()), - zap.String("client_id", request.ClientID), - zap.String("client_secret", request.ClientSecret), - ) - - app.GetInstance().Metrics.ObserveStatusCode(internal.HttpApi, internal.Soteria, internal.Token, http.StatusAccepted) - app.GetInstance().Metrics.ObserveStatus(internal.HttpApi, internal.Soteria, internal.Token, internal.Success, "token request accepted") - app.GetInstance().Metrics.ObserveStatus(internal.HttpApi, internal.Soteria, internal.Token, internal.Success, request.ClientID) - app.GetInstance().Metrics.ObserveResponseTime(internal.HttpApi, internal.Soteria, internal.Token, float64(time.Since(s).Nanoseconds())) - - tokenIssueSpan.SetTag("success", true) - - ctx.String(http.StatusAccepted, tokenString) -} From 41ba89b74e73101dcf4db0dceb479b90713aeba1 Mon Sep 17 00:00:00 2001 From: Parham Alvani Date: Tue, 16 Nov 2021 21:30:20 +0330 Subject: [PATCH 044/660] feat: remove unused packages --- pkg/log/l.go | 5 +++-- pkg/memoize/m.go | 26 -------------------------- pkg/memoize/m_test.go | 38 -------------------------------------- pkg/prettify.go | 8 -------- 4 files changed, 3 insertions(+), 74 deletions(-) delete mode 100644 pkg/memoize/m.go delete mode 100644 pkg/memoize/m_test.go delete mode 100644 pkg/prettify.go diff --git a/pkg/log/l.go b/pkg/log/l.go index 9b0daeb7..63f27155 100644 --- a/pkg/log/l.go +++ b/pkg/log/l.go @@ -1,10 +1,11 @@ package log import ( - "go.uber.org/zap" - "go.uber.org/zap/zapcore" "os" "strings" + + "go.uber.org/zap" + "go.uber.org/zap/zapcore" ) var atom zap.AtomicLevel diff --git a/pkg/memoize/m.go b/pkg/memoize/m.go deleted file mode 100644 index 9762158c..00000000 --- a/pkg/memoize/m.go +++ /dev/null @@ -1,26 +0,0 @@ -package memoize - -import ( - "golang.org/x/crypto/bcrypt" -) - -func MemoizedCompareHashAndPassword() func([]byte, []byte) error { - type args struct { - hashedPassword string - password string - } - - cache := make(map[args]error) - - return func(hashedPassword []byte, password []byte) error { - key := args{ - hashedPassword: string(hashedPassword), - password: string(password), - } - if _, ok := cache[key]; !ok { - cache[key] = bcrypt.CompareHashAndPassword(hashedPassword, password) - } - - return cache[key] - } -} diff --git a/pkg/memoize/m_test.go b/pkg/memoize/m_test.go deleted file mode 100644 index 1f37858d..00000000 --- a/pkg/memoize/m_test.go +++ /dev/null @@ -1,38 +0,0 @@ -package memoize_test - -import ( - "testing" - "time" - - "github.com/stretchr/testify/assert" - "gitlab.snapp.ir/dispatching/soteria/v3/pkg/memoize" - "golang.org/x/crypto/bcrypt" -) - -func TestMemoizedCompareHashAndPassword(t *testing.T) { - t.Parallel() - - fn := memoize.MemoizedCompareHashAndPassword() - hashedPassword, _ := bcrypt.GenerateFromPassword([]byte("test"), bcrypt.DefaultCost) - actual := fn(hashedPassword, []byte("test")) - expected := bcrypt.CompareHashAndPassword(hashedPassword, []byte("test")) - assert.Equal(t, actual, expected) - - s1 := time.Now() - - for i := 0; i < 10; i++ { - _ = bcrypt.CompareHashAndPassword(hashedPassword, []byte("test")) - } - - d1 := time.Since(s1) - - s2 := time.Now() - - for i := 0; i < 10; i++ { - _ = fn(hashedPassword, []byte("test")) - } - - d2 := time.Since(s2) - - assert.Less(t, d2.Nanoseconds(), d1.Nanoseconds()) -} diff --git a/pkg/prettify.go b/pkg/prettify.go deleted file mode 100644 index d59b55d3..00000000 --- a/pkg/prettify.go +++ /dev/null @@ -1,8 +0,0 @@ -package pkg - -import "encoding/json" - -func PrettifyStruct(i interface{}) string { - s, _ := json.MarshalIndent(i, "", "\t") - return string(s) -} From 21af8731bd4c0b359f2a6b77c52e03a1280a01c5 Mon Sep 17 00:00:00 2001 From: Parham Alvani Date: Tue, 16 Nov 2021 21:38:24 +0330 Subject: [PATCH 045/660] feat: remove accounts --- internal/accounts/accounts.go | 8 -- internal/accounts/delete.go | 16 ---- internal/accounts/info.go | 23 ------ internal/accounts/rules.go | 136 -------------------------------- internal/accounts/rules_test.go | 77 ------------------ internal/accounts/signup.go | 35 -------- internal/accounts/update.go | 57 ------------- 7 files changed, 352 deletions(-) delete mode 100644 internal/accounts/accounts.go delete mode 100644 internal/accounts/delete.go delete mode 100644 internal/accounts/info.go delete mode 100644 internal/accounts/rules.go delete mode 100644 internal/accounts/rules_test.go delete mode 100644 internal/accounts/signup.go delete mode 100644 internal/accounts/update.go diff --git a/internal/accounts/accounts.go b/internal/accounts/accounts.go deleted file mode 100644 index cb65e0dc..00000000 --- a/internal/accounts/accounts.go +++ /dev/null @@ -1,8 +0,0 @@ -package accounts - -import "gitlab.snapp.ir/dispatching/soteria/v3/internal/db" - -// Service is responsible for all things related to account handling. -type Service struct { - Handler db.ModelHandler -} diff --git a/internal/accounts/delete.go b/internal/accounts/delete.go deleted file mode 100644 index dca61387..00000000 --- a/internal/accounts/delete.go +++ /dev/null @@ -1,16 +0,0 @@ -package accounts - -import ( - "context" - - "gitlab.snapp.ir/dispatching/soteria/v3/pkg/errors" -) - -// Delete removes a user by given username and password from database -func (s Service) Delete(ctx context.Context, username string) *errors.Error { - if err := s.Handler.Delete(ctx, "user", username); err != nil { - return errors.CreateError(errors.DatabaseDeleteFailure, err.Error()) - } - - return nil -} diff --git a/internal/accounts/info.go b/internal/accounts/info.go deleted file mode 100644 index 5cbdf3b1..00000000 --- a/internal/accounts/info.go +++ /dev/null @@ -1,23 +0,0 @@ -package accounts - -import ( - "context" - - "gitlab.snapp.ir/dispatching/soteria/v3/pkg/errors" - "gitlab.snapp.ir/dispatching/soteria/v3/pkg/user" - "golang.org/x/crypto/bcrypt" -) - -// Info returns a user based on given username and password. -func (s Service) Info(ctx context.Context, username, password string) (*user.User, *errors.Error) { - var u user.User - if err := s.Handler.Get(ctx, "user", username, &u); err != nil { - return nil, errors.CreateError(errors.DatabaseGetFailure, err.Error()) - } - - if err := bcrypt.CompareHashAndPassword([]byte(u.Password), []byte(password)); err != nil { - return nil, errors.CreateError(errors.WrongUsernameOrPassword, "") - } - - return &u, nil -} diff --git a/internal/accounts/rules.go b/internal/accounts/rules.go deleted file mode 100644 index 2bfbffad..00000000 --- a/internal/accounts/rules.go +++ /dev/null @@ -1,136 +0,0 @@ -package accounts - -import ( - "context" - "time" - - "github.com/google/uuid" - "gitlab.snapp.ir/dispatching/soteria/v3/internal/topics" - "gitlab.snapp.ir/dispatching/soteria/v3/pkg/acl" - "gitlab.snapp.ir/dispatching/soteria/v3/pkg/errors" - "gitlab.snapp.ir/dispatching/soteria/v3/pkg/user" -) - -// CreateRule will add a new rule with given information to a user -func (s Service) CreateRule(ctx context.Context, username, endpoint string, topicPattern topics.Type, accessType acl.AccessType) (*user.Rule, *errors.Error) { - if err := validateRuleInfo(endpoint, topicPattern, accessType); err != nil { - return nil, err - } - - var u user.User - if err := s.Handler.Get(ctx, "user", username, &u); err != nil { - return nil, errors.CreateError(errors.DatabaseGetFailure, err.Error()) - } - - rule := &user.Rule{ - UUID: uuid.New(), - Endpoint: endpoint, - Topic: topicPattern, - AccessType: accessType, - } - - u.Rules = append(u.Rules, *rule) - - u.MetaData.DateModified = time.Now() - - if err := s.Handler.Update(ctx, u); err != nil { - return nil, errors.CreateError(errors.DatabaseUpdateFailure, err.Error()) - } - - return rule, nil -} - -// GetRule returns a user rule based on given username, password and rule UUID -func (s Service) GetRule(ctx context.Context, username string, id uuid.UUID) (*user.Rule, *errors.Error) { - var u user.User - if err := s.Handler.Get(ctx, "user", username, &u); err != nil { - return nil, errors.CreateError(errors.DatabaseGetFailure, err.Error()) - } - - for _, r := range u.Rules { - if r.UUID == id { - return &r, nil - } - } - - return nil, errors.CreateError(errors.RuleNotFound, "") -} - -// UpdateRule updates an account's rule based on given username, UUID and information -func (s Service) UpdateRule(ctx context.Context, username string, id uuid.UUID, endpoint string, topicPattern topics.Type, accessType acl.AccessType) *errors.Error { - if err := validateRuleInfo(endpoint, topicPattern, accessType); err != nil { - return err - } - - var u user.User - if err := s.Handler.Get(ctx, "user", username, &u); err != nil { - return errors.CreateError(errors.DatabaseGetFailure, err.Error()) - } - - var ruleIndex *int - for i, r := range u.Rules { - if r.UUID == id { - ruleIndex = &i - } - } - if ruleIndex == nil { - return errors.CreateError(errors.RuleNotFound, "") - } - - u.Rules[*ruleIndex].Endpoint = endpoint - u.Rules[*ruleIndex].Topic = topicPattern - u.Rules[*ruleIndex].AccessType = accessType - - u.MetaData.DateModified = time.Now() - - if err := s.Handler.Update(ctx, u); err != nil { - return errors.CreateError(errors.DatabaseUpdateFailure, err.Error()) - } - - return nil -} - -// DeleteRule deletes an account's rule based on given username and UUID -func (s Service) DeleteRule(ctx context.Context, username string, id uuid.UUID) *errors.Error { - var u user.User - if err := s.Handler.Get(ctx, "user", username, &u); err != nil { - return errors.CreateError(errors.DatabaseGetFailure, err.Error()) - } - - var ruleIndex *int - for i, r := range u.Rules { - if r.UUID == id { - ruleIndex = &i - } - } - if ruleIndex == nil { - return errors.CreateError(errors.RuleNotFound, "") - } - - u.Rules = append(u.Rules[:*ruleIndex], u.Rules[*ruleIndex+1:]...) - - u.MetaData.DateModified = time.Now() - - if err := s.Handler.Update(ctx, u); err != nil { - return errors.CreateError(errors.DatabaseUpdateFailure, err.Error()) - } - - return nil -} - -// validateRuleInfo will validate a rule info -func validateRuleInfo(endpoint string, topicPattern topics.Type, accessType acl.AccessType) *errors.Error { - if endpoint == "" && topicPattern == "" && accessType == "" { - return errors.CreateError(errors.InvalidRule, "all rule information is empty") - } - - if accessType == "" { - return errors.CreateError(errors.InvalidRule, "access type is necessary") - } - - if (endpoint != "" && topicPattern != "") || (endpoint == "" && topicPattern == "") { - return errors.CreateError(errors.InvalidRule, "either endpoint or topic pattern should be present") - } - - return nil -} diff --git a/internal/accounts/rules_test.go b/internal/accounts/rules_test.go deleted file mode 100644 index a9c4c72b..00000000 --- a/internal/accounts/rules_test.go +++ /dev/null @@ -1,77 +0,0 @@ -package accounts - -import ( - "github.com/stretchr/testify/assert" - "gitlab.snapp.ir/dispatching/soteria/v3/internal/topics" - "gitlab.snapp.ir/dispatching/soteria/v3/pkg/acl" - "gitlab.snapp.ir/dispatching/soteria/v3/pkg/errors" - "testing" -) - -func TestValidateRuleInfo(t *testing.T) { - t.Run("test with with invalid rule info", func(t *testing.T) { - endpoint := "" - topicPattern := topics.Type("") - accessType := acl.AccessType("") - - err := validateRuleInfo(endpoint, topicPattern, accessType) - assert.NotNil(t, err) - assert.Equal(t, errors.InvalidRule, err.Code) - - endpoint = "/notification" - topicPattern = topics.DriverLocation - accessType = "" - - err = validateRuleInfo(endpoint, topicPattern, accessType) - assert.NotNil(t, err) - assert.Equal(t, errors.InvalidRule, err.Code) - - endpoint = "/notification" - topicPattern = topics.DriverLocation - accessType = "" - - err = validateRuleInfo(endpoint, topicPattern, accessType) - assert.NotNil(t, err) - assert.Equal(t, errors.InvalidRule, err.Code) - - endpoint = "/notification" - topicPattern = topics.CabEvent - accessType = acl.Pub - - err = validateRuleInfo(endpoint, topicPattern, accessType) - assert.NotNil(t, err) - assert.Equal(t, errors.InvalidRule, err.Code) - - endpoint = "" - topicPattern = topics.DriverLocation - accessType = "" - - err = validateRuleInfo(endpoint, topicPattern, accessType) - assert.NotNil(t, err) - assert.Equal(t, errors.InvalidRule, err.Code) - - endpoint = "" - topicPattern = "" - accessType = acl.Sub - - err = validateRuleInfo(endpoint, topicPattern, accessType) - assert.NotNil(t, err) - assert.Equal(t, errors.InvalidRule, err.Code) - }) - - t.Run("test with with valid rule info", func(t *testing.T) { - endpoint := "/notification" - topicPattern := topics.Type("") - accessType := acl.Pub - - err := validateRuleInfo(endpoint, topicPattern, accessType) - assert.Nil(t, err) - - endpoint = "" - topicPattern = topics.DriverLocation - accessType = acl.Pub - - err = validateRuleInfo(endpoint, topicPattern, accessType) - assert.Nil(t, err) - }) -} diff --git a/internal/accounts/signup.go b/internal/accounts/signup.go deleted file mode 100644 index f6109dbd..00000000 --- a/internal/accounts/signup.go +++ /dev/null @@ -1,35 +0,0 @@ -package accounts - -import ( - "context" - "time" - - "gitlab.snapp.ir/dispatching/soteria/v3/internal/db" - "gitlab.snapp.ir/dispatching/soteria/v3/pkg/errors" - "gitlab.snapp.ir/dispatching/soteria/v3/pkg/user" - "golang.org/x/crypto/bcrypt" -) - -// SignUp creates a user with the given information in database -func (s Service) SignUp(ctx context.Context, username, password string, userType user.Type) *errors.Error { - hash, err := bcrypt.GenerateFromPassword([]byte(password), bcrypt.DefaultCost) - if err != nil { - return errors.CreateError(errors.PasswordHashGenerationFailure, err.Error()) - } - - u := user.User{ - MetaData: db.MetaData{ - ModelName: "user", - DateCreated: time.Now(), - DateModified: time.Now(), - }, - Username: username, - Password: string(hash), - Type: userType, - } - if err := s.Handler.Save(context.Background(), u); err != nil { - return errors.CreateError(errors.DatabaseSaveFailure, err.Error()) - } - - return nil -} diff --git a/internal/accounts/update.go b/internal/accounts/update.go deleted file mode 100644 index 99b82668..00000000 --- a/internal/accounts/update.go +++ /dev/null @@ -1,57 +0,0 @@ -package accounts - -import ( - "context" - "time" - - "gitlab.snapp.ir/dispatching/soteria/v3/pkg/errors" - "gitlab.snapp.ir/dispatching/soteria/v3/pkg/user" - "golang.org/x/crypto/bcrypt" -) - -// Update updates given username with given new data in `newInfo` in database -func (s Service) Update( - ctx context.Context, - username string, - newPassword string, - newType user.Type, - newIPs []string, - newSecret string, - newTokenExpiration time.Duration) *errors.Error { - var u user.User - if err := s.Handler.Get(context.Background(), "user", username, &u); err != nil { - return errors.CreateError(errors.DatabaseGetFailure, err.Error()) - } - - if newPassword != "" { - hash, err := bcrypt.GenerateFromPassword([]byte(newPassword), bcrypt.DefaultCost) - if err != nil { - return errors.CreateError(errors.PasswordHashGenerationFailure, err.Error()) - } - u.Password = string(hash) - } - - if newType != "" { - u.Type = newType - } - - if newSecret != "" { - u.Secret = newSecret - } - - if newIPs != nil && len(newIPs) != 0 { - u.IPs = newIPs - } - - if newTokenExpiration != 0 { - u.TokenExpirationDuration = newTokenExpiration - } - - u.MetaData.DateModified = time.Now() - - if err := s.Handler.Update(context.Background(), u); err != nil { - return errors.CreateError(errors.DatabaseUpdateFailure, err.Error()) - } - - return nil -} From 61a0e1968c9b30043d885590a049b5880ea15ddd Mon Sep 17 00:00:00 2001 From: Parham Alvani Date: Tue, 16 Nov 2021 21:38:51 +0330 Subject: [PATCH 046/660] feat: remove pre-compile --- .gitlab-ci.yml | 2 -- .gitlab/ci/templates/precompile.gitlab-ci.yml | 17 ----------------- 2 files changed, 19 deletions(-) delete mode 100644 .gitlab/ci/templates/precompile.gitlab-ci.yml diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 484c3a80..2e78a173 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -3,7 +3,6 @@ image: registry.snapp.tech/docker/golang:1.11.4-alpine3.8 stages: - lint - - pre-compile - compile - test - build @@ -14,7 +13,6 @@ variables: PROJECT_VERSION: "${CI_COMMIT_SHA}" include: - - local: .gitlab/ci/templates/precompile.gitlab-ci.yml - local: .gitlab/ci/templates/compile.gitlab-ci.yml - local: .gitlab/ci/templates/test.gitlab-ci.yml - local: .gitlab/ci/templates/build.gitlab-ci.yml diff --git a/.gitlab/ci/templates/precompile.gitlab-ci.yml b/.gitlab/ci/templates/precompile.gitlab-ci.yml deleted file mode 100644 index 1dceda4c..00000000 --- a/.gitlab/ci/templates/precompile.gitlab-ci.yml +++ /dev/null @@ -1,17 +0,0 @@ -code-generator: - stage: pre-compile - image: - name: namely/protoc-all - entrypoint: [""] - script: - - entrypoint.sh -d ./internal/web/grpc/contracts -l go -o ./internal/web/grpc/contracts --with-gateway --go-source-relative - artifacts: - paths: - - ./internal/web/grpc/contracts - expire_in: 1 week -# cache: -# paths: -# - ./web/grpc/contracts - except: - variables: - - $UPDATE_ENVIRONMENT_VARIABLE \ No newline at end of file From 079e700a2b0288830564873dfa0c5d66a2c8ed5d Mon Sep 17 00:00:00 2001 From: Parham Alvani Date: Tue, 16 Nov 2021 21:39:04 +0330 Subject: [PATCH 047/660] feat: remove unused api --- api/swagger.yml | 327 +++--------------------------------------------- 1 file changed, 18 insertions(+), 309 deletions(-) diff --git a/api/swagger.yml b/api/swagger.yml index 5cae6513..221ecc01 100644 --- a/api/swagger.yml +++ b/api/swagger.yml @@ -1,65 +1,46 @@ --- swagger: '2.0' info: - version: 3.5.0 + version: 5.0.0 title: Soteria - paths: /auth: post: summary: Authenticates EMQ user's connection request produces: - - text + - text consumes: - - application/json + - application/json parameters: - - in: body - name: request - description: Request body - schema: - $ref: '#/definitions/auth' + - in: body + name: request + description: Request body + schema: + $ref: '#/definitions/auth' responses: 401: description: Request is not authorized 400: description: Bad input parameter 200: - description: if body is empty means OK, if contains "ignore" it means request is ignored + description: > + if body is empty means OK, + if contains "ignore" it means request is ignored /acl: post: summary: Authorizes EMQ user's subscription request produces: - - text + - text consumes: - - application/json - parameters: - - in: body - name: request - description: Request body - schema: - $ref: '#/definitions/acl' - responses: - 401: - description: Request is not authorized - 400: - description: Bad input parameter - 200: - description: OK - /token: - post: - summary: Generates token for EMQ users - produces: - - text - consumes: - - application/json + - application/json parameters: - - in: body - name: request - description: Request body - schema: - $ref: '#/definitions/token' + - in: body + name: request + description: Request body + schema: + $ref: '#/definitions/acl' responses: 401: description: Request is not authorized @@ -68,187 +49,6 @@ paths: 200: description: OK - /accounts: - post: - summary: Creates new account - produces: - - application/json - consumes: - - application/json - parameters: - - in: body - name: request - description: Request body - schema: - $ref: '#/definitions/createaccount' - responses: - 400: - description: Bad input parameter - 200: - description: OK - - /accounts/:username: - get: - summary: gets account - produces: - - application/json - consumes: - - application/json - security: - - basicAuth: [] - responses: - 400: - description: Bad input parameter - schema: - $ref: '#/definitions/response' - 200: - description: OK - schema: - $ref: '#/definitions/user' - put: - summary: updates the account - produces: - - application/json - consumes: - - application/json - security: - - basicAuth: [] - parameters: - - in: body - name: request - description: Request body - schema: - $ref: '#/definitions/updateaccount' - - responses: - 400: - description: Bad input parameter - schema: - $ref: '#/definitions/response' - 500: - description: Internal Server Error - schema: - $ref: '#/definitions/response' - 200: - description: OK - schema: - $ref: '#/definitions/response' - delete: - summary: deletes the account - produces: - - application/json - consumes: - - application/json - security: - - basicAuth: [] - responses: - 400: - description: Bad input parameter - schema: - $ref: '#/definitions/response' - 500: - description: Internal Server Error - schema: - $ref: '#/definitions/response' - 200: - description: OK - schema: - $ref: '#/definitions/response' - - - /accounts/:username/rules: - post: - summary: creates new rule - produces: - - application/json - consumes: - - application/json - security: - - basicAuth: [] - parameters: - - in: body - name: request - description: Request body - schema: - $ref: '#/definitions/rule' - responses: - 400: - description: Bad input parameter - schema: - $ref: '#/definitions/response' - 200: - description: OK - schema: - $ref: '#/definitions/response' - - - /accounts/:username/rules/:uuid: - get: - summary: get the rule with uuid - produces: - - application/json - consumes: - - application/json - security: - - basicAuth: [] - responses: - 400: - description: Bad input parameter - schema: - $ref: '#/definitions/response' - 200: - description: OK - schema: - $ref: '#/definitions/response' - - put: - summary: updates a rule - produces: - - application/json - consumes: - - application/json - security: - - basicAuth: [] - parameters: - - in: body - name: request - description: Request body - schema: - $ref: '#/definitions/rule' - responses: - 400: - description: Bad input parameter - schema: - $ref: '#/definitions/response' - 200: - description: OK - schema: - $ref: '#/definitions/response' - - delete: - summary: deletes the rule with uuid - produces: - - application/json - consumes: - - application/json - security: - - basicAuth: [] - responses: - 400: - description: Bad input parameter - schema: - $ref: '#/definitions/response' - 200: - description: OK - schema: - $ref: '#/definitions/response' - -components: - securitySchemes: - basicAuth: # <-- arbitrary name for the security scheme - type: http - scheme: basic - definitions: auth: type: object @@ -274,94 +74,3 @@ definitions: type: string enum: ["1", "2", "3"] example: "1" - - token: - type: object - required: - - grant_type - - client_id - - client_secret - properties: - grant_type: - type: string - client_id: - type: string - example: "snapp-box" - client_secret: - type: string - - createaccount: - type: object - required: - - username - - password - - user_type - properties: - username: - type: string - password: - type: string - user_type: - type: string - enum: ["HeraldUser", "EMQUser", "Staff"] - - updateaccount: - type: object - properties: - new_password: - type: string - IPs: - type: array - items: - type: string - token_expiration: - type: string - secret: - type: string - user_type: - type: string - enum: ["HeraldUser", "EMQUser", "Staff"] - - user: - type: object - properties: - username: - type: string - password: - type: string - IPs: - type: array - items: - type: string - token_expiration_duration: - type: string - rules: - type: array - items: - schema: - $ref: '#/definitions/rule' - example: - uuid: "1" - endpoint: "/event" - access_type: "2" - - response: - type: object - properties: - code: - type: integer - message: - type: string - data: - type: object - - rule: - type: object - properties: - endpoint: - type: string - topic: - type: string - access_type: - type: string - enum: ["2", "1", "3"] From a0d33f1d183dd55fff855588501202850205cb72 Mon Sep 17 00:00:00 2001 From: Parham Alvani Date: Tue, 16 Nov 2021 21:39:18 +0330 Subject: [PATCH 048/660] feat: update metrics --- internal/metrics/metrics.go | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/internal/metrics/metrics.go b/internal/metrics/metrics.go index 099b1ef4..9a85478c 100644 --- a/internal/metrics/metrics.go +++ b/internal/metrics/metrics.go @@ -9,7 +9,7 @@ type SoteriaMetrics struct { Handler metrics.Handler } -// NewMetrics creates and returns all metrics needed in Soteria +// NewMetrics creates and returns all metrics needed in Soteria. func NewMetrics() *SoteriaMetrics { statusCodesCounter := prometheus.NewCounterVec(prometheus.CounterOpts{ Namespace: "dispatching", @@ -36,11 +36,11 @@ func NewMetrics() *SoteriaMetrics { prometheus.MustRegister(statusesCounter) prometheus.MustRegister(responseTimesSummery) - h := metrics.Handler{ - StatusCodeCounterVec: statusCodesCounter, - StatusCounterVec: statusesCounter, - ResponseTimeVec: responseTimesSummery, + return &SoteriaMetrics{ + metrics.Handler{ + StatusCodeCounterVec: statusCodesCounter, + StatusCounterVec: statusesCounter, + ResponseTimeVec: responseTimesSummery, + }, } - - return &SoteriaMetrics{h} } From b26c3f97cc52ed3d4a3df63b42a0a0bb1571984e Mon Sep 17 00:00:00 2001 From: Parham Alvani Date: Tue, 16 Nov 2021 21:39:27 +0330 Subject: [PATCH 049/660] feat: remove emq package --- internal/emq/store.go | 97 ----------------------------------- internal/emq/store_test.go | 102 ------------------------------------- internal/emq/user.go | 9 ---- 3 files changed, 208 deletions(-) delete mode 100644 internal/emq/store.go delete mode 100644 internal/emq/store_test.go delete mode 100644 internal/emq/user.go diff --git a/internal/emq/store.go b/internal/emq/store.go deleted file mode 100644 index 5fcbb399..00000000 --- a/internal/emq/store.go +++ /dev/null @@ -1,97 +0,0 @@ -package emq - -import ( - "context" - "errors" - "fmt" - "strings" - - "github.com/go-redis/redis/v8" -) - -type Store struct { - Client *redis.Client -} - -var ( - ErrInvalidHResult = errors.New("invalid hresult structure") - ErrUserNotExists = errors.New("user doesn't exist") -) - -const ( - PasswordHKey = "password" - IsSuperuserHKey = "is_superuser" -) - -func Key(username string) string { - return fmt.Sprintf("mqtt_user:%s", username) -} - -func booleanToOneZero(b bool) int { - if b { - return 1 - } - - return 0 -} - -func (s *Store) Save(ctx context.Context, u User) error { - if err := s.Client.HSet(ctx, Key(u.Username), PasswordHKey, u.Password, - IsSuperuserHKey, booleanToOneZero(u.IsSuperuser)).Err(); err != nil { - return fmt.Errorf("failed to save into redis %w", err) - } - - return nil -} - -func (s *Store) Load(ctx context.Context, username string) (User, error) { - val, err := s.Client.HGetAll(ctx, Key(username)).Result() - if err != nil { - return User{}, fmt.Errorf("failed to load from redis %w", err) - } - - if len(val) == 0 { - return User{}, ErrUserNotExists - } - - password, ok := val[PasswordHKey] - if !ok { - return User{}, ErrInvalidHResult - } - - siss, ok := val[IsSuperuserHKey] - if !ok { - return User{}, ErrInvalidHResult - } - - iss := false - if siss == "1" { - iss = true - } - - return User{ - Password: password, - IsSuperuser: iss, - Username: username, - }, nil -} - -func (s *Store) LoadAll(ctx context.Context) ([]User, error) { - keys, err := s.Client.Keys(ctx, "mqtt_user:*").Result() - if err != nil { - return nil, fmt.Errorf("failed to fetch keys from redis %w", err) - } - - users := make([]User, 0) - - for _, key := range keys { - user, err := s.Load(ctx, strings.TrimPrefix(key, "mqtt_user:")) - if err != nil { - return nil, fmt.Errorf("failed to fetch user from redis %w", err) - } - - users = append(users, user) - } - - return users, nil -} diff --git a/internal/emq/store_test.go b/internal/emq/store_test.go deleted file mode 100644 index 63df608e..00000000 --- a/internal/emq/store_test.go +++ /dev/null @@ -1,102 +0,0 @@ -package emq_test - -import ( - "context" - "fmt" - "testing" - - "github.com/alicebob/miniredis/v2" - "github.com/go-redis/redis/v8" - "github.com/stretchr/testify/suite" - "gitlab.snapp.ir/dispatching/soteria/v3/internal/emq" -) - -type StoreSuite struct { - suite.Suite - - Client *redis.Client - Store emq.Store -} - -func (suite *StoreSuite) SetupSuite() { - mr, err := miniredis.Run() - suite.Require().NoError(err) - - // nolint: exhaustivestruct - client := redis.NewClient(&redis.Options{ - Addr: mr.Addr(), - }) - - suite.Client = client - suite.Store = emq.Store{Client: client} -} - -func (suite *StoreSuite) TearDownTest() { - suite.Require().NoError(suite.Client.FlushAll(context.Background()).Err()) -} - -func (suite *StoreSuite) TestSave() { - require := suite.Require() - - ctx := context.Background() - - require.NoError(suite.Store.Save(ctx, emq.User{ - Username: "secret", - Password: "password", - IsSuperuser: true, - })) - - ok, err := suite.Client.Exists(ctx, "mqtt_user:secret").Result() - require.NoError(err) - require.Equal(int64(1), ok) -} - -func (suite *StoreSuite) TestLoad() { - require := suite.Require() - - ctx := context.Background() - - user := emq.User{ - Username: "secret", - Password: "password", - IsSuperuser: true, - } - - require.NoError(suite.Store.Save(ctx, user)) - - u, err := suite.Store.Load(ctx, user.Username) - require.NoError(err) - require.Equal(u, user) -} - -func (suite *StoreSuite) TestLoadAll() { - require := suite.Require() - - total := 10 - - ctx := context.Background() - - users := make([]emq.User, 0) - - for index := 0; index < total; index++ { - user := emq.User{ - Username: fmt.Sprintf("secret-%d", index), - Password: "password", - IsSuperuser: true, - } - - users = append(users, user) - - require.NoError(suite.Store.Save(ctx, user)) - } - - us, err := suite.Store.LoadAll(ctx) - require.NoError(err) - require.Equal(us, users) -} - -func TestStoreSuite(t *testing.T) { - t.Parallel() - - suite.Run(t, new(StoreSuite)) -} diff --git a/internal/emq/user.go b/internal/emq/user.go deleted file mode 100644 index c03f6ab9..00000000 --- a/internal/emq/user.go +++ /dev/null @@ -1,9 +0,0 @@ -package emq - -// User contains the user information for storing in emq based on its redis-auth plugin. -// https://github.com/emqx/emqx-auth-redis -type User struct { - Username string - Password string - IsSuperuser bool -} From 07de86fb6fd7a2f6e80bc68eaec499d83e328924 Mon Sep 17 00:00:00 2001 From: Parham Alvani Date: Tue, 16 Nov 2021 21:43:31 +0330 Subject: [PATCH 050/660] update user description --- pkg/user/user.go | 44 +++++--------------------------------------- 1 file changed, 5 insertions(+), 39 deletions(-) diff --git a/pkg/user/user.go b/pkg/user/user.go index 96d57944..ff292db2 100644 --- a/pkg/user/user.go +++ b/pkg/user/user.go @@ -1,10 +1,6 @@ package user import ( - "time" - - "github.com/google/uuid" - "gitlab.snapp.ir/dispatching/soteria/v3/internal/db" "gitlab.snapp.ir/dispatching/soteria/v3/internal/topics" "gitlab.snapp.ir/dispatching/soteria/v3/pkg/acl" ) @@ -12,46 +8,27 @@ import ( // Type indicates user type which is herald, emq and staff. type Type string -const ( - HeraldUser Type = "HeraldUser" - EMQUser Type = "EMQUser" - Staff Type = "Staff" -) - // Issuer indicate issuers. type Issuer string const ( - Driver Issuer = "0" - Passenger Issuer = "1" - ThirdParty Issuer = "100" + Driver Issuer = "0" + Passenger Issuer = "1" ) // User is Soteria's users db model. type User struct { - MetaData db.MetaData `json:"meta_data"` - Username string `json:"username"` - Password string `json:"password"` - Type Type `json:"type"` - IPs []string `json:"ips"` - Secret string `json:"secret"` - TokenExpirationDuration time.Duration `json:"token_expiration_duration"` - Rules []Rule `json:"rules"` + Username string `json:"username"` + Type Type `json:"type"` + Rules []Rule `json:"rules"` } // Rule tells about a access to a specific topic or endpoint. type Rule struct { - UUID uuid.UUID `json:"uuid"` - Endpoint string `json:"endpoint"` Topic topics.Type `json:"topic"` AccessType acl.AccessType `json:"access_type"` } -// GetMetadata is for getting metadata of a user model such as date created. -func (u User) GetMetadata() db.MetaData { - return u.MetaData -} - // GetPrimaryKey is for knowing a model primary key. func (u User) GetPrimaryKey() string { return u.Username @@ -67,14 +44,3 @@ func (u User) CheckTopicAllowance(topic topics.Type, accessType acl.AccessType) return false } - -// CheckEndpointAllowance checks whether the user is allowed to use a Herald endpoint or not. -func (u User) CheckEndpointAllowance(endpoint string) bool { - for _, rule := range u.Rules { - if rule.Endpoint == endpoint && rule.AccessType == acl.Pub { - return true - } - } - - return false -} From 936340ef728d1c585bb043511a936ad287822556 Mon Sep 17 00:00:00 2001 From: Parham Alvani Date: Tue, 16 Nov 2021 21:48:42 +0330 Subject: [PATCH 051/660] feat: update user configuration --- pkg/user/user.go | 4 ---- 1 file changed, 4 deletions(-) diff --git a/pkg/user/user.go b/pkg/user/user.go index ff292db2..70f6e28e 100644 --- a/pkg/user/user.go +++ b/pkg/user/user.go @@ -5,9 +5,6 @@ import ( "gitlab.snapp.ir/dispatching/soteria/v3/pkg/acl" ) -// Type indicates user type which is herald, emq and staff. -type Type string - // Issuer indicate issuers. type Issuer string @@ -19,7 +16,6 @@ const ( // User is Soteria's users db model. type User struct { Username string `json:"username"` - Type Type `json:"type"` Rules []Rule `json:"rules"` } From ee8564a2fe9c5c6dd2360a7dab0ffe529896ab16 Mon Sep 17 00:00:00 2001 From: Parham Alvani Date: Tue, 16 Nov 2021 23:55:55 +0330 Subject: [PATCH 052/660] feat: remove redis databases --- internal/db/cachedredis/c.go | 68 ------- internal/db/cachedredis/c_test.go | 157 -------------- internal/db/main/main.go | 326 ------------------------------ internal/db/models.go | 23 +-- internal/db/redis/client.go | 33 --- internal/db/redis/redis.go | 94 --------- internal/db/redis/redis_test.go | 144 ------------- 7 files changed, 2 insertions(+), 843 deletions(-) delete mode 100644 internal/db/cachedredis/c.go delete mode 100644 internal/db/cachedredis/c_test.go delete mode 100644 internal/db/main/main.go delete mode 100644 internal/db/redis/client.go delete mode 100644 internal/db/redis/redis.go delete mode 100644 internal/db/redis/redis_test.go diff --git a/internal/db/cachedredis/c.go b/internal/db/cachedredis/c.go deleted file mode 100644 index 7affa532..00000000 --- a/internal/db/cachedredis/c.go +++ /dev/null @@ -1,68 +0,0 @@ -package cachedredis - -import ( - "context" - "encoding/json" - - "github.com/patrickmn/go-cache" - "gitlab.snapp.ir/dispatching/soteria/v3/internal/db" - "gitlab.snapp.ir/dispatching/soteria/v3/internal/db/redis" -) - -type ModelHandler struct { - redisModelHandler *redis.ModelHandler - cache *cache.Cache -} - -func NewCachedRedisModelHandler(redisModelHandler *redis.ModelHandler, cache *cache.Cache) *ModelHandler { - return &ModelHandler{ - redisModelHandler: redisModelHandler, - cache: cache, - } -} - -// Save saves a model in redis. -func (mh *ModelHandler) Save(ctx context.Context, model db.Model) error { - return mh.redisModelHandler.Save(ctx, model) -} - -// Delete finds and deletes a model from redis and cache. -func (mh *ModelHandler) Delete(ctx context.Context, modelName, pk string) error { - key := redis.GenerateKey(modelName, pk) - mh.cache.Delete(key) - - return mh.redisModelHandler.Delete(ctx, modelName, pk) -} - -// Get searches cache at first then returns a model from redis or from cache, if exists. -func (mh *ModelHandler) Get(ctx context.Context, modelName, pk string, v db.Model) error { - key := redis.GenerateKey(modelName, pk) - - item, found := mh.cache.Get(key) - if found { - if err := json.Unmarshal([]byte(item.(string)), v); err != nil { - return err - } - - return nil - } - - err := mh.redisModelHandler.Get(ctx, modelName, pk, v) - if err != nil { - return err - } - - value, _ := json.Marshal(v) - mh.cache.SetDefault(key, string(value)) - - return nil -} - -// Update invalidates cache and then finds and updates a model in redis. -func (mh *ModelHandler) Update(ctx context.Context, model db.Model) error { - key := redis.GenerateKey(model.GetMetadata().ModelName, model.GetPrimaryKey()) - - mh.cache.Delete(key) - - return mh.redisModelHandler.Update(ctx, model) -} diff --git a/internal/db/cachedredis/c_test.go b/internal/db/cachedredis/c_test.go deleted file mode 100644 index 531ea0f3..00000000 --- a/internal/db/cachedredis/c_test.go +++ /dev/null @@ -1,157 +0,0 @@ -package cachedredis_test - -import ( - "context" - "encoding/json" - "testing" - "time" - - "github.com/alicebob/miniredis/v2" - "github.com/go-redis/redis/v8" - "github.com/patrickmn/go-cache" - "github.com/stretchr/testify/suite" - "gitlab.snapp.ir/dispatching/soteria/v3/internal/db" - "gitlab.snapp.ir/dispatching/soteria/v3/internal/db/cachedredis" - rd "gitlab.snapp.ir/dispatching/soteria/v3/internal/db/redis" -) - -type CacheModelHandlerSuite struct { - suite.Suite - - Model db.ModelHandler - DB *redis.Client - Cache *cache.Cache -} - -func (suite *CacheModelHandlerSuite) SetupSuite() { - mr, err := miniredis.Run() - suite.NoError(err) - - // nolint: exhaustivestruct - client := redis.NewClient(&redis.Options{ - Addr: mr.Addr(), - }) - - cache := cache.New(time.Minute*60, time.Minute*60) - - suite.DB = client - suite.Cache = cache - - suite.Model = cachedredis.NewCachedRedisModelHandler(&rd.ModelHandler{Client: client}, cache) -} - -func (suite *CacheModelHandlerSuite) TestGet() { - require := suite.Require() - - expected := MockModel{Name: "test", Value: ""} - v, err := json.Marshal(expected) - require.NoError(err) - - require.NoError(suite.DB.Set(context.Background(), "mock-test", v, 0).Err()) - - suite.Run("testing first successful get", func() { - var actual MockModel - require.NoError(suite.Model.Get(context.Background(), "mock", "test", &actual)) - require.Equal(expected, actual) - - suite.Cache.Get(rd.GenerateKey("mock", "test")) - }) - suite.Run("testing second successful get", func() { - var actual MockModel - err := suite.Model.Get(context.Background(), "mock", "test", &actual) - - require.Equal(expected, actual) - require.NoError(err) - }) - suite.Run("testing failed get", func() { - var actual MockModel - err := suite.Model.Get(context.Background(), "mock", "t", &actual) - - require.EqualError(err, "redis: nil") - }) - - suite.NoError(suite.DB.Del(context.Background(), "mock-test").Err()) -} - -func (suite *CacheModelHandlerSuite) TestSave() { - require := suite.Require() - - expected := MockModel{Name: "save-test", Value: ""} - - require.NoError(suite.Model.Save(context.Background(), expected)) - - v := suite.DB.Get(context.Background(), "mock-save-test").Val() - - var actual MockModel - - require.NoError(json.Unmarshal([]byte(v), &actual)) - require.Equal(expected, actual) -} - -func (suite *CacheModelHandlerSuite) TestDelete() { - require := suite.Require() - - expected := MockModel{Name: "test", Value: ""} - v, err := json.Marshal(expected) - require.NoError(err) - - require.NoError(suite.DB.Set(context.Background(), "mock-test", v, 0).Err()) - - suite.Run("testing successful delete", func() { - require.NoError(suite.Model.Delete(context.Background(), "mock", "test")) - - err := suite.DB.Get(context.Background(), "mock-test").Err() - require.EqualError(err, "redis: nil") - - item, ok := suite.Cache.Get("mock-test") - require.False(ok) - require.Nil(item) - }) - suite.Run("testing failed delete", func() { - var actual MockModel - - err := suite.Model.Get(context.Background(), "mock", "t", &actual) - require.EqualError(err, "redis: nil") - }) -} - -func (suite *CacheModelHandlerSuite) TestUpdate() { - require := suite.Require() - - m := MockModel{Name: "test", Value: "test-1"} - v, err := json.Marshal(m) - require.NoError(err) - - require.NoError(suite.DB.Set(context.Background(), "mock-test", v, 0).Err()) - - newModel := MockModel{Name: "test", Value: "test-2"} - require.NoError(suite.Model.Update(context.Background(), newModel)) - - var updatedModel MockModel - - require.NoError(suite.Model.Get(context.Background(), "mock", "test", &updatedModel)) - require.Equal(newModel, updatedModel) -} - -type MockModel struct { - Name string `json:"name"` - Value string `json:"value"` -} - -func (m MockModel) GetMetadata() db.MetaData { - return db.MetaData{ - ModelName: "mock", - DateCreated: time.Time{}, - DateModified: time.Time{}, - } -} - -func (m MockModel) GetPrimaryKey() string { - return m.Name -} - -func TestCacheModelHandlerSuite(t *testing.T) { - t.Parallel() - - suite.Run(t, new(CacheModelHandlerSuite)) -} diff --git a/internal/db/main/main.go b/internal/db/main/main.go deleted file mode 100644 index 14f37928..00000000 --- a/internal/db/main/main.go +++ /dev/null @@ -1,326 +0,0 @@ -package main - -import ( - "crypto/rsa" - "encoding/json" - "fmt" - "io/ioutil" - "os" - "time" - - "github.com/golang-jwt/jwt/v4" - "github.com/google/uuid" - "gitlab.snapp.ir/dispatching/soteria/v3/internal/db" - "gitlab.snapp.ir/dispatching/soteria/v3/internal/topics" - "gitlab.snapp.ir/dispatching/soteria/v3/pkg/acl" - "gitlab.snapp.ir/dispatching/soteria/v3/pkg/user" -) - -func main() { - password := "password" - secret := "secret" - - var users []user.User - driver := user.User{ - MetaData: db.MetaData{ - ModelName: "user", - DateCreated: time.Now(), - DateModified: time.Now(), - }, - Username: "driver", - Password: string(password), - Type: user.EMQUser, - Secret: string(secret), - TokenExpirationDuration: time.Hour * 30 * 24, - Rules: []user.Rule{ - user.Rule{ - UUID: uuid.New(), - Topic: topics.CabEvent, - AccessType: acl.Sub, - }, - user.Rule{ - UUID: uuid.New(), - Topic: topics.DriverLocation, - AccessType: acl.Pub, - }, - user.Rule{ - UUID: uuid.New(), - Topic: topics.SuperappEvent, - AccessType: acl.Sub, - }, - user.Rule{ - UUID: uuid.New(), - Topic: topics.SharedLocation, - AccessType: acl.Sub, - }, - user.Rule{ - UUID: uuid.New(), - Topic: topics.Chat, - AccessType: acl.PubSub, - }, - user.Rule{ - UUID: uuid.New(), - Topic: topics.CallEntry, - AccessType: acl.Pub, - }, - user.Rule{ - UUID: uuid.New(), - Topic: topics.CallOutgoing, - AccessType: acl.Sub, - }, - }, - } - - passenger := user.User{ - MetaData: db.MetaData{ - ModelName: "user", - DateCreated: time.Now(), - DateModified: time.Now(), - }, - Username: "passenger", - Password: string(password), - Type: user.EMQUser, - Secret: string(secret), - TokenExpirationDuration: time.Hour * 30 * 24, - Rules: []user.Rule{ - { - UUID: uuid.New(), - Topic: topics.CabEvent, - AccessType: acl.Sub, - }, - { - UUID: uuid.New(), - Topic: topics.SuperappEvent, - AccessType: acl.Sub, - }, - { - UUID: uuid.New(), - Topic: topics.PassengerLocation, - AccessType: acl.Pub, - }, - { - UUID: uuid.New(), - Topic: topics.SharedLocation, - AccessType: acl.Sub, - }, - { - UUID: uuid.New(), - Topic: topics.Chat, - AccessType: acl.PubSub, - }, - { - UUID: uuid.New(), - Topic: topics.CallEntry, - AccessType: acl.Pub, - }, - { - UUID: uuid.New(), - Topic: topics.CallOutgoing, - AccessType: acl.Sub, - }, - }, - } - box := user.User{ - MetaData: db.MetaData{ - ModelName: "user", - DateCreated: time.Now(), - DateModified: time.Now(), - }, - Username: "box", - Password: string(password), - Type: user.EMQUser, - Secret: string(secret), - TokenExpirationDuration: time.Hour * 30 * 24, - Rules: []user.Rule{ - user.Rule{ - UUID: uuid.New(), - Topic: topics.BoxEvent, - AccessType: acl.Sub, - }, - }, - } - - colonySubscriber := user.User{ - MetaData: db.MetaData{ - ModelName: "user", - DateCreated: time.Now(), - DateModified: time.Now(), - }, - Username: "colony-subscriber", - Password: string(password), - Type: user.EMQUser, - Secret: string(secret), - TokenExpirationDuration: time.Hour * 30 * 24, - Rules: []user.Rule{ - user.Rule{ - UUID: uuid.New(), - Topic: topics.DriverLocation, - AccessType: acl.Sub, - }, - }, - } - - snappbox := user.User{ - MetaData: db.MetaData{ - ModelName: "user", - DateCreated: time.Now(), - DateModified: time.Now(), - }, - Username: "snapp-box", - Password: string(password), - Type: user.HeraldUser, - Secret: string(secret), - TokenExpirationDuration: time.Hour * 30 * 24, - Rules: []user.Rule{ - user.Rule{ - UUID: uuid.New(), - Endpoint: "/notification", - AccessType: acl.Pub, - }, - }, - } - - snappfood := user.User{ - MetaData: db.MetaData{ - ModelName: "user", - DateCreated: time.Now(), - DateModified: time.Now(), - }, - Username: "snapp-food", - Password: string(password), - Type: user.HeraldUser, - Secret: string(secret), - TokenExpirationDuration: time.Hour * 30 * 24, - Rules: []user.Rule{ - user.Rule{ - UUID: uuid.New(), - Endpoint: "/notification", - AccessType: acl.Pub, - }, - }, - } - - snappmarket := user.User{ - MetaData: db.MetaData{ - ModelName: "user", - DateCreated: time.Now(), - DateModified: time.Now(), - }, - Username: "snapp-market", - Password: string(password), - Type: user.HeraldUser, - Secret: string(secret), - TokenExpirationDuration: time.Hour * 30 * 24, - Rules: []user.Rule{ - user.Rule{ - UUID: uuid.New(), - Endpoint: "/notification", - AccessType: acl.Pub, - }, - }, - } - - snappflight := user.User{ - MetaData: db.MetaData{ - ModelName: "user", - DateCreated: time.Now(), - DateModified: time.Now(), - }, - Username: "snapp-flight", - Password: string(password), - Type: user.HeraldUser, - Secret: string(secret), - TokenExpirationDuration: time.Hour * 30 * 24, - Rules: []user.Rule{ - user.Rule{ - UUID: uuid.New(), - Endpoint: "/notification", - AccessType: acl.Pub, - }, - }, - } - - snappdoctor := user.User{ - MetaData: db.MetaData{ - ModelName: "user", - DateCreated: time.Now(), - DateModified: time.Now(), - }, - Username: "snapp-doctor", - Password: string(password), - Type: user.HeraldUser, - Secret: string(secret), - TokenExpirationDuration: time.Hour * 30 * 24, - Rules: []user.Rule{ - user.Rule{ - UUID: uuid.New(), - Endpoint: "/notification", - AccessType: acl.Pub, - }, - }, - } - - gabriel := user.User{ - MetaData: db.MetaData{ - ModelName: "user", - DateCreated: time.Now(), - DateModified: time.Now(), - }, - Username: "gabriel", - Password: string(password), - Type: user.HeraldUser, - Secret: string(secret), - TokenExpirationDuration: time.Hour * 30 * 24, - Rules: []user.Rule{ - user.Rule{ - UUID: uuid.New(), - Endpoint: "/notification", - AccessType: acl.Pub, - }, - user.Rule{ - UUID: uuid.New(), - Endpoint: "/event", - AccessType: acl.Pub, - }, - }, - } - - users = append(users, driver) - users = append(users, passenger) - users = append(users, box) - users = append(users, colonySubscriber) - users = append(users, snappbox) - users = append(users, snappfood) - users = append(users, snappmarket) - users = append(users, snappflight) - users = append(users, snappdoctor) - users = append(users, gabriel) - - d, _ := json.Marshal(users) - ioutil.WriteFile("db.json", d, 0644) -} - -func getPublicKey(u user.Issuer) (*rsa.PublicKey, error) { - var fileName string - d, _ := os.Getwd() - fmt.Println(d) - switch u { - case user.Passenger: - fileName = "test/1.pem" - case user.Driver: - fileName = "test/0.pem" - case user.ThirdParty: - fileName = "test/100.pem" - default: - return nil, fmt.Errorf("invalid user, public key not found") - } - pem, err := ioutil.ReadFile(fileName) - if err != nil { - return nil, err - } - publicKey, err := jwt.ParseRSAPublicKeyFromPEM(pem) - if err != nil { - return nil, err - } - return publicKey, nil -} diff --git a/internal/db/models.go b/internal/db/models.go index d1633395..f66df731 100644 --- a/internal/db/models.go +++ b/internal/db/models.go @@ -1,28 +1,9 @@ package db import ( - "context" - "errors" - "time" + "gitlab.snapp.ir/dispatching/soteria/v3/pkg/user" ) -// ErrDb is returned when there was an error in database operations -var ErrDb = errors.New("database error") - type ModelHandler interface { - Save(ctx context.Context, model Model) error - Delete(ctx context.Context, modelName, pk string) error - Get(ctx context.Context, modelName, pk string, model Model) error - Update(ctx context.Context, model Model) error -} - -type Model interface { - GetMetadata() MetaData - GetPrimaryKey() string -} - -type MetaData struct { - ModelName string `json:"model_name"` - DateCreated time.Time `json:"date_created"` - DateModified time.Time `json:"date_modified"` + Get(pk string) user.User } diff --git a/internal/db/redis/client.go b/internal/db/redis/client.go deleted file mode 100644 index e4bab455..00000000 --- a/internal/db/redis/client.go +++ /dev/null @@ -1,33 +0,0 @@ -package redis - -import ( - "context" - "fmt" - - "github.com/go-redis/redis/v8" - "gitlab.snapp.ir/dispatching/soteria/v3/internal/config" -) - -func NewRedisClient(cfg *config.RedisConfig) (*redis.Client, error) { - // nolint: exhaustivestruct - opts := &redis.Options{ - Addr: cfg.Address, - Password: cfg.Password, - PoolTimeout: cfg.PoolTimeout, - ReadTimeout: cfg.ReadTimeout, - MaxRetries: cfg.MaxRetries, - MaxRetryBackoff: cfg.MaxRetryBackoff, - MinRetryBackoff: cfg.MinRetryBackoff, - IdleTimeout: cfg.IdleTimeout, - IdleCheckFrequency: cfg.IdleCheckFrequency, - PoolSize: cfg.PoolSize, - MinIdleConns: cfg.MinIdleConnections, - } - - client := redis.NewClient(opts) - if err := client.Ping(context.Background()).Err(); err != nil { - return nil, fmt.Errorf("could not ping redis: %w", err) - } - - return client, nil -} diff --git a/internal/db/redis/redis.go b/internal/db/redis/redis.go deleted file mode 100644 index 635f8646..00000000 --- a/internal/db/redis/redis.go +++ /dev/null @@ -1,94 +0,0 @@ -package redis - -import ( - "context" - "encoding/json" - "fmt" - - "github.com/go-redis/redis/v8" - "gitlab.snapp.ir/dispatching/soteria/v3/internal/db" -) - -// RedisModelHandler implements ModelHandler interface. -type ModelHandler struct { - Client redis.Cmdable -} - -// Save saves a model in redis. -func (rmh ModelHandler) Save(ctx context.Context, model db.Model) error { - md := model.GetMetadata() - pk := model.GetPrimaryKey() - key := GenerateKey(md.ModelName, pk) - - value, err := json.Marshal(model) - if err != nil { - return err - } - - if err := rmh.Client.Set(ctx, key, string(value), 0).Err(); err != nil { - return fmt.Errorf("%w: %s", db.ErrDb, err) - } - - return nil -} - -// Delete finds and deletes a model from redis and cache. -func (rmh ModelHandler) Delete(ctx context.Context, modelName, pk string) error { - key := GenerateKey(modelName, pk) - - res, err := rmh.Client.Del(ctx, key).Result() - if err != nil { - return fmt.Errorf("%w: %s", db.ErrDb, err) - } - - if res < 1 { - return fmt.Errorf("key does not exist") - } - - return nil -} - -// Get returns a model from redis or from cache, if exists. -func (rmh ModelHandler) Get(ctx context.Context, modelName, pk string, v db.Model) error { - key := GenerateKey(modelName, pk) - - res, err := rmh.Client.Get(ctx, key).Result() - if err != nil && err == redis.Nil { - return fmt.Errorf("%s", err) - } else if err != nil { - return fmt.Errorf("%w: %s", db.ErrDb, err) - } - - if err := json.Unmarshal([]byte(res), v); err != nil { - return fmt.Errorf("cannot unmarshal model %w", err) - } - - return nil -} - -// Update finds and updates a model in redis. -func (rmh ModelHandler) Update(ctx context.Context, model db.Model) error { - md := model.GetMetadata() - pk := model.GetPrimaryKey() - - key := GenerateKey(md.ModelName, pk) - - value, err := json.Marshal(model) - if err != nil { - return err - } - - pipeline := rmh.Client.Pipeline() - pipeline.Del(ctx, key) - pipeline.Set(ctx, key, string(value), 0) - if _, err := pipeline.Exec(ctx); err != nil { - return fmt.Errorf("%w: %s", db.ErrDb, err) - } - - return nil -} - -// GenerateKey is used to generate redis keys. -func GenerateKey(modelName, pk string) string { - return fmt.Sprintf("%s-%s", modelName, pk) -} diff --git a/internal/db/redis/redis_test.go b/internal/db/redis/redis_test.go deleted file mode 100644 index 9b883915..00000000 --- a/internal/db/redis/redis_test.go +++ /dev/null @@ -1,144 +0,0 @@ -package redis_test - -import ( - "context" - "encoding/json" - "testing" - "time" - - "github.com/alicebob/miniredis/v2" - "github.com/go-redis/redis/v8" - "github.com/stretchr/testify/suite" - "gitlab.snapp.ir/dispatching/soteria/v3/internal/db" - rd "gitlab.snapp.ir/dispatching/soteria/v3/internal/db/redis" -) - -type RedisModelHandlerSuite struct { - suite.Suite - - Model db.ModelHandler - DB *redis.Client -} - -func (suite *RedisModelHandlerSuite) SetupSuite() { - mr, err := miniredis.Run() - suite.Require().NoError(err) - - // nolint: exhaustivestruct - client := redis.NewClient(&redis.Options{ - Addr: mr.Addr(), - }) - - suite.DB = client - suite.Model = rd.ModelHandler{Client: client} -} - -func (suite *RedisModelHandlerSuite) TestGet() { - require := suite.Require() - - expected := MockModel{Name: "test", Value: ""} - v, err := json.Marshal(expected) - require.NoError(err) - - require.NoError(suite.DB.Set(context.Background(), "mock-test", v, 0).Err()) - - suite.Run("testing successful get", func() { - var actual MockModel - err := suite.Model.Get(context.Background(), "mock", "test", &actual) - require.Equal(expected, actual) - require.NoError(err) - }) - - suite.Run("testing invalid get usage", func() { - var actual MockModel - err := suite.Model.Get(context.Background(), "mock", "test", actual) - require.Error(err) - }) - - suite.Run("testing failed get", func() { - var actual MockModel - err := suite.Model.Get(context.Background(), "mock", "t", &actual) - require.EqualError(err, "redis: nil") - }) - - require.NoError(suite.DB.Del(context.Background(), "mock-test").Err()) -} - -func (suite *RedisModelHandlerSuite) TestSave() { - require := suite.Require() - - expected := MockModel{Name: "save-test", Value: ""} - - require.NoError(suite.Model.Save(context.Background(), expected)) - - v := suite.DB.Get(context.Background(), "mock-save-test").Val() - - var actual MockModel - - require.NoError(json.Unmarshal([]byte(v), &actual)) - require.Equal(expected, actual) -} - -func (suite *RedisModelHandlerSuite) TestDelete() { - require := suite.Require() - - expected := MockModel{Name: "test", Value: ""} - v, _ := json.Marshal(expected) - - require.NoError(suite.DB.Set(context.Background(), "mock-test", v, 0).Err()) - - suite.Run("testing successful delete", func() { - require.NoError(suite.Model.Delete(context.Background(), "mock", "test")) - - err := suite.DB.Get(context.Background(), "mock-test").Err() - require.EqualError(err, "redis: nil") - }) - - suite.Run("testing failed delete", func() { - var actual MockModel - - err := suite.Model.Get(context.Background(), "mock", "t", &actual) - require.EqualError(err, "redis: nil") - }) -} - -func (suite *RedisModelHandlerSuite) TestUpdate() { - require := suite.Require() - - m := MockModel{Name: "test", Value: "test-1"} - v, err := json.Marshal(m) - require.NoError(err) - - require.NoError(suite.DB.Set(context.Background(), "mock-test", v, 0).Err()) - - newModel := MockModel{Name: "test", Value: "test-2"} - require.NoError(suite.Model.Update(context.Background(), newModel)) - - var updatedModel MockModel - - require.NoError(suite.Model.Get(context.Background(), "mock", "test", &updatedModel)) - require.Equal(newModel, updatedModel) -} - -type MockModel struct { - Name string `json:"name"` - Value string `json:"value"` -} - -func (m MockModel) GetMetadata() db.MetaData { - return db.MetaData{ - ModelName: "mock", - DateCreated: time.Time{}, - DateModified: time.Time{}, - } -} - -func (m MockModel) GetPrimaryKey() string { - return m.Name -} - -func TestRedisModelHandlerSuite(t *testing.T) { - t.Parallel() - - suite.Run(t, new(RedisModelHandlerSuite)) -} From b11e4682363a61642e46d628cc7fd77d453d1b83 Mon Sep 17 00:00:00 2001 From: Parham Alvani Date: Tue, 16 Nov 2021 23:56:09 +0330 Subject: [PATCH 053/660] feat: remove third party tokens --- test/100.pem | 6 ------ test/100.private.pem | 15 --------------- 2 files changed, 21 deletions(-) delete mode 100644 test/100.pem delete mode 100644 test/100.private.pem diff --git a/test/100.pem b/test/100.pem deleted file mode 100644 index ad20ae77..00000000 --- a/test/100.pem +++ /dev/null @@ -1,6 +0,0 @@ ------BEGIN PUBLIC KEY----- -MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCTxwVGmWzJNOaZnBRL+9/V1Mc8 -OWWzUDxlG2kL+0WxHh8/+76ngIvp7YsHHxUadR0iY6NkzLgFv+sBkKh523Nx0Ytu -GgmGuuVTaD27G2inwgFDabUsAKISBbn6d6jwlkfk3D+O6h5pdLqoI64Zq/NPmD0o -Wsupn2HVhMSjFbE6dwIDAQAB ------END PUBLIC KEY----- \ No newline at end of file diff --git a/test/100.private.pem b/test/100.private.pem deleted file mode 100644 index 467519f4..00000000 --- a/test/100.private.pem +++ /dev/null @@ -1,15 +0,0 @@ ------BEGIN RSA PRIVATE KEY----- -MIICWwIBAAKBgQCTxwVGmWzJNOaZnBRL+9/V1Mc8OWWzUDxlG2kL+0WxHh8/+76n -gIvp7YsHHxUadR0iY6NkzLgFv+sBkKh523Nx0YtuGgmGuuVTaD27G2inwgFDabUs -AKISBbn6d6jwlkfk3D+O6h5pdLqoI64Zq/NPmD0oWsupn2HVhMSjFbE6dwIDAQAB -AoGAJDRGHp3IASNsu4V5k4QJuqF+jkqhl+S4Zyzn939/+3ydu1c5xl+/53fC7+O1 -j93RXXN7vF5LV11FfgSqwe/5wDEcAtyLXWPCHtLB1CIYFfqHxgwOQm4gQSyOgBnP -hMccyv0VCDK23+Mk37lLkuON6xXMC8+IUq5UW/aadxkeqoECQQDU9Z5IFCmp3Ibs -hJXx/x+ZQI+gLj0hh71pQEO2zqhu19i+M62KKnDb7k2OtK9IJR2ucU+YE3SXGShh -1sPmgfVfAkEAsaTtZ1oZmszOs5TPYhs2e7LKLPNADZ36GVsG2h1FHVX+LyNkwk/E -pn+FV3Dd1vkzxG/a3znEKz+2BJiz4vF56QJATUxKA4euB8XQA5Gsi4Y7Bfl1KIMg -FUeb7NQyv+wLHxChz4gaeYgmJu48oIvdA6bVOzhN17lYHHA5RCocOVL6qQJAdHdT -6nmo5dO3BQfgO0rqGolqgbPtX8AeE3eZc3DTOluBrbf/vGF95UcfzedCmkmBxh0r -m0SNN2mq1TKkZXq52QJAIjxhG7spkOSZJQnVBA9TfLYZFM/aUzDpLxflvFAuJuqJ -l+PFsbek2Zl6fgy294dXRvQhp1PJryngDaXTBiWK6g== ------END RSA PRIVATE KEY----- \ No newline at end of file From c8c9ab5b07e60471c1dba81661afb3eee2f63d26 Mon Sep 17 00:00:00 2001 From: Parham Alvani Date: Tue, 16 Nov 2021 23:56:21 +0330 Subject: [PATCH 054/660] feat: update configuration module --- internal/config/config.go | 199 +++++++++++++++++-------------------- internal/config/default.go | 43 ++++++++ 2 files changed, 135 insertions(+), 107 deletions(-) create mode 100644 internal/config/default.go diff --git a/internal/config/config.go b/internal/config/config.go index 9fe5fd4e..a13d0d44 100644 --- a/internal/config/config.go +++ b/internal/config/config.go @@ -2,158 +2,142 @@ package config import ( "crypto/rsa" + "errors" "fmt" "io/ioutil" - "time" + "log" + "strings" "github.com/golang-jwt/jwt/v4" - "github.com/kelseyhightower/envconfig" + "github.com/knadh/koanf" + "github.com/knadh/koanf/parsers/yaml" + "github.com/knadh/koanf/providers/env" + "github.com/knadh/koanf/providers/file" + "github.com/knadh/koanf/providers/structs" "gitlab.snapp.ir/dispatching/soteria/v3/pkg/acl" "gitlab.snapp.ir/dispatching/soteria/v3/pkg/user" ) -// AppConfig is the main container of Soteria's config. -type AppConfig struct { - AllowedAccessTypes []string `default:"sub,pub" split_words:"true"` - PassengerHashLength int `split_words:"true"` - DriverHashLength int `split_words:"true"` - PassengerSalt string `split_words:"true"` - DriverSalt string `split_words:"true"` - Redis *RedisConfig - Jwt *JwtConfig - Logger *LoggerConfig - Cache *CacheConfig - Mode string `default:"debug"` - HttpPort int `default:"9999" split_words:"true"` - GrpcPort int `default:"50051" split_words:"true"` - Tracer *TracerConfig - Company string `default:"snapp"` -} +const ( + // Prefix indicates environment variables prefix. + Prefix = "soteria_" +) -// RedisConfig is all configs needed to connect to a Redis server. -type RedisConfig struct { - Address string `split_words:"true"` - Password string `default:"" split_words:"true"` - ExpirationTime int `default:"30" split_words:"true"` - PoolSize int `split_words:"true" default:"10"` - MaxRetries int `split_words:"true" default:"0"` - MinIdleConnections int `split_words:"true" default:"5"` - ReadTimeout time.Duration `split_words:"true" default:"3s"` - PoolTimeout time.Duration `split_words:"true" default:"4s"` - MinRetryBackoff time.Duration `split_words:"true" default:"8ms"` - MaxRetryBackoff time.Duration `split_words:"true" default:"512ms"` - IdleTimeout time.Duration `split_words:"true" default:"300s"` - IdleCheckFrequency time.Duration `split_words:"true" default:"60s"` -} +type ( + // Config is the main container of Soteria's config. + Config struct { + AllowedAccessTypes []string `koanf:"allowed_access_types"` + PassengerHashLength int `koanf:"passenger_hash_length"` + DriverHashLength int `koanf:"driver_hash_length"` + PassengerSalt string `koanf:"passenger_salt"` + DriverSalt string `koanf:"driver_salt"` + JWT *JWT `koanf:"jwt"` + Logger *Logger `koanf:"logger"` + HTTPPort int `koanf:"http_port"` + Tracer *TracerConfig `koanf:"tracer"` + Company string `koanf:"company"` + Users []user.User `koanf:"users"` + } -// CacheConfig contains configs of in memory cache. -type CacheConfig struct { - Enabled bool `split_words:"true" default:"true"` - Expiration time.Duration `split_words:"true" default:"600s"` -} + // JWt contains path of the keys for JWT encryption. + JWT struct { + Path string `koanf:"path"` + } -// JwtConfig contains path of the keys for JWT encryption. -type JwtConfig struct { - KeysPath string `split_words:"true" default:"test/"` -} + // Logger is the config for logging and this kind of stuff. + Logger struct { + Level string `koanf:"level"` + } -// LoggerConfig is the config for logging and this kind of stuff. -type LoggerConfig struct { - Level string `default:"warn" split_words:"true"` + // Tracer contains all configs needed to create a tracer. + TracerConfig struct { + Enabled bool `koanf:"enabled"` + ServiceName string `koanf:"service_name"` + SamplerType string `koanf:"sampler_type"` + SamplerParam float64 `koanf:"sampler_param"` + Host string `koanf:"host"` + Port int `koanf:"port"` + } +) - SentryEnabled bool `default:"false" split_words:"true"` - SentryDSN string `envconfig:"SENTRY_DSN"` - SentryTimeout time.Duration `split_words:"true" default:"100ms"` -} +// New reads configuration with koanf. +func New() Config { + var instance Config -// TracerConfig contains all configs needed to create a tracer. -type TracerConfig struct { - Enabled bool `split_words:"false" default:"true"` - ServiceName string `default:"soteria" split_words:"true"` - SamplerType string `default:"const" split_words:"true"` - SamplerParam float64 `default:"1" split_words:"true"` - Host string `default:"localhost" split_words:"true"` - Port int `default:"6831" split_words:"true"` -} + k := koanf.New(".") -// InitConfig tries to initialize app config from env variables. -func InitConfig() AppConfig { - appConfig := &AppConfig{} - appConfig.Redis = &RedisConfig{} - appConfig.Cache = &CacheConfig{} - appConfig.Jwt = &JwtConfig{} - appConfig.Logger = &LoggerConfig{} - appConfig.Tracer = &TracerConfig{} - - envconfig.MustProcess("soteria", appConfig) - envconfig.MustProcess("soteria_redis", appConfig.Redis) - envconfig.MustProcess("soteria_cache", appConfig.Cache) - envconfig.MustProcess("soteria_jwt", appConfig.Jwt) - envconfig.MustProcess("soteria_logger", appConfig.Logger) - envconfig.MustProcess("soteria_tracer", appConfig.Tracer) - return *appConfig -} + // load default configuration from file + if err := k.Load(structs.Provider(Default(), "koanf"), nil); err != nil { + log.Fatalf("error loading default: %s", err) + } -// ReadPrivateKey will read and return private key that is used for JWT encryption -func (a *AppConfig) ReadPrivateKey(u user.Issuer) (*rsa.PrivateKey, error) { - var fileName string - switch u { - case user.ThirdParty: - fileName = fmt.Sprintf("%s%s", a.Jwt.KeysPath, "100.private.pem") - default: - return nil, fmt.Errorf("invalid issuer, private key not found") + // load configuration from file + if err := k.Load(file.Provider("config.yml"), yaml.Parser()); err != nil { + log.Printf("error loading config.yml: %s", err) } - pem, err := ioutil.ReadFile(fileName) - if err != nil { - return nil, err + + // load environment variables + if err := k.Load(env.Provider(Prefix, ".", func(s string) string { + return strings.ReplaceAll(strings.ToLower( + strings.TrimPrefix(s, Prefix)), "_", ".") + }), nil); err != nil { + log.Printf("error loading environment variables: %s", err) } - privateKey, err := jwt.ParseRSAPrivateKeyFromPEM(pem) - if err != nil { - return nil, err + + if err := k.Unmarshal("", &instance); err != nil { + log.Fatalf("error unmarshalling config: %s", err) } - return privateKey, nil + + log.Printf("following configuration is loaded:\n%+v", instance) + + return instance } -// ReadPrivateKey will read and return private key that is used for JWT encryption -func (a *AppConfig) ReadPublicKey(u user.Issuer) (*rsa.PublicKey, error) { +// ReadPrivateKey will read and return private key that is used for JWT encryption. +func (a *Config) ReadPublicKey(u user.Issuer) (*rsa.PublicKey, error) { var fileName string + switch u { case user.Driver: - fileName = fmt.Sprintf("%s%s", a.Jwt.KeysPath, "0.pem") + fileName = fmt.Sprintf("%s%s", a.JWT.Path, "0.pem") case user.Passenger: - fileName = fmt.Sprintf("%s%s", a.Jwt.KeysPath, "1.pem") - case user.ThirdParty: - fileName = fmt.Sprintf("%s%s", a.Jwt.KeysPath, "100.pem") + fileName = fmt.Sprintf("%s%s", a.JWT.Path, "1.pem") default: - return nil, fmt.Errorf("invalid issuer, public key not found") + return nil, errors.New("invalid issuer, public key not found") } + pem, err := ioutil.ReadFile(fileName) if err != nil { return nil, err } - privateKey, err := jwt.ParseRSAPublicKeyFromPEM(pem) + + publicKey, err := jwt.ParseRSAPublicKeyFromPEM(pem) if err != nil { return nil, err } - return privateKey, nil + + return publicKey, nil } -// GetAllowedAccessTypes will return all allowed access types in Soteria -func (a *AppConfig) GetAllowedAccessTypes() ([]acl.AccessType, error) { - var allowedAccessTypes []acl.AccessType +// GetAllowedAccessTypes will return all allowed access types in Soteria. +func (a *Config) GetAllowedAccessTypes() ([]acl.AccessType, error) { + allowedAccessTypes := make([]acl.AccessType, 0, len(a.AllowedAccessTypes)) + for _, a := range a.AllowedAccessTypes { at, err := toUserAccessType(a) if err != nil { return nil, fmt.Errorf("could not convert %s: %w", at, err) } + allowedAccessTypes = append(allowedAccessTypes, at) } + return allowedAccessTypes, nil } -// toUserAccessType will convert string access type to it's own type -func toUserAccessType(i string) (acl.AccessType, error) { - switch i { +// toUserAccessType will convert string access type to it's own type. +func toUserAccessType(access string) (acl.AccessType, error) { + switch access { case "pub": return acl.Pub, nil case "sub": @@ -161,5 +145,6 @@ func toUserAccessType(i string) (acl.AccessType, error) { case "pubsub": return acl.PubSub, nil } - return "", fmt.Errorf("%v is a invalid acces type", i) + + return "", fmt.Errorf("%v is a invalid acces type", access) } diff --git a/internal/config/default.go b/internal/config/default.go new file mode 100644 index 00000000..fe6558b2 --- /dev/null +++ b/internal/config/default.go @@ -0,0 +1,43 @@ +package config + +import "gitlab.snapp.ir/dispatching/soteria/v3/pkg/user" + +// Default return default configuration. +func Default() Config { + return Config{ + AllowedAccessTypes: []string{ + "pub", + "sub", + }, + PassengerHashLength: 15, + DriverHashLength: 15, + PassengerSalt: "secret", + DriverSalt: "secret", + JWT: &JWT{ + Path: "/test", + }, + Logger: &Logger{ + Level: "warn", + }, + HTTPPort: 0, + Tracer: &TracerConfig{ + Enabled: false, + ServiceName: "", + SamplerType: "", + SamplerParam: 0.0, + Host: "", + Port: 0, + }, + Company: "snapp", + Users: []user.User{ + { + Username: "driver", + Rules: []user.Rule{}, + }, + { + Username: "passenger", + Rules: []user.Rule{}, + }, + }, + } +} From d0843c1a365e4aef8097992dba33e2c4b782b7d2 Mon Sep 17 00:00:00 2001 From: Parham Alvani Date: Tue, 16 Nov 2021 23:59:28 +0330 Subject: [PATCH 055/660] feat: remove other commands --- cmd/soteria/soteria.go | 5 ----- 1 file changed, 5 deletions(-) diff --git a/cmd/soteria/soteria.go b/cmd/soteria/soteria.go index 3e95c453..e10b05d9 100644 --- a/cmd/soteria/soteria.go +++ b/cmd/soteria/soteria.go @@ -4,7 +4,6 @@ import ( "log" "gitlab.snapp.ir/dispatching/soteria/v3/internal/commands" - "gitlab.snapp.ir/dispatching/soteria/v3/internal/commands/accounts" ) func main() { @@ -12,10 +11,6 @@ func main() { cli.AddCommand(commands.Serve) - accounts.Accounts.AddCommand(accounts.Init) - cli.AddCommand(accounts.Accounts) - cli.AddCommand(commands.Token) - if err := cli.Execute(); err != nil { log.Fatal(err) } From 71e55f4e56a958cee165382c2befcb70542f48fa Mon Sep 17 00:00:00 2001 From: Parham Alvani Date: Tue, 16 Nov 2021 23:59:40 +0330 Subject: [PATCH 056/660] feat: update packages --- go.mod | 48 +++++---- go.sum | 329 +++++++++++++++++++++++++++++++++++++++++++-------------- 2 files changed, 274 insertions(+), 103 deletions(-) diff --git a/go.mod b/go.mod index 0a6e4747..08fda68b 100644 --- a/go.mod +++ b/go.mod @@ -4,18 +4,13 @@ go 1.17 require ( github.com/HdrHistogram/hdrhistogram-go v1.1.0 // indirect - github.com/alicebob/miniredis/v2 v2.13.1 - github.com/gin-contrib/zap v0.0.1 - github.com/gin-gonic/gin v1.7.4 - github.com/go-ozzo/ozzo-validation/v4 v4.3.0 - github.com/go-playground/validator/v10 v10.9.0 // indirect - github.com/go-redis/redis/v8 v8.11.4 + github.com/alicebob/miniredis/v2 v2.13.1 // indirect + github.com/go-redis/redis/v8 v8.11.4 // indirect github.com/golang-jwt/jwt/v4 v4.1.0 - github.com/golang/protobuf v1.5.2 - github.com/google/uuid v1.3.0 - github.com/kelseyhightower/envconfig v1.4.0 + github.com/golang/protobuf v1.5.2 // indirect + github.com/google/uuid v1.3.0 // indirect github.com/opentracing/opentracing-go v1.2.0 - github.com/patrickmn/go-cache v2.1.0+incompatible + github.com/patrickmn/go-cache v2.1.0+incompatible // indirect github.com/prometheus/client_golang v1.11.0 github.com/spf13/cobra v1.2.1 github.com/stretchr/testify v1.7.0 @@ -26,40 +21,51 @@ require ( go.uber.org/automaxprocs v1.4.0 go.uber.org/zap v1.19.1 golang.org/x/crypto v0.0.0-20211115234514-b4de73f9ece8 - google.golang.org/grpc v1.42.0 google.golang.org/protobuf v1.27.1 // indirect ) +require ( + github.com/ansrivas/fiberprometheus/v2 v2.1.2 + github.com/gofiber/contrib/fiberzap v0.0.0-20211104103143-eae1892b9aac + github.com/gofiber/fiber/v2 v2.22.0 + github.com/knadh/koanf v1.3.2 +) + require ( github.com/alicebob/gopher-json v0.0.0-20200520072559-a9ecdc9d1d3a // indirect + github.com/andybalholm/brotli v1.0.4 // indirect github.com/beorn7/perks v1.0.1 // indirect github.com/cespare/xxhash/v2 v2.1.2 // indirect github.com/davecgh/go-spew v1.1.1 // indirect github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f // indirect - github.com/gin-contrib/sse v0.1.0 // indirect - github.com/go-playground/locales v0.14.0 // indirect - github.com/go-playground/universal-translator v0.18.0 // indirect + github.com/fatih/structs v1.1.0 // indirect + github.com/fsnotify/fsnotify v1.4.9 // indirect + github.com/gofiber/adaptor/v2 v2.1.14 // indirect + github.com/gofiber/utils v0.1.2 // indirect github.com/inconshreveable/mousetrap v1.0.0 // indirect - github.com/json-iterator/go v1.1.12 // indirect - github.com/leodido/go-urn v1.2.1 // indirect - github.com/mattn/go-isatty v0.0.14 // indirect + github.com/klauspost/compress v1.13.6 // indirect + github.com/kr/pretty v0.3.0 // indirect github.com/matttproud/golang_protobuf_extensions v1.0.1 // indirect - github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect - github.com/modern-go/reflect2 v1.0.2 // indirect + github.com/mitchellh/copystructure v1.2.0 // indirect + github.com/mitchellh/mapstructure v1.4.1 // indirect + github.com/mitchellh/reflectwalk v1.0.2 // indirect github.com/pkg/errors v0.9.1 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect github.com/prometheus/client_model v0.2.0 // indirect github.com/prometheus/common v0.32.1 // indirect github.com/prometheus/procfs v0.7.3 // indirect + github.com/rogpeppe/go-internal v1.8.0 // indirect github.com/speps/go-hashids/v2 v2.0.1 // indirect github.com/spf13/pflag v1.0.5 // indirect - github.com/ugorji/go/codec v1.2.6 // indirect + github.com/valyala/bytebufferpool v1.0.0 // indirect + github.com/valyala/fasthttp v1.31.0 // indirect + github.com/valyala/tcplisten v1.0.0 // indirect github.com/yuin/gopher-lua v0.0.0-20191220021717-ab39c6098bdb // indirect go.uber.org/multierr v1.7.0 // indirect golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2 // indirect golang.org/x/sys v0.0.0-20211116061358-0a5406a5449c // indirect golang.org/x/text v0.3.7 // indirect - google.golang.org/genproto v0.0.0-20211115160612-a5da7257a6f7 // indirect + gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c // indirect gopkg.in/yaml.v2 v2.4.0 // indirect gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b // indirect ) diff --git a/go.sum b/go.sum index 8051f0c4..39bc31db 100644 --- a/go.sum +++ b/go.sum @@ -43,7 +43,11 @@ github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03 github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= github.com/HdrHistogram/hdrhistogram-go v1.1.0 h1:6dpdDPTRoo78HxAJ6T1HfMiKSnqhgRRqzCuPshRkQ7I= github.com/HdrHistogram/hdrhistogram-go v1.1.0/go.mod h1:yDgFjdqOqDEKOvasDdhWNXYg9BVp4O+o5f6V/ehm6Oo= -github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU= +github.com/Knetic/govaluate v3.0.1-0.20171022003610-9aa49832a739+incompatible/go.mod h1:r7JcOSlj0wfOMncg0iLm8Leh48TZaKVeNIfJntJ2wa0= +github.com/Shopify/sarama v1.19.0/go.mod h1:FVkBWblsNy7DGZRfXLU0O9RCGt5g3g3yEuWXgklEdEo= +github.com/Shopify/toxiproxy v2.1.4+incompatible/go.mod h1:OXgGpZ6Cli1/URJOF1DMxUHB2q5Ap20/P/eIdh4G0pI= +github.com/VividCortex/gohistogram v1.0.0/go.mod h1:Pf5mBqqDxYaXu3hDrrU+w6nw50o/4+TcAqDqk/vUH7g= +github.com/afex/hystrix-go v0.0.0-20180502004556-fa1af6a1f4f5/go.mod h1:SkGFH1ia65gfNATL8TAiHDNxPzPdmEL5uirI2Uyuz6c= github.com/ajstarks/svgo v0.0.0-20180226025133-644b8db467af/go.mod h1:K08gAheRH3/J6wwsYMMT4xOr94bZjxIelGM0+d/wbFw= github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= @@ -54,12 +58,33 @@ github.com/alicebob/gopher-json v0.0.0-20200520072559-a9ecdc9d1d3a h1:HbKu58rmZp github.com/alicebob/gopher-json v0.0.0-20200520072559-a9ecdc9d1d3a/go.mod h1:SGnFV6hVsYE877CKEZ6tDNTjaSXYUk6QqoIK6PrAtcc= github.com/alicebob/miniredis/v2 v2.13.1 h1:twArGFW9kCdxe0K1Ga+iWrZc9RdWalf7V5bQerNoPK0= github.com/alicebob/miniredis/v2 v2.13.1/go.mod h1:0UIBNuf97uxrWhdVBpJvPtafKyGpL2NS2pYe0tYM97k= +github.com/andybalholm/brotli v1.0.0/go.mod h1:loMXtMfwqflxFJPmdbJO0a3KNoPuLBgiu3qAvBg8x/Y= +github.com/andybalholm/brotli v1.0.2/go.mod h1:loMXtMfwqflxFJPmdbJO0a3KNoPuLBgiu3qAvBg8x/Y= +github.com/andybalholm/brotli v1.0.3/go.mod h1:fO7iG3H7G2nSZ7m0zPUDn85XEX2GTukHGRSepvi9Eig= +github.com/andybalholm/brotli v1.0.4 h1:V7DdXeJtZscaqfNuAdSRuRFzuiKlHSC/Zh3zl9qY3JY= +github.com/andybalholm/brotli v1.0.4/go.mod h1:fO7iG3H7G2nSZ7m0zPUDn85XEX2GTukHGRSepvi9Eig= +github.com/ansrivas/fiberprometheus/v2 v2.1.2 h1:xhG9rfJuqfpRNVHX4//ZQnKAbBubKDsvVFlGWBH9JsE= +github.com/ansrivas/fiberprometheus/v2 v2.1.2/go.mod h1:M8p5I/jCzqpD8V/IprHLmLzRIx5cJFE+/76NavR4PXI= github.com/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kdvxnR2qWY= +github.com/apache/thrift v0.12.0/go.mod h1:cp2SuWMxlEZw2r+iP2GNCdIi4C1qmUzdZFSVb+bacwQ= +github.com/apache/thrift v0.13.0/go.mod h1:cp2SuWMxlEZw2r+iP2GNCdIi4C1qmUzdZFSVb+bacwQ= github.com/armon/circbuf v0.0.0-20150827004946-bbbad097214e/go.mod h1:3U/XgcO3hCbHZ8TKRvWD2dDTCfh9M9ya+I9JpbB7O8o= github.com/armon/go-metrics v0.0.0-20180917152333-f0300d1749da/go.mod h1:Q73ZrmVTwzkszR9V5SSuryQ31EELlFMUz1kKyl939pY= github.com/armon/go-radix v0.0.0-20180808171621-7fddfc383310/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8= -github.com/asaskevich/govalidator v0.0.0-20200108200545-475eaeb16496 h1:zV3ejI06GQ59hwDQAvmK1qxOQGB3WuVTRoY0okPTAv0= -github.com/asaskevich/govalidator v0.0.0-20200108200545-475eaeb16496/go.mod h1:oGkLhpf+kjZl6xBf758TQhh5XrAeiJv/7FRz/2spLIg= +github.com/aryann/difflib v0.0.0-20170710044230-e206f873d14a/go.mod h1:DAHtR1m6lCRdSC2Tm3DSWRPvIPr6xNKyeHdqDQSQT+A= +github.com/aws/aws-lambda-go v1.13.3/go.mod h1:4UKl9IzQMoD+QF79YdCuzCwp8VbmG4VAQwij/eHl5CU= +github.com/aws/aws-sdk-go v1.27.0/go.mod h1:KmX6BPdI08NWTb3/sm4ZGu5ShLoqVDhKgpiN924inxo= +github.com/aws/aws-sdk-go-v2 v0.18.0/go.mod h1:JWVYvqSMppoMJC0x5wdwiImzgXTI9FuZwxzkQq9wy+g= +github.com/aws/aws-sdk-go-v2 v1.9.2/go.mod h1:cK/D0BBs0b/oWPIcX/Z/obahJK1TT7IPVjy53i/mX/4= +github.com/aws/aws-sdk-go-v2/config v1.8.3/go.mod h1:4AEiLtAb8kLs7vgw2ZV3p2VZ1+hBavOc84hqxVNpCyw= +github.com/aws/aws-sdk-go-v2/credentials v1.4.3/go.mod h1:FNNC6nQZQUuyhq5aE5c7ata8o9e4ECGmS4lAXC7o1mQ= +github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.6.0/go.mod h1:gqlclDEZp4aqJOancXK6TN24aKhT0W0Ae9MHk3wzTMM= +github.com/aws/aws-sdk-go-v2/internal/ini v1.2.4/go.mod h1:ZcBrrI3zBKlhGFNYWvju0I3TR93I7YIgAfy82Fh4lcQ= +github.com/aws/aws-sdk-go-v2/service/appconfig v1.4.2/go.mod h1:FZ3HkCe+b10uFZZkFdvf98LHW21k49W8o8J366lqVKY= +github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.3.2/go.mod h1:72HRZDLMtmVQiLG2tLfQcaWLCssELvGl+Zf2WVxMmR8= +github.com/aws/aws-sdk-go-v2/service/sso v1.4.2/go.mod h1:NBvT9R1MEF+Ud6ApJKM0G+IkPchKS7p7c2YPKwHmBOk= +github.com/aws/aws-sdk-go-v2/service/sts v1.7.2/go.mod h1:8EzeIqfWt2wWT4rJVu3f21TfrhJ8AEMzVybRNSb/b4g= +github.com/aws/smithy-go v1.8.0/go.mod h1:SObp3lf9smib00L/v3U2eAKG8FyQ7iLrJnQiAmR5n+E= github.com/benbjohnson/clock v1.1.0 h1:Q92kusRqC1XV2MjkWETPvjJVqKetz1OzxZB7mHJLju8= github.com/benbjohnson/clock v1.1.0/go.mod h1:J11/hYXuz8f4ySSvYwY0FKfm+ezbsZBKZxNJlLklBHA= github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q= @@ -68,90 +93,100 @@ 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/bgentry/speakeasy v0.1.0/go.mod h1:+zsyZBPWlz7T6j88CTgSN5bM796AkVf0kBD4zp0CCIs= github.com/bketelsen/crypt v0.0.4/go.mod h1:aI6NrJ0pMGgvZKL1iVgXLnfIFJtfV+bKCoqOes/6LfM= +github.com/casbin/casbin/v2 v2.1.2/go.mod h1:YcPU1XXisHhLzuxH9coDNf2FbKpjGlbCg3n9yuLkIJQ= +github.com/cenkalti/backoff v2.2.1+incompatible/go.mod h1:90ReRw6GdpyfrHakVjL/QHaoyV4aDUVVkXQJJJ3NXXM= github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= -github.com/cespare/xxhash v1.1.0 h1:a6HrQnmkObjyL+Gs60czilIUGqrzKutQD6XZog3p+ko= -github.com/cespare/xxhash v1.1.0/go.mod h1:XrSqR1VqqWfGrhpAt58auRo0WTKS1nRRg3ghfAqPWnc= github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= github.com/cespare/xxhash/v2 v2.1.2 h1:YRXhKfTDauu4ajMg1TPgFO5jnlC2HCbmLXMcTG5cbYE= github.com/cespare/xxhash/v2 v2.1.2/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI= github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI= github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU= +github.com/clbanning/x2j v0.0.0-20191024224557-825249438eec/go.mod h1:jMjuTZXRI4dUb/I5gc9Hdhagfvm9+RyrPryS/auMzxE= github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc= github.com/cncf/udpa/go v0.0.0-20200629203442-efcf912fb354/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= github.com/cncf/udpa/go v0.0.0-20201120205902-5459f2c99403/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= -github.com/cncf/udpa/go v0.0.0-20210930031921-04548b0d99d4/go.mod h1:6pvJx4me5XPnfI9Z40ddWsdw2W/uZgQLFXToKeRcDiI= -github.com/cncf/xds/go v0.0.0-20210312221358-fbca930ec8ed/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= -github.com/cncf/xds/go v0.0.0-20210805033703-aa0b78936158/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= -github.com/cncf/xds/go v0.0.0-20210922020428-25de7278fc84/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= -github.com/cncf/xds/go v0.0.0-20211011173535-cb28da3451f1/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= +github.com/cockroachdb/datadriven v0.0.0-20190809214429-80d97fb3cbaa/go.mod h1:zn76sxSg3SzpJ0PPJaLDCu+Bu0Lg3sKTORVIj19EIF8= +github.com/codahale/hdrhistogram v0.0.0-20161010025455-3a0bb77429bd/go.mod h1:sE/e/2PUdi/liOCUjSTXgM1o87ZssimdTWN964YiIeI= +github.com/coreos/go-semver v0.2.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk= github.com/coreos/go-semver v0.3.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk= +github.com/coreos/go-systemd v0.0.0-20180511133405-39ca1b05acc7/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4= github.com/coreos/go-systemd/v22 v22.3.2/go.mod h1:Y58oyj3AT4RCenI/lSvhwexgC+NSVTIJ3seZv2GcEnc= +github.com/coreos/pkg v0.0.0-20160727233714-3ac0863d7acf/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA= +github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU= github.com/cpuguy83/go-md2man/v2 v2.0.0/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU= +github.com/creack/pty v1.1.7/go.mod h1:lj5s0c3V2DBrqTV7llrYr5NG6My20zk30Fl46Y7DoTY= github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ= github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f h1:lO4WD4F/rVNCu3HqELle0jiPLLBs70cWOduZpkS1E78= github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f/go.mod h1:cuUVRXasLTGF7a8hSLbxyZXjz+1KgoB3wDUb6vlszIc= +github.com/dustin/go-humanize v0.0.0-20171111073723-bb3d318650d4/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk= +github.com/eapache/go-resiliency v1.1.0/go.mod h1:kFI+JgMyC7bLPUVY133qvEBtVayf5mFgVsvEsIPBvNs= +github.com/eapache/go-xerial-snappy v0.0.0-20180814174437-776d5712da21/go.mod h1:+020luEh2TKB4/GOp8oxxtq0Daoen/Cii55CzbTV6DU= +github.com/eapache/queue v1.1.0/go.mod h1:6eCeP0CKFpHLu8blIFXhExK/dRa7WDZfr6jVFPTqq+I= +github.com/edsrzf/mmap-go v1.0.0/go.mod h1:YO35OhQPt3KJa3ryjFM5Bs14WD66h8eGKpfaBNrHW5M= +github.com/envoyproxy/go-control-plane v0.6.9/go.mod h1:SBwIajubJHhxtWwsL9s8ss4safvEdbitLhGGK48rN6g= github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98= github.com/envoyproxy/go-control-plane v0.9.7/go.mod h1:cwu0lG7PUMfa9snN8LXBig5ynNVH9qI8YYLbd1fK2po= github.com/envoyproxy/go-control-plane v0.9.9-0.20201210154907-fd9021fe5dad/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk= github.com/envoyproxy/go-control-plane v0.9.9-0.20210217033140-668b12f5399d/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk= -github.com/envoyproxy/go-control-plane v0.9.9-0.20210512163311-63b5d3c536b0/go.mod h1:hliV/p42l8fGbc6Y9bQ70uLwIvmJyVE5k4iMKlh8wCQ= -github.com/envoyproxy/go-control-plane v0.9.10-0.20210907150352-cf90f659a021/go.mod h1:AFq3mo9L8Lqqiid3OhADV3RfLJnjiw63cSpi+fDTRC0= github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= +github.com/fatih/structs v1.1.0 h1:Q7juDM0QtcnhCpeyLGQKyg4TOIghuNXrkL32pHAUMxo= +github.com/fatih/structs v1.1.0/go.mod h1:9NiDSp5zOcgEDl+j00MP/WkGVPOlPRLejGD8Ga6PJ7M= github.com/fogleman/gg v1.2.1-0.20190220221249-0403632d5b90/go.mod h1:R/bRT+9gY/C5z7JzPU0zXsXHKM4/ayA+zqcVNZzPa1k= +github.com/franela/goblin v0.0.0-20200105215937-c9ffbefa60db/go.mod h1:7dvUGVsVBjqR7JHJk0brhHOZYGmfBYOrK0ZhYMEtBr4= +github.com/franela/goreq v0.0.0-20171204163338-bcd34c9993f8/go.mod h1:ZhphrRTfi2rbfLwlschooIH4+wKKDR4Pdxhh+TRoA20= github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= github.com/fsnotify/fsnotify v1.4.9 h1:hsms1Qyu0jgnwNXIxa+/V/PDsU6CfLf6CNO8H7IWoS4= github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ= github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= -github.com/gin-contrib/sse v0.1.0 h1:Y/yl/+YNO8GZSjAhjMsSuLt29uWRFHdHYUb5lYOV9qE= -github.com/gin-contrib/sse v0.1.0/go.mod h1:RHrZQHXnP2xjPF+u1gW/2HnVO7nvIa9PG3Gm+fLHvGI= -github.com/gin-contrib/zap v0.0.1 h1:wsX/ahRftxPiXpiUw0YqyHj+TQTKtv+DAFWH84G1Uvg= -github.com/gin-contrib/zap v0.0.1/go.mod h1:vJJndZ8f44gsTHQrDPIB4YOZzwOwiEIdE0mMrZLOogk= -github.com/gin-gonic/gin v1.5.0/go.mod h1:Nd6IXA8m5kNZdNEHMBd93KT+mdY3+bewLgRvmCsR2Do= -github.com/gin-gonic/gin v1.7.4 h1:QmUZXrvJ9qZ3GfWvQ+2wnW/1ePrTEJqPKMYEU3lD/DM= -github.com/gin-gonic/gin v1.7.4/go.mod h1:jD2toBW3GZUr5UMcdrwQA10I7RuaFOl/SGeDjXkfUtY= github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU= github.com/go-gl/glfw/v3.3/glfw v0.0.0-20191125211704-12ad95a8df72/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= github.com/go-gl/glfw/v3.3/glfw v0.0.0-20200222043503-6f7a984d4dc4/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= github.com/go-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= github.com/go-kit/kit v0.9.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= +github.com/go-kit/kit v0.10.0/go.mod h1:xUsJbQ/Fp4kEt7AFgCuvyX4a71u8h9jB8tj/ORgOZ7o= github.com/go-kit/log v0.1.0/go.mod h1:zbhenjAZHb184qTLMA9ZjW7ThYL0H2mk7Q6pNt4vbaY= +github.com/go-ldap/ldap v3.0.2+incompatible/go.mod h1:qfd9rJvER9Q0/D/Sqn1DfHRoBp40uXYvFoEVrNEPqRc= github.com/go-logfmt/logfmt v0.3.0/go.mod h1:Qt1PoO58o5twSAckw1HlFXLmHsOX5/0LbT9GBnD5lWE= github.com/go-logfmt/logfmt v0.4.0/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V4qmtdjCk= github.com/go-logfmt/logfmt v0.5.0/go.mod h1:wCYkCAKZfumFQihp8CzCvQ3paCTfi41vtzG1KdI/P7A= -github.com/go-ozzo/ozzo-validation/v4 v4.3.0 h1:byhDUpfEwjsVQb1vBunvIjh2BHQ9ead57VkAEY4V+Es= -github.com/go-ozzo/ozzo-validation/v4 v4.3.0/go.mod h1:2NKgrcHl3z6cJs+3Oo940FPRiTzuqKbvfrL2RxCj6Ew= -github.com/go-playground/assert/v2 v2.0.1 h1:MsBgLAaY856+nPRTKrp3/OZK38U/wa0CcBYNjji3q3A= -github.com/go-playground/assert/v2 v2.0.1/go.mod h1:VDjEfimB/XKnb+ZQfWdccd7VUvScMdVu0Titje2rxJ4= -github.com/go-playground/locales v0.12.1/go.mod h1:IUMDtCfWo/w/mtMfIE/IG2K+Ey3ygWanZIBtBW0W2TM= -github.com/go-playground/locales v0.13.0/go.mod h1:taPMhCMXrRLJO55olJkUXHZBHCxTMfnGwq/HNwmWNS8= -github.com/go-playground/locales v0.14.0 h1:u50s323jtVGugKlcYeyzC0etD1HifMjqmJqb8WugfUU= -github.com/go-playground/locales v0.14.0/go.mod h1:sawfccIbzZTqEDETgFXqTho0QybSa7l++s0DH+LDiLs= -github.com/go-playground/universal-translator v0.16.0/go.mod h1:1AnU7NaIRDWWzGEKwgtJRd2xk99HeFyHw3yid4rvQIY= -github.com/go-playground/universal-translator v0.17.0/go.mod h1:UkSxE5sNxxRwHyU+Scu5vgOQjsIJAF8j9muTVoKLVtA= -github.com/go-playground/universal-translator v0.18.0 h1:82dyy6p4OuJq4/CByFNOn/jYrnRPArHwAcmLoJZxyho= -github.com/go-playground/universal-translator v0.18.0/go.mod h1:UvRDBj+xPUEGrFYl+lu/H90nyDXpg0fqeB/AQUGNTVA= -github.com/go-playground/validator/v10 v10.4.1/go.mod h1:nlOn6nFhuKACm19sB/8EGNn9GlaMV7XkbRSipzJ0Ii4= -github.com/go-playground/validator/v10 v10.9.0 h1:NgTtmN58D0m8+UuxtYmGztBJB7VnPgjj221I1QHci2A= -github.com/go-playground/validator/v10 v10.9.0/go.mod h1:74x4gJWsvQexRdW8Pn3dXSGrTK4nAUsbPlLADvpJkos= github.com/go-redis/redis/v8 v8.11.4 h1:kHoYkfZP6+pe04aFTnhDH6GDROa5yJdHJVNxV3F46Tg= github.com/go-redis/redis/v8 v8.11.4/go.mod h1:2Z2wHZXdQpCDXEGzqMockDpNyYvi2l4Pxt6RJr792+w= +github.com/go-sql-driver/mysql v1.4.0/go.mod h1:zAC/RDZ24gD3HViQzih4MyKcchzm+sOG5ZlKdlhCg5w= github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= github.com/go-task/slim-sprig v0.0.0-20210107165309-348f09dbbbc0/go.mod h1:fyg7847qk6SyHyPtNmDHnmrv/HOrqktSC+C9fM+CJOE= +github.com/go-test/deep v1.0.2-0.20181118220953-042da051cf31/go.mod h1:wGDj63lr65AM2AQyKZd/NYHGb0R+1RLqB8NKt3aSFNA= github.com/godbus/dbus/v5 v5.0.4/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA= +github.com/gofiber/adaptor/v2 v2.1.1/go.mod h1:jdHkqsqdWzEc0qMB+5svsWL5kdZmaDN2H0C3Hxl8y7c= +github.com/gofiber/adaptor/v2 v2.1.14 h1:fGp2G83lnA5opUk5SQ7YQxnoXMnTXWA4qj/22aYixEU= +github.com/gofiber/adaptor/v2 v2.1.14/go.mod h1:s2KVIM9tgTFdbHFd2yUefy80BMIGjU1w3jc3Umk9ZM8= +github.com/gofiber/contrib/fiberzap v0.0.0-20211104103143-eae1892b9aac h1:oBtsxC4TrZd7WuDro3S8U+AALGq0MzlAYYONzsPypdA= +github.com/gofiber/contrib/fiberzap v0.0.0-20211104103143-eae1892b9aac/go.mod h1:QI2s0bHSHwaic8ssYtm50JvJGgqW+xHxNHXxCaEedwE= +github.com/gofiber/fiber/v2 v2.2.2/go.mod h1:Aso7/M+EQOinVkWp4LUYjdlTpKTBoCk2Qo4djnMsyHE= +github.com/gofiber/fiber/v2 v2.6.0/go.mod h1:f8BRRIMjMdRyt2qmJ/0Sea3j3rwwfufPrh9WNBRiVZ0= +github.com/gofiber/fiber/v2 v2.21.0/go.mod h1:MR1usVH3JHYRyQwMe2eZXRSZHRX38fkV+A7CPB+DlDQ= +github.com/gofiber/fiber/v2 v2.22.0 h1:+iyKK4ooDH6z0lAHdaWO1AFIB/DZ9AVo6vz8VZIA0EU= +github.com/gofiber/fiber/v2 v2.22.0/go.mod h1:MR1usVH3JHYRyQwMe2eZXRSZHRX38fkV+A7CPB+DlDQ= +github.com/gofiber/utils v0.1.2 h1:1SH2YEz4RlNS0tJlMJ0bGwO0JkqPqvq6TbHK9tXZKtk= +github.com/gofiber/utils v0.1.2/go.mod h1:pacRFtghAE3UoknMOUiXh2Io/nLWSUHtQCi/3QASsOc= +github.com/gogo/googleapis v1.1.0/go.mod h1:gf4bu3Q80BeJ6H1S1vYPm8/ELATdvryBaNFGgqEef3s= github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= +github.com/gogo/protobuf v1.2.0/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= +github.com/gogo/protobuf v1.2.1/go.mod h1:hp+jE20tsWTFYpLwKvXlhS1hjn+gTNwPg2I6zVXpSg4= github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q= github.com/golang-jwt/jwt/v4 v4.1.0 h1:XUgk2Ex5veyVFVeLm0xhusUTQybEbexJXrvPNOKkSY0= github.com/golang-jwt/jwt/v4 v4.1.0/go.mod h1:/xlHOz8bRuivTWchD4jCa+NbatV+wEUSzwAxVc6locg= github.com/golang/freetype v0.0.0-20170609003504-e2365dfdc4a0/go.mod h1:E/TSTwGwJL78qG/PmXZO1EjYhfJinVAhrmmHX6Z8B9k= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= +github.com/golang/groupcache v0.0.0-20160516000752-02826c3e7903/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/groupcache v0.0.0-20191227052852-215e87163ea7/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= @@ -181,6 +216,9 @@ github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaS github.com/golang/protobuf v1.5.1/go.mod h1:DopwsBzvsk0Fs44TXzsVbJyPhcCPeIwnvohx4u74HPM= github.com/golang/protobuf v1.5.2 h1:ROPKBNFfQgOUMifHyP+KYbvpjbdoFNs+aK7DXlji0Tw= github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= +github.com/golang/snappy v0.0.0-20180518054509-2e65f85255db/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= +github.com/golang/snappy v0.0.1/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= +github.com/golang/snappy v0.0.3/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= github.com/gomodule/redigo v1.8.1 h1:Abmo0bI7Xf0IhdIPc7HZQzZcShdnmxeoVuDDtIQp8N8= github.com/gomodule/redigo v1.8.1/go.mod h1:P9dn9mFrCBvWhGE1wpxx6fgq7BAeLBk+UUUzlpkBYO0= github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= @@ -214,56 +252,91 @@ github.com/google/pprof v0.0.0-20201203190320-1bf35d6f28c2/go.mod h1:kpwsk12EmLe github.com/google/pprof v0.0.0-20210122040257-d980be63207e/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/pprof v0.0.0-20210226084205-cbba55b83ad5/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= +github.com/google/uuid v1.0.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.3.0 h1:t6JiXgmwXMjEs8VusXIJk2BXHsn+wx8BZdTaoZ5fu7I= github.com/google/uuid v1.3.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg= github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk= github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= +github.com/gorilla/context v1.1.1/go.mod h1:kBGZzfjB9CEq2AlWe17Uuf7NDRt0dE0s8S51q0aT7Yg= +github.com/gorilla/mux v1.6.2/go.mod h1:1lud6UwP+6orDFRuTfBEV8e9/aOM/c4fVVCaMa2zaAs= +github.com/gorilla/mux v1.7.3/go.mod h1:1lud6UwP+6orDFRuTfBEV8e9/aOM/c4fVVCaMa2zaAs= +github.com/gorilla/websocket v0.0.0-20170926233335-4201258b820c/go.mod h1:E7qHFY5m1UJ88s3WnNqhKjPHQ0heANvMoAMk2YaljkQ= +github.com/grpc-ecosystem/go-grpc-middleware v1.0.1-0.20190118093823-f849b5445de4/go.mod h1:FiyG127CGDf3tlThmgyCl78X/SZQqEOJBCDaAfeWzPs= +github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0/go.mod h1:8NvIoxWQoOIhqOTXgfV/d3M/q6VIi02HzZEHgUlZvzk= +github.com/grpc-ecosystem/grpc-gateway v1.9.5/go.mod h1:vNeuVxBJEsws4ogUvrchl83t/GYV9WGTSLVdBhOQFDY= github.com/grpc-ecosystem/grpc-gateway v1.16.0/go.mod h1:BDjrQk3hbvj6Nolgz8mAMFbcEtjT1g+wF4CSlocrBnw= github.com/hashicorp/consul/api v1.1.0/go.mod h1:VmuI/Lkw1nC05EYQWNKwWGbkg+FbDBtguAZLlVdkD9Q= +github.com/hashicorp/consul/api v1.3.0/go.mod h1:MmDNSzIMUjNpY/mQ398R4bk2FnqQLoPndWW5VkKPlCE= github.com/hashicorp/consul/sdk v0.1.1/go.mod h1:VKf9jXwCTEY1QZP2MOLRhb5i/I/ssyNV1vwHyQBF0x8= +github.com/hashicorp/consul/sdk v0.3.0/go.mod h1:VKf9jXwCTEY1QZP2MOLRhb5i/I/ssyNV1vwHyQBF0x8= github.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= +github.com/hashicorp/go-cleanhttp v0.5.0/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtngrth3wmdIIUrZ80= github.com/hashicorp/go-cleanhttp v0.5.1/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtngrth3wmdIIUrZ80= +github.com/hashicorp/go-hclog v0.0.0-20180709165350-ff2cf002a8dd/go.mod h1:9bjs9uLqI8l75knNv3lV1kA55veR+WUPSiKIWcQHudI= +github.com/hashicorp/go-hclog v0.8.0/go.mod h1:5CU+agLiy3J7N7QjHK5d05KxGsuXiQLrjA0H7acj2lQ= github.com/hashicorp/go-immutable-radix v1.0.0/go.mod h1:0y9vanUI8NX6FsYoO3zeMjhV/C5i9g4Q3DwcSNZ4P60= github.com/hashicorp/go-msgpack v0.5.3/go.mod h1:ahLV/dePpqEmjfWmKiqvPkv/twdG7iPBM1vqhUKIvfM= github.com/hashicorp/go-multierror v1.0.0/go.mod h1:dHtQlpGsu+cZNNAkkCN/P3hoUDHhCYQXV3UM06sGGrk= +github.com/hashicorp/go-plugin v1.0.1/go.mod h1:++UyYGoz3o5w9ZzAdZxtQKrWWP+iqPBn3cQptSMzBuY= +github.com/hashicorp/go-retryablehttp v0.5.4/go.mod h1:9B5zBasrRhHXnJnui7y6sL7es7NDiJgTc6Er0maI1Xs= github.com/hashicorp/go-rootcerts v1.0.0/go.mod h1:K6zTfqpRlCUIjkwsN4Z+hiSfzSTQa6eBIzfwKfwNnHU= +github.com/hashicorp/go-rootcerts v1.0.1/go.mod h1:pqUvnprVnM5bf7AOirdbb01K4ccR319Vf4pU3K5EGc8= github.com/hashicorp/go-sockaddr v1.0.0/go.mod h1:7Xibr9yA9JjQq1JpNB2Vw7kxv8xerXegt+ozgdvDeDU= +github.com/hashicorp/go-sockaddr v1.0.2/go.mod h1:rB4wwRAUzs07qva3c5SdrY/NEtAUjGlgmH/UkBUC97A= github.com/hashicorp/go-syslog v1.0.0/go.mod h1:qPfqrKkXGihmCqbJM2mZgkZGvKG1dFdvsLplgctolz4= github.com/hashicorp/go-uuid v1.0.0/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= github.com/hashicorp/go-uuid v1.0.1/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= +github.com/hashicorp/go-version v1.1.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= +github.com/hashicorp/go-version v1.2.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= github.com/hashicorp/go.net v0.0.1/go.mod h1:hjKkEWcCURg++eb33jQU7oqQcI9XDCnUzHA0oac0k90= github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= +github.com/hashicorp/hcl v1.0.0 h1:0Anlzjpi4vEasTeNFn2mLJgTSwt0+6sfsiTG8qcWGx4= github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ= github.com/hashicorp/logutils v1.0.0/go.mod h1:QIAnNjmIWmVIIkWDTG1z5v++HQmx9WQRO+LraFDTW64= github.com/hashicorp/mdns v1.0.0/go.mod h1:tL+uN++7HEJ6SQLQ2/p+z2pH24WQKWjBPkE0mNTz8vQ= github.com/hashicorp/memberlist v0.1.3/go.mod h1:ajVTdAv/9Im8oMAAj5G31PhhMCZJV2pPBoIllUwCN7I= github.com/hashicorp/serf v0.8.2/go.mod h1:6hOLApaqBFA1NXqRQAsxw9QxuDEvNxSQRwA/JwenrHc= +github.com/hashicorp/vault/api v1.0.4/go.mod h1:gDcqh3WGcR1cpF5AJz/B1UFheUEneMoIospckxBxk6Q= +github.com/hashicorp/vault/sdk v0.1.13/go.mod h1:B+hVj7TpuQY1Y/GPbCpffmgd+tSEwvhkWnjtSYCaS2M= +github.com/hashicorp/yamux v0.0.0-20180604194846-3520598351bb/go.mod h1:+NfK9FKeTrX5uv1uIXGdwYDTeHna2qgaIlx54MXqjAM= +github.com/hashicorp/yamux v0.0.0-20181012175058-2f1d1f20f75d/go.mod h1:+NfK9FKeTrX5uv1uIXGdwYDTeHna2qgaIlx54MXqjAM= github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= +github.com/hudl/fargo v1.3.0/go.mod h1:y3CKSmjA+wD2gak7sUSXTAoopbhU08POFhmITJgmKTg= github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= github.com/ianlancetaylor/demangle v0.0.0-20200824232613-28f6c0f3b639/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= github.com/inconshreveable/mousetrap v1.0.0 h1:Z8tu5sraLXCXIcARxBp/8cbvlwVa7Z1NHg9XEKhtSvM= github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8= +github.com/influxdata/influxdb1-client v0.0.0-20191209144304-8bf82d3c094d/go.mod h1:qj24IKcXYK6Iy9ceXlo3Tc+vtHo9lIhSX5JddghvEPo= +github.com/jmespath/go-jmespath v0.0.0-20180206201540-c2b33e8439af/go.mod h1:Nht3zPeWKUH0NzdCt2Blrr5ys8VGpn0CEB0cQHVjt7k= +github.com/jmespath/go-jmespath v0.4.0/go.mod h1:T8mJZnbsbmF+m6zOOFylbeCJqk5+pHWvzYPziyZiYoo= +github.com/jmespath/go-jmespath/internal/testify v1.5.1/go.mod h1:L3OGu8Wl2/fWfCI6z80xFu9LTZmf1ZRjMHUOPmWr69U= +github.com/joho/godotenv v1.3.0 h1:Zjp+RcGpHhGlrMbJzXTrZZPrWj+1vfm90La1wgB6Bhc= +github.com/joho/godotenv v1.3.0/go.mod h1:7hK45KPybAkOC6peb+G5yklZfMxEjkZhHbwpqxOKXbg= +github.com/jonboulle/clockwork v0.1.0/go.mod h1:Ii8DK3G1RaLaWxj9trq07+26W01tbo22gdxWY5EU2bo= github.com/jpillora/backoff v1.0.0/go.mod h1:J/6gKK9jxlEcS3zixgDgUAsiuZ7yrSoa/FX5e0EB2j4= github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= github.com/json-iterator/go v1.1.7/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= -github.com/json-iterator/go v1.1.9/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= +github.com/json-iterator/go v1.1.8/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= github.com/json-iterator/go v1.1.10/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= github.com/json-iterator/go v1.1.11/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= -github.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnrnM= -github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo= github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU= github.com/jstemmer/go-junit-report v0.9.1/go.mod h1:Brl9GWCQeLvo8nXZwPNNblvFj/XSXhF0NWZEnDohbsk= github.com/jtolds/gls v4.20.0+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfVYBRgL+9YlvaHOwJU= github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w= github.com/julienschmidt/httprouter v1.3.0/go.mod h1:JR6WtHb+2LUe8TCKY3cZOxFyyO8IZAc4RVcycCCAKdM= github.com/jung-kurt/gofpdf v1.0.3-0.20190309125859-24315acbbda5/go.mod h1:7Id9E/uU8ce6rXgefFLlgrJj/GYY22cpxn+r32jIOes= -github.com/kelseyhightower/envconfig v1.4.0 h1:Im6hONhd3pLkfDFsbRgu68RDNkGF1r3dvMUtDTo2cv8= -github.com/kelseyhightower/envconfig v1.4.0/go.mod h1:cccZRl6mQpaq41TPp5QxidR+Sa3axMbJDNb//FQX6Gg= +github.com/kisielk/errcheck v1.1.0/go.mod h1:EZBBE59ingxPouuu3KfxchcWSUPOHkagtvWXihfKN4Q= github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8= github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= +github.com/klauspost/compress v1.10.7/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdYsUV+/s2qKfXs= +github.com/klauspost/compress v1.13.4/go.mod h1:8dP1Hq4DHOhN9w426knH3Rhby4rFm6D8eO+e+Dq5Gzg= +github.com/klauspost/compress v1.13.6 h1:P76CopJELS0TiO2mebmnzgWaajssP/EszplttgQxcgc= +github.com/klauspost/compress v1.13.6/go.mod h1:/3/Vjq9QcHkK5uEr5lBEmyoZ1iFhe47etQ6QUkpK6sk= +github.com/knadh/koanf v1.3.2 h1:0JKfmTLcvEmdJwjY16BMOVKpqThxRwj29CtQvZiCsAA= +github.com/knadh/koanf v1.3.2/go.mod h1:HZ7HMLIGbrWJUfgtEzfHvzR/rX+eIqQlBNPRr4Vt42s= github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/konsorten/go-windows-terminal-sequences v1.0.3/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/kr/fs v0.1.0/go.mod h1:FFnZGqtBN9Gxj7eW1uZ42v5BccTP0vu6NEaFoC2HwRg= @@ -276,87 +349,133 @@ github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= -github.com/leodido/go-urn v1.1.0/go.mod h1:+cyI34gQWZcE1eQU7NVgKkkzdXDQHr1dBMtdAPozLkw= -github.com/leodido/go-urn v1.2.0/go.mod h1:+8+nEpDfqqsY+g338gtMEUOtuK+4dEMhiQEgxpxOKII= -github.com/leodido/go-urn v1.2.1 h1:BqpAaACuzVSgi/VLzGZIobT2z4v53pjosyNd9Yv6n/w= -github.com/leodido/go-urn v1.2.1/go.mod h1:zt4jvISO2HfUBqxjfIshjdMTYS56ZS/qv49ictyFfxY= +github.com/lightstep/lightstep-tracer-common/golang/gogo v0.0.0-20190605223551-bc2310a04743/go.mod h1:qklhhLq1aX+mtWk9cPHPzaBjWImj5ULL6C7HFJtXQMM= +github.com/lightstep/lightstep-tracer-go v0.18.1/go.mod h1:jlF1pusYV4pidLvZ+XD0UBX0ZE6WURAspgAczcDHrL4= +github.com/lyft/protoc-gen-validate v0.0.13/go.mod h1:XbGvPuh87YZc5TdIa2/I4pLk0QoUACkjt2znoq26NVQ= github.com/magiconair/properties v1.8.5/go.mod h1:y3VJvCyxH9uVvJTWEGAELF3aiYNyPKd5NZ3oSwXrF60= github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU= github.com/mattn/go-isatty v0.0.3/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= -github.com/mattn/go-isatty v0.0.9/go.mod h1:YNRxwqDuOph6SZLI9vUUz6OYw3QyUt7WiY2yME+cCiQ= -github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU= -github.com/mattn/go-isatty v0.0.14 h1:yVuAays6BHfxijgZPzw+3Zlu5yQgKGP2/hcQbHb7S9Y= -github.com/mattn/go-isatty v0.0.14/go.mod h1:7GGIvUiUoEMVVmxf/4nioHXj79iQHKdU27kJ6hsGG94= +github.com/mattn/go-isatty v0.0.4/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= +github.com/mattn/go-runewidth v0.0.2/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzpuz5H//U1FU= github.com/matttproud/golang_protobuf_extensions v1.0.1 h1:4hp9jkHxhMHkqkrB3Ix0jegS5sx/RkqARlsWZ6pIwiU= github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= github.com/miekg/dns v1.0.14/go.mod h1:W1PPwlIAgtquWBMBEV9nkV9Cazfe8ScdGz/Lj7v3Nrg= github.com/mitchellh/cli v1.0.0/go.mod h1:hNIlj7HEI86fIcpObd7a0FcrxTWetlwJDGcceTlRvqc= +github.com/mitchellh/copystructure v1.0.0/go.mod h1:SNtv71yrdKgLRyLFxmLdkAbkKEFWgYaq1OVrnRcwhnw= +github.com/mitchellh/copystructure v1.2.0 h1:vpKXTN4ewci03Vljg/q9QvCGUDttBOGBIa15WveJJGw= +github.com/mitchellh/copystructure v1.2.0/go.mod h1:qLl+cE2AmVv+CoeAwDPye/v+N2HKCj9FbZEVFJRxO9s= github.com/mitchellh/go-homedir v1.0.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= +github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= +github.com/mitchellh/go-testing-interface v0.0.0-20171004221916-a61a99592b77/go.mod h1:kRemZodwjscx+RGhAo8eIhFbs2+BFgRtFPeD/KE+zxI= github.com/mitchellh/go-testing-interface v1.0.0/go.mod h1:kRemZodwjscx+RGhAo8eIhFbs2+BFgRtFPeD/KE+zxI= +github.com/mitchellh/go-wordwrap v1.0.0/go.mod h1:ZXFpozHsX6DPmq2I0TCekCxypsnAUbP2oI0UX1GXzOo= github.com/mitchellh/gox v0.4.0/go.mod h1:Sd9lOJ0+aimLBi73mGofS1ycjY8lL3uZM3JPS42BGNg= github.com/mitchellh/iochan v1.0.0/go.mod h1:JwYml1nuB7xOzsp52dPpHFffvOCDupsG0QubkSMEySY= github.com/mitchellh/mapstructure v0.0.0-20160808181253-ca63d7c062ee/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= +github.com/mitchellh/mapstructure v1.4.1 h1:CpVNEelQCZBooIPDn+AR3NpivK/TIKU8bDxdASFVQag= github.com/mitchellh/mapstructure v1.4.1/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= +github.com/mitchellh/reflectwalk v1.0.0/go.mod h1:mSTlrgnPZtwu0c4WaC2kGObEpuNDbx0jmZXqmk4esnw= +github.com/mitchellh/reflectwalk v1.0.2 h1:G2LzWKi524PWgd3mLHV8Y5k7s6XUvT0Gef6zxSIeXaQ= +github.com/mitchellh/reflectwalk v1.0.2/go.mod h1:mSTlrgnPZtwu0c4WaC2kGObEpuNDbx0jmZXqmk4esnw= github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= -github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w8PVh93nsPXa1VrQ6jlwL5oN8l14QlcNfg= github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= -github.com/modern-go/reflect2 v1.0.2 h1:xBagoLtFs94CBntxluKeaWgTMpvLxC4ur3nMaC9Gz0M= -github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk= github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= +github.com/nats-io/jwt v0.3.0/go.mod h1:fRYCDE99xlTsqUzISS1Bi75UBJ6ljOJQOAAu5VglpSg= +github.com/nats-io/jwt v0.3.2/go.mod h1:/euKqTS1ZD+zzjYrY7pseZrTtWQSjujC7xjPc8wL6eU= +github.com/nats-io/nats-server/v2 v2.1.2/go.mod h1:Afk+wRZqkMQs/p45uXdrVLuab3gwv3Z8C4HTBu8GD/k= +github.com/nats-io/nats.go v1.9.1/go.mod h1:ZjDU1L/7fJ09jvUSRVBR2e7+RnLiiIQyqyzEE/Zbp4w= +github.com/nats-io/nkeys v0.1.0/go.mod h1:xpnFELMwJABBLVhffcfd1MZx6VsNRFpEugbxziKVo7w= +github.com/nats-io/nkeys v0.1.3/go.mod h1:xpnFELMwJABBLVhffcfd1MZx6VsNRFpEugbxziKVo7w= +github.com/nats-io/nuid v1.0.1/go.mod h1:19wcPz3Ph3q0Jbyiqsd0kePYG7A95tJPxeL+1OSON2c= github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno= github.com/nxadm/tail v1.4.4/go.mod h1:kenIhsEOeOJmVchQTgglprH7qJGnHDVpk1VPCcaMI8A= github.com/nxadm/tail v1.4.8 h1:nPr65rt6Y5JFSKQO7qToXr7pePgD6Gwiw05lkbyAQTE= github.com/nxadm/tail v1.4.8/go.mod h1:+ncqLTQzXmGhMZNUePPaPqPvBxHAIsmXswZKocGu+AU= +github.com/oklog/oklog v0.3.2/go.mod h1:FCV+B7mhrz4o+ueLpx+KqkyXRGMWOYEvfiXtdGtbWGs= +github.com/oklog/run v1.0.0/go.mod h1:dlhp/R75TPv97u0XWUtDeV/lRKWPKSdTuV0TZvrmrQA= +github.com/olekukonko/tablewriter v0.0.0-20170122224234-a0225b3f23b5/go.mod h1:vsDQFd/mU46D+Z4whnwzcISnGGzXWMclvtLoiIKAKIo= github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= +github.com/onsi/ginkgo v1.7.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.12.1/go.mod h1:zj2OWP4+oCPe1qIXoGWkgMRwljMUYCdkwsT2108oapk= github.com/onsi/ginkgo v1.16.4 h1:29JGrr5oVBm5ulCWet69zQkzWipVXIol6ygQUe/EzNc= github.com/onsi/ginkgo v1.16.4/go.mod h1:dX+/inL/fNMqNlz0e9LfyB9TswhZpCVdJM/Z6Vvnwo0= +github.com/onsi/gomega v1.4.3/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= github.com/onsi/gomega v1.7.1/go.mod h1:XdKZgCCFLUoM/7CFJVPcG8C1xQ1AJ0vpAezJrB7JYyY= github.com/onsi/gomega v1.10.1/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1ybHNo= github.com/onsi/gomega v1.16.0 h1:6gjqkI8iiRHMvdccRJM8rVKjCWk6ZIm6FTm3ddIe4/c= github.com/onsi/gomega v1.16.0/go.mod h1:HnhC7FXeEQY45zxNK3PPoIUhzk/80Xly9PcubAlGdZY= +github.com/op/go-logging v0.0.0-20160315200505-970db520ece7/go.mod h1:HzydrMdWErDVzsI23lYNej1Htcns9BCg93Dk0bBINWk= +github.com/opentracing-contrib/go-observer v0.0.0-20170622124052-a52f23424492/go.mod h1:Ngi6UdF0k5OKD5t5wlmGhe/EDKPoUM3BXZSSfIuJbis= +github.com/opentracing/basictracer-go v1.0.0/go.mod h1:QfBfYuafItcjQuMwinw9GhYKwFXS9KnPs5lxoYwgW74= +github.com/opentracing/opentracing-go v1.0.2/go.mod h1:UkNAQd3GIcIGf0SeVgPpRdFStlNbqXla1AfSYxPUl2o= +github.com/opentracing/opentracing-go v1.1.0/go.mod h1:UkNAQd3GIcIGf0SeVgPpRdFStlNbqXla1AfSYxPUl2o= github.com/opentracing/opentracing-go v1.2.0 h1:uEJPy/1a5RIPAJ0Ov+OIO8OxWu77jEv+1B0VhjKrZUs= github.com/opentracing/opentracing-go v1.2.0/go.mod h1:GxEUsuufX4nBwe+T+Wl9TAgYrxe9dPLANfrWvHYVTgc= +github.com/openzipkin-contrib/zipkin-go-opentracing v0.4.5/go.mod h1:/wsWhb9smxSfWAKL3wpBW7V8scJMt8N8gnaMCS9E/cA= +github.com/openzipkin/zipkin-go v0.1.6/go.mod h1:QgAqvLzwWbR/WpD4A3cGpPtJrZXNIiJc5AZX7/PBEpw= +github.com/openzipkin/zipkin-go v0.2.1/go.mod h1:NaW6tEwdmWMaCDZzg8sh+IBNOxHMPnhQw8ySjnjRyN4= +github.com/openzipkin/zipkin-go v0.2.2/go.mod h1:NaW6tEwdmWMaCDZzg8sh+IBNOxHMPnhQw8ySjnjRyN4= +github.com/pact-foundation/pact-go v1.0.4/go.mod h1:uExwJY4kCzNPcHRj+hCR/HBbOOIwwtUjcrb0b5/5kLM= github.com/pascaldekloe/goe v0.0.0-20180627143212-57f6aae5913c/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc= +github.com/pascaldekloe/goe v0.1.0/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc= github.com/patrickmn/go-cache v2.1.0+incompatible h1:HRMgzkcYKYpi3C8ajMPV8OFXaaRUnok+kx1WdO15EQc= github.com/patrickmn/go-cache v2.1.0+incompatible/go.mod h1:3Qf8kWWT7OJRJbdiICTKqZju1ZixQ/KpMGzzAfe6+WQ= +github.com/pborman/uuid v1.2.0/go.mod h1:X/NO0urCmaxf9VXbdlT7C2Yzkj2IKimNn4k+gtPdI/k= +github.com/pelletier/go-toml v1.7.0/go.mod h1:vwGMzjaWMwyfHwgIBhI2YUM4fB6nL6lVAvS1LBMMhTE= +github.com/pelletier/go-toml v1.9.3 h1:zeC5b1GviRUyKYd6OJPvBU/mcVDVoL1OhT17FCt5dSQ= github.com/pelletier/go-toml v1.9.3/go.mod h1:u1nR/EPcESfeI/szUZKdtJ0xRNbUoANCkoOuaOx1Y+c= +github.com/performancecopilot/speed v3.0.0+incompatible/go.mod h1:/CLtqpZ5gBg1M9iaPbIdPPGyKcA8hKdoy6hAWba7Yac= +github.com/pierrec/lz4 v1.0.2-0.20190131084431-473cd7ce01a1/go.mod h1:3/3N9NVKO0jef7pBehbT1qWhCMrIgbYNnFAZCqQ5LRc= +github.com/pierrec/lz4 v2.0.5+incompatible/go.mod h1:pdkljMzZIN41W+lC3N2tnIh5sFi+IEE17M5jbnwPHcY= github.com/pkg/diff v0.0.0-20210226163009-20ebb0f2a09e/go.mod h1:pJLUxLENpZxwdsKMEsNbx1VGcRFpLqf3715MtcvvzbA= github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= +github.com/pkg/profile v1.2.1/go.mod h1:hJw3o1OdXxsrSjjVksARp5W95eeEaEfptyVZyv6JUPA= github.com/pkg/sftp v1.10.1/go.mod h1:lYOWFsE0bwd1+KfKJaKeuokY15vzFx25BLbzYYoAxZI= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/posener/complete v1.1.1/go.mod h1:em0nMJCgc9GFtwrmVmEMR/ZL6WyhyjMBndrE9hABlRI= github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw= +github.com/prometheus/client_golang v0.9.3-0.20190127221311-3c4408c8b829/go.mod h1:p2iRAGwDERtqlqzRXnrOVns+ignqQo//hLXqYxZYVNs= github.com/prometheus/client_golang v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5FsnadC4Ky3P0J6CfImo= +github.com/prometheus/client_golang v1.3.0/go.mod h1:hJaj2vgQTGQmVCsAACORcieXFeDPbaTKGT+JTgUa3og= github.com/prometheus/client_golang v1.7.1/go.mod h1:PY5Wy2awLA44sXw4AOSfFBetzPP4j5+D6mVACh+pe2M= +github.com/prometheus/client_golang v1.9.0/go.mod h1:FqZLKOZnGdFAhOK4nqGHa7D66IdsO+O441Eve7ptJDU= github.com/prometheus/client_golang v1.11.0 h1:HNkLOAEQMIDv/K+04rukrLx6ch7msSRwf3/SASFAGtQ= github.com/prometheus/client_golang v1.11.0/go.mod h1:Z6t4BnS23TR94PD6BsDNk8yVqroYurpAkEiz0P2BEV0= github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= +github.com/prometheus/client_model v0.0.0-20190115171406-56726106282f/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= +github.com/prometheus/client_model v0.1.0/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/client_model v0.2.0 h1:uq5h0d+GuxiXLJLNABMgp2qUWDPiLvgCzz2dUR+/W/M= github.com/prometheus/client_model v0.2.0/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= +github.com/prometheus/common v0.2.0/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= github.com/prometheus/common v0.4.1/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= +github.com/prometheus/common v0.7.0/go.mod h1:DjGbpBbp5NYNiECxcL/VnbXCCaQpKd3tt26CguLLsqA= github.com/prometheus/common v0.10.0/go.mod h1:Tlit/dnDKsSWFlCLTWaA1cyBgKHSMdTB80sz/V91rCo= +github.com/prometheus/common v0.15.0/go.mod h1:U+gB1OBLb1lF3O42bTCL+FK18tX9Oar16Clt/msog/s= github.com/prometheus/common v0.26.0/go.mod h1:M7rCNAaPfAosfx8veZJCuw84e35h3Cfd9VFqTh1DIvc= -github.com/prometheus/common v0.31.1 h1:d18hG4PkHnNAKNMOmFuXFaiY8Us0nird/2m60uS1AMs= -github.com/prometheus/common v0.31.1/go.mod h1:vu+V0TpY+O6vW9J44gczi3Ap/oXXR10b+M/gUGO4Hls= github.com/prometheus/common v0.32.1 h1:hWIdL3N2HoUx3B8j3YN9mWor0qhY/NlEKZEaXxuIRh4= github.com/prometheus/common v0.32.1/go.mod h1:vu+V0TpY+O6vW9J44gczi3Ap/oXXR10b+M/gUGO4Hls= github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= +github.com/prometheus/procfs v0.0.0-20190117184657-bf6a532e95b1/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= +github.com/prometheus/procfs v0.0.8/go.mod h1:7Qr8sr6344vo1JqZ6HhLceV9o3AJ1Ff+GxbHq6oeK9A= github.com/prometheus/procfs v0.1.3/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU= +github.com/prometheus/procfs v0.2.0/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU= github.com/prometheus/procfs v0.6.0/go.mod h1:cz+aTbrPOrUb4q7XlbU9ygM+/jj0fzG6c1xBZuNvfVA= github.com/prometheus/procfs v0.7.3 h1:4jVXhlkAyzOScmCkXBTOLRLTz8EeU+eyjrwB/EPq0VU= github.com/prometheus/procfs v0.7.3/go.mod h1:cz+aTbrPOrUb4q7XlbU9ygM+/jj0fzG6c1xBZuNvfVA= +github.com/rcrowley/go-metrics v0.0.0-20181016184325-3113b8401b8a/go.mod h1:bCqnVzQkZxMG4s8nGwiZ5l3QUCyqpo9Y+/ZMZ9VjZe4= +github.com/rhnvrm/simples3 v0.6.1/go.mod h1:Y+3vYm2V7Y4VijFoJHHTrja6OgPrJ2cBti8dPGkC3sA= +github.com/rogpeppe/fastuuid v0.0.0-20150106093220-6724a57986af/go.mod h1:XWv6SoW27p1b0cqNHllgS5HIMJraePCO15w5zCzIWYg= github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6LYCDYWNEvQ= github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= github.com/rogpeppe/go-internal v1.6.1/go.mod h1:xXDCJY+GAPziupqXw64V24skbSoqbTEfhy4qGm1nDQc= @@ -364,6 +483,9 @@ github.com/rogpeppe/go-internal v1.8.0 h1:FCbCCtXNOY3UtUuHUYaghJg4y7Fd14rXifAYUA github.com/rogpeppe/go-internal v1.8.0/go.mod h1:WmiCO8CzOY8rg0OYDC4/i/2WRWAB6poM+XZ2dLUbcbE= github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= github.com/ryanuber/columnize v0.0.0-20160712163229-9b3edd62028f/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts= +github.com/ryanuber/columnize v2.1.0+incompatible/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts= +github.com/ryanuber/go-glob v1.0.0/go.mod h1:807d1WSdnB0XRJzKNil9Om6lcp/3a0v4qIHxIXzX/Yc= +github.com/samuel/go-zookeeper v0.0.0-20190923202752-2cc03de413da/go.mod h1:gi+0XIa01GRL2eRQVjQkKGqKF3SF9vZR/HnPullcV2E= github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529/go.mod h1:DxrIzT+xaE7yg65j358z/aeFdxmN0P9QXhEzd20vsDc= github.com/shurcooL/sanitized_anchor_name v1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc= github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= @@ -371,17 +493,23 @@ github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6Mwd github.com/sirupsen/logrus v1.6.0/go.mod h1:7uNnSEd1DgxDLC74fIahvMZmmYsHGZGEOFrfsX/uA88= github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc= github.com/smartystreets/goconvey v1.6.4/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9QV7WQ/tjFTllLA= -github.com/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA= +github.com/soheilhy/cmux v0.1.4/go.mod h1:IM3LyeVVIOuxMH7sFAkER9+bJ4dT7Ms6E4xg4kGIyLM= +github.com/sony/gobreaker v0.4.1/go.mod h1:ZKptC7FHNvhBz7dN2LGjPVBz2sZJmc0/PkyDJOjmxWY= github.com/speps/go-hashids/v2 v2.0.1 h1:ViWOEqWES/pdOSq+C1SLVa8/Tnsd52XC34RY7lt7m4g= github.com/speps/go-hashids/v2 v2.0.1/go.mod h1:47LKunwvDZki/uRVD6NImtyk712yFzIs3UF3KlHohGw= github.com/spf13/afero v1.6.0/go.mod h1:Ai8FlHk4v/PARR026UzYexafAt9roJ7LcLMAmO6Z93I= github.com/spf13/cast v1.3.1/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE= +github.com/spf13/cobra v0.0.3/go.mod h1:1l0Ry5zgKvJasoi3XT1TypsSe7PqH0Sj9dhYf7v3XqQ= github.com/spf13/cobra v1.2.1 h1:+KmjbUw1hriSNMF55oPrkZcb27aECyrj8V2ytv7kWDw= github.com/spf13/cobra v1.2.1/go.mod h1:ExllRjgxM/piMAM+3tAZvg8fsklGAf3tPfi+i8t68Nk= github.com/spf13/jwalterweatherman v1.1.0/go.mod h1:aNWZUN0dPAAO/Ljvb5BEdw96iTZ0EXowPYD95IqWIGo= +github.com/spf13/pflag v1.0.1/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA= github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= github.com/spf13/viper v1.8.1/go.mod h1:o0Pch8wJ9BVSWGQMbra6iw0oQ5oktSIBaujf1rJH9Ns= +github.com/streadway/amqp v0.0.0-20190404075320-75d898a42a94/go.mod h1:AZpEONHx3DKn8O/DFsRAY58/XVQiIPMTMB1SddzLXVw= +github.com/streadway/amqp v0.0.0-20190827072141-edfb9018d271/go.mod h1:AZpEONHx3DKn8O/DFsRAY58/XVQiIPMTMB1SddzLXVw= +github.com/streadway/handy v0.0.0-20190108123426-d5acb3125c2a/go.mod h1:qNTQ5P5JnDBl6z3cMAg/SywNDC5ABu5ApDIw6lUbRmI= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.1.1 h1:2vfRuCMp5sSVIDSqO8oNnWJq7mPa6KVP3iPIwFBuy8A= github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= @@ -393,16 +521,23 @@ github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/ github.com/stretchr/testify v1.7.0 h1:nwc3DEeHmmLAfoZucVR881uASk0Mfjw8xYJ99tb5CcY= github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/subosito/gotenv v1.2.0/go.mod h1:N0PQaV/YGNqwC0u51sEeR/aUtSLEXKX9iv69rRypqCw= +github.com/tmc/grpc-websocket-proxy v0.0.0-20170815181823-89b8d40f7ca8/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U= github.com/uber/jaeger-client-go v2.29.1+incompatible h1:R9ec3zO3sGpzs0abd43Y+fBZRJ9uiH6lXyR/+u6brW4= github.com/uber/jaeger-client-go v2.29.1+incompatible/go.mod h1:WVhlPFC8FDjOFMMWRy2pZqQJSXxYSwNYOkTr/Z6d3Kk= github.com/uber/jaeger-lib v2.4.1+incompatible h1:td4jdvLcExb4cBISKIpHuGoVXh+dVKhn2Um6rjCsSsg= github.com/uber/jaeger-lib v2.4.1+incompatible/go.mod h1:ComeNDZlWwrWnDv8aPp0Ba6+uUTzImX/AauajbLI56U= -github.com/ugorji/go v1.1.7/go.mod h1:kZn38zHttfInRq0xu/PH0az30d+z6vm202qpg1oXVMw= -github.com/ugorji/go v1.2.6 h1:tGiWC9HENWE2tqYycIqFTNorMmFRVhNwCpDOpWqnk8E= -github.com/ugorji/go v1.2.6/go.mod h1:anCg0y61KIhDlPZmnH+so+RQbysYVyDko0IMgJv0Nn0= -github.com/ugorji/go/codec v1.1.7/go.mod h1:Ax+UKWsSmolVDwsd+7N3ZtXu+yMGCf907BLYF3GoBXY= -github.com/ugorji/go/codec v1.2.6 h1:7kbGefxLoDBuYXOms4yD7223OpNMMPNPZxXk5TvFcyQ= -github.com/ugorji/go/codec v1.2.6/go.mod h1:V6TCNZ4PHqoHGFZuSG1W8nrCzzdgA2DozYxWFFpvxTw= +github.com/urfave/cli v1.20.0/go.mod h1:70zkFmudgCuE/ngEzBv17Jvp/497gISqfk5gWijbERA= +github.com/urfave/cli v1.22.1/go.mod h1:Gos4lmkARVdJ6EkW0WaNv/tZAAMe9V7XWyB60NtXRu0= +github.com/valyala/bytebufferpool v1.0.0 h1:GqA5TC/0021Y/b9FG4Oi9Mr3q7XYx6KllzawFIhcdPw= +github.com/valyala/bytebufferpool v1.0.0/go.mod h1:6bBcMArwyJ5K/AmCkWv1jt77kVWyCJ6HpOuEn7z0Csc= +github.com/valyala/fasthttp v1.17.0/go.mod h1:jjraHZVbKOXftJfsOYoAjaeygpj5hr8ermTRJNroD7A= +github.com/valyala/fasthttp v1.18.0/go.mod h1:jjraHZVbKOXftJfsOYoAjaeygpj5hr8ermTRJNroD7A= +github.com/valyala/fasthttp v1.31.0 h1:lrauRLII19afgCs2fnWRJ4M5IkV0lo2FqA61uGkNBfE= +github.com/valyala/fasthttp v1.31.0/go.mod h1:2rsYD01CKFrjjsvFxx75KlEUNpWNBY9JWD3K/7o2Cus= +github.com/valyala/tcplisten v0.0.0-20161114210144-ceec8f93295a/go.mod h1:v3UYOV9WzVtRmSR+PDvWpU/qWl4Wa5LApYYX4ZtKbio= +github.com/valyala/tcplisten v1.0.0 h1:rBHj/Xf+E1tRGZyWIWwJDiRY0zc1Js+CV5DqwacVSA8= +github.com/valyala/tcplisten v1.0.0/go.mod h1:T0xQ8SeCZGxckz9qRXTfG43PvQ/mcWh7FwZEA7Ioqkc= +github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2/go.mod h1:UETIi67q53MR2AWcXfiuqkDkRtnGDLqkBTpCHuJHxtU= github.com/yuin/goldmark v1.1.25/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.1.32/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= @@ -412,9 +547,13 @@ github.com/yuin/gopher-lua v0.0.0-20191220021717-ab39c6098bdb h1:ZkM6LRnq40pR1Ox github.com/yuin/gopher-lua v0.0.0-20191220021717-ab39c6098bdb/go.mod h1:gqRgreBUhTSL0GeU64rtZ3Uq3wtjOa/TB2YfrtkCbVQ= gitlab.snapp.ir/dispatching/snappids/v2 v2.8.0 h1:5BzBqfPB59hEHfHzfU4gcWKfiDBjNWcf68GAUgeRPu4= gitlab.snapp.ir/dispatching/snappids/v2 v2.8.0/go.mod h1:U7lxAuqPifdXkUNcCXhtk9+6HFAyw5qy8LrF1DQDMuQ= +go.etcd.io/bbolt v1.3.3/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU= +go.etcd.io/etcd v0.0.0-20191023171146-3cf2f69b5738/go.mod h1:dnLIgRNXwCJa5e+c6mIZCrds/GIG4ncV9HhK5PX7jPg= go.etcd.io/etcd/api/v3 v3.5.0/go.mod h1:cbVKeC6lCfl7j/8jBhAK6aIYO9XOjdptoxU/nLQcPvs= go.etcd.io/etcd/client/pkg/v3 v3.5.0/go.mod h1:IJHfcCEKxYu1Os13ZdwCwIUTUVGYTSAM3YSwc9/Ac1g= go.etcd.io/etcd/client/v2 v2.305.0/go.mod h1:h9puh54ZTgAKtEbut2oe9P4L/oqKCVB6xsXlzd7alYQ= +go.opencensus.io v0.20.1/go.mod h1:6WKK9ahsWS3RSO+PY9ZHZUfv2irvY6gN279GOPZjmmk= +go.opencensus.io v0.20.2/go.mod h1:6WKK9ahsWS3RSO+PY9ZHZUfv2irvY6gN279GOPZjmmk= go.opencensus.io v0.21.0/go.mod h1:mSImk1erAIZhrmZN+AvHh14ztQfjbGwt4TtuofqLduU= go.opencensus.io v0.22.0/go.mod h1:+kGneAE2xo2IficOXnaByMWTGM9T73dGwxeWcUqIpI8= go.opencensus.io v0.22.2/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= @@ -422,8 +561,8 @@ go.opencensus.io v0.22.3/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= go.opencensus.io v0.22.4/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= go.opencensus.io v0.22.5/go.mod h1:5pWMHQbX5EPX2/62yrJeAkowc+lfs/XD7Uxpq3pI6kk= go.opencensus.io v0.23.0/go.mod h1:XItmlyltB5F7CS4xOC1DcqMoFqwtC6OG2xF7mCv7P7E= -go.opentelemetry.io/proto/otlp v0.7.0/go.mod h1:PqfVotwruBrMGOCsRd/89rSnXhoiJIqeYNgFYFoEGnI= go.uber.org/atomic v1.3.2/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= +go.uber.org/atomic v1.5.0/go.mod h1:sABNBOSYdrvTF6hTgEIbc7YasKWGhgEQZyfxyTvoXHQ= go.uber.org/atomic v1.7.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc= go.uber.org/atomic v1.9.0 h1:ECmE8Bn/WFTYwEW/bpKD3M8VtR/zQVbavAoalC1PYyE= go.uber.org/atomic v1.9.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc= @@ -432,10 +571,13 @@ go.uber.org/automaxprocs v1.4.0/go.mod h1:/mTEdr7LvHhs0v7mjdxDreTz1OG5zdZGqgOnhW go.uber.org/goleak v1.1.11-0.20210813005559-691160354723 h1:sHOAIxRGBp443oHZIPB+HsUGaksVCXVQENPxwTfQdH4= go.uber.org/goleak v1.1.11-0.20210813005559-691160354723/go.mod h1:cwTWslyiVhfpKIDGSZEM2HlOvcqm+tG4zioyIeLoqMQ= go.uber.org/multierr v1.1.0/go.mod h1:wR5kodmAFQ0UK8QlbwjlSNy0Z68gJhDJUG5sjR94q/0= +go.uber.org/multierr v1.3.0/go.mod h1:VgVr7evmIr6uPjLBxg28wmKNXyqE9akIJ5XnfpiKl+4= go.uber.org/multierr v1.6.0/go.mod h1:cdWPpRnG4AhwMwsgIHip0KRBQjJy5kYEpYjJxpXp9iU= go.uber.org/multierr v1.7.0 h1:zaiO/rmgFjbmCXdSYJWQcdvOCsthmdaHfr3Gm2Kx4Ec= go.uber.org/multierr v1.7.0/go.mod h1:7EAYxJLBy9rStEaz58O2t4Uvip6FSURkq8/ppBp95ak= +go.uber.org/tools v0.0.0-20190618225709-2cfd321de3ee/go.mod h1:vJERXedbb3MVM5f9Ejo0C68/HhF8uaILCdgjnY+goOA= go.uber.org/zap v1.10.0/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q= +go.uber.org/zap v1.13.0/go.mod h1:zwrFLgMcdUuIBviXEYEH1YKNaOBnKXsx2IPda5bBwHM= go.uber.org/zap v1.17.0/go.mod h1:MXVU+bhUf/A7Xi2HNOnopQOrmycQ5Ih87HtOu4q5SSo= go.uber.org/zap v1.19.1 h1:ue41HOKd1vGURxrmeKIgELGb3jPW9DMUDGtsinblHwI= go.uber.org/zap v1.19.1/go.mod h1:j3DNczoxDZroyBnOT1L/Q79cfUMGZxlv/9dzN7SM1rI= @@ -444,12 +586,11 @@ golang.org/x/crypto v0.0.0-20181029021203-45a5f77698d3/go.mod h1:6SG95UA2DQfeDnf golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +golang.org/x/crypto v0.0.0-20190701094942-4def268fd1a4/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20190820162420-60c769a6c586/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/crypto v0.0.0-20210711020723-a769d52b0f97/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= -golang.org/x/crypto v0.0.0-20210921155107-089bfa567519 h1:7I4JAnoQBe7ZtJcBaYHi5UtiO8tQHbUSXxL+pnGRANg= -golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= +golang.org/x/crypto v0.0.0-20210513164829-c07d793c2f9a/go.mod h1:P+XmwS30IXTQdn5tA2iutPOUgjI07+tq3H3K9MVA1s8= golang.org/x/crypto v0.0.0-20211115234514-b4de73f9ece8 h1:5QRxNnVsaJP6NAse0UdkRgL3zHMvCRRkrDVLNdNpdy4= golang.org/x/crypto v0.0.0-20211115234514-b4de73f9ece8/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/exp v0.0.0-20180321215751-8460e604b9de/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= @@ -497,7 +638,9 @@ golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73r golang.org/x/net v0.0.0-20181023162649-9b4f9f5ad519/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20181114220301-adae6a3d119a/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20181201002055-351d144fa1fc/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20181220203305-927f97764cc3/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20190125091013-d26f9f9a57f3/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= @@ -508,6 +651,7 @@ golang.org/x/net v0.0.0-20190613194153-d28f0bde5980/go.mod h1:z5CRVTTTmAJ677TzLL golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20190628185345-da137c7871d7/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20190724013045-ca1201d0de80/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20190813141303-74dc4d7220e7/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20191209160850-c0dbc17a3553/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200114155413-6afb5195e5aa/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200202094626-16171245cfb2/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= @@ -523,6 +667,7 @@ golang.org/x/net v0.0.0-20200520182314-0ba52f642ac2/go.mod h1:qpuaurCH72eLCgpAm/ golang.org/x/net v0.0.0-20200625001655-4c5254603344/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= golang.org/x/net v0.0.0-20200707034311-ab3426394381/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= golang.org/x/net v0.0.0-20200822124328-c89045814202/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= +golang.org/x/net v0.0.0-20201016165138-7b1cca2348c0/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= golang.org/x/net v0.0.0-20201031054903-ff519b6c9102/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= golang.org/x/net v0.0.0-20201110031124-69a78807bb2b/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= @@ -532,9 +677,8 @@ golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v golang.org/x/net v0.0.0-20210316092652-d523dce5a7f4/go.mod h1:RBQZq4jEuRlivfhVLdyRGr576XBO4/greRjx4P4O3yc= golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM= golang.org/x/net v0.0.0-20210428140749-89ef3d95e781/go.mod h1:OJAsFXCWl8Ukc7SiCT/9KSuxbyM7479/AVlXFRxuMCk= +golang.org/x/net v0.0.0-20210510120150-4163338589ed/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20210525063256-abc453219eb5/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= -golang.org/x/net v0.0.0-20211015210444-4f30a5c0130f h1:OfiFi4JbukWwe3lzw+xunroH1mnC1e2Gy5cxNJApiSY= -golang.org/x/net v0.0.0-20211015210444-4f30a5c0130f/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2 h1:CIJ76btIcR3eFI5EgSo6k1qKw9KJexJuRLI9G7Hp5wE= golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= @@ -566,10 +710,14 @@ golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5h golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20181026203630-95b1ffbd15a5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20181107165924-66b7b1311ac8/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20181116152217-5ac8a444bdc5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20181122145206-62eef0e2fa9b/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20190129075346-302c3dd5f1cc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190204203706-41f3e6584952/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190312061237-fead79001313/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190403152447-81d4e9dc473e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190422165155-953cdadca894/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190502145724-3ef323f4f1fd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -577,16 +725,16 @@ golang.org/x/sys v0.0.0-20190507160741-ecd444e8653b/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20190606165138-5da285871e9c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190624142023-c5567b49c5d0/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190726091711-fc99dfbffb4e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190813064441-fde4db37ae7a/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190826190057-c7b8b68b1456/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190904154756-749cb33beabd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191001151750-bb3f8db39f24/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191005200804-aed5e4c7ecf9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191120155948-bd437916bb0e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191204072324-ce4227a45e2e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191220142924-d4481acd189f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191228213918-04cbcbbfeed8/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200106162015-b016eb3dc98e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200113162924-86b910548bc1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200116001909-b77594299b42/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200122134326-e047566fdf82/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200202164722-d101bd2416d5/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200212091648-12a6c2dcc1e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -605,6 +753,8 @@ golang.org/x/sys v0.0.0-20200905004654-be1d3432aa8f/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20201201145000-ef89a241ccb3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20201210223839-7e3030f88018/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20201214210602-f9fddec55a1e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210104204734-6f8348627aad/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210112080510-489259a85091/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210119212857-b64e53b001e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -617,18 +767,17 @@ golang.org/x/sys v0.0.0-20210330210617-4fbd30eecc44/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20210403161142-5e06dd20ab57/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20210514084401-e8d321eab015/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210603081109-ebe580a85c40/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20210806184541-e5e7981a1069/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20211015200801-69063c4bb744 h1:KzbpndAYEM+4oHRp9JmB2ewj0NHHxO3Z0g7Gus2O1kk= -golang.org/x/sys v0.0.0-20211015200801-69063c4bb744/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20211013075003-97ac67df715c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20211116061358-0a5406a5449c h1:DHcbWVXeY+0Y8HHKR+rbLwnoh2F4tNCY7rTiHJ30RmA= golang.org/x/sys v0.0.0-20211116061358-0a5406a5449c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +golang.org/x/text v0.3.1-0.20181227161524-e6919f6577db/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.4/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= @@ -636,10 +785,13 @@ golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.7 h1:olpwvP2KacW1ZWvsR7uQhoyTYvKAupfQrRGBFM352Gk= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= +golang.org/x/time v0.0.0-20180412165947-fbb02b2291d2/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= +golang.org/x/tools v0.0.0-20180221164845-07fd8470d635/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20180525024113-a5b4c53f6e8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20180828015842-6cd1fcedba52/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190206041539-40960b6deb8e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= @@ -657,6 +809,8 @@ golang.org/x/tools v0.0.0-20190628153133-6cdbf07be9d0/go.mod h1:/rFqwRUd4F7ZHNgw golang.org/x/tools v0.0.0-20190816200558-6889da9d5479/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20190911174233-4f2ddba30aff/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191012152004-8de300cfc20a/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191029041327-9cc4af7d6b2c/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191029190741-b9c20aec41a5/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191112195655-aa38f8e97acc/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191113191852-77e3bb0ad9e7/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191115202509-3a792d9c32b2/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= @@ -665,6 +819,7 @@ golang.org/x/tools v0.0.0-20191125144606-a911d9008d1f/go.mod h1:b+2E5dAYhXwXZwtn golang.org/x/tools v0.0.0-20191130070609-6e064ea0cf2d/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191216173652-a0e659d51361/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20191227053925-7b8e75db28f4/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200103221440-774c71fcf114/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20200117161641-43d50277825c/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20200122220014-bf1340f18c4a/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20200130002326-2f3ba24bd6e7/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= @@ -703,6 +858,7 @@ gonum.org/v1/gonum v0.0.0-20180816165407-929014505bf4/go.mod h1:Y+Yx5eoAFn32cQvJ gonum.org/v1/gonum v0.8.2/go.mod h1:oe/vMfY3deqTw+1EZJhuvEW2iwGF1bW9wwu7XCu0+v0= gonum.org/v1/netlib v0.0.0-20190313105609-8cb42192e0e0/go.mod h1:wa6Ws7BG/ESfp6dHfk7C6KdzKA7wR7u/rKwOGE66zvw= gonum.org/v1/plot v0.0.0-20190515093506-e2840ee46a6b/go.mod h1:Wt8AAjI+ypCyYX3nZBvf6cAIx93T+c/OS2HFAYskSZc= +google.golang.org/api v0.3.1/go.mod h1:6wY9I6uQWHQ8EM57III9mq/AjF+i8G65rmVagqKMtkk= google.golang.org/api v0.4.0/go.mod h1:8k5glujaEP+g9n7WNsDg8QP6cUVNI86fCNMcbazEtwE= google.golang.org/api v0.7.0/go.mod h1:WtwebWUNSVBH/HAw79HIFXZNqEvBhG+Ra+ax0hx3E3M= google.golang.org/api v0.8.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg= @@ -726,6 +882,7 @@ google.golang.org/api v0.41.0/go.mod h1:RkxM5lITDfTzmyKFPt+wGrCJbVfniCr2ool8kTBz google.golang.org/api v0.43.0/go.mod h1:nQsDGjRXMo4lvh5hP0TKqF244gqhGcr/YSIykhUk/94= google.golang.org/api v0.44.0/go.mod h1:EBOGZqzyhtvMDoxwS97ctnh0zUmYY6CxqXsc1AvkYD8= google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= +google.golang.org/appengine v1.2.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= google.golang.org/appengine v1.5.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= google.golang.org/appengine v1.6.1/go.mod h1:i06prIuMbXzDqacNJfV5OdTW448YApPu5ww/cMBSeb0= @@ -734,9 +891,11 @@ google.golang.org/appengine v1.6.6/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCID google.golang.org/appengine v1.6.7/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= google.golang.org/genproto v0.0.0-20190307195333-5fe7a883aa19/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= +google.golang.org/genproto v0.0.0-20190404172233-64821d5d2107/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= google.golang.org/genproto v0.0.0-20190418145605-e7d98fc518a7/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= google.golang.org/genproto v0.0.0-20190425155659-357c62f0e4bb/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= google.golang.org/genproto v0.0.0-20190502173448-54afdca5d873/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= +google.golang.org/genproto v0.0.0-20190530194941-fb225487d101/go.mod h1:z3L6/3dTEVtUr6QSP8miRzeRqwQOioJ9I66odjN4I7s= google.golang.org/genproto v0.0.0-20190801165951-fa694d86fc64/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= google.golang.org/genproto v0.0.0-20190911173649-1774047e7e51/go.mod h1:IbNlFCBrqXvoKpeg0TB2l7cyZUmoaFKYIwrEpbDKLA8= @@ -773,14 +932,17 @@ google.golang.org/genproto v0.0.0-20210310155132-4ce2db91004e/go.mod h1:FWY/as6D google.golang.org/genproto v0.0.0-20210319143718-93e7006c17a6/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20210402141018-6c239bbf2bb1/go.mod h1:9lPAdzaEmUacj36I+k7YKbEc5CXzPIeORRgDAUOu28A= google.golang.org/genproto v0.0.0-20210602131652-f16073e35f0c/go.mod h1:UODoCrxHCcBojKKwX1terBiRUaqAsFqJiF615XL43r0= -google.golang.org/genproto v0.0.0-20211016002631-37fc39342514 h1:Rp1vYDPD4TdkMH5S/bZbopsGCsWhPcrLBUwOVhAQCxM= -google.golang.org/genproto v0.0.0-20211016002631-37fc39342514/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= -google.golang.org/genproto v0.0.0-20211115160612-a5da7257a6f7 h1:0LoCYJF53PEqtJOntKxGD72X/c8Xto5EZ4HLrt9D80I= -google.golang.org/genproto v0.0.0-20211115160612-a5da7257a6f7/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= +google.golang.org/grpc v1.14.0/go.mod h1:yo6s7OP7yaDglbqo1J04qKzAhqBH6lvTonzMVmEdcZw= +google.golang.org/grpc v1.17.0/go.mod h1:6QZJwpn2B+Zp71q/5VxRsJ6NXXVCE5NRUHRo+f3cWCs= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= +google.golang.org/grpc v1.20.0/go.mod h1:chYK+tFQF0nDUGJgXMSgLCQk3phJEuONr2DCgLDdAQM= google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38= +google.golang.org/grpc v1.21.0/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= google.golang.org/grpc v1.21.1/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= +google.golang.org/grpc v1.22.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= +google.golang.org/grpc v1.22.1/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= +google.golang.org/grpc v1.23.1/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQciAY= google.golang.org/grpc v1.26.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= @@ -797,11 +959,6 @@ google.golang.org/grpc v1.35.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAG google.golang.org/grpc v1.36.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= google.golang.org/grpc v1.36.1/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= google.golang.org/grpc v1.38.0/go.mod h1:NREThFqKR1f3iQ6oBuvc5LadQuXVGo9rkm5ZGrQdJfM= -google.golang.org/grpc v1.40.0/go.mod h1:ogyxbiOoUXAkP+4+xa6PZSE9DZgIHtSpzjDTB9KAK34= -google.golang.org/grpc v1.41.0 h1:f+PlOh7QV4iIJkPrx5NQ7qaNGFQ3OTse67yaDHfju4E= -google.golang.org/grpc v1.41.0/go.mod h1:U3l9uK9J0sini8mHphKoXyaqDA/8VyGnDee1zzIUK6k= -google.golang.org/grpc v1.42.0 h1:XT2/MFpuPFsEX2fWh3YQtHkZ+WYZFQRfaUgLZYj/p6A= -google.golang.org/grpc v1.42.0/go.mod h1:k+4IHHFw41K8+bbowsex27ge2rCb65oeWqe4jJ590SU= 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= @@ -817,19 +974,24 @@ google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQ google.golang.org/protobuf v1.27.1 h1:SnqbnDw1V7RiZcXPx5MEeqPv2s79L9i7BJUlG/+RurQ= google.golang.org/protobuf v1.27.1/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= +gopkg.in/asn1-ber.v1 v1.0.0-20181015200546-f715ec2f112d/go.mod h1:cuepJuh7vyXfUyUwEgHQXw849cJrilpS5NeIjOWESAw= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= +gopkg.in/cheggaaa/pb.v1 v1.0.25/go.mod h1:V/YB90LKu/1FcN3WVnfiiE5oMCibMjukxqG/qStrOgw= gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys= -gopkg.in/go-playground/assert.v1 v1.2.1/go.mod h1:9RXL0bg/zibRAgZUYszZSwO/z8Y/a8bDuhia5mkpMnE= -gopkg.in/go-playground/validator.v9 v9.29.1/go.mod h1:+c9/zcJMFNgbLvly1L1V+PpxWdVbfP1avr/N00E2vyQ= +gopkg.in/gcfg.v1 v1.2.3/go.mod h1:yesOnuUOFQAhST5vPY4nbZsb/huCgGGXlipJsBn0b3o= gopkg.in/ini.v1 v1.62.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= +gopkg.in/resty.v1 v1.12.0/go.mod h1:mDo4pnntr5jdWRML875a/NmxYqAlA73dVijT2AXvQQo= +gopkg.in/square/go-jose.v2 v2.3.1/go.mod h1:M9dMgbHiYLoDGQrXy7OpJDJWiKiU//h+vD76mk0e1AI= gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 h1:uRGJdciOHaEIrze2W8Q3AKkepLTh2hOroT7a+7czfdQ= gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw= +gopkg.in/warnings.v0 v0.1.2/go.mod h1:jksf8JmL6Qr/oQM2OXTHunEvvTAsrWBLb6OOjuVWRNI= +gopkg.in/yaml.v2 v2.0.0-20170812160011-eb3733d160e7/go.mod h1:JAlM8MvJe8wmxCU4Bli9HhUf9+ttbYbLASfIpnQbh74= gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.3/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= @@ -842,6 +1004,7 @@ gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b h1:h8qDotaEPuJATrMmW04NCwg7v22aHH28wwpauUhK9Oo= gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +honnef.co/go/tools v0.0.0-20180728063816-88497007e858/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190106161140-3f1c8253044a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190418001031-e561f6794a2a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= @@ -853,3 +1016,5 @@ rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8 rsc.io/pdf v0.1.1/go.mod h1:n8OzWcQ6Sp37PL01nO98y4iUCRdTGarVfzxY20ICaU4= rsc.io/quote/v3 v3.1.0/go.mod h1:yEA65RcK8LyAZtP9Kv3t0HmxON59tX3rD+tICJqUlj0= rsc.io/sampler v1.3.0/go.mod h1:T1hPZKmBbMNahiBKFy5HrXp6adAjACjK9JXDnKaTXpA= +sigs.k8s.io/yaml v1.1.0/go.mod h1:UJmg0vDUVViEyp3mgSv9WPwZCDxu4rQW1olrI1uml+o= +sourcegraph.com/sourcegraph/appdash v0.0.0-20190731080439-ebfcffb1b5c0/go.mod h1:hI742Nqp5OhwiqlzhgfbWU4mW4yO10fP+LoT9WOswdU= From 374df0baacea6f5e2de73bf92881966c1d777ab0 Mon Sep 17 00:00:00 2001 From: Parham Alvani Date: Tue, 16 Nov 2021 23:59:49 +0330 Subject: [PATCH 057/660] feat: use gofiber --- internal/api/acl.go | 46 ++++++++++++++++---------------------------- internal/api/api.go | 42 +++++++++++++++------------------------- internal/api/auth.go | 21 ++++++++------------ 3 files changed, 40 insertions(+), 69 deletions(-) diff --git a/internal/api/acl.go b/internal/api/acl.go index 8c2b473b..001ca11a 100644 --- a/internal/api/acl.go +++ b/internal/api/acl.go @@ -5,12 +5,11 @@ import ( "net/http" "time" - "github.com/gin-gonic/gin" + "github.com/gofiber/fiber/v2" "github.com/opentracing/opentracing-go" "gitlab.snapp.ir/dispatching/soteria/v3/internal" "gitlab.snapp.ir/dispatching/soteria/v3/internal/app" "gitlab.snapp.ir/dispatching/soteria/v3/internal/authenticator" - "gitlab.snapp.ir/dispatching/soteria/v3/internal/db" "gitlab.snapp.ir/dispatching/soteria/v3/internal/topics" "gitlab.snapp.ir/dispatching/soteria/v3/pkg/acl" "go.uber.org/zap" @@ -26,15 +25,14 @@ type aclRequest struct { } // ACL is the handler responsible for ACL requests. -func ACL(ctx *gin.Context) { +func ACL(c *fiber.Ctx) error { aclSpan := app.GetInstance().Tracer.StartSpan("api.rest.acl") defer aclSpan.Finish() s := time.Now() - request := &aclRequest{} - err := ctx.ShouldBind(request) - if err != nil { + request := new(aclRequest) + if err := c.BodyParser(request); err != nil { zap.L(). Warn("acl bad request", zap.Error(err), @@ -48,23 +46,26 @@ func ACL(ctx *gin.Context) { app.GetInstance().Metrics.ObserveStatusCode(internal.HttpApi, internal.Soteria, internal.Acl, http.StatusBadRequest) app.GetInstance().Metrics.ObserveStatus(internal.HttpApi, internal.Soteria, internal.Acl, internal.Failure, "bad request") app.GetInstance().Metrics.ObserveResponseTime(internal.HttpApi, internal.Soteria, internal.Acl, float64(time.Since(s).Nanoseconds())) - ctx.String(http.StatusBadRequest, "bad request") - return + + return c.Status(http.StatusBadRequest).SendString("bad request") } + tokenString := request.Token + if len(request.Token) == 0 { tokenString = request.Username } + if len(tokenString) == 0 { tokenString = request.Password } topic := topics.Topic(request.Topic) topicType := topic.GetType() + if len(topicType) == 0 { zap.L(). Warn("acl bad request", - zap.Error(err), zap.String("access", request.Access.String()), zap.String("topic", request.Topic), zap.String("token", request.Token), @@ -75,15 +76,17 @@ func ACL(ctx *gin.Context) { app.GetInstance().Metrics.ObserveStatusCode(internal.HttpApi, internal.Soteria, internal.Acl, http.StatusBadRequest) app.GetInstance().Metrics.ObserveStatus(internal.HttpApi, internal.Soteria, internal.Acl, internal.Failure, "bad request") app.GetInstance().Metrics.ObserveResponseTime(internal.HttpApi, internal.Soteria, internal.Acl, float64(time.Since(s).Nanoseconds())) - ctx.String(http.StatusBadRequest, "bad request") - return + + return c.Status(http.StatusBadRequest).SendString("bad request") } aclCheckSpan := app.GetInstance().Tracer.StartSpan("acl check", opentracing.ChildOf(aclSpan.Context())) + defer aclCheckSpan.Finish() - ok, err := app.GetInstance().Authenticator.ACL(ctx, request.Access, tokenString, topic) + ok, err := app.GetInstance().Authenticator.ACL(request.Access, tokenString, topic) if err != nil || !ok { aclCheckSpan.SetTag("success", false) + if err != nil { aclCheckSpan.SetTag("error", err.Error()) } @@ -99,27 +102,12 @@ func ACL(ctx *gin.Context) { zap.Error(err)) } - if errors.Is(err, db.ErrDb) { - app.GetInstance().Metrics.ObserveStatusCode(internal.HttpApi, internal.Soteria, internal.Acl, http.StatusInternalServerError) - app.GetInstance().Metrics.ObserveStatus(internal.HttpApi, internal.Soteria, request.Access.String(), internal.Failure, string(topicType)) - app.GetInstance().Metrics.ObserveStatus(internal.HttpApi, internal.Soteria, internal.Acl, internal.Failure, "database error happened") - app.GetInstance().Metrics.ObserveResponseTime(internal.HttpApi, internal.Soteria, internal.Acl, float64(time.Since(s).Nanoseconds())) - ctx.String(http.StatusInternalServerError, "internal server error") - - aclCheckSpan.Finish() - - return - } - app.GetInstance().Metrics.ObserveStatusCode(internal.HttpApi, internal.Soteria, internal.Acl, http.StatusUnauthorized) app.GetInstance().Metrics.ObserveStatus(internal.HttpApi, internal.Soteria, request.Access.String(), internal.Failure, string(topicType)) app.GetInstance().Metrics.ObserveStatus(internal.HttpApi, internal.Soteria, internal.Acl, internal.Failure, "request is not authorized") app.GetInstance().Metrics.ObserveResponseTime(internal.HttpApi, internal.Soteria, internal.Acl, float64(time.Since(s).Nanoseconds())) - ctx.String(http.StatusUnauthorized, "request is not authorized") - - aclCheckSpan.Finish() - return + return c.Status(http.StatusUnauthorized).SendString("request is not authorized") } zap.L(). @@ -138,5 +126,5 @@ func ACL(ctx *gin.Context) { aclCheckSpan.SetTag("success", true) - ctx.String(http.StatusOK, "ok") + return c.Status(http.StatusOK).SendString("ok") } diff --git a/internal/api/api.go b/internal/api/api.go index 899c5b04..b53d2c08 100644 --- a/internal/api/api.go +++ b/internal/api/api.go @@ -1,38 +1,26 @@ package api import ( - "fmt" - "net/http" - "time" - - ginzap "github.com/gin-contrib/zap" - "github.com/gin-gonic/gin" - "github.com/prometheus/client_golang/prometheus/promhttp" + "github.com/ansrivas/fiberprometheus/v2" + "github.com/gofiber/contrib/fiberzap" + "github.com/gofiber/fiber/v2" "go.uber.org/zap" ) -// setupRouter will attach all routes needed for Soteria to gin's default router -func setupRouter(mode string) *gin.Engine { - gin.SetMode(mode) - - router := gin.New() - router.Use(gin.Recovery()) +// ReSTServer will return an HTTP.Server with given port and gin mode +func ReSTServer() *fiber.App { + app := fiber.New() - router.Use(ginzap.Ginzap(zap.L(), time.RFC3339, false)) - router.Use(ginzap.RecoveryWithZap(zap.L(), true)) + app.Use(fiberzap.New(fiberzap.Config{ + Logger: zap.L(), + })) - router.POST("/auth", Auth) - router.POST("/acl", ACL) + app.Post("/auth", Auth) + app.Post("/acl", ACL) - router.GET("/metrics", gin.WrapH(promhttp.Handler())) - - return router -} + prometheus := fiberprometheus.NewWith("soteria", "dispatching", "http") + prometheus.RegisterAt(app, "/metrics") + app.Use(prometheus.Middleware) -// RestServer will return an HTTP.Server with given port and gin mode -func RestServer(mode string, port int) *http.Server { - return &http.Server{ - Addr: fmt.Sprintf(":%d", port), - Handler: setupRouter(mode), - } + return app } diff --git a/internal/api/auth.go b/internal/api/auth.go index 376b91da..afffe13b 100644 --- a/internal/api/auth.go +++ b/internal/api/auth.go @@ -4,7 +4,7 @@ import ( "net/http" "time" - "github.com/gin-gonic/gin" + "github.com/gofiber/fiber/v2" "github.com/opentracing/opentracing-go" "gitlab.snapp.ir/dispatching/soteria/v3/internal" "gitlab.snapp.ir/dispatching/soteria/v3/internal/app" @@ -21,15 +21,13 @@ type authRequest struct { } // Auth is the handler responsible for authentication. -// it will returns "ignore" for superusers to pass them to redis. -func Auth(ctx *gin.Context) { +func Auth(c *fiber.Ctx) error { authSpan := app.GetInstance().Tracer.StartSpan("api.rest.auth") defer authSpan.Finish() s := time.Now() request := &authRequest{} - err := ctx.ShouldBind(request) - if err != nil { + if err := c.BodyParser(request); err != nil { zap.L(). Warn("bad request", zap.Error(err), @@ -37,9 +35,8 @@ func Auth(ctx *gin.Context) { app.GetInstance().Metrics.ObserveStatusCode(internal.HttpApi, internal.Soteria, internal.Auth, http.StatusBadRequest) app.GetInstance().Metrics.ObserveStatus(internal.HttpApi, internal.Soteria, internal.Auth, internal.Failure, "bad request") app.GetInstance().Metrics.ObserveResponseTime(internal.HttpApi, internal.Soteria, internal.Auth, float64(time.Since(s).Nanoseconds())) - ctx.String(http.StatusBadRequest, "bad request") - return + return c.Status(http.StatusBadRequest).SendString("bad request") } tokenString := request.Token @@ -52,8 +49,9 @@ func Auth(ctx *gin.Context) { } authCheckSpan := app.GetInstance().Tracer.StartSpan("auth check", opentracing.ChildOf(authSpan.Context())) + defer authCheckSpan.Finish() - if err := app.GetInstance().Authenticator.Auth(ctx, tokenString); err != nil { + if err := app.GetInstance().Authenticator.Auth(tokenString); err != nil { authCheckSpan.SetTag("success", false) authCheckSpan.SetTag("error", err.Error()) @@ -68,11 +66,8 @@ func Auth(ctx *gin.Context) { app.GetInstance().Metrics.ObserveStatusCode(internal.HttpApi, internal.Soteria, internal.Auth, http.StatusUnauthorized) app.GetInstance().Metrics.ObserveStatus(internal.HttpApi, internal.Soteria, internal.Auth, internal.Failure, "request is not authorized") app.GetInstance().Metrics.ObserveResponseTime(internal.HttpApi, internal.Soteria, internal.Auth, float64(time.Since(s).Nanoseconds())) - ctx.String(http.StatusUnauthorized, "request is not authorized") - authCheckSpan.Finish() - - return + return c.Status(http.StatusUnauthorized).SendString("request is not authorized") } zap.L(). @@ -88,5 +83,5 @@ func Auth(ctx *gin.Context) { authSpan.SetTag("success", true) - ctx.String(http.StatusOK, "ok") + return c.Status(http.StatusOK).SendString("ok") } From 12f8ee5b2df22e62bc5bef3088f4d98b0cc0511d Mon Sep 17 00:00:00 2001 From: Parham Alvani Date: Wed, 17 Nov 2021 00:00:12 +0330 Subject: [PATCH 058/660] feat: remove unused commands --- internal/commands/accounts/accounts.go | 17 -- internal/commands/accounts/init.go | 69 -------- internal/commands/serve.go | 96 ++-------- internal/commands/token.go | 231 ------------------------- 4 files changed, 13 insertions(+), 400 deletions(-) delete mode 100644 internal/commands/accounts/accounts.go delete mode 100644 internal/commands/accounts/init.go delete mode 100644 internal/commands/token.go diff --git a/internal/commands/accounts/accounts.go b/internal/commands/accounts/accounts.go deleted file mode 100644 index 7ae75234..00000000 --- a/internal/commands/accounts/accounts.go +++ /dev/null @@ -1,17 +0,0 @@ -package accounts - -import ( - "fmt" - "github.com/spf13/cobra" -) - -var Accounts = &cobra.Command{ - Use: "accounts", - Short: "Soteria account management", - Long: `accounts is used to manage all operations related to accounts`, - Run: accountsRun, -} - -func accountsRun(cmd *cobra.Command, args []string) { - fmt.Println("run `soteria accounts --help` to see available options") -} diff --git a/internal/commands/accounts/init.go b/internal/commands/accounts/init.go deleted file mode 100644 index bf4fd81f..00000000 --- a/internal/commands/accounts/init.go +++ /dev/null @@ -1,69 +0,0 @@ -package accounts - -import ( - "encoding/json" - "fmt" - "io/ioutil" - - "github.com/spf13/cobra" - "gitlab.snapp.ir/dispatching/soteria/v3/internal/accounts" - "gitlab.snapp.ir/dispatching/soteria/v3/internal/app" - "gitlab.snapp.ir/dispatching/soteria/v3/internal/config" - "gitlab.snapp.ir/dispatching/soteria/v3/internal/db/redis" - "gitlab.snapp.ir/dispatching/soteria/v3/pkg/user" - "golang.org/x/crypto/bcrypt" -) - -var Init = &cobra.Command{ - Use: "init [json file]", - Short: "init accounts data from a json file", - Long: `init is used to set all accounts data from a json file `, - Args: cobra.ExactArgs(1), - PreRunE: initPreRun, - RunE: initRun, -} - -func initPreRun(cmd *cobra.Command, args []string) error { - cfg := config.InitConfig() - - rClient, err := redis.NewRedisClient(cfg.Redis) - if err != nil { - return fmt.Errorf("could not init redis: %w", err) - } - - app.GetInstance().SetAccountsService(&accounts.Service{ - Handler: redis.ModelHandler{ - Client: rClient, - }, - }) - - return nil -} - -func initRun(cmd *cobra.Command, args []string) error { - file := args[0] - - raw, err := ioutil.ReadFile(file) - if err != nil { - return fmt.Errorf("failed to read file: %w", err) - } - - var users []user.User - if err := json.Unmarshal(raw, &users); err != nil { - return fmt.Errorf("failed to unmarshal data: %w", err) - } - - for _, u := range users { - hash, err := bcrypt.GenerateFromPassword([]byte(u.Password), bcrypt.DefaultCost) - if err != nil { - return fmt.Errorf("failed to generate hash for %s, %w", u.Username, err) - } - u.Password = string(hash) - - if err := app.GetInstance().AccountsService.Handler.Save(cmd.Context(), u); err != nil { - return fmt.Errorf("failed to import user %s: %w", u.Username, err) - } - } - - return nil -} diff --git a/internal/commands/serve.go b/internal/commands/serve.go index fd1ec8f2..86f8b356 100644 --- a/internal/commands/serve.go +++ b/internal/commands/serve.go @@ -1,37 +1,26 @@ package commands import ( - "context" "crypto/rsa" "errors" "fmt" - "net" "net/http" "os" "os/signal" - "github.com/patrickmn/go-cache" "github.com/spf13/cobra" "gitlab.snapp.ir/dispatching/snappids/v2" - "gitlab.snapp.ir/dispatching/soteria/v3/internal/accounts" + "gitlab.snapp.ir/dispatching/soteria/v3/internal/api" "gitlab.snapp.ir/dispatching/soteria/v3/internal/app" "gitlab.snapp.ir/dispatching/soteria/v3/internal/authenticator" "gitlab.snapp.ir/dispatching/soteria/v3/internal/config" "gitlab.snapp.ir/dispatching/soteria/v3/internal/db" - "gitlab.snapp.ir/dispatching/soteria/v3/internal/db/cachedredis" - "gitlab.snapp.ir/dispatching/soteria/v3/internal/db/redis" - "gitlab.snapp.ir/dispatching/soteria/v3/internal/emq" "gitlab.snapp.ir/dispatching/soteria/v3/internal/metrics" - "gitlab.snapp.ir/dispatching/soteria/v3/internal/web/grpc" - "gitlab.snapp.ir/dispatching/soteria/v3/internal/web/rest/api" - "gitlab.snapp.ir/dispatching/soteria/v3/pkg" "gitlab.snapp.ir/dispatching/soteria/v3/pkg/log" - "gitlab.snapp.ir/dispatching/soteria/v3/pkg/memoize" "gitlab.snapp.ir/dispatching/soteria/v3/pkg/tracer" "gitlab.snapp.ir/dispatching/soteria/v3/pkg/user" _ "go.uber.org/automaxprocs" "go.uber.org/zap" - grpcLib "google.golang.org/grpc" ) var Serve = &cobra.Command{ @@ -42,30 +31,13 @@ var Serve = &cobra.Command{ Run: serveRun, } -var cfg config.AppConfig +var cfg config.Config func servePreRun(cmd *cobra.Command, args []string) { - cfg = config.InitConfig() + cfg = config.New() log.InitLogger() log.SetLevel(cfg.Logger.Level) - zap.L().Debug("config init successfully", - zap.String("cache_config", pkg.PrettifyStruct(cfg.Cache)), - zap.String("redis_config", pkg.PrettifyStruct(cfg.Redis)), - zap.String("logger_config", pkg.PrettifyStruct(cfg.Logger)), - zap.String("jwt_keys_path", cfg.Jwt.KeysPath), - zap.String("allowed_access_types", fmt.Sprintf("%v", cfg.AllowedAccessTypes))) - - privateKey100, err := cfg.ReadPrivateKey(user.ThirdParty) - if err != nil { - zap.L().Fatal("could not read third party private key") - } - - publicKey100, err := cfg.ReadPublicKey(user.ThirdParty) - if err != nil { - zap.L().Fatal("could not read third party public key") - } - publicKey0, err := cfg.ReadPublicKey(user.Driver) if err != nil { zap.L().Fatal("could not read driver public key") @@ -94,50 +66,23 @@ func servePreRun(cmd *cobra.Command, args []string) { app.GetInstance().SetTracer(trc, cl) - rClient, err := redis.NewRedisClient(cfg.Redis) - if err != nil { - zap.L().Fatal("could not create redis client", zap.Error(err)) - } - - redisModelHandler := &redis.ModelHandler{Client: rClient} - var modelHandler db.ModelHandler - if cfg.Cache.Enabled { - modelHandler = cachedredis.NewCachedRedisModelHandler(redisModelHandler, - cache.New(cfg.Cache.Expiration, cache.NoExpiration), - ) - } else { - modelHandler = redisModelHandler - } - - app.GetInstance().SetAccountsService(&accounts.Service{ - Handler: modelHandler, - }) - - store := emq.Store{Client: rClient} - app.GetInstance().SetEMQStore(store) allowedAccessTypes, err := cfg.GetAllowedAccessTypes() if err != nil { zap.L().Fatal("error while getting allowed access types", zap.Error(err)) } - memoizedCompareHashAndPassword := memoize.MemoizedCompareHashAndPassword() app.GetInstance().SetAuthenticator(&authenticator.Authenticator{ - PrivateKeys: map[user.Issuer]*rsa.PrivateKey{ - user.ThirdParty: privateKey100, - }, PublicKeys: map[user.Issuer]*rsa.PublicKey{ - user.Driver: publicKey0, - user.Passenger: publicKey1, - user.ThirdParty: publicKey100, + user.Driver: publicKey0, + user.Passenger: publicKey1, }, - AllowedAccessTypes: allowedAccessTypes, - ModelHandler: modelHandler, - HashIDSManager: hid, - EMQTopicManager: snappids.NewEMQManagerWithCompany(hid, cfg.Company), - CompareHashAndPassword: memoizedCompareHashAndPassword, - Company: cfg.Company, + AllowedAccessTypes: allowedAccessTypes, + ModelHandler: modelHandler, + HashIDSManager: hid, + EMQTopicManager: snappids.NewEMQManagerWithCompany(hid, cfg.Company), + Company: cfg.Company, }) m := metrics.NewMetrics() @@ -145,37 +90,22 @@ func servePreRun(cmd *cobra.Command, args []string) { } func serveRun(cmd *cobra.Command, args []string) { - rest := api.RestServer(cfg.Mode, cfg.HttpPort) - - gListen, err := net.Listen("tcp", fmt.Sprintf(":%d", cfg.GrpcPort)) - if err != nil { - zap.L().Fatal("failed to listen", zap.Int("port", cfg.GrpcPort), zap.Error(err)) - } - - grpcServer := grpc.NewServer() + rest := api.ReSTServer() go func() { - if err := rest.ListenAndServe(); err != nil && !errors.Is(err, http.ErrServerClosed) { + if err := rest.Listen(fmt.Sprintf(":%d", cfg.HTTPPort)); err != nil && !errors.Is(err, http.ErrServerClosed) { zap.L().Fatal("failed to run REST HTTP server", zap.Error(err)) } }() - go func() { - if err := grpcServer.Serve(gListen); err != nil && !errors.Is(err, grpcLib.ErrServerStopped) { - zap.L().Fatal("failed to run GRPC server", zap.Error(err)) - } - }() - c := make(chan os.Signal, 1) signal.Notify(c, os.Interrupt) <-c - if err := rest.Shutdown(context.Background()); err != nil { + if err := rest.Shutdown(); err != nil { zap.L().Error("error happened during REST API shutdown", zap.Error(err)) } - grpcServer.Stop() - if err := app.GetInstance().TracerCloser.Close(); err != nil { zap.L().Error("error happened while closing tracer", zap.Error(err)) } diff --git a/internal/commands/token.go b/internal/commands/token.go deleted file mode 100644 index 02255435..00000000 --- a/internal/commands/token.go +++ /dev/null @@ -1,231 +0,0 @@ -package commands - -import ( - "bufio" - "crypto/rsa" - "errors" - "fmt" - "os" - "time" - - "github.com/spf13/cobra" - "gitlab.snapp.ir/dispatching/soteria/v3/internal/app" - "gitlab.snapp.ir/dispatching/soteria/v3/internal/authenticator" - "gitlab.snapp.ir/dispatching/soteria/v3/internal/config" - "gitlab.snapp.ir/dispatching/soteria/v3/internal/db/redis" - "gitlab.snapp.ir/dispatching/soteria/v3/internal/emq" - "gitlab.snapp.ir/dispatching/soteria/v3/internal/topics" - "gitlab.snapp.ir/dispatching/soteria/v3/pkg/acl" - "gitlab.snapp.ir/dispatching/soteria/v3/pkg/user" -) - -var ( - ErrInvalidToken = errors.New("invalid token type") - ErrNoToken = errors.New("must be at least one token type") -) - -type ErrInvalidInput struct { - Message string -} - -func (err ErrInvalidInput) Error() string { - return fmt.Sprintf("invalid input. %s", err.Message) -} - -var Token = &cobra.Command{ - Use: "token", - Short: "token issues token based on type of user", - Args: func(cmd *cobra.Command, args []string) error { - if len(args) < 1 { - return ErrNoToken - } - - t := args[0] - if t == "herald" || t == "superuser" { - return nil - } - - return ErrInvalidInput{Message: fmt.Sprintf("token with type %s is not valid", t)} - }, - RunE: func(cmd *cobra.Command, args []string) error { - config := config.InitConfig() - - pk100, err := config.ReadPrivateKey(user.ThirdParty) - if err != nil { - return fmt.Errorf("cannot load private keys %w", err) - } - - // nolint: exhaustivestruct - app.GetInstance().SetAuthenticator(&authenticator.Authenticator{ - PrivateKeys: map[user.Issuer]*rsa.PrivateKey{ - user.ThirdParty: pk100, - }, - }) - - switch args[0] { - case "herald": - return heraldToken(cmd, args) - case "superuser": - return superuserToken(config, cmd, args) - default: - return ErrInvalidToken - } - }, -} - -func heraldToken(cmd *cobra.Command, args []string) error { - r := bufio.NewScanner(os.Stdin) - - cmd.Print("username? >>> ") - r.Scan() - username := r.Text() - - cmd.Print("duration? (in hours) >>> ") - r.Scan() - duration, err := time.ParseDuration(fmt.Sprintf("%sh", r.Text())) - if err != nil { - return fmt.Errorf("cannot parse duration %w", err) - } - - var ( - allowedTopics []acl.Topic - allowedEndpoints []acl.Endpoint - ) - - heraldEndpoints := map[string]string{ - "1": "/event", - "2": "/events", - "3": "/notification", - } - topicTypes := map[string]topics.Type{ - "1": topics.CabEvent, - "2": topics.BoxEvent, - "3": topics.SuperappEvent, - "4": topics.DriverLocation, - "5": topics.PassengerLocation, - "6": topics.SharedLocation, - "7": topics.Chat, - "8": topics.CallEntry, - "9": topics.CallOutgoing, - } - accessTypes := map[string]acl.AccessType{ - "1": acl.Sub, - "2": acl.Pub, - "3": acl.PubSub, - } - - for { - cmd.Println("do you want to give permissions? [y/n]") - cmd.Print(">>> ") - r.Scan() - - switch r.Text() { - case "n": - token, err := app.GetInstance().Authenticator.HeraldToken(username, allowedEndpoints, allowedTopics, duration) - if err != nil { - return fmt.Errorf("token creation failed %w", err) - } - - cmd.Println(token) - - return nil - case "y": - cmd.Println("which one do you want to grant access to? \n\t1. topic\n\t2. endpoint") - cmd.Print(">>> ") - r.Scan() - - switch r.Text() { - case "1": - cmd.Println("which topic do you want to grant access to?\n" + - "\t1. Snapp Cab Events" + - "\t2. Snapp Box Events" + - "\t3. Snapp Super App Events" + - "\t4. Snapp Driver Locations") - cmd.Print(">>> ") - r.Scan() - topicType, ok := topicTypes[r.Text()] - if !ok { - return ErrInvalidInput{Message: "selected topic does not exist"} - } - - cmd.Println("which access type do you want to grant?\n" + - "\t1. Subscribe" + - "\t2. Publish" + - "\t3. Publish-Subscribe") - cmd.Print(">>> ") - r.Scan() - at, ok := accessTypes[r.Text()] - if !ok { - return ErrInvalidInput{Message: "invalid input. selected access type does not exist"} - } - topic := acl.Topic{ - Type: topicType, - AccessType: at, - } - allowedTopics = append(allowedTopics, topic) - case "2": - cmd.Println("which endpoint do you want to grant access to?\n" + - "\t1. event" + - "\t2. events" + - "\t3. notification") - cmd.Print(">>> ") - r.Scan() - endpoint, ok := heraldEndpoints[r.Text()] - if !ok { - return ErrInvalidInput{Message: "invalid input. selected endpoint does not exist"} - } - e := acl.Endpoint{Name: endpoint} - allowedEndpoints = append(allowedEndpoints, e) - default: - return ErrInvalidInput{Message: ""} - } - default: - return ErrInvalidInput{Message: "you should enter y or n"} - } - } -} - -func superuserToken(config config.AppConfig, cmd *cobra.Command, _ []string) error { - cli, err := redis.NewRedisClient(config.Redis) - if err != nil { - return fmt.Errorf("redis connection failed %w", err) - } - - app.GetInstance().SetEMQStore(emq.Store{ - Client: cli, - }) - - r := bufio.NewScanner(os.Stdin) - - cmd.Print("username? >>> ") - r.Scan() - username := r.Text() - - cmd.Print("duration? (in hours) >>> ") - r.Scan() - duration, err := time.ParseDuration(fmt.Sprintf("%sh", r.Text())) - if err != nil { - return fmt.Errorf("cannot parse duration %w", err) - } - - cmd.Print("password? >>> ") - r.Scan() - password := r.Text() - - token, err := app.GetInstance().Authenticator.SuperuserToken(username, duration) - if err != nil { - return fmt.Errorf("token creation failed %w", err) - } - - if err := app.GetInstance().EMQStore.Save(cmd.Context(), emq.User{ - Username: token, - Password: password, - IsSuperuser: true, - }); err != nil { - return fmt.Errorf("cannot save token to redis %w", err) - } - - cmd.Println(token) - - return nil -} From b2e7fa9212effad4b79fcb1efa846b639e3764ff Mon Sep 17 00:00:00 2001 From: Parham Alvani Date: Wed, 17 Nov 2021 00:00:27 +0330 Subject: [PATCH 059/660] feat: complete without redis --- internal/app/a.go | 35 +- internal/authenticator/authenticator.go | 175 ++------ internal/authenticator/authenticator_test.go | 418 ++++--------------- internal/config/default.go | 76 +++- 4 files changed, 181 insertions(+), 523 deletions(-) diff --git a/internal/app/a.go b/internal/app/a.go index 761ecb9a..c553be09 100644 --- a/internal/app/a.go +++ b/internal/app/a.go @@ -5,51 +5,40 @@ import ( "sync" "github.com/opentracing/opentracing-go" - "gitlab.snapp.ir/dispatching/soteria/v3/internal/accounts" "gitlab.snapp.ir/dispatching/soteria/v3/internal/authenticator" - "gitlab.snapp.ir/dispatching/soteria/v3/internal/emq" "gitlab.snapp.ir/dispatching/soteria/v3/pkg/metrics" ) -type app struct { - Metrics metrics.Metrics - Authenticator *authenticator.Authenticator - AccountsService *accounts.Service - EMQStore emq.Store - Tracer opentracing.Tracer - TracerCloser io.Closer +type App struct { + Metrics metrics.Metrics + Authenticator *authenticator.Authenticator + Tracer opentracing.Tracer + TracerCloser io.Closer } +// nolint: gochecknoglobals var ( - singleton *app + singleton *App once sync.Once ) -func GetInstance() *app { +func GetInstance() *App { once.Do(func() { - singleton = &app{} + singleton = new(App) }) return singleton } -func (a *app) SetEMQStore(store emq.Store) { - a.EMQStore = store -} - -func (a *app) SetAuthenticator(authenticator *authenticator.Authenticator) { +func (a *App) SetAuthenticator(authenticator *authenticator.Authenticator) { a.Authenticator = authenticator } -func (a *app) SetMetrics(m metrics.Metrics) { +func (a *App) SetMetrics(m metrics.Metrics) { a.Metrics = m } -func (a *app) SetAccountsService(service *accounts.Service) { - a.AccountsService = service -} - -func (a *app) SetTracer(tracer opentracing.Tracer, closer io.Closer) { +func (a *App) SetTracer(tracer opentracing.Tracer, closer io.Closer) { a.Tracer = tracer a.TracerCloser = closer } diff --git a/internal/authenticator/authenticator.go b/internal/authenticator/authenticator.go index ff07501d..70668972 100644 --- a/internal/authenticator/authenticator.go +++ b/internal/authenticator/authenticator.go @@ -1,11 +1,9 @@ package authenticator import ( - "context" "crypto/rsa" "errors" "fmt" - "time" "github.com/golang-jwt/jwt/v4" "gitlab.snapp.ir/dispatching/snappids/v2" @@ -27,50 +25,48 @@ var ( ErrIncorrectPassword = errors.New("username or password is worng") ) -type ErrTopicNotAllowed struct { +type TopicNotAllowedError struct { Issuer user.Issuer Sub string AccessType acl.AccessType Topic topics.Topic } -func (err ErrTopicNotAllowed) Error() string { +func (err TopicNotAllowedError) Error() string { return fmt.Sprintf("issuer %s with sub %s is not allowed to %s on topic %s (%s)", err.Issuer, err.Sub, err.AccessType, err.Topic, err.Topic.GetType(), ) } -type ErrPublicKeyNotFound struct { +type PublicKeyNotFoundError struct { Issuer user.Issuer } -func (err ErrPublicKeyNotFound) Error() string { +func (err PublicKeyNotFoundError) Error() string { return fmt.Sprintf("cannot find issuer %s public key", err.Issuer) } -type ErrInvalidTopic struct { +type InvalidTopicError struct { Topic topics.Topic } -func (err ErrInvalidTopic) Error() string { +func (err InvalidTopicError) Error() string { return fmt.Sprintf("provided topic %s is not valid", err.Topic) } // Authenticator is responsible for Acl/Auth/Token of users. type Authenticator struct { - PrivateKeys map[user.Issuer]*rsa.PrivateKey - PublicKeys map[user.Issuer]*rsa.PublicKey - AllowedAccessTypes []acl.AccessType - ModelHandler db.ModelHandler - EMQTopicManager *snappids.EMQTopicManager - HashIDSManager *snappids.HashIDSManager - CompareHashAndPassword func([]byte, []byte) error - Company string + PublicKeys map[user.Issuer]*rsa.PublicKey + AllowedAccessTypes []acl.AccessType + ModelHandler db.ModelHandler + EMQTopicManager *snappids.EMQTopicManager + HashIDSManager *snappids.HashIDSManager + Company string } // Auth check user authentication by checking the user's token // isSuperuser is a flag that authenticator set it true when credentials is related to a superuser. -func (a Authenticator) Auth(ctx context.Context, tokenString string) (isSuperuser bool, err error) { +func (a Authenticator) Auth(tokenString string) (err error) { _, err = jwt.Parse(tokenString, func(token *jwt.Token) (i interface{}, err error) { if _, ok := token.Method.(*jwt.SigningMethodRSA); !ok { return nil, ErrInvalidSigningMethod @@ -84,29 +80,26 @@ func (a Authenticator) Auth(ctx context.Context, tokenString string) (isSuperuse return nil, ErrIssNotFound } - _, isSuperuser = claims["is_superuser"] - issuer := user.Issuer(fmt.Sprintf("%v", claims["iss"])) key := a.PublicKeys[issuer] if key == nil { - return nil, ErrPublicKeyNotFound{Issuer: issuer} + return nil, PublicKeyNotFoundError{Issuer: issuer} } return key, nil }) - if err != nil { - return false, fmt.Errorf("token is invalid: %w", err) + return fmt.Errorf("token is invalid: %w", err) } - return isSuperuser, nil + return nil } // ACL check a user access to a topic. -func (a Authenticator) ACL(ctx context.Context, accessType acl.AccessType, +func (a Authenticator) ACL(accessType acl.AccessType, tokenString string, topic topics.Topic) (bool, error) { - if !a.validateAccessType(accessType) { + if !a.ValidateAccessType(accessType) { return false, ErrInvalidAccessType } @@ -129,7 +122,7 @@ func (a Authenticator) ACL(ctx context.Context, accessType acl.AccessType, issuer := user.Issuer(fmt.Sprintf("%v", claims["iss"])) key := a.PublicKeys[issuer] if key == nil { - return nil, ErrPublicKeyNotFound{Issuer: issuer} + return nil, PublicKeyNotFoundError{Issuer: issuer} } return key, nil @@ -157,136 +150,26 @@ func (a Authenticator) ACL(ctx context.Context, accessType acl.AccessType, pk := primaryKey(issuer, sub) - var u user.User - if err := a.ModelHandler.Get(ctx, "user", pk, &u); err != nil { - return false, fmt.Errorf("error getting user %s from db err: %w", pk, err) - } + u := a.ModelHandler.Get(pk) - // validate passenger and driver topics. - if issuer != user.ThirdParty { - id, err := a.HashIDSManager.DecodeHashID(sub, issuerToAudience(issuer)) - if err != nil { - return false, ErrDecodeHashID - } + id, err := a.HashIDSManager.DecodeHashID(sub, issuerToAudience(issuer)) + if err != nil { + return false, ErrDecodeHashID + } - ok := a.ValidateTopicBySender(topic, issuerToAudience(issuer), id) - if !ok { - return false, ErrInvalidTopic{Topic: topic} - } + if !a.ValidateTopicBySender(topic, issuerToAudience(issuer), id) { + return false, InvalidTopicError{Topic: topic} } if ok := u.CheckTopicAllowance(topic.GetTypeWithCompany(a.Company), accessType); !ok { return false, - ErrTopicNotAllowed{issuer, sub, accessType, topic} + TopicNotAllowedError{issuer, sub, accessType, topic} } return true, nil } -// Token function issues JWT token by taking client credentials. -func (a Authenticator) Token(ctx context.Context, _ acl.AccessType, - username, secret string) (string, error) { - var u user.User - if err := a.ModelHandler.Get(ctx, "user", username, &u); err != nil { - return "", fmt.Errorf("could not get user %s. %w", username, err) - } - - if u.Secret != secret { - return "", ErrInvalidSecret - } - - // nolint: exhaustivestruct - claims := jwt.StandardClaims{ - ExpiresAt: time.Now().Add(u.TokenExpirationDuration).Unix(), - Issuer: string(user.ThirdParty), - Subject: username, - } - - token := jwt.NewWithClaims(jwt.SigningMethodRS256, claims) - - tokenString, err := token.SignedString(a.PrivateKeys[user.ThirdParty]) - if err != nil { - return "", fmt.Errorf("could not sign the token %w", err) - } - - return tokenString, nil -} - -func (a Authenticator) HeraldToken( - username string, - endpoints []acl.Endpoint, - topics []acl.Topic, - duration time.Duration, -) (string, error) { - // nolint: exhaustivestruct - claims := acl.Claims{ - StandardClaims: jwt.StandardClaims{ - ExpiresAt: time.Now().Add(duration).Unix(), - Issuer: string(user.ThirdParty), - Subject: username, - }, - Topics: topics, - Endpoints: endpoints, - } - - token := jwt.NewWithClaims(jwt.SigningMethodRS256, claims) - - tokenString, err := token.SignedString(a.PrivateKeys[user.ThirdParty]) - if err != nil { - return "", fmt.Errorf("could not sign the token. %w", err) - } - - return tokenString, nil -} - -func (a Authenticator) SuperuserToken(username string, duration time.Duration) (string, error) { - // nolint: exhaustivestruct - claims := acl.SuperuserClaims{ - StandardClaims: jwt.StandardClaims{ - ExpiresAt: time.Now().Add(duration).Unix(), - Issuer: string(user.ThirdParty), - Subject: username, - }, - IsSuperuser: true, - } - - token := jwt.NewWithClaims(jwt.SigningMethodRS256, claims) - - tokenString, err := token.SignedString(a.PrivateKeys[user.ThirdParty]) - if err != nil { - return "", fmt.Errorf("could not sign the token. %w", err) - } - - return tokenString, nil -} - -func (a Authenticator) EndPointBasicAuth(ctx context.Context, username, password, endpoint string) (bool, error) { - var u user.User - if err := a.ModelHandler.Get(ctx, "user", username, &u); err != nil { - return false, fmt.Errorf("could not get user from db: %w", err) - } - - if err := a.CompareHashAndPassword([]byte(u.Password), []byte(password)); err != nil { - return false, ErrIncorrectPassword - } - - return u.CheckEndpointAllowance(endpoint), nil -} - -func (a Authenticator) EndpointIPAuth(ctx context.Context, username string, ip string, endpoint string) (bool, error) { - var u user.User - if err := a.ModelHandler.Get(ctx, "user", username, &u); err != nil { - return false, fmt.Errorf("could not get user from db: %w", err) - } - - if ok := acl.ValidateIP(ip, u.IPs, []string{}); !ok { - return false, ErrInvalidIP - } - - return u.CheckEndpointAllowance(endpoint), nil -} - -func (a Authenticator) validateAccessType(accessType acl.AccessType) bool { +func (a Authenticator) ValidateAccessType(accessType acl.AccessType) bool { for _, allowedAccessType := range a.AllowedAccessTypes { if allowedAccessType == accessType { return true @@ -339,8 +222,6 @@ func issuerToAudience(issuer user.Issuer) snappids.Audience { return snappids.PassengerAudience case user.Driver: return snappids.DriverAudience - case user.ThirdParty: - return snappids.ThirdPartyAudience default: return -1 } diff --git a/internal/authenticator/authenticator_test.go b/internal/authenticator/authenticator_test.go index 8444f1cd..ef771cae 100644 --- a/internal/authenticator/authenticator_test.go +++ b/internal/authenticator/authenticator_test.go @@ -1,7 +1,6 @@ -package authenticator +package authenticator_test import ( - "context" "crypto/rsa" "fmt" "io/ioutil" @@ -9,15 +8,12 @@ import ( "time" "github.com/golang-jwt/jwt/v4" - "github.com/google/uuid" "github.com/stretchr/testify/assert" snappids "gitlab.snapp.ir/dispatching/snappids/v2" - "gitlab.snapp.ir/dispatching/soteria/v3/internal/db" + "gitlab.snapp.ir/dispatching/soteria/v3/internal/authenticator" "gitlab.snapp.ir/dispatching/soteria/v3/internal/topics" "gitlab.snapp.ir/dispatching/soteria/v3/pkg/acl" - "gitlab.snapp.ir/dispatching/soteria/v3/pkg/memoize" "gitlab.snapp.ir/dispatching/soteria/v3/pkg/user" - "golang.org/x/crypto/bcrypt" ) const ( @@ -68,16 +64,6 @@ func TestAuthenticator_Auth(t *testing.T) { t.Fatal(err) } - thirdPartyToken, err := getSampleToken(user.ThirdParty, false) - if err != nil { - t.Fatal(err) - } - - superuserToken, err := getSampleToken(user.ThirdParty, true) - if err != nil { - t.Fatal(err) - } - pkey0, err := getPublicKey(user.Driver) if err != nil { t.Fatal(err) @@ -88,199 +74,29 @@ func TestAuthenticator_Auth(t *testing.T) { t.Fatal(err) } - pkey100, err := getPublicKey(user.ThirdParty) - if err != nil { - t.Fatal(err) - } - - key100, err := getPrivateKey(user.ThirdParty) - if err != nil { - t.Fatal(err) - } - - passwordChecker := memoize.MemoizedCompareHashAndPassword() - - authenticator := Authenticator{ - PrivateKeys: map[user.Issuer]*rsa.PrivateKey{ - user.ThirdParty: key100, - }, + // nolint: exhaustivestruct + authenticator := authenticator.Authenticator{ PublicKeys: map[user.Issuer]*rsa.PublicKey{ - user.Driver: pkey0, - user.Passenger: pkey1, - user.ThirdParty: pkey100, + user.Driver: pkey0, + user.Passenger: pkey1, }, - ModelHandler: MockModelHandler{}, - CompareHashAndPassword: passwordChecker, + ModelHandler: MockModelHandler{}, } t.Run("testing driver token auth", func(t *testing.T) { - ok, err := authenticator.Auth(context.Background(), driverToken) + err := authenticator.Auth(driverToken) assert.NoError(t, err) - assert.False(t, ok) }) t.Run("testing passenger token auth", func(t *testing.T) { - ok, err := authenticator.Auth(context.Background(), passengerToken) - assert.NoError(t, err) - assert.False(t, ok) - }) - - t.Run("testing third party token auth", func(t *testing.T) { - ok, err := authenticator.Auth(context.Background(), thirdPartyToken) - assert.NoError(t, err) - assert.False(t, ok) - }) - - t.Run("testing superuser token auth", func(t *testing.T) { - ok, err := authenticator.Auth(context.Background(), superuserToken) + err := authenticator.Auth(passengerToken) assert.NoError(t, err) - assert.True(t, ok) }) t.Run("testing invalid token auth", func(t *testing.T) { - ok, err := authenticator.Auth(context.Background(), invalidToken) + err := authenticator.Auth(invalidToken) assert.Error(t, err) - assert.False(t, ok) - }) -} - -func TestAuthenticator_Token(t *testing.T) { - key, err := getPrivateKey(user.ThirdParty) - if err != nil { - t.Fatal(err) - } - pk, err := getPublicKey(user.ThirdParty) - if err != nil { - t.Fatal(err) - } - passwordChecker := memoize.MemoizedCompareHashAndPassword() - - authenticator := Authenticator{ - PrivateKeys: map[user.Issuer]*rsa.PrivateKey{ - user.ThirdParty: key, - }, - ModelHandler: MockModelHandler{}, - CompareHashAndPassword: passwordChecker, - } - - t.Run("testing getting token with valid inputs", func(t *testing.T) { - tokenString, err := authenticator.Token(context.Background(), acl.ClientCredentials, "snappbox", "KJIikjIKbIYVGj)YihYUGIB&") - token, err := jwt.Parse(tokenString, func(token *jwt.Token) (interface{}, error) { - return pk, nil - }) - assert.NoError(t, err) - claims := token.Claims.(jwt.MapClaims) - assert.Equal(t, "snappbox", claims["sub"].(string)) - assert.Equal(t, "100", claims["iss"].(string)) - - }) - - t.Run("testing getting token with valid inputs", func(t *testing.T) { - tokenString, err := authenticator.Token(context.Background(), acl.ClientCredentials, "snappbox", "invalid secret") - token, err := jwt.Parse(tokenString, func(token *jwt.Token) (interface{}, error) { - return pk, nil - }) - assert.Error(t, err) - assert.Nil(t, token) - }) -} - -func TestAuthenticator_HeraldToken(t *testing.T) { - key, err := getPrivateKey(user.ThirdParty) - if err != nil { - t.Fatal(err) - } - pk, err := getPublicKey(user.ThirdParty) - if err != nil { - t.Fatal(err) - } - - authenticator := Authenticator{ - PrivateKeys: map[user.Issuer]*rsa.PrivateKey{ - user.ThirdParty: key, - }, - } - - t.Run("testing issuing valid herald token", func(t *testing.T) { - allowedTopics := []acl.Topic{ - { - Type: topics.BoxEvent, - }, - } - - allowedEndpoints := []acl.Endpoint{ - { - Name: "event", - }, - } - - tokenString, err := authenticator.HeraldToken( - "snappbox", allowedEndpoints, allowedTopics, time.Hour*24) - assert.NoError(t, err) - token, err := jwt.ParseWithClaims(tokenString, &acl.Claims{}, func(token *jwt.Token) (interface{}, error) { - return pk, nil - }) - assert.NoError(t, err) - actual := token.Claims.(*acl.Claims) - - expected := acl.Claims{ - StandardClaims: jwt.StandardClaims{ - Issuer: "100", - Subject: "snappbox", - }, - Topics: []acl.Topic{ - { - Type: topics.BoxEvent, - }, - }, - Endpoints: []acl.Endpoint{ - { - Name: "event", - }, - }, - } - assert.Equal(t, expected.StandardClaims.Issuer, actual.StandardClaims.Issuer) - assert.Equal(t, expected.StandardClaims.Subject, actual.StandardClaims.Subject) - assert.EqualValues(t, expected.Endpoints, actual.Endpoints) - assert.EqualValues(t, expected.Topics, actual.Topics) - }) -} - -func TestAuthenticator_SuperuserToken(t *testing.T) { - key, err := getPrivateKey(user.ThirdParty) - if err != nil { - t.Fatal(err) - } - pk, err := getPublicKey(user.ThirdParty) - if err != nil { - t.Fatal(err) - } - authenticator := Authenticator{ - PrivateKeys: map[user.Issuer]*rsa.PrivateKey{ - user.ThirdParty: key, - }, - } - - tokenString, err := authenticator.SuperuserToken("herald", time.Hour*24) - assert.NoError(t, err) - - token, err := jwt.ParseWithClaims(tokenString, &acl.SuperuserClaims{}, func(token *jwt.Token) (interface{}, error) { - return pk, nil }) - assert.NoError(t, err) - - actual := token.Claims.(*acl.SuperuserClaims) - expected := acl.SuperuserClaims{ - StandardClaims: jwt.StandardClaims{ - Issuer: "100", - Subject: "herald", - }, - IsSuperuser: true, - } - - assert.Equal(t, expected.StandardClaims.Issuer, actual.StandardClaims.Issuer) - assert.Equal(t, expected.StandardClaims.Subject, actual.StandardClaims.Subject) - assert.Equal(t, expected.IsSuperuser, actual.IsSuperuser) } func TestAuthenticator_Acl(t *testing.T) { @@ -292,14 +108,6 @@ func TestAuthenticator_Acl(t *testing.T) { if err != nil { t.Fatal(err) } - pkey100, err := getPublicKey(user.ThirdParty) - if err != nil { - t.Fatal(err) - } - key100, err := getPrivateKey(user.ThirdParty) - if err != nil { - t.Fatal(err) - } passengerToken, err := getSampleToken(user.Passenger, false) if err != nil { t.Fatal(err) @@ -308,10 +116,6 @@ func TestAuthenticator_Acl(t *testing.T) { if err != nil { t.Fatal(err) } - thirdPartyToken, err := getSampleToken(user.ThirdParty, false) - if err != nil { - t.Fatal(err) - } hid := &snappids.HashIDSManager{ Salts: map[snappids.Audience]string{ @@ -326,190 +130,178 @@ func TestAuthenticator_Acl(t *testing.T) { }, } - passwordChecker := memoize.MemoizedCompareHashAndPassword() - authenticator := Authenticator{ - PrivateKeys: map[user.Issuer]*rsa.PrivateKey{ - user.ThirdParty: key100, - }, + auth := authenticator.Authenticator{ PublicKeys: map[user.Issuer]*rsa.PublicKey{ - user.Driver: pkey0, - user.Passenger: pkey1, - user.ThirdParty: pkey100, + user.Driver: pkey0, + user.Passenger: pkey1, }, - AllowedAccessTypes: []acl.AccessType{acl.Pub, acl.Sub, acl.PubSub}, - ModelHandler: MockModelHandler{}, - EMQTopicManager: snappids.NewEMQManager(hid), - HashIDSManager: hid, - CompareHashAndPassword: passwordChecker, + AllowedAccessTypes: []acl.AccessType{acl.Pub, acl.Sub, acl.PubSub}, + ModelHandler: MockModelHandler{}, + EMQTopicManager: snappids.NewEMQManager(hid), + HashIDSManager: hid, } t.Run("testing acl with invalid access type", func(t *testing.T) { - ok, err := authenticator.ACL(context.Background(), "invalid-access", passengerToken, "test") + ok, err := auth.ACL("invalid-access", passengerToken, "test") assert.Error(t, err) assert.False(t, ok) - assert.Equal(t, ErrInvalidAccessType.Error(), err.Error()) + assert.Equal(t, authenticator.ErrInvalidAccessType.Error(), err.Error()) }) t.Run("testing acl with invalid token", func(t *testing.T) { - ok, err := authenticator.ACL(context.Background(), acl.Pub, invalidToken, validDriverCabEventTopic) + ok, err := auth.ACL(acl.Pub, invalidToken, validDriverCabEventTopic) assert.False(t, ok) assert.Error(t, err) assert.Equal(t, "token is invalid illegal base64 data at input byte 36", err.Error()) }) t.Run("testing acl with valid inputs", func(t *testing.T) { - ok, err := authenticator.ACL(context.Background(), acl.Sub, passengerToken, validPassengerCabEventTopic) + ok, err := auth.ACL(acl.Sub, passengerToken, validPassengerCabEventTopic) assert.NoError(t, err) assert.True(t, ok) }) t.Run("testing acl with invalid topic", func(t *testing.T) { - ok, err := authenticator.ACL(context.Background(), acl.Sub, passengerToken, invalidPassengerCabEventTopic) + ok, err := auth.ACL(acl.Sub, passengerToken, invalidPassengerCabEventTopic) assert.Error(t, err) assert.False(t, ok) }) t.Run("testing acl with invalid access type", func(t *testing.T) { - ok, err := authenticator.ACL(context.Background(), acl.Pub, passengerToken, validPassengerCabEventTopic) + ok, err := auth.ACL(acl.Pub, passengerToken, validPassengerCabEventTopic) assert.Error(t, err) assert.False(t, ok) }) - t.Run("testing acl with third party token", func(t *testing.T) { - ok, err := authenticator.ACL(context.Background(), acl.Sub, thirdPartyToken, validDriverLocationTopic) - assert.NoError(t, err) - assert.True(t, ok) - }) - t.Run("testing driver publish on its location topic", func(t *testing.T) { - ok, err := authenticator.ACL(context.Background(), acl.Pub, driverToken, validDriverLocationTopic) + ok, err := auth.ACL(acl.Pub, driverToken, validDriverLocationTopic) assert.NoError(t, err) assert.True(t, ok) }) t.Run("testing driver publish on invalid location topic", func(t *testing.T) { - ok, err := authenticator.ACL(context.Background(), acl.Pub, driverToken, invalidDriverLocationTopic) + ok, err := auth.ACL(acl.Pub, driverToken, invalidDriverLocationTopic) assert.Error(t, err) assert.False(t, ok) }) t.Run("testing driver subscribe on invalid cab event topic", func(t *testing.T) { - ok, err := authenticator.ACL(context.Background(), acl.Sub, driverToken, invalidDriverCabEventTopic) + ok, err := auth.ACL(acl.Sub, driverToken, invalidDriverCabEventTopic) assert.Error(t, err) assert.False(t, ok) }) t.Run("testing passenger subscribe on valid superapp event topic", func(t *testing.T) { - ok, err := authenticator.ACL(context.Background(), acl.Sub, passengerToken, validPassengerSuperappEventTopic) + ok, err := auth.ACL(acl.Sub, passengerToken, validPassengerSuperappEventTopic) assert.NoError(t, err) assert.True(t, ok) }) t.Run("testing passenger subscribe on invalid superapp event topic", func(t *testing.T) { - ok, err := authenticator.ACL(context.Background(), acl.Sub, passengerToken, invalidPassengerSuperappEventTopic) + ok, err := auth.ACL(acl.Sub, passengerToken, invalidPassengerSuperappEventTopic) assert.Error(t, err) assert.False(t, ok) }) t.Run("testing driver subscribe on valid superapp event topic", func(t *testing.T) { - ok, err := authenticator.ACL(context.Background(), acl.Sub, driverToken, validDriverSuperappEventTopic) + ok, err := auth.ACL(acl.Sub, driverToken, validDriverSuperappEventTopic) assert.NoError(t, err) assert.True(t, ok) }) t.Run("testing driver subscribe on invalid superapp event topic", func(t *testing.T) { - ok, err := authenticator.ACL(context.Background(), acl.Sub, driverToken, invalidDriverSuperappEventTopic) + ok, err := auth.ACL(acl.Sub, driverToken, invalidDriverSuperappEventTopic) assert.Error(t, err) assert.False(t, ok) }) t.Run("testing driver subscribe on valid shared location topic", func(t *testing.T) { - ok, err := authenticator.ACL(context.Background(), acl.Sub, driverToken, validDriverSharedTopic) + ok, err := auth.ACL(acl.Sub, driverToken, validDriverSharedTopic) assert.NoError(t, err) assert.True(t, ok) }) t.Run("testing passenger subscribe on valid shared location topic", func(t *testing.T) { - ok, err := authenticator.ACL(context.Background(), acl.Sub, passengerToken, validPassengerSharedTopic) + ok, err := auth.ACL(acl.Sub, passengerToken, validPassengerSharedTopic) assert.NoError(t, err) assert.True(t, ok) }) t.Run("testing driver subscribe on invalid shared location topic", func(t *testing.T) { - ok, err := authenticator.ACL(context.Background(), acl.Sub, driverToken, invalidDriverSharedTopic) + ok, err := auth.ACL(acl.Sub, driverToken, invalidDriverSharedTopic) assert.Error(t, err) assert.False(t, ok) }) t.Run("testing passenger subscribe on invalid shared location topic", func(t *testing.T) { - ok, err := authenticator.ACL(context.Background(), acl.Sub, passengerToken, invalidPassengerSharedTopic) + ok, err := auth.ACL(acl.Sub, passengerToken, invalidPassengerSharedTopic) assert.Error(t, err) assert.False(t, ok) }) t.Run("testing driver subscribe on valid chat topic", func(t *testing.T) { - ok, err := authenticator.ACL(context.Background(), acl.Sub, driverToken, validDriverChatTopic) + ok, err := auth.ACL(acl.Sub, driverToken, validDriverChatTopic) assert.NoError(t, err) assert.True(t, ok) }) t.Run("testing passenger subscribe on valid chat topic", func(t *testing.T) { - ok, err := authenticator.ACL(context.Background(), acl.Sub, passengerToken, validPassengerChatTopic) + ok, err := auth.ACL(acl.Sub, passengerToken, validPassengerChatTopic) assert.NoError(t, err) assert.True(t, ok) }) t.Run("testing driver subscribe on invalid chat topic", func(t *testing.T) { - ok, err := authenticator.ACL(context.Background(), acl.Sub, driverToken, invalidDriverChatTopic) + ok, err := auth.ACL(acl.Sub, driverToken, invalidDriverChatTopic) assert.Error(t, err) assert.False(t, ok) }) t.Run("testing passenger subscribe on invalid chat topic", func(t *testing.T) { - ok, err := authenticator.ACL(context.Background(), acl.Sub, passengerToken, invalidPassengerChatTopic) + ok, err := auth.ACL(acl.Sub, passengerToken, invalidPassengerChatTopic) assert.Error(t, err) assert.False(t, ok) }) t.Run("testing driver subscribe on valid call entry topic", func(t *testing.T) { - ok, err := authenticator.ACL(context.Background(), acl.Pub, driverToken, validDriverCallEntryTopic) + ok, err := auth.ACL(acl.Pub, driverToken, validDriverCallEntryTopic) assert.NoError(t, err) assert.True(t, ok) }) t.Run("testing passenger subscribe on valid entry call topic", func(t *testing.T) { - ok, err := authenticator.ACL(context.Background(), acl.Pub, passengerToken, validPassengerCallEntryTopic) + ok, err := auth.ACL(acl.Pub, passengerToken, validPassengerCallEntryTopic) assert.NoError(t, err) assert.True(t, ok) }) t.Run("testing driver subscribe on invalid call entry topic", func(t *testing.T) { - ok, err := authenticator.ACL(context.Background(), acl.Pub, driverToken, invalidDriverCallEntryTopic) + ok, err := auth.ACL(acl.Pub, driverToken, invalidDriverCallEntryTopic) assert.Error(t, err) assert.False(t, ok) }) t.Run("testing passenger subscribe on invalid call entry topic", func(t *testing.T) { - ok, err := authenticator.ACL(context.Background(), acl.Pub, passengerToken, invalidPassengerCallEntryTopic) + ok, err := auth.ACL(acl.Pub, passengerToken, invalidPassengerCallEntryTopic) assert.Error(t, err) assert.False(t, ok) }) t.Run("testing driver subscribe on valid call outgoing topic", func(t *testing.T) { - ok, err := authenticator.ACL(context.Background(), acl.Sub, driverToken, validDriverCallOutgoingTopic) + ok, err := auth.ACL(acl.Sub, driverToken, validDriverCallOutgoingTopic) assert.NoError(t, err) assert.True(t, ok) }) t.Run("testing passenger subscribe on valid outgoing call topic", func(t *testing.T) { - ok, err := authenticator.ACL(context.Background(), acl.Sub, passengerToken, validPassengerCallOutgoingTopic) + ok, err := auth.ACL(acl.Sub, passengerToken, validPassengerCallOutgoingTopic) assert.NoError(t, err) assert.True(t, ok) }) t.Run("testing driver subscribe on invalid call outgoing topic", func(t *testing.T) { - ok, err := authenticator.ACL(context.Background(), acl.Sub, driverToken, invalidDriverCallOutgoingTopic) + ok, err := auth.ACL(acl.Sub, driverToken, invalidDriverCallOutgoingTopic) assert.Error(t, err) assert.False(t, ok) }) t.Run("testing passenger subscribe on invalid call outgoing topic", func(t *testing.T) { - ok, err := authenticator.ACL(context.Background(), acl.Sub, passengerToken, invalidPassengerCallOutgoingTopic) + ok, err := auth.ACL(acl.Sub, passengerToken, invalidPassengerCallOutgoingTopic) assert.Error(t, err) assert.False(t, ok) }) @@ -525,29 +317,29 @@ func TestAuthenticator_ValidateTopicBySender(t *testing.T) { }, } - passwordChecker := memoize.MemoizedCompareHashAndPassword() - authenticator := Authenticator{ - AllowedAccessTypes: []acl.AccessType{acl.Pub, acl.Sub}, - ModelHandler: MockModelHandler{}, - EMQTopicManager: snappids.NewEMQManager(hid), - HashIDSManager: hid, - CompareHashAndPassword: passwordChecker, + // nolint: exhaustivestruct + authenticator := authenticator.Authenticator{ + AllowedAccessTypes: []acl.AccessType{acl.Pub, acl.Sub}, + ModelHandler: MockModelHandler{}, + EMQTopicManager: snappids.NewEMQManager(hid), + HashIDSManager: hid, } t.Run("testing valid driver cab event", func(t *testing.T) { ok := authenticator.ValidateTopicBySender(validDriverCabEventTopic, snappids.DriverAudience, 123) assert.True(t, ok) }) - } func TestAuthenticator_validateAccessType(t *testing.T) { type fields struct { AllowedAccessTypes []acl.AccessType } + type args struct { accessType acl.AccessType } + tests := []struct { name string fields fields @@ -609,12 +401,17 @@ func TestAuthenticator_validateAccessType(t *testing.T) { want: true, }, } + for _, tt := range tests { + tt := tt t.Run(tt.name, func(t *testing.T) { - a := Authenticator{ + t.Parallel() + + // nolint: exhaustivestruct + a := authenticator.Authenticator{ AllowedAccessTypes: tt.fields.AllowedAccessTypes, } - if got := a.validateAccessType(tt.args.accessType); got != tt.want { + if got := a.ValidateAccessType(tt.args.accessType); got != tt.want { t.Errorf("validateAccessType() = %v, want %v", got, tt.want) } }) @@ -623,174 +420,109 @@ func TestAuthenticator_validateAccessType(t *testing.T) { type MockModelHandler struct{} -func (rmh MockModelHandler) Save(ctx context.Context, model db.Model) error { - return nil -} - -func (rmh MockModelHandler) Delete(ctx context.Context, modelName, pk string) error { - return nil -} +func (rmh MockModelHandler) Get(pk string) user.User { + var u user.User -func (rmh MockModelHandler) Get(ctx context.Context, modelName, pk string, v db.Model) error { switch pk { case "passenger": - *v.(*user.User) = user.User{ - MetaData: db.MetaData{}, + u = user.User{ Username: string(user.Passenger), - Type: user.EMQUser, Rules: []user.Rule{ { - UUID: uuid.New(), Topic: topics.CabEvent, AccessType: acl.Sub, }, { - UUID: uuid.New(), Topic: topics.SuperappEvent, AccessType: acl.Sub, }, { - UUID: uuid.New(), Topic: topics.PassengerLocation, AccessType: acl.Pub, }, { - UUID: uuid.New(), Topic: topics.SharedLocation, AccessType: acl.Sub, }, { - UUID: uuid.New(), Topic: topics.Chat, AccessType: acl.Sub, }, { - UUID: uuid.New(), Topic: topics.CallEntry, AccessType: acl.Pub, }, { - UUID: uuid.New(), Topic: topics.CallOutgoing, AccessType: acl.Sub, }, }, } case "driver": - *v.(*user.User) = user.User{ - MetaData: db.MetaData{}, + u = user.User{ Username: string(user.Driver), - Type: user.EMQUser, Rules: []user.Rule{ { - UUID: uuid.Nil, - Endpoint: "", Topic: topics.DriverLocation, AccessType: acl.Pub, }, { - UUID: uuid.Nil, - Endpoint: "", Topic: topics.CabEvent, AccessType: acl.Sub, }, { - UUID: uuid.New(), Topic: topics.SuperappEvent, AccessType: acl.Sub, }, { - UUID: uuid.New(), Topic: topics.PassengerLocation, AccessType: acl.Pub, }, { - UUID: uuid.New(), Topic: topics.SharedLocation, AccessType: acl.Sub, }, { - UUID: uuid.New(), Topic: topics.Chat, AccessType: acl.Sub, }, { - UUID: uuid.New(), Topic: topics.CallEntry, AccessType: acl.Pub, }, { - UUID: uuid.New(), Topic: topics.CallOutgoing, AccessType: acl.Sub, }, }, } - case "snappbox": - *v.(*user.User) = user.User{ - MetaData: db.MetaData{}, - Username: "snapp-box", - Password: getSamplePassword(), - Type: user.HeraldUser, - Secret: "KJIikjIKbIYVGj)YihYUGIB&", - TokenExpirationDuration: time.Hour * 72, - Rules: []user.Rule{ - { - UUID: uuid.New(), - Topic: topics.BoxEvent, - AccessType: acl.Sub, - }, - { - UUID: uuid.New(), - Endpoint: "/notification", - AccessType: acl.Pub, - }, - }, - } - case "colony-subscriber": - *v.(*user.User) = user.User{ - MetaData: db.MetaData{}, - Username: "colony-subscriber", - Password: "password", - Type: user.EMQUser, - Secret: "secret", - TokenExpirationDuration: 0, - Rules: []user.Rule{ - user.Rule{ - UUID: uuid.New(), - Topic: topics.DriverLocation, - AccessType: acl.Sub, - }, - }, - } } - return nil -} -func (rmh MockModelHandler) Update(ctx context.Context, model db.Model) error { - return nil + return u } func getPublicKey(u user.Issuer) (*rsa.PublicKey, error) { var fileName string + switch u { case user.Passenger: fileName = "../../test/1.pem" case user.Driver: fileName = "../../test/0.pem" - case user.ThirdParty: - fileName = "../../test/100.pem" default: return nil, fmt.Errorf("invalid user, public key not found") } + pem, err := ioutil.ReadFile(fileName) if err != nil { return nil, err } + publicKey, err := jwt.ParseRSAPublicKeyFromPEM(pem) if err != nil { return nil, err } + return publicKey, nil } @@ -801,8 +533,6 @@ func getPrivateKey(u user.Issuer) (*rsa.PrivateKey, error) { fileName = "../../test/0.private.pem" case user.Passenger: fileName = "../../test/1.private.pem" - case user.ThirdParty: - fileName = "../../test/100.private.pem" default: return nil, fmt.Errorf("invalid user, private key not found") } @@ -825,9 +555,6 @@ func getSampleToken(issuer user.Issuer, isSuperuser bool) (string, error) { exp := time.Now().Add(time.Hour * 24 * 365 * 10).Unix() sub := "DXKgaNQa7N5Y7bo" - if issuer == user.ThirdParty { - sub = "colony-subscriber" - } var claims jwt.Claims if isSuperuser { @@ -851,8 +578,3 @@ func getSampleToken(issuer user.Issuer, isSuperuser bool) (string, error) { } return tokenString, nil } - -func getSamplePassword() string { - hash, _ := bcrypt.GenerateFromPassword([]byte("test"), bcrypt.DefaultCost) - return string(hash) -} diff --git a/internal/config/default.go b/internal/config/default.go index fe6558b2..27dd9ed8 100644 --- a/internal/config/default.go +++ b/internal/config/default.go @@ -1,6 +1,10 @@ package config -import "gitlab.snapp.ir/dispatching/soteria/v3/pkg/user" +import ( + "gitlab.snapp.ir/dispatching/soteria/v3/internal/topics" + "gitlab.snapp.ir/dispatching/soteria/v3/pkg/acl" + "gitlab.snapp.ir/dispatching/soteria/v3/pkg/user" +) // Default return default configuration. func Default() Config { @@ -31,12 +35,74 @@ func Default() Config { Company: "snapp", Users: []user.User{ { - Username: "driver", - Rules: []user.Rule{}, + Username: string(user.Driver), + Rules: []user.Rule{ + { + Topic: topics.DriverLocation, + AccessType: acl.Pub, + }, + { + Topic: topics.CabEvent, + AccessType: acl.Sub, + }, + { + Topic: topics.SuperappEvent, + AccessType: acl.Sub, + }, + { + Topic: topics.PassengerLocation, + AccessType: acl.Pub, + }, + { + Topic: topics.SharedLocation, + AccessType: acl.Sub, + }, + { + Topic: topics.Chat, + AccessType: acl.Sub, + }, + { + Topic: topics.CallEntry, + AccessType: acl.Pub, + }, + { + Topic: topics.CallOutgoing, + AccessType: acl.Sub, + }, + }, }, { - Username: "passenger", - Rules: []user.Rule{}, + Username: string(user.Passenger), + Rules: []user.Rule{ + { + Topic: topics.CabEvent, + AccessType: acl.Sub, + }, + { + Topic: topics.SuperappEvent, + AccessType: acl.Sub, + }, + { + Topic: topics.PassengerLocation, + AccessType: acl.Pub, + }, + { + Topic: topics.SharedLocation, + AccessType: acl.Sub, + }, + { + Topic: topics.Chat, + AccessType: acl.Sub, + }, + { + Topic: topics.CallEntry, + AccessType: acl.Pub, + }, + { + Topic: topics.CallOutgoing, + AccessType: acl.Sub, + }, + }, }, }, } From b99500607984f855932481da9eeee7e2d513ccf6 Mon Sep 17 00:00:00 2001 From: Parham Alvani Date: Wed, 17 Nov 2021 00:12:07 +0330 Subject: [PATCH 060/660] feat: remove soteria init chart --- deployments/soteria-init/.helmignore | 23 --- deployments/soteria-init/Chart.yaml | 24 --- deployments/soteria-init/templates/NOTES.txt | 0 .../soteria-init/templates/_helpers.tpl | 62 ------ .../soteria-init/templates/configmap.yaml | 12 -- deployments/soteria-init/templates/pod.yaml | 31 --- .../soteria-init/templates/secret.yaml | 10 - deployments/soteria-init/values.yaml | 178 ------------------ 8 files changed, 340 deletions(-) delete mode 100644 deployments/soteria-init/.helmignore delete mode 100644 deployments/soteria-init/Chart.yaml delete mode 100644 deployments/soteria-init/templates/NOTES.txt delete mode 100644 deployments/soteria-init/templates/_helpers.tpl delete mode 100644 deployments/soteria-init/templates/configmap.yaml delete mode 100644 deployments/soteria-init/templates/pod.yaml delete mode 100644 deployments/soteria-init/templates/secret.yaml delete mode 100644 deployments/soteria-init/values.yaml diff --git a/deployments/soteria-init/.helmignore b/deployments/soteria-init/.helmignore deleted file mode 100644 index 0e8a0eb3..00000000 --- a/deployments/soteria-init/.helmignore +++ /dev/null @@ -1,23 +0,0 @@ -# Patterns to ignore when building packages. -# This supports shell glob matching, relative path matching, and -# negation (prefixed with !). Only one pattern per line. -.DS_Store -# Common VCS dirs -.git/ -.gitignore -.bzr/ -.bzrignore -.hg/ -.hgignore -.svn/ -# Common backup files -*.swp -*.bak -*.tmp -*.orig -*~ -# Various IDEs -.project -.idea/ -*.tmproj -.vscode/ diff --git a/deployments/soteria-init/Chart.yaml b/deployments/soteria-init/Chart.yaml deleted file mode 100644 index 3d534646..00000000 --- a/deployments/soteria-init/Chart.yaml +++ /dev/null @@ -1,24 +0,0 @@ -apiVersion: v2 -name: soteria-init -description: A Helm chart for Kubernetes - -# A chart can be either an 'application' or a 'library' chart. -# -# Application charts are a collection of templates that can be packaged into versioned archives -# to be deployed. -# -# Library charts provide useful utilities or functions for the chart developer. They're included as -# a dependency of application charts to inject those utilities and functions into the rendering -# pipeline. Library charts do not define any templates and therefore cannot be deployed. -type: application - -# This is the chart version. This version number should be incremented each time you make changes -# to the chart and its templates, including the app version. -# Versions are expected to follow Semantic Versioning (https://semver.org/) -version: 4.0.0 - -# This is the version number of the application being deployed. This version number should be -# incremented each time you make changes to the application. Versions are not expected to -# follow Semantic Versioning. They should reflect the version the application is using. -# It is recommended to use it with quotes. -appVersion: "v4-0-0" diff --git a/deployments/soteria-init/templates/NOTES.txt b/deployments/soteria-init/templates/NOTES.txt deleted file mode 100644 index e69de29b..00000000 diff --git a/deployments/soteria-init/templates/_helpers.tpl b/deployments/soteria-init/templates/_helpers.tpl deleted file mode 100644 index 8b61a174..00000000 --- a/deployments/soteria-init/templates/_helpers.tpl +++ /dev/null @@ -1,62 +0,0 @@ -{{/* -Expand the name of the chart. -*/}} -{{- define "soteria-init.name" -}} -{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }} -{{- end }} - -{{/* -Create a default fully qualified app name. -We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec). -If release name contains chart name it will be used as a full name. -*/}} -{{- define "soteria-init.fullname" -}} -{{- if .Values.fullnameOverride }} -{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" }} -{{- else }} -{{- $name := default .Chart.Name .Values.nameOverride }} -{{- if contains $name .Release.Name }} -{{- .Release.Name | trunc 63 | trimSuffix "-" }} -{{- else }} -{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" }} -{{- end }} -{{- end }} -{{- end }} - -{{/* -Create chart name and version as used by the chart label. -*/}} -{{- define "soteria-init.chart" -}} -{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }} -{{- end }} - -{{/* -Common labels -*/}} -{{- define "soteria-init.labels" -}} -helm.sh/chart: {{ include "soteria-init.chart" . }} -{{ include "soteria-init.selectorLabels" . }} -{{- if .Chart.AppVersion }} -app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} -{{- end }} -app.kubernetes.io/managed-by: {{ .Release.Service }} -{{- end }} - -{{/* -Selector labels -*/}} -{{- define "soteria-init.selectorLabels" -}} -app.kubernetes.io/name: {{ include "soteria-init.name" . }} -app.kubernetes.io/instance: {{ .Release.Name }} -{{- end }} - -{{/* -Create the name of the service account to use -*/}} -{{- define "soteria-init.serviceAccountName" -}} -{{- if .Values.serviceAccount.create }} -{{- default (include "soteria-init.fullname" .) .Values.serviceAccount.name }} -{{- else }} -{{- default "default" .Values.serviceAccount.name }} -{{- end }} -{{- end }} diff --git a/deployments/soteria-init/templates/configmap.yaml b/deployments/soteria-init/templates/configmap.yaml deleted file mode 100644 index aa44d96c..00000000 --- a/deployments/soteria-init/templates/configmap.yaml +++ /dev/null @@ -1,12 +0,0 @@ -apiVersion: v1 -kind: ConfigMap -metadata: - name: {{ include "soteria-init.fullname" . }} - labels: - {{- include "soteria-init.labels" . | nindent 4 }} -data: - {{ range $key, $value := .Values.envs }} - {{ if $value }} - SOTERIA_{{ $key | upper }}: {{ $value | quote }} - {{ end }} - {{ end }} diff --git a/deployments/soteria-init/templates/pod.yaml b/deployments/soteria-init/templates/pod.yaml deleted file mode 100644 index 78aa6607..00000000 --- a/deployments/soteria-init/templates/pod.yaml +++ /dev/null @@ -1,31 +0,0 @@ -apiVersion: v1 -kind: Pod -metadata: - name: {{ include "soteria-init.fullname" . }} - labels: - {{- include "soteria-init.labels" . | nindent 4 }} -spec: - containers: - - name: {{ .Chart.Name }} - image: "{{ .Values.image.registry }}/{{ .Values.image.repository }}:{{ .Values.image.tag }}" - imagePullPolicy: {{ .Values.image.pullPolicy }} - command: ["/app/soteria"] - args: - - "accounts" - - "init" - - "db.json" - envFrom: - - configMapRef: - name: {{ include "soteria-init.fullname" . }} - volumeMounts: - - name: {{ include "soteria-init.fullname" . }}-db - mountPath: "/app/db.json" - subPath: db.json - readOnly: true - resources: - {{- toYaml .Values.resources | nindent 8 }} - restartPolicy: Never - volumes: - - name: {{ include "soteria-init.fullname" . }}-db - secret: - secretName: {{ include "soteria-init.fullname" . }}-db diff --git a/deployments/soteria-init/templates/secret.yaml b/deployments/soteria-init/templates/secret.yaml deleted file mode 100644 index d0a0e3fa..00000000 --- a/deployments/soteria-init/templates/secret.yaml +++ /dev/null @@ -1,10 +0,0 @@ ---- -apiVersion: v1 -kind: Secret -metadata: - name: {{ include "soteria-init.fullname" . }}-db - labels: - {{- include "soteria-init.labels" . | nindent 4 }} -stringData: - db.json: | - {{ toRawJson .Values.db | nindent 4 }} diff --git a/deployments/soteria-init/values.yaml b/deployments/soteria-init/values.yaml deleted file mode 100644 index 0de9b130..00000000 --- a/deployments/soteria-init/values.yaml +++ /dev/null @@ -1,178 +0,0 @@ -# Default values for Soteria. -# This is a YAML-formatted file. -# Declare variables to be passed into your templates. - - -image: - registry: docker-registry.default.svc:5000 - repository: mozart/soteria - tag: dev - pullPolicy: Always - -resources: - limits: - memory: 128Mi - cpu: 100m - requests: - memory: 128Mi - cpu: 100m - -envs: - http_port: "9999" - grpc_port: "50051" - mode: "debug" - redis_address: "rediscentral:6379" - redis_pass: "" - redis_pool_size: "10" - redis_max_retries: "0" - redis_read_timeout: "3s" - redis_pool_timeout: "4s" - redis_min_retry_backoff: "8ms" - redis_max_retry_backoff: "512ms" - redis_idle_timeout: "300s" - redis_idle_check_frequency: "60s" - redis_set_member_exp_time: "300s" - redis_min_idle_connections: "5" - logger_level: "debug" - logger_sentry_enabled: "false" - logger_sentry_dsn: "" - logger_sentry_timeout: "500ms" - allowed_access_types: "sub,pub" - cache_enabled: "true" - cache_expiration: "600s" - -db: - - meta_data: - model_name: user - date_created: '2020-09-29T10:44:15.106544359+03:30' - date_modified: '2020-09-29T10:44:15.106544423+03:30' - username: driver - password: password - type: EMQUser - ips: - secret: secret - token_expiration_duration: 2592000000000000 - rules: - - uuid: c57553f1-5675-4998-ae07-a9204db76e7c - endpoint: '' - topic: chat - access_type: '1' - - uuid: 84df6017-a850-42a3-a06f-22306a006a8d - endpoint: '' - topic: cab_event - access_type: '1' - - uuid: df0b884e-41dc-444e-81d4-67f62ae2174c - endpoint: '' - topic: driver_location - access_type: '2' - - uuid: 1375192a-6fc5-4409-abd8-0d21ef106bee - endpoint: '' - topic: shared_location - access_type: '1' - - uuid: d7aeb294-6271-470a-987a-01ea4f035e5d - endpoint: '' - topic: superapp_event - access_type: '1' - - meta_data: - model_name: user - date_created: '2020-09-29T10:44:15.106560757+03:30' - date_modified: '2020-09-29T10:44:15.106560814+03:30' - username: passenger - password: password - type: EMQUser - ips: - secret: secret - token_expiration_duration: 2592000000000000 - rules: - - uuid: 0cae4792-7002-4d7f-88be-2ffb069835a3 - endpoint: '' - topic: chat - access_type: '1' - - uuid: a51f1898-3381-456f-a5fe-0e9d80b5bee0 - endpoint: '' - topic: cab_event - access_type: '1' - - uuid: 8de97e3f-e772-4da4-8f15-4dc048f5c06e - endpoint: '' - topic: superapp_event - access_type: '1' - - uuid: c41260ed-70eb-4554-bc15-5714fc1bf3f8 - endpoint: '' - topic: passenger_location - access_type: '2' - - uuid: 1375192a-6fc5-4409-abd8-0d21ef106bee - endpoint: '' - topic: shared_location - access_type: '1' - - meta_data: - model_name: user - date_created: '2020-09-29T10:44:15.106567252+03:30' - date_modified: '2020-09-29T10:44:15.106567311+03:30' - username: box - password: password - type: EMQUser - ips: - secret: secret - token_expiration_duration: 2592000000000000 - rules: - - uuid: e591af90-8191-4118-941a-7ef4434414ee - endpoint: '' - topic: box_event - access_type: '1' - - meta_data: - model_name: user - date_created: '2020-09-29T10:44:15.106569957+03:30' - date_modified: '2020-09-29T10:44:15.106570022+03:30' - username: colony-subscriber - password: password - type: EMQUser - ips: - secret: secret - token_expiration_duration: 2592000000000000 - rules: - - uuid: bcbe0a57-1706-4de7-a948-71c56c9700c4 - endpoint: '' - topic: driver_location - access_type: '1' - - meta_data: - model_name: user - date_created: '2020-09-29T10:44:15.106573104+03:30' - date_modified: '2020-09-29T10:44:15.106573162+03:30' - username: gabriel - password: password - type: HeraldUser - ips: - secret: secret - token_expiration_duration: 2592000000000000 - rules: - - uuid: 305dc844-5df0-42dc-849b-deccfe2dab96 - endpoint: "/notification" - topic: '' - access_type: '2' - - uuid: 5795227f-10a8-4822-ba5e-a1fc057a0a95 - endpoint: "/event" - topic: '' - access_type: '2' - - meta_data: - model_name: user - date_created: '2021-06-23T08:42:24.722521722Z' - date_modified: '2021-07-06T18:40:10.074710788Z' - username: gossiper - password: password - type: EMQUser - ips: - secret: secret - token_expiration_duration: 30758400000000000 - rules: - - uuid: ec6f659e-fe73-41cd-805e-c5285bd92a8d - endpoint: '' - topic: shared_location - access_type: '2' - - uuid: a8dc06c4-bb11-4cb9-8da7-84ae34d2d14a - endpoint: '' - topic: driver_location - access_type: '1' - - uuid: cda59530-d412-4c6d-bb3b-7a89c6bf58c5 - endpoint: '' - topic: passenger_location - access_type: '1' From e73e85ad542285b2f79b74933bd9cfedeb2b3732 Mon Sep 17 00:00:00 2001 From: Parham Alvani Date: Wed, 17 Nov 2021 00:21:32 +0330 Subject: [PATCH 061/660] feat: complete new helm chart --- deployments/soteria/Chart.yaml | 4 +- deployments/soteria/templates/configmap.yaml | 29 +++++-- deployments/soteria/templates/deployment.yaml | 16 ++-- deployments/soteria/templates/secret.yaml | 16 +--- deployments/soteria/values.yaml | 85 ++++++++----------- 5 files changed, 71 insertions(+), 79 deletions(-) diff --git a/deployments/soteria/Chart.yaml b/deployments/soteria/Chart.yaml index 09167cc0..aa5b479e 100644 --- a/deployments/soteria/Chart.yaml +++ b/deployments/soteria/Chart.yaml @@ -15,10 +15,10 @@ type: application # This is the chart version. This version number should be incremented each time you make changes # to the chart and its templates, including the app version. # Versions are expected to follow Semantic Versioning (https://semver.org/) -version: 4.0.2 +version: 5.0.0 # This is the version number of the application being deployed. This version number should be # incremented each time you make changes to the application. Versions are not expected to # follow Semantic Versioning. They should reflect the version the application is using. # It is recommended to use it with quotes. -appVersion: "v4-0-2" +appVersion: "v5-0-0" diff --git a/deployments/soteria/templates/configmap.yaml b/deployments/soteria/templates/configmap.yaml index 7695dcf6..fa9d2663 100644 --- a/deployments/soteria/templates/configmap.yaml +++ b/deployments/soteria/templates/configmap.yaml @@ -1,3 +1,4 @@ +--- apiVersion: v1 kind: ConfigMap metadata: @@ -6,8 +7,26 @@ metadata: labels: {{- include "soteria.labels" . | nindent 4 }} data: - {{ range $key, $value := .Values.envs }} - {{ if $value }} - SOTERIA_{{ $key | upper }}: {{ $value | quote }} - {{ end }} - {{ end }} + config.yaml: + allowed_access_types: {{ .Values.envs.allowed_access_types }} + passenger_hash_length: {{ .Values.authEnvs.passenger_hash_length }} + driver_hash_length: {{ .Values.authEnvs.driver_hash_length }} + passenger_salt: {{ .Values.authEnvs.passenger_salt }} + driver_salt: {{ .Values.authEnvs.driver_salt }} + jwt: + path: {{ .Values.authEnvs.jwt_keys_path }} + logger: + level: {{ .Values.envs.logger_level }} + http_port: 9999 + tracer: + enabled: {{ .Values.envs.tracer_enabled }} + service_name: {{ .Values.envs.tracer_service_name }} + sampler_type: {{ .Values.envs.tracer_sampler_type }} + sampler_param: {{ .Values.envs.tracer_sampler_param }} + host: {{ .Values.envs.tracer_host }} + port: {{ .Values.envs.tracer_port }} + company: {{ .Values.envs.company }} + {{ with .Values.users }} + users: + {{ toYaml . | nindent 8 }} + {{ end }} diff --git a/deployments/soteria/templates/deployment.yaml b/deployments/soteria/templates/deployment.yaml index d9bb7a80..bedb27d4 100644 --- a/deployments/soteria/templates/deployment.yaml +++ b/deployments/soteria/templates/deployment.yaml @@ -73,20 +73,22 @@ spec: env: - name: TZ value: {{ .Values.timezone }} - envFrom: - - configMapRef: - name: {{ include "soteria.fullname" . }} - - secretRef: - name: {{ include "soteria.fullname" . }}-auth-envs volumeMounts: - {{- $root := . -}} + - name: configuration + mountPath: "/app/config.yml" + subPath: "config.yaml" + readOnly: true {{- range $key, $value := .Values.jwtKeys }} - name: {{ include "soteria.fullname" $ }}-jwt-keys - mountPath: "{{ $root.Values.authEnvs.jwt_keys_path }}{{ $key }}" + mountPath: "{{ $.Values.authEnvs.jwt_keys_path }}{{ $key }}" subPath: {{ $key }} readOnly: true {{ end }} volumes: + - name: configuration + configMap: + defaultMode: 0440 + name: {{ include "soteria.fullname" . }} - name: {{ include "soteria.fullname" . }}-jwt-keys secret: secretName: {{ include "soteria.fullname" . }}-jwt-keys diff --git a/deployments/soteria/templates/secret.yaml b/deployments/soteria/templates/secret.yaml index 07f930a3..2ab382f4 100644 --- a/deployments/soteria/templates/secret.yaml +++ b/deployments/soteria/templates/secret.yaml @@ -1,17 +1,3 @@ -apiVersion: v1 -kind: Secret -metadata: - name: {{ include "soteria.fullname" . }}-auth-envs - namespace: {{ $.Release.Namespace }} - labels: - {{- include "soteria.labels" . | nindent 4 }} -stringData: - {{- range $key, $value := .Values.authEnvs }} - {{- if $value }} - SOTERIA_{{ $key | upper }}: {{ $value | quote }} - {{- end }} - {{- end }} - --- apiVersion: v1 kind: Secret @@ -20,7 +6,7 @@ metadata: namespace: {{ $.Release.Namespace }} labels: {{- include "soteria.labels" . | nindent 4 }} - + stringData: {{- range $key, $value := .Values.jwtKeys }} {{- if $value }} diff --git a/deployments/soteria/values.yaml b/deployments/soteria/values.yaml index a0866e70..b1ed5aa3 100644 --- a/deployments/soteria/values.yaml +++ b/deployments/soteria/values.yaml @@ -1,3 +1,4 @@ +--- # Default values for Soteria. # This is a YAML-formatted file. # Declare variables to be passed into your templates. @@ -21,9 +22,6 @@ service: - name: http port: 9999 protocol: tcp - - name: grpc - port: 50051 - protocol: tcp resources: limits: @@ -77,58 +75,45 @@ jwtKeys: 9L/zyDMi4jgFTZEWNXC2vIrxwZMFwFhBXEp0PcCbuHJgJIucbRrbwukQC16uHJwP zQIDAQAB -----END PUBLIC KEY----- - 100.pem: |- - -----BEGIN PUBLIC KEY----- - MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCTxwVGmWzJNOaZnBRL+9/V1Mc8 - OWWzUDxlG2kL+0WxHh8/+76ngIvp7YsHHxUadR0iY6NkzLgFv+sBkKh523Nx0Ytu - GgmGuuVTaD27G2inwgFDabUsAKISBbn6d6jwlkfk3D+O6h5pdLqoI64Zq/NPmD0o - Wsupn2HVhMSjFbE6dwIDAQAB - -----END PUBLIC KEY----- - 100.private.pem: |- - -----BEGIN RSA PRIVATE KEY----- - MIICWwIBAAKBgQCTxwVGmWzJNOaZnBRL+9/V1Mc8OWWzUDxlG2kL+0WxHh8/+76n - gIvp7YsHHxUadR0iY6NkzLgFv+sBkKh523Nx0YtuGgmGuuVTaD27G2inwgFDabUs - AKISBbn6d6jwlkfk3D+O6h5pdLqoI64Zq/NPmD0oWsupn2HVhMSjFbE6dwIDAQAB - AoGAJDRGHp3IASNsu4V5k4QJuqF+jkqhl+S4Zyzn939/+3ydu1c5xl+/53fC7+O1 - j93RXXN7vF5LV11FfgSqwe/5wDEcAtyLXWPCHtLB1CIYFfqHxgwOQm4gQSyOgBnP - hMccyv0VCDK23+Mk37lLkuON6xXMC8+IUq5UW/aadxkeqoECQQDU9Z5IFCmp3Ibs - hJXx/x+ZQI+gLj0hh71pQEO2zqhu19i+M62KKnDb7k2OtK9IJR2ucU+YE3SXGShh - 1sPmgfVfAkEAsaTtZ1oZmszOs5TPYhs2e7LKLPNADZ36GVsG2h1FHVX+LyNkwk/E - pn+FV3Dd1vkzxG/a3znEKz+2BJiz4vF56QJATUxKA4euB8XQA5Gsi4Y7Bfl1KIMg - FUeb7NQyv+wLHxChz4gaeYgmJu48oIvdA6bVOzhN17lYHHA5RCocOVL6qQJAdHdT - 6nmo5dO3BQfgO0rqGolqgbPtX8AeE3eZc3DTOluBrbf/vGF95UcfzedCmkmBxh0r - m0SNN2mq1TKkZXq52QJAIjxhG7spkOSZJQnVBA9TfLYZFM/aUzDpLxflvFAuJuqJ - l+PFsbek2Zl6fgy294dXRvQhp1PJryngDaXTBiWK6g== - -----END RSA PRIVATE KEY----- authEnvs: jwt_keys_path: "/jwt_pems/" driver_salt: "secret" passenger_salt: "secret" - driver_hash_length: "15" - passenger_hash_length: "15" + driver_hash_length: 15 + passenger_hash_length: 15 envs: + allowed_access_types: [ "pub", "sub" ] # company: "baly" - http_port: "9999" - grpc_port: "50051" - mode: "debug" - redis_address: "main-redis-master.dispatching-staging.svc:6379" - redis_pass: "" - redis_pool_size: "10" - redis_max_retries: "0" - redis_read_timeout: "3s" - redis_pool_timeout: "4s" - redis_min_retry_backoff: "8ms" - redis_max_retry_backoff: "512ms" - redis_idle_timeout: "300s" - redis_idle_check_frequency: "60s" - redis_set_member_exp_time: "300s" - redis_min_idle_connections: "5" - logger_level: "debug" - logger_sentry_enabled: "false" - logger_sentry_dsn: "" - logger_sentry_timeout: "500ms" - allowed_access_types: "sub,pub" - cache_enabled: "true" - cache_expiration: "600s" + logger_level: "warn" + +users: + - username: driver + rules: + - topic: cab_event + access_type: '1' + - topic: driver_location + access_type: '2' + - topic: shared_location + access_type: '1' + - topic: superapp_event + access_type: '1' + - topic: call_entry + access_type: '2' + - topic: call_outgoing + access_type: '1' + - username: passenger + rules: + - topic: cab_event + access_type: '1' + - topic: superapp_event + access_type: '1' + - topic: passenger_location + access_type: '2' + - topic: shared_location + access_type: '1' + - topic: call_entry + access_type: '2' + - topic: call_outgoing + access_type: '1' From 27c45861596f47f7f301a6ea9d501205cc69f6ee Mon Sep 17 00:00:00 2001 From: Parham Alvani Date: Wed, 17 Nov 2021 00:21:49 +0330 Subject: [PATCH 062/660] feat: update default configuration --- internal/config/default.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/config/default.go b/internal/config/default.go index 27dd9ed8..80eb9616 100644 --- a/internal/config/default.go +++ b/internal/config/default.go @@ -18,7 +18,7 @@ func Default() Config { PassengerSalt: "secret", DriverSalt: "secret", JWT: &JWT{ - Path: "/test", + Path: "test/", }, Logger: &Logger{ Level: "warn", From 37d3e73279ff04d0613d12c237b9b62f62fe2bd5 Mon Sep 17 00:00:00 2001 From: Parham Alvani Date: Wed, 17 Nov 2021 00:22:43 +0330 Subject: [PATCH 063/660] feat: remove code generation dependency --- .gitlab/ci/templates/build.gitlab-ci.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.gitlab/ci/templates/build.gitlab-ci.yml b/.gitlab/ci/templates/build.gitlab-ci.yml index b2a6553b..7a0ca41e 100644 --- a/.gitlab/ci/templates/build.gitlab-ci.yml +++ b/.gitlab/ci/templates/build.gitlab-ci.yml @@ -16,8 +16,7 @@ build: - ${CI_PROJECT_NAME}-${CI_COMMIT_REF_SLUG}.tar expire_in: 1 week dependencies: - - code-generator - compile except: variables: - - $UPDATE_ENVIRONMENT_VARIABLE \ No newline at end of file + - $UPDATE_ENVIRONMENT_VARIABLE From 988590a8b8fd361b95369cdbbf7ade75175b1c76 Mon Sep 17 00:00:00 2001 From: Parham Alvani Date: Wed, 17 Nov 2021 00:24:04 +0330 Subject: [PATCH 064/660] feat: remove code generation dependency --- .gitlab/ci/templates/build.gitlab-ci.yml | 3 --- .gitlab/ci/templates/test.gitlab-ci.yml | 4 ---- 2 files changed, 7 deletions(-) diff --git a/.gitlab/ci/templates/build.gitlab-ci.yml b/.gitlab/ci/templates/build.gitlab-ci.yml index 7a0ca41e..a89bc355 100644 --- a/.gitlab/ci/templates/build.gitlab-ci.yml +++ b/.gitlab/ci/templates/build.gitlab-ci.yml @@ -17,6 +17,3 @@ build: expire_in: 1 week dependencies: - compile - except: - variables: - - $UPDATE_ENVIRONMENT_VARIABLE diff --git a/.gitlab/ci/templates/test.gitlab-ci.yml b/.gitlab/ci/templates/test.gitlab-ci.yml index 3cf93ad5..5d5ebbf3 100644 --- a/.gitlab/ci/templates/test.gitlab-ci.yml +++ b/.gitlab/ci/templates/test.gitlab-ci.yml @@ -18,8 +18,4 @@ unit_tests: - rm -rf .coverage.out.tmp - go tool cover -func .coverage.out dependencies: - - code-generator - compile - except: - variables: - - $UPDATE_ENVIRONMENT_VARIABLE From 53beac98de2c59e106b926e0b38a334a30930d23 Mon Sep 17 00:00:00 2001 From: Parham Alvani Date: Wed, 17 Nov 2021 00:30:03 +0330 Subject: [PATCH 065/660] fix: correct dependencies --- Makefile | 2 +- go.mod | 29 ++++++++--------------------- go.sum | 49 +++---------------------------------------------- 3 files changed, 12 insertions(+), 68 deletions(-) diff --git a/Makefile b/Makefile index 7228a4ab..b1a30af4 100644 --- a/Makefile +++ b/Makefile @@ -20,7 +20,7 @@ build-image: compile docker build -t ${IMAGE_TAG} . push-image: build-image - docker push ${IMAGE_TAG} + docker push ${IMAGE_TAG} build-image-dev: compile docker build -t soteria:latest . diff --git a/go.mod b/go.mod index 08fda68b..a63601f8 100644 --- a/go.mod +++ b/go.mod @@ -3,45 +3,33 @@ module gitlab.snapp.ir/dispatching/soteria/v3 go 1.17 require ( - github.com/HdrHistogram/hdrhistogram-go v1.1.0 // indirect - github.com/alicebob/miniredis/v2 v2.13.1 // indirect - github.com/go-redis/redis/v8 v8.11.4 // indirect + github.com/ansrivas/fiberprometheus/v2 v2.1.2 + github.com/gofiber/contrib/fiberzap v0.0.0-20211104103143-eae1892b9aac + github.com/gofiber/fiber/v2 v2.22.0 github.com/golang-jwt/jwt/v4 v4.1.0 - github.com/golang/protobuf v1.5.2 // indirect - github.com/google/uuid v1.3.0 // indirect + github.com/knadh/koanf v1.3.2 github.com/opentracing/opentracing-go v1.2.0 - github.com/patrickmn/go-cache v2.1.0+incompatible // indirect github.com/prometheus/client_golang v1.11.0 github.com/spf13/cobra v1.2.1 github.com/stretchr/testify v1.7.0 github.com/uber/jaeger-client-go v2.29.1+incompatible - github.com/uber/jaeger-lib v2.4.1+incompatible // indirect gitlab.snapp.ir/dispatching/snappids/v2 v2.8.0 go.uber.org/atomic v1.9.0 // indirect go.uber.org/automaxprocs v1.4.0 go.uber.org/zap v1.19.1 - golang.org/x/crypto v0.0.0-20211115234514-b4de73f9ece8 - google.golang.org/protobuf v1.27.1 // indirect ) require ( - github.com/ansrivas/fiberprometheus/v2 v2.1.2 - github.com/gofiber/contrib/fiberzap v0.0.0-20211104103143-eae1892b9aac - github.com/gofiber/fiber/v2 v2.22.0 - github.com/knadh/koanf v1.3.2 -) - -require ( - github.com/alicebob/gopher-json v0.0.0-20200520072559-a9ecdc9d1d3a // indirect + github.com/HdrHistogram/hdrhistogram-go v1.1.2 // indirect github.com/andybalholm/brotli v1.0.4 // indirect github.com/beorn7/perks v1.0.1 // indirect github.com/cespare/xxhash/v2 v2.1.2 // indirect github.com/davecgh/go-spew v1.1.1 // indirect - github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f // indirect github.com/fatih/structs v1.1.0 // indirect github.com/fsnotify/fsnotify v1.4.9 // indirect github.com/gofiber/adaptor/v2 v2.1.14 // indirect github.com/gofiber/utils v0.1.2 // indirect + github.com/golang/protobuf v1.5.2 // indirect github.com/inconshreveable/mousetrap v1.0.0 // indirect github.com/klauspost/compress v1.13.6 // indirect github.com/kr/pretty v0.3.0 // indirect @@ -57,14 +45,13 @@ require ( github.com/rogpeppe/go-internal v1.8.0 // indirect github.com/speps/go-hashids/v2 v2.0.1 // indirect github.com/spf13/pflag v1.0.5 // indirect + github.com/uber/jaeger-lib v2.4.1+incompatible // indirect github.com/valyala/bytebufferpool v1.0.0 // indirect github.com/valyala/fasthttp v1.31.0 // indirect github.com/valyala/tcplisten v1.0.0 // indirect - github.com/yuin/gopher-lua v0.0.0-20191220021717-ab39c6098bdb // indirect go.uber.org/multierr v1.7.0 // indirect - golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2 // indirect golang.org/x/sys v0.0.0-20211116061358-0a5406a5449c // indirect - golang.org/x/text v0.3.7 // indirect + google.golang.org/protobuf v1.26.0 // indirect gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c // indirect gopkg.in/yaml.v2 v2.4.0 // indirect gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b // indirect diff --git a/go.sum b/go.sum index 39bc31db..481226af 100644 --- a/go.sum +++ b/go.sum @@ -41,8 +41,8 @@ cloud.google.com/go/storage v1.10.0/go.mod h1:FLPqc6j+Ki4BU591ie1oL6qBQGu2Bl/tZ9 dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= -github.com/HdrHistogram/hdrhistogram-go v1.1.0 h1:6dpdDPTRoo78HxAJ6T1HfMiKSnqhgRRqzCuPshRkQ7I= -github.com/HdrHistogram/hdrhistogram-go v1.1.0/go.mod h1:yDgFjdqOqDEKOvasDdhWNXYg9BVp4O+o5f6V/ehm6Oo= +github.com/HdrHistogram/hdrhistogram-go v1.1.2 h1:5IcZpTvzydCQeHzK4Ef/D5rrSqwxob0t8PQPMybUNFM= +github.com/HdrHistogram/hdrhistogram-go v1.1.2/go.mod h1:yDgFjdqOqDEKOvasDdhWNXYg9BVp4O+o5f6V/ehm6Oo= github.com/Knetic/govaluate v3.0.1-0.20171022003610-9aa49832a739+incompatible/go.mod h1:r7JcOSlj0wfOMncg0iLm8Leh48TZaKVeNIfJntJ2wa0= github.com/Shopify/sarama v1.19.0/go.mod h1:FVkBWblsNy7DGZRfXLU0O9RCGt5g3g3yEuWXgklEdEo= github.com/Shopify/toxiproxy v2.1.4+incompatible/go.mod h1:OXgGpZ6Cli1/URJOF1DMxUHB2q5Ap20/P/eIdh4G0pI= @@ -54,10 +54,6 @@ github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751/go.mod h1:LOuy github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= github.com/alecthomas/units v0.0.0-20190717042225-c3de453c63f4/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= github.com/alecthomas/units v0.0.0-20190924025748-f65c72e2690d/go.mod h1:rBZYJk541a8SKzHPHnH3zbiI+7dagKZ0cgpgrD7Fyho= -github.com/alicebob/gopher-json v0.0.0-20200520072559-a9ecdc9d1d3a h1:HbKu58rmZpUGpz5+4FfNmIU+FmZg2P3Xaj2v2bfNWmk= -github.com/alicebob/gopher-json v0.0.0-20200520072559-a9ecdc9d1d3a/go.mod h1:SGnFV6hVsYE877CKEZ6tDNTjaSXYUk6QqoIK6PrAtcc= -github.com/alicebob/miniredis/v2 v2.13.1 h1:twArGFW9kCdxe0K1Ga+iWrZc9RdWalf7V5bQerNoPK0= -github.com/alicebob/miniredis/v2 v2.13.1/go.mod h1:0UIBNuf97uxrWhdVBpJvPtafKyGpL2NS2pYe0tYM97k= github.com/andybalholm/brotli v1.0.0/go.mod h1:loMXtMfwqflxFJPmdbJO0a3KNoPuLBgiu3qAvBg8x/Y= github.com/andybalholm/brotli v1.0.2/go.mod h1:loMXtMfwqflxFJPmdbJO0a3KNoPuLBgiu3qAvBg8x/Y= github.com/andybalholm/brotli v1.0.3/go.mod h1:fO7iG3H7G2nSZ7m0zPUDn85XEX2GTukHGRSepvi9Eig= @@ -122,8 +118,6 @@ github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSs github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ= -github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f h1:lO4WD4F/rVNCu3HqELle0jiPLLBs70cWOduZpkS1E78= -github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f/go.mod h1:cuUVRXasLTGF7a8hSLbxyZXjz+1KgoB3wDUb6vlszIc= github.com/dustin/go-humanize v0.0.0-20171111073723-bb3d318650d4/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk= github.com/eapache/go-resiliency v1.1.0/go.mod h1:kFI+JgMyC7bLPUVY133qvEBtVayf5mFgVsvEsIPBvNs= github.com/eapache/go-xerial-snappy v0.0.0-20180814174437-776d5712da21/go.mod h1:+020luEh2TKB4/GOp8oxxtq0Daoen/Cii55CzbTV6DU= @@ -158,11 +152,8 @@ github.com/go-ldap/ldap v3.0.2+incompatible/go.mod h1:qfd9rJvER9Q0/D/Sqn1DfHRoBp github.com/go-logfmt/logfmt v0.3.0/go.mod h1:Qt1PoO58o5twSAckw1HlFXLmHsOX5/0LbT9GBnD5lWE= github.com/go-logfmt/logfmt v0.4.0/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V4qmtdjCk= github.com/go-logfmt/logfmt v0.5.0/go.mod h1:wCYkCAKZfumFQihp8CzCvQ3paCTfi41vtzG1KdI/P7A= -github.com/go-redis/redis/v8 v8.11.4 h1:kHoYkfZP6+pe04aFTnhDH6GDROa5yJdHJVNxV3F46Tg= -github.com/go-redis/redis/v8 v8.11.4/go.mod h1:2Z2wHZXdQpCDXEGzqMockDpNyYvi2l4Pxt6RJr792+w= github.com/go-sql-driver/mysql v1.4.0/go.mod h1:zAC/RDZ24gD3HViQzih4MyKcchzm+sOG5ZlKdlhCg5w= github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= -github.com/go-task/slim-sprig v0.0.0-20210107165309-348f09dbbbc0/go.mod h1:fyg7847qk6SyHyPtNmDHnmrv/HOrqktSC+C9fM+CJOE= github.com/go-test/deep v1.0.2-0.20181118220953-042da051cf31/go.mod h1:wGDj63lr65AM2AQyKZd/NYHGb0R+1RLqB8NKt3aSFNA= github.com/godbus/dbus/v5 v5.0.4/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA= github.com/gofiber/adaptor/v2 v2.1.1/go.mod h1:jdHkqsqdWzEc0qMB+5svsWL5kdZmaDN2H0C3Hxl8y7c= @@ -219,8 +210,6 @@ github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiu github.com/golang/snappy v0.0.0-20180518054509-2e65f85255db/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= github.com/golang/snappy v0.0.1/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= github.com/golang/snappy v0.0.3/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= -github.com/gomodule/redigo v1.8.1 h1:Abmo0bI7Xf0IhdIPc7HZQzZcShdnmxeoVuDDtIQp8N8= -github.com/gomodule/redigo v1.8.1/go.mod h1:P9dn9mFrCBvWhGE1wpxx6fgq7BAeLBk+UUUzlpkBYO0= github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= @@ -254,8 +243,6 @@ github.com/google/pprof v0.0.0-20210226084205-cbba55b83ad5/go.mod h1:kpwsk12EmLe github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= github.com/google/uuid v1.0.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/google/uuid v1.3.0 h1:t6JiXgmwXMjEs8VusXIJk2BXHsn+wx8BZdTaoZ5fu7I= -github.com/google/uuid v1.3.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg= github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk= github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= @@ -392,22 +379,12 @@ github.com/nats-io/nkeys v0.1.0/go.mod h1:xpnFELMwJABBLVhffcfd1MZx6VsNRFpEugbxzi github.com/nats-io/nkeys v0.1.3/go.mod h1:xpnFELMwJABBLVhffcfd1MZx6VsNRFpEugbxziKVo7w= github.com/nats-io/nuid v1.0.1/go.mod h1:19wcPz3Ph3q0Jbyiqsd0kePYG7A95tJPxeL+1OSON2c= github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno= -github.com/nxadm/tail v1.4.4/go.mod h1:kenIhsEOeOJmVchQTgglprH7qJGnHDVpk1VPCcaMI8A= -github.com/nxadm/tail v1.4.8 h1:nPr65rt6Y5JFSKQO7qToXr7pePgD6Gwiw05lkbyAQTE= -github.com/nxadm/tail v1.4.8/go.mod h1:+ncqLTQzXmGhMZNUePPaPqPvBxHAIsmXswZKocGu+AU= github.com/oklog/oklog v0.3.2/go.mod h1:FCV+B7mhrz4o+ueLpx+KqkyXRGMWOYEvfiXtdGtbWGs= github.com/oklog/run v1.0.0/go.mod h1:dlhp/R75TPv97u0XWUtDeV/lRKWPKSdTuV0TZvrmrQA= github.com/olekukonko/tablewriter v0.0.0-20170122224234-a0225b3f23b5/go.mod h1:vsDQFd/mU46D+Z4whnwzcISnGGzXWMclvtLoiIKAKIo= github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.7.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= -github.com/onsi/ginkgo v1.12.1/go.mod h1:zj2OWP4+oCPe1qIXoGWkgMRwljMUYCdkwsT2108oapk= -github.com/onsi/ginkgo v1.16.4 h1:29JGrr5oVBm5ulCWet69zQkzWipVXIol6ygQUe/EzNc= -github.com/onsi/ginkgo v1.16.4/go.mod h1:dX+/inL/fNMqNlz0e9LfyB9TswhZpCVdJM/Z6Vvnwo0= github.com/onsi/gomega v1.4.3/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= -github.com/onsi/gomega v1.7.1/go.mod h1:XdKZgCCFLUoM/7CFJVPcG8C1xQ1AJ0vpAezJrB7JYyY= -github.com/onsi/gomega v1.10.1/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1ybHNo= -github.com/onsi/gomega v1.16.0 h1:6gjqkI8iiRHMvdccRJM8rVKjCWk6ZIm6FTm3ddIe4/c= -github.com/onsi/gomega v1.16.0/go.mod h1:HnhC7FXeEQY45zxNK3PPoIUhzk/80Xly9PcubAlGdZY= github.com/op/go-logging v0.0.0-20160315200505-970db520ece7/go.mod h1:HzydrMdWErDVzsI23lYNej1Htcns9BCg93Dk0bBINWk= github.com/opentracing-contrib/go-observer v0.0.0-20170622124052-a52f23424492/go.mod h1:Ngi6UdF0k5OKD5t5wlmGhe/EDKPoUM3BXZSSfIuJbis= github.com/opentracing/basictracer-go v1.0.0/go.mod h1:QfBfYuafItcjQuMwinw9GhYKwFXS9KnPs5lxoYwgW74= @@ -422,8 +399,6 @@ github.com/openzipkin/zipkin-go v0.2.2/go.mod h1:NaW6tEwdmWMaCDZzg8sh+IBNOxHMPnh github.com/pact-foundation/pact-go v1.0.4/go.mod h1:uExwJY4kCzNPcHRj+hCR/HBbOOIwwtUjcrb0b5/5kLM= github.com/pascaldekloe/goe v0.0.0-20180627143212-57f6aae5913c/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc= github.com/pascaldekloe/goe v0.1.0/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc= -github.com/patrickmn/go-cache v2.1.0+incompatible h1:HRMgzkcYKYpi3C8ajMPV8OFXaaRUnok+kx1WdO15EQc= -github.com/patrickmn/go-cache v2.1.0+incompatible/go.mod h1:3Qf8kWWT7OJRJbdiICTKqZju1ZixQ/KpMGzzAfe6+WQ= github.com/pborman/uuid v1.2.0/go.mod h1:X/NO0urCmaxf9VXbdlT7C2Yzkj2IKimNn4k+gtPdI/k= github.com/pelletier/go-toml v1.7.0/go.mod h1:vwGMzjaWMwyfHwgIBhI2YUM4fB6nL6lVAvS1LBMMhTE= github.com/pelletier/go-toml v1.9.3 h1:zeC5b1GviRUyKYd6OJPvBU/mcVDVoL1OhT17FCt5dSQ= @@ -543,8 +518,6 @@ github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9de github.com/yuin/goldmark v1.1.32/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.3.5/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= -github.com/yuin/gopher-lua v0.0.0-20191220021717-ab39c6098bdb h1:ZkM6LRnq40pR1Ox0hTHlnpkcOTuFIDQpZ1IN8rKKhX0= -github.com/yuin/gopher-lua v0.0.0-20191220021717-ab39c6098bdb/go.mod h1:gqRgreBUhTSL0GeU64rtZ3Uq3wtjOa/TB2YfrtkCbVQ= gitlab.snapp.ir/dispatching/snappids/v2 v2.8.0 h1:5BzBqfPB59hEHfHzfU4gcWKfiDBjNWcf68GAUgeRPu4= gitlab.snapp.ir/dispatching/snappids/v2 v2.8.0/go.mod h1:U7lxAuqPifdXkUNcCXhtk9+6HFAyw5qy8LrF1DQDMuQ= go.etcd.io/bbolt v1.3.3/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU= @@ -591,8 +564,6 @@ golang.org/x/crypto v0.0.0-20190820162420-60c769a6c586/go.mod h1:yigFU9vqHzYiE8U golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20210513164829-c07d793c2f9a/go.mod h1:P+XmwS30IXTQdn5tA2iutPOUgjI07+tq3H3K9MVA1s8= -golang.org/x/crypto v0.0.0-20211115234514-b4de73f9ece8 h1:5QRxNnVsaJP6NAse0UdkRgL3zHMvCRRkrDVLNdNpdy4= -golang.org/x/crypto v0.0.0-20211115234514-b4de73f9ece8/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/exp v0.0.0-20180321215751-8460e604b9de/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20180807140117-3d87b88a115f/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= @@ -662,7 +633,6 @@ golang.org/x/net v0.0.0-20200324143707-d3edc9973b7e/go.mod h1:qpuaurCH72eLCgpAm/ golang.org/x/net v0.0.0-20200501053045-e0ff5e5a1de5/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= golang.org/x/net v0.0.0-20200506145744-7e3656a0809f/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= golang.org/x/net v0.0.0-20200513185701-a91f0712d120/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= -golang.org/x/net v0.0.0-20200520004742-59133d7f0dd7/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= golang.org/x/net v0.0.0-20200520182314-0ba52f642ac2/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= golang.org/x/net v0.0.0-20200625001655-4c5254603344/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= golang.org/x/net v0.0.0-20200707034311-ab3426394381/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= @@ -676,11 +646,8 @@ golang.org/x/net v0.0.0-20210119194325-5f4716e94777/go.mod h1:m0MpNAwzfU5UDzcl9v golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20210316092652-d523dce5a7f4/go.mod h1:RBQZq4jEuRlivfhVLdyRGr576XBO4/greRjx4P4O3yc= golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM= -golang.org/x/net v0.0.0-20210428140749-89ef3d95e781/go.mod h1:OJAsFXCWl8Ukc7SiCT/9KSuxbyM7479/AVlXFRxuMCk= golang.org/x/net v0.0.0-20210510120150-4163338589ed/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20210525063256-abc453219eb5/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= -golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2 h1:CIJ76btIcR3eFI5EgSo6k1qKw9KJexJuRLI9G7Hp5wE= -golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= @@ -714,7 +681,6 @@ golang.org/x/sys v0.0.0-20181107165924-66b7b1311ac8/go.mod h1:STP8DvDyc/dI5b8T5h golang.org/x/sys v0.0.0-20181116152217-5ac8a444bdc5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20181122145206-62eef0e2fa9b/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190129075346-302c3dd5f1cc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20190204203706-41f3e6584952/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190312061237-fead79001313/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190403152447-81d4e9dc473e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -726,10 +692,8 @@ golang.org/x/sys v0.0.0-20190606165138-5da285871e9c/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20190624142023-c5567b49c5d0/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190726091711-fc99dfbffb4e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190826190057-c7b8b68b1456/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190904154756-749cb33beabd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191001151750-bb3f8db39f24/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191005200804-aed5e4c7ecf9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20191120155948-bd437916bb0e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191204072324-ce4227a45e2e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191220142924-d4481acd189f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191228213918-04cbcbbfeed8/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -756,7 +720,6 @@ golang.org/x/sys v0.0.0-20201201145000-ef89a241ccb3/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20201210223839-7e3030f88018/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20201214210602-f9fddec55a1e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210104204734-6f8348627aad/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210112080510-489259a85091/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210119212857-b64e53b001e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210220050731-9a76102bfb43/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -769,7 +732,6 @@ golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210514084401-e8d321eab015/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210603081109-ebe580a85c40/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20211013075003-97ac67df715c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20211116061358-0a5406a5449c h1:DHcbWVXeY+0Y8HHKR+rbLwnoh2F4tNCY7rTiHJ30RmA= golang.org/x/sys v0.0.0-20211116061358-0a5406a5449c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= @@ -783,8 +745,6 @@ golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.4/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/text v0.3.7 h1:olpwvP2KacW1ZWvsR7uQhoyTYvKAupfQrRGBFM352Gk= -golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= golang.org/x/time v0.0.0-20180412165947-fbb02b2291d2/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= @@ -843,7 +803,6 @@ golang.org/x/tools v0.0.0-20200904185747-39188db58858/go.mod h1:Cj7w3i3Rnn0Xh82u golang.org/x/tools v0.0.0-20201110124207-079ba7bd75cd/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.0.0-20201201161351-ac6f37ff4c2a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.0.0-20201208233053-a543418bbed2/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= -golang.org/x/tools v0.0.0-20201224043029-2b0845dc783e/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.0.0-20210105154028-b0ab187a4818/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.1.0/go.mod h1:xkSsbof2nBLbhDlRMhhhyNLN/zl3eTqcnHD5viDpcZ0= @@ -970,9 +929,8 @@ google.golang.org/protobuf v1.23.1-0.20200526195155-81db48ad09cc/go.mod h1:EGpAD google.golang.org/protobuf v1.24.0/go.mod h1:r/3tXBNzIEhYS9I1OUVjXDlt8tc493IdKGjtUeSXeh4= google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c= google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= +google.golang.org/protobuf v1.26.0 h1:bxAC2xTBsZGibn2RTntX0oH50xLsqy1OxA9tTL3p/lk= google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= -google.golang.org/protobuf v1.27.1 h1:SnqbnDw1V7RiZcXPx5MEeqPv2s79L9i7BJUlG/+RurQ= -google.golang.org/protobuf v1.27.1/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= gopkg.in/asn1-ber.v1 v1.0.0-20181015200546-f715ec2f112d/go.mod h1:cuepJuh7vyXfUyUwEgHQXw849cJrilpS5NeIjOWESAw= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= @@ -988,7 +946,6 @@ gopkg.in/gcfg.v1 v1.2.3/go.mod h1:yesOnuUOFQAhST5vPY4nbZsb/huCgGGXlipJsBn0b3o= gopkg.in/ini.v1 v1.62.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= gopkg.in/resty.v1 v1.12.0/go.mod h1:mDo4pnntr5jdWRML875a/NmxYqAlA73dVijT2AXvQQo= gopkg.in/square/go-jose.v2 v2.3.1/go.mod h1:M9dMgbHiYLoDGQrXy7OpJDJWiKiU//h+vD76mk0e1AI= -gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 h1:uRGJdciOHaEIrze2W8Q3AKkepLTh2hOroT7a+7czfdQ= gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw= gopkg.in/warnings.v0 v0.1.2/go.mod h1:jksf8JmL6Qr/oQM2OXTHunEvvTAsrWBLb6OOjuVWRNI= gopkg.in/yaml.v2 v2.0.0-20170812160011-eb3733d160e7/go.mod h1:JAlM8MvJe8wmxCU4Bli9HhUf9+ttbYbLASfIpnQbh74= From beec505b7ecd0e97a89558e40c24cbb40267d4de Mon Sep 17 00:00:00 2001 From: Parham Alvani Date: Wed, 17 Nov 2021 00:38:05 +0330 Subject: [PATCH 066/660] feat: update pipeline --- .gitlab-ci.yml | 2 -- .gitlab/ci/templates/build.gitlab-ci.yml | 6 +----- .gitlab/ci/templates/compile.gitlab-ci.yml | 24 ++++------------------ .gitlab/ci/templates/test.gitlab-ci.yml | 13 +++--------- Dockerfile | 12 ++++++----- 5 files changed, 15 insertions(+), 42 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 2e78a173..160e07a7 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,6 +1,4 @@ --- -image: registry.snapp.tech/docker/golang:1.11.4-alpine3.8 - stages: - lint - compile diff --git a/.gitlab/ci/templates/build.gitlab-ci.yml b/.gitlab/ci/templates/build.gitlab-ci.yml index a89bc355..e64781bf 100644 --- a/.gitlab/ci/templates/build.gitlab-ci.yml +++ b/.gitlab/ci/templates/build.gitlab-ci.yml @@ -1,3 +1,4 @@ +--- build: image: docker:latest stage: build @@ -10,10 +11,5 @@ build: - docker build --build-arg BUILD_DATE=$CURRENT_DATETIME --build-arg VCS_REF=${CI_COMMIT_SHA} --build-arg BUILD_VERSION=${CI_COMMIT_REF_SLUG} -t ${CI_PROJECT_NAME}:${CI_COMMIT_REF_SLUG} . after_script: - docker save -o ${CI_PROJECT_NAME}-${CI_COMMIT_REF_SLUG}.tar ${CI_PROJECT_NAME}:${CI_COMMIT_REF_SLUG} - artifacts: - name: "docker-image-$CI_PROJECT_NAME-$CI_COMMIT_REF_SLUG" - paths: - - ${CI_PROJECT_NAME}-${CI_COMMIT_REF_SLUG}.tar - expire_in: 1 week dependencies: - compile diff --git a/.gitlab/ci/templates/compile.gitlab-ci.yml b/.gitlab/ci/templates/compile.gitlab-ci.yml index 2996e8d6..06c07d49 100644 --- a/.gitlab/ci/templates/compile.gitlab-ci.yml +++ b/.gitlab/ci/templates/compile.gitlab-ci.yml @@ -1,28 +1,12 @@ --- -.go_mod_config: &go_mod - image: registry.snapp.tech/docker/golang:1.17-alpine3.14 - cache: - policy: pull - paths: - - vendor/ - before_script: - - go env -w GOPROXY="https://repo.snapp.tech/repository/goproxy/" - compile: - <<: *go_mod stage: compile + image: registry.snapp.tech/docker/golang:1.17-alpine3.14 variables: GOOS: "linux" GOARCH: "amd64" CGO_ENABLED: 0 + before_script: + - go env -w GOPROXY="https://repo.snapp.tech/repository/goproxy/" script: - - go mod vendor -v - - go build -mod vendor -v -o ${BUILD_PATH}/${CI_PROJECT_NAME} cmd/soteria/soteria.go - artifacts: - name: "$CI_PROJECT_NAME-$CI_COMMIT_REF_SLUG" - paths: - - ${BUILD_PATH}/${CI_PROJECT_NAME} - expire_in: 1 week - except: - variables: - - $UPDATE_ENVIRONMENT_VARIABLE + - go build -v -o ${BUILD_PATH}/${CI_PROJECT_NAME} cmd/soteria/soteria.go diff --git a/.gitlab/ci/templates/test.gitlab-ci.yml b/.gitlab/ci/templates/test.gitlab-ci.yml index 5d5ebbf3..c604e071 100644 --- a/.gitlab/ci/templates/test.gitlab-ci.yml +++ b/.gitlab/ci/templates/test.gitlab-ci.yml @@ -1,17 +1,10 @@ --- -.go_mod_config: &go_mod - image: registry.snapp.tech/docker/golang:1.17-alpine3.14 - cache: - policy: pull - paths: - - vendor/ - before_script: - - go env -w GOPROXY="https://repo.snapp.tech/repository/goproxy/" - unit_tests: - <<: *go_mod + image: registry.snapp.tech/docker/golang:1.17-alpine3.14 stage: test coverage: '/total:\s*\(statements\)\s*([\d.]+)%/' + before_script: + - go env -w GOPROXY="https://repo.snapp.tech/repository/goproxy/" script: - go test -gcflags=-l -v -coverprofile .coverage.out.tmp ./... - cat .coverage.out.tmp | grep -v "mock.go" > .coverage.out diff --git a/Dockerfile b/Dockerfile index 800a66de..8f6abe69 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,16 +1,18 @@ -FROM alpine +FROM alpine:3.14 ARG BUILD_DATE ARG VCS_REF ARG BUILD_VERSION -RUN echo -e "https://repo.snapp.tech/repository/alpine/v3.12/main\nhttps://repo.snapp.tech/repository/alpine/v3.12/community" > /etc/apk/repositories -RUN apk --no-cache --update add ca-certificates tzdata - -RUN mkdir /app +RUN echo "https://repo.snapp.tech/repository/alpine/v3.14/main" > /etc/apk/repositories && \ + echo "https://repo.snapp.tech/repository/alpine/v3.14/community" >> /etc/apk/repositories && \ + apk --no-cache --update add ca-certificates tzdata && \ + mkdir /app COPY ./soteria /app WORKDIR /app + ENV SOTERIA_BUILD_DATE=${BUILD_DATE} ENV SOTERIA_VCS_REF=${VCS_REF} ENV SOTERIA_BUILD_VERSION=${BUILD_VERSION} + CMD ["/app/soteria", "serve"] From 7f5779e9a21e27ae79ccbcf06d82fb3b87d7e6da Mon Sep 17 00:00:00 2001 From: Parham Alvani Date: Wed, 17 Nov 2021 00:41:38 +0330 Subject: [PATCH 067/660] fix: correct artifacts --- .gitlab/ci/templates/build.gitlab-ci.yml | 5 +++++ .gitlab/ci/templates/compile.gitlab-ci.yml | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/.gitlab/ci/templates/build.gitlab-ci.yml b/.gitlab/ci/templates/build.gitlab-ci.yml index e64781bf..2cbd6fed 100644 --- a/.gitlab/ci/templates/build.gitlab-ci.yml +++ b/.gitlab/ci/templates/build.gitlab-ci.yml @@ -13,3 +13,8 @@ build: - docker save -o ${CI_PROJECT_NAME}-${CI_COMMIT_REF_SLUG}.tar ${CI_PROJECT_NAME}:${CI_COMMIT_REF_SLUG} dependencies: - compile + artifacts: + name: "docker-image-$CI_PROJECT_NAME-$CI_COMMIT_REF_SLUG" + paths: + - ${CI_PROJECT_NAME}-${CI_COMMIT_REF_SLUG}.tar + expire_in: 1 week diff --git a/.gitlab/ci/templates/compile.gitlab-ci.yml b/.gitlab/ci/templates/compile.gitlab-ci.yml index 06c07d49..bbdd82c3 100644 --- a/.gitlab/ci/templates/compile.gitlab-ci.yml +++ b/.gitlab/ci/templates/compile.gitlab-ci.yml @@ -10,3 +10,8 @@ compile: - go env -w GOPROXY="https://repo.snapp.tech/repository/goproxy/" script: - go build -v -o ${BUILD_PATH}/${CI_PROJECT_NAME} cmd/soteria/soteria.go + artifacts: + name: "$CI_PROJECT_NAME-$CI_COMMIT_REF_SLUG" + paths: + - ${BUILD_PATH}/${CI_PROJECT_NAME} + expire_in: 1 week From 6a2b6586f1f029e50dc00abf30cda784073e38b4 Mon Sep 17 00:00:00 2001 From: Parham Alvani Date: Wed, 17 Nov 2021 00:47:53 +0330 Subject: [PATCH 068/660] feat: update README --- README.md | 61 ------------------------------------------------------- 1 file changed, 61 deletions(-) diff --git a/README.md b/README.md index 012bf1b5..b00bbbb7 100644 --- a/README.md +++ b/README.md @@ -67,68 +67,7 @@ for production deployments on Cloud (okd). - `.api`: API documentation like swagger files - `.gitlab`: Gitlab CI templates - `.okd`: OpenShift deployment configs (no longer is use. please use Helm charts) -- `configs`: Config files - `deployments`: Helm Charts - `internal`: Main application directory for codes - `pkg`: Go packages that their logic is independent of this project and can become handy in other projects as well. -- `web`: web interface of application including rest and grpc - `test`: test data like jwt keys - -# Accounting with Soteria-CLI - -## Installation - -Install [pipenv](https://pipenv.pypa.io/en/latest/). - -```sh -poetry install -poetry shell -``` - -## EMQ User (http-auth) - -1. First create an `emq` account - -```sh -python3 main.py -b "https://soteria-snapp-ode-004.apps.private.teh-1.snappcloud.io/" new -u gossiper -p password -t emq -``` - -2. Add rule for accessing the requested topic - -```sh -python3 main.py -b "https://soteria-snapp-ode-004.apps.private.teh-1.snappcloud.io/" rules-add --username gossiper --password password --topic shared_location --access-type pubsub -``` - -3. Set account secret - -```sh -python3 main.py -b "https://soteria-snapp-ode-004.apps.private.teh-1.snappcloud.io/" set-secret --username gossiper --password password --secret secret -``` - -4. Set token timeout in nanoseconds - -```sh -python3 main.py -b "https://soteria-snapp-ode-004.apps.private.teh-1.snappcloud.io/" set-expire --username gossiper --password password -e $(( 356 * 24 * 60 * 60 * 1000 * 1000 * 1000)) -``` - -5. Checkout the created user - -```sh -python3 main.py -b "https://soteria-snapp-ode-004.apps.private.teh-1.snappcloud.io/" show --username gossiper --password password -``` - -6. Generate token and have fun with `emq` - -```sh -python3 main.py -b "https://soteria-snapp-ode-004.apps.private.teh-1.snappcloud.io/" token --username gossiper --secret secret --grant-type pub -``` - -## EMQ Superuser (redis-auth) - -The main job of superuser authentication is on the emq and the redis. soteria only makes the creation process easier. - -1. Create EMQ superuser on redis. the command returns the authentication information for your service. - -```sh -python3 main.py -b "https://soteria-snapp-ode-012.apps.private.teh-1.snappcloud.io/" superuser --username parham --password password --duration $((1000 * 1000 * 1000)) -``` From 80ed8b4ed8f56b9126eb84e63e631216ec5112e5 Mon Sep 17 00:00:00 2001 From: Parham Alvani Date: Wed, 17 Nov 2021 01:09:48 +0330 Subject: [PATCH 069/660] fix: correct chart issues --- deployments/soteria/templates/configmap.yaml | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/deployments/soteria/templates/configmap.yaml b/deployments/soteria/templates/configmap.yaml index fa9d2663..b827d67e 100644 --- a/deployments/soteria/templates/configmap.yaml +++ b/deployments/soteria/templates/configmap.yaml @@ -7,7 +7,7 @@ metadata: labels: {{- include "soteria.labels" . | nindent 4 }} data: - config.yaml: + config.yaml: | allowed_access_types: {{ .Values.envs.allowed_access_types }} passenger_hash_length: {{ .Values.authEnvs.passenger_hash_length }} driver_hash_length: {{ .Values.authEnvs.driver_hash_length }} @@ -18,14 +18,18 @@ data: logger: level: {{ .Values.envs.logger_level }} http_port: 9999 + {{ with .Values.envs.tracer }} tracer: - enabled: {{ .Values.envs.tracer_enabled }} - service_name: {{ .Values.envs.tracer_service_name }} - sampler_type: {{ .Values.envs.tracer_sampler_type }} - sampler_param: {{ .Values.envs.tracer_sampler_param }} - host: {{ .Values.envs.tracer_host }} - port: {{ .Values.envs.tracer_port }} - company: {{ .Values.envs.company }} + enabled: {{ .enabled }} + service_name: {{ .service_name }} + sampler_type: {{ .sampler_type }} + sampler_param: {{ .sampler_param }} + host: {{ .host }} + port: {{ .port }} + {{ end }} + {{ with .Values.envs.company }} + company: {{ . }} + {{ end }} {{ with .Values.users }} users: {{ toYaml . | nindent 8 }} From eb7702d2ad65c72d5813d049e00d091264db305f Mon Sep 17 00:00:00 2001 From: Parham Alvani Date: Wed, 17 Nov 2021 01:10:18 +0330 Subject: [PATCH 070/660] feat: update chart version --- deployments/soteria/Chart.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/deployments/soteria/Chart.yaml b/deployments/soteria/Chart.yaml index aa5b479e..0e28f559 100644 --- a/deployments/soteria/Chart.yaml +++ b/deployments/soteria/Chart.yaml @@ -15,10 +15,10 @@ type: application # This is the chart version. This version number should be incremented each time you make changes # to the chart and its templates, including the app version. # Versions are expected to follow Semantic Versioning (https://semver.org/) -version: 5.0.0 +version: 5.0.1 # This is the version number of the application being deployed. This version number should be # incremented each time you make changes to the application. Versions are not expected to # follow Semantic Versioning. They should reflect the version the application is using. # It is recommended to use it with quotes. -appVersion: "v5-0-0" +appVersion: "v5-0-1" From 00a148b8eab69edc0eeb25f02c6f1f88c1b93fb7 Mon Sep 17 00:00:00 2001 From: Parham Alvani Date: Wed, 17 Nov 2021 01:42:51 +0330 Subject: [PATCH 071/660] fix: correct authenticator --- internal/authenticator/authenticator.go | 4 ++-- internal/commands/serve.go | 4 +--- internal/db/models.go | 21 +++++++++++++++++++++ 3 files changed, 24 insertions(+), 5 deletions(-) diff --git a/internal/authenticator/authenticator.go b/internal/authenticator/authenticator.go index 70668972..8e581543 100644 --- a/internal/authenticator/authenticator.go +++ b/internal/authenticator/authenticator.go @@ -150,7 +150,7 @@ func (a Authenticator) ACL(accessType acl.AccessType, pk := primaryKey(issuer, sub) - u := a.ModelHandler.Get(pk) + user := a.ModelHandler.Get(pk) id, err := a.HashIDSManager.DecodeHashID(sub, issuerToAudience(issuer)) if err != nil { @@ -161,7 +161,7 @@ func (a Authenticator) ACL(accessType acl.AccessType, return false, InvalidTopicError{Topic: topic} } - if ok := u.CheckTopicAllowance(topic.GetTypeWithCompany(a.Company), accessType); !ok { + if ok := user.CheckTopicAllowance(topic.GetTypeWithCompany(a.Company), accessType); !ok { return false, TopicNotAllowedError{issuer, sub, accessType, topic} } diff --git a/internal/commands/serve.go b/internal/commands/serve.go index 86f8b356..1164fd28 100644 --- a/internal/commands/serve.go +++ b/internal/commands/serve.go @@ -66,8 +66,6 @@ func servePreRun(cmd *cobra.Command, args []string) { app.GetInstance().SetTracer(trc, cl) - var modelHandler db.ModelHandler - allowedAccessTypes, err := cfg.GetAllowedAccessTypes() if err != nil { zap.L().Fatal("error while getting allowed access types", zap.Error(err)) @@ -79,7 +77,7 @@ func servePreRun(cmd *cobra.Command, args []string) { user.Passenger: publicKey1, }, AllowedAccessTypes: allowedAccessTypes, - ModelHandler: modelHandler, + ModelHandler: db.NewInternal(cfg.Users), HashIDSManager: hid, EMQTopicManager: snappids.NewEMQManagerWithCompany(hid, cfg.Company), Company: cfg.Company, diff --git a/internal/db/models.go b/internal/db/models.go index f66df731..32136776 100644 --- a/internal/db/models.go +++ b/internal/db/models.go @@ -7,3 +7,24 @@ import ( type ModelHandler interface { Get(pk string) user.User } + +type InternalModelHanlder struct { + users []user.User +} + +func NewInternal(users []user.User) InternalModelHanlder { + return InternalModelHanlder{ + users: users, + } +} + +func (model InternalModelHanlder) Get(pk string) user.User { + for _, user := range model.users { + if user.Username == pk { + return user + } + } + + // nolint: exhaustivestruct + return user.User{} +} From 94bcdf583aad1d8e98a27ad75c14cbe51dc5dd21 Mon Sep 17 00:00:00 2001 From: Parham Alvani Date: Wed, 17 Nov 2021 01:43:08 +0330 Subject: [PATCH 072/660] fix: correct access type configuration --- deployments/soteria/templates/configmap.yaml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/deployments/soteria/templates/configmap.yaml b/deployments/soteria/templates/configmap.yaml index b827d67e..d45b9cd1 100644 --- a/deployments/soteria/templates/configmap.yaml +++ b/deployments/soteria/templates/configmap.yaml @@ -8,7 +8,10 @@ metadata: {{- include "soteria.labels" . | nindent 4 }} data: config.yaml: | - allowed_access_types: {{ .Values.envs.allowed_access_types }} + {{ with .Values.envs.allowed_access_types }} + allowed_access_types: + {{ toYaml . | nindent 8 }} + {{ end }} passenger_hash_length: {{ .Values.authEnvs.passenger_hash_length }} driver_hash_length: {{ .Values.authEnvs.driver_hash_length }} passenger_salt: {{ .Values.authEnvs.passenger_salt }} From d4994d405512f1742cab2dc49592683ad0224f0e Mon Sep 17 00:00:00 2001 From: Parham Alvani Date: Wed, 17 Nov 2021 01:43:53 +0330 Subject: [PATCH 073/660] feat: update soteria helm chart --- deployments/soteria/Chart.yaml | 20 +++----------------- 1 file changed, 3 insertions(+), 17 deletions(-) diff --git a/deployments/soteria/Chart.yaml b/deployments/soteria/Chart.yaml index 0e28f559..f33b5b05 100644 --- a/deployments/soteria/Chart.yaml +++ b/deployments/soteria/Chart.yaml @@ -1,24 +1,10 @@ +--- apiVersion: v2 name: soteria description: Soteria Helm Chart -# A chart can be either an 'application' or a 'library' chart. -# -# Application charts are a collection of templates that can be packaged into versioned archives -# to be deployed. -# -# Library charts provide useful utilities or functions for the chart developer. They're included as -# a dependency of application charts to inject those utilities and functions into the rendering -# pipeline. Library charts do not define any templates and therefore cannot be deployed. type: application -# This is the chart version. This version number should be incremented each time you make changes -# to the chart and its templates, including the app version. -# Versions are expected to follow Semantic Versioning (https://semver.org/) -version: 5.0.1 +version: 5.0.2 -# This is the version number of the application being deployed. This version number should be -# incremented each time you make changes to the application. Versions are not expected to -# follow Semantic Versioning. They should reflect the version the application is using. -# It is recommended to use it with quotes. -appVersion: "v5-0-1" +appVersion: "v5-0-2" From 5bd0752b2b5e6e15165d83b6e9984b268c204856 Mon Sep 17 00:00:00 2001 From: Parham Alvani Date: Wed, 17 Nov 2021 01:57:01 +0330 Subject: [PATCH 074/660] feat: update acl and user configuration --- pkg/acl/utils.go | 35 ----------------------------------- pkg/user/user.go | 10 +++++----- 2 files changed, 5 insertions(+), 40 deletions(-) diff --git a/pkg/acl/utils.go b/pkg/acl/utils.go index ab7639b8..6329e256 100644 --- a/pkg/acl/utils.go +++ b/pkg/acl/utils.go @@ -1,7 +1,5 @@ package acl -import "net" - // Access Types for EMQ contains subscribe, publish and publish-subscribe. type AccessType string @@ -53,36 +51,3 @@ func ValidateEndpoint(endpoint string, authorizedEndpoints, unauthorizedEndpoint return isValid } - -// ValidateIP takes validIPs and invalidIPs and tell whether a IP is valid or not. -func ValidateIP(ip string, validIPs, invalidIPs []string) bool { - isValid := false - - for _, validIP := range validIPs { - _, network, err := net.ParseCIDR(validIP) - if err != nil && validIP == ip { - isValid = true - - break - } else if err == nil && network.Contains(net.ParseIP(ip)) { - isValid = true - - break - } - } - - for _, invalidIP := range invalidIPs { - _, network, err := net.ParseCIDR(invalidIP) - if err != nil && invalidIP == ip { - isValid = false - - break - } else if err == nil && network.Contains(net.ParseIP(ip)) { - isValid = false - - break - } - } - - return isValid -} diff --git a/pkg/user/user.go b/pkg/user/user.go index 70f6e28e..1bf9e936 100644 --- a/pkg/user/user.go +++ b/pkg/user/user.go @@ -15,14 +15,14 @@ const ( // User is Soteria's users db model. type User struct { - Username string `json:"username"` - Rules []Rule `json:"rules"` + Username string + Rules []Rule } // Rule tells about a access to a specific topic or endpoint. type Rule struct { - Topic topics.Type `json:"topic"` - AccessType acl.AccessType `json:"access_type"` + Topic topics.Type + Access acl.AccessType } // GetPrimaryKey is for knowing a model primary key. @@ -33,7 +33,7 @@ func (u User) GetPrimaryKey() string { // CheckTopicAllowance checks whether the user is allowed to pub/sub/pubsub to a topic or not. func (u User) CheckTopicAllowance(topic topics.Type, accessType acl.AccessType) bool { for _, rule := range u.Rules { - if rule.Topic == topic && (rule.AccessType == acl.PubSub || rule.AccessType == accessType) { + if rule.Topic == topic && (rule.Access == acl.PubSub || rule.Access == accessType) { return true } } From 8b4212d1006a76a179b735142662e5ae71800621 Mon Sep 17 00:00:00 2001 From: Parham Alvani Date: Wed, 17 Nov 2021 01:57:16 +0330 Subject: [PATCH 075/660] fix: use access instead of access_type --- deployments/soteria/values.yaml | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/deployments/soteria/values.yaml b/deployments/soteria/values.yaml index b1ed5aa3..be93c781 100644 --- a/deployments/soteria/values.yaml +++ b/deployments/soteria/values.yaml @@ -92,28 +92,28 @@ users: - username: driver rules: - topic: cab_event - access_type: '1' + access: '1' - topic: driver_location - access_type: '2' + access: '2' - topic: shared_location - access_type: '1' + access: '1' - topic: superapp_event - access_type: '1' + access: '1' - topic: call_entry - access_type: '2' + access: '2' - topic: call_outgoing - access_type: '1' + access: '1' - username: passenger rules: - topic: cab_event - access_type: '1' + access: '1' - topic: superapp_event - access_type: '1' + access: '1' - topic: passenger_location - access_type: '2' + access: '2' - topic: shared_location - access_type: '1' + access: '1' - topic: call_entry - access_type: '2' + access: '2' - topic: call_outgoing - access_type: '1' + access: '1' From ae7d6bb17d6e11982149b51d5ac8e1cf922681f5 Mon Sep 17 00:00:00 2001 From: Parham Alvani Date: Wed, 17 Nov 2021 02:00:06 +0330 Subject: [PATCH 076/660] fix: correct default configuration --- internal/config/default.go | 60 +++++++++++++++++++------------------- 1 file changed, 30 insertions(+), 30 deletions(-) diff --git a/internal/config/default.go b/internal/config/default.go index 80eb9616..c6ca8dcf 100644 --- a/internal/config/default.go +++ b/internal/config/default.go @@ -38,36 +38,36 @@ func Default() Config { Username: string(user.Driver), Rules: []user.Rule{ { - Topic: topics.DriverLocation, - AccessType: acl.Pub, + Topic: topics.DriverLocation, + Access: acl.Pub, }, { - Topic: topics.CabEvent, - AccessType: acl.Sub, + Topic: topics.CabEvent, + Access: acl.Sub, }, { - Topic: topics.SuperappEvent, - AccessType: acl.Sub, + Topic: topics.SuperappEvent, + Access: acl.Sub, }, { - Topic: topics.PassengerLocation, - AccessType: acl.Pub, + Topic: topics.PassengerLocation, + Access: acl.Pub, }, { - Topic: topics.SharedLocation, - AccessType: acl.Sub, + Topic: topics.SharedLocation, + Access: acl.Sub, }, { - Topic: topics.Chat, - AccessType: acl.Sub, + Topic: topics.Chat, + Access: acl.Sub, }, { - Topic: topics.CallEntry, - AccessType: acl.Pub, + Topic: topics.CallEntry, + Access: acl.Pub, }, { - Topic: topics.CallOutgoing, - AccessType: acl.Sub, + Topic: topics.CallOutgoing, + Access: acl.Sub, }, }, }, @@ -75,32 +75,32 @@ func Default() Config { Username: string(user.Passenger), Rules: []user.Rule{ { - Topic: topics.CabEvent, - AccessType: acl.Sub, + Topic: topics.CabEvent, + Access: acl.Sub, }, { - Topic: topics.SuperappEvent, - AccessType: acl.Sub, + Topic: topics.SuperappEvent, + Access: acl.Sub, }, { - Topic: topics.PassengerLocation, - AccessType: acl.Pub, + Topic: topics.PassengerLocation, + Access: acl.Pub, }, { - Topic: topics.SharedLocation, - AccessType: acl.Sub, + Topic: topics.SharedLocation, + Access: acl.Sub, }, { - Topic: topics.Chat, - AccessType: acl.Sub, + Topic: topics.Chat, + Access: acl.Sub, }, { - Topic: topics.CallEntry, - AccessType: acl.Pub, + Topic: topics.CallEntry, + Access: acl.Pub, }, { - Topic: topics.CallOutgoing, - AccessType: acl.Sub, + Topic: topics.CallOutgoing, + Access: acl.Sub, }, }, }, From 3c03f319ff6ac95b0afc0bc5861c1f5dec27a719 Mon Sep 17 00:00:00 2001 From: Parham Alvani Date: Wed, 17 Nov 2021 02:02:28 +0330 Subject: [PATCH 077/660] fix: correct authenticator tests --- internal/authenticator/authenticator_test.go | 60 ++++++++++---------- 1 file changed, 30 insertions(+), 30 deletions(-) diff --git a/internal/authenticator/authenticator_test.go b/internal/authenticator/authenticator_test.go index ef771cae..d392fec5 100644 --- a/internal/authenticator/authenticator_test.go +++ b/internal/authenticator/authenticator_test.go @@ -429,32 +429,32 @@ func (rmh MockModelHandler) Get(pk string) user.User { Username: string(user.Passenger), Rules: []user.Rule{ { - Topic: topics.CabEvent, - AccessType: acl.Sub, + Topic: topics.CabEvent, + Access: acl.Sub, }, { - Topic: topics.SuperappEvent, - AccessType: acl.Sub, + Topic: topics.SuperappEvent, + Access: acl.Sub, }, { - Topic: topics.PassengerLocation, - AccessType: acl.Pub, + Topic: topics.PassengerLocation, + Access: acl.Pub, }, { - Topic: topics.SharedLocation, - AccessType: acl.Sub, + Topic: topics.SharedLocation, + Access: acl.Sub, }, { - Topic: topics.Chat, - AccessType: acl.Sub, + Topic: topics.Chat, + Access: acl.Sub, }, { - Topic: topics.CallEntry, - AccessType: acl.Pub, + Topic: topics.CallEntry, + Access: acl.Pub, }, { - Topic: topics.CallOutgoing, - AccessType: acl.Sub, + Topic: topics.CallOutgoing, + Access: acl.Sub, }, }, } @@ -463,36 +463,36 @@ func (rmh MockModelHandler) Get(pk string) user.User { Username: string(user.Driver), Rules: []user.Rule{ { - Topic: topics.DriverLocation, - AccessType: acl.Pub, + Topic: topics.DriverLocation, + Access: acl.Pub, }, { - Topic: topics.CabEvent, - AccessType: acl.Sub, + Topic: topics.CabEvent, + Access: acl.Sub, }, { - Topic: topics.SuperappEvent, - AccessType: acl.Sub, + Topic: topics.SuperappEvent, + Access: acl.Sub, }, { - Topic: topics.PassengerLocation, - AccessType: acl.Pub, + Topic: topics.PassengerLocation, + Access: acl.Pub, }, { - Topic: topics.SharedLocation, - AccessType: acl.Sub, + Topic: topics.SharedLocation, + Access: acl.Sub, }, { - Topic: topics.Chat, - AccessType: acl.Sub, + Topic: topics.Chat, + Access: acl.Sub, }, { - Topic: topics.CallEntry, - AccessType: acl.Pub, + Topic: topics.CallEntry, + Access: acl.Pub, }, { - Topic: topics.CallOutgoing, - AccessType: acl.Sub, + Topic: topics.CallOutgoing, + Access: acl.Sub, }, }, } From 8ba0db8ad3a4150652f95e3443848e93ed72a04a Mon Sep 17 00:00:00 2001 From: Parham Alvani Date: Wed, 17 Nov 2021 02:06:21 +0330 Subject: [PATCH 078/660] feat: update acl package --- pkg/acl/acl.go | 25 +++++++ pkg/acl/utils.go | 53 -------------- pkg/acl/utils_test.go | 162 ------------------------------------------ 3 files changed, 25 insertions(+), 215 deletions(-) create mode 100644 pkg/acl/acl.go delete mode 100644 pkg/acl/utils.go delete mode 100644 pkg/acl/utils_test.go diff --git a/pkg/acl/acl.go b/pkg/acl/acl.go new file mode 100644 index 00000000..82bc8282 --- /dev/null +++ b/pkg/acl/acl.go @@ -0,0 +1,25 @@ +package acl + +// Access Types for EMQ contains subscribe, publish and publish-subscribe. +type AccessType string + +const ( + Sub AccessType = "1" + Pub AccessType = "2" + PubSub AccessType = "3" + + ClientCredentials = "client_credentials" +) + +func (a AccessType) String() string { + switch a { + case Sub: + return "subscribe" + case Pub: + return "publish" + case PubSub: + return "publish-subscribe" + } + + return "" +} diff --git a/pkg/acl/utils.go b/pkg/acl/utils.go deleted file mode 100644 index 6329e256..00000000 --- a/pkg/acl/utils.go +++ /dev/null @@ -1,53 +0,0 @@ -package acl - -// Access Types for EMQ contains subscribe, publish and publish-subscribe. -type AccessType string - -const ( - Sub AccessType = "1" - Pub AccessType = "2" - PubSub AccessType = "3" - - ClientCredentials = "client_credentials" -) - -func (a AccessType) String() string { - switch a { - case Sub: - return "subscribe" - case Pub: - return "publish" - case PubSub: - return "publish-subscribe" - } - - return "" -} - -// ValidateEndpoint takes authorizedEndpoints and unauthorizedEndpoints and -// tell whether a endpoint is authorized or not. -func ValidateEndpoint(endpoint string, authorizedEndpoints, unauthorizedEndpoints []string) bool { - if len(authorizedEndpoints) == 0 && len(unauthorizedEndpoints) == 0 { - return true - } - - isValid := false - - for _, e := range authorizedEndpoints { - if e == endpoint { - isValid = true - - break - } - } - - for _, e := range unauthorizedEndpoints { - if e == endpoint { - isValid = false - - break - } - } - - return isValid -} diff --git a/pkg/acl/utils_test.go b/pkg/acl/utils_test.go deleted file mode 100644 index 2582a151..00000000 --- a/pkg/acl/utils_test.go +++ /dev/null @@ -1,162 +0,0 @@ -package acl_test - -import ( - "testing" - - "gitlab.snapp.ir/dispatching/soteria/v3/pkg/acl" -) - -// nolint: funlen -func TestValidateEndpoint(t *testing.T) { - t.Parallel() - - type args struct { - endpoint string - authorizedEndpoints []string - unauthorizedEndpoints []string - } - - tests := []struct { - name string - args args - want bool - }{ - { - name: "#1", - args: args{ - endpoint: "", - authorizedEndpoints: []string{}, - unauthorizedEndpoints: []string{}, - }, - want: true, - }, - { - name: "#2", - args: args{ - endpoint: "/push", - authorizedEndpoints: []string{"/push"}, - unauthorizedEndpoints: []string{"/push"}, - }, - want: false, - }, - { - name: "#3", - args: args{ - endpoint: "/push", - authorizedEndpoints: []string{"/push"}, - unauthorizedEndpoints: []string{"/events"}, - }, - want: true, - }, - { - name: "#4", - args: args{ - endpoint: "/events", - authorizedEndpoints: []string{"/push"}, - unauthorizedEndpoints: []string{"/events"}, - }, - want: false, - }, - { - name: "#5", - args: args{ - endpoint: "/events", - authorizedEndpoints: []string{"/push"}, - unauthorizedEndpoints: []string{"/event"}, - }, - want: false, - }, - } - for _, tt := range tests { - tt := tt - t.Run(tt.name, func(t *testing.T) { - t.Parallel() - if got := acl.ValidateEndpoint(tt.args.endpoint, tt.args.authorizedEndpoints, - tt.args.unauthorizedEndpoints); got != tt.want { - t.Errorf("ValidateEndpoint() = %v, want %v", got, tt.want) - } - }) - } -} - -// nolint: funlen -func TestValidateIP(t *testing.T) { - t.Parallel() - - type args struct { - IP string - validIPs []string - invalidIPs []string - } - - tests := []struct { - name string - args args - want bool - }{ - { - name: "#1", - args: args{ - IP: "192.168.24.56", - validIPs: []string{}, - invalidIPs: []string{}, - }, - want: false, - }, - { - name: "#2", - args: args{ - IP: "192.168.24.56", - validIPs: []string{"192.168.24.56"}, - invalidIPs: []string{"192.168.24.56"}, - }, - want: false, - }, - { - name: "#3", - args: args{ - IP: "192.168.24.56", - validIPs: []string{"192.168.24.0/8"}, - invalidIPs: []string{"192.168.24.56"}, - }, - want: false, - }, - { - name: "#4", - args: args{ - IP: "192.168.24.56", - validIPs: []string{"192.168.24.0/8"}, - invalidIPs: []string{"192.168.24.8"}, - }, - want: true, - }, - { - name: "#5", - args: args{ - IP: "192.168.24.56", - validIPs: []string{"192.168.24.56"}, - invalidIPs: []string{"192.168.24.8/8"}, - }, - want: false, - }, - { - name: "#6", - args: args{ - IP: "192.168.24.56", - validIPs: []string{"192.168.24.1", "192.168.0.0/16"}, - invalidIPs: []string{"192.168.24.89"}, - }, - want: true, - }, - } - - for _, tt := range tests { - tt := tt - t.Run(tt.name, func(t *testing.T) { - t.Parallel() - if got := acl.ValidateIP(tt.args.IP, tt.args.validIPs, tt.args.invalidIPs); got != tt.want { - t.Errorf("ValidateIP() = %v, want %v", got, tt.want) - } - }) - } -} From 6c75f28fd6af803097407c3bca43322087d6c7ae Mon Sep 17 00:00:00 2001 From: Parham Alvani Date: Wed, 17 Nov 2021 02:10:15 +0330 Subject: [PATCH 079/660] feat: update chart version --- deployments/soteria/Chart.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/deployments/soteria/Chart.yaml b/deployments/soteria/Chart.yaml index f33b5b05..bcaffdf3 100644 --- a/deployments/soteria/Chart.yaml +++ b/deployments/soteria/Chart.yaml @@ -5,6 +5,6 @@ description: Soteria Helm Chart type: application -version: 5.0.2 +version: 5.0.3 -appVersion: "v5-0-2" +appVersion: "v5-0-3" From d2d9dd8c7bfd71e4a3a2ba40dd2551576b854f05 Mon Sep 17 00:00:00 2001 From: Parham Alvani Date: Wed, 17 Nov 2021 09:23:29 +0330 Subject: [PATCH 080/660] fix: correct zap logger lint issues --- pkg/log/l.go | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/pkg/log/l.go b/pkg/log/l.go index 63f27155..6144d0ad 100644 --- a/pkg/log/l.go +++ b/pkg/log/l.go @@ -10,21 +10,22 @@ import ( var atom zap.AtomicLevel -// InitLogger will replace global zap.L() with our own preferred configs +// InitLogger will replace global zap.L() with our own preferred configs. func InitLogger() func() { config := zap.NewProductionEncoderConfig() encoder := zapcore.NewJSONEncoder(config) atom = zap.NewAtomicLevel() logger := zap.New(zapcore.NewCore(encoder, zapcore.Lock(os.Stdout), atom)) + return zap.ReplaceGlobals(logger) } -// SetLevel will change zap's log level +// SetLevel will change zap's log level. func SetLevel(lvl string) { atom.SetLevel(parseLevel(lvl)) } -// parseLevel will convert a string based log level to zapcore.Level +// parseLevel will convert a string based log level to zapcore.Level. func parseLevel(lvl string) zapcore.Level { lvl = strings.ToLower(lvl) switch lvl { From a833afcd397bfbc6b0617c94ed5a92bb9738f514 Mon Sep 17 00:00:00 2001 From: Parham Alvani Date: Wed, 17 Nov 2021 09:30:37 +0330 Subject: [PATCH 081/660] fix: correct default config --- internal/config/default.go | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/internal/config/default.go b/internal/config/default.go index c6ca8dcf..a1d72ca5 100644 --- a/internal/config/default.go +++ b/internal/config/default.go @@ -6,6 +6,12 @@ import ( "gitlab.snapp.ir/dispatching/soteria/v3/pkg/user" ) +const ( + DefaultHTTPPort = 9999 + DefaultDriverHashLength = 15 + DefaultPassengerHashLength = 15 +) + // Default return default configuration. func Default() Config { return Config{ @@ -13,8 +19,8 @@ func Default() Config { "pub", "sub", }, - PassengerHashLength: 15, - DriverHashLength: 15, + PassengerHashLength: DefaultPassengerHashLength, + DriverHashLength: DefaultDriverHashLength, PassengerSalt: "secret", DriverSalt: "secret", JWT: &JWT{ @@ -23,7 +29,7 @@ func Default() Config { Logger: &Logger{ Level: "warn", }, - HTTPPort: 0, + HTTPPort: DefaultHTTPPort, Tracer: &TracerConfig{ Enabled: false, ServiceName: "", From 2133ce274d16f208dff1f20dcce245b41141f2bd Mon Sep 17 00:00:00 2001 From: Parham Alvani Date: Wed, 17 Nov 2021 09:35:10 +0330 Subject: [PATCH 082/660] fix: better prometheus metrics --- internal/api/api.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/internal/api/api.go b/internal/api/api.go index b53d2c08..271619d5 100644 --- a/internal/api/api.go +++ b/internal/api/api.go @@ -7,7 +7,7 @@ import ( "go.uber.org/zap" ) -// ReSTServer will return an HTTP.Server with given port and gin mode +// ReSTServer will return fiber app. func ReSTServer() *fiber.App { app := fiber.New() @@ -15,12 +15,12 @@ func ReSTServer() *fiber.App { Logger: zap.L(), })) - app.Post("/auth", Auth) - app.Post("/acl", ACL) - - prometheus := fiberprometheus.NewWith("soteria", "dispatching", "http") + prometheus := fiberprometheus.NewWith("http", "dispatching", "soteria") prometheus.RegisterAt(app, "/metrics") app.Use(prometheus.Middleware) + app.Post("/auth", Auth) + app.Post("/acl", ACL) + return app } From d86e50bb91ae59f22e07d8394e48e8bbe30c66e6 Mon Sep 17 00:00:00 2001 From: Parham Alvani Date: Wed, 17 Nov 2021 09:40:31 +0330 Subject: [PATCH 083/660] feat: update chart values --- deployments/soteria/values.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/deployments/soteria/values.yaml b/deployments/soteria/values.yaml index be93c781..cadf6e4f 100644 --- a/deployments/soteria/values.yaml +++ b/deployments/soteria/values.yaml @@ -43,7 +43,7 @@ rollingParams: ingress: enabled: false - annotations: { } + annotations: {} # kubernetes.io/ingress.class: nginDeploymentConfigx # kubernetes.io/tls-acme: "true" hosts: From 31ee636f0676ae21d54a0db16719f0d4d60b137d Mon Sep 17 00:00:00 2001 From: Parham Alvani Date: Wed, 17 Nov 2021 09:44:10 +0330 Subject: [PATCH 084/660] feat: update chart version --- deployments/soteria/Chart.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/deployments/soteria/Chart.yaml b/deployments/soteria/Chart.yaml index bcaffdf3..1ff3a666 100644 --- a/deployments/soteria/Chart.yaml +++ b/deployments/soteria/Chart.yaml @@ -5,6 +5,6 @@ description: Soteria Helm Chart type: application -version: 5.0.3 +version: 5.0.4 -appVersion: "v5-0-3" +appVersion: "v5-0-4" From 6988409999311a9b75ca904a664ef3f9f0aa7e38 Mon Sep 17 00:00:00 2001 From: Parham Alvani Date: Wed, 24 Nov 2021 23:32:03 +0330 Subject: [PATCH 085/660] feat: add golangci configuration --- .golangci.yml | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 .golangci.yml diff --git a/.golangci.yml b/.golangci.yml new file mode 100644 index 00000000..404ea51d --- /dev/null +++ b/.golangci.yml @@ -0,0 +1,13 @@ +--- +linters: + enable-all: true + disable: + # we don't use json with camel-case + - tagliatelle + # it should improve to support more known patterns + - varnamelen + # deprecated linters + - maligned + - scopelint + - golint + - interfacer From 5ccac4bb9ea77bb25693201353aab4e22dc5514c Mon Sep 17 00:00:00 2001 From: Parham Alvani Date: Wed, 24 Nov 2021 23:33:05 +0330 Subject: [PATCH 086/660] feat: add lint stage --- .gitlab/ci/templates/test.gitlab-ci.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.gitlab/ci/templates/test.gitlab-ci.yml b/.gitlab/ci/templates/test.gitlab-ci.yml index c604e071..f88873cb 100644 --- a/.gitlab/ci/templates/test.gitlab-ci.yml +++ b/.gitlab/ci/templates/test.gitlab-ci.yml @@ -1,5 +1,8 @@ --- -unit_tests: +lint: + extends: .easy_ci:lint + +test: image: registry.snapp.tech/docker/golang:1.17-alpine3.14 stage: test coverage: '/total:\s*\(statements\)\s*([\d.]+)%/' From c3a7d80d2fb46a5d68a7d6e57a85c8881cfdcc43 Mon Sep 17 00:00:00 2001 From: Parham Alvani Date: Wed, 24 Nov 2021 23:33:20 +0330 Subject: [PATCH 087/660] feat: use internal logger --- internal/logger/l.go | 34 ++++++++++++++++++++++++++++++++++ pkg/log/l.go | 43 ------------------------------------------- 2 files changed, 34 insertions(+), 43 deletions(-) create mode 100644 internal/logger/l.go delete mode 100644 pkg/log/l.go diff --git a/internal/logger/l.go b/internal/logger/l.go new file mode 100644 index 00000000..9dbe6195 --- /dev/null +++ b/internal/logger/l.go @@ -0,0 +1,34 @@ +package logger + +import ( + "log" + "os" + + "go.uber.org/zap" + "go.uber.org/zap/zapcore" +) + +type Config struct { + Level string `koanf:"level"` +} + +// New creates a zap logger for console. +func New(cfg Config) *zap.Logger { + var lvl zapcore.Level + if err := lvl.Set(cfg.Level); err != nil { + log.Printf("cannot parse log level %s: %s", cfg.Level, err) + + lvl = zapcore.WarnLevel + } + + encoder := zapcore.NewConsoleEncoder(zap.NewDevelopmentEncoderConfig()) + defaultCore := zapcore.NewCore(encoder, zapcore.Lock(zapcore.AddSync(os.Stderr)), lvl) + cores := []zapcore.Core{ + defaultCore, + } + + core := zapcore.NewTee(cores...) + logger := zap.New(core, zap.AddCaller(), zap.AddStacktrace(zap.ErrorLevel)) + + return logger +} diff --git a/pkg/log/l.go b/pkg/log/l.go deleted file mode 100644 index 6144d0ad..00000000 --- a/pkg/log/l.go +++ /dev/null @@ -1,43 +0,0 @@ -package log - -import ( - "os" - "strings" - - "go.uber.org/zap" - "go.uber.org/zap/zapcore" -) - -var atom zap.AtomicLevel - -// InitLogger will replace global zap.L() with our own preferred configs. -func InitLogger() func() { - config := zap.NewProductionEncoderConfig() - encoder := zapcore.NewJSONEncoder(config) - atom = zap.NewAtomicLevel() - logger := zap.New(zapcore.NewCore(encoder, zapcore.Lock(os.Stdout), atom)) - - return zap.ReplaceGlobals(logger) -} - -// SetLevel will change zap's log level. -func SetLevel(lvl string) { - atom.SetLevel(parseLevel(lvl)) -} - -// parseLevel will convert a string based log level to zapcore.Level. -func parseLevel(lvl string) zapcore.Level { - lvl = strings.ToLower(lvl) - switch lvl { - case "debug": - return zapcore.DebugLevel - case "info": - return zapcore.InfoLevel - case "warn": - return zapcore.WarnLevel - case "error": - return zapcore.ErrorLevel - default: - return zapcore.ErrorLevel - } -} From c070258efe24c3f2219aa47c86b90b501211288f Mon Sep 17 00:00:00 2001 From: Parham Alvani Date: Wed, 24 Nov 2021 23:34:10 +0330 Subject: [PATCH 088/660] feat: remove docker-compose --- docker-compose.yml | 30 ------------------------------ 1 file changed, 30 deletions(-) delete mode 100644 docker-compose.yml diff --git a/docker-compose.yml b/docker-compose.yml deleted file mode 100644 index 09463618..00000000 --- a/docker-compose.yml +++ /dev/null @@ -1,30 +0,0 @@ -version: '3.7' -services: - soteria: - container_name: soteria - image: soteria:latest - working_dir: /go/src/app - ports: - - 9999:9999 - - 50051:50051 - volumes: - - .:/go/src/app - depends_on: - - redis - environment: - SOTERIA_LOGGER_LEVEL: 'DEBUG' - SOTERIA_JWT_KEYS_PATH: '/go/src/app/test/' - SOTERIA_HTTP_PORT: '9999' - SOTERIA_GRPC_PORT: '50051' - SOTERIA_REDIS_ADDRESS: 'redis:6379' - redis: - image: redis - container_name: soteria-redis - ports: - - 6379:6379 - jaeger: - image: jaegertracing/all-in-one:latest - ports: - - 16686:16686 - - "6831:6831/udp" - - 14250:14250 From 32b5d68cb01c2a4d0df93578b2aeeb3200ac07ee Mon Sep 17 00:00:00 2001 From: Parham Alvani Date: Wed, 24 Nov 2021 23:34:37 +0330 Subject: [PATCH 089/660] feat: remove makefile --- Makefile | 36 ------------------------------------ 1 file changed, 36 deletions(-) delete mode 100644 Makefile diff --git a/Makefile b/Makefile deleted file mode 100644 index b1a30af4..00000000 --- a/Makefile +++ /dev/null @@ -1,36 +0,0 @@ -IMAGE_FLAG := $(shell git rev-parse --abbrev-ref HEAD | tr '/' '-') #get image flag from current branch name. -IMAGE_TAG ?= registry.apps.private.teh-1.snappcloud.io/dispatching-staging/soteria:${IMAGE_FLAG} - -dependencies: - go mod vendor -v - -compile: dependencies - go build --ldflags "-linkmode external -extldflags '-static'" -mod vendor -v cmd/soteria/soteria.go - -test: - go test --race -gcflags=-l -v -coverprofile .coverage.out.tmp ./... - cat .coverage.out.tmp | grep -v "mock.go" > .coverage.out - rm -rf .coverage.out.tmp - go tool cover -func .coverage.out - -html-report: test - go tool cover -html=.coverage.out -o coverage.html - -build-image: compile - docker build -t ${IMAGE_TAG} . - -push-image: build-image - docker push ${IMAGE_TAG} - -build-image-dev: compile - docker build -t soteria:latest . - -up: build-image-dev - docker-compose up - -down: - docker-compose down - docker-compose stop - docker rmi soteria - -.PHONY: all test clean From fc166d8927d2b87d289ad514c9f91d1178fecf3a Mon Sep 17 00:00:00 2001 From: Parham Alvani Date: Wed, 24 Nov 2021 23:39:24 +0330 Subject: [PATCH 090/660] feat: use cmd instead of command --- internal/cmd/root.go | 40 +++++++++++++++++++ .../{commands/serve.go => cmd/serve/main.go} | 36 ++++++++--------- internal/commands/root.go | 16 -------- 3 files changed, 57 insertions(+), 35 deletions(-) create mode 100644 internal/cmd/root.go rename internal/{commands/serve.go => cmd/serve/main.go} (84%) delete mode 100644 internal/commands/root.go diff --git a/internal/cmd/root.go b/internal/cmd/root.go new file mode 100644 index 00000000..29435cb0 --- /dev/null +++ b/internal/cmd/root.go @@ -0,0 +1,40 @@ +package cmd + +import ( + "os" + + "github.com/spf13/cobra" + "gitlab.snapp.ir/dispatching/soteria/v3/internal/cmd/serve" + "gitlab.snapp.ir/dispatching/soteria/v3/internal/config" + "gitlab.snapp.ir/dispatching/soteria/v3/internal/logger" + "go.uber.org/zap" +) + +// ExitFailure status code. +const ExitFailure = 1 + +// Execute adds all child commands to the root command and sets flags appropriately. +// This is called by main.main(). It only needs to happen once to the rootCmd. +func Execute() { + cfg := config.New() + + logger := logger.New(cfg.Logger) + + // nolint: exhaustivestruct + root := &cobra.Command{ + Use: "soteria", + Short: "Soteria is the authentication service.", + Long: `Soteria is responsible for Authentication and Authorization of every request witch send to EMQ Server.`, + Run: func(cmd *cobra.Command, args []string) { + cmd.Println("Run `soteria serve` to start serving requests") + }, + } + + serve.Register(root, cfg, logger) + + if err := root.Execute(); err != nil { + logger.Error("failed to execute root command", zap.Error(err)) + + os.Exit(ExitFailure) + } +} diff --git a/internal/commands/serve.go b/internal/cmd/serve/main.go similarity index 84% rename from internal/commands/serve.go rename to internal/cmd/serve/main.go index 1164fd28..15f99e5b 100644 --- a/internal/commands/serve.go +++ b/internal/cmd/serve/main.go @@ -1,4 +1,4 @@ -package commands +package serve import ( "crypto/rsa" @@ -16,28 +16,13 @@ import ( "gitlab.snapp.ir/dispatching/soteria/v3/internal/config" "gitlab.snapp.ir/dispatching/soteria/v3/internal/db" "gitlab.snapp.ir/dispatching/soteria/v3/internal/metrics" - "gitlab.snapp.ir/dispatching/soteria/v3/pkg/log" "gitlab.snapp.ir/dispatching/soteria/v3/pkg/tracer" "gitlab.snapp.ir/dispatching/soteria/v3/pkg/user" _ "go.uber.org/automaxprocs" "go.uber.org/zap" ) -var Serve = &cobra.Command{ - Use: "serve", - Short: "serve runs the application", - Long: `serve will run Soteria REST and gRPC server and waits until user disrupts.`, - PreRun: servePreRun, - Run: serveRun, -} - -var cfg config.Config - -func servePreRun(cmd *cobra.Command, args []string) { - cfg = config.New() - log.InitLogger() - log.SetLevel(cfg.Logger.Level) - +func main(cfg config.Config, logger *zap.Logger) { publicKey0, err := cfg.ReadPublicKey(user.Driver) if err != nil { zap.L().Fatal("could not read driver public key") @@ -85,9 +70,7 @@ func servePreRun(cmd *cobra.Command, args []string) { m := metrics.NewMetrics() app.GetInstance().SetMetrics(&m.Handler) -} -func serveRun(cmd *cobra.Command, args []string) { rest := api.ReSTServer() go func() { @@ -108,3 +91,18 @@ func serveRun(cmd *cobra.Command, args []string) { zap.L().Error("error happened while closing tracer", zap.Error(err)) } } + +// Register serve command. +func Register(root *cobra.Command, cfg config.Config, logger *zap.Logger) { + root.AddCommand( + // nolint: exhaustivestruct + &cobra.Command{ + Use: "serve", + Short: "serve runs the application", + Long: `serve will run Soteria ReST server and waits until user disrupts.`, + Run: func(cmd *cobra.Command, args []string) { + main(cfg, logger) + }, + }, + ) +} diff --git a/internal/commands/root.go b/internal/commands/root.go deleted file mode 100644 index 262f45d8..00000000 --- a/internal/commands/root.go +++ /dev/null @@ -1,16 +0,0 @@ -package commands - -import ( - "github.com/spf13/cobra" -) - -var Root = &cobra.Command{ - Use: "soteria", - Short: "Soteria is the authentication service.", - Long: `Soteria is responsible for Authentication and Authorization of every request witch send to EMQ Server.`, - Run: rootRun, -} - -func rootRun(cmd *cobra.Command, args []string) { - cmd.Println("Run `soteria serve` to start serving requests") -} From d6f2d69089c9019a4907ea5ed0d7bc3e265f9daa Mon Sep 17 00:00:00 2001 From: Parham Alvani Date: Wed, 24 Nov 2021 23:39:48 +0330 Subject: [PATCH 091/660] feat: add logger configuration --- internal/config/config.go | 8 ++------ internal/config/default.go | 4 +++- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/internal/config/config.go b/internal/config/config.go index a13d0d44..b330d633 100644 --- a/internal/config/config.go +++ b/internal/config/config.go @@ -14,6 +14,7 @@ import ( "github.com/knadh/koanf/providers/env" "github.com/knadh/koanf/providers/file" "github.com/knadh/koanf/providers/structs" + "gitlab.snapp.ir/dispatching/soteria/v3/internal/logger" "gitlab.snapp.ir/dispatching/soteria/v3/pkg/acl" "gitlab.snapp.ir/dispatching/soteria/v3/pkg/user" ) @@ -32,7 +33,7 @@ type ( PassengerSalt string `koanf:"passenger_salt"` DriverSalt string `koanf:"driver_salt"` JWT *JWT `koanf:"jwt"` - Logger *Logger `koanf:"logger"` + Logger logger.Config `koanf:"logger"` HTTPPort int `koanf:"http_port"` Tracer *TracerConfig `koanf:"tracer"` Company string `koanf:"company"` @@ -44,11 +45,6 @@ type ( Path string `koanf:"path"` } - // Logger is the config for logging and this kind of stuff. - Logger struct { - Level string `koanf:"level"` - } - // Tracer contains all configs needed to create a tracer. TracerConfig struct { Enabled bool `koanf:"enabled"` diff --git a/internal/config/default.go b/internal/config/default.go index a1d72ca5..3834dbed 100644 --- a/internal/config/default.go +++ b/internal/config/default.go @@ -1,6 +1,7 @@ package config import ( + "gitlab.snapp.ir/dispatching/soteria/v3/internal/logger" "gitlab.snapp.ir/dispatching/soteria/v3/internal/topics" "gitlab.snapp.ir/dispatching/soteria/v3/pkg/acl" "gitlab.snapp.ir/dispatching/soteria/v3/pkg/user" @@ -13,6 +14,7 @@ const ( ) // Default return default configuration. +// nolint: funlen func Default() Config { return Config{ AllowedAccessTypes: []string{ @@ -26,7 +28,7 @@ func Default() Config { JWT: &JWT{ Path: "test/", }, - Logger: &Logger{ + Logger: logger.Config{ Level: "warn", }, HTTPPort: DefaultHTTPPort, From 399d7f44523951de6820932535ad46d015c00a2c Mon Sep 17 00:00:00 2001 From: Parham Alvani Date: Wed, 24 Nov 2021 23:40:51 +0330 Subject: [PATCH 092/660] fix: correct soteria entrypoint --- cmd/soteria/soteria.go | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/cmd/soteria/soteria.go b/cmd/soteria/soteria.go index e10b05d9..5f277942 100644 --- a/cmd/soteria/soteria.go +++ b/cmd/soteria/soteria.go @@ -1,17 +1,9 @@ package main import ( - "log" - - "gitlab.snapp.ir/dispatching/soteria/v3/internal/commands" + "gitlab.snapp.ir/dispatching/soteria/v3/internal/cmd" ) func main() { - cli := commands.Root - - cli.AddCommand(commands.Serve) - - if err := cli.Execute(); err != nil { - log.Fatal(err) - } + cmd.Execute() } From 4584a058922ac27ff8819b25c1122905c9d6841e Mon Sep 17 00:00:00 2001 From: Parham Alvani Date: Wed, 24 Nov 2021 23:41:45 +0330 Subject: [PATCH 093/660] feat: remove unused errors package --- pkg/errors/code.go | 115 -------------------------------------------- pkg/errors/error.go | 23 --------- 2 files changed, 138 deletions(-) delete mode 100644 pkg/errors/code.go delete mode 100644 pkg/errors/error.go diff --git a/pkg/errors/code.go b/pkg/errors/code.go deleted file mode 100644 index 3c22d79c..00000000 --- a/pkg/errors/code.go +++ /dev/null @@ -1,115 +0,0 @@ -package errors - -import "net/http" - -// Code is the type of the error returned to user in api -type Code string - -const ( - SuccessfulOperation Code = "successful_operation" - BadRequestPayload Code = "bad_request_payload" - SignUpUserFailure Code = "sign_up_user_failure" - WrongUsernameOrPassword Code = "wrong_username_or_password" - DatabaseSaveFailure Code = "database_save_failure" - DatabaseGetFailure Code = "database_get_failure" - DatabaseUpdateFailure Code = "database_update_failure" - DatabaseDeleteFailure Code = "database_delete_failure" - PasswordHashGenerationFailure Code = "password_hash_generation_failure" - UsernameMismatch Code = "username_mismatch" - IPMisMatch Code = "ip_mismatch" - PublicKeyReadFormFailure Code = "public_key_read_form_failure" - PublicKeyOpenFailure Code = "public_key_open_failure" - PublicKeyReadFileFailure Code = "public_key_read_file_failure" - PublicKeyParseFailure Code = "public_key_parse_failure" - InvalidRuleUUID Code = "invalid_rule_uuid" - RuleNotFound Code = "rule_not_found" - InvalidRule Code = "invalid_rule" -) - -// Message will return detailed error information -func (e Code) Message() string { - switch e { - case SuccessfulOperation: - return "operation done successfully" - case BadRequestPayload: - return "request payload is not valid" - case SignUpUserFailure: - return "could not save user" - case WrongUsernameOrPassword: - return "username or password is not correct" - case DatabaseSaveFailure: - return "could not save info to database" - case DatabaseGetFailure: - return "could not get info from database" - case DatabaseUpdateFailure: - return "could update info in database" - case DatabaseDeleteFailure: - return "could delete info from database" - case PasswordHashGenerationFailure: - return "could not generate hash from password" - case UsernameMismatch: - return "provided username does not match with username in path" - case IPMisMatch: - return "ip is not authorized" - case PublicKeyReadFormFailure: - return "cloud not read public key file from form" - case PublicKeyOpenFailure: - return "could not open public key file" - case PublicKeyReadFileFailure: - return "could not read from opened public key file" - case PublicKeyParseFailure: - return "could not parse public key" - case InvalidRuleUUID: - return "provided rule UUID is not valid" - case RuleNotFound: - return "account has no rule with provided UUID" - case InvalidRule: - return "provided rule is not valid" - default: - return "" - } -} - -// HttpStatusCode returns the perfect HTTP Status Code for the error -func (e Code) HttpStatusCode() int { - switch e { - case SuccessfulOperation: - return http.StatusOK - case BadRequestPayload: - return http.StatusBadRequest - case SignUpUserFailure: - return http.StatusInternalServerError - case WrongUsernameOrPassword: - return http.StatusUnauthorized - case DatabaseSaveFailure: - return http.StatusInternalServerError - case DatabaseGetFailure: - return http.StatusInternalServerError - case DatabaseUpdateFailure: - return http.StatusInternalServerError - case DatabaseDeleteFailure: - return http.StatusInternalServerError - case PasswordHashGenerationFailure: - return http.StatusInternalServerError - case UsernameMismatch: - return http.StatusUnauthorized - case IPMisMatch: - return http.StatusUnauthorized - case PublicKeyReadFormFailure: - return http.StatusBadRequest - case PublicKeyOpenFailure: - return http.StatusBadRequest - case PublicKeyReadFileFailure: - return http.StatusInternalServerError - case PublicKeyParseFailure: - return http.StatusBadRequest - case InvalidRuleUUID: - return http.StatusBadRequest - case RuleNotFound: - return http.StatusNotFound - case InvalidRule: - return http.StatusBadRequest - default: - return http.StatusInternalServerError - } -} diff --git a/pkg/errors/error.go b/pkg/errors/error.go deleted file mode 100644 index 5d7dae66..00000000 --- a/pkg/errors/error.go +++ /dev/null @@ -1,23 +0,0 @@ -package errors - -import ( - "fmt" -) - -// Error is the error type that contains a Code and a message about the error -type Error struct { - Code Code - Message string -} - -func (e Error) Error() string { - return fmt.Sprintf("%s: %s", e.Code.Message(), e.Message) -} - -// CreateError returns an instance of Error with given information -func CreateError(code Code, message string) *Error { - return &Error{ - Code: code, - Message: message, - } -} From 7ab7f4d35f1f0e7afa1774e7e2084a86f449c19d Mon Sep 17 00:00:00 2001 From: Parham Alvani Date: Wed, 24 Nov 2021 23:54:32 +0330 Subject: [PATCH 094/660] fix: correct lint issue --- internal/api/api.go | 1 + 1 file changed, 1 insertion(+) diff --git a/internal/api/api.go b/internal/api/api.go index 271619d5..e5a284fd 100644 --- a/internal/api/api.go +++ b/internal/api/api.go @@ -11,6 +11,7 @@ import ( func ReSTServer() *fiber.App { app := fiber.New() + // nolint: exhaustivestruct app.Use(fiberzap.New(fiberzap.Config{ Logger: zap.L(), })) From 5b6c96d50197d7ceb8fcb26aa1f03ac00573f656 Mon Sep 17 00:00:00 2001 From: Parham Alvani Date: Thu, 25 Nov 2021 00:07:33 +0330 Subject: [PATCH 095/660] feat: switch to open telemetry --- go.mod | 23 +++++++++++++---------- go.sum | 55 +++++++++++++++++++++++-------------------------------- 2 files changed, 36 insertions(+), 42 deletions(-) diff --git a/go.mod b/go.mod index a63601f8..775effc2 100644 --- a/go.mod +++ b/go.mod @@ -7,12 +7,10 @@ require ( github.com/gofiber/contrib/fiberzap v0.0.0-20211104103143-eae1892b9aac github.com/gofiber/fiber/v2 v2.22.0 github.com/golang-jwt/jwt/v4 v4.1.0 - github.com/knadh/koanf v1.3.2 - github.com/opentracing/opentracing-go v1.2.0 + github.com/knadh/koanf v1.3.3 github.com/prometheus/client_golang v1.11.0 github.com/spf13/cobra v1.2.1 github.com/stretchr/testify v1.7.0 - github.com/uber/jaeger-client-go v2.29.1+incompatible gitlab.snapp.ir/dispatching/snappids/v2 v2.8.0 go.uber.org/atomic v1.9.0 // indirect go.uber.org/automaxprocs v1.4.0 @@ -20,13 +18,20 @@ require ( ) require ( - github.com/HdrHistogram/hdrhistogram-go v1.1.2 // indirect + go.opentelemetry.io/otel v1.2.0 + go.opentelemetry.io/otel/exporters/jaeger v1.2.0 + go.opentelemetry.io/otel/exporters/stdout/stdouttrace v1.2.0 + go.opentelemetry.io/otel/sdk v1.2.0 + go.opentelemetry.io/otel/trace v1.2.0 +) + +require ( github.com/andybalholm/brotli v1.0.4 // indirect github.com/beorn7/perks v1.0.1 // indirect github.com/cespare/xxhash/v2 v2.1.2 // indirect github.com/davecgh/go-spew v1.1.1 // indirect github.com/fatih/structs v1.1.0 // indirect - github.com/fsnotify/fsnotify v1.4.9 // indirect + github.com/fsnotify/fsnotify v1.5.1 // indirect github.com/gofiber/adaptor/v2 v2.1.14 // indirect github.com/gofiber/utils v0.1.2 // indirect github.com/golang/protobuf v1.5.2 // indirect @@ -35,9 +40,8 @@ require ( github.com/kr/pretty v0.3.0 // indirect github.com/matttproud/golang_protobuf_extensions v1.0.1 // indirect github.com/mitchellh/copystructure v1.2.0 // indirect - github.com/mitchellh/mapstructure v1.4.1 // indirect + github.com/mitchellh/mapstructure v1.4.2 // indirect github.com/mitchellh/reflectwalk v1.0.2 // indirect - github.com/pkg/errors v0.9.1 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect github.com/prometheus/client_model v0.2.0 // indirect github.com/prometheus/common v0.32.1 // indirect @@ -45,13 +49,12 @@ require ( github.com/rogpeppe/go-internal v1.8.0 // indirect github.com/speps/go-hashids/v2 v2.0.1 // indirect github.com/spf13/pflag v1.0.5 // indirect - github.com/uber/jaeger-lib v2.4.1+incompatible // indirect github.com/valyala/bytebufferpool v1.0.0 // indirect github.com/valyala/fasthttp v1.31.0 // indirect github.com/valyala/tcplisten v1.0.0 // indirect go.uber.org/multierr v1.7.0 // indirect - golang.org/x/sys v0.0.0-20211116061358-0a5406a5449c // indirect - google.golang.org/protobuf v1.26.0 // indirect + golang.org/x/sys v0.0.0-20211123173158-ef496fb156ab // indirect + google.golang.org/protobuf v1.27.1 // indirect gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c // indirect gopkg.in/yaml.v2 v2.4.0 // indirect gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b // indirect diff --git a/go.sum b/go.sum index 481226af..392dd598 100644 --- a/go.sum +++ b/go.sum @@ -41,14 +41,11 @@ cloud.google.com/go/storage v1.10.0/go.mod h1:FLPqc6j+Ki4BU591ie1oL6qBQGu2Bl/tZ9 dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= -github.com/HdrHistogram/hdrhistogram-go v1.1.2 h1:5IcZpTvzydCQeHzK4Ef/D5rrSqwxob0t8PQPMybUNFM= -github.com/HdrHistogram/hdrhistogram-go v1.1.2/go.mod h1:yDgFjdqOqDEKOvasDdhWNXYg9BVp4O+o5f6V/ehm6Oo= github.com/Knetic/govaluate v3.0.1-0.20171022003610-9aa49832a739+incompatible/go.mod h1:r7JcOSlj0wfOMncg0iLm8Leh48TZaKVeNIfJntJ2wa0= github.com/Shopify/sarama v1.19.0/go.mod h1:FVkBWblsNy7DGZRfXLU0O9RCGt5g3g3yEuWXgklEdEo= github.com/Shopify/toxiproxy v2.1.4+incompatible/go.mod h1:OXgGpZ6Cli1/URJOF1DMxUHB2q5Ap20/P/eIdh4G0pI= github.com/VividCortex/gohistogram v1.0.0/go.mod h1:Pf5mBqqDxYaXu3hDrrU+w6nw50o/4+TcAqDqk/vUH7g= github.com/afex/hystrix-go v0.0.0-20180502004556-fa1af6a1f4f5/go.mod h1:SkGFH1ia65gfNATL8TAiHDNxPzPdmEL5uirI2Uyuz6c= -github.com/ajstarks/svgo v0.0.0-20180226025133-644b8db467af/go.mod h1:K08gAheRH3/J6wwsYMMT4xOr94bZjxIelGM0+d/wbFw= github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= @@ -134,12 +131,12 @@ github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7 github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= github.com/fatih/structs v1.1.0 h1:Q7juDM0QtcnhCpeyLGQKyg4TOIghuNXrkL32pHAUMxo= github.com/fatih/structs v1.1.0/go.mod h1:9NiDSp5zOcgEDl+j00MP/WkGVPOlPRLejGD8Ga6PJ7M= -github.com/fogleman/gg v1.2.1-0.20190220221249-0403632d5b90/go.mod h1:R/bRT+9gY/C5z7JzPU0zXsXHKM4/ayA+zqcVNZzPa1k= github.com/franela/goblin v0.0.0-20200105215937-c9ffbefa60db/go.mod h1:7dvUGVsVBjqR7JHJk0brhHOZYGmfBYOrK0ZhYMEtBr4= github.com/franela/goreq v0.0.0-20171204163338-bcd34c9993f8/go.mod h1:ZhphrRTfi2rbfLwlschooIH4+wKKDR4Pdxhh+TRoA20= github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= -github.com/fsnotify/fsnotify v1.4.9 h1:hsms1Qyu0jgnwNXIxa+/V/PDsU6CfLf6CNO8H7IWoS4= github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ= +github.com/fsnotify/fsnotify v1.5.1 h1:mZcQUHVQUQWoPXXtuf9yuEXKudkV2sx1E06UadKWpgI= +github.com/fsnotify/fsnotify v1.5.1/go.mod h1:T3375wBYaZdLLcVNkcVbzGHY7f1l/uK5T5Ai1i3InKU= github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU= github.com/go-gl/glfw/v3.3/glfw v0.0.0-20191125211704-12ad95a8df72/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= @@ -175,7 +172,6 @@ github.com/gogo/protobuf v1.2.1/go.mod h1:hp+jE20tsWTFYpLwKvXlhS1hjn+gTNwPg2I6zV github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q= github.com/golang-jwt/jwt/v4 v4.1.0 h1:XUgk2Ex5veyVFVeLm0xhusUTQybEbexJXrvPNOKkSY0= github.com/golang-jwt/jwt/v4 v4.1.0/go.mod h1:/xlHOz8bRuivTWchD4jCa+NbatV+wEUSzwAxVc6locg= -github.com/golang/freetype v0.0.0-20170609003504-e2365dfdc4a0/go.mod h1:E/TSTwGwJL78qG/PmXZO1EjYhfJinVAhrmmHX6Z8B9k= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= github.com/golang/groupcache v0.0.0-20160516000752-02826c3e7903/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= @@ -314,7 +310,6 @@ github.com/jstemmer/go-junit-report v0.9.1/go.mod h1:Brl9GWCQeLvo8nXZwPNNblvFj/X github.com/jtolds/gls v4.20.0+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfVYBRgL+9YlvaHOwJU= github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w= github.com/julienschmidt/httprouter v1.3.0/go.mod h1:JR6WtHb+2LUe8TCKY3cZOxFyyO8IZAc4RVcycCCAKdM= -github.com/jung-kurt/gofpdf v1.0.3-0.20190309125859-24315acbbda5/go.mod h1:7Id9E/uU8ce6rXgefFLlgrJj/GYY22cpxn+r32jIOes= github.com/kisielk/errcheck v1.1.0/go.mod h1:EZBBE59ingxPouuu3KfxchcWSUPOHkagtvWXihfKN4Q= github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8= github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= @@ -322,8 +317,8 @@ github.com/klauspost/compress v1.10.7/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdYs github.com/klauspost/compress v1.13.4/go.mod h1:8dP1Hq4DHOhN9w426knH3Rhby4rFm6D8eO+e+Dq5Gzg= github.com/klauspost/compress v1.13.6 h1:P76CopJELS0TiO2mebmnzgWaajssP/EszplttgQxcgc= github.com/klauspost/compress v1.13.6/go.mod h1:/3/Vjq9QcHkK5uEr5lBEmyoZ1iFhe47etQ6QUkpK6sk= -github.com/knadh/koanf v1.3.2 h1:0JKfmTLcvEmdJwjY16BMOVKpqThxRwj29CtQvZiCsAA= -github.com/knadh/koanf v1.3.2/go.mod h1:HZ7HMLIGbrWJUfgtEzfHvzR/rX+eIqQlBNPRr4Vt42s= +github.com/knadh/koanf v1.3.3 h1:eNtBOzQDzkzIIPRCJCx/Ha3DeD/ZFwCAp8JxyqoVAls= +github.com/knadh/koanf v1.3.3/go.mod h1:1cfH5223ZeZUOs8FU2UdTmaNfHpqgtjV0+NHjRO43gs= github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/konsorten/go-windows-terminal-sequences v1.0.3/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/kr/fs v0.1.0/go.mod h1:FFnZGqtBN9Gxj7eW1uZ42v5BccTP0vu6NEaFoC2HwRg= @@ -360,8 +355,9 @@ github.com/mitchellh/gox v0.4.0/go.mod h1:Sd9lOJ0+aimLBi73mGofS1ycjY8lL3uZM3JPS4 github.com/mitchellh/iochan v1.0.0/go.mod h1:JwYml1nuB7xOzsp52dPpHFffvOCDupsG0QubkSMEySY= github.com/mitchellh/mapstructure v0.0.0-20160808181253-ca63d7c062ee/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= -github.com/mitchellh/mapstructure v1.4.1 h1:CpVNEelQCZBooIPDn+AR3NpivK/TIKU8bDxdASFVQag= github.com/mitchellh/mapstructure v1.4.1/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= +github.com/mitchellh/mapstructure v1.4.2 h1:6h7AQ0yhTcIsmFmnAwQls75jp2Gzs4iB8W7pjMO+rqo= +github.com/mitchellh/mapstructure v1.4.2/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= github.com/mitchellh/reflectwalk v1.0.0/go.mod h1:mSTlrgnPZtwu0c4WaC2kGObEpuNDbx0jmZXqmk4esnw= github.com/mitchellh/reflectwalk v1.0.2 h1:G2LzWKi524PWgd3mLHV8Y5k7s6XUvT0Gef6zxSIeXaQ= github.com/mitchellh/reflectwalk v1.0.2/go.mod h1:mSTlrgnPZtwu0c4WaC2kGObEpuNDbx0jmZXqmk4esnw= @@ -378,7 +374,7 @@ github.com/nats-io/nats.go v1.9.1/go.mod h1:ZjDU1L/7fJ09jvUSRVBR2e7+RnLiiIQyqyzE github.com/nats-io/nkeys v0.1.0/go.mod h1:xpnFELMwJABBLVhffcfd1MZx6VsNRFpEugbxziKVo7w= github.com/nats-io/nkeys v0.1.3/go.mod h1:xpnFELMwJABBLVhffcfd1MZx6VsNRFpEugbxziKVo7w= github.com/nats-io/nuid v1.0.1/go.mod h1:19wcPz3Ph3q0Jbyiqsd0kePYG7A95tJPxeL+1OSON2c= -github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno= +github.com/npillmayer/nestext v0.1.3/go.mod h1:h2lrijH8jpicr25dFY+oAJLyzlya6jhnuG+zWp9L0Uk= github.com/oklog/oklog v0.3.2/go.mod h1:FCV+B7mhrz4o+ueLpx+KqkyXRGMWOYEvfiXtdGtbWGs= github.com/oklog/run v1.0.0/go.mod h1:dlhp/R75TPv97u0XWUtDeV/lRKWPKSdTuV0TZvrmrQA= github.com/olekukonko/tablewriter v0.0.0-20170122224234-a0225b3f23b5/go.mod h1:vsDQFd/mU46D+Z4whnwzcISnGGzXWMclvtLoiIKAKIo= @@ -390,8 +386,6 @@ github.com/opentracing-contrib/go-observer v0.0.0-20170622124052-a52f23424492/go github.com/opentracing/basictracer-go v1.0.0/go.mod h1:QfBfYuafItcjQuMwinw9GhYKwFXS9KnPs5lxoYwgW74= github.com/opentracing/opentracing-go v1.0.2/go.mod h1:UkNAQd3GIcIGf0SeVgPpRdFStlNbqXla1AfSYxPUl2o= github.com/opentracing/opentracing-go v1.1.0/go.mod h1:UkNAQd3GIcIGf0SeVgPpRdFStlNbqXla1AfSYxPUl2o= -github.com/opentracing/opentracing-go v1.2.0 h1:uEJPy/1a5RIPAJ0Ov+OIO8OxWu77jEv+1B0VhjKrZUs= -github.com/opentracing/opentracing-go v1.2.0/go.mod h1:GxEUsuufX4nBwe+T+Wl9TAgYrxe9dPLANfrWvHYVTgc= github.com/openzipkin-contrib/zipkin-go-opentracing v0.4.5/go.mod h1:/wsWhb9smxSfWAKL3wpBW7V8scJMt8N8gnaMCS9E/cA= github.com/openzipkin/zipkin-go v0.1.6/go.mod h1:QgAqvLzwWbR/WpD4A3cGpPtJrZXNIiJc5AZX7/PBEpw= github.com/openzipkin/zipkin-go v0.2.1/go.mod h1:NaW6tEwdmWMaCDZzg8sh+IBNOxHMPnhQw8ySjnjRyN4= @@ -497,10 +491,6 @@ github.com/stretchr/testify v1.7.0 h1:nwc3DEeHmmLAfoZucVR881uASk0Mfjw8xYJ99tb5Cc github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/subosito/gotenv v1.2.0/go.mod h1:N0PQaV/YGNqwC0u51sEeR/aUtSLEXKX9iv69rRypqCw= github.com/tmc/grpc-websocket-proxy v0.0.0-20170815181823-89b8d40f7ca8/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U= -github.com/uber/jaeger-client-go v2.29.1+incompatible h1:R9ec3zO3sGpzs0abd43Y+fBZRJ9uiH6lXyR/+u6brW4= -github.com/uber/jaeger-client-go v2.29.1+incompatible/go.mod h1:WVhlPFC8FDjOFMMWRy2pZqQJSXxYSwNYOkTr/Z6d3Kk= -github.com/uber/jaeger-lib v2.4.1+incompatible h1:td4jdvLcExb4cBISKIpHuGoVXh+dVKhn2Um6rjCsSsg= -github.com/uber/jaeger-lib v2.4.1+incompatible/go.mod h1:ComeNDZlWwrWnDv8aPp0Ba6+uUTzImX/AauajbLI56U= github.com/urfave/cli v1.20.0/go.mod h1:70zkFmudgCuE/ngEzBv17Jvp/497gISqfk5gWijbERA= github.com/urfave/cli v1.22.1/go.mod h1:Gos4lmkARVdJ6EkW0WaNv/tZAAMe9V7XWyB60NtXRu0= github.com/valyala/bytebufferpool v1.0.0 h1:GqA5TC/0021Y/b9FG4Oi9Mr3q7XYx6KllzawFIhcdPw= @@ -534,6 +524,16 @@ go.opencensus.io v0.22.3/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= go.opencensus.io v0.22.4/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= go.opencensus.io v0.22.5/go.mod h1:5pWMHQbX5EPX2/62yrJeAkowc+lfs/XD7Uxpq3pI6kk= go.opencensus.io v0.23.0/go.mod h1:XItmlyltB5F7CS4xOC1DcqMoFqwtC6OG2xF7mCv7P7E= +go.opentelemetry.io/otel v1.2.0 h1:YOQDvxO1FayUcT9MIhJhgMyNO1WqoduiyvQHzGN0kUQ= +go.opentelemetry.io/otel v1.2.0/go.mod h1:aT17Fk0Z1Nor9e0uisf98LrntPGMnk4frBO9+dkf69I= +go.opentelemetry.io/otel/exporters/jaeger v1.2.0 h1:C/5Egj3MJBXRJi22cSl07suqPqtZLnLFmH//OxETUEc= +go.opentelemetry.io/otel/exporters/jaeger v1.2.0/go.mod h1:KJLFbEMKTNPIfOxcg/WikIozEoKcPgJRz3Ce1vLlM8E= +go.opentelemetry.io/otel/exporters/stdout/stdouttrace v1.2.0 h1:OiYdrCq1Ctwnovp6EofSPwlp5aGy4LgKNbkg7PtEUw8= +go.opentelemetry.io/otel/exporters/stdout/stdouttrace v1.2.0/go.mod h1:DUFCmFkXr0VtAHl5Zq2JRx24G6ze5CAq8YfdD36RdX8= +go.opentelemetry.io/otel/sdk v1.2.0 h1:wKN260u4DesJYhyjxDa7LRFkuhH7ncEVKU37LWcyNIo= +go.opentelemetry.io/otel/sdk v1.2.0/go.mod h1:jNN8QtpvbsKhgaC6V5lHiejMoKD+V8uadoSafgHPx1U= +go.opentelemetry.io/otel/trace v1.2.0 h1:Ys3iqbqZhcf28hHzrm5WAquMkDHNZTUkw7KHbuNjej0= +go.opentelemetry.io/otel/trace v1.2.0/go.mod h1:N5FLswTubnxKxOJHM7XZC074qpeEdLy3CgAVsdMucK0= go.uber.org/atomic v1.3.2/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= go.uber.org/atomic v1.5.0/go.mod h1:sABNBOSYdrvTF6hTgEIbc7YasKWGhgEQZyfxyTvoXHQ= go.uber.org/atomic v1.7.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc= @@ -564,10 +564,7 @@ golang.org/x/crypto v0.0.0-20190820162420-60c769a6c586/go.mod h1:yigFU9vqHzYiE8U golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20210513164829-c07d793c2f9a/go.mod h1:P+XmwS30IXTQdn5tA2iutPOUgjI07+tq3H3K9MVA1s8= -golang.org/x/exp v0.0.0-20180321215751-8460e604b9de/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= -golang.org/x/exp v0.0.0-20180807140117-3d87b88a115f/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= -golang.org/x/exp v0.0.0-20190125153040-c74c464bbbf2/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= golang.org/x/exp v0.0.0-20190829153037-c13cbed26979/go.mod h1:86+5VVa7VpoJ4kLfm080zCjGlMRFzhUhsZKEZO7MGek= @@ -577,7 +574,6 @@ golang.org/x/exp v0.0.0-20191227195350-da58074b4299/go.mod h1:2RIsYlXP63K8oxa1u0 golang.org/x/exp v0.0.0-20200119233911-0405dc783f0a/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= golang.org/x/exp v0.0.0-20200207192155-f17229e696bd/go.mod h1:J/WKrq2StrnmMY6+EHIKF9dgMWnmCNThgcyBT1FY9mM= golang.org/x/exp v0.0.0-20200224162631-6cc2880d07d6/go.mod h1:3jZMyOhIsHpP37uCMkUooju7aAi5cS1Q23tOzKc+0MU= -golang.org/x/image v0.0.0-20180708004352-c73c2afc3b81/go.mod h1:ux5Hcp/YLpHSI86hEcLt0YII63i6oz57MZXIpbrjZUs= golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js= golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= @@ -729,12 +725,14 @@ golang.org/x/sys v0.0.0-20210320140829-1e4c9ba3b0c4/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20210330210617-4fbd30eecc44/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210403161142-5e06dd20ab57/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210423185535-09eb48e85fd7/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210514084401-e8d321eab015/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210603081109-ebe580a85c40/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20211013075003-97ac67df715c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20211116061358-0a5406a5449c h1:DHcbWVXeY+0Y8HHKR+rbLwnoh2F4tNCY7rTiHJ30RmA= -golang.org/x/sys v0.0.0-20211116061358-0a5406a5449c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20211123173158-ef496fb156ab h1:rfJ1bsoJQQIAoAxTxB7bme+vHrNkRw8CqfsYh9w54cw= +golang.org/x/sys v0.0.0-20211123173158-ef496fb156ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= @@ -750,11 +748,9 @@ golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxb golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/tools v0.0.0-20180221164845-07fd8470d635/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -golang.org/x/tools v0.0.0-20180525024113-a5b4c53f6e8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20180828015842-6cd1fcedba52/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -golang.org/x/tools v0.0.0-20190206041539-40960b6deb8e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= golang.org/x/tools v0.0.0-20190312151545-0bb0c0a6e846/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= @@ -813,10 +809,6 @@ golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8T golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 h1:go1bK/D/BFZV2I8cIQd1NKEZ+0owSTG1fDTci4IqFcE= golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -gonum.org/v1/gonum v0.0.0-20180816165407-929014505bf4/go.mod h1:Y+Yx5eoAFn32cQvJDxZx5Dpnq+c3wtXuadVZAcxbbBo= -gonum.org/v1/gonum v0.8.2/go.mod h1:oe/vMfY3deqTw+1EZJhuvEW2iwGF1bW9wwu7XCu0+v0= -gonum.org/v1/netlib v0.0.0-20190313105609-8cb42192e0e0/go.mod h1:wa6Ws7BG/ESfp6dHfk7C6KdzKA7wR7u/rKwOGE66zvw= -gonum.org/v1/plot v0.0.0-20190515093506-e2840ee46a6b/go.mod h1:Wt8AAjI+ypCyYX3nZBvf6cAIx93T+c/OS2HFAYskSZc= google.golang.org/api v0.3.1/go.mod h1:6wY9I6uQWHQ8EM57III9mq/AjF+i8G65rmVagqKMtkk= google.golang.org/api v0.4.0/go.mod h1:8k5glujaEP+g9n7WNsDg8QP6cUVNI86fCNMcbazEtwE= google.golang.org/api v0.7.0/go.mod h1:WtwebWUNSVBH/HAw79HIFXZNqEvBhG+Ra+ax0hx3E3M= @@ -929,14 +921,14 @@ google.golang.org/protobuf v1.23.1-0.20200526195155-81db48ad09cc/go.mod h1:EGpAD google.golang.org/protobuf v1.24.0/go.mod h1:r/3tXBNzIEhYS9I1OUVjXDlt8tc493IdKGjtUeSXeh4= google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c= google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= -google.golang.org/protobuf v1.26.0 h1:bxAC2xTBsZGibn2RTntX0oH50xLsqy1OxA9tTL3p/lk= google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= +google.golang.org/protobuf v1.27.1 h1:SnqbnDw1V7RiZcXPx5MEeqPv2s79L9i7BJUlG/+RurQ= +google.golang.org/protobuf v1.27.1/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= gopkg.in/asn1-ber.v1 v1.0.0-20181015200546-f715ec2f112d/go.mod h1:cuepJuh7vyXfUyUwEgHQXw849cJrilpS5NeIjOWESAw= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= gopkg.in/cheggaaa/pb.v1 v1.0.25/go.mod h1:V/YB90LKu/1FcN3WVnfiiE5oMCibMjukxqG/qStrOgw= @@ -970,7 +962,6 @@ honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt honnef.co/go/tools v0.0.1-2020.1.3/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= honnef.co/go/tools v0.0.1-2020.1.4/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8= -rsc.io/pdf v0.1.1/go.mod h1:n8OzWcQ6Sp37PL01nO98y4iUCRdTGarVfzxY20ICaU4= rsc.io/quote/v3 v3.1.0/go.mod h1:yEA65RcK8LyAZtP9Kv3t0HmxON59tX3rD+tICJqUlj0= rsc.io/sampler v1.3.0/go.mod h1:T1hPZKmBbMNahiBKFy5HrXp6adAjACjK9JXDnKaTXpA= sigs.k8s.io/yaml v1.1.0/go.mod h1:UJmg0vDUVViEyp3mgSv9WPwZCDxu4rQW1olrI1uml+o= From 0d56f18e32c6618d60b2c1b9b81f7657ecf53c97 Mon Sep 17 00:00:00 2001 From: Parham Alvani Date: Thu, 25 Nov 2021 00:07:46 +0330 Subject: [PATCH 096/660] feat: create tracing package --- internal/api/acl.go | 14 ++---- internal/api/auth.go | 16 ++----- internal/app/a.go | 7 ++- internal/authenticator/authenticator.go | 7 ++- internal/cmd/root.go | 6 ++- internal/cmd/serve/main.go | 31 +++++------- internal/config/config.go | 33 +++++-------- internal/config/default.go | 15 +++--- internal/tracing/config.go | 12 +++++ internal/tracing/tracer.go | 63 +++++++++++++++++++++++++ pkg/tracer/tracer.go | 32 ------------- 11 files changed, 127 insertions(+), 109 deletions(-) create mode 100644 internal/tracing/config.go create mode 100644 internal/tracing/tracer.go delete mode 100644 pkg/tracer/tracer.go diff --git a/internal/api/acl.go b/internal/api/acl.go index 001ca11a..af552e82 100644 --- a/internal/api/acl.go +++ b/internal/api/acl.go @@ -6,7 +6,6 @@ import ( "time" "github.com/gofiber/fiber/v2" - "github.com/opentracing/opentracing-go" "gitlab.snapp.ir/dispatching/soteria/v3/internal" "gitlab.snapp.ir/dispatching/soteria/v3/internal/app" "gitlab.snapp.ir/dispatching/soteria/v3/internal/authenticator" @@ -26,8 +25,8 @@ type aclRequest struct { // ACL is the handler responsible for ACL requests. func ACL(c *fiber.Ctx) error { - aclSpan := app.GetInstance().Tracer.StartSpan("api.rest.acl") - defer aclSpan.Finish() + _, span := app.GetInstance().Tracer.Start(c.Context(), "api.acl") + defer span.End() s := time.Now() @@ -80,15 +79,10 @@ func ACL(c *fiber.Ctx) error { return c.Status(http.StatusBadRequest).SendString("bad request") } - aclCheckSpan := app.GetInstance().Tracer.StartSpan("acl check", opentracing.ChildOf(aclSpan.Context())) - defer aclCheckSpan.Finish() - ok, err := app.GetInstance().Authenticator.ACL(request.Access, tokenString, topic) if err != nil || !ok { - aclCheckSpan.SetTag("success", false) - if err != nil { - aclCheckSpan.SetTag("error", err.Error()) + span.RecordError(err) } // nolint: exhaustivestruct @@ -124,7 +118,5 @@ func ACL(c *fiber.Ctx) error { app.GetInstance().Metrics.ObserveStatus(internal.HttpApi, internal.Soteria, request.Access.String(), internal.Success, string(topicType)) app.GetInstance().Metrics.ObserveResponseTime(internal.HttpApi, internal.Soteria, internal.Acl, float64(time.Since(s).Nanoseconds())) - aclCheckSpan.SetTag("success", true) - return c.Status(http.StatusOK).SendString("ok") } diff --git a/internal/api/auth.go b/internal/api/auth.go index afffe13b..ec58b8b9 100644 --- a/internal/api/auth.go +++ b/internal/api/auth.go @@ -5,7 +5,6 @@ import ( "time" "github.com/gofiber/fiber/v2" - "github.com/opentracing/opentracing-go" "gitlab.snapp.ir/dispatching/soteria/v3/internal" "gitlab.snapp.ir/dispatching/soteria/v3/internal/app" "go.uber.org/zap" @@ -22,11 +21,12 @@ type authRequest struct { // Auth is the handler responsible for authentication. func Auth(c *fiber.Ctx) error { - authSpan := app.GetInstance().Tracer.StartSpan("api.rest.auth") - defer authSpan.Finish() + _, span := app.GetInstance().Tracer.Start(c.Context(), "api.auth") + defer span.End() s := time.Now() - request := &authRequest{} + request := new(authRequest) + if err := c.BodyParser(request); err != nil { zap.L(). Warn("bad request", @@ -48,12 +48,8 @@ func Auth(c *fiber.Ctx) error { tokenString = request.Password } - authCheckSpan := app.GetInstance().Tracer.StartSpan("auth check", opentracing.ChildOf(authSpan.Context())) - defer authCheckSpan.Finish() - if err := app.GetInstance().Authenticator.Auth(tokenString); err != nil { - authCheckSpan.SetTag("success", false) - authCheckSpan.SetTag("error", err.Error()) + span.RecordError(err) zap.L(). Error("auth request is not authorized", @@ -81,7 +77,5 @@ func Auth(c *fiber.Ctx) error { app.GetInstance().Metrics.ObserveStatus(internal.HttpApi, internal.Soteria, internal.Auth, internal.Success, "ok") app.GetInstance().Metrics.ObserveResponseTime(internal.HttpApi, internal.Soteria, internal.Auth, float64(time.Since(s).Nanoseconds())) - authSpan.SetTag("success", true) - return c.Status(http.StatusOK).SendString("ok") } diff --git a/internal/app/a.go b/internal/app/a.go index c553be09..cd110d3a 100644 --- a/internal/app/a.go +++ b/internal/app/a.go @@ -4,15 +4,15 @@ import ( "io" "sync" - "github.com/opentracing/opentracing-go" "gitlab.snapp.ir/dispatching/soteria/v3/internal/authenticator" "gitlab.snapp.ir/dispatching/soteria/v3/pkg/metrics" + "go.opentelemetry.io/otel/trace" ) type App struct { Metrics metrics.Metrics Authenticator *authenticator.Authenticator - Tracer opentracing.Tracer + Tracer trace.Tracer TracerCloser io.Closer } @@ -38,7 +38,6 @@ func (a *App) SetMetrics(m metrics.Metrics) { a.Metrics = m } -func (a *App) SetTracer(tracer opentracing.Tracer, closer io.Closer) { +func (a *App) SetTracer(tracer trace.Tracer) { a.Tracer = tracer - a.TracerCloser = closer } diff --git a/internal/authenticator/authenticator.go b/internal/authenticator/authenticator.go index 8e581543..d696e5a7 100644 --- a/internal/authenticator/authenticator.go +++ b/internal/authenticator/authenticator.go @@ -97,8 +97,11 @@ func (a Authenticator) Auth(tokenString string) (err error) { } // ACL check a user access to a topic. -func (a Authenticator) ACL(accessType acl.AccessType, - tokenString string, topic topics.Topic) (bool, error) { +func (a Authenticator) ACL( + accessType acl.AccessType, + tokenString string, + topic topics.Topic, +) (bool, error) { if !a.ValidateAccessType(accessType) { return false, ErrInvalidAccessType } diff --git a/internal/cmd/root.go b/internal/cmd/root.go index 29435cb0..74d2bbd7 100644 --- a/internal/cmd/root.go +++ b/internal/cmd/root.go @@ -7,6 +7,7 @@ import ( "gitlab.snapp.ir/dispatching/soteria/v3/internal/cmd/serve" "gitlab.snapp.ir/dispatching/soteria/v3/internal/config" "gitlab.snapp.ir/dispatching/soteria/v3/internal/logger" + "gitlab.snapp.ir/dispatching/soteria/v3/internal/tracing" "go.uber.org/zap" ) @@ -19,6 +20,9 @@ func Execute() { cfg := config.New() logger := logger.New(cfg.Logger) + zap.ReplaceGlobals(logger) + + tracer := tracing.New(cfg.Tracer) // nolint: exhaustivestruct root := &cobra.Command{ @@ -30,7 +34,7 @@ func Execute() { }, } - serve.Register(root, cfg, logger) + serve.Register(root, cfg, logger, tracer) if err := root.Execute(); err != nil { logger.Error("failed to execute root command", zap.Error(err)) diff --git a/internal/cmd/serve/main.go b/internal/cmd/serve/main.go index 15f99e5b..231e63d0 100644 --- a/internal/cmd/serve/main.go +++ b/internal/cmd/serve/main.go @@ -16,21 +16,21 @@ import ( "gitlab.snapp.ir/dispatching/soteria/v3/internal/config" "gitlab.snapp.ir/dispatching/soteria/v3/internal/db" "gitlab.snapp.ir/dispatching/soteria/v3/internal/metrics" - "gitlab.snapp.ir/dispatching/soteria/v3/pkg/tracer" "gitlab.snapp.ir/dispatching/soteria/v3/pkg/user" + "go.opentelemetry.io/otel/trace" _ "go.uber.org/automaxprocs" "go.uber.org/zap" ) -func main(cfg config.Config, logger *zap.Logger) { +func main(cfg config.Config, logger *zap.Logger, tracer trace.Tracer) { publicKey0, err := cfg.ReadPublicKey(user.Driver) if err != nil { - zap.L().Fatal("could not read driver public key") + logger.Fatal("could not read driver public key") } publicKey1, err := cfg.ReadPublicKey(user.Passenger) if err != nil { - zap.L().Fatal("could not read passenger public key") + logger.Fatal("could not read passenger public key") } hid := &snappids.HashIDSManager{ @@ -44,16 +44,9 @@ func main(cfg config.Config, logger *zap.Logger) { }, } - trc, cl, err := tracer.New(cfg.Tracer) - if err != nil { - zap.L().Fatal("could not create tracer", zap.Error(err)) - } - - app.GetInstance().SetTracer(trc, cl) - allowedAccessTypes, err := cfg.GetAllowedAccessTypes() if err != nil { - zap.L().Fatal("error while getting allowed access types", zap.Error(err)) + logger.Fatal("error while getting allowed access types", zap.Error(err)) } app.GetInstance().SetAuthenticator(&authenticator.Authenticator{ @@ -68,6 +61,8 @@ func main(cfg config.Config, logger *zap.Logger) { Company: cfg.Company, }) + app.GetInstance().SetTracer(tracer) + m := metrics.NewMetrics() app.GetInstance().SetMetrics(&m.Handler) @@ -75,7 +70,7 @@ func main(cfg config.Config, logger *zap.Logger) { go func() { if err := rest.Listen(fmt.Sprintf(":%d", cfg.HTTPPort)); err != nil && !errors.Is(err, http.ErrServerClosed) { - zap.L().Fatal("failed to run REST HTTP server", zap.Error(err)) + logger.Fatal("failed to run REST HTTP server", zap.Error(err)) } }() @@ -84,16 +79,12 @@ func main(cfg config.Config, logger *zap.Logger) { <-c if err := rest.Shutdown(); err != nil { - zap.L().Error("error happened during REST API shutdown", zap.Error(err)) - } - - if err := app.GetInstance().TracerCloser.Close(); err != nil { - zap.L().Error("error happened while closing tracer", zap.Error(err)) + logger.Error("error happened during REST API shutdown", zap.Error(err)) } } // Register serve command. -func Register(root *cobra.Command, cfg config.Config, logger *zap.Logger) { +func Register(root *cobra.Command, cfg config.Config, logger *zap.Logger, tracer trace.Tracer) { root.AddCommand( // nolint: exhaustivestruct &cobra.Command{ @@ -101,7 +92,7 @@ func Register(root *cobra.Command, cfg config.Config, logger *zap.Logger) { Short: "serve runs the application", Long: `serve will run Soteria ReST server and waits until user disrupts.`, Run: func(cmd *cobra.Command, args []string) { - main(cfg, logger) + main(cfg, logger, tracer) }, }, ) diff --git a/internal/config/config.go b/internal/config/config.go index b330d633..909dfde4 100644 --- a/internal/config/config.go +++ b/internal/config/config.go @@ -15,6 +15,7 @@ import ( "github.com/knadh/koanf/providers/file" "github.com/knadh/koanf/providers/structs" "gitlab.snapp.ir/dispatching/soteria/v3/internal/logger" + "gitlab.snapp.ir/dispatching/soteria/v3/internal/tracing" "gitlab.snapp.ir/dispatching/soteria/v3/pkg/acl" "gitlab.snapp.ir/dispatching/soteria/v3/pkg/user" ) @@ -27,33 +28,23 @@ const ( type ( // Config is the main container of Soteria's config. Config struct { - AllowedAccessTypes []string `koanf:"allowed_access_types"` - PassengerHashLength int `koanf:"passenger_hash_length"` - DriverHashLength int `koanf:"driver_hash_length"` - PassengerSalt string `koanf:"passenger_salt"` - DriverSalt string `koanf:"driver_salt"` - JWT *JWT `koanf:"jwt"` - Logger logger.Config `koanf:"logger"` - HTTPPort int `koanf:"http_port"` - Tracer *TracerConfig `koanf:"tracer"` - Company string `koanf:"company"` - Users []user.User `koanf:"users"` + AllowedAccessTypes []string `koanf:"allowed_access_types"` + PassengerHashLength int `koanf:"passenger_hash_length"` + DriverHashLength int `koanf:"driver_hash_length"` + PassengerSalt string `koanf:"passenger_salt"` + DriverSalt string `koanf:"driver_salt"` + JWT *JWT `koanf:"jwt"` + Logger logger.Config `koanf:"logger"` + HTTPPort int `koanf:"http_port"` + Tracer tracing.Config `koanf:"tracer"` + Company string `koanf:"company"` + Users []user.User `koanf:"users"` } // JWt contains path of the keys for JWT encryption. JWT struct { Path string `koanf:"path"` } - - // Tracer contains all configs needed to create a tracer. - TracerConfig struct { - Enabled bool `koanf:"enabled"` - ServiceName string `koanf:"service_name"` - SamplerType string `koanf:"sampler_type"` - SamplerParam float64 `koanf:"sampler_param"` - Host string `koanf:"host"` - Port int `koanf:"port"` - } ) // New reads configuration with koanf. diff --git a/internal/config/default.go b/internal/config/default.go index 3834dbed..6c0d759e 100644 --- a/internal/config/default.go +++ b/internal/config/default.go @@ -3,6 +3,7 @@ package config import ( "gitlab.snapp.ir/dispatching/soteria/v3/internal/logger" "gitlab.snapp.ir/dispatching/soteria/v3/internal/topics" + "gitlab.snapp.ir/dispatching/soteria/v3/internal/tracing" "gitlab.snapp.ir/dispatching/soteria/v3/pkg/acl" "gitlab.snapp.ir/dispatching/soteria/v3/pkg/user" ) @@ -32,13 +33,13 @@ func Default() Config { Level: "warn", }, HTTPPort: DefaultHTTPPort, - Tracer: &TracerConfig{ - Enabled: false, - ServiceName: "", - SamplerType: "", - SamplerParam: 0.0, - Host: "", - Port: 0, + Tracer: tracing.Config{ + Enabled: false, + Ratio: 0.1, + Agent: tracing.Agent{ + Host: "127.0.0.1", + Port: "6831", + }, }, Company: "snapp", Users: []user.User{ diff --git a/internal/tracing/config.go b/internal/tracing/config.go new file mode 100644 index 00000000..a6f1a472 --- /dev/null +++ b/internal/tracing/config.go @@ -0,0 +1,12 @@ +package tracing + +type Config struct { + Enabled bool `koanf:"enabled"` + Agent `koanf:"agent"` + Ratio float64 `koanf:"ratio"` +} + +type Agent struct { + Host string `koanf:"host"` + Port string `koanf:"port"` +} diff --git a/internal/tracing/tracer.go b/internal/tracing/tracer.go new file mode 100644 index 00000000..9d0a7b47 --- /dev/null +++ b/internal/tracing/tracer.go @@ -0,0 +1,63 @@ +package tracing + +import ( + "log" + + "go.opentelemetry.io/otel" + "go.opentelemetry.io/otel/exporters/jaeger" + stdout "go.opentelemetry.io/otel/exporters/stdout/stdouttrace" + "go.opentelemetry.io/otel/propagation" + "go.opentelemetry.io/otel/sdk/resource" + sdktrace "go.opentelemetry.io/otel/sdk/trace" + semconv "go.opentelemetry.io/otel/semconv/v1.7.0" + "go.opentelemetry.io/otel/trace" +) + +// nolint: ireturn +func New(cfg Config) trace.Tracer { + var exporter sdktrace.SpanExporter + + var err error + if !cfg.Enabled { + exporter, err = stdout.New( + stdout.WithPrettyPrint(), + ) + } else { + exporter, err = jaeger.New( + jaeger.WithAgentEndpoint(jaeger.WithAgentHost(cfg.Agent.Host), jaeger.WithAgentPort(cfg.Agent.Port)), + ) + } + + if err != nil { + log.Fatalf("failed to initialize export pipeline: %v", err) + } + + res, err := resource.Merge( + resource.Default(), + resource.NewSchemaless( + semconv.ServiceNamespaceKey.String("snapp.dispatching"), + semconv.ServiceNameKey.String("soteria"), + ), + ) + if err != nil { + panic(err) + } + + bsp := sdktrace.NewBatchSpanProcessor(exporter) + tp := sdktrace.NewTracerProvider( + sdktrace.WithSampler(sdktrace.ParentBased(sdktrace.TraceIDRatioBased(cfg.Ratio))), + sdktrace.WithSpanProcessor(bsp), + sdktrace.WithResource(res), + ) + + otel.SetTracerProvider(tp) + + // register the TraceContext propagator globally. + var tc propagation.TraceContext + + otel.SetTextMapPropagator(tc) + + tracer := otel.Tracer("dispatching/soteria") + + return tracer +} diff --git a/pkg/tracer/tracer.go b/pkg/tracer/tracer.go deleted file mode 100644 index 3f49bcc5..00000000 --- a/pkg/tracer/tracer.go +++ /dev/null @@ -1,32 +0,0 @@ -package tracer - -import ( - "fmt" - "io" - - "github.com/opentracing/opentracing-go" - jaegerConf "github.com/uber/jaeger-client-go/config" - "gitlab.snapp.ir/dispatching/soteria/v3/internal/config" -) - -// New receives a `configs.TracerConfig` and returns a `opentracing.Tracer` and a `io.Closer` and a `error` if there was one -func New(cfg *config.TracerConfig) (opentracing.Tracer, io.Closer, error) { - trc, cl, err := jaegerConf.Configuration{ - ServiceName: cfg.ServiceName, - Disabled: !cfg.Enabled, - Sampler: &jaegerConf.SamplerConfig{ - Type: cfg.SamplerType, - Param: cfg.SamplerParam, - }, - Reporter: &jaegerConf.ReporterConfig{ - LogSpans: true, - LocalAgentHostPort: fmt.Sprintf("%s:%d", cfg.Host, cfg.Port), - }, - }.NewTracer() - - if err != nil { - return nil, nil, fmt.Errorf("failed to create new tracer: %w", err) - } - - return trc, cl, nil -} From 42cd3a90befcf88aa7fb8013a6551e6d5681218a Mon Sep 17 00:00:00 2001 From: Parham Alvani Date: Thu, 25 Nov 2021 00:10:46 +0330 Subject: [PATCH 097/660] feat: add tracer configuration on helm chart --- deployments/soteria/templates/configmap.yaml | 9 ++++----- deployments/soteria/templates/deployment.yaml | 8 -------- 2 files changed, 4 insertions(+), 13 deletions(-) diff --git a/deployments/soteria/templates/configmap.yaml b/deployments/soteria/templates/configmap.yaml index d45b9cd1..c4273705 100644 --- a/deployments/soteria/templates/configmap.yaml +++ b/deployments/soteria/templates/configmap.yaml @@ -24,11 +24,10 @@ data: {{ with .Values.envs.tracer }} tracer: enabled: {{ .enabled }} - service_name: {{ .service_name }} - sampler_type: {{ .sampler_type }} - sampler_param: {{ .sampler_param }} - host: {{ .host }} - port: {{ .port }} + ratio: {{ .ratio }} + agent: + host: {{ .host }} + port: {{ .port }} {{ end }} {{ with .Values.envs.company }} company: {{ . }} diff --git a/deployments/soteria/templates/deployment.yaml b/deployments/soteria/templates/deployment.yaml index bedb27d4..64a27481 100644 --- a/deployments/soteria/templates/deployment.yaml +++ b/deployments/soteria/templates/deployment.yaml @@ -16,14 +16,6 @@ spec: type: RollingUpdate template: metadata: - annotations: - prometheus.io/scrape: "true" - prometheus.io/path: "/metrics" - {{ range .Values.service.ports }} - {{ if eq .name "http"}} - prometheus.io/port: {{ .port | quote }} - {{ end }} - {{ end }} labels: {{- include "soteria.selectorLabels" . | nindent 8 }} {{- include "soteria.podLabels" . | nindent 8 }} From 9c413c88d0d1fe0b537d32e6c8890867e80044e2 Mon Sep 17 00:00:00 2001 From: Parham Alvani Date: Thu, 25 Nov 2021 00:36:24 +0330 Subject: [PATCH 098/660] feat: remove metrics --- internal/api/acl.go | 32 ++++++++------------------ internal/api/auth.go | 24 +++++++------------ internal/app/a.go | 6 ----- internal/cmd/serve/main.go | 4 ---- internal/constants.go | 17 -------------- internal/metrics/metrics.go | 46 ------------------------------------- pkg/metrics/m.go | 13 ----------- pkg/metrics/prom.go | 40 -------------------------------- 8 files changed, 17 insertions(+), 165 deletions(-) delete mode 100644 internal/constants.go delete mode 100644 internal/metrics/metrics.go delete mode 100644 pkg/metrics/m.go delete mode 100644 pkg/metrics/prom.go diff --git a/internal/api/acl.go b/internal/api/acl.go index af552e82..1ae9f292 100644 --- a/internal/api/acl.go +++ b/internal/api/acl.go @@ -3,14 +3,13 @@ package api import ( "errors" "net/http" - "time" "github.com/gofiber/fiber/v2" - "gitlab.snapp.ir/dispatching/soteria/v3/internal" "gitlab.snapp.ir/dispatching/soteria/v3/internal/app" "gitlab.snapp.ir/dispatching/soteria/v3/internal/authenticator" "gitlab.snapp.ir/dispatching/soteria/v3/internal/topics" "gitlab.snapp.ir/dispatching/soteria/v3/pkg/acl" + "go.opentelemetry.io/otel/attribute" "go.uber.org/zap" ) @@ -28,8 +27,6 @@ func ACL(c *fiber.Ctx) error { _, span := app.GetInstance().Tracer.Start(c.Context(), "api.acl") defer span.End() - s := time.Now() - request := new(aclRequest) if err := c.BodyParser(request); err != nil { zap.L(). @@ -42,10 +39,6 @@ func ACL(c *fiber.Ctx) error { zap.String("password", request.Username), ) - app.GetInstance().Metrics.ObserveStatusCode(internal.HttpApi, internal.Soteria, internal.Acl, http.StatusBadRequest) - app.GetInstance().Metrics.ObserveStatus(internal.HttpApi, internal.Soteria, internal.Acl, internal.Failure, "bad request") - app.GetInstance().Metrics.ObserveResponseTime(internal.HttpApi, internal.Soteria, internal.Acl, float64(time.Since(s).Nanoseconds())) - return c.Status(http.StatusBadRequest).SendString("bad request") } @@ -59,6 +52,14 @@ func ACL(c *fiber.Ctx) error { tokenString = request.Password } + span.SetAttributes( + attribute.String("access", request.Access.String()), + attribute.String("topic", request.Topic), + attribute.String("token", request.Token), + attribute.String("username", request.Password), + attribute.String("password", request.Username), + ) + topic := topics.Topic(request.Topic) topicType := topic.GetType() @@ -72,10 +73,6 @@ func ACL(c *fiber.Ctx) error { zap.String("password", request.Username), ) - app.GetInstance().Metrics.ObserveStatusCode(internal.HttpApi, internal.Soteria, internal.Acl, http.StatusBadRequest) - app.GetInstance().Metrics.ObserveStatus(internal.HttpApi, internal.Soteria, internal.Acl, internal.Failure, "bad request") - app.GetInstance().Metrics.ObserveResponseTime(internal.HttpApi, internal.Soteria, internal.Acl, float64(time.Since(s).Nanoseconds())) - return c.Status(http.StatusBadRequest).SendString("bad request") } @@ -85,7 +82,6 @@ func ACL(c *fiber.Ctx) error { span.RecordError(err) } - // nolint: exhaustivestruct if errors.Is(err, authenticator.TopicNotAllowedError{}) { zap.L(). Warn("acl request is not authorized", @@ -96,11 +92,6 @@ func ACL(c *fiber.Ctx) error { zap.Error(err)) } - app.GetInstance().Metrics.ObserveStatusCode(internal.HttpApi, internal.Soteria, internal.Acl, http.StatusUnauthorized) - app.GetInstance().Metrics.ObserveStatus(internal.HttpApi, internal.Soteria, request.Access.String(), internal.Failure, string(topicType)) - app.GetInstance().Metrics.ObserveStatus(internal.HttpApi, internal.Soteria, internal.Acl, internal.Failure, "request is not authorized") - app.GetInstance().Metrics.ObserveResponseTime(internal.HttpApi, internal.Soteria, internal.Acl, float64(time.Since(s).Nanoseconds())) - return c.Status(http.StatusUnauthorized).SendString("request is not authorized") } @@ -113,10 +104,5 @@ func ACL(c *fiber.Ctx) error { zap.String("password", request.Username), ) - app.GetInstance().Metrics.ObserveStatusCode(internal.HttpApi, internal.Soteria, internal.Acl, http.StatusOK) - app.GetInstance().Metrics.ObserveStatus(internal.HttpApi, internal.Soteria, internal.Acl, internal.Success, "ok") - app.GetInstance().Metrics.ObserveStatus(internal.HttpApi, internal.Soteria, request.Access.String(), internal.Success, string(topicType)) - app.GetInstance().Metrics.ObserveResponseTime(internal.HttpApi, internal.Soteria, internal.Acl, float64(time.Since(s).Nanoseconds())) - return c.Status(http.StatusOK).SendString("ok") } diff --git a/internal/api/auth.go b/internal/api/auth.go index ec58b8b9..55ad067d 100644 --- a/internal/api/auth.go +++ b/internal/api/auth.go @@ -2,16 +2,13 @@ package api import ( "net/http" - "time" "github.com/gofiber/fiber/v2" - "gitlab.snapp.ir/dispatching/soteria/v3/internal" "gitlab.snapp.ir/dispatching/soteria/v3/internal/app" + "go.opentelemetry.io/otel/attribute" "go.uber.org/zap" ) -const EMQAuthIgnore = "ignore" - // authRequest is the body payload structure of the auth endpoint. type authRequest struct { Token string `form:"token"` @@ -24,17 +21,15 @@ func Auth(c *fiber.Ctx) error { _, span := app.GetInstance().Tracer.Start(c.Context(), "api.auth") defer span.End() - s := time.Now() request := new(authRequest) if err := c.BodyParser(request); err != nil { + span.RecordError(err) + zap.L(). Warn("bad request", zap.Error(err), ) - app.GetInstance().Metrics.ObserveStatusCode(internal.HttpApi, internal.Soteria, internal.Auth, http.StatusBadRequest) - app.GetInstance().Metrics.ObserveStatus(internal.HttpApi, internal.Soteria, internal.Auth, internal.Failure, "bad request") - app.GetInstance().Metrics.ObserveResponseTime(internal.HttpApi, internal.Soteria, internal.Auth, float64(time.Since(s).Nanoseconds())) return c.Status(http.StatusBadRequest).SendString("bad request") } @@ -48,6 +43,11 @@ func Auth(c *fiber.Ctx) error { tokenString = request.Password } + span.SetAttributes( + attribute.String("token", request.Token), + attribute.String("username", request.Password), + attribute.String("password", request.Username), + ) if err := app.GetInstance().Authenticator.Auth(tokenString); err != nil { span.RecordError(err) @@ -59,10 +59,6 @@ func Auth(c *fiber.Ctx) error { zap.String("password", request.Username), ) - app.GetInstance().Metrics.ObserveStatusCode(internal.HttpApi, internal.Soteria, internal.Auth, http.StatusUnauthorized) - app.GetInstance().Metrics.ObserveStatus(internal.HttpApi, internal.Soteria, internal.Auth, internal.Failure, "request is not authorized") - app.GetInstance().Metrics.ObserveResponseTime(internal.HttpApi, internal.Soteria, internal.Auth, float64(time.Since(s).Nanoseconds())) - return c.Status(http.StatusUnauthorized).SendString("request is not authorized") } @@ -73,9 +69,5 @@ func Auth(c *fiber.Ctx) error { zap.String("password", request.Username), ) - app.GetInstance().Metrics.ObserveStatusCode(internal.HttpApi, internal.Soteria, internal.Auth, http.StatusOK) - app.GetInstance().Metrics.ObserveStatus(internal.HttpApi, internal.Soteria, internal.Auth, internal.Success, "ok") - app.GetInstance().Metrics.ObserveResponseTime(internal.HttpApi, internal.Soteria, internal.Auth, float64(time.Since(s).Nanoseconds())) - return c.Status(http.StatusOK).SendString("ok") } diff --git a/internal/app/a.go b/internal/app/a.go index cd110d3a..e7023c48 100644 --- a/internal/app/a.go +++ b/internal/app/a.go @@ -5,12 +5,10 @@ import ( "sync" "gitlab.snapp.ir/dispatching/soteria/v3/internal/authenticator" - "gitlab.snapp.ir/dispatching/soteria/v3/pkg/metrics" "go.opentelemetry.io/otel/trace" ) type App struct { - Metrics metrics.Metrics Authenticator *authenticator.Authenticator Tracer trace.Tracer TracerCloser io.Closer @@ -34,10 +32,6 @@ func (a *App) SetAuthenticator(authenticator *authenticator.Authenticator) { a.Authenticator = authenticator } -func (a *App) SetMetrics(m metrics.Metrics) { - a.Metrics = m -} - func (a *App) SetTracer(tracer trace.Tracer) { a.Tracer = tracer } diff --git a/internal/cmd/serve/main.go b/internal/cmd/serve/main.go index 231e63d0..f2c2417d 100644 --- a/internal/cmd/serve/main.go +++ b/internal/cmd/serve/main.go @@ -15,7 +15,6 @@ import ( "gitlab.snapp.ir/dispatching/soteria/v3/internal/authenticator" "gitlab.snapp.ir/dispatching/soteria/v3/internal/config" "gitlab.snapp.ir/dispatching/soteria/v3/internal/db" - "gitlab.snapp.ir/dispatching/soteria/v3/internal/metrics" "gitlab.snapp.ir/dispatching/soteria/v3/pkg/user" "go.opentelemetry.io/otel/trace" _ "go.uber.org/automaxprocs" @@ -63,9 +62,6 @@ func main(cfg config.Config, logger *zap.Logger, tracer trace.Tracer) { app.GetInstance().SetTracer(tracer) - m := metrics.NewMetrics() - app.GetInstance().SetMetrics(&m.Handler) - rest := api.ReSTServer() go func() { diff --git a/internal/constants.go b/internal/constants.go deleted file mode 100644 index 5515900e..00000000 --- a/internal/constants.go +++ /dev/null @@ -1,17 +0,0 @@ -package internal - -const ( - Soteria = "soteria" - Acl = "acl" - Auth = "auth" - Token = "token" - Success = "success" - Failure = "failure" - Ignore = "ignore" - CabEvent = "cab_event" - DriverLocation = "driver_location" - SuperAppEvent = "super_app_event" - - HttpApi = "http" - GrpcApi = "grpc" -) diff --git a/internal/metrics/metrics.go b/internal/metrics/metrics.go deleted file mode 100644 index 9a85478c..00000000 --- a/internal/metrics/metrics.go +++ /dev/null @@ -1,46 +0,0 @@ -package metrics - -import ( - "github.com/prometheus/client_golang/prometheus" - "gitlab.snapp.ir/dispatching/soteria/v3/pkg/metrics" -) - -type SoteriaMetrics struct { - Handler metrics.Handler -} - -// NewMetrics creates and returns all metrics needed in Soteria. -func NewMetrics() *SoteriaMetrics { - statusCodesCounter := prometheus.NewCounterVec(prometheus.CounterOpts{ - Namespace: "dispatching", - Subsystem: "soteria", - Name: "status_codes", - Help: "status codes observed from soteria and its all external calls", - }, []string{"api", "service", "function", "code"}) - - statusesCounter := prometheus.NewCounterVec(prometheus.CounterOpts{ - Namespace: "dispatching", - Subsystem: "soteria", - Name: "statuses", - Help: "statuses observed from soteria and its all external calls", - }, []string{"api", "service", "function", "status", "info"}) - - responseTimesSummery := prometheus.NewSummaryVec(prometheus.SummaryOpts{ - Namespace: "dispatching", - Subsystem: "soteria", - Name: "response_times", - Help: "response times observed from and its all external calls", - }, []string{"api", "service", "function"}) - - prometheus.MustRegister(statusCodesCounter) - prometheus.MustRegister(statusesCounter) - prometheus.MustRegister(responseTimesSummery) - - return &SoteriaMetrics{ - metrics.Handler{ - StatusCodeCounterVec: statusCodesCounter, - StatusCounterVec: statusesCounter, - ResponseTimeVec: responseTimesSummery, - }, - } -} diff --git a/pkg/metrics/m.go b/pkg/metrics/m.go deleted file mode 100644 index 1c3d5886..00000000 --- a/pkg/metrics/m.go +++ /dev/null @@ -1,13 +0,0 @@ -package metrics - -// Metrics is an interface used to capture metrics in soteria. -type Metrics interface { - // ObserveStatusCode is the method for status code metrics - ObserveStatusCode(api, serviceName, function string, code int) - - // ObserveStatus is the method for the status of the done operations - ObserveStatus(api, serviceName, function, status, info string) - - // ObserveResponseTime is the method for times takes by a specific function - ObserveResponseTime(api, serviceName, function string, time float64) -} diff --git a/pkg/metrics/prom.go b/pkg/metrics/prom.go deleted file mode 100644 index 87ebe700..00000000 --- a/pkg/metrics/prom.go +++ /dev/null @@ -1,40 +0,0 @@ -package metrics - -import ( - "github.com/prometheus/client_golang/prometheus" - "strconv" -) - -// Handler is a implementation `Metrics` -type Handler struct { - StatusCodeCounterVec *prometheus.CounterVec - StatusCounterVec *prometheus.CounterVec - ResponseTimeVec *prometheus.SummaryVec -} - -func (h *Handler) ObserveStatusCode(api, serviceName, function string, code int) { - h.StatusCodeCounterVec.With(prometheus.Labels{ - "api": api, - "service": serviceName, - "function": function, - "code": strconv.Itoa(code), - }).Inc() -} - -func (h *Handler) ObserveStatus(api, serviceName, function, status, info string) { - h.StatusCounterVec.With(prometheus.Labels{ - "api": api, - "service": serviceName, - "function": function, - "status": status, - "info": info, - }).Inc() -} - -func (h *Handler) ObserveResponseTime(api, serviceName, function string, time float64) { - h.ResponseTimeVec.With(prometheus.Labels{ - "api": api, - "service": serviceName, - "function": function, - }).Observe(time) -} From 2a240992a7321bfba00e85054cfccfdaafd1687f Mon Sep 17 00:00:00 2001 From: Parham Alvani Date: Thu, 25 Nov 2021 00:37:40 +0330 Subject: [PATCH 099/660] feat: update chart version --- deployments/soteria/Chart.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/deployments/soteria/Chart.yaml b/deployments/soteria/Chart.yaml index 1ff3a666..de5947e4 100644 --- a/deployments/soteria/Chart.yaml +++ b/deployments/soteria/Chart.yaml @@ -5,6 +5,6 @@ description: Soteria Helm Chart type: application -version: 5.0.4 +version: 5.1.0 -appVersion: "v5-0-4" +appVersion: "v5-1-0" From fbbacc8b615df237c89d86ff6648a921755576d4 Mon Sep 17 00:00:00 2001 From: Parham Alvani Date: Thu, 25 Nov 2021 01:01:42 +0330 Subject: [PATCH 100/660] feat: disable tracer when there is no need --- go.mod | 3 +-- go.sum | 2 -- internal/app/a.go | 2 -- internal/tracing/tracer.go | 15 ++++----------- 4 files changed, 5 insertions(+), 17 deletions(-) diff --git a/go.mod b/go.mod index 775effc2..00a8ca59 100644 --- a/go.mod +++ b/go.mod @@ -8,7 +8,7 @@ require ( github.com/gofiber/fiber/v2 v2.22.0 github.com/golang-jwt/jwt/v4 v4.1.0 github.com/knadh/koanf v1.3.3 - github.com/prometheus/client_golang v1.11.0 + github.com/prometheus/client_golang v1.11.0 // indirect github.com/spf13/cobra v1.2.1 github.com/stretchr/testify v1.7.0 gitlab.snapp.ir/dispatching/snappids/v2 v2.8.0 @@ -20,7 +20,6 @@ require ( require ( go.opentelemetry.io/otel v1.2.0 go.opentelemetry.io/otel/exporters/jaeger v1.2.0 - go.opentelemetry.io/otel/exporters/stdout/stdouttrace v1.2.0 go.opentelemetry.io/otel/sdk v1.2.0 go.opentelemetry.io/otel/trace v1.2.0 ) diff --git a/go.sum b/go.sum index 392dd598..4eb1144d 100644 --- a/go.sum +++ b/go.sum @@ -528,8 +528,6 @@ go.opentelemetry.io/otel v1.2.0 h1:YOQDvxO1FayUcT9MIhJhgMyNO1WqoduiyvQHzGN0kUQ= go.opentelemetry.io/otel v1.2.0/go.mod h1:aT17Fk0Z1Nor9e0uisf98LrntPGMnk4frBO9+dkf69I= go.opentelemetry.io/otel/exporters/jaeger v1.2.0 h1:C/5Egj3MJBXRJi22cSl07suqPqtZLnLFmH//OxETUEc= go.opentelemetry.io/otel/exporters/jaeger v1.2.0/go.mod h1:KJLFbEMKTNPIfOxcg/WikIozEoKcPgJRz3Ce1vLlM8E= -go.opentelemetry.io/otel/exporters/stdout/stdouttrace v1.2.0 h1:OiYdrCq1Ctwnovp6EofSPwlp5aGy4LgKNbkg7PtEUw8= -go.opentelemetry.io/otel/exporters/stdout/stdouttrace v1.2.0/go.mod h1:DUFCmFkXr0VtAHl5Zq2JRx24G6ze5CAq8YfdD36RdX8= go.opentelemetry.io/otel/sdk v1.2.0 h1:wKN260u4DesJYhyjxDa7LRFkuhH7ncEVKU37LWcyNIo= go.opentelemetry.io/otel/sdk v1.2.0/go.mod h1:jNN8QtpvbsKhgaC6V5lHiejMoKD+V8uadoSafgHPx1U= go.opentelemetry.io/otel/trace v1.2.0 h1:Ys3iqbqZhcf28hHzrm5WAquMkDHNZTUkw7KHbuNjej0= diff --git a/internal/app/a.go b/internal/app/a.go index e7023c48..29ecfdaa 100644 --- a/internal/app/a.go +++ b/internal/app/a.go @@ -1,7 +1,6 @@ package app import ( - "io" "sync" "gitlab.snapp.ir/dispatching/soteria/v3/internal/authenticator" @@ -11,7 +10,6 @@ import ( type App struct { Authenticator *authenticator.Authenticator Tracer trace.Tracer - TracerCloser io.Closer } // nolint: gochecknoglobals diff --git a/internal/tracing/tracer.go b/internal/tracing/tracer.go index 9d0a7b47..03f7c9ef 100644 --- a/internal/tracing/tracer.go +++ b/internal/tracing/tracer.go @@ -5,7 +5,6 @@ import ( "go.opentelemetry.io/otel" "go.opentelemetry.io/otel/exporters/jaeger" - stdout "go.opentelemetry.io/otel/exporters/stdout/stdouttrace" "go.opentelemetry.io/otel/propagation" "go.opentelemetry.io/otel/sdk/resource" sdktrace "go.opentelemetry.io/otel/sdk/trace" @@ -15,19 +14,13 @@ import ( // nolint: ireturn func New(cfg Config) trace.Tracer { - var exporter sdktrace.SpanExporter - - var err error if !cfg.Enabled { - exporter, err = stdout.New( - stdout.WithPrettyPrint(), - ) - } else { - exporter, err = jaeger.New( - jaeger.WithAgentEndpoint(jaeger.WithAgentHost(cfg.Agent.Host), jaeger.WithAgentPort(cfg.Agent.Port)), - ) + return trace.NewNoopTracerProvider().Tracer("snapp.dispatching") } + exporter, err := jaeger.New( + jaeger.WithAgentEndpoint(jaeger.WithAgentHost(cfg.Agent.Host), jaeger.WithAgentPort(cfg.Agent.Port)), + ) if err != nil { log.Fatalf("failed to initialize export pipeline: %v", err) } From 6ff87cff9eb0b1a26a2489a5b46d19f491509203 Mon Sep 17 00:00:00 2001 From: Parham Alvani Date: Thu, 25 Nov 2021 01:02:12 +0330 Subject: [PATCH 101/660] feat: update chart version --- deployments/soteria/Chart.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/deployments/soteria/Chart.yaml b/deployments/soteria/Chart.yaml index de5947e4..7204874d 100644 --- a/deployments/soteria/Chart.yaml +++ b/deployments/soteria/Chart.yaml @@ -5,6 +5,6 @@ description: Soteria Helm Chart type: application -version: 5.1.0 +version: 5.1.1 -appVersion: "v5-1-0" +appVersion: "v5-1-1" From 8c205228e55b39cba937234838547ce54ca41d59 Mon Sep 17 00:00:00 2001 From: Parham Alvani Date: Thu, 25 Nov 2021 01:04:19 +0330 Subject: [PATCH 102/660] feat: disable run golangci on test --- .golangci.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.golangci.yml b/.golangci.yml index 404ea51d..30026fdf 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -1,4 +1,6 @@ --- +run: + tests: false linters: enable-all: true disable: From a077ea0dc4b54d837c8eb9d81fe0a7dcaf4ff88b Mon Sep 17 00:00:00 2001 From: Parham Alvani Date: Thu, 25 Nov 2021 01:09:20 +0330 Subject: [PATCH 103/660] fix: correct lint issues --- cmd/soteria/soteria.go | 1 + internal/api/acl.go | 2 ++ internal/api/auth.go | 2 ++ internal/authenticator/authenticator.go | 1 + internal/cmd/serve/main.go | 1 - internal/config/config.go | 2 ++ internal/config/default.go | 2 +- internal/topics/t.go | 1 + 8 files changed, 10 insertions(+), 2 deletions(-) diff --git a/cmd/soteria/soteria.go b/cmd/soteria/soteria.go index 5f277942..cc899146 100644 --- a/cmd/soteria/soteria.go +++ b/cmd/soteria/soteria.go @@ -2,6 +2,7 @@ package main import ( "gitlab.snapp.ir/dispatching/soteria/v3/internal/cmd" + _ "go.uber.org/automaxprocs" ) func main() { diff --git a/internal/api/acl.go b/internal/api/acl.go index 1ae9f292..19e84d98 100644 --- a/internal/api/acl.go +++ b/internal/api/acl.go @@ -23,6 +23,7 @@ type aclRequest struct { } // ACL is the handler responsible for ACL requests. +// nolint: wrapcheck, funlen func ACL(c *fiber.Ctx) error { _, span := app.GetInstance().Tracer.Start(c.Context(), "api.acl") defer span.End() @@ -82,6 +83,7 @@ func ACL(c *fiber.Ctx) error { span.RecordError(err) } + // nolint: exhaustivestruct if errors.Is(err, authenticator.TopicNotAllowedError{}) { zap.L(). Warn("acl request is not authorized", diff --git a/internal/api/auth.go b/internal/api/auth.go index 55ad067d..695b5133 100644 --- a/internal/api/auth.go +++ b/internal/api/auth.go @@ -17,6 +17,7 @@ type authRequest struct { } // Auth is the handler responsible for authentication. +// nolint: wrapcheck func Auth(c *fiber.Ctx) error { _, span := app.GetInstance().Tracer.Start(c.Context(), "api.auth") defer span.End() @@ -48,6 +49,7 @@ func Auth(c *fiber.Ctx) error { attribute.String("username", request.Password), attribute.String("password", request.Username), ) + if err := app.GetInstance().Authenticator.Auth(tokenString); err != nil { span.RecordError(err) diff --git a/internal/authenticator/authenticator.go b/internal/authenticator/authenticator.go index d696e5a7..c4de4fda 100644 --- a/internal/authenticator/authenticator.go +++ b/internal/authenticator/authenticator.go @@ -97,6 +97,7 @@ func (a Authenticator) Auth(tokenString string) (err error) { } // ACL check a user access to a topic. +// nolint: funlen, cyclop func (a Authenticator) ACL( accessType acl.AccessType, tokenString string, diff --git a/internal/cmd/serve/main.go b/internal/cmd/serve/main.go index f2c2417d..c01b375e 100644 --- a/internal/cmd/serve/main.go +++ b/internal/cmd/serve/main.go @@ -17,7 +17,6 @@ import ( "gitlab.snapp.ir/dispatching/soteria/v3/internal/db" "gitlab.snapp.ir/dispatching/soteria/v3/pkg/user" "go.opentelemetry.io/otel/trace" - _ "go.uber.org/automaxprocs" "go.uber.org/zap" ) diff --git a/internal/config/config.go b/internal/config/config.go index 909dfde4..197354fb 100644 --- a/internal/config/config.go +++ b/internal/config/config.go @@ -81,6 +81,7 @@ func New() Config { } // ReadPrivateKey will read and return private key that is used for JWT encryption. +// nolint: wrapcheck, goerr113 func (a *Config) ReadPublicKey(u user.Issuer) (*rsa.PublicKey, error) { var fileName string @@ -123,6 +124,7 @@ func (a *Config) GetAllowedAccessTypes() ([]acl.AccessType, error) { } // toUserAccessType will convert string access type to it's own type. +// nolint: goerr113 func toUserAccessType(access string) (acl.AccessType, error) { switch access { case "pub": diff --git a/internal/config/default.go b/internal/config/default.go index 6c0d759e..9a10adb9 100644 --- a/internal/config/default.go +++ b/internal/config/default.go @@ -15,7 +15,7 @@ const ( ) // Default return default configuration. -// nolint: funlen +// nolint: funlen, gomnd func Default() Config { return Config{ AllowedAccessTypes: []string{ diff --git a/internal/topics/t.go b/internal/topics/t.go index a9517499..fa498bec 100644 --- a/internal/topics/t.go +++ b/internal/topics/t.go @@ -41,6 +41,7 @@ func (t Topic) GetType() Type { return t.GetTypeWithCompany("snapp") } +// nolint: cyclop func (t Topic) GetTypeWithCompany(company string) Type { topic := string(t) topic = strings.TrimPrefix(topic, company) From 438745fb80966addabb93ceae59790852b65e3fb Mon Sep 17 00:00:00 2001 From: Parham Alvani Date: Sat, 27 Nov 2021 12:50:41 +0330 Subject: [PATCH 104/660] feat: add new ode files --- .okd/.env | 80 ---------- .okd/AutoScaler.yaml | 35 ----- .okd/ConfigMap.yaml | 71 --------- .okd/DeploymentConfig.yaml | 116 -------------- .okd/Route.yaml | 62 -------- .okd/Secret.yaml | 81 ---------- .okd/Service.yaml | 35 ----- .okd/Template.yaml | 218 --------------------------- .okd/deploy.sh | 24 +-- .okd/mozart/ConfigMap.yaml | 58 ------- .okd/mozart/DeploymentConfig.yaml | 151 ------------------- .okd/mozart/Route.yaml | 52 ------- .okd/mozart/Secret.yaml | 152 ------------------- .okd/mozart/Service.yaml | 39 ----- .okd/oldMozart/ConfigMap.yaml | 61 -------- .okd/oldMozart/DeploymentConfig.yaml | 151 ------------------- .okd/oldMozart/Route.yaml | 44 ------ .okd/oldMozart/Secret.yaml | 61 -------- .okd/oldMozart/Service.yaml | 35 ----- .okd/teardown.sh | 3 + 20 files changed, 10 insertions(+), 1519 deletions(-) delete mode 100644 .okd/.env delete mode 100644 .okd/AutoScaler.yaml delete mode 100644 .okd/ConfigMap.yaml delete mode 100644 .okd/DeploymentConfig.yaml delete mode 100644 .okd/Route.yaml delete mode 100644 .okd/Secret.yaml delete mode 100644 .okd/Service.yaml delete mode 100644 .okd/Template.yaml delete mode 100644 .okd/mozart/ConfigMap.yaml delete mode 100644 .okd/mozart/DeploymentConfig.yaml delete mode 100644 .okd/mozart/Route.yaml delete mode 100644 .okd/mozart/Secret.yaml delete mode 100644 .okd/mozart/Service.yaml delete mode 100644 .okd/oldMozart/ConfigMap.yaml delete mode 100644 .okd/oldMozart/DeploymentConfig.yaml delete mode 100644 .okd/oldMozart/Route.yaml delete mode 100644 .okd/oldMozart/Secret.yaml delete mode 100644 .okd/oldMozart/Service.yaml create mode 100755 .okd/teardown.sh diff --git a/.okd/.env b/.okd/.env deleted file mode 100644 index 33e14e43..00000000 --- a/.okd/.env +++ /dev/null @@ -1,80 +0,0 @@ -GJS_DEBUG_TOPICS=JS ERROR;JS LOG -LC_TIME=az_IR -USER=amin -TEXTDOMAIN=im-config -XDG_SEAT=seat0 -XDG_SESSION_TYPE=x11 -SSH_AGENT_PID=6340 -SHLVL=1 -QT4_IM_MODULE=xim -OLDPWD=/home/amin/Development/snapp/soteria/.okd -HOME=/home/amin -LESS=-R -DESKTOP_SESSION=ubuntu -_INTELLIJ_FORCE_SET_GOPATH=/home/amin/go -TERMINAL_EMULATOR=JetBrains-JediTerm -_INTELLIJ_FORCE_SET_GOPROXY=direct -GIO_LAUNCHED_DESKTOP_FILE=/home/amin/.local/share/applications/jetbrains-goland.desktop -ZSH=/home/amin/.oh-my-zsh -LSCOLORS=Gxfxcxdxbxegedabagacad -GTK_MODULES=gail:atk-bridge -GNOME_SHELL_SESSION_MODE=ubuntu -PAGER=less -LC_MONETARY=az_IR -GOROOT=/usr/local/go -DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/1000/bus -GIO_LAUNCHED_DESKTOP_FILE_PID=15825 -GOFLAGS= -mod=vendor -IM_CONFIG_PHASE=2 -_INTELLIJ_FORCE_SET_PATH=/usr/local/go/bin:/home/amin/.cargo/bin:/home/amin/go/bin:/usr/local/go/bin:/home/amin/.local/bin:/home/amin/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/home/amin/Development/flutter/bin:/home/amin/go/bin -MANDATORY_PATH=/usr/share/gconf/ubuntu.mandatory.path -GO111MODULE=on -GTK_IM_MODULE=ibus -LOGNAME=amin -_=/home/amin/Development/snapp/soteria/.okd/./deploy.sh -DEFAULTS_PATH=/usr/share/gconf/ubuntu.default.path -USERNAME=amin -XDG_SESSION_ID=3 -TERM=xterm-256color -SERVICE_NAME=soteria -GNOME_DESKTOP_SESSION_ID=this-is-deprecated -WINDOWPATH=2 -PATH=/usr/local/go/bin:/home/amin/.cargo/bin:/home/amin/go/bin:/usr/local/go/bin:/home/amin/.local/bin:/home/amin/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/home/amin/Development/flutter/bin:/home/amin/go/bin -__INTELLIJ_COMMAND_HISTFILE__=/home/amin/.GoLand2019.3/config/terminal/history/history-254 -SESSION_MANAGER=local/amin-ThinkPad-E490:@/tmp/.ICE-unix/6244,unix/amin-ThinkPad-E490:/tmp/.ICE-unix/6244 -S_COLORS=auto -XDG_RUNTIME_DIR=/run/user/1000 -XDG_MENU_PREFIX=gnome- -LC_ADDRESS=az_IR -DISPLAY=:0 -LC_TELEPHONE=az_IR -XDG_CURRENT_DESKTOP=ubuntu:GNOME -LANG=en_US.UTF-8 -XDG_SESSION_DESKTOP=ubuntu -XAUTHORITY=/run/user/1000/gdm/Xauthority -XMODIFIERS=@im=ibus -LS_COLORS=rs=0:di=01;34:ln=01;36:mh=00:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=40;31;01:mi=00:su=37;41:sg=30;43:ca=30;41:tw=30;42:ow=34;42:st=37;44:ex=01;32:*.tar=01;31:*.tgz=01;31:*.arc=01;31:*.arj=01;31:*.taz=01;31:*.lha=01;31:*.lz4=01;31:*.lzh=01;31:*.lzma=01;31:*.tlz=01;31:*.txz=01;31:*.tzo=01;31:*.t7z=01;31:*.zip=01;31:*.z=01;31:*.Z=01;31:*.dz=01;31:*.gz=01;31:*.lrz=01;31:*.lz=01;31:*.lzo=01;31:*.xz=01;31:*.zst=01;31:*.tzst=01;31:*.bz2=01;31:*.bz=01;31:*.tbz=01;31:*.tbz2=01;31:*.tz=01;31:*.deb=01;31:*.rpm=01;31:*.jar=01;31:*.war=01;31:*.ear=01;31:*.sar=01;31:*.rar=01;31:*.alz=01;31:*.ace=01;31:*.zoo=01;31:*.cpio=01;31:*.7z=01;31:*.rz=01;31:*.cab=01;31:*.wim=01;31:*.swm=01;31:*.dwm=01;31:*.esd=01;31:*.jpg=01;35:*.jpeg=01;35:*.mjpg=01;35:*.mjpeg=01;35:*.gif=01;35:*.bmp=01;35:*.pbm=01;35:*.pgm=01;35:*.ppm=01;35:*.tga=01;35:*.xbm=01;35:*.xpm=01;35:*.tif=01;35:*.tiff=01;35:*.png=01;35:*.svg=01;35:*.svgz=01;35:*.mng=01;35:*.pcx=01;35:*.mov=01;35:*.mpg=01;35:*.mpeg=01;35:*.m2v=01;35:*.mkv=01;35:*.webm=01;35:*.ogm=01;35:*.mp4=01;35:*.m4v=01;35:*.mp4v=01;35:*.vob=01;35:*.qt=01;35:*.nuv=01;35:*.wmv=01;35:*.asf=01;35:*.rm=01;35:*.rmvb=01;35:*.flc=01;35:*.avi=01;35:*.fli=01;35:*.flv=01;35:*.gl=01;35:*.dl=01;35:*.xcf=01;35:*.xwd=01;35:*.yuv=01;35:*.cgm=01;35:*.emf=01;35:*.ogv=01;35:*.ogx=01;35:*.aac=00;36:*.au=00;36:*.flac=00;36:*.m4a=00;36:*.mid=00;36:*.midi=00;36:*.mka=00;36:*.mp3=00;36:*.mpc=00;36:*.ogg=00;36:*.ra=00;36:*.wav=00;36:*.oga=00;36:*.opus=00;36:*.spx=00;36:*.xspf=00;36: -SSH_AUTH_SOCK=/run/user/1000/keyring/ssh -LC_NAME=az_IR -GOPROXY=direct -GOPATH=/home/amin/go -SHELL=/usr/bin/zsh -GDMSESSION=ubuntu -QT_ACCESSIBILITY=1 -LC_MEASUREMENT=az_IR -TEXTDOMAINDIR=/usr/share/locale/ -LC_IDENTIFICATION=az_IR -GPG_AGENT_INFO=/run/user/1000/gnupg/S.gpg-agent:0:1 -GJS_DEBUG_OUTPUT=stderr -_INTELLIJ_FORCE_SET_GOROOT=/usr/local/go -QT_IM_MODULE=ibus -XDG_VTNR=2 -PWD=/home/amin/Development/snapp/soteria/.okd -_INTELLIJ_FORCE_SET_GOFLAGS= -mod=vendor -ZDOTDIR= -XDG_CONFIG_DIRS=/etc/xdg/xdg-ubuntu:/etc/xdg -XDG_DATA_DIRS=/usr/share/ubuntu:/usr/local/share/:/usr/share/:/var/lib/snapd/desktop -CLUTTER_IM_MODULE=xim -_INTELLIJ_FORCE_SET_GO111MODULE=on -LC_NUMERIC=az_IR -LC_PAPER=az_IR diff --git a/.okd/AutoScaler.yaml b/.okd/AutoScaler.yaml deleted file mode 100644 index ab27cb8b..00000000 --- a/.okd/AutoScaler.yaml +++ /dev/null @@ -1,35 +0,0 @@ -apiVersion: v1 -kind: Template -metadata: - name: ${SERVICE_NAME}-scaler-tpl -objects: -- apiVersion: autoscaling/v1 - kind: HorizontalPodAutoscaler - metadata: - labels: - app: ${SERVICE_NAME} - name: ${SERVICE_NAME} - spec: - scaleTargetRef: - kind: DeploymentConfig - name: ${SERVICE_NAME} - apiVersion: v1 - subresource: scale - minReplicas: ${{MIN_REPLICA}} - maxReplicas: ${{MAX_REPLICA}} - targetCPUUtilizationPercentage: ${{CPU_UTILIZATION}} - -parameters: -- name: SERVICE_NAME - displayName: Service name - description: The name of the application (should be unique in the namespace) - value: "soteria" -- name: MIN_REPLICA - displayName: Minimum number of replica - required: true -- name: MAX_REPLICA - displayName: Maximum number of replica - required: true -- name: CPU_UTILIZATION - displayName: Target CPU Utilization Percentage - required: true \ No newline at end of file diff --git a/.okd/ConfigMap.yaml b/.okd/ConfigMap.yaml deleted file mode 100644 index 00e8b4de..00000000 --- a/.okd/ConfigMap.yaml +++ /dev/null @@ -1,71 +0,0 @@ ---- -apiVersion: v1 -kind: Template -metadata: - name: ${SERVICE_NAME}-configmap -objects: - - apiVersion: v1 - kind: ConfigMap - metadata: - name: ${SERVICE_NAME}-env - labels: - app: "${SERVICE_NAME}" - app.snappcloud.io/managed-by: "${MANAGED_BY}" - app.snappcloud.io/version: "${APP_VERSION}" - app.snappcloud.io/instance: "${SERVICE_NAME}-${CI_COMMIT_REF_SLUG}" - data: - SOTERIA_HTTP_PORT: "9999" - SOTERIA_GRPC_PORT: "50051" - SOTERIA_REDIS_ADDRESS: "${REDIS_ADDR}" - SOTERIA_REDIS_PASS: "${REDIS_PASS}" - SOTERIA_REDIS_POOL_SIZE: "10" - SOTERIA_REDIS_MAX_RETRIES: "0" - SOTERIA_REDIS_READ_TIMEOUT: "3s" - SOTERIA_REDIS_POOL_TIMEOUT: "4s" - SOTERIA_REDIS_MIN_RETRY_BACKOFF: "8ms" - SOTERIA_REDIS_MAX_RETRY_BACKOFF: "512ms" - SOTERIA_REDIS_IDLE_TIMEOUT: "300s" - SOTERIA_REDIS_IDLE_CHECK_FREQUENCY: "60s" - SOTERIA_REDIS_SET_MEMBER_EXP_TIME: "300s" - SOTERIA_REDIS_MIN_IDLE_CONNECTIONS: "5" - SOTERIA_LOGGER_LEVEL: "${LOG_LEVEL}" - SOTERIA_LOGGER_SENTRY_ENABLED: "false" - SOTERIA_LOGGER_SENTRY_DSN: "" - SOTERIA_LOGGER_SENTRY_TIMEOUT: "500ms" - SOTERIA_ALLOWED_ACCESS_TYPES: "sub,pub" - SOTERIA_CACHE_ENABLED: "true" - SOTERIA_CACHE_EXPIRATION: "600s" - SOTERIA_TRACER_ENABLED: "${TRACER_ENABLED}" - SOTERIA_TRACER_SERVICE_NAME: "soteria" - SOTERIA_TRACER_SAMPLER_TYPE: "const" - SOTERIA_TRACER_SAMPLER_PARAM: "1" - SOTERIA_TRACER_HOST: "${TRACER_HOST}" - SOTERIA_TRACER_PORT: "6831" - SOTERIA_MODE: "${GIN_MODE}" - -parameters: -- name: SERVICE_NAME - displayName: Service name - description: The name of the application (should be unique in the namespace) -- name: LOG_LEVEL - value: "ERROR" - displayName: Log Level - description: How much log do you want? (DEBUG|INFO|WARN|ERROR|OFF) -- name: GIN_MODE - value: "release" -- name: REDIS_ADDR - required: true -- name: REDIS_PASS - required: false -- name: TRACER_ENABLED - value: "false" -- name: TRACER_HOST - required: false -- name: MANAGED_BY - displayName: Managed by - required: true - value: "dispatching-team" -- name: APP_VERSION - required: true -- name: CI_COMMIT_REF_SLUG - required: true diff --git a/.okd/DeploymentConfig.yaml b/.okd/DeploymentConfig.yaml deleted file mode 100644 index 4d540a03..00000000 --- a/.okd/DeploymentConfig.yaml +++ /dev/null @@ -1,116 +0,0 @@ -apiVersion: v1 -kind: Template -metadata: - name: ${SERVICE_NAME}-deployment-config -objects: - - apiVersion: v1 - kind: DeploymentConfig - metadata: - labels: - app: ${SERVICE_NAME} - name: ${SERVICE_NAME} - spec: - selector: - app: ${SERVICE_NAME} - strategy: - rollingParams: - intervalSeconds: 1 - maxSurge: 5 - maxUnavailable: 0 - timeoutSeconds: 600 - updatePeriodSeconds: 10 - type: Rolling - template: - metadata: - annotations: - prometheus.io/scrape: "${METRICS_ENABLED}" - prometheus.io/path: "/metrics" - prometheus.io/port: "9999" - labels: - app: ${SERVICE_NAME} - spec: - containers: - - name: ${SERVICE_NAME}-app - image: "docker-registry.default.svc:5000/${APP_IMAGE}" - imagePullPolicy: Always - ports: - - containerPort: 9999 - protocol: TCP - - containerPort: 50051 - protocol: TCP - resources: - limits: - memory: "${MEMORY_LIMIT}" - cpu: "${CPU_LIMIT}" - requests: - memory: "${MEMORY_REQUEST}" - cpu: "${CPU_REQUEST}" - readinessProbe: - failureThreshold: 3 - initialDelaySeconds: 10 - periodSeconds: 23 - successThreshold: 1 - tcpSocket: - port: 9999 - timeoutSeconds: 2 - livenessProbe: - failureThreshold: 3 - initialDelaySeconds: 10 - periodSeconds: 29 - successThreshold: 1 - tcpSocket: - port: 9999 - timeoutSeconds: 2 - envFrom: - - secretRef: - name: "${SERVICE_NAME}-auth-env" - - configMapRef: - name: "${SERVICE_NAME}-env" - env: - - name: HTTP_PROXY - - name: HTTPS_PROXY - volumeMounts: - - name: "${SERVICE_NAME}-jwt-keys" - mountPath: "/jwt_pems/100.private.pem" - subPath: 100.private.pem - readOnly: true - - name: "${SERVICE_NAME}-jwt-keys" - mountPath: "/jwt_pems/100.pem" - subPath: 100.pem - readOnly: true - - name: "${SERVICE_NAME}-jwt-keys" - mountPath: "/jwt_pems/1.pem" - subPath: 1.pem - readOnly: true - - name: "${SERVICE_NAME}-jwt-keys" - mountPath: "/jwt_pems/0.pem" - subPath: 0.pem - readOnly: true - volumes: - - name: "${SERVICE_NAME}-jwt-keys" - secret: - secretName: "${SERVICE_NAME}-jwt-keys" - dnsPolicy: ClusterFirst - restartPolicy: Always - terminationGracePeriodSeconds: 30 - triggers: [] -parameters: - - name: APP_IMAGE - displayName: Application Docker Image - description: application will pull and run this docker image. It has to be in Snapp Cloud registery - value: "$CONTAINER_REGISTRY_IMAGE" - - name: SERVICE_NAME - displayName: Service name - description: The name of the application (should be unique in the namespace) - - name: MEMORY_LIMIT - value: "1024Mi" - - name: MEMORY_REQUEST - value: "512Mi" - - name: CPU_LIMIT - value: "2" - - name: CPU_REQUEST - value: "1" - - name: METRICS_ENABLED - value: "true" - displayName: Metrics Endpoint? - description: /metrics endpoint will be available for Prometheus diff --git a/.okd/Route.yaml b/.okd/Route.yaml deleted file mode 100644 index 18b499ad..00000000 --- a/.okd/Route.yaml +++ /dev/null @@ -1,62 +0,0 @@ -apiVersion: v1 -kind: Template -metadata: - name: ${SERVICE_NAME}-route -objects: -- apiVersion: v1 - kind: Route - metadata: - labels: - app: ${SERVICE_NAME} - router: inter-dc - name: ${SERVICE_NAME}-inter-dc - spec: - host: ${APP_HOST}.apps.inter-dc.${DC}.snappcloud.io - port: - targetPort: 9999-tcp - to: - kind: Service - name: ${SERVICE_NAME} - weight: 100 - wildcardPolicy: None -- apiVersion: v1 - kind: Route - metadata: - annotations: - haproxy.router.openshift.io/ip_whitelist: "${IP_WHITE_LIST}" - labels: - app: ${SERVICE_NAME} - router: "public" - name: "${SERVICE_NAME}-publi" - spec: - host: "${APP_HOST}.apps.public.${DC}.snappcloud.io" - port: - targetPort: 9999-tcp - tls: - termination: edge - insecureEdgeTerminationPolicy: Redirect - to: - kind: Service - name: ${SERVICE_NAME} - weight: 100 - wildcardPolicy: None - -parameters: -- name: APP_HOST - required: true - displayName: Application host -- name: PORT - displayName: Port - description: the port which will be open by your application - value: "9999" -- name: IP_WHITE_LIST - displayName: IP White list - description: The valid IP Addresses which can send request to public route - value: "*" -- name: SERVICE_NAME - displayName: Service name - description: The name of the application (should be unique in the namespace) - value: "soteria" -- name: DC - displayName: Data center - value: "teh-1" diff --git a/.okd/Secret.yaml b/.okd/Secret.yaml deleted file mode 100644 index fc84574c..00000000 --- a/.okd/Secret.yaml +++ /dev/null @@ -1,81 +0,0 @@ -apiVersion: v1 -kind: Template -metadata: - name: "${SERVICE_NAME}-secret" -objects: - - apiVersion: v1 - kind: Secret - type: Opaque - metadata: - name: "${SERVICE_NAME}-auth-env" - labels: - app: "${SERVICE_NAME}" - app.snappcloud.io/managed-by: "${MANAGED_BY}" - app.snappcloud.io/version: "${APP_VERSION}" - app.snappcloud.io/instance: "${SERVICE_NAME}-${CI_COMMIT_REF_SLUG}" - stringData: - SOTERIA_JWT_KEYS_PATH: "${JWT_KEYS_PATH}" - SOTERIA_DRIVER_SALT: "${DRIVER_HASH_SALT}" - SOTERIA_PASSENGER_SALT: "${PASSENGER_HASH_SALT}" - SOTERIA_DRIVER_HASH_LENGTH: "${DRIVER_HASH_LENGTH}" - SOTERIA_PASSENGER_HASH_LENGTH: "${PASSENGER_HASH_LENGTH}" - - apiVersion: v1 - kind: Secret - type: Opaque - metadata: - name: "${SERVICE_NAME}-jwt-keys" - labels: - app: "${SERVICE_NAME}" - app.snappcloud.io/managed-by: "${MANAGED_BY}" - app.snappcloud.io/version: "${APP_VERSION}" - app.snappcloud.io/instance: "${SERVICE_NAME}-${CI_COMMIT_REF_SLUG}" - stringData: - 0.pem: "${DRIVER_JWT_PUBLIC_KEY}" - 1.pem: "${PASSENGER_JWT_PUBLIC_KEY}" - 100.pem: "${THIRD_PARTY_JWT_PUBLIC_KEY}" - 100.private.pem: "${THIRD_PARTY_JWT_PRIVATE_KEY}" - -parameters: - - name: SERVICE_NAME - displayName: Service name - description: The name of the application (should be unique in the namespace) - - name: APP_VERSION - required: true - - name: MANAGED_BY - displayName: Managed by - required: true - value: "dispatching-team" - - name: CI_COMMIT_REF_SLUG - displayName: Commit Ref Slug - required: true - - name: PASSENGER_HASH_SALT - displayName: Passenger hash salt for HashIds - required: true - - name: PASSENGER_HASH_LENGTH - displayName: Minimum length of passenger generated hash for HashIds - - name: DRIVER_HASH_SALT - displayName: Passenger hash salt for HashIds - required: true - - name: DRIVER_HASH_LENGTH - displayName: Minimum length of driver generated hash for HashIds - - name: JWT_KEYS_PATH - displayName: Private Key Path - description: Private key Path - value: "/jwt_pems/" - required: true - - name: THIRD_PARTY_JWT_PRIVATE_KEY - displayName: Third party Private Key - description: Private key of third party's token - required: true - - name: DRIVER_JWT_PUBLIC_KEY - displayName: Driver public key - description: Public Key of driver's token - required: true - - name: PASSENGER_JWT_PUBLIC_KEY - displayName: Passenger public key - description: Public Key of passenger's token - required: true - - name: THIRD_PARTY_JWT_PUBLIC_KEY - displayName: Third party public key - description: Public key of third parties - required: true diff --git a/.okd/Service.yaml b/.okd/Service.yaml deleted file mode 100644 index 8d503d52..00000000 --- a/.okd/Service.yaml +++ /dev/null @@ -1,35 +0,0 @@ -apiVersion: v1 -kind: Template -metadata: - name: ${SERVICE_NAME}-svc-tpl -objects: -- apiVersion: v1 - kind: Service - metadata: - annotations: - labels: - app: ${SERVICE_NAME} - name: ${SERVICE_NAME} - spec: - ports: - - name: 9999-tcp - port: 9999 - protocol: TCP - targetPort: 9999 - - name: 50051-tcp - port: 50051 - protocol: TCP - targetPort: 50051 - selector: - app: ${SERVICE_NAME} - sessionAffinity: None - type: ClusterIP -parameters: -- name: SERVICE_NAME - displayName: Service name - description: The name of the application (should be unique in the namespace) - value: "soteria" -- name: PORT - displayName: Port - description: the port which will be open by your application - value: "9999" diff --git a/.okd/Template.yaml b/.okd/Template.yaml deleted file mode 100644 index c8e629b6..00000000 --- a/.okd/Template.yaml +++ /dev/null @@ -1,218 +0,0 @@ -apiVersion: v1 -kind: Template -metadata: - name: emq-auth-module - annotations: - description: "EMQ Authentication/Autherization (ACL/AUTH)" - iconClass: "go-gopher" - tags: "emq,realtime" -objects: -- apiVersion: v1 - kind: Template - metadata: - name: ${SERVICE_NAME} - objects: - - apiVersion: autoscaling/v1 - kind: HorizontalPodAutoscaler - metadata: - labels: - app: ${SERVICE_NAME} - name: ${SERVICE_NAME} - spec: - scaleTargetRef: - kind: DeploymentConfig - name: ${SERVICE_NAME} - apiVersion: v1 - subresource: scale - minReplicas: ${MIN_REPLICA} - maxReplicas: ${MAX_REPLICA} - targetCPUUtilizationPercentage: ${CPU_UTILIZATION} - - apiVersion: v1 - kind: ConfigMap - metadata: - name: "${SERVICE_NAME}-jwt-keys" - labels: - app: "${SERVICE_NAME}" - - - apiVersion: v1 - kind: Template - metadata: - name: ${SERVICE_NAME} - objects: - - apiVersion: v1 - kind: Route - metadata: - labels: - app: ${SERVICE_NAME} - name: ${SERVICE_NAME} - spec: - host: ${APP_HOST}.apps.private.teh-1.snappcloud.io - port: - targetPort: ${PORT}-tcp - tls: - termination: edge - insecureEdgeTerminationPolicy: Redirect - to: - kind: Service - name: ${SERVICE_NAME} - weight: 100 - wildcardPolicy: None - - apiVersion: v1 - kind: Secret - type: Opaque - metadata: - name: "${SERVICE_NAME}-auth-env" - labels: - app: "${SERVICE_NAME}" - stringData: - CHANNEL_PREFIX: "emqch-" - JWT_BASE_PATH: "/jwt_pems/" - PASSENGER_HASH_SALT: "${PASSENGER_HASH_SALT}" - PASSENGER_HASH_MIN_LENGTH: "${PASSENGER_HASH_MIN_LENGTH}" - DRIVER_HASH_SALT: "${DRIVER_HASH_SALT}" - DRIVER_HASH_MIN_LENGTH: "${DRIVER_HASH_MIN_LENGTH}" - PASSENGER_ISSUER: "0" - DRIVER_ISSUER: "1" - - apiVersion: v1 - kind: Template - metadata: - name: ${SERVICE_NAME}-svc - objects: - - apiVersion: v1 - kind: Service - metadata: - annotations: - labels: - app: ${SERVICE_NAME} - name: ${SERVICE_NAME} - spec: - ports: - - name: ${PORT}-tcp - port: ${PORT} - protocol: TCP - targetPort: ${PORT} - selector: - app: ${SERVICE_NAME} - sessionAffinity: None - type: ClusterIP - - apiVersion: v1 - kind: Template - metadata: - name: ${SERVICE_NAME} - objects: - - apiVersion: v1 - kind: DeploymentConfig - metadata: - labels: - app: ${SERVICE_NAME} - name: ${SERVICE_NAME} - spec: - selector: - app: ${SERVICE_NAME} - strategy: - rollingParams: - intervalSeconds: 1 - maxSurge: 1 - maxUnavailable: 0 - timeoutSeconds: 600 - updatePeriodSeconds: 10 - type: Rolling - template: - metadata: - # annotations: - # prometheus.io/scrape: "true" - # prometheus.io/path: "/metrics" - labels: - app: ${SERVICE_NAME} - spec: - containers: - - name: ${SERVICE_NAME}-app - image: "docker-registry.default.svc:5000/${APP_IMAGE}" - imagePullPolicy: Always - ports: - - containerPort: ${PORT} - protocol: TCP - resources: - limits: - memory: "${MEMORY_LIMIT}" - # cpu: "${CPU_LIMIT}" - requests: - memory: "${MEMORY_REQUEST}" - # cpu: "${CPU_REQUEST}" - readinessProbe: - failureThreshold: 3 - initialDelaySeconds: 10 - periodSeconds: 23 - successThreshold: 1 - tcpSocket: - port: ${PORT} - timeoutSeconds: 2 - livenessProbe: - failureThreshold: 3 - initialDelaySeconds: 10 - periodSeconds: 29 - successThreshold: 1 - tcpSocket: - port: ${PORT} - timeoutSeconds: 2 - envFrom: - - secretRef: - name: "${SERVICE_NAME}-auth-env" - env: - - name: HTTP_PROXY - - name: HTTPS_PROXY - volumeMounts: - - name: "${SERVICE_NAME}-jwt-keys" - mountPath: "/jwt_pems/" - volumes: - - name: "${SERVICE_NAME}-jwt-keys" - configMap: - name: "${SERVICE_NAME}-jwt-keys" - # - name: "readiness-check" - # emptyDir: {} - dnsPolicy: ClusterFirst - restartPolicy: Always - terminationGracePeriodSeconds: 30 - triggers: [] - -parameters: -- name: SERVICE_NAME - displayName: Service name - description: The name of the application (should be unique in the namespace) - value: soteria -- name: MIN_REPLICA - displayName: Minimum number of replica - value: 2 -- name: MAX_REPLICA - displayName: Maximum number of replica - value: 80 -- name: CPU_UTILIZATION - displayName: Target CPU Utilization Percentage - value: 80 -- name: PASSENGER_HASH_SALT - displayName: Passenger hash salt for HashIds - required: true -- name: PASSENGER_HASH_MIN_LENGTH - displayName: Minimum length of passenger generated hash for HashIds - value: 15 -- name: DRIVER_HASH_SALT - displayName: Passenger hash salt for HashIds - required: true -- name: DRIVER_HASH_MIN_LENGTH - displayName: Minimum length of driver generated hash for HashIds - value: 15 -- name: APP_HOST - required: true - displayName: Application host -- name: APP_IMAGE - displayName: Application Docker Image - description: application will pull and run this docker image. It has to be in Snapp Cloud registery - value: "bravo-testing/soteria:master" -- name: MEMORY_LIMIT - value: "512Mi" -- name: MEMORY_REQUEST - value: "512Mi" -- name: CPU_LIMIT - value: "600m" -- name: CPU_REQUEST - value: "600m" \ No newline at end of file diff --git a/.okd/deploy.sh b/.okd/deploy.sh index 76728654..b6904cc3 100755 --- a/.okd/deploy.sh +++ b/.okd/deploy.sh @@ -1,21 +1,11 @@ -#!/usr/bin/env sh +#!/usr/bin/env bash -env > .env +set -e -echo "processing config map..." -oc process -f ./mozart/ConfigMap.yaml --param-file=.env --ignore-unknown-parameters=true | oc apply -f - +echo "Rolling out soteria..." -echo "processing secret..." -oc process -f ./mozart/Secret.yaml --param-file=.env --ignore-unknown-parameters=true | oc apply -f - +current_dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" +path_to_k8s="$current_dir/../deployments/soteria" -echo "processing service..." -oc process -f ./mozart/Service.yaml --param-file=.env --ignore-unknown-parameters=true | oc apply -f - - -echo "processing deployment config..." -oc process -f ./mozart/DeploymentConfig.yaml --param-file=.env --ignore-unknown-parameters=true | oc apply -f - - -echo "processing route..." -oc process -f ./mozart/Route.yaml --param-file=.env --ignore-unknown-parameters=true | oc apply -f - - -echo "rolling out $SERVICE_NAME ..." -oc rollout latest dc/$SERVICE_NAME +helm upgrade --install soteria "$path_to_k8s" \ + -f "$path_to_k8s/values.yaml" diff --git a/.okd/mozart/ConfigMap.yaml b/.okd/mozart/ConfigMap.yaml deleted file mode 100644 index c08062bc..00000000 --- a/.okd/mozart/ConfigMap.yaml +++ /dev/null @@ -1,58 +0,0 @@ -apiVersion: v1 -kind: Template -metadata: - name: ${SERVICE_NAME}-configmap -objects: - - apiVersion: v1 - kind: ConfigMap - metadata: - name: ${SERVICE_NAME}-env - labels: - app.snappcloud.io/name: ${SERVICE_NAME} - app.snappcloud.io/instance: ${SERVICE_NAME}-${CI_COMMIT_REF_SLUG} - app.snappcloud.io/version: ${CI_COMMIT_REF_SLUG} - app.snappcloud.io/managed-by: ${MANAGED_BY} - app.snappcloud.io/created-by: mozart - app: ${SERVICE_NAME} - data: - SOTERIA_HTTP_PORT: "9999" - SOTERIA_GRPC_PORT: "50051" - SOTERIA_REDIS_ADDRESS: "${REDIS_ADDR}" - SOTERIA_REDIS_POOL_SIZE: "10" - SOTERIA_REDIS_MAX_RETRIES: "0" - SOTERIA_REDIS_READ_TIMEOUT: "3s" - SOTERIA_REDIS_POOL_TIMEOUT: "4s" - SOTERIA_REDIS_MIN_RETRY_BACKOFF: "8ms" - SOTERIA_REDIS_MAX_RETRY_BACKOFF: "512ms" - SOTERIA_REDIS_IDLE_TIMEOUT: "300s" - SOTERIA_REDIS_IDLE_CHECK_FREQUENCY: "60s" - SOTERIA_REDIS_SET_MEMBER_EXP_TIME: "300s" - SOTERIA_REDIS_MIN_IDLE_CONNECTIONS: "5" - SOTERIA_LOGGER_LEVEL: "${LOG_LEVEL}" - SOTERIA_LOGGER_SENTRY_ENABLED: "false" - SOTERIA_LOGGER_SENTRY_DSN: "" - SOTERIA_LOGGER_SENTRY_TIMEOUT: "500ms" - SOTERIA_ALLOWED_ACCESS_TYPES: "sub,pub" - SOTERIA_CACHE_ENABLED: "true" - SOTERIA_CACHE_EXPIRATION: "600s" - -parameters: - - name: SERVICE_NAME - displayName: Service name - required: true - value: "soteria" - - name: MANAGED_BY - displayName: Created By - required: true - value: dispatching-team - - name: CI_COMMIT_REF_SLUG - displayName: Commit Ref Slug - required: true - value: "dev" - - name: LOG_LEVEL - value: "DEBUG" - displayName: Log Level - description: How much log do you want? (DEBUG|INFO|WARN|ERROR|OFF) - - name: REDIS_ADDR - required: true - value: "rediscentral:6379" diff --git a/.okd/mozart/DeploymentConfig.yaml b/.okd/mozart/DeploymentConfig.yaml deleted file mode 100644 index 238d545b..00000000 --- a/.okd/mozart/DeploymentConfig.yaml +++ /dev/null @@ -1,151 +0,0 @@ -apiVersion: v1 -kind: Template -metadata: - name: ${SERVICE_NAME}-deployment-config -objects: - - apiVersion: v1 - kind: DeploymentConfig - metadata: - labels: - app: ${SERVICE_NAME} - app.snappcloud.io/name: ${SERVICE_NAME} - app.snappcloud.io/instance: ${SERVICE_NAME}-${CI_COMMIT_REF_SLUG} - app.snappcloud.io/version: ${CI_COMMIT_REF_SLUG} - app.snappcloud.io/managed-by: ${MANAGED_BY} - app.snappcloud.io/created-by: mozart - name: ${SERVICE_NAME} - spec: - replicas: 1 - selector: - app: ${SERVICE_NAME} - deploymentconfig: ${SERVICE_NAME} - triggers: [] - template: - metadata: - annotations: - prometheus.io/scrape: "${METRICS_ENABLED}" - prometheus.io/path: "/metrics" - labels: - app: ${SERVICE_NAME} - deploymentconfig: ${SERVICE_NAME} - spec: - initContainers: - - name: ${SERVICE_NAME}-app-init - image: docker-registry.default.svc:5000/mozart/${SERVICE_NAME}:${SERVICE_IMAGE_TAG} - command: ["/app/soteria", "accounts", "init", "db.json"] - imagePullPolicy: Always - envFrom: - - secretRef: - name: ${SERVICE_NAME}-auth-env - - configMapRef: - name: "${SERVICE_NAME}-env" - volumeMounts: - - name: "${SERVICE_NAME}-db" - mountPath: "/app/db.json" - subPath: db.json - readOnly: true - containers: - - name: ${SERVICE_NAME}-app - image: docker-registry.default.svc:5000/mozart/${SERVICE_NAME}:${SERVICE_IMAGE_TAG} - command: ["/app/soteria", "serve"] - imagePullPolicy: Always - ports: - - containerPort: 9999 - protocol: TCP - resources: - limits: - memory: "${MEMORY_LIMIT}" - # cpu: "${CPU_LIMIT}" - requests: - memory: "${MEMORY_REQUEST}" - # cpu: "${CPU_REQUEST}" - readinessProbe: - failureThreshold: 3 - initialDelaySeconds: 10 - periodSeconds: 23 - successThreshold: 1 - tcpSocket: - port: 9999 - timeoutSeconds: 2 - livenessProbe: - failureThreshold: 3 - initialDelaySeconds: 10 - periodSeconds: 29 - successThreshold: 1 - tcpSocket: - port: 9999 - timeoutSeconds: 2 - envFrom: - - secretRef: - name: ${SERVICE_NAME}-auth-env - - configMapRef: - name: "${SERVICE_NAME}-env" - env: - - name: LOG_LEVEL - value: "${LOG_LEVEL}" - - name: HTTP_PROXY - - name: HTTPS_PROXY - volumeMounts: - - name: "${SERVICE_NAME}-jwt-keys" - mountPath: "/jwt_pems/100.private.pem" - subPath: 100.private.pem - readOnly: true - - name: "${SERVICE_NAME}-jwt-keys" - mountPath: "/jwt_pems/100.pem" - subPath: 100.pem - readOnly: true - - name: "${SERVICE_NAME}-jwt-keys" - mountPath: "/jwt_pems/1.pem" - subPath: 1.pem - readOnly: true - - name: "${SERVICE_NAME}-jwt-keys" - mountPath: "/jwt_pems/0.pem" - subPath: 0.pem - readOnly: true - volumes: - - name: "${SERVICE_NAME}-jwt-keys" - secret: - secretName: "${SERVICE_NAME}-jwt-keys" - - name: "${SERVICE_NAME}-db" - secret: - secretName: "${SERVICE_NAME}-db" - dnsPolicy: ClusterFirst - restartPolicy: Always - terminationGracePeriodSeconds: 30 -parameters: -- name: SERVICE_IMAGE_TAG - displayName: Application Docker Image - description: application will pull and run this docker image. It has to be in Snapp Cloud registery - value: "dev" -- name: CI_COMMIT_REF_SLUG - displayName: Deployment branch - required: true - value: "dev" -- name: SERVICE_NAME - displayName: Service name - description: The name of the application (should be unique in the namespace) - value: "soteria" -- name: PORT - value: "9999" - displayName: Port - description: the port which will be open by your application -- name: MEMORY_LIMIT - value: "150Mi" -- name: MEMORY_REQUEST - value: "150Mi" -- name: CPU_LIMIT - value: "500m" -- name: CPU_REQUEST - value: "500m" -- name: LOG_LEVEL - value: "DEBUG" - displayName: Log Level - description: How much log do you want? (DEBUG|INFO|WARN|ERROR|OFF) -- name: METRICS_ENABLED - value: "false" - displayName: Metrics Endpoint? - description: /metrics endpoint will be available for Prometheus -- name: MANAGED_BY - displayName: Managed By - required: true - value: dispatching-team diff --git a/.okd/mozart/Route.yaml b/.okd/mozart/Route.yaml deleted file mode 100644 index 223d1754..00000000 --- a/.okd/mozart/Route.yaml +++ /dev/null @@ -1,52 +0,0 @@ -apiVersion: v1 -kind: Template -metadata: - name: ${SERVICE_NAME} -objects: - - - apiVersion: v1 - kind: Route - metadata: - labels: - app.snappcloud.io/name: ${SERVICE_NAME} - app.snappcloud.io/instance: ${SERVICE_NAME}-${CI_COMMIT_REF_SLUG} - app.snappcloud.io/version: ${CI_COMMIT_REF_SLUG} - app.snappcloud.io/managed-by: dispatching-team - app.snappcloud.io/created-by: ${CREATED_BY} - app: ${SERVICE_NAME} - name: ${SERVICE_NAME}-tcp - spec: - host: ${SERVICE_NAME}-${SERVICE_NAMESPACE}.apps.private.${CLUSTER_NAME}.snappcloud.io - port: - targetPort: ${SERVICE_NAME}-tcp - tls: - termination: edge - insecureEdgeTerminationPolicy: Allow - to: - kind: Service - name: ${SERVICE_NAME} - weight: 100 - wildcardPolicy: None - -parameters: - - name: CLUSTER_NAME - displayName: Cluster name - required: true - value: "teh-1" - - name: SERVICE_NAME - displayName: Service name - description: The name of the application (should be unique in the namespace) - required: true - value: soteria - - name: SERVICE_NAMESPACE - displayName: Application Unique ID - required: true - value: "snapp-ode-mozart" - - name: CREATED_BY - displayName: Service name - required: true - value: mozart - - name: CI_COMMIT_REF_SLUG - displayName: Commit Ref Slug - required: true - value: "dev" diff --git a/.okd/mozart/Secret.yaml b/.okd/mozart/Secret.yaml deleted file mode 100644 index 22030e57..00000000 --- a/.okd/mozart/Secret.yaml +++ /dev/null @@ -1,152 +0,0 @@ -apiVersion: v1 -kind: Template -metadata: - name: "${SERVICE_NAME}-secret" -objects: - - apiVersion: v1 - kind: Secret - type: Opaque - metadata: - name: "${SERVICE_NAME}-auth-env" - labels: - app: "${SERVICE_NAME}" - app.snappcloud.io/created-by: "mozart" - app.snappcloud.io/managed-by: "${MANAGED_BY}" - app.snappcloud.io/version: "${APP_VERSION}" - app.snappcloud.io/instance: "${SERVICE_NAME}-${CI_COMMIT_REF_SLUG}" - stringData: - SOTERIA_JWT_KEYS_PATH: "${JWT_KEYS_PATH}" - SOTERIA_DRIVER_SALT: "${DRIVER_HASH_SALT}" - SOTERIA_PASSENGER_SALT: "${PASSENGER_HASH_SALT}" - SOTERIA_DRIVER_HASH_LENGTH: "${DRIVER_HASH_LENGTH}" - SOTERIA_PASSENGER_HASH_LENGTH: "${PASSENGER_HASH_LENGTH}" - - apiVersion: v1 - kind: Secret - type: Opaque - metadata: - name: "${SERVICE_NAME}-jwt-keys" - labels: - app: "${SERVICE_NAME}" - app.snappcloud.io/created-by: "mozart" - app.snappcloud.io/managed-by: "${MANAGED_BY}" - app.snappcloud.io/version: "${APP_VERSION}" - app.snappcloud.io/instance: "${SERVICE_NAME}-${CI_COMMIT_REF_SLUG}" - stringData: - 0.pem: "${DRIVER_JWT_PUBLIC_KEY}" - 1.pem: "${PASSENGER_JWT_PUBLIC_KEY}" - 100.pem: "${THIRD_PARTY_JWT_PUBLIC_KEY}" - 100.private.pem: "${THIRD_PARTY_JWT_PRIVATE_KEY}" - - apiVersion: v1 - kind: Secret - type: Opaque - metadata: - name: "${SERVICE_NAME}-db" - labels: - app: "${SERVICE_NAME}" - app.snappcloud.io/created-by: "mozart" - app.snappcloud.io/managed-by: "${MANAGED_BY}" - app.snappcloud.io/version: "${APP_VERSION}" - app.snappcloud.io/instance: "${SERVICE_NAME}-${CI_COMMIT_REF_SLUG}" - stringData: - db.json: "${DB}" - - -parameters: - - name: SERVICE_NAME - displayName: Service name - description: The name of the application (should be unique in the namespace) - value: "soteria" - - name: APP_VERSION - required: true - value: "dev" - - name: MANAGED_BY - displayName: Managed by - required: true - value: "dispatching-team" - - name: CI_COMMIT_REF_SLUG - displayName: Commit Ref Slug - required: true - value: "dev" - - name: PASSENGER_HASH_SALT - displayName: Passenger hash salt for HashIds - required: true - value: "secret" - - name: PASSENGER_HASH_LENGTH - displayName: Minimum length of passenger generated hash for HashIds - value: "15" - - name: DRIVER_HASH_SALT - displayName: Passenger hash salt for HashIds - required: true - value: "secret" - - name: DRIVER_HASH_LENGTH - displayName: Minimum length of driver generated hash for HashIds - value: "15" - - name: JWT_KEYS_PATH - displayName: Private Key Path - description: Private key Path - value: "/jwt_pems/" - required: true - - name: THIRD_PARTY_JWT_PRIVATE_KEY - displayName: Third Party JWT Private Key - required: true - value: |- - -----BEGIN RSA PRIVATE KEY----- - MIICWwIBAAKBgQCTxwVGmWzJNOaZnBRL+9/V1Mc8OWWzUDxlG2kL+0WxHh8/+76n - gIvp7YsHHxUadR0iY6NkzLgFv+sBkKh523Nx0YtuGgmGuuVTaD27G2inwgFDabUs - AKISBbn6d6jwlkfk3D+O6h5pdLqoI64Zq/NPmD0oWsupn2HVhMSjFbE6dwIDAQAB - AoGAJDRGHp3IASNsu4V5k4QJuqF+jkqhl+S4Zyzn939/+3ydu1c5xl+/53fC7+O1 - j93RXXN7vF5LV11FfgSqwe/5wDEcAtyLXWPCHtLB1CIYFfqHxgwOQm4gQSyOgBnP - hMccyv0VCDK23+Mk37lLkuON6xXMC8+IUq5UW/aadxkeqoECQQDU9Z5IFCmp3Ibs - hJXx/x+ZQI+gLj0hh71pQEO2zqhu19i+M62KKnDb7k2OtK9IJR2ucU+YE3SXGShh - 1sPmgfVfAkEAsaTtZ1oZmszOs5TPYhs2e7LKLPNADZ36GVsG2h1FHVX+LyNkwk/E - pn+FV3Dd1vkzxG/a3znEKz+2BJiz4vF56QJATUxKA4euB8XQA5Gsi4Y7Bfl1KIMg - FUeb7NQyv+wLHxChz4gaeYgmJu48oIvdA6bVOzhN17lYHHA5RCocOVL6qQJAdHdT - 6nmo5dO3BQfgO0rqGolqgbPtX8AeE3eZc3DTOluBrbf/vGF95UcfzedCmkmBxh0r - m0SNN2mq1TKkZXq52QJAIjxhG7spkOSZJQnVBA9TfLYZFM/aUzDpLxflvFAuJuqJ - l+PFsbek2Zl6fgy294dXRvQhp1PJryngDaXTBiWK6g== - -----END RSA PRIVATE KEY----- - - name: DRIVER_JWT_PUBLIC_KEY - displayName: Driver public key - description: Public Key of driver's token - required: true - value: |- - -----BEGIN PUBLIC KEY----- - MIIBITANBgkqhkiG9w0BAQEFAAOCAQ4AMIIBCQKCAQBk7O6M5p4eYNAwtVU2beGa - W4mhFG94OtYUWDl1E7UUrhUNGf97Eb/45NjQszu0YPERnApJc2RUm2TrS7iq0mHz - Xbwf+CbNF54Q5mjuHcpBKgvFwUUSCCYBftmRc4xbFIH4Oh3nHC2GeukUS9TmJwjM - tJKyU0Ve8BK5BgjhagM7XSs+scE2mxemoWtcs6mJLtBuEgRGMgHW00mSdOcLp/+l - oHpSzRYN92/DomwmmjGVy8Ji0faeHx+r79ZzE0E8Rcc29Yhrg1ymrjfkXg98WjAb - TSv4UAN20lsBDejpnGEZKJrxHZ56gHgaJn6PKKCD6ItJA7y7iraCdBhCfAIUIz/z - AgMBAAE= - -----END PUBLIC KEY----- - - name: PASSENGER_JWT_PUBLIC_KEY - displayName: Passenger public key - description: Public Key of passenger's token - required: true - value: |- - -----BEGIN PUBLIC KEY----- - MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA1lNRwyNsDieWs6LvHOJ+ - GyehhRC4Pn5yL5edKP3565F3LtRDMrkzwDRsQbqnUtTea9HCdTdBv+lI8vE17qRi - RQn10IMaIH6e4Aa3OWNClFhuqNOag7VmffsjTOgxHgHpfGAKVF/4BwqOHrdHFbAD - VOiWB1hv9Uc0C5laffGAub7fj+EAI02zlrsNDxYW8vyF2H47N7VWcvgd3RhZpxlG - 8bq9phl7Ja55YmQiT2Ic3/K5tsazg5z9lz6OTrx+JvWbefHFlJpjCLz5yefEaRmX - 9L/zyDMi4jgFTZEWNXC2vIrxwZMFwFhBXEp0PcCbuHJgJIucbRrbwukQC16uHJwP - zQIDAQAB - -----END PUBLIC KEY----- - - name: THIRD_PARTY_JWT_PUBLIC_KEY - displayName: Third party public key - description: Public key of third parties - required: true - value: |- - -----BEGIN PUBLIC KEY----- - MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCTxwVGmWzJNOaZnBRL+9/V1Mc8 - OWWzUDxlG2kL+0WxHh8/+76ngIvp7YsHHxUadR0iY6NkzLgFv+sBkKh523Nx0Ytu - GgmGuuVTaD27G2inwgFDabUsAKISBbn6d6jwlkfk3D+O6h5pdLqoI64Zq/NPmD0o - Wsupn2HVhMSjFbE6dwIDAQAB - -----END PUBLIC KEY----- - - name: DB - displayName: Initial database state - description: Initial database state - required: true - value: |- - [{"meta_data":{"model_name":"user","date_created":"2020-09-29T10:44:15.106544359+03:30","date_modified":"2020-09-29T10:44:15.106544423+03:30"},"username":"driver","password":"password","type":"EMQUser","ips":null,"secret":"secret","token_expiration_duration":2592000000000000,"rules":[{"uuid":"84df6017-a850-42a3-a06f-22306a006a8d","endpoint":"","topic":"cab_event","access_type":"1"},{"uuid":"df0b884e-41dc-444e-81d4-67f62ae2174c","endpoint":"","topic":"driver_location","access_type":"2"},{"uuid":"1375192a-6fc5-4409-abd8-0d21ef106bee","endpoint":"","topic":"shared_location","access_type":"1"},{"uuid":"d7aeb294-6271-470a-987a-01ea4f035e5d","endpoint":"","topic":"superapp_event","access_type":"1"},{"uuid":"702dfb02-251a-11ec-9621-0242ac130002","endpoint":"","topic":"call_entry","access_type":"2"},{"uuid":"9582c554-251a-11ec-9621-0242ac130002","endpoint":"","topic":"call_outgoing","access_type":"1"}]},{"meta_data":{"model_name":"user","date_created":"2020-09-29T10:44:15.106560757+03:30","date_modified":"2020-09-29T10:44:15.106560814+03:30"},"username":"passenger","password":"password","type":"EMQUser","ips":null,"secret":"secret","token_expiration_duration":2592000000000000,"rules":[{"uuid":"a51f1898-3381-456f-a5fe-0e9d80b5bee0","endpoint":"","topic":"cab_event","access_type":"1"},{"uuid":"8de97e3f-e772-4da4-8f15-4dc048f5c06e","endpoint":"","topic":"superapp_event","access_type":"1"},{"uuid":"c41260ed-70eb-4554-bc15-5714fc1bf3f8","endpoint":"","topic":"passenger_location","access_type":"2"},{"uuid":"1375192a-6fc5-4409-abd8-0d21ef106bee","endpoint":"","topic":"shared_location","access_type":"1"},{"uuid":"a6a87996-251a-11ec-9621-0242ac130002","endpoint":"","topic":"call_entry","access_type":"2"},{"uuid":"ad368bc2-251a-11ec-9621-0242ac130002","endpoint":"","topic":"call_outgoing","access_type":"1"}]},{"meta_data":{"model_name":"user","date_created":"2020-09-29T10:44:15.106567252+03:30","date_modified":"2020-09-29T10:44:15.106567311+03:30"},"username":"box","password":"password","type":"EMQUser","ips":null,"secret":"secret","token_expiration_duration":2592000000000000,"rules":[{"uuid":"e591af90-8191-4118-941a-7ef4434414ee","endpoint":"","topic":"box_event","access_type":"1"}]},{"meta_data":{"model_name":"user","date_created":"2020-09-29T10:44:15.106569957+03:30","date_modified":"2020-09-29T10:44:15.106570022+03:30"},"username":"colony-subscriber","password":"password","type":"EMQUser","ips":null,"secret":"secret","token_expiration_duration":2592000000000000,"rules":[{"uuid":"bcbe0a57-1706-4de7-a948-71c56c9700c4","endpoint":"","topic":"driver_location","access_type":"1"}]},{"meta_data":{"model_name":"user","date_created":"2020-09-29T10:44:15.106573104+03:30","date_modified":"2020-09-29T10:44:15.106573162+03:30"},"username":"gabriel","password":"password","type":"HeraldUser","ips":null,"secret":"secret","token_expiration_duration":2592000000000000,"rules":[{"uuid":"305dc844-5df0-42dc-849b-deccfe2dab96","endpoint":"\/notification","topic":"","access_type":"2"},{"uuid":"5795227f-10a8-4822-ba5e-a1fc057a0a95","endpoint":"\/event","topic":"","access_type":"2"}]},{"meta_data":{"model_name":"user","date_created":"2021-06-23T08:42:24.722521722Z","date_modified":"2021-07-06T18:40:10.074710788Z"},"username":"gossiper","password":"password","type":"EMQUser","ips":null,"secret":"secret","token_expiration_duration":30758400000000000,"rules":[{"uuid":"ec6f659e-fe73-41cd-805e-c5285bd92a8d","endpoint":"","topic":"shared_location","access_type":"2"},{"uuid":"a8dc06c4-bb11-4cb9-8da7-84ae34d2d14a","endpoint":"","topic":"driver_location","access_type":"1"},{"uuid":"cda59530-d412-4c6d-bb3b-7a89c6bf58c5","endpoint":"","topic":"passenger_location","access_type":"1"}]}] diff --git a/.okd/mozart/Service.yaml b/.okd/mozart/Service.yaml deleted file mode 100644 index 79d7b005..00000000 --- a/.okd/mozart/Service.yaml +++ /dev/null @@ -1,39 +0,0 @@ -apiVersion: v1 -kind: Template -objects: - - apiVersion: v1 - kind: Service - metadata: - name: ${SERVICE_NAME} - labels: - app.snappcloud.io/name: ${SERVICE_NAME} - app.snappcloud.io/instance: ${SERVICE_NAME}-${CI_COMMIT_REF_SLUG} - app.snappcloud.io/version: ${CI_COMMIT_REF_SLUG} - app.snappcloud.io/managed-by: dispatching-team - app.snappcloud.io/created-by: ${CREATED_BY} - app: "${SERVICE_NAME}" - spec: - ports: - - name: ${SERVICE_NAME}-tcp - port: 9999 - protocol: TCP - targetPort: 9999 - - name: 50051-tcp - port: 50051 - protocol: TCP - targetPort: 50051 - selector: - deploymentconfig: ${SERVICE_NAME} -parameters: - - name: SERVICE_NAME - displayName: Service name - required: true - value: "soteria" - - name: CREATED_BY - displayName: Created By - required: true - value: mozart - - name: CI_COMMIT_REF_SLUG - displayName: Commit Ref Slug - required: true - value: "dev" diff --git a/.okd/oldMozart/ConfigMap.yaml b/.okd/oldMozart/ConfigMap.yaml deleted file mode 100644 index ba656114..00000000 --- a/.okd/oldMozart/ConfigMap.yaml +++ /dev/null @@ -1,61 +0,0 @@ -apiVersion: v1 -kind: Template -metadata: - name: ${SERVICE_NAME}-configmap -objects: - - apiVersion: v1 - kind: ConfigMap - metadata: - name: ${SERVICE_NAME}-jwt-keys - labels: - app.snappcloud.io/name: ${SERVICE_NAME} - app.snappcloud.io/instance: ${SERVICE_NAME}-${CI_COMMIT_REF_SLUG} - app.snappcloud.io/version: ${CI_COMMIT_REF_SLUG} - app.snappcloud.io/managed-by: bravo - app.snappcloud.io/created-by: ${CREATED_BY} - app: ${SERVICE_NAME} - data: - 100.private.pem: ${BOX_JWT_PRIVATE_KEY} - 100.pem: ${BOX_JWT_PUBLIC_KEY} -parameters: - - name: SERVICE_NAME - displayName: Service name - required: true - value: "soteria" - - name: CREATED_BY - displayName: Created By - required: true - value: mozart - - name: CI_COMMIT_REF_SLUG - displayName: Commit Ref Slug - required: true - value: "qe" - - name: BOX_JWT_PUBLIC_KEY - displayName: Box JWT Public Key - required: true - value: |- - -----BEGIN PUBLIC KEY----- - MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCTxwVGmWzJNOaZnBRL+9/V1Mc8 - OWWzUDxlG2kL+0WxHh8/+76ngIvp7YsHHxUadR0iY6NkzLgFv+sBkKh523Nx0Ytu - GgmGuuVTaD27G2inwgFDabUsAKISBbn6d6jwlkfk3D+O6h5pdLqoI64Zq/NPmD0o - Wsupn2HVhMSjFbE6dwIDAQAB - -----END PUBLIC KEY----- - - name: BOX_JWT_PRIVATE_KEY - displayName: Box JWT Private Key - required: true - value: |- - -----BEGIN RSA PRIVATE KEY----- - MIICWwIBAAKBgQCTxwVGmWzJNOaZnBRL+9/V1Mc8OWWzUDxlG2kL+0WxHh8/+76n - gIvp7YsHHxUadR0iY6NkzLgFv+sBkKh523Nx0YtuGgmGuuVTaD27G2inwgFDabUs - AKISBbn6d6jwlkfk3D+O6h5pdLqoI64Zq/NPmD0oWsupn2HVhMSjFbE6dwIDAQAB - AoGAJDRGHp3IASNsu4V5k4QJuqF+jkqhl+S4Zyzn939/+3ydu1c5xl+/53fC7+O1 - j93RXXN7vF5LV11FfgSqwe/5wDEcAtyLXWPCHtLB1CIYFfqHxgwOQm4gQSyOgBnP - hMccyv0VCDK23+Mk37lLkuON6xXMC8+IUq5UW/aadxkeqoECQQDU9Z5IFCmp3Ibs - hJXx/x+ZQI+gLj0hh71pQEO2zqhu19i+M62KKnDb7k2OtK9IJR2ucU+YE3SXGShh - 1sPmgfVfAkEAsaTtZ1oZmszOs5TPYhs2e7LKLPNADZ36GVsG2h1FHVX+LyNkwk/E - pn+FV3Dd1vkzxG/a3znEKz+2BJiz4vF56QJATUxKA4euB8XQA5Gsi4Y7Bfl1KIMg - FUeb7NQyv+wLHxChz4gaeYgmJu48oIvdA6bVOzhN17lYHHA5RCocOVL6qQJAdHdT - 6nmo5dO3BQfgO0rqGolqgbPtX8AeE3eZc3DTOluBrbf/vGF95UcfzedCmkmBxh0r - m0SNN2mq1TKkZXq52QJAIjxhG7spkOSZJQnVBA9TfLYZFM/aUzDpLxflvFAuJuqJ - l+PFsbek2Zl6fgy294dXRvQhp1PJryngDaXTBiWK6g== - -----END RSA PRIVATE KEY----- \ No newline at end of file diff --git a/.okd/oldMozart/DeploymentConfig.yaml b/.okd/oldMozart/DeploymentConfig.yaml deleted file mode 100644 index 8dbdc528..00000000 --- a/.okd/oldMozart/DeploymentConfig.yaml +++ /dev/null @@ -1,151 +0,0 @@ -apiVersion: v1 -kind: Template -metadata: - name: ${SERVICE_NAME}-deployment-config -objects: - - apiVersion: v1 - kind: DeploymentConfig - metadata: - labels: - app.snappcloud.io/name: ${SERVICE_NAME} - app.snappcloud.io/instance: ${SERVICE_NAME}-${CI_COMMIT_REF_SLUG} - app.snappcloud.io/version: ${CI_COMMIT_REF_SLUG} - app.snappcloud.io/managed-by: bravo - app.snappcloud.io/created-by: ${CREATED_BY} - app: ${SERVICE_NAME} - name: ${SERVICE_NAME} - spec: - replicas: 1 - selector: - app: ${SERVICE_NAME} - deploymentconfig: ${SERVICE_NAME} - triggers: [] - template: - metadata: - annotations: - prometheus.io/scrape: "${METRICS_ENABLED}" - prometheus.io/path: "/metrics" - labels: - app: ${SERVICE_NAME} - deploymentconfig: ${SERVICE_NAME} - spec: - containers: - - name: ${SERVICE_NAME}-app - image: docker-registry.default.svc:5000/mozart/${SERVICE_NAME}:master - imagePullPolicy: Always - ports: - - containerPort: 9999 - protocol: TCP - resources: - limits: - memory: "${MEMORY_LIMIT}" - # cpu: "${CPU_LIMIT}" - requests: - memory: "${MEMORY_REQUEST}" - # cpu: "${CPU_REQUEST}" - readinessProbe: - failureThreshold: 3 - initialDelaySeconds: 10 - periodSeconds: 23 - successThreshold: 1 - tcpSocket: - port: 9999 - timeoutSeconds: 2 - livenessProbe: - failureThreshold: 3 - initialDelaySeconds: 10 - periodSeconds: 29 - successThreshold: 1 - tcpSocket: - port: 9999 - timeoutSeconds: 2 - envFrom: - - secretRef: - name: "${SERVICE_NAME}-auth-env" - env: - - name: LOG_LEVEL - value: "${LOG_LEVEL}" - - name: DEBUG - value: "${DEBUG}" - - name: HTTP_PROXY - - name: HTTPS_PROXY - volumeMounts: - - name: "${SERVICE_NAME}-passenger-keys" - mountPath: "/jwt_pems/1.pem" - subPath: "1.pem" - readOnly: true - - name: "${SERVICE_NAME}-driver-keys" - mountPath: "/jwt_pems/0.pem" - subPath: "0.pem" - readOnly: true - - name: "${SERVICE_NAME}-3rd-party-keys" - mountPath: "/jwt_pems/100.private.pem" - subPath: 100.private.pem - readOnly: true - - name: "${SERVICE_NAME}-3rd-party-keys" - mountPath: "/jwt_pems/100.pem" - subPath: 100.pem - readOnly: true - volumes: - - name: "${SERVICE_NAME}-passenger-keys" - secret: - secretName: passengeroauth-keys - items: - - key: passenger-public.pem - path: "1.pem" - - name: "${SERVICE_NAME}-driver-keys" - secret: - secretName: driveroauth-keys - items: - - key: driver-public.pem - path: "0.pem" - - name: "${SERVICE_NAME}-3rd-party-keys" - configMap: - name: ${SERVICE_NAME}-jwt-keys - - # - name: "readiness-check" - # emptyDir: {} - dnsPolicy: ClusterFirst - restartPolicy: Always - terminationGracePeriodSeconds: 30 -parameters: -- name: SERVICE_IMAGE_TAG - displayName: Application Docker Image - description: application will pull and run this docker image. It has to be in Snapp Cloud registery - value: "qe" -- name: CI_COMMIT_REF_SLUG - displayName: Deployment branch - required: true - value: "master" -- name: SERVICE_NAME - displayName: Service name - description: The name of the application (should be unique in the namespace) - value: "soteria" -- name: PORT - value: "9999" - displayName: Port - description: the port which will be open by your application -- name: MEMORY_LIMIT - value: "150Mi" -- name: MEMORY_REQUEST - value: "150Mi" -- name: CPU_LIMIT - value: "500m" -- name: CPU_REQUEST - value: "500m" -- name: DEBUG - value: "0" - displayName: Debug Mode - description: Add more debug info under /pprof route if it's enabled -- name: LOG_LEVEL - value: "DEBUG" - displayName: Log Level - description: How much log do you want? (DEBUG|INFO|WARN|ERROR|OFF) -- name: METRICS_ENABLED - value: "false" - displayName: Metrics Endpoint? - description: /metrics endpoint will be available for Prometheus -- name: CREATED_BY - displayName: Created By - required: true - value: mozart diff --git a/.okd/oldMozart/Route.yaml b/.okd/oldMozart/Route.yaml deleted file mode 100644 index 08967366..00000000 --- a/.okd/oldMozart/Route.yaml +++ /dev/null @@ -1,44 +0,0 @@ -apiVersion: v1 -kind: Template -metadata: - name: ${SERVICE_NAME} -objects: -- apiVersion: v1 - kind: Route - metadata: - labels: - app: ${SERVICE_NAME} - app.snappcloud.io/name: ${SERVICE_NAME} - app.snappcloud.io/instance: ${SERVICE_NAME}-${CI_COMMIT_REF_SLUG} - app.snappcloud.io/version: ${CI_COMMIT_REF_SLUG} - app.snappcloud.io/managed-by: bravo - app.snappcloud.io/created-by: ${CREATED_BY} - name: ${SERVICE_NAME}-tcp - spec: - host: ${SERVICE_NAME}-${SERVICE_NAMESPACE}.apps.private.teh-1.snappcloud.io - port: - targetPort: ${SERVICE_NAME}-tcp - to: - kind: Service - name: ${SERVICE_NAME} - weight: 100 - wildcardPolicy: None - -parameters: -- name: SERVICE_NAME - displayName: Service name - description: The name of the application (should be unique in the namespace) - required: true - value: soteria -- name: SERVICE_NAMESPACE - displayName: Application Unique ID - required: true - value: "snapp-ode-mozart" -- name: CREATED_BY - displayName: Service name - required: true - value: mozart -- name: CI_COMMIT_REF_SLUG - displayName: Commit Ref Slug - required: true - value: "qe" diff --git a/.okd/oldMozart/Secret.yaml b/.okd/oldMozart/Secret.yaml deleted file mode 100644 index 1fd334a8..00000000 --- a/.okd/oldMozart/Secret.yaml +++ /dev/null @@ -1,61 +0,0 @@ -apiVersion: v1 -kind: Template -metadata: - name: ${SERVICE_NAME}-secret-tpl -objects: - - apiVersion: v1 - kind: Secret - type: Opaque - metadata: - name: "${SERVICE_NAME}-auth-env" - labels: - app.snappcloud.io/name: ${SERVICE_NAME} - app.snappcloud.io/instance: ${SERVICE_NAME}-${CI_COMMIT_REF_SLUG} - app.snappcloud.io/version: ${CI_COMMIT_REF_SLUG} - app.snappcloud.io/managed-by: bravo - app.snappcloud.io/created-by: ${CREATED_BY} - app: ${SERVICE_NAME} - stringData: - CHANNEL_PREFIX: "emqch-" - JWT_BASE_PATH: "/jwt_pems/" - SALT_1: "${PASSENGER_HASH_SALT}" - HASH_LENGTH_1: "${PASSENGER_HASH_MIN_LENGTH}" - SALT_0: "${DRIVER_HASH_SALT}" - HASH_LENGTH_0: "${DRIVER_HASH_MIN_LENGTH}" - ISS_TYPE_0: "driver" - ISS_TYPE_1: "passenger" - ISS_TYPE_100: "third party" - THIRDPARTY_CONFIG: "${VENDOR_APPLICATION_DATA}" - -parameters: - - name: PASSENGER_HASH_SALT - displayName: Passenger hash salt for HashIds - value: "secret" - required: true - - name: PASSENGER_HASH_MIN_LENGTH - displayName: Minimum length of passenger generated hash for HashIds - value: "15" - - name: DRIVER_HASH_SALT - displayName: Passenger hash salt for HashIds - value: "secret" - required: true - - name: DRIVER_HASH_MIN_LENGTH - displayName: Minimum length of driver generated hash for HashIds - value: "15" - - name: VENDOR_APPLICATION_DATA - displayName: Vendor Application Data - description: The configuration of 3rd parties application - required: true - value: "ewogICAiYm94Ijp7CiAgICAgICJ0eXBlIjoic3Vic2NyaWJlciIsCiAgICAgICJ0b2tlbiI6IktKSWlraklLYklZVkdqKVlpaFlVR0lCJiIsCiAgICAgICJ0b3BpY3MiOiJidWNrcywgMTExMSIsCiAgICAgICJleHAiOjg2NDAwCiAgIH0sCiAgICJoZXJhbGQtcHVibGlzaCI6ewogICAgICAidHlwZSI6InB1Ymxpc2giLAogICAgICAidG9rZW4iOiJ1dTBKVlB0aygxbnRHYWN1IiwKICAgICAgInRvcGljcyI6IioiLAogICAgICAiZXhwIjoxNTc2ODAwMDAKICAgfSwKICAgImhlcmFsZC1zdWJzY3JpYmVyIjp7CiAgICAgICJ0eXBlIjoic3Vic2NyaWJlciIsCiAgICAgICJ0b2tlbiI6InV1MEpWUHRrKDFudEdhY3UiLAogICAgICAidG9waWNzIjoiKiIsCiAgICAgICJleHAiOjE1NzY4MDAwMAogICB9LAogICAiY29sb255LXN1YnNjcmliZXIiOnsKICAgICAgInR5cGUiOiJzdWJzY3JpYmVyIiwKICAgICAgInRva2VuIjoidXUwSlZQdGsoMW50R2FjdXpwIiwKICAgICAgInRvcGljcyI6IioiLAogICAgICAiZXhwIjoxNTc2ODAwMDAKICAgfQp9" - - name: SERVICE_NAME - displayName: Service name - description: The name of the application (should be unique in the namespace) - value: "soteria" - - name: CREATED_BY - displayName: Created By - required: true - value: mozart - - name: CI_COMMIT_REF_SLUG - displayName: Commit Ref Slug - required: true - value: "qe" diff --git a/.okd/oldMozart/Service.yaml b/.okd/oldMozart/Service.yaml deleted file mode 100644 index b2f4154c..00000000 --- a/.okd/oldMozart/Service.yaml +++ /dev/null @@ -1,35 +0,0 @@ -apiVersion: v1 -kind: Template -objects: - - apiVersion: v1 - kind: Service - metadata: - name: ${SERVICE_NAME} - labels: - app.snappcloud.io/name: ${SERVICE_NAME} - app.snappcloud.io/instance: ${SERVICE_NAME}-${CI_COMMIT_REF_SLUG} - app.snappcloud.io/version: ${CI_COMMIT_REF_SLUG} - app.snappcloud.io/managed-by: bravo - app.snappcloud.io/created-by: ${CREATED_BY} - app: "${SERVICE_NAME}" - spec: - ports: - - name: ${SERVICE_NAME}-tcp - port: 9999 - protocol: TCP - targetPort: 9999 - selector: - deploymentconfig: ${SERVICE_NAME} -parameters: - - name: SERVICE_NAME - displayName: Service name - required: true - value: "soteria" - - name: CREATED_BY - displayName: Created By - required: true - value: mozart - - name: CI_COMMIT_REF_SLUG - displayName: Commit Ref Slug - required: true - value: "qe" \ No newline at end of file diff --git a/.okd/teardown.sh b/.okd/teardown.sh new file mode 100755 index 00000000..cf50c30c --- /dev/null +++ b/.okd/teardown.sh @@ -0,0 +1,3 @@ +#!/usr/bin/env bash + +helm uninstall soteria From ce4be58616cb378bda258184db636ffe289914c7 Mon Sep 17 00:00:00 2001 From: Parham Alvani Date: Sat, 27 Nov 2021 13:25:30 +0330 Subject: [PATCH 105/660] feat: add app label --- deployments/soteria/templates/_helpers.tpl | 1 + 1 file changed, 1 insertion(+) diff --git a/deployments/soteria/templates/_helpers.tpl b/deployments/soteria/templates/_helpers.tpl index 2e44edc8..0c08413c 100644 --- a/deployments/soteria/templates/_helpers.tpl +++ b/deployments/soteria/templates/_helpers.tpl @@ -35,6 +35,7 @@ Common labels */}} {{- define "soteria.labels" -}} helm.sh/chart: {{ include "soteria.chart" . }} +app: soteria {{ include "soteria.selectorLabels" . }} {{- if .Chart.AppVersion }} app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} From fdd829477964b5f72d73c6b2b6b015e3577491eb Mon Sep 17 00:00:00 2001 From: Parham Alvani Date: Sat, 27 Nov 2021 13:25:48 +0330 Subject: [PATCH 106/660] chore: remove comments --- deployments/soteria/values.yaml | 4 ---- 1 file changed, 4 deletions(-) diff --git a/deployments/soteria/values.yaml b/deployments/soteria/values.yaml index cadf6e4f..fcda8b8a 100644 --- a/deployments/soteria/values.yaml +++ b/deployments/soteria/values.yaml @@ -1,8 +1,4 @@ --- -# Default values for Soteria. -# This is a YAML-formatted file. -# Declare variables to be passed into your templates. - replicaCount: 1 namespace: dispatching-staging From 2c47eedc39c05cf8b0ca93a3d3a812d6690ae015 Mon Sep 17 00:00:00 2001 From: Parham Alvani Date: Sat, 27 Nov 2021 13:25:59 +0330 Subject: [PATCH 107/660] feat: add ode values --- deployments/soteria/values.ode.yaml | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 deployments/soteria/values.ode.yaml diff --git a/deployments/soteria/values.ode.yaml b/deployments/soteria/values.ode.yaml new file mode 100644 index 00000000..62e1cd4a --- /dev/null +++ b/deployments/soteria/values.ode.yaml @@ -0,0 +1,9 @@ +--- +namespace: ode +region: teh-1 + +image: + registry: docker-registry.default.svc:5000 + repository: mozart/soteria + tag: main + pullPolicy: Always From e15d50145ce6f780e71e26c05b3738fb25b14c08 Mon Sep 17 00:00:00 2001 From: Parham Alvani Date: Sat, 27 Nov 2021 13:32:33 +0330 Subject: [PATCH 108/660] feat: remove soteria ingress --- deployments/soteria/templates/ingress.yaml | 42 ---------------------- deployments/soteria/values.yaml | 11 ------ 2 files changed, 53 deletions(-) delete mode 100644 deployments/soteria/templates/ingress.yaml diff --git a/deployments/soteria/templates/ingress.yaml b/deployments/soteria/templates/ingress.yaml deleted file mode 100644 index b7ab2c75..00000000 --- a/deployments/soteria/templates/ingress.yaml +++ /dev/null @@ -1,42 +0,0 @@ -{{- if .Values.ingress.enabled -}} -{{- $fullName := include "soteria.fullname" . -}} -{{- $svcPort := .Values.service.port -}} -{{- if semverCompare ">=1.14-0" .Capabilities.KubeVersion.GitVersion -}} -apiVersion: networking.k8s.io/v1beta1 -{{- else -}} -apiVersion: extensions/v1beta1 -{{- end }} -kind: Ingress -metadata: - name: {{ $fullName }} - namespace: {{ $.Release.Namespace }} - labels: - {{- include "soteria.labels" . | nindent 4 }} - {{- with .Values.ingress.annotations }} - annotations: - {{- toYaml . | nindent 4 }} - {{- end }} -spec: - {{- if .Values.ingress.tls }} - tls: - {{- range .Values.ingress.tls }} - - hosts: - {{- range .hosts }} - - {{ . | quote }} - {{- end }} - secretName: {{ .secretName }} - {{- end }} - {{- end }} - rules: - {{- range .Values.ingress.hosts }} - - host: {{ .host | quote }} - http: - paths: - {{- range .paths }} - - path: {{ .path }} - backend: - serviceName: {{ $fullName }} - servicePort: {{ $svcPort }} - {{- end }} - {{- end }} -{{- end }} diff --git a/deployments/soteria/values.yaml b/deployments/soteria/values.yaml index fcda8b8a..85dd4a91 100644 --- a/deployments/soteria/values.yaml +++ b/deployments/soteria/values.yaml @@ -7,7 +7,6 @@ region: teh-1 image: registry: docker-registry.default.svc:5000 repository: realtime-staging/soteria - tag: dev pullPolicy: Always timezone: Asia/Tehran @@ -37,16 +36,6 @@ rollingParams: maxSurge: 5 maxUnavailable: 0 -ingress: - enabled: false - annotations: {} - # kubernetes.io/ingress.class: nginDeploymentConfigx - # kubernetes.io/tls-acme: "true" - hosts: - - host: chart-example.local - paths: [ ] - tls: [ ] - serviceMonitor: enabled: false From 04546cc521fc8682a0bf2061b0442608cc88ff20 Mon Sep 17 00:00:00 2001 From: Parham Alvani Date: Sat, 27 Nov 2021 13:37:47 +0330 Subject: [PATCH 109/660] fix: correct .okd --- .okd/deploy.sh | 3 ++- deployments/soteria/values.ode.yaml | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.okd/deploy.sh b/.okd/deploy.sh index b6904cc3..275cca88 100755 --- a/.okd/deploy.sh +++ b/.okd/deploy.sh @@ -8,4 +8,5 @@ current_dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" path_to_k8s="$current_dir/../deployments/soteria" helm upgrade --install soteria "$path_to_k8s" \ - -f "$path_to_k8s/values.yaml" + -f "$path_to_k8s/values.yaml" \ + -f "$path_to_k8s/values.ode.yaml" diff --git a/deployments/soteria/values.ode.yaml b/deployments/soteria/values.ode.yaml index 62e1cd4a..d0ff1fd5 100644 --- a/deployments/soteria/values.ode.yaml +++ b/deployments/soteria/values.ode.yaml @@ -3,7 +3,7 @@ namespace: ode region: teh-1 image: - registry: docker-registry.default.svc:5000 + registry: registry.apps.private.teh-1.snappcloud.io repository: mozart/soteria tag: main pullPolicy: Always From 67d4dd693be2778a7c8ffe975bdef01e340c666e Mon Sep 17 00:00:00 2001 From: Parham Alvani Date: Sat, 27 Nov 2021 14:02:11 +0330 Subject: [PATCH 110/660] feat: update notes --- deployments/soteria/templates/NOTES.txt | 23 +---------------------- 1 file changed, 1 insertion(+), 22 deletions(-) diff --git a/deployments/soteria/templates/NOTES.txt b/deployments/soteria/templates/NOTES.txt index 786ac34a..f7bdfe37 100644 --- a/deployments/soteria/templates/NOTES.txt +++ b/deployments/soteria/templates/NOTES.txt @@ -1,22 +1 @@ -1. Get the application URL by running these commands: -{{- if .Values.ingress.enabled }} -{{- range $host := .Values.ingress.hosts }} - {{- range .paths }} - http{{ if $.Values.ingress.tls }}s{{ end }}://{{ $host.host }}{{ .path }} - {{- end }} -{{- end }} -{{- else if contains "NodePort" .Values.service.type }} - export NODE_PORT=$(kubectl get --namespace {{ .Release.Namespace }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ include "soteria.fullname" . }}) - export NODE_IP=$(kubectl get nodes --namespace {{ .Release.Namespace }} -o jsonpath="{.items[0].status.addresses[0].address}") - echo http://$NODE_IP:$NODE_PORT -{{- else if contains "LoadBalancer" .Values.service.type }} - NOTE: It may take a few minutes for the LoadBalancer IP to be available. - You can watch the status of by running 'kubectl get --namespace {{ .Release.Namespace }} svc -w {{ include "soteria.fullname" . }}' - export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ include "soteria.fullname" . }} --template "{{"{{ range (index .status.loadBalancer.ingress 0) }}{{.}}{{ end }}"}}") - echo http://$SERVICE_IP:{{ .Values.service.port }} -{{- else if contains "ClusterIP" .Values.service.type }} - export POD_NAME=$(kubectl get pods --namespace {{ .Release.Namespace }} -l "app.kubernetes.io/name={{ include "soteria.name" . }},app.kubernetes.io/instance={{ .Release.Name }}" -o jsonpath="{.items[0].metadata.name}") - export CONTAINER_PORT=$(kubectl get pod --namespace {{ .Release.Namespace }} $POD_NAME -o jsonpath="{.spec.containers[0].ports[0].containerPort}") - echo "Visit http://127.0.0.1:8080 to use your application" - kubectl --namespace {{ .Release.Namespace }} port-forward $POD_NAME 8080:$CONTAINER_PORT -{{- end }} +Soteria does the emq authentication and its serivce must be set in emqx http_auth configuration. From b83397cc0b48e434ff8e4b6628023daec28378f1 Mon Sep 17 00:00:00 2001 From: Parham Alvani Date: Sat, 27 Nov 2021 14:04:04 +0330 Subject: [PATCH 111/660] feat: update chart version --- deployments/soteria/Chart.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/deployments/soteria/Chart.yaml b/deployments/soteria/Chart.yaml index 7204874d..67e1ef4e 100644 --- a/deployments/soteria/Chart.yaml +++ b/deployments/soteria/Chart.yaml @@ -5,6 +5,6 @@ description: Soteria Helm Chart type: application -version: 5.1.1 +version: 5.1.2 -appVersion: "v5-1-1" +appVersion: "v5-1-2" From 09247bfed07760e71274c41c802b0cbc3f3c1aa9 Mon Sep 17 00:00:00 2001 From: Parham Alvani Date: Sat, 27 Nov 2021 14:04:04 +0330 Subject: [PATCH 112/660] feat: update chart version --- deployments/soteria/Chart.yaml | 4 ++-- {.okd => deployments/soteria}/deploy.sh | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) rename {.okd => deployments/soteria}/deploy.sh (82%) diff --git a/deployments/soteria/Chart.yaml b/deployments/soteria/Chart.yaml index 7204874d..67e1ef4e 100644 --- a/deployments/soteria/Chart.yaml +++ b/deployments/soteria/Chart.yaml @@ -5,6 +5,6 @@ description: Soteria Helm Chart type: application -version: 5.1.1 +version: 5.1.2 -appVersion: "v5-1-1" +appVersion: "v5-1-2" diff --git a/.okd/deploy.sh b/deployments/soteria/deploy.sh similarity index 82% rename from .okd/deploy.sh rename to deployments/soteria/deploy.sh index 275cca88..9bf4af1f 100755 --- a/.okd/deploy.sh +++ b/deployments/soteria/deploy.sh @@ -5,7 +5,7 @@ set -e echo "Rolling out soteria..." current_dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" -path_to_k8s="$current_dir/../deployments/soteria" +path_to_k8s="$current_dir" helm upgrade --install soteria "$path_to_k8s" \ -f "$path_to_k8s/values.yaml" \ From 44745f8b467b33125f47f74d8684c62a1c047d6a Mon Sep 17 00:00:00 2001 From: Parham Alvani Date: Sat, 27 Nov 2021 15:05:59 +0330 Subject: [PATCH 113/660] fix: correct deploy.sh file location --- deployments/{soteria => }/deploy.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) rename deployments/{soteria => }/deploy.sh (87%) diff --git a/deployments/soteria/deploy.sh b/deployments/deploy.sh similarity index 87% rename from deployments/soteria/deploy.sh rename to deployments/deploy.sh index 9bf4af1f..1e02fe86 100755 --- a/deployments/soteria/deploy.sh +++ b/deployments/deploy.sh @@ -5,7 +5,7 @@ set -e echo "Rolling out soteria..." current_dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" -path_to_k8s="$current_dir" +path_to_k8s="$current_dir/soteria" helm upgrade --install soteria "$path_to_k8s" \ -f "$path_to_k8s/values.yaml" \ From 9f4609736563cccad4061dbb257f009c9f779c59 Mon Sep 17 00:00:00 2001 From: Parham Alvani Date: Sat, 27 Nov 2021 15:23:34 +0330 Subject: [PATCH 114/660] feat: move soteria into deployments folder --- deployments/{soteria => }/.helmignore | 0 deployments/{soteria => }/Chart.yaml | 0 deployments/{soteria => }/templates/NOTES.txt | 0 deployments/{soteria => }/templates/_helpers.tpl | 0 deployments/{soteria => }/templates/configmap.yaml | 0 deployments/{soteria => }/templates/deployment.yaml | 0 deployments/{soteria => }/templates/hpa.yaml | 0 deployments/{soteria => }/templates/secret.yaml | 0 deployments/{soteria => }/templates/service.yaml | 0 deployments/{soteria => }/templates/servicemonitor.yaml | 0 deployments/{soteria => }/templates/tests/test-connection.yaml | 0 deployments/{soteria => }/values.ode.yaml | 0 deployments/{soteria => }/values.yaml | 0 13 files changed, 0 insertions(+), 0 deletions(-) rename deployments/{soteria => }/.helmignore (100%) rename deployments/{soteria => }/Chart.yaml (100%) rename deployments/{soteria => }/templates/NOTES.txt (100%) rename deployments/{soteria => }/templates/_helpers.tpl (100%) rename deployments/{soteria => }/templates/configmap.yaml (100%) rename deployments/{soteria => }/templates/deployment.yaml (100%) rename deployments/{soteria => }/templates/hpa.yaml (100%) rename deployments/{soteria => }/templates/secret.yaml (100%) rename deployments/{soteria => }/templates/service.yaml (100%) rename deployments/{soteria => }/templates/servicemonitor.yaml (100%) rename deployments/{soteria => }/templates/tests/test-connection.yaml (100%) rename deployments/{soteria => }/values.ode.yaml (100%) rename deployments/{soteria => }/values.yaml (100%) diff --git a/deployments/soteria/.helmignore b/deployments/.helmignore similarity index 100% rename from deployments/soteria/.helmignore rename to deployments/.helmignore diff --git a/deployments/soteria/Chart.yaml b/deployments/Chart.yaml similarity index 100% rename from deployments/soteria/Chart.yaml rename to deployments/Chart.yaml diff --git a/deployments/soteria/templates/NOTES.txt b/deployments/templates/NOTES.txt similarity index 100% rename from deployments/soteria/templates/NOTES.txt rename to deployments/templates/NOTES.txt diff --git a/deployments/soteria/templates/_helpers.tpl b/deployments/templates/_helpers.tpl similarity index 100% rename from deployments/soteria/templates/_helpers.tpl rename to deployments/templates/_helpers.tpl diff --git a/deployments/soteria/templates/configmap.yaml b/deployments/templates/configmap.yaml similarity index 100% rename from deployments/soteria/templates/configmap.yaml rename to deployments/templates/configmap.yaml diff --git a/deployments/soteria/templates/deployment.yaml b/deployments/templates/deployment.yaml similarity index 100% rename from deployments/soteria/templates/deployment.yaml rename to deployments/templates/deployment.yaml diff --git a/deployments/soteria/templates/hpa.yaml b/deployments/templates/hpa.yaml similarity index 100% rename from deployments/soteria/templates/hpa.yaml rename to deployments/templates/hpa.yaml diff --git a/deployments/soteria/templates/secret.yaml b/deployments/templates/secret.yaml similarity index 100% rename from deployments/soteria/templates/secret.yaml rename to deployments/templates/secret.yaml diff --git a/deployments/soteria/templates/service.yaml b/deployments/templates/service.yaml similarity index 100% rename from deployments/soteria/templates/service.yaml rename to deployments/templates/service.yaml diff --git a/deployments/soteria/templates/servicemonitor.yaml b/deployments/templates/servicemonitor.yaml similarity index 100% rename from deployments/soteria/templates/servicemonitor.yaml rename to deployments/templates/servicemonitor.yaml diff --git a/deployments/soteria/templates/tests/test-connection.yaml b/deployments/templates/tests/test-connection.yaml similarity index 100% rename from deployments/soteria/templates/tests/test-connection.yaml rename to deployments/templates/tests/test-connection.yaml diff --git a/deployments/soteria/values.ode.yaml b/deployments/values.ode.yaml similarity index 100% rename from deployments/soteria/values.ode.yaml rename to deployments/values.ode.yaml diff --git a/deployments/soteria/values.yaml b/deployments/values.yaml similarity index 100% rename from deployments/soteria/values.yaml rename to deployments/values.yaml From fc5ab1127bb5c1a22946e1570e3c98ecd144a4c3 Mon Sep 17 00:00:00 2001 From: Parham Alvani Date: Sat, 27 Nov 2021 15:41:12 +0330 Subject: [PATCH 115/660] fix: correct deploy.sh --- deployments/deploy.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/deployments/deploy.sh b/deployments/deploy.sh index 1e02fe86..9bf4af1f 100755 --- a/deployments/deploy.sh +++ b/deployments/deploy.sh @@ -5,7 +5,7 @@ set -e echo "Rolling out soteria..." current_dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" -path_to_k8s="$current_dir/soteria" +path_to_k8s="$current_dir" helm upgrade --install soteria "$path_to_k8s" \ -f "$path_to_k8s/values.yaml" \ From 7aaab7331a1173aabd16b7edf6e3b0674b54d68a Mon Sep 17 00:00:00 2001 From: Parham Alvani Date: Sat, 27 Nov 2021 16:15:04 +0330 Subject: [PATCH 116/660] Revert "fix: correct deploy.sh" This reverts commit e9384ff48f33c612941df2beb62d161c70aa405d. --- deployments/deploy.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/deployments/deploy.sh b/deployments/deploy.sh index 9bf4af1f..1e02fe86 100755 --- a/deployments/deploy.sh +++ b/deployments/deploy.sh @@ -5,7 +5,7 @@ set -e echo "Rolling out soteria..." current_dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" -path_to_k8s="$current_dir" +path_to_k8s="$current_dir/soteria" helm upgrade --install soteria "$path_to_k8s" \ -f "$path_to_k8s/values.yaml" \ From e660b89baa87e64f1053e0b9da08ff2e0c34f8c5 Mon Sep 17 00:00:00 2001 From: Parham Alvani Date: Sat, 27 Nov 2021 16:15:18 +0330 Subject: [PATCH 117/660] Revert "feat: move soteria into deployments folder" This reverts commit e6d944a4f21dcf67d726d7a5559ee2d6545774a9. --- deployments/{ => soteria}/.helmignore | 0 deployments/{ => soteria}/Chart.yaml | 0 deployments/{ => soteria}/templates/NOTES.txt | 0 deployments/{ => soteria}/templates/_helpers.tpl | 0 deployments/{ => soteria}/templates/configmap.yaml | 0 deployments/{ => soteria}/templates/deployment.yaml | 0 deployments/{ => soteria}/templates/hpa.yaml | 0 deployments/{ => soteria}/templates/secret.yaml | 0 deployments/{ => soteria}/templates/service.yaml | 0 deployments/{ => soteria}/templates/servicemonitor.yaml | 0 deployments/{ => soteria}/templates/tests/test-connection.yaml | 0 deployments/{ => soteria}/values.ode.yaml | 0 deployments/{ => soteria}/values.yaml | 0 13 files changed, 0 insertions(+), 0 deletions(-) rename deployments/{ => soteria}/.helmignore (100%) rename deployments/{ => soteria}/Chart.yaml (100%) rename deployments/{ => soteria}/templates/NOTES.txt (100%) rename deployments/{ => soteria}/templates/_helpers.tpl (100%) rename deployments/{ => soteria}/templates/configmap.yaml (100%) rename deployments/{ => soteria}/templates/deployment.yaml (100%) rename deployments/{ => soteria}/templates/hpa.yaml (100%) rename deployments/{ => soteria}/templates/secret.yaml (100%) rename deployments/{ => soteria}/templates/service.yaml (100%) rename deployments/{ => soteria}/templates/servicemonitor.yaml (100%) rename deployments/{ => soteria}/templates/tests/test-connection.yaml (100%) rename deployments/{ => soteria}/values.ode.yaml (100%) rename deployments/{ => soteria}/values.yaml (100%) diff --git a/deployments/.helmignore b/deployments/soteria/.helmignore similarity index 100% rename from deployments/.helmignore rename to deployments/soteria/.helmignore diff --git a/deployments/Chart.yaml b/deployments/soteria/Chart.yaml similarity index 100% rename from deployments/Chart.yaml rename to deployments/soteria/Chart.yaml diff --git a/deployments/templates/NOTES.txt b/deployments/soteria/templates/NOTES.txt similarity index 100% rename from deployments/templates/NOTES.txt rename to deployments/soteria/templates/NOTES.txt diff --git a/deployments/templates/_helpers.tpl b/deployments/soteria/templates/_helpers.tpl similarity index 100% rename from deployments/templates/_helpers.tpl rename to deployments/soteria/templates/_helpers.tpl diff --git a/deployments/templates/configmap.yaml b/deployments/soteria/templates/configmap.yaml similarity index 100% rename from deployments/templates/configmap.yaml rename to deployments/soteria/templates/configmap.yaml diff --git a/deployments/templates/deployment.yaml b/deployments/soteria/templates/deployment.yaml similarity index 100% rename from deployments/templates/deployment.yaml rename to deployments/soteria/templates/deployment.yaml diff --git a/deployments/templates/hpa.yaml b/deployments/soteria/templates/hpa.yaml similarity index 100% rename from deployments/templates/hpa.yaml rename to deployments/soteria/templates/hpa.yaml diff --git a/deployments/templates/secret.yaml b/deployments/soteria/templates/secret.yaml similarity index 100% rename from deployments/templates/secret.yaml rename to deployments/soteria/templates/secret.yaml diff --git a/deployments/templates/service.yaml b/deployments/soteria/templates/service.yaml similarity index 100% rename from deployments/templates/service.yaml rename to deployments/soteria/templates/service.yaml diff --git a/deployments/templates/servicemonitor.yaml b/deployments/soteria/templates/servicemonitor.yaml similarity index 100% rename from deployments/templates/servicemonitor.yaml rename to deployments/soteria/templates/servicemonitor.yaml diff --git a/deployments/templates/tests/test-connection.yaml b/deployments/soteria/templates/tests/test-connection.yaml similarity index 100% rename from deployments/templates/tests/test-connection.yaml rename to deployments/soteria/templates/tests/test-connection.yaml diff --git a/deployments/values.ode.yaml b/deployments/soteria/values.ode.yaml similarity index 100% rename from deployments/values.ode.yaml rename to deployments/soteria/values.ode.yaml diff --git a/deployments/values.yaml b/deployments/soteria/values.yaml similarity index 100% rename from deployments/values.yaml rename to deployments/soteria/values.yaml From 20d2e1106021cd066f293221a16084fca3fa0689 Mon Sep 17 00:00:00 2001 From: Parham Alvani Date: Sat, 27 Nov 2021 16:15:26 +0330 Subject: [PATCH 118/660] Revert "fix: correct deploy.sh file location" This reverts commit 4e8f5c97fb815584b6cbe9547fb73fa833bc373f. --- deployments/{ => soteria}/deploy.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) rename deployments/{ => soteria}/deploy.sh (87%) diff --git a/deployments/deploy.sh b/deployments/soteria/deploy.sh similarity index 87% rename from deployments/deploy.sh rename to deployments/soteria/deploy.sh index 1e02fe86..9bf4af1f 100755 --- a/deployments/deploy.sh +++ b/deployments/soteria/deploy.sh @@ -5,7 +5,7 @@ set -e echo "Rolling out soteria..." current_dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" -path_to_k8s="$current_dir/soteria" +path_to_k8s="$current_dir" helm upgrade --install soteria "$path_to_k8s" \ -f "$path_to_k8s/values.yaml" \ From 4a86be9ac03a6aeaa9846b153c848606b20ac349 Mon Sep 17 00:00:00 2001 From: Parham Alvani Date: Sat, 27 Nov 2021 16:23:55 +0330 Subject: [PATCH 119/660] feat: remove .okd folder --- deployments/{soteria => }/deploy.sh | 2 +- {.okd => deployments}/teardown.sh | 0 2 files changed, 1 insertion(+), 1 deletion(-) rename deployments/{soteria => }/deploy.sh (87%) rename {.okd => deployments}/teardown.sh (100%) diff --git a/deployments/soteria/deploy.sh b/deployments/deploy.sh similarity index 87% rename from deployments/soteria/deploy.sh rename to deployments/deploy.sh index 9bf4af1f..1e02fe86 100755 --- a/deployments/soteria/deploy.sh +++ b/deployments/deploy.sh @@ -5,7 +5,7 @@ set -e echo "Rolling out soteria..." current_dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" -path_to_k8s="$current_dir" +path_to_k8s="$current_dir/soteria" helm upgrade --install soteria "$path_to_k8s" \ -f "$path_to_k8s/values.yaml" \ diff --git a/.okd/teardown.sh b/deployments/teardown.sh similarity index 100% rename from .okd/teardown.sh rename to deployments/teardown.sh From fa1cb3a3db3c41f1c58769cee4ef2b81137b1c07 Mon Sep 17 00:00:00 2001 From: Parham Alvani Date: Sat, 27 Nov 2021 16:37:34 +0330 Subject: [PATCH 120/660] feat: update chart version --- deployments/soteria/Chart.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/deployments/soteria/Chart.yaml b/deployments/soteria/Chart.yaml index 67e1ef4e..a8f02b01 100644 --- a/deployments/soteria/Chart.yaml +++ b/deployments/soteria/Chart.yaml @@ -5,6 +5,6 @@ description: Soteria Helm Chart type: application -version: 5.1.2 +version: 5.1.3 -appVersion: "v5-1-2" +appVersion: "v5-1-3" From e26ea802e971b24f60e37304e4a395af634793a9 Mon Sep 17 00:00:00 2001 From: Parham Alvani Date: Sat, 27 Nov 2021 17:28:34 +0330 Subject: [PATCH 121/660] feat: add new topics for chat --- deployments/soteria/values.yaml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/deployments/soteria/values.yaml b/deployments/soteria/values.yaml index 85dd4a91..8e29b78b 100644 --- a/deployments/soteria/values.yaml +++ b/deployments/soteria/values.yaml @@ -88,6 +88,10 @@ users: access: '2' - topic: call_outgoing access: '1' + - topic: chat + access: '1' + - topic: chat + access: '2' - username: passenger rules: - topic: cab_event @@ -102,3 +106,7 @@ users: access: '2' - topic: call_outgoing access: '1' + - topic: chat + access: '1' + - topic: chat + access: '2' From b2bda1ce0cb46baba2b88665258e29747ca2ff49 Mon Sep 17 00:00:00 2001 From: Parham Alvani Date: Mon, 6 Dec 2021 00:37:21 +0330 Subject: [PATCH 122/660] feat: add okd4 registeries --- .gitlab/ci/templates/release.gitlab-ci.yml | 29 ++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/.gitlab/ci/templates/release.gitlab-ci.yml b/.gitlab/ci/templates/release.gitlab-ci.yml index 450edb89..cff673f2 100644 --- a/.gitlab/ci/templates/release.gitlab-ci.yml +++ b/.gitlab/ci/templates/release.gitlab-ci.yml @@ -14,6 +14,21 @@ release:staging:teh-1: - branches when: manual +release:staging:teh-2: + extends: .easy_ci:release:docker + variables: + OKD4_TEH1_REGISTRY: "image-registry.apps.private.okd4.teh-2.snappcloud.io" + RELEASE_CONTAINER_REGISTRY_ADDRESS: "$OKD4_TEH2_REGISTRY" + RELEASE_CONTAINER_REGISTRY_IMAGE: "$OKD4_TEH2_REGISTRY/realtime-staging/$CI_PROJECT_NAME" + RELEASE_CONTAINER_REGISTRY_USERNAME: "gitlab-ci" + RELEASE_CONTAINER_REGISTRY_PASSWORD: ${OKD4_TEH2_REALTIME_STAGING_TOKEN} + dependencies: + - build + only: + - tags + - branches + when: manual + release:mozart: extends: .easy_ci:release:docker variables: @@ -42,6 +57,20 @@ release:production:teh-1: - tags when: manual +release:production:teh-2: + extends: .easy_ci:release:docker + variables: + OKD4_TEH1_REGISTRY: "image-registry.apps.private.okd4.teh-2.snappcloud.io" + RELEASE_CONTAINER_REGISTRY_ADDRESS: "$OKD4_TEH2_REGISTRY" + RELEASE_CONTAINER_REGISTRY_IMAGE: "$OKD4_TEH2_REGISTRY/realtime-production/$CI_PROJECT_NAME" + RELEASE_CONTAINER_REGISTRY_USERNAME: "gitlab-ci" + RELEASE_CONTAINER_REGISTRY_PASSWORD: ${OKD4_TEH2_REALTIME_PRODUCTION_TOKEN} + dependencies: + - build + only: + - tags + when: manual + release:production:baly: extends: .easy_ci:release:docker variables: From 0cbd3daea8a86d060b48d92838637c17fcad76b4 Mon Sep 17 00:00:00 2001 From: Parham Alvani Date: Mon, 6 Dec 2021 01:12:10 +0330 Subject: [PATCH 123/660] fix: correct teh-2 pipeline --- .gitlab/ci/templates/release.gitlab-ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.gitlab/ci/templates/release.gitlab-ci.yml b/.gitlab/ci/templates/release.gitlab-ci.yml index cff673f2..d0b1f26a 100644 --- a/.gitlab/ci/templates/release.gitlab-ci.yml +++ b/.gitlab/ci/templates/release.gitlab-ci.yml @@ -17,7 +17,7 @@ release:staging:teh-1: release:staging:teh-2: extends: .easy_ci:release:docker variables: - OKD4_TEH1_REGISTRY: "image-registry.apps.private.okd4.teh-2.snappcloud.io" + OKD4_TEH2_REGISTRY: "image-registry.apps.private.okd4.teh-2.snappcloud.io" RELEASE_CONTAINER_REGISTRY_ADDRESS: "$OKD4_TEH2_REGISTRY" RELEASE_CONTAINER_REGISTRY_IMAGE: "$OKD4_TEH2_REGISTRY/realtime-staging/$CI_PROJECT_NAME" RELEASE_CONTAINER_REGISTRY_USERNAME: "gitlab-ci" @@ -60,7 +60,7 @@ release:production:teh-1: release:production:teh-2: extends: .easy_ci:release:docker variables: - OKD4_TEH1_REGISTRY: "image-registry.apps.private.okd4.teh-2.snappcloud.io" + OKD4_TEH2_REGISTRY: "image-registry.apps.private.okd4.teh-2.snappcloud.io" RELEASE_CONTAINER_REGISTRY_ADDRESS: "$OKD4_TEH2_REGISTRY" RELEASE_CONTAINER_REGISTRY_IMAGE: "$OKD4_TEH2_REGISTRY/realtime-production/$CI_PROJECT_NAME" RELEASE_CONTAINER_REGISTRY_USERNAME: "gitlab-ci" From a446d2566c58097471a62c902c87b89e026fbed0 Mon Sep 17 00:00:00 2001 From: Parham Alvani Date: Mon, 6 Dec 2021 01:15:56 +0330 Subject: [PATCH 124/660] feat: remove daghigh topic --- internal/authenticator/authenticator.go | 2 -- internal/topics/t.go | 5 ----- internal/topics/t_test.go | 15 --------------- 3 files changed, 22 deletions(-) diff --git a/internal/authenticator/authenticator.go b/internal/authenticator/authenticator.go index c4de4fda..d0f31141 100644 --- a/internal/authenticator/authenticator.go +++ b/internal/authenticator/authenticator.go @@ -211,8 +211,6 @@ func (a Authenticator) ValidateTopicBySender(topic topics.Topic, audience snappi ch, _ = a.EMQTopicManager.CreateCallEntryTopic(id, audience) case topics.CallOutgoing: ch, _ = a.EMQTopicManager.CreateCallOutgoingTopic(id, audience) - case topics.DaghighSys: - return true case topics.BoxEvent: return true } diff --git a/internal/topics/t.go b/internal/topics/t.go index fa498bec..03e01836 100644 --- a/internal/topics/t.go +++ b/internal/topics/t.go @@ -15,7 +15,6 @@ const ( PassengerLocation Type = "passenger_location" SuperappEvent Type = "superapp_event" BoxEvent Type = "box_event" - DaghighSys Type = "daghigh_sys" SharedLocation Type = "shared_location" Chat Type = "chat" CallEntry Type = "call_entry" @@ -31,7 +30,6 @@ var ( PassengerLocationRegexp = regexp.MustCompile(`/passenger/[a-zA-Z0-9+]+/location`) SuperappEventRegexp = regexp.MustCompile(`/(driver|passenger)/[a-zA-Z0-9]+/(superapp)`) SharedLocationRegexp = regexp.MustCompile(`/(driver|passenger)+/[a-zA-Z0-9]+/(driver-location|passenger-location)`) - DaghighSysRegexp = regexp.MustCompile(`\$SYS/brokers/\+/clients/\+/(connected|disconnected)`) ChatRegexp = regexp.MustCompile(`/(driver|passenger)+/[a-zA-Z0-9+]+/chat`) CallEntryRegexp = regexp.MustCompile(`/(driver|passenger)+/[a-zA-Z0-9+]+/call/send`) CallOutgoingRegexp = regexp.MustCompile(`/(driver|passenger)+/[a-zA-Z0-9+]+/call/receive`) @@ -41,7 +39,6 @@ func (t Topic) GetType() Type { return t.GetTypeWithCompany("snapp") } -// nolint: cyclop func (t Topic) GetTypeWithCompany(company string) Type { topic := string(t) topic = strings.TrimPrefix(topic, company) @@ -65,8 +62,6 @@ func (t Topic) GetTypeWithCompany(company string) Type { return SuperappEvent case topic == "bucks": return BoxEvent - case DaghighSysRegexp.MatchString(topic): - return DaghighSys } return "" diff --git a/internal/topics/t_test.go b/internal/topics/t_test.go index d8ed750c..dc4e7414 100644 --- a/internal/topics/t_test.go +++ b/internal/topics/t_test.go @@ -51,21 +51,6 @@ func TestTopic_GetType(t1 *testing.T) { arg: "snapp/driver/+/location", want: DriverLocation, }, - { - name: "testing daghigh sys", - arg: "$SYS/brokers/+/clients/+/disconnected", - want: DaghighSys, - }, - { - name: "testing daghigh sys", - arg: "$SYS/brokers/+/clients/+/connected", - want: DaghighSys, - }, - { - name: "testing daghigh sys", - arg: "$share/hello/$SYS/brokers/+/clients/+/connected", - want: DaghighSys, - }, { name: "testing shared passenger location", arg: "snapp/passenger/py9kdjLYB35RP4q/driver-location", From d574515e767bcd60346c3e86ac48c2b63999d22c Mon Sep 17 00:00:00 2001 From: Parham Alvani Date: Mon, 6 Dec 2021 01:19:52 +0330 Subject: [PATCH 125/660] feat: update packages --- go.mod | 8 ++++---- go.sum | 8 ++++++++ 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/go.mod b/go.mod index 00a8ca59..94726de8 100644 --- a/go.mod +++ b/go.mod @@ -6,12 +6,12 @@ require ( github.com/ansrivas/fiberprometheus/v2 v2.1.2 github.com/gofiber/contrib/fiberzap v0.0.0-20211104103143-eae1892b9aac github.com/gofiber/fiber/v2 v2.22.0 - github.com/golang-jwt/jwt/v4 v4.1.0 + github.com/golang-jwt/jwt/v4 v4.2.0 github.com/knadh/koanf v1.3.3 github.com/prometheus/client_golang v1.11.0 // indirect github.com/spf13/cobra v1.2.1 github.com/stretchr/testify v1.7.0 - gitlab.snapp.ir/dispatching/snappids/v2 v2.8.0 + gitlab.snapp.ir/dispatching/snappids/v2 v2.8.2 go.uber.org/atomic v1.9.0 // indirect go.uber.org/automaxprocs v1.4.0 go.uber.org/zap v1.19.1 @@ -39,7 +39,7 @@ require ( github.com/kr/pretty v0.3.0 // indirect github.com/matttproud/golang_protobuf_extensions v1.0.1 // indirect github.com/mitchellh/copystructure v1.2.0 // indirect - github.com/mitchellh/mapstructure v1.4.2 // indirect + github.com/mitchellh/mapstructure v1.4.3 // indirect github.com/mitchellh/reflectwalk v1.0.2 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect github.com/prometheus/client_model v0.2.0 // indirect @@ -52,7 +52,7 @@ require ( github.com/valyala/fasthttp v1.31.0 // indirect github.com/valyala/tcplisten v1.0.0 // indirect go.uber.org/multierr v1.7.0 // indirect - golang.org/x/sys v0.0.0-20211123173158-ef496fb156ab // indirect + golang.org/x/sys v0.0.0-20211205182925-97ca703d548d // indirect google.golang.org/protobuf v1.27.1 // indirect gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c // indirect gopkg.in/yaml.v2 v2.4.0 // indirect diff --git a/go.sum b/go.sum index 4eb1144d..4e464699 100644 --- a/go.sum +++ b/go.sum @@ -172,6 +172,8 @@ github.com/gogo/protobuf v1.2.1/go.mod h1:hp+jE20tsWTFYpLwKvXlhS1hjn+gTNwPg2I6zV github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q= github.com/golang-jwt/jwt/v4 v4.1.0 h1:XUgk2Ex5veyVFVeLm0xhusUTQybEbexJXrvPNOKkSY0= github.com/golang-jwt/jwt/v4 v4.1.0/go.mod h1:/xlHOz8bRuivTWchD4jCa+NbatV+wEUSzwAxVc6locg= +github.com/golang-jwt/jwt/v4 v4.2.0 h1:besgBTC8w8HjP6NzQdxwKH9Z5oQMZ24ThTrHp3cZ8eU= +github.com/golang-jwt/jwt/v4 v4.2.0/go.mod h1:/xlHOz8bRuivTWchD4jCa+NbatV+wEUSzwAxVc6locg= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= github.com/golang/groupcache v0.0.0-20160516000752-02826c3e7903/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= @@ -358,6 +360,8 @@ github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh github.com/mitchellh/mapstructure v1.4.1/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= github.com/mitchellh/mapstructure v1.4.2 h1:6h7AQ0yhTcIsmFmnAwQls75jp2Gzs4iB8W7pjMO+rqo= github.com/mitchellh/mapstructure v1.4.2/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= +github.com/mitchellh/mapstructure v1.4.3 h1:OVowDSCllw/YjdLkam3/sm7wEtOy59d8ndGgCcyj8cs= +github.com/mitchellh/mapstructure v1.4.3/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= github.com/mitchellh/reflectwalk v1.0.0/go.mod h1:mSTlrgnPZtwu0c4WaC2kGObEpuNDbx0jmZXqmk4esnw= github.com/mitchellh/reflectwalk v1.0.2 h1:G2LzWKi524PWgd3mLHV8Y5k7s6XUvT0Gef6zxSIeXaQ= github.com/mitchellh/reflectwalk v1.0.2/go.mod h1:mSTlrgnPZtwu0c4WaC2kGObEpuNDbx0jmZXqmk4esnw= @@ -510,6 +514,8 @@ github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9dec github.com/yuin/goldmark v1.3.5/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= gitlab.snapp.ir/dispatching/snappids/v2 v2.8.0 h1:5BzBqfPB59hEHfHzfU4gcWKfiDBjNWcf68GAUgeRPu4= gitlab.snapp.ir/dispatching/snappids/v2 v2.8.0/go.mod h1:U7lxAuqPifdXkUNcCXhtk9+6HFAyw5qy8LrF1DQDMuQ= +gitlab.snapp.ir/dispatching/snappids/v2 v2.8.2 h1:yWTrWlnD8ErnVc5D4WLSOIkDwyiFI6+pSaSFd/rTppI= +gitlab.snapp.ir/dispatching/snappids/v2 v2.8.2/go.mod h1:U7lxAuqPifdXkUNcCXhtk9+6HFAyw5qy8LrF1DQDMuQ= go.etcd.io/bbolt v1.3.3/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU= go.etcd.io/etcd v0.0.0-20191023171146-3cf2f69b5738/go.mod h1:dnLIgRNXwCJa5e+c6mIZCrds/GIG4ncV9HhK5PX7jPg= go.etcd.io/etcd/api/v3 v3.5.0/go.mod h1:cbVKeC6lCfl7j/8jBhAK6aIYO9XOjdptoxU/nLQcPvs= @@ -731,6 +737,8 @@ golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20211013075003-97ac67df715c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20211123173158-ef496fb156ab h1:rfJ1bsoJQQIAoAxTxB7bme+vHrNkRw8CqfsYh9w54cw= golang.org/x/sys v0.0.0-20211123173158-ef496fb156ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20211205182925-97ca703d548d h1:FjkYO/PPp4Wi0EAUOVLxePm7qVW4r4ctbWpURyuOD0E= +golang.org/x/sys v0.0.0-20211205182925-97ca703d548d/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= From c4419ae24121e4b455fc287f554561f5f1747d84 Mon Sep 17 00:00:00 2001 From: Parham Alvani Date: Mon, 6 Dec 2021 01:22:33 +0330 Subject: [PATCH 126/660] feat: update soteria version --- deployments/soteria/Chart.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/deployments/soteria/Chart.yaml b/deployments/soteria/Chart.yaml index a8f02b01..9802311a 100644 --- a/deployments/soteria/Chart.yaml +++ b/deployments/soteria/Chart.yaml @@ -5,6 +5,6 @@ description: Soteria Helm Chart type: application -version: 5.1.3 +version: 5.1.4 -appVersion: "v5-1-3" +appVersion: "v5-1-4" From 2da1d6f9864a4130ed6efd646fb5f2f6e024b35e Mon Sep 17 00:00:00 2001 From: Omid Akhavan Date: Sat, 25 Dec 2021 14:42:02 +0330 Subject: [PATCH 127/660] create labels in values file --- deployments/soteria/templates/_helpers.tpl | 4 ++-- deployments/soteria/values.yaml | 4 ++++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/deployments/soteria/templates/_helpers.tpl b/deployments/soteria/templates/_helpers.tpl index 0c08413c..b7a6da0c 100644 --- a/deployments/soteria/templates/_helpers.tpl +++ b/deployments/soteria/templates/_helpers.tpl @@ -40,8 +40,8 @@ app: soteria {{- if .Chart.AppVersion }} app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} {{- end }} -app.kubernetes.io/managed-by: {{ .Release.Service }} -app.snappcloud.io/created-by: mozart +app.kubernetes.io/managed-by: {{ .Values.labels.managedby }} +app.snappcloud.io/created-by: {{ .Values.labels.createdby }} {{- end }} {{- define "soteria.podLabels" -}} diff --git a/deployments/soteria/values.yaml b/deployments/soteria/values.yaml index 8e29b78b..4d502d5a 100644 --- a/deployments/soteria/values.yaml +++ b/deployments/soteria/values.yaml @@ -4,6 +4,10 @@ replicaCount: 1 namespace: dispatching-staging region: teh-1 +labels: + managedby: dispatching-team + createdby: mozart + image: registry: docker-registry.default.svc:5000 repository: realtime-staging/soteria From c738b2fd6ac0880cc3c479e238c910940c96f52e Mon Sep 17 00:00:00 2001 From: Parham Alvani Date: Sat, 25 Dec 2021 14:43:22 +0330 Subject: [PATCH 128/660] feat: update ode labels --- deployments/soteria/values.ode.yaml | 4 ++++ deployments/soteria/values.yaml | 4 ++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/deployments/soteria/values.ode.yaml b/deployments/soteria/values.ode.yaml index d0ff1fd5..396d8d7e 100644 --- a/deployments/soteria/values.ode.yaml +++ b/deployments/soteria/values.ode.yaml @@ -2,6 +2,10 @@ namespace: ode region: teh-1 +labels: + managedby: dispatching-team + createdby: mozart + image: registry: registry.apps.private.teh-1.snappcloud.io repository: mozart/soteria diff --git a/deployments/soteria/values.yaml b/deployments/soteria/values.yaml index 4d502d5a..231d09d6 100644 --- a/deployments/soteria/values.yaml +++ b/deployments/soteria/values.yaml @@ -6,8 +6,8 @@ region: teh-1 labels: managedby: dispatching-team - createdby: mozart - + createdby: dispatching-team + image: registry: docker-registry.default.svc:5000 repository: realtime-staging/soteria From 18dbe9c2ed3bf14a199a9bae745e38366f7d87e9 Mon Sep 17 00:00:00 2001 From: Parham Alvani Date: Thu, 13 Jan 2022 15:13:18 +0330 Subject: [PATCH 129/660] feat: update call general topic --- go.mod | 32 ++-- go.sum | 211 ++++++++++++++++++++++++ internal/authenticator/authenticator.go | 2 +- 3 files changed, 229 insertions(+), 16 deletions(-) diff --git a/go.mod b/go.mod index 94726de8..44f63f55 100644 --- a/go.mod +++ b/go.mod @@ -4,24 +4,24 @@ go 1.17 require ( github.com/ansrivas/fiberprometheus/v2 v2.1.2 - github.com/gofiber/contrib/fiberzap v0.0.0-20211104103143-eae1892b9aac - github.com/gofiber/fiber/v2 v2.22.0 + github.com/gofiber/contrib/fiberzap v0.0.0-20220112233641-76fa5fde0be2 + github.com/gofiber/fiber/v2 v2.24.0 github.com/golang-jwt/jwt/v4 v4.2.0 - github.com/knadh/koanf v1.3.3 + github.com/knadh/koanf v1.4.0 github.com/prometheus/client_golang v1.11.0 // indirect - github.com/spf13/cobra v1.2.1 + github.com/spf13/cobra v1.3.0 github.com/stretchr/testify v1.7.0 - gitlab.snapp.ir/dispatching/snappids/v2 v2.8.2 + gitlab.snapp.ir/dispatching/snappids/v2 v2.9.0 go.uber.org/atomic v1.9.0 // indirect go.uber.org/automaxprocs v1.4.0 - go.uber.org/zap v1.19.1 + go.uber.org/zap v1.20.0 ) require ( - go.opentelemetry.io/otel v1.2.0 - go.opentelemetry.io/otel/exporters/jaeger v1.2.0 - go.opentelemetry.io/otel/sdk v1.2.0 - go.opentelemetry.io/otel/trace v1.2.0 + go.opentelemetry.io/otel v1.3.0 + go.opentelemetry.io/otel/exporters/jaeger v1.3.0 + go.opentelemetry.io/otel/sdk v1.3.0 + go.opentelemetry.io/otel/trace v1.3.0 ) require ( @@ -31,11 +31,13 @@ require ( github.com/davecgh/go-spew v1.1.1 // indirect github.com/fatih/structs v1.1.0 // indirect github.com/fsnotify/fsnotify v1.5.1 // indirect - github.com/gofiber/adaptor/v2 v2.1.14 // indirect + github.com/go-logr/logr v1.2.2 // indirect + github.com/go-logr/stdr v1.2.2 // indirect + github.com/gofiber/adaptor/v2 v2.1.16 // indirect github.com/gofiber/utils v0.1.2 // indirect github.com/golang/protobuf v1.5.2 // indirect github.com/inconshreveable/mousetrap v1.0.0 // indirect - github.com/klauspost/compress v1.13.6 // indirect + github.com/klauspost/compress v1.14.1 // indirect github.com/kr/pretty v0.3.0 // indirect github.com/matttproud/golang_protobuf_extensions v1.0.1 // indirect github.com/mitchellh/copystructure v1.2.0 // indirect @@ -45,14 +47,14 @@ require ( github.com/prometheus/client_model v0.2.0 // indirect github.com/prometheus/common v0.32.1 // indirect github.com/prometheus/procfs v0.7.3 // indirect - github.com/rogpeppe/go-internal v1.8.0 // indirect + github.com/rogpeppe/go-internal v1.8.1 // indirect github.com/speps/go-hashids/v2 v2.0.1 // indirect github.com/spf13/pflag v1.0.5 // indirect github.com/valyala/bytebufferpool v1.0.0 // indirect - github.com/valyala/fasthttp v1.31.0 // indirect + github.com/valyala/fasthttp v1.32.0 // indirect github.com/valyala/tcplisten v1.0.0 // indirect go.uber.org/multierr v1.7.0 // indirect - golang.org/x/sys v0.0.0-20211205182925-97ca703d548d // indirect + golang.org/x/sys v0.0.0-20220111092808-5a964db01320 // indirect google.golang.org/protobuf v1.27.1 // indirect gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c // indirect gopkg.in/yaml.v2 v2.4.0 // indirect diff --git a/go.sum b/go.sum index 4e464699..ae3b279f 100644 --- a/go.sum +++ b/go.sum @@ -20,6 +20,15 @@ cloud.google.com/go v0.74.0/go.mod h1:VV1xSbzvo+9QJOxLDaJfTjx5e+MePCpCWwvftOeQmW cloud.google.com/go v0.78.0/go.mod h1:QjdrLG0uq+YwhjoVOLsS1t7TW8fs36kLs4XO5R5ECHg= cloud.google.com/go v0.79.0/go.mod h1:3bzgcEeQlzbuEAYu4mrWhKqWjmpprinYgKJLgKHnbb8= cloud.google.com/go v0.81.0/go.mod h1:mk/AM35KwGk/Nm2YSeZbxXdrNK3KZOYHmLkOqC2V6E0= +cloud.google.com/go v0.83.0/go.mod h1:Z7MJUsANfY0pYPdw0lbnivPx4/vhy/e2FEkSkF7vAVY= +cloud.google.com/go v0.84.0/go.mod h1:RazrYuxIK6Kb7YrzzhPoLmCVzl7Sup4NrbKPg8KHSUM= +cloud.google.com/go v0.87.0/go.mod h1:TpDYlFy7vuLzZMMZ+B6iRiELaY7z/gJPaqbMx6mlWcY= +cloud.google.com/go v0.90.0/go.mod h1:kRX0mNRHe0e2rC6oNakvwQqzyDmg57xJ+SZU1eT2aDQ= +cloud.google.com/go v0.93.3/go.mod h1:8utlLll2EF5XMAV15woO4lSbWQlk8rer9aLOfLh7+YI= +cloud.google.com/go v0.94.1/go.mod h1:qAlAugsXlC+JWO+Bke5vCtc9ONxjQT3drlTTnAplMW4= +cloud.google.com/go v0.97.0/go.mod h1:GF7l59pYBVlXQIBLx3a761cZ41F9bBH3JUlihCt2Udc= +cloud.google.com/go v0.98.0/go.mod h1:ua6Ush4NALrHk5QXDWnjvZHN93OuF0HfuEPq9I1X0cM= +cloud.google.com/go v0.99.0/go.mod h1:w0Xx2nLzqWJPuozYQX+hFfCSI8WioryfRDzkoI/Y2ZA= cloud.google.com/go/bigquery v1.0.1/go.mod h1:i/xbL2UlR5RvWAURpBYZTtm/cXjCha9lbfbpx4poX+o= cloud.google.com/go/bigquery v1.3.0/go.mod h1:PjpwJnslEMmckchkHFfq+HTD2DmtT67aNFKH1/VBDHE= cloud.google.com/go/bigquery v1.4.0/go.mod h1:S8dzgnTigyfTmLBfrtrhyYhwRxG72rYxvftPBK2Dvzc= @@ -29,6 +38,7 @@ cloud.google.com/go/bigquery v1.8.0/go.mod h1:J5hqkt3O0uAFnINi6JXValWIb1v0goeZM7 cloud.google.com/go/datastore v1.0.0/go.mod h1:LXYbyblFSglQ5pkeyhO+Qmw7ukd3C+pD7TKLgZqpHYE= cloud.google.com/go/datastore v1.1.0/go.mod h1:umbIZjpQpHh4hmRpGhH4tLFup+FVzqBi1b3c64qFpCk= cloud.google.com/go/firestore v1.1.0/go.mod h1:ulACoGHTpvq5r8rxGJ4ddJZBZqakUQqClKRT5SZwBmk= +cloud.google.com/go/firestore v1.6.1/go.mod h1:asNXNOzBdyVQmEU+ggO8UPodTkEVFW5Qx+rwHnAz+EY= cloud.google.com/go/pubsub v1.0.1/go.mod h1:R0Gpsv3s54REJCy4fxDixWD93lHJMoZTyQ2kNxGRt3I= cloud.google.com/go/pubsub v1.1.0/go.mod h1:EwwdRX2sKPjnvnqCa270oGRyludottCI76h+R3AArQw= cloud.google.com/go/pubsub v1.2.0/go.mod h1:jhfEVHT8odbXTkndysNHCcx0awwzvfOlguIAii9o8iA= @@ -41,7 +51,9 @@ cloud.google.com/go/storage v1.10.0/go.mod h1:FLPqc6j+Ki4BU591ie1oL6qBQGu2Bl/tZ9 dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= +github.com/DataDog/datadog-go v3.2.0+incompatible/go.mod h1:LButxg5PwREeZtORoXG3tL4fMGNddJ+vMq1mwgfaqoQ= github.com/Knetic/govaluate v3.0.1-0.20171022003610-9aa49832a739+incompatible/go.mod h1:r7JcOSlj0wfOMncg0iLm8Leh48TZaKVeNIfJntJ2wa0= +github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU= github.com/Shopify/sarama v1.19.0/go.mod h1:FVkBWblsNy7DGZRfXLU0O9RCGt5g3g3yEuWXgklEdEo= github.com/Shopify/toxiproxy v2.1.4+incompatible/go.mod h1:OXgGpZ6Cli1/URJOF1DMxUHB2q5Ap20/P/eIdh4G0pI= github.com/VividCortex/gohistogram v1.0.0/go.mod h1:Pf5mBqqDxYaXu3hDrrU+w6nw50o/4+TcAqDqk/vUH7g= @@ -63,7 +75,9 @@ github.com/apache/thrift v0.12.0/go.mod h1:cp2SuWMxlEZw2r+iP2GNCdIi4C1qmUzdZFSVb github.com/apache/thrift v0.13.0/go.mod h1:cp2SuWMxlEZw2r+iP2GNCdIi4C1qmUzdZFSVb+bacwQ= github.com/armon/circbuf v0.0.0-20150827004946-bbbad097214e/go.mod h1:3U/XgcO3hCbHZ8TKRvWD2dDTCfh9M9ya+I9JpbB7O8o= github.com/armon/go-metrics v0.0.0-20180917152333-f0300d1749da/go.mod h1:Q73ZrmVTwzkszR9V5SSuryQ31EELlFMUz1kKyl939pY= +github.com/armon/go-metrics v0.3.10/go.mod h1:4O98XIr/9W0sxpJ8UaYkvjk10Iff7SnFrb4QAOwNTFc= github.com/armon/go-radix v0.0.0-20180808171621-7fddfc383310/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8= +github.com/armon/go-radix v1.0.0/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8= github.com/aryann/difflib v0.0.0-20170710044230-e206f873d14a/go.mod h1:DAHtR1m6lCRdSC2Tm3DSWRPvIPr6xNKyeHdqDQSQT+A= github.com/aws/aws-lambda-go v1.13.3/go.mod h1:4UKl9IzQMoD+QF79YdCuzCwp8VbmG4VAQwij/eHl5CU= github.com/aws/aws-sdk-go v1.27.0/go.mod h1:KmX6BPdI08NWTb3/sm4ZGu5ShLoqVDhKgpiN924inxo= @@ -80,6 +94,7 @@ github.com/aws/aws-sdk-go-v2/service/sts v1.7.2/go.mod h1:8EzeIqfWt2wWT4rJVu3f21 github.com/aws/smithy-go v1.8.0/go.mod h1:SObp3lf9smib00L/v3U2eAKG8FyQ7iLrJnQiAmR5n+E= github.com/benbjohnson/clock v1.1.0 h1:Q92kusRqC1XV2MjkWETPvjJVqKetz1OzxZB7mHJLju8= github.com/benbjohnson/clock v1.1.0/go.mod h1:J11/hYXuz8f4ySSvYwY0FKfm+ezbsZBKZxNJlLklBHA= +github.com/benbjohnson/clock v1.3.0/go.mod h1:J11/hYXuz8f4ySSvYwY0FKfm+ezbsZBKZxNJlLklBHA= github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q= github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8= github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= @@ -89,17 +104,29 @@ github.com/bketelsen/crypt v0.0.4/go.mod h1:aI6NrJ0pMGgvZKL1iVgXLnfIFJtfV+bKCoqO github.com/casbin/casbin/v2 v2.1.2/go.mod h1:YcPU1XXisHhLzuxH9coDNf2FbKpjGlbCg3n9yuLkIJQ= github.com/cenkalti/backoff v2.2.1+incompatible/go.mod h1:90ReRw6GdpyfrHakVjL/QHaoyV4aDUVVkXQJJJ3NXXM= github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= +github.com/census-instrumentation/opencensus-proto v0.3.0/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= +github.com/cespare/xxhash v1.1.0 h1:a6HrQnmkObjyL+Gs60czilIUGqrzKutQD6XZog3p+ko= +github.com/cespare/xxhash v1.1.0/go.mod h1:XrSqR1VqqWfGrhpAt58auRo0WTKS1nRRg3ghfAqPWnc= github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= github.com/cespare/xxhash/v2 v2.1.2 h1:YRXhKfTDauu4ajMg1TPgFO5jnlC2HCbmLXMcTG5cbYE= github.com/cespare/xxhash/v2 v2.1.2/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI= github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI= github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU= +github.com/circonus-labs/circonus-gometrics v2.3.1+incompatible/go.mod h1:nmEj6Dob7S7YxXgwXpfOuvO54S+tGdZdw9fuRZt25Ag= +github.com/circonus-labs/circonusllhist v0.1.3/go.mod h1:kMXHVDlOchFAehlya5ePtbp5jckzBHf4XRpQvBOLI+I= github.com/clbanning/x2j v0.0.0-20191024224557-825249438eec/go.mod h1:jMjuTZXRI4dUb/I5gc9Hdhagfvm9+RyrPryS/auMzxE= github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc= github.com/cncf/udpa/go v0.0.0-20200629203442-efcf912fb354/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= github.com/cncf/udpa/go v0.0.0-20201120205902-5459f2c99403/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= +github.com/cncf/udpa/go v0.0.0-20210930031921-04548b0d99d4/go.mod h1:6pvJx4me5XPnfI9Z40ddWsdw2W/uZgQLFXToKeRcDiI= +github.com/cncf/xds/go v0.0.0-20210312221358-fbca930ec8ed/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= +github.com/cncf/xds/go v0.0.0-20210805033703-aa0b78936158/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= +github.com/cncf/xds/go v0.0.0-20210922020428-25de7278fc84/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= +github.com/cncf/xds/go v0.0.0-20211001041855-01bcc9b48dfe/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= +github.com/cncf/xds/go v0.0.0-20211011173535-cb28da3451f1/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= +github.com/cncf/xds/go v0.0.0-20211130200136-a8f946100490/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= github.com/cockroachdb/datadriven v0.0.0-20190809214429-80d97fb3cbaa/go.mod h1:zn76sxSg3SzpJ0PPJaLDCu+Bu0Lg3sKTORVIj19EIF8= github.com/codahale/hdrhistogram v0.0.0-20161010025455-3a0bb77429bd/go.mod h1:sE/e/2PUdi/liOCUjSTXgM1o87ZssimdTWN964YiIeI= github.com/coreos/go-semver v0.2.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk= @@ -109,6 +136,7 @@ github.com/coreos/go-systemd/v22 v22.3.2/go.mod h1:Y58oyj3AT4RCenI/lSvhwexgC+NSV github.com/coreos/pkg v0.0.0-20160727233714-3ac0863d7acf/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA= github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU= github.com/cpuguy83/go-md2man/v2 v2.0.0/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU= +github.com/cpuguy83/go-md2man/v2 v2.0.1/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= github.com/creack/pty v1.1.7/go.mod h1:lj5s0c3V2DBrqTV7llrYr5NG6My20zk30Fl46Y7DoTY= github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= @@ -127,8 +155,14 @@ github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1m github.com/envoyproxy/go-control-plane v0.9.7/go.mod h1:cwu0lG7PUMfa9snN8LXBig5ynNVH9qI8YYLbd1fK2po= github.com/envoyproxy/go-control-plane v0.9.9-0.20201210154907-fd9021fe5dad/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk= github.com/envoyproxy/go-control-plane v0.9.9-0.20210217033140-668b12f5399d/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk= +github.com/envoyproxy/go-control-plane v0.9.9-0.20210512163311-63b5d3c536b0/go.mod h1:hliV/p42l8fGbc6Y9bQ70uLwIvmJyVE5k4iMKlh8wCQ= +github.com/envoyproxy/go-control-plane v0.9.10-0.20210907150352-cf90f659a021/go.mod h1:AFq3mo9L8Lqqiid3OhADV3RfLJnjiw63cSpi+fDTRC0= +github.com/envoyproxy/go-control-plane v0.10.1/go.mod h1:AY7fTTXNdv/aJ2O5jwpxAPOWUZ7hQAEvzN5Pf27BkQQ= github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= +github.com/envoyproxy/protoc-gen-validate v0.6.2/go.mod h1:2t7qjJNvHPx8IjnBOzl9E9/baC+qXE/TeeyBRzgJDws= github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= +github.com/fatih/color v1.9.0/go.mod h1:eQcE1qtQxscV5RaZvpXrrb8Drkc3/DdQ+uUYCNjL+zU= +github.com/fatih/color v1.13.0/go.mod h1:kLAiJbzzSOZDVNGyDpeOxJ47H46qBXwg5ILebYFFOfk= github.com/fatih/structs v1.1.0 h1:Q7juDM0QtcnhCpeyLGQKyg4TOIghuNXrkL32pHAUMxo= github.com/fatih/structs v1.1.0/go.mod h1:9NiDSp5zOcgEDl+j00MP/WkGVPOlPRLejGD8Ga6PJ7M= github.com/franela/goblin v0.0.0-20200105215937-c9ffbefa60db/go.mod h1:7dvUGVsVBjqR7JHJk0brhHOZYGmfBYOrK0ZhYMEtBr4= @@ -149,6 +183,13 @@ github.com/go-ldap/ldap v3.0.2+incompatible/go.mod h1:qfd9rJvER9Q0/D/Sqn1DfHRoBp github.com/go-logfmt/logfmt v0.3.0/go.mod h1:Qt1PoO58o5twSAckw1HlFXLmHsOX5/0LbT9GBnD5lWE= github.com/go-logfmt/logfmt v0.4.0/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V4qmtdjCk= github.com/go-logfmt/logfmt v0.5.0/go.mod h1:wCYkCAKZfumFQihp8CzCvQ3paCTfi41vtzG1KdI/P7A= +github.com/go-logr/logr v1.2.0/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= +github.com/go-logr/logr v1.2.1/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= +github.com/go-logr/logr v1.2.2 h1:ahHml/yUpnlb96Rp8HCvtYVPY8ZYpxq3g7UYchIYwbs= +github.com/go-logr/logr v1.2.2/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= +github.com/go-logr/stdr v1.2.0/go.mod h1:YkVgnZu1ZjjL7xTxrfm/LLZBfkhTqSR1ydtm6jTKKwI= +github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag= +github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE= github.com/go-sql-driver/mysql v1.4.0/go.mod h1:zAC/RDZ24gD3HViQzih4MyKcchzm+sOG5ZlKdlhCg5w= github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= github.com/go-test/deep v1.0.2-0.20181118220953-042da051cf31/go.mod h1:wGDj63lr65AM2AQyKZd/NYHGb0R+1RLqB8NKt3aSFNA= @@ -156,13 +197,19 @@ github.com/godbus/dbus/v5 v5.0.4/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5x github.com/gofiber/adaptor/v2 v2.1.1/go.mod h1:jdHkqsqdWzEc0qMB+5svsWL5kdZmaDN2H0C3Hxl8y7c= github.com/gofiber/adaptor/v2 v2.1.14 h1:fGp2G83lnA5opUk5SQ7YQxnoXMnTXWA4qj/22aYixEU= github.com/gofiber/adaptor/v2 v2.1.14/go.mod h1:s2KVIM9tgTFdbHFd2yUefy80BMIGjU1w3jc3Umk9ZM8= +github.com/gofiber/adaptor/v2 v2.1.16 h1:8dURf+4n/EYFy3+BI1t5xyPQ7ZvOBgXuRFRrWkVNK54= +github.com/gofiber/adaptor/v2 v2.1.16/go.mod h1:m6m07fScuw5hpY9ZV027VqorR41XVzi3md6xBg2rdxQ= github.com/gofiber/contrib/fiberzap v0.0.0-20211104103143-eae1892b9aac h1:oBtsxC4TrZd7WuDro3S8U+AALGq0MzlAYYONzsPypdA= github.com/gofiber/contrib/fiberzap v0.0.0-20211104103143-eae1892b9aac/go.mod h1:QI2s0bHSHwaic8ssYtm50JvJGgqW+xHxNHXxCaEedwE= +github.com/gofiber/contrib/fiberzap v0.0.0-20220112233641-76fa5fde0be2 h1:sZuXSGtb+fccsIrmmuodhYzpaClUp47E7/g+23THt5U= +github.com/gofiber/contrib/fiberzap v0.0.0-20220112233641-76fa5fde0be2/go.mod h1:3syX4RQLVr9+5Y6sM9+XrsB5vLVqQ47fFvEUX92stuw= github.com/gofiber/fiber/v2 v2.2.2/go.mod h1:Aso7/M+EQOinVkWp4LUYjdlTpKTBoCk2Qo4djnMsyHE= github.com/gofiber/fiber/v2 v2.6.0/go.mod h1:f8BRRIMjMdRyt2qmJ/0Sea3j3rwwfufPrh9WNBRiVZ0= github.com/gofiber/fiber/v2 v2.21.0/go.mod h1:MR1usVH3JHYRyQwMe2eZXRSZHRX38fkV+A7CPB+DlDQ= github.com/gofiber/fiber/v2 v2.22.0 h1:+iyKK4ooDH6z0lAHdaWO1AFIB/DZ9AVo6vz8VZIA0EU= github.com/gofiber/fiber/v2 v2.22.0/go.mod h1:MR1usVH3JHYRyQwMe2eZXRSZHRX38fkV+A7CPB+DlDQ= +github.com/gofiber/fiber/v2 v2.24.0 h1:18rpLoQMJBVlLtX/PwgHj3hIxPSeWfN1YeDJ2lEnzjU= +github.com/gofiber/fiber/v2 v2.24.0/go.mod h1:MR1usVH3JHYRyQwMe2eZXRSZHRX38fkV+A7CPB+DlDQ= github.com/gofiber/utils v0.1.2 h1:1SH2YEz4RlNS0tJlMJ0bGwO0JkqPqvq6TbHK9tXZKtk= github.com/gofiber/utils v0.1.2/go.mod h1:pacRFtghAE3UoknMOUiXh2Io/nLWSUHtQCi/3QASsOc= github.com/gogo/googleapis v1.1.0/go.mod h1:gf4bu3Q80BeJ6H1S1vYPm8/ELATdvryBaNFGgqEef3s= @@ -179,6 +226,7 @@ github.com/golang/groupcache v0.0.0-20160516000752-02826c3e7903/go.mod h1:cIg4er github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/groupcache v0.0.0-20191227052852-215e87163ea7/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= +github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= github.com/golang/mock v1.2.0/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= github.com/golang/mock v1.3.1/go.mod h1:sBzyDLLjw3U8JLTeZvSv8jJB+tU5PVekmnlKIyFUx0Y= @@ -187,6 +235,7 @@ github.com/golang/mock v1.4.1/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt github.com/golang/mock v1.4.3/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= github.com/golang/mock v1.4.4/go.mod h1:l3mdAwkq5BuhzHwde/uurv3sEJeZMXNpwsxVWU71h+4= github.com/golang/mock v1.5.0/go.mod h1:CWnOUgYIOo4TcNZ0wHX3YZCqsaM1I1Jvs6v3mP3KVu8= +github.com/golang/mock v1.6.0/go.mod h1:p6yTPP+5HYm5mzsMV8JkE6ZKdX+/wYM6Hr+LicevLPs= github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= @@ -227,6 +276,7 @@ github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/ github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs= github.com/google/martian/v3 v3.0.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0= github.com/google/martian/v3 v3.1.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0= +github.com/google/martian/v3 v3.2.1/go.mod h1:oBOf6HBosgwRXnUGWUB05QECsc6uvmMiJ3+6W4l/CUk= github.com/google/pprof v0.0.0-20181206194817-3ea8567a2e57/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= github.com/google/pprof v0.0.0-20190515194954-54271f7e092f/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= github.com/google/pprof v0.0.0-20191218002539-d4f498aebedc/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= @@ -238,11 +288,16 @@ github.com/google/pprof v0.0.0-20201023163331-3e6fc7fc9c4c/go.mod h1:kpwsk12EmLe github.com/google/pprof v0.0.0-20201203190320-1bf35d6f28c2/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/pprof v0.0.0-20210122040257-d980be63207e/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/pprof v0.0.0-20210226084205-cbba55b83ad5/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= +github.com/google/pprof v0.0.0-20210601050228-01bbb1931b22/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= +github.com/google/pprof v0.0.0-20210609004039-a478d1d731e9/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= +github.com/google/pprof v0.0.0-20210720184732-4bb14d4b1be1/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= github.com/google/uuid v1.0.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg= github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk= +github.com/googleapis/gax-go/v2 v2.1.0/go.mod h1:Q3nei7sK6ybPYH7twZdmQpAd1MKb7pfu6SK+H1/DsU0= +github.com/googleapis/gax-go/v2 v2.1.1/go.mod h1:hddJymUZASv3XPyGkUpKj8pPO47Rmb0eJc8R6ouapiM= github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= github.com/gorilla/context v1.1.1/go.mod h1:kBGZzfjB9CEq2AlWe17Uuf7NDRt0dE0s8S51q0aT7Yg= github.com/gorilla/mux v1.6.2/go.mod h1:1lud6UwP+6orDFRuTfBEV8e9/aOM/c4fVVCaMa2zaAs= @@ -254,20 +309,29 @@ github.com/grpc-ecosystem/grpc-gateway v1.9.5/go.mod h1:vNeuVxBJEsws4ogUvrchl83t github.com/grpc-ecosystem/grpc-gateway v1.16.0/go.mod h1:BDjrQk3hbvj6Nolgz8mAMFbcEtjT1g+wF4CSlocrBnw= github.com/hashicorp/consul/api v1.1.0/go.mod h1:VmuI/Lkw1nC05EYQWNKwWGbkg+FbDBtguAZLlVdkD9Q= github.com/hashicorp/consul/api v1.3.0/go.mod h1:MmDNSzIMUjNpY/mQ398R4bk2FnqQLoPndWW5VkKPlCE= +github.com/hashicorp/consul/api v1.11.0/go.mod h1:XjsvQN+RJGWI2TWy1/kqaE16HrR2J/FWgkYjdZQsX9M= github.com/hashicorp/consul/sdk v0.1.1/go.mod h1:VKf9jXwCTEY1QZP2MOLRhb5i/I/ssyNV1vwHyQBF0x8= github.com/hashicorp/consul/sdk v0.3.0/go.mod h1:VKf9jXwCTEY1QZP2MOLRhb5i/I/ssyNV1vwHyQBF0x8= +github.com/hashicorp/consul/sdk v0.8.0/go.mod h1:GBvyrGALthsZObzUGsfgHZQDXjg4lOjagTIwIR1vPms= github.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= github.com/hashicorp/go-cleanhttp v0.5.0/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtngrth3wmdIIUrZ80= github.com/hashicorp/go-cleanhttp v0.5.1/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtngrth3wmdIIUrZ80= +github.com/hashicorp/go-cleanhttp v0.5.2/go.mod h1:kO/YDlP8L1346E6Sodw+PrpBSV4/SoxCXGY6BqNFT48= github.com/hashicorp/go-hclog v0.0.0-20180709165350-ff2cf002a8dd/go.mod h1:9bjs9uLqI8l75knNv3lV1kA55veR+WUPSiKIWcQHudI= github.com/hashicorp/go-hclog v0.8.0/go.mod h1:5CU+agLiy3J7N7QjHK5d05KxGsuXiQLrjA0H7acj2lQ= +github.com/hashicorp/go-hclog v0.12.0/go.mod h1:whpDNt7SSdeAju8AWKIWsul05p54N/39EeqMAyrmvFQ= +github.com/hashicorp/go-hclog v1.0.0/go.mod h1:whpDNt7SSdeAju8AWKIWsul05p54N/39EeqMAyrmvFQ= github.com/hashicorp/go-immutable-radix v1.0.0/go.mod h1:0y9vanUI8NX6FsYoO3zeMjhV/C5i9g4Q3DwcSNZ4P60= +github.com/hashicorp/go-immutable-radix v1.3.1/go.mod h1:0y9vanUI8NX6FsYoO3zeMjhV/C5i9g4Q3DwcSNZ4P60= github.com/hashicorp/go-msgpack v0.5.3/go.mod h1:ahLV/dePpqEmjfWmKiqvPkv/twdG7iPBM1vqhUKIvfM= github.com/hashicorp/go-multierror v1.0.0/go.mod h1:dHtQlpGsu+cZNNAkkCN/P3hoUDHhCYQXV3UM06sGGrk= +github.com/hashicorp/go-multierror v1.1.0/go.mod h1:spPvp8C1qA32ftKqdAHm4hHTbPw+vmowP0z+KUhOZdA= github.com/hashicorp/go-plugin v1.0.1/go.mod h1:++UyYGoz3o5w9ZzAdZxtQKrWWP+iqPBn3cQptSMzBuY= +github.com/hashicorp/go-retryablehttp v0.5.3/go.mod h1:9B5zBasrRhHXnJnui7y6sL7es7NDiJgTc6Er0maI1Xs= github.com/hashicorp/go-retryablehttp v0.5.4/go.mod h1:9B5zBasrRhHXnJnui7y6sL7es7NDiJgTc6Er0maI1Xs= github.com/hashicorp/go-rootcerts v1.0.0/go.mod h1:K6zTfqpRlCUIjkwsN4Z+hiSfzSTQa6eBIzfwKfwNnHU= github.com/hashicorp/go-rootcerts v1.0.1/go.mod h1:pqUvnprVnM5bf7AOirdbb01K4ccR319Vf4pU3K5EGc8= +github.com/hashicorp/go-rootcerts v1.0.2/go.mod h1:pqUvnprVnM5bf7AOirdbb01K4ccR319Vf4pU3K5EGc8= github.com/hashicorp/go-sockaddr v1.0.0/go.mod h1:7Xibr9yA9JjQq1JpNB2Vw7kxv8xerXegt+ozgdvDeDU= github.com/hashicorp/go-sockaddr v1.0.2/go.mod h1:rB4wwRAUzs07qva3c5SdrY/NEtAUjGlgmH/UkBUC97A= github.com/hashicorp/go-syslog v1.0.0/go.mod h1:qPfqrKkXGihmCqbJM2mZgkZGvKG1dFdvsLplgctolz4= @@ -278,18 +342,26 @@ github.com/hashicorp/go-version v1.2.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09 github.com/hashicorp/go.net v0.0.1/go.mod h1:hjKkEWcCURg++eb33jQU7oqQcI9XDCnUzHA0oac0k90= github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= +github.com/hashicorp/golang-lru v0.5.4/go.mod h1:iADmTwqILo4mZ8BN3D2Q6+9jd8WM5uGBxy+E8yxSoD4= github.com/hashicorp/hcl v1.0.0 h1:0Anlzjpi4vEasTeNFn2mLJgTSwt0+6sfsiTG8qcWGx4= github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ= github.com/hashicorp/logutils v1.0.0/go.mod h1:QIAnNjmIWmVIIkWDTG1z5v++HQmx9WQRO+LraFDTW64= github.com/hashicorp/mdns v1.0.0/go.mod h1:tL+uN++7HEJ6SQLQ2/p+z2pH24WQKWjBPkE0mNTz8vQ= +github.com/hashicorp/mdns v1.0.1/go.mod h1:4gW7WsVCke5TE7EPeYliwHlRUyBtfCwuFwuMg2DmyNY= +github.com/hashicorp/mdns v1.0.4/go.mod h1:mtBihi+LeNXGtG8L9dX59gAEa12BDtBQSp4v/YAJqrc= github.com/hashicorp/memberlist v0.1.3/go.mod h1:ajVTdAv/9Im8oMAAj5G31PhhMCZJV2pPBoIllUwCN7I= +github.com/hashicorp/memberlist v0.2.2/go.mod h1:MS2lj3INKhZjWNqd3N0m3J+Jxf3DAOnAH9VT3Sh9MUE= +github.com/hashicorp/memberlist v0.3.0/go.mod h1:MS2lj3INKhZjWNqd3N0m3J+Jxf3DAOnAH9VT3Sh9MUE= github.com/hashicorp/serf v0.8.2/go.mod h1:6hOLApaqBFA1NXqRQAsxw9QxuDEvNxSQRwA/JwenrHc= +github.com/hashicorp/serf v0.9.5/go.mod h1:UWDWwZeL5cuWDJdl0C6wrvrUwEqtQ4ZKBKKENpqIUyk= +github.com/hashicorp/serf v0.9.6/go.mod h1:TXZNMjZQijwlDvp+r0b63xZ45H7JmCmgg4gpTwn9UV4= github.com/hashicorp/vault/api v1.0.4/go.mod h1:gDcqh3WGcR1cpF5AJz/B1UFheUEneMoIospckxBxk6Q= github.com/hashicorp/vault/sdk v0.1.13/go.mod h1:B+hVj7TpuQY1Y/GPbCpffmgd+tSEwvhkWnjtSYCaS2M= github.com/hashicorp/yamux v0.0.0-20180604194846-3520598351bb/go.mod h1:+NfK9FKeTrX5uv1uIXGdwYDTeHna2qgaIlx54MXqjAM= github.com/hashicorp/yamux v0.0.0-20181012175058-2f1d1f20f75d/go.mod h1:+NfK9FKeTrX5uv1uIXGdwYDTeHna2qgaIlx54MXqjAM= github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= github.com/hudl/fargo v1.3.0/go.mod h1:y3CKSmjA+wD2gak7sUSXTAoopbhU08POFhmITJgmKTg= +github.com/iancoleman/strcase v0.2.0/go.mod h1:iwCmte+B7n89clKwxIoIXy/HfoL7AsD47ZCWhYzw7ho= github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= github.com/ianlancetaylor/demangle v0.0.0-20200824232613-28f6c0f3b639/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= github.com/inconshreveable/mousetrap v1.0.0 h1:Z8tu5sraLXCXIcARxBp/8cbvlwVa7Z1NHg9XEKhtSvM= @@ -305,8 +377,10 @@ github.com/jpillora/backoff v1.0.0/go.mod h1:J/6gKK9jxlEcS3zixgDgUAsiuZ7yrSoa/FX github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= github.com/json-iterator/go v1.1.7/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= github.com/json-iterator/go v1.1.8/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= +github.com/json-iterator/go v1.1.9/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= github.com/json-iterator/go v1.1.10/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= github.com/json-iterator/go v1.1.11/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= +github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo= github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU= github.com/jstemmer/go-junit-report v0.9.1/go.mod h1:Brl9GWCQeLvo8nXZwPNNblvFj/XSXhF0NWZEnDohbsk= github.com/jtolds/gls v4.20.0+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfVYBRgL+9YlvaHOwJU= @@ -319,13 +393,18 @@ github.com/klauspost/compress v1.10.7/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdYs github.com/klauspost/compress v1.13.4/go.mod h1:8dP1Hq4DHOhN9w426knH3Rhby4rFm6D8eO+e+Dq5Gzg= github.com/klauspost/compress v1.13.6 h1:P76CopJELS0TiO2mebmnzgWaajssP/EszplttgQxcgc= github.com/klauspost/compress v1.13.6/go.mod h1:/3/Vjq9QcHkK5uEr5lBEmyoZ1iFhe47etQ6QUkpK6sk= +github.com/klauspost/compress v1.14.1 h1:hLQYb23E8/fO+1u53d02A97a8UnsddcvYzq4ERRU4ds= +github.com/klauspost/compress v1.14.1/go.mod h1:/3/Vjq9QcHkK5uEr5lBEmyoZ1iFhe47etQ6QUkpK6sk= github.com/knadh/koanf v1.3.3 h1:eNtBOzQDzkzIIPRCJCx/Ha3DeD/ZFwCAp8JxyqoVAls= github.com/knadh/koanf v1.3.3/go.mod h1:1cfH5223ZeZUOs8FU2UdTmaNfHpqgtjV0+NHjRO43gs= +github.com/knadh/koanf v1.4.0 h1:/k0Bh49SqLyLNfte9r6cvuZWrApOQhglOmhIU3L/zDw= +github.com/knadh/koanf v1.4.0/go.mod h1:1cfH5223ZeZUOs8FU2UdTmaNfHpqgtjV0+NHjRO43gs= github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/konsorten/go-windows-terminal-sequences v1.0.3/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/kr/fs v0.1.0/go.mod h1:FFnZGqtBN9Gxj7eW1uZ42v5BccTP0vu6NEaFoC2HwRg= github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc= github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= +github.com/kr/pretty v0.2.0/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= github.com/kr/pretty v0.3.0 h1:WgNl7dwNpEZ6jJ9k1snq4pZsg7DOEN8hP9Xw0Tsjwk0= github.com/kr/pretty v0.3.0/go.mod h1:640gp4NfQd8pI5XOwp5fnNeVWj67G7CFk/SaSQn7NBk= @@ -335,16 +414,29 @@ github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= github.com/lightstep/lightstep-tracer-common/golang/gogo v0.0.0-20190605223551-bc2310a04743/go.mod h1:qklhhLq1aX+mtWk9cPHPzaBjWImj5ULL6C7HFJtXQMM= github.com/lightstep/lightstep-tracer-go v0.18.1/go.mod h1:jlF1pusYV4pidLvZ+XD0UBX0ZE6WURAspgAczcDHrL4= +github.com/lyft/protoc-gen-star v0.5.3/go.mod h1:V0xaHgaf5oCCqmcxYcWiDfTiKsZsRc87/1qhoTACD8w= github.com/lyft/protoc-gen-validate v0.0.13/go.mod h1:XbGvPuh87YZc5TdIa2/I4pLk0QoUACkjt2znoq26NVQ= github.com/magiconair/properties v1.8.5/go.mod h1:y3VJvCyxH9uVvJTWEGAELF3aiYNyPKd5NZ3oSwXrF60= github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU= +github.com/mattn/go-colorable v0.1.4/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE= +github.com/mattn/go-colorable v0.1.6/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= +github.com/mattn/go-colorable v0.1.9/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= +github.com/mattn/go-colorable v0.1.12/go.mod h1:u5H1YNBxpqRaxsYJYSkiCWKzEfiAb1Gb520KVy5xxl4= github.com/mattn/go-isatty v0.0.3/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= github.com/mattn/go-isatty v0.0.4/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= +github.com/mattn/go-isatty v0.0.8/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s= +github.com/mattn/go-isatty v0.0.10/go.mod h1:qgIWMr58cqv1PHHyhnkY9lrL7etaEgOFcMEpPG5Rm84= +github.com/mattn/go-isatty v0.0.11/go.mod h1:PhnuNfih5lzO57/f3n+odYbM4JtupLOxQOAqxQCu2WE= +github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU= +github.com/mattn/go-isatty v0.0.14/go.mod h1:7GGIvUiUoEMVVmxf/4nioHXj79iQHKdU27kJ6hsGG94= github.com/mattn/go-runewidth v0.0.2/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzpuz5H//U1FU= github.com/matttproud/golang_protobuf_extensions v1.0.1 h1:4hp9jkHxhMHkqkrB3Ix0jegS5sx/RkqARlsWZ6pIwiU= github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= github.com/miekg/dns v1.0.14/go.mod h1:W1PPwlIAgtquWBMBEV9nkV9Cazfe8ScdGz/Lj7v3Nrg= +github.com/miekg/dns v1.1.26/go.mod h1:bPDLeHnStXmXAq1m/Ch/hvfNHr14JKNPMBo3VZKjuso= +github.com/miekg/dns v1.1.41/go.mod h1:p6aan82bvRIyn+zDIv9xYNUpwa73JcSh9BKwknJysuI= github.com/mitchellh/cli v1.0.0/go.mod h1:hNIlj7HEI86fIcpObd7a0FcrxTWetlwJDGcceTlRvqc= +github.com/mitchellh/cli v1.1.0/go.mod h1:xcISNoH86gajksDmfB23e/pu+B+GeFRMYmoHXxx3xhI= github.com/mitchellh/copystructure v1.0.0/go.mod h1:SNtv71yrdKgLRyLFxmLdkAbkKEFWgYaq1OVrnRcwhnw= github.com/mitchellh/copystructure v1.2.0 h1:vpKXTN4ewci03Vljg/q9QvCGUDttBOGBIa15WveJJGw= github.com/mitchellh/copystructure v1.2.0/go.mod h1:qLl+cE2AmVv+CoeAwDPye/v+N2HKCj9FbZEVFJRxO9s= @@ -369,6 +461,7 @@ github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJ github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= +github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk= github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= github.com/nats-io/jwt v0.3.0/go.mod h1:fRYCDE99xlTsqUzISS1Bi75UBJ6ljOJQOAAu5VglpSg= @@ -401,6 +494,7 @@ github.com/pborman/uuid v1.2.0/go.mod h1:X/NO0urCmaxf9VXbdlT7C2Yzkj2IKimNn4k+gtP github.com/pelletier/go-toml v1.7.0/go.mod h1:vwGMzjaWMwyfHwgIBhI2YUM4fB6nL6lVAvS1LBMMhTE= github.com/pelletier/go-toml v1.9.3 h1:zeC5b1GviRUyKYd6OJPvBU/mcVDVoL1OhT17FCt5dSQ= github.com/pelletier/go-toml v1.9.3/go.mod h1:u1nR/EPcESfeI/szUZKdtJ0xRNbUoANCkoOuaOx1Y+c= +github.com/pelletier/go-toml v1.9.4/go.mod h1:u1nR/EPcESfeI/szUZKdtJ0xRNbUoANCkoOuaOx1Y+c= github.com/performancecopilot/speed v3.0.0+incompatible/go.mod h1:/CLtqpZ5gBg1M9iaPbIdPPGyKcA8hKdoy6hAWba7Yac= github.com/pierrec/lz4 v1.0.2-0.20190131084431-473cd7ce01a1/go.mod h1:3/3N9NVKO0jef7pBehbT1qWhCMrIgbYNnFAZCqQ5LRc= github.com/pierrec/lz4 v2.0.5+incompatible/go.mod h1:pdkljMzZIN41W+lC3N2tnIh5sFi+IEE17M5jbnwPHcY= @@ -414,10 +508,12 @@ github.com/pkg/sftp v1.10.1/go.mod h1:lYOWFsE0bwd1+KfKJaKeuokY15vzFx25BLbzYYoAxZ github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/posener/complete v1.1.1/go.mod h1:em0nMJCgc9GFtwrmVmEMR/ZL6WyhyjMBndrE9hABlRI= +github.com/posener/complete v1.2.3/go.mod h1:WZIdtGGp+qx0sLrYKtIRAruyNpv6hFCicSgv7Sy7s/s= github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw= github.com/prometheus/client_golang v0.9.3-0.20190127221311-3c4408c8b829/go.mod h1:p2iRAGwDERtqlqzRXnrOVns+ignqQo//hLXqYxZYVNs= github.com/prometheus/client_golang v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5FsnadC4Ky3P0J6CfImo= github.com/prometheus/client_golang v1.3.0/go.mod h1:hJaj2vgQTGQmVCsAACORcieXFeDPbaTKGT+JTgUa3og= +github.com/prometheus/client_golang v1.4.0/go.mod h1:e9GMxYsXl05ICDXkRhurwBS4Q3OK1iX/F2sw+iXX5zU= github.com/prometheus/client_golang v1.7.1/go.mod h1:PY5Wy2awLA44sXw4AOSfFBetzPP4j5+D6mVACh+pe2M= github.com/prometheus/client_golang v1.9.0/go.mod h1:FqZLKOZnGdFAhOK4nqGHa7D66IdsO+O441Eve7ptJDU= github.com/prometheus/client_golang v1.11.0 h1:HNkLOAEQMIDv/K+04rukrLx6ch7msSRwf3/SASFAGtQ= @@ -432,6 +528,7 @@ github.com/prometheus/client_model v0.2.0/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6T github.com/prometheus/common v0.2.0/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= github.com/prometheus/common v0.4.1/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= github.com/prometheus/common v0.7.0/go.mod h1:DjGbpBbp5NYNiECxcL/VnbXCCaQpKd3tt26CguLLsqA= +github.com/prometheus/common v0.9.1/go.mod h1:yhUN8i9wzaXS3w1O07YhxHEBxD+W35wd8bs7vj7HSQ4= github.com/prometheus/common v0.10.0/go.mod h1:Tlit/dnDKsSWFlCLTWaA1cyBgKHSMdTB80sz/V91rCo= github.com/prometheus/common v0.15.0/go.mod h1:U+gB1OBLb1lF3O42bTCL+FK18tX9Oar16Clt/msog/s= github.com/prometheus/common v0.26.0/go.mod h1:M7rCNAaPfAosfx8veZJCuw84e35h3Cfd9VFqTh1DIvc= @@ -454,10 +551,13 @@ github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFR github.com/rogpeppe/go-internal v1.6.1/go.mod h1:xXDCJY+GAPziupqXw64V24skbSoqbTEfhy4qGm1nDQc= github.com/rogpeppe/go-internal v1.8.0 h1:FCbCCtXNOY3UtUuHUYaghJg4y7Fd14rXifAYUAtL9R8= github.com/rogpeppe/go-internal v1.8.0/go.mod h1:WmiCO8CzOY8rg0OYDC4/i/2WRWAB6poM+XZ2dLUbcbE= +github.com/rogpeppe/go-internal v1.8.1/go.mod h1:JeRgkft04UBgHMgCIwADu4Pn6Mtm5d4nPKWu0nJ5d+o= github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= +github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= github.com/ryanuber/columnize v0.0.0-20160712163229-9b3edd62028f/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts= github.com/ryanuber/columnize v2.1.0+incompatible/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts= github.com/ryanuber/go-glob v1.0.0/go.mod h1:807d1WSdnB0XRJzKNil9Om6lcp/3a0v4qIHxIXzX/Yc= +github.com/sagikazarmark/crypt v0.3.0/go.mod h1:uD/D+6UF4SrIR1uGEv7bBNkNqLGqUr43MRiaGWX1Nig= github.com/samuel/go-zookeeper v0.0.0-20190923202752-2cc03de413da/go.mod h1:gi+0XIa01GRL2eRQVjQkKGqKF3SF9vZR/HnPullcV2E= github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529/go.mod h1:DxrIzT+xaE7yg65j358z/aeFdxmN0P9QXhEzd20vsDc= github.com/shurcooL/sanitized_anchor_name v1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc= @@ -468,18 +568,24 @@ github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d/go.mod h1 github.com/smartystreets/goconvey v1.6.4/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9QV7WQ/tjFTllLA= github.com/soheilhy/cmux v0.1.4/go.mod h1:IM3LyeVVIOuxMH7sFAkER9+bJ4dT7Ms6E4xg4kGIyLM= github.com/sony/gobreaker v0.4.1/go.mod h1:ZKptC7FHNvhBz7dN2LGjPVBz2sZJmc0/PkyDJOjmxWY= +github.com/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA= github.com/speps/go-hashids/v2 v2.0.1 h1:ViWOEqWES/pdOSq+C1SLVa8/Tnsd52XC34RY7lt7m4g= github.com/speps/go-hashids/v2 v2.0.1/go.mod h1:47LKunwvDZki/uRVD6NImtyk712yFzIs3UF3KlHohGw= +github.com/spf13/afero v1.3.3/go.mod h1:5KUK8ByomD5Ti5Artl0RtHeI5pTF7MIDuXL3yY520V4= github.com/spf13/afero v1.6.0/go.mod h1:Ai8FlHk4v/PARR026UzYexafAt9roJ7LcLMAmO6Z93I= github.com/spf13/cast v1.3.1/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE= +github.com/spf13/cast v1.4.1/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE= github.com/spf13/cobra v0.0.3/go.mod h1:1l0Ry5zgKvJasoi3XT1TypsSe7PqH0Sj9dhYf7v3XqQ= github.com/spf13/cobra v1.2.1 h1:+KmjbUw1hriSNMF55oPrkZcb27aECyrj8V2ytv7kWDw= github.com/spf13/cobra v1.2.1/go.mod h1:ExllRjgxM/piMAM+3tAZvg8fsklGAf3tPfi+i8t68Nk= +github.com/spf13/cobra v1.3.0 h1:R7cSvGu+Vv+qX0gW5R/85dx2kmmJT5z5NM8ifdYjdn0= +github.com/spf13/cobra v1.3.0/go.mod h1:BrRVncBjOJa/eUcVVm9CE+oC6as8k+VYr4NY7WCi9V4= github.com/spf13/jwalterweatherman v1.1.0/go.mod h1:aNWZUN0dPAAO/Ljvb5BEdw96iTZ0EXowPYD95IqWIGo= github.com/spf13/pflag v1.0.1/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA= github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= github.com/spf13/viper v1.8.1/go.mod h1:o0Pch8wJ9BVSWGQMbra6iw0oQ5oktSIBaujf1rJH9Ns= +github.com/spf13/viper v1.10.0/go.mod h1:SoyBPwAtKDzypXNDFKN5kzH7ppppbGZtls1UpIy5AsM= github.com/streadway/amqp v0.0.0-20190404075320-75d898a42a94/go.mod h1:AZpEONHx3DKn8O/DFsRAY58/XVQiIPMTMB1SddzLXVw= github.com/streadway/amqp v0.0.0-20190827072141-edfb9018d271/go.mod h1:AZpEONHx3DKn8O/DFsRAY58/XVQiIPMTMB1SddzLXVw= github.com/streadway/handy v0.0.0-20190108123426-d5acb3125c2a/go.mod h1:qNTQ5P5JnDBl6z3cMAg/SywNDC5ABu5ApDIw6lUbRmI= @@ -495,6 +601,7 @@ github.com/stretchr/testify v1.7.0 h1:nwc3DEeHmmLAfoZucVR881uASk0Mfjw8xYJ99tb5Cc github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/subosito/gotenv v1.2.0/go.mod h1:N0PQaV/YGNqwC0u51sEeR/aUtSLEXKX9iv69rRypqCw= github.com/tmc/grpc-websocket-proxy v0.0.0-20170815181823-89b8d40f7ca8/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U= +github.com/tv42/httpunix v0.0.0-20150427012821-b75d8614f926/go.mod h1:9ESjWnEqriFuLhtthL60Sar/7RFoluCcXsuvEwTV5KM= github.com/urfave/cli v1.20.0/go.mod h1:70zkFmudgCuE/ngEzBv17Jvp/497gISqfk5gWijbERA= github.com/urfave/cli v1.22.1/go.mod h1:Gos4lmkARVdJ6EkW0WaNv/tZAAMe9V7XWyB60NtXRu0= github.com/valyala/bytebufferpool v1.0.0 h1:GqA5TC/0021Y/b9FG4Oi9Mr3q7XYx6KllzawFIhcdPw= @@ -503,6 +610,8 @@ github.com/valyala/fasthttp v1.17.0/go.mod h1:jjraHZVbKOXftJfsOYoAjaeygpj5hr8erm github.com/valyala/fasthttp v1.18.0/go.mod h1:jjraHZVbKOXftJfsOYoAjaeygpj5hr8ermTRJNroD7A= github.com/valyala/fasthttp v1.31.0 h1:lrauRLII19afgCs2fnWRJ4M5IkV0lo2FqA61uGkNBfE= github.com/valyala/fasthttp v1.31.0/go.mod h1:2rsYD01CKFrjjsvFxx75KlEUNpWNBY9JWD3K/7o2Cus= +github.com/valyala/fasthttp v1.32.0 h1:keswgWzyKyNIIjz2a7JmCYHOOIkRp6HMx9oTV6QrZWY= +github.com/valyala/fasthttp v1.32.0/go.mod h1:2rsYD01CKFrjjsvFxx75KlEUNpWNBY9JWD3K/7o2Cus= github.com/valyala/tcplisten v0.0.0-20161114210144-ceec8f93295a/go.mod h1:v3UYOV9WzVtRmSR+PDvWpU/qWl4Wa5LApYYX4ZtKbio= github.com/valyala/tcplisten v1.0.0 h1:rBHj/Xf+E1tRGZyWIWwJDiRY0zc1Js+CV5DqwacVSA8= github.com/valyala/tcplisten v1.0.0/go.mod h1:T0xQ8SeCZGxckz9qRXTfG43PvQ/mcWh7FwZEA7Ioqkc= @@ -512,15 +621,21 @@ github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9de github.com/yuin/goldmark v1.1.32/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.3.5/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= +github.com/yuin/goldmark v1.4.1/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= gitlab.snapp.ir/dispatching/snappids/v2 v2.8.0 h1:5BzBqfPB59hEHfHzfU4gcWKfiDBjNWcf68GAUgeRPu4= gitlab.snapp.ir/dispatching/snappids/v2 v2.8.0/go.mod h1:U7lxAuqPifdXkUNcCXhtk9+6HFAyw5qy8LrF1DQDMuQ= gitlab.snapp.ir/dispatching/snappids/v2 v2.8.2 h1:yWTrWlnD8ErnVc5D4WLSOIkDwyiFI6+pSaSFd/rTppI= gitlab.snapp.ir/dispatching/snappids/v2 v2.8.2/go.mod h1:U7lxAuqPifdXkUNcCXhtk9+6HFAyw5qy8LrF1DQDMuQ= +gitlab.snapp.ir/dispatching/snappids/v2 v2.9.0 h1:nb3uqHasVp4CGvS8jJKP5c/dkff9XJfOToGwqctXoVo= +gitlab.snapp.ir/dispatching/snappids/v2 v2.9.0/go.mod h1:U7lxAuqPifdXkUNcCXhtk9+6HFAyw5qy8LrF1DQDMuQ= go.etcd.io/bbolt v1.3.3/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU= go.etcd.io/etcd v0.0.0-20191023171146-3cf2f69b5738/go.mod h1:dnLIgRNXwCJa5e+c6mIZCrds/GIG4ncV9HhK5PX7jPg= go.etcd.io/etcd/api/v3 v3.5.0/go.mod h1:cbVKeC6lCfl7j/8jBhAK6aIYO9XOjdptoxU/nLQcPvs= +go.etcd.io/etcd/api/v3 v3.5.1/go.mod h1:cbVKeC6lCfl7j/8jBhAK6aIYO9XOjdptoxU/nLQcPvs= go.etcd.io/etcd/client/pkg/v3 v3.5.0/go.mod h1:IJHfcCEKxYu1Os13ZdwCwIUTUVGYTSAM3YSwc9/Ac1g= +go.etcd.io/etcd/client/pkg/v3 v3.5.1/go.mod h1:IJHfcCEKxYu1Os13ZdwCwIUTUVGYTSAM3YSwc9/Ac1g= go.etcd.io/etcd/client/v2 v2.305.0/go.mod h1:h9puh54ZTgAKtEbut2oe9P4L/oqKCVB6xsXlzd7alYQ= +go.etcd.io/etcd/client/v2 v2.305.1/go.mod h1:pMEacxZW7o8pg4CrFE7pquyCJJzZvkvdD2RibOCCCGs= go.opencensus.io v0.20.1/go.mod h1:6WKK9ahsWS3RSO+PY9ZHZUfv2irvY6gN279GOPZjmmk= go.opencensus.io v0.20.2/go.mod h1:6WKK9ahsWS3RSO+PY9ZHZUfv2irvY6gN279GOPZjmmk= go.opencensus.io v0.21.0/go.mod h1:mSImk1erAIZhrmZN+AvHh14ztQfjbGwt4TtuofqLduU= @@ -532,12 +647,21 @@ go.opencensus.io v0.22.5/go.mod h1:5pWMHQbX5EPX2/62yrJeAkowc+lfs/XD7Uxpq3pI6kk= go.opencensus.io v0.23.0/go.mod h1:XItmlyltB5F7CS4xOC1DcqMoFqwtC6OG2xF7mCv7P7E= go.opentelemetry.io/otel v1.2.0 h1:YOQDvxO1FayUcT9MIhJhgMyNO1WqoduiyvQHzGN0kUQ= go.opentelemetry.io/otel v1.2.0/go.mod h1:aT17Fk0Z1Nor9e0uisf98LrntPGMnk4frBO9+dkf69I= +go.opentelemetry.io/otel v1.3.0 h1:APxLf0eiBwLl+SOXiJJCVYzA1OOJNyAoV8C5RNRyy7Y= +go.opentelemetry.io/otel v1.3.0/go.mod h1:PWIKzi6JCp7sM0k9yZ43VX+T345uNbAkDKwHVjb2PTs= go.opentelemetry.io/otel/exporters/jaeger v1.2.0 h1:C/5Egj3MJBXRJi22cSl07suqPqtZLnLFmH//OxETUEc= go.opentelemetry.io/otel/exporters/jaeger v1.2.0/go.mod h1:KJLFbEMKTNPIfOxcg/WikIozEoKcPgJRz3Ce1vLlM8E= +go.opentelemetry.io/otel/exporters/jaeger v1.3.0 h1:HfydzioALdtcB26H5WHc4K47iTETJCdloL7VN579/L0= +go.opentelemetry.io/otel/exporters/jaeger v1.3.0/go.mod h1:KoYHi1BtkUPncGSRtCe/eh1ijsnePhSkxwzz07vU0Fc= go.opentelemetry.io/otel/sdk v1.2.0 h1:wKN260u4DesJYhyjxDa7LRFkuhH7ncEVKU37LWcyNIo= go.opentelemetry.io/otel/sdk v1.2.0/go.mod h1:jNN8QtpvbsKhgaC6V5lHiejMoKD+V8uadoSafgHPx1U= +go.opentelemetry.io/otel/sdk v1.3.0 h1:3278edCoH89MEJ0Ky8WQXVmDQv3FX4ZJ3Pp+9fJreAI= +go.opentelemetry.io/otel/sdk v1.3.0/go.mod h1:rIo4suHNhQwBIPg9axF8V9CA72Wz2mKF1teNrup8yzs= go.opentelemetry.io/otel/trace v1.2.0 h1:Ys3iqbqZhcf28hHzrm5WAquMkDHNZTUkw7KHbuNjej0= go.opentelemetry.io/otel/trace v1.2.0/go.mod h1:N5FLswTubnxKxOJHM7XZC074qpeEdLy3CgAVsdMucK0= +go.opentelemetry.io/otel/trace v1.3.0 h1:doy8Hzb1RJ+I3yFhtDmwNc7tIyw1tNMOIsyPzp1NOGY= +go.opentelemetry.io/otel/trace v1.3.0/go.mod h1:c/VDhno8888bvQYmbYLqe41/Ldmr/KKunbvWM4/fEjk= +go.opentelemetry.io/proto/otlp v0.7.0/go.mod h1:PqfVotwruBrMGOCsRd/89rSnXhoiJIqeYNgFYFoEGnI= go.uber.org/atomic v1.3.2/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= go.uber.org/atomic v1.5.0/go.mod h1:sABNBOSYdrvTF6hTgEIbc7YasKWGhgEQZyfxyTvoXHQ= go.uber.org/atomic v1.7.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc= @@ -547,6 +671,8 @@ go.uber.org/automaxprocs v1.4.0 h1:CpDZl6aOlLhReez+8S3eEotD7Jx0Os++lemPlMULQP0= go.uber.org/automaxprocs v1.4.0/go.mod h1:/mTEdr7LvHhs0v7mjdxDreTz1OG5zdZGqgOnhWiR/+Q= go.uber.org/goleak v1.1.11-0.20210813005559-691160354723 h1:sHOAIxRGBp443oHZIPB+HsUGaksVCXVQENPxwTfQdH4= go.uber.org/goleak v1.1.11-0.20210813005559-691160354723/go.mod h1:cwTWslyiVhfpKIDGSZEM2HlOvcqm+tG4zioyIeLoqMQ= +go.uber.org/goleak v1.1.11/go.mod h1:cwTWslyiVhfpKIDGSZEM2HlOvcqm+tG4zioyIeLoqMQ= +go.uber.org/goleak v1.1.12/go.mod h1:cwTWslyiVhfpKIDGSZEM2HlOvcqm+tG4zioyIeLoqMQ= go.uber.org/multierr v1.1.0/go.mod h1:wR5kodmAFQ0UK8QlbwjlSNy0Z68gJhDJUG5sjR94q/0= go.uber.org/multierr v1.3.0/go.mod h1:VgVr7evmIr6uPjLBxg28wmKNXyqE9akIJ5XnfpiKl+4= go.uber.org/multierr v1.6.0/go.mod h1:cdWPpRnG4AhwMwsgIHip0KRBQjJy5kYEpYjJxpXp9iU= @@ -558,6 +684,8 @@ go.uber.org/zap v1.13.0/go.mod h1:zwrFLgMcdUuIBviXEYEH1YKNaOBnKXsx2IPda5bBwHM= go.uber.org/zap v1.17.0/go.mod h1:MXVU+bhUf/A7Xi2HNOnopQOrmycQ5Ih87HtOu4q5SSo= go.uber.org/zap v1.19.1 h1:ue41HOKd1vGURxrmeKIgELGb3jPW9DMUDGtsinblHwI= go.uber.org/zap v1.19.1/go.mod h1:j3DNczoxDZroyBnOT1L/Q79cfUMGZxlv/9dzN7SM1rI= +go.uber.org/zap v1.20.0 h1:N4oPlghZwYG55MlU6LXk/Zp00FVNE9X9wrYO8CEs4lc= +go.uber.org/zap v1.20.0/go.mod h1:wjWOCqI0f2ZZrJF/UufIOkiC8ii6tm1iqIsLo76RfJw= golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20181029021203-45a5f77698d3/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= @@ -565,9 +693,11 @@ golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8U golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20190701094942-4def268fd1a4/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20190820162420-60c769a6c586/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +golang.org/x/crypto v0.0.0-20190923035154-9ee001bba392/go.mod h1:/lpIB1dKB+9EgE3H3cr1v9wB50oz8l4C4h62xy7jSTY= golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20210513164829-c07d793c2f9a/go.mod h1:P+XmwS30IXTQdn5tA2iutPOUgjI07+tq3H3K9MVA1s8= +golang.org/x/crypto v0.0.0-20210817164053-32db794688a5/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= @@ -603,6 +733,8 @@ golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.1/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= +golang.org/x/mod v0.5.0/go.mod h1:5OXOZSfqPIIbmVBIIKWRFfZjPR0E5r58TLhUjH0a2Ro= +golang.org/x/mod v0.5.1/go.mod h1:5OXOZSfqPIIbmVBIIKWRFfZjPR0E5r58TLhUjH0a2Ro= golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= @@ -623,6 +755,7 @@ golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLL golang.org/x/net v0.0.0-20190628185345-da137c7871d7/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20190724013045-ca1201d0de80/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20190813141303-74dc4d7220e7/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20190923162816-aa69164e4478/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20191209160850-c0dbc17a3553/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200114155413-6afb5195e5aa/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200202094626-16171245cfb2/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= @@ -646,8 +779,12 @@ golang.org/x/net v0.0.0-20210119194325-5f4716e94777/go.mod h1:m0MpNAwzfU5UDzcl9v golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20210316092652-d523dce5a7f4/go.mod h1:RBQZq4jEuRlivfhVLdyRGr576XBO4/greRjx4P4O3yc= golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM= +golang.org/x/net v0.0.0-20210410081132-afb366fc7cd1/go.mod h1:9tjilg8BloeKEkVJvy7fQ90B1CfIiPueXVOjqfkSzI8= +golang.org/x/net v0.0.0-20210503060351-7fd8e65b6420/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20210510120150-4163338589ed/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20210525063256-abc453219eb5/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= +golang.org/x/net v0.0.0-20210813160813-60bc85c4be6d/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= +golang.org/x/net v0.0.0-20211015210444-4f30a5c0130f/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= @@ -661,6 +798,11 @@ golang.org/x/oauth2 v0.0.0-20210220000619-9bb904979d93/go.mod h1:KelEdhl1UZF7XfJ golang.org/x/oauth2 v0.0.0-20210313182246-cd4f82c27b84/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/oauth2 v0.0.0-20210402161424-2e8d93401602/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/oauth2 v0.0.0-20210514164344-f6687ab2804c/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= +golang.org/x/oauth2 v0.0.0-20210628180205-a41e5a781914/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= +golang.org/x/oauth2 v0.0.0-20210805134026-6f1e6394065a/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= +golang.org/x/oauth2 v0.0.0-20210819190943-2bc19b11175f/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= +golang.org/x/oauth2 v0.0.0-20211005180243-6b3c2da341f1/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= +golang.org/x/oauth2 v0.0.0-20211104180415-d3ed0bb246c8/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -682,6 +824,7 @@ golang.org/x/sys v0.0.0-20181116152217-5ac8a444bdc5/go.mod h1:STP8DvDyc/dI5b8T5h golang.org/x/sys v0.0.0-20181122145206-62eef0e2fa9b/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190129075346-302c3dd5f1cc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20190222072716-a9d3bda3a223/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190312061237-fead79001313/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190403152447-81d4e9dc473e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -692,14 +835,20 @@ golang.org/x/sys v0.0.0-20190606165138-5da285871e9c/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20190624142023-c5567b49c5d0/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190726091711-fc99dfbffb4e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190826190057-c7b8b68b1456/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190922100055-0a153f010e69/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190924154521-2837fb4f24fe/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191001151750-bb3f8db39f24/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191005200804-aed5e4c7ecf9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191008105621-543471e840be/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191026070338-33540a1f6037/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191204072324-ce4227a45e2e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191220142924-d4481acd189f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191228213918-04cbcbbfeed8/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200106162015-b016eb3dc98e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200113162924-86b910548bc1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200116001909-b77594299b42/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200122134326-e047566fdf82/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200124204421-9fbb57f87de9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200202164722-d101bd2416d5/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200212091648-12a6c2dcc1e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -723,6 +872,7 @@ golang.org/x/sys v0.0.0-20210104204734-6f8348627aad/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20210119212857-b64e53b001e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210220050731-9a76102bfb43/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210303074136-134d130e1a04/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210305230114-8fe3ee5dd75b/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210315160823-c6e025ad8005/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210320140829-1e4c9ba3b0c4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -733,12 +883,25 @@ golang.org/x/sys v0.0.0-20210423185535-09eb48e85fd7/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210514084401-e8d321eab015/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210603081109-ebe580a85c40/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20210603125802-9665404d3644/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20210616094352-59db8d763f22/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20210806184541-e5e7981a1069/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20210816183151-1e6c022a8912/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20210823070655-63515b42dcdf/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20210908233432-aa78b53d3365/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20210927094055-39ccf1dd6fa6/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20211007075335-d3039528d8ac/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20211013075003-97ac67df715c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20211019181941-9d821ace8654/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20211123173158-ef496fb156ab h1:rfJ1bsoJQQIAoAxTxB7bme+vHrNkRw8CqfsYh9w54cw= golang.org/x/sys v0.0.0-20211123173158-ef496fb156ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20211124211545-fe61309f8881/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20211205182925-97ca703d548d h1:FjkYO/PPp4Wi0EAUOVLxePm7qVW4r4ctbWpURyuOD0E= golang.org/x/sys v0.0.0-20211205182925-97ca703d548d/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220111092808-5a964db01320 h1:0jf+tOCoZ3LyutmCOWpVni1chK4VfFLhRsDK7MhqGRY= +golang.org/x/sys v0.0.0-20220111092808-5a964db01320/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= @@ -749,6 +912,7 @@ golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.4/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= +golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= golang.org/x/time v0.0.0-20180412165947-fbb02b2291d2/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= @@ -769,6 +933,7 @@ golang.org/x/tools v0.0.0-20190606124116-d0a3d012864b/go.mod h1:/rFqwRUd4F7ZHNgw golang.org/x/tools v0.0.0-20190621195816-6e04913cbbac/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= golang.org/x/tools v0.0.0-20190628153133-6cdbf07be9d0/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= golang.org/x/tools v0.0.0-20190816200558-6889da9d5479/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20190907020128-2ca718005c18/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20190911174233-4f2ddba30aff/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191012152004-8de300cfc20a/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191029041327-9cc4af7d6b2c/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= @@ -808,8 +973,12 @@ golang.org/x/tools v0.0.0-20201208233053-a543418bbed2/go.mod h1:emZCQorbCU4vsT4f golang.org/x/tools v0.0.0-20210105154028-b0ab187a4818/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.1.0/go.mod h1:xkSsbof2nBLbhDlRMhhhyNLN/zl3eTqcnHD5viDpcZ0= +golang.org/x/tools v0.1.1/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.2/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= +golang.org/x/tools v0.1.3/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= +golang.org/x/tools v0.1.4/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.5/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= +golang.org/x/tools v0.1.8/go.mod h1:nABZi5QlRsZVlzPpHl034qft6wpY4eDcsTt5AaioBiU= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= @@ -838,6 +1007,17 @@ google.golang.org/api v0.40.0/go.mod h1:fYKFpnQN0DsDSKRVRcQSDQNtqWPfM9i+zNPxepjR google.golang.org/api v0.41.0/go.mod h1:RkxM5lITDfTzmyKFPt+wGrCJbVfniCr2ool8kTBzRTU= google.golang.org/api v0.43.0/go.mod h1:nQsDGjRXMo4lvh5hP0TKqF244gqhGcr/YSIykhUk/94= google.golang.org/api v0.44.0/go.mod h1:EBOGZqzyhtvMDoxwS97ctnh0zUmYY6CxqXsc1AvkYD8= +google.golang.org/api v0.47.0/go.mod h1:Wbvgpq1HddcWVtzsVLyfLp8lDg6AA241LmgIL59tHXo= +google.golang.org/api v0.48.0/go.mod h1:71Pr1vy+TAZRPkPs/xlCf5SsU8WjuAWv1Pfjbtukyy4= +google.golang.org/api v0.50.0/go.mod h1:4bNT5pAuq5ji4SRZm+5QIkjny9JAyVD/3gaSihNefaw= +google.golang.org/api v0.51.0/go.mod h1:t4HdrdoNgyN5cbEfm7Lum0lcLDLiise1F8qDKX00sOU= +google.golang.org/api v0.54.0/go.mod h1:7C4bFFOvVDGXjfDTAsgGwDgAxRDeQ4X8NvUedIt6z3k= +google.golang.org/api v0.55.0/go.mod h1:38yMfeP1kfjsl8isn0tliTjIb1rJXcQi4UXlbqivdVE= +google.golang.org/api v0.56.0/go.mod h1:38yMfeP1kfjsl8isn0tliTjIb1rJXcQi4UXlbqivdVE= +google.golang.org/api v0.57.0/go.mod h1:dVPlbZyBo2/OjBpmvNdpn2GRm6rPy75jyU7bmhdrMgI= +google.golang.org/api v0.59.0/go.mod h1:sT2boj7M9YJxZzgeZqXogmhfmRWDtPzT31xkieUbuZU= +google.golang.org/api v0.61.0/go.mod h1:xQRti5UdCmoCEqFxcz93fTl338AVqDgyaDRuOZ3hg9I= +google.golang.org/api v0.62.0/go.mod h1:dKmwPCydfsad4qCH08MSdgWjfHOyfpd4VtDGgRFdavw= google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= google.golang.org/appengine v1.2.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= @@ -888,7 +1068,29 @@ google.golang.org/genproto v0.0.0-20210303154014-9728d6b83eeb/go.mod h1:FWY/as6D google.golang.org/genproto v0.0.0-20210310155132-4ce2db91004e/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20210319143718-93e7006c17a6/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20210402141018-6c239bbf2bb1/go.mod h1:9lPAdzaEmUacj36I+k7YKbEc5CXzPIeORRgDAUOu28A= +google.golang.org/genproto v0.0.0-20210513213006-bf773b8c8384/go.mod h1:P3QM42oQyzQSnHPnZ/vqoCdDmzH28fzWByN9asMeM8A= google.golang.org/genproto v0.0.0-20210602131652-f16073e35f0c/go.mod h1:UODoCrxHCcBojKKwX1terBiRUaqAsFqJiF615XL43r0= +google.golang.org/genproto v0.0.0-20210604141403-392c879c8b08/go.mod h1:UODoCrxHCcBojKKwX1terBiRUaqAsFqJiF615XL43r0= +google.golang.org/genproto v0.0.0-20210608205507-b6d2f5bf0d7d/go.mod h1:UODoCrxHCcBojKKwX1terBiRUaqAsFqJiF615XL43r0= +google.golang.org/genproto v0.0.0-20210624195500-8bfb893ecb84/go.mod h1:SzzZ/N+nwJDaO1kznhnlzqS8ocJICar6hYhVyhi++24= +google.golang.org/genproto v0.0.0-20210713002101-d411969a0d9a/go.mod h1:AxrInvYm1dci+enl5hChSFPOmmUF1+uAa/UsgNRWd7k= +google.golang.org/genproto v0.0.0-20210716133855-ce7ef5c701ea/go.mod h1:AxrInvYm1dci+enl5hChSFPOmmUF1+uAa/UsgNRWd7k= +google.golang.org/genproto v0.0.0-20210728212813-7823e685a01f/go.mod h1:ob2IJxKrgPT52GcgX759i1sleT07tiKowYBGbczaW48= +google.golang.org/genproto v0.0.0-20210805201207-89edb61ffb67/go.mod h1:ob2IJxKrgPT52GcgX759i1sleT07tiKowYBGbczaW48= +google.golang.org/genproto v0.0.0-20210813162853-db860fec028c/go.mod h1:cFeNkxwySK631ADgubI+/XFU/xp8FD5KIVV4rj8UC5w= +google.golang.org/genproto v0.0.0-20210821163610-241b8fcbd6c8/go.mod h1:eFjDcFEctNawg4eG61bRv87N7iHBWyVhJu7u1kqDUXY= +google.golang.org/genproto v0.0.0-20210828152312-66f60bf46e71/go.mod h1:eFjDcFEctNawg4eG61bRv87N7iHBWyVhJu7u1kqDUXY= +google.golang.org/genproto v0.0.0-20210831024726-fe130286e0e2/go.mod h1:eFjDcFEctNawg4eG61bRv87N7iHBWyVhJu7u1kqDUXY= +google.golang.org/genproto v0.0.0-20210903162649-d08c68adba83/go.mod h1:eFjDcFEctNawg4eG61bRv87N7iHBWyVhJu7u1kqDUXY= +google.golang.org/genproto v0.0.0-20210909211513-a8c4777a87af/go.mod h1:eFjDcFEctNawg4eG61bRv87N7iHBWyVhJu7u1kqDUXY= +google.golang.org/genproto v0.0.0-20210924002016-3dee208752a0/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= +google.golang.org/genproto v0.0.0-20211008145708-270636b82663/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= +google.golang.org/genproto v0.0.0-20211028162531-8db9c33dc351/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= +google.golang.org/genproto v0.0.0-20211118181313-81c1377c94b1/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= +google.golang.org/genproto v0.0.0-20211129164237-f09f9a12af12/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= +google.golang.org/genproto v0.0.0-20211203200212-54befc351ae9/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= +google.golang.org/genproto v0.0.0-20211206160659-862468c7d6e0/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= +google.golang.org/genproto v0.0.0-20211208223120-3a66f561d7aa/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= google.golang.org/grpc v1.14.0/go.mod h1:yo6s7OP7yaDglbqo1J04qKzAhqBH6lvTonzMVmEdcZw= google.golang.org/grpc v1.17.0/go.mod h1:6QZJwpn2B+Zp71q/5VxRsJ6NXXVCE5NRUHRo+f3cWCs= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= @@ -915,7 +1117,15 @@ google.golang.org/grpc v1.34.0/go.mod h1:WotjhfgOW/POjDeRt8vscBtXq+2VjORFy659qA5 google.golang.org/grpc v1.35.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= google.golang.org/grpc v1.36.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= google.golang.org/grpc v1.36.1/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= +google.golang.org/grpc v1.37.0/go.mod h1:NREThFqKR1f3iQ6oBuvc5LadQuXVGo9rkm5ZGrQdJfM= +google.golang.org/grpc v1.37.1/go.mod h1:NREThFqKR1f3iQ6oBuvc5LadQuXVGo9rkm5ZGrQdJfM= google.golang.org/grpc v1.38.0/go.mod h1:NREThFqKR1f3iQ6oBuvc5LadQuXVGo9rkm5ZGrQdJfM= +google.golang.org/grpc v1.39.0/go.mod h1:PImNr+rS9TWYb2O4/emRugxiyHZ5JyHW5F+RPnDzfrE= +google.golang.org/grpc v1.39.1/go.mod h1:PImNr+rS9TWYb2O4/emRugxiyHZ5JyHW5F+RPnDzfrE= +google.golang.org/grpc v1.40.0/go.mod h1:ogyxbiOoUXAkP+4+xa6PZSE9DZgIHtSpzjDTB9KAK34= +google.golang.org/grpc v1.40.1/go.mod h1:ogyxbiOoUXAkP+4+xa6PZSE9DZgIHtSpzjDTB9KAK34= +google.golang.org/grpc v1.42.0/go.mod h1:k+4IHHFw41K8+bbowsex27ge2rCb65oeWqe4jJ590SU= +google.golang.org/grpc/cmd/protoc-gen-go-grpc v1.1.0/go.mod h1:6Kw0yEErY5E/yWrBtf03jp27GLLJujG4z/JK95pnjjw= 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= @@ -942,6 +1152,7 @@ gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys= gopkg.in/gcfg.v1 v1.2.3/go.mod h1:yesOnuUOFQAhST5vPY4nbZsb/huCgGGXlipJsBn0b3o= gopkg.in/ini.v1 v1.62.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= +gopkg.in/ini.v1 v1.66.2/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= gopkg.in/resty.v1 v1.12.0/go.mod h1:mDo4pnntr5jdWRML875a/NmxYqAlA73dVijT2AXvQQo= gopkg.in/square/go-jose.v2 v2.3.1/go.mod h1:M9dMgbHiYLoDGQrXy7OpJDJWiKiU//h+vD76mk0e1AI= gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw= diff --git a/internal/authenticator/authenticator.go b/internal/authenticator/authenticator.go index d0f31141..7b6338c9 100644 --- a/internal/authenticator/authenticator.go +++ b/internal/authenticator/authenticator.go @@ -208,7 +208,7 @@ func (a Authenticator) ValidateTopicBySender(topic topics.Topic, audience snappi case topics.Chat: ch, _ = a.EMQTopicManager.CreateChatTopic(id, audience) case topics.CallEntry: - ch, _ = a.EMQTopicManager.CreateCallEntryTopic(id, audience) + ch, _ = a.EMQTopicManager.CreateGeneralCallEntryTopic(id, audience) case topics.CallOutgoing: ch, _ = a.EMQTopicManager.CreateCallOutgoingTopic(id, audience) case topics.BoxEvent: From a6eb89bb39de6d862100e088cf8fc3ff9ee48915 Mon Sep 17 00:00:00 2001 From: Parham Alvani Date: Thu, 13 Jan 2022 15:14:49 +0330 Subject: [PATCH 130/660] feat: update call topic --- internal/authenticator/authenticator_test.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/internal/authenticator/authenticator_test.go b/internal/authenticator/authenticator_test.go index d392fec5..d209230d 100644 --- a/internal/authenticator/authenticator_test.go +++ b/internal/authenticator/authenticator_test.go @@ -43,8 +43,8 @@ const ( invalidDriverChatTopic = "snapp/driver/0596923be632d673560af9adadd2f78a/chat" invalidPassengerChatTopic = "snapp/passenger/0596923be632d673560af9adadd2f78a/chat" - validDriverCallEntryTopic = "snapp/driver/DXKgaNQa7N5Y7bo/call/send" - validPassengerCallEntryTopic = "snapp/passenger/DXKgaNQa7N5Y7bo/call/send" + validDriverCallEntryTopic = "shared/snapp/driver/DXKgaNQa7N5Y7bo/call/send" + validPassengerCallEntryTopic = "shared/snapp/passenger/DXKgaNQa7N5Y7bo/call/send" invalidDriverCallEntryTopic = "snapp/driver/0596923be632d673560af9adadd2f78a/call/send" invalidPassengerCallEntryTopic = "snapp/passenger/0596923be632d673560af9adadd2f78a/call/send" validDriverCallOutgoingTopic = "snapp/driver/DXKgaNQa7N5Y7bo/call/receive" From ca327d532855939827d23655f7b00cff2321464d Mon Sep 17 00:00:00 2001 From: Parham Alvani Date: Thu, 13 Jan 2022 16:05:28 +0330 Subject: [PATCH 131/660] feat: handle call topics --- internal/authenticator/authenticator.go | 6 ++++- internal/authenticator/authenticator_test.go | 26 +++++++++++++++++-- internal/topics/t.go | 22 +++++++++------- internal/topics/t_test.go | 27 ++++++++++++-------- 4 files changed, 58 insertions(+), 23 deletions(-) diff --git a/internal/authenticator/authenticator.go b/internal/authenticator/authenticator.go index 7b6338c9..fca11a35 100644 --- a/internal/authenticator/authenticator.go +++ b/internal/authenticator/authenticator.go @@ -4,6 +4,7 @@ import ( "crypto/rsa" "errors" "fmt" + "strings" "github.com/golang-jwt/jwt/v4" "gitlab.snapp.ir/dispatching/snappids/v2" @@ -207,8 +208,11 @@ func (a Authenticator) ValidateTopicBySender(topic topics.Topic, audience snappi ch, _ = a.EMQTopicManager.CreateSharedLocationTopic(id, audience) case topics.Chat: ch, _ = a.EMQTopicManager.CreateChatTopic(id, audience) - case topics.CallEntry: + case topics.GeneralCallEntry: ch, _ = a.EMQTopicManager.CreateGeneralCallEntryTopic(id, audience) + case topics.NodeCallEntry: + node := strings.Split(string(topic), "/")[4] + ch, _ = a.EMQTopicManager.CreateNodeCallEntryTopic(id, audience, node) case topics.CallOutgoing: ch, _ = a.EMQTopicManager.CreateCallOutgoingTopic(id, audience) case topics.BoxEvent: diff --git a/internal/authenticator/authenticator_test.go b/internal/authenticator/authenticator_test.go index d209230d..cf9ace94 100644 --- a/internal/authenticator/authenticator_test.go +++ b/internal/authenticator/authenticator_test.go @@ -45,6 +45,8 @@ const ( validDriverCallEntryTopic = "shared/snapp/driver/DXKgaNQa7N5Y7bo/call/send" validPassengerCallEntryTopic = "shared/snapp/passenger/DXKgaNQa7N5Y7bo/call/send" + validDriverNodeCallEntryTopic = "snapp/driver/DXKgaNQa7N5Y7bo/call/heliograph-0/send" + validPassengerNodeCallEntryTopic = "snapp/passenger/DXKgaNQa7N5Y7bo/call/heliograph-0/send" invalidDriverCallEntryTopic = "snapp/driver/0596923be632d673560af9adadd2f78a/call/send" invalidPassengerCallEntryTopic = "snapp/passenger/0596923be632d673560af9adadd2f78a/call/send" validDriverCallOutgoingTopic = "snapp/driver/DXKgaNQa7N5Y7bo/call/receive" @@ -294,6 +296,18 @@ func TestAuthenticator_Acl(t *testing.T) { assert.True(t, ok) }) + t.Run("testing driver subscribe on valid call outgoing node topic", func(t *testing.T) { + ok, err := auth.ACL(acl.Pub, driverToken, validDriverNodeCallEntryTopic) + assert.NoError(t, err) + assert.True(t, ok) + }) + + t.Run("testing passenger subscribe on valid outgoing call node topic", func(t *testing.T) { + ok, err := auth.ACL(acl.Pub, passengerToken, validPassengerNodeCallEntryTopic) + assert.NoError(t, err) + assert.True(t, ok) + }) + t.Run("testing driver subscribe on invalid call outgoing topic", func(t *testing.T) { ok, err := auth.ACL(acl.Sub, driverToken, invalidDriverCallOutgoingTopic) assert.Error(t, err) @@ -449,7 +463,11 @@ func (rmh MockModelHandler) Get(pk string) user.User { Access: acl.Sub, }, { - Topic: topics.CallEntry, + Topic: topics.GeneralCallEntry, + Access: acl.Pub, + }, + { + Topic: topics.NodeCallEntry, Access: acl.Pub, }, { @@ -487,7 +505,11 @@ func (rmh MockModelHandler) Get(pk string) user.User { Access: acl.Sub, }, { - Topic: topics.CallEntry, + Topic: topics.GeneralCallEntry, + Access: acl.Pub, + }, + { + Topic: topics.NodeCallEntry, Access: acl.Pub, }, { diff --git a/internal/topics/t.go b/internal/topics/t.go index 03e01836..243e04b1 100644 --- a/internal/topics/t.go +++ b/internal/topics/t.go @@ -17,7 +17,8 @@ const ( BoxEvent Type = "box_event" SharedLocation Type = "shared_location" Chat Type = "chat" - CallEntry Type = "call_entry" + GeneralCallEntry Type = "general_call_entry" + NodeCallEntry Type = "node_call_entry" CallOutgoing Type = "call_outgoing" ) @@ -26,13 +27,14 @@ const ( // so they regular expressions should not contain the company prefix. var ( CabEventRegexp = regexp.MustCompile(`(\w+)-event-[a-zA-Z0-9]+`) - DriverLocationRegexp = regexp.MustCompile(`/driver/[a-zA-Z0-9+]+/location`) - PassengerLocationRegexp = regexp.MustCompile(`/passenger/[a-zA-Z0-9+]+/location`) + DriverLocationRegexp = regexp.MustCompile(`/driver/[a-zA-Z0-9]+/location`) + PassengerLocationRegexp = regexp.MustCompile(`/passenger/[a-zA-Z0-9]+/location`) SuperappEventRegexp = regexp.MustCompile(`/(driver|passenger)/[a-zA-Z0-9]+/(superapp)`) - SharedLocationRegexp = regexp.MustCompile(`/(driver|passenger)+/[a-zA-Z0-9]+/(driver-location|passenger-location)`) - ChatRegexp = regexp.MustCompile(`/(driver|passenger)+/[a-zA-Z0-9+]+/chat`) - CallEntryRegexp = regexp.MustCompile(`/(driver|passenger)+/[a-zA-Z0-9+]+/call/send`) - CallOutgoingRegexp = regexp.MustCompile(`/(driver|passenger)+/[a-zA-Z0-9+]+/call/receive`) + SharedLocationRegexp = regexp.MustCompile(`/(driver|passenger)/[a-zA-Z0-9]+/(driver-location|passenger-location)`) + ChatRegexp = regexp.MustCompile(`/(driver|passenger)/[a-zA-Z0-9]+/chat`) + GeneralCallEntryRegexp = regexp.MustCompile(`/(driver|passenger)/[a-zA-Z0-9]+/call/send`) + NodeCallEntryRegexp = regexp.MustCompile(`/(driver|passenger)/[a-zA-Z0-9]+/call/[a-zA-Z0-9-]+/send`) + CallOutgoingRegexp = regexp.MustCompile(`/(driver|passenger)/[a-zA-Z0-9]+/call/receive`) ) func (t Topic) GetType() Type { @@ -54,8 +56,10 @@ func (t Topic) GetTypeWithCompany(company string) Type { return SharedLocation case ChatRegexp.MatchString(topic): return Chat - case CallEntryRegexp.MatchString(topic): - return CallEntry + case GeneralCallEntryRegexp.MatchString(topic): + return GeneralCallEntry + case NodeCallEntryRegexp.MatchString(topic): + return NodeCallEntry case CallOutgoingRegexp.MatchString(topic): return CallOutgoing case SuperappEventRegexp.MatchString(topic): diff --git a/internal/topics/t_test.go b/internal/topics/t_test.go index dc4e7414..32434c0a 100644 --- a/internal/topics/t_test.go +++ b/internal/topics/t_test.go @@ -46,11 +46,6 @@ func TestTopic_GetType(t1 *testing.T) { arg: "snapp/passenger/fhdyfuiksdf5456456adljada/superapp", want: SuperappEvent, }, - { - name: "testing superapp event", - arg: "snapp/driver/+/location", - want: DriverLocation, - }, { name: "testing shared passenger location", arg: "snapp/passenger/py9kdjLYB35RP4q/driver-location", @@ -72,14 +67,24 @@ func TestTopic_GetType(t1 *testing.T) { want: Chat, }, { - name: "testing passenger call entry", - arg: "snapp/passenger/py9kdjLYB35RP4q/call/send", - want: CallEntry, + name: "testing passenger general call entry", + arg: "shared/snapp/passenger/py9kdjLYB35RP4q/call/send", + want: GeneralCallEntry, + }, + { + name: "testing driver general call entry", + arg: "shared/snapp/driver/py9kdjLYB35RP4q/call/send", + want: GeneralCallEntry, + }, + { + name: "testing passenger node call entry", + arg: "snapp/passenger/py9kdjLYB35RP4q/call/heliograph-0/send", + want: NodeCallEntry, }, { - name: "testing driver call entry", - arg: "snapp/driver/py9kdjLYB35RP4q/call/send", - want: CallEntry, + name: "testing driver node call entry", + arg: "snapp/driver/py9kdjLYB35RP4q/call/heliograph-1/send", + want: NodeCallEntry, }, { name: "testing passenger call", From 3c8220aad894a71c67a012ebb5a709224134267f Mon Sep 17 00:00:00 2001 From: Parham Alvani Date: Thu, 13 Jan 2022 16:34:37 +0330 Subject: [PATCH 132/660] fix: correct default configuration --- internal/config/default.go | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/internal/config/default.go b/internal/config/default.go index 9a10adb9..4a657ebb 100644 --- a/internal/config/default.go +++ b/internal/config/default.go @@ -71,7 +71,11 @@ func Default() Config { Access: acl.Sub, }, { - Topic: topics.CallEntry, + Topic: topics.GeneralCallEntry, + Access: acl.Pub, + }, + { + Topic: topics.NodeCallEntry, Access: acl.Pub, }, { @@ -104,7 +108,11 @@ func Default() Config { Access: acl.Sub, }, { - Topic: topics.CallEntry, + Topic: topics.GeneralCallEntry, + Access: acl.Pub, + }, + { + Topic: topics.NodeCallEntry, Access: acl.Pub, }, { From 5da0b7e7c5fba6d71d1c2c1fa4074fff000dba12 Mon Sep 17 00:00:00 2001 From: Parham Alvani Date: Thu, 13 Jan 2022 16:45:10 +0330 Subject: [PATCH 133/660] Update t.go --- internal/topics/t.go | 1 + 1 file changed, 1 insertion(+) diff --git a/internal/topics/t.go b/internal/topics/t.go index 243e04b1..f8379bb7 100644 --- a/internal/topics/t.go +++ b/internal/topics/t.go @@ -41,6 +41,7 @@ func (t Topic) GetType() Type { return t.GetTypeWithCompany("snapp") } +// nolint: cyclop func (t Topic) GetTypeWithCompany(company string) Type { topic := string(t) topic = strings.TrimPrefix(topic, company) From 74cff492d57dbccba2caf8d79a6aa37be554bae6 Mon Sep 17 00:00:00 2001 From: Parham Alvani Date: Sat, 15 Jan 2022 10:44:00 +0330 Subject: [PATCH 134/660] feat: update chart version --- deployments/soteria/Chart.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/deployments/soteria/Chart.yaml b/deployments/soteria/Chart.yaml index 9802311a..0720e640 100644 --- a/deployments/soteria/Chart.yaml +++ b/deployments/soteria/Chart.yaml @@ -5,6 +5,6 @@ description: Soteria Helm Chart type: application -version: 5.1.4 +version: 5.2.0 -appVersion: "v5-1-4" +appVersion: "v5-2-0" From e297cee73ff73d7a49d1d3e2ba51f9d1da925ddc Mon Sep 17 00:00:00 2001 From: Parham Alvani Date: Sun, 16 Jan 2022 13:23:30 +0330 Subject: [PATCH 135/660] feat: update default values --- deployments/soteria/values.yaml | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/deployments/soteria/values.yaml b/deployments/soteria/values.yaml index 231d09d6..73dd4fc7 100644 --- a/deployments/soteria/values.yaml +++ b/deployments/soteria/values.yaml @@ -88,7 +88,9 @@ users: access: '1' - topic: superapp_event access: '1' - - topic: call_entry + - topic: node_call_entry + access: '2' + - topic: general_call_entry access: '2' - topic: call_outgoing access: '1' @@ -106,7 +108,9 @@ users: access: '2' - topic: shared_location access: '1' - - topic: call_entry + - topic: node_call_entry + access: '2' + - topic: general_call_entry access: '2' - topic: call_outgoing access: '1' From 2fb829f2f5f4edf2eb0bb4d9886ad1d05f05366f Mon Sep 17 00:00:00 2001 From: Parham Alvani Date: Sun, 16 Jan 2022 13:23:37 +0330 Subject: [PATCH 136/660] feat: update chart version --- deployments/soteria/Chart.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/deployments/soteria/Chart.yaml b/deployments/soteria/Chart.yaml index 0720e640..8656f59a 100644 --- a/deployments/soteria/Chart.yaml +++ b/deployments/soteria/Chart.yaml @@ -5,6 +5,6 @@ description: Soteria Helm Chart type: application -version: 5.2.0 +version: 5.2.1 -appVersion: "v5-2-0" +appVersion: "v5-2-1" From 7822293620dbe604c4bda0b26db236cfddcbd4bc Mon Sep 17 00:00:00 2001 From: Mehdi Date: Sat, 29 Jan 2022 15:31:16 +0330 Subject: [PATCH 137/660] feat: add topic manager --- internal/topics/manager.go | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 internal/topics/manager.go diff --git a/internal/topics/manager.go b/internal/topics/manager.go new file mode 100644 index 00000000..72804543 --- /dev/null +++ b/internal/topics/manager.go @@ -0,0 +1,28 @@ +package topics + +import "regexp" + +type Manager struct { + regexes map[string]*regexp.Regexp +} + +func NewManager(topics map[string]string) Manager { + regexes := make(map[string]*regexp.Regexp) + + for key, template := range topics { + regexes[key] = regexp.MustCompile(template) + } + + return Manager{regexes: regexes} +} + +func (m Manager) IsTopicValid(topic string) bool { + + for _, regex := range m.regexes { + if regex.MatchString(topic) { + return true + } + } + + return false +} From ee8ed2f03f66e6fa313e6c9fd0adc889cb734acc Mon Sep 17 00:00:00 2001 From: Mehdi Date: Sat, 29 Jan 2022 15:41:17 +0330 Subject: [PATCH 138/660] feat: add topics templates to config --- internal/config/config.go | 23 ++++++++++++----------- internal/config/default.go | 12 ++++++++++++ 2 files changed, 24 insertions(+), 11 deletions(-) diff --git a/internal/config/config.go b/internal/config/config.go index 197354fb..6848dde9 100644 --- a/internal/config/config.go +++ b/internal/config/config.go @@ -28,17 +28,18 @@ const ( type ( // Config is the main container of Soteria's config. Config struct { - AllowedAccessTypes []string `koanf:"allowed_access_types"` - PassengerHashLength int `koanf:"passenger_hash_length"` - DriverHashLength int `koanf:"driver_hash_length"` - PassengerSalt string `koanf:"passenger_salt"` - DriverSalt string `koanf:"driver_salt"` - JWT *JWT `koanf:"jwt"` - Logger logger.Config `koanf:"logger"` - HTTPPort int `koanf:"http_port"` - Tracer tracing.Config `koanf:"tracer"` - Company string `koanf:"company"` - Users []user.User `koanf:"users"` + AllowedAccessTypes []string `koanf:"allowed_access_types"` + PassengerHashLength int `koanf:"passenger_hash_length"` + DriverHashLength int `koanf:"driver_hash_length"` + PassengerSalt string `koanf:"passenger_salt"` + DriverSalt string `koanf:"driver_salt"` + JWT *JWT `koanf:"jwt"` + Logger logger.Config `koanf:"logger"` + HTTPPort int `koanf:"http_port"` + Tracer tracing.Config `koanf:"tracer"` + Company string `koanf:"company"` + Users []user.User `koanf:"users"` + Topics map[string]string `koanf:"topics"` } // JWt contains path of the keys for JWT encryption. diff --git a/internal/config/default.go b/internal/config/default.go index 4a657ebb..6f9c142b 100644 --- a/internal/config/default.go +++ b/internal/config/default.go @@ -122,5 +122,17 @@ func Default() Config { }, }, }, + Topics: map[string]string{ + "cab_event": `(\w+)-event-[a-zA-Z0-9]+`, + "driver_location": `/driver/[a-zA-Z0-9]+/location`, + "passenger_location": `/passenger/[a-zA-Z0-9]+/location`, + "superapp_event": `/(driver|passenger)/[a-zA-Z0-9]+/(superapp)`, + "box_event": `bucks`, + "shared_location": `/(driver|passenger)/[a-zA-Z0-9]+/(driver-location|passenger-location)`, + "chat": `/(driver|passenger)/[a-zA-Z0-9]+/chat`, + "general_call_entry": `/(driver|passenger)/[a-zA-Z0-9]+/call/send`, + "node_call_entry": `/(driver|passenger)/[a-zA-Z0-9]+/call/[a-zA-Z0-9-]+/send`, + "call_outgoing": `/(driver|passenger)/[a-zA-Z0-9]+/call/receive`, + }, } } From b7fbd2c44b7d50dbd5da480407ad40f5f369b578 Mon Sep 17 00:00:00 2001 From: Mehdi Date: Sat, 29 Jan 2022 16:05:53 +0330 Subject: [PATCH 139/660] feat: add get type function --- internal/topics/manager.go | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/internal/topics/manager.go b/internal/topics/manager.go index 72804543..f0e7750b 100644 --- a/internal/topics/manager.go +++ b/internal/topics/manager.go @@ -17,12 +17,15 @@ func NewManager(topics map[string]string) Manager { } func (m Manager) IsTopicValid(topic string) bool { + return len(m.GetTopicType(topic)) != 0 +} - for _, regex := range m.regexes { +func (m Manager) GetTopicType(topic string) string { + for key, regex := range m.regexes { if regex.MatchString(topic) { - return true + return key } } - return false + return "" } From fba464405814334569b7b658caafcde169540a59 Mon Sep 17 00:00:00 2001 From: Mehdi Date: Sat, 29 Jan 2022 16:12:57 +0330 Subject: [PATCH 140/660] feat: embed topic manager into authenticator --- internal/authenticator/authenticator.go | 40 +++++++++++++++++++++++-- internal/topics/manager.go | 31 ------------------- 2 files changed, 38 insertions(+), 33 deletions(-) delete mode 100644 internal/topics/manager.go diff --git a/internal/authenticator/authenticator.go b/internal/authenticator/authenticator.go index fca11a35..72629004 100644 --- a/internal/authenticator/authenticator.go +++ b/internal/authenticator/authenticator.go @@ -4,6 +4,8 @@ import ( "crypto/rsa" "errors" "fmt" + "gitlab.snapp.ir/dispatching/soteria/v3/internal/app" + "regexp" "strings" "github.com/golang-jwt/jwt/v4" @@ -30,12 +32,12 @@ type TopicNotAllowedError struct { Issuer user.Issuer Sub string AccessType acl.AccessType - Topic topics.Topic + Topic string } func (err TopicNotAllowedError) Error() string { return fmt.Sprintf("issuer %s with sub %s is not allowed to %s on topic %s (%s)", - err.Issuer, err.Sub, err.AccessType, err.Topic, err.Topic.GetType(), + err.Issuer, err.Sub, err.AccessType, err.Topic, app.GetInstance().Authenticator.GetTopicType(err.Topic), ) } @@ -63,6 +65,7 @@ type Authenticator struct { EMQTopicManager *snappids.EMQTopicManager HashIDSManager *snappids.HashIDSManager Company string + Regexes map[string]*regexp.Regexp } // Auth check user authentication by checking the user's token @@ -232,3 +235,36 @@ func issuerToAudience(issuer user.Issuer) snappids.Audience { return -1 } } + +// IsTopicValid returns true if it finds a topic type for the given topic. +func (a Authenticator) IsTopicValid(topic string) bool { + return len(a.GetTopicType(topic)) != 0 +} + +// GetTopicType find topic type based on regexes. +func (a Authenticator) GetTopicType(topic string) string { + return a.GetTopicTypeByCompany(topic, "snapp") +} + +func (a Authenticator) GetTopicTypeByCompany(topic, company string) string { + topic = strings.TrimPrefix(topic, company) + + for key, regex := range a.Regexes { + if regex.MatchString(topic) { + return key + } + } + + return "" +} + +// CompileTopicsRegexes compile topic regex template reading from config. +func CompileTopicsRegexes(topics map[string]string) map[string]*regexp.Regexp { + regexes := make(map[string]*regexp.Regexp) + + for key, template := range topics { + regexes[key] = regexp.MustCompile(template) + } + + return regexes +} diff --git a/internal/topics/manager.go b/internal/topics/manager.go deleted file mode 100644 index f0e7750b..00000000 --- a/internal/topics/manager.go +++ /dev/null @@ -1,31 +0,0 @@ -package topics - -import "regexp" - -type Manager struct { - regexes map[string]*regexp.Regexp -} - -func NewManager(topics map[string]string) Manager { - regexes := make(map[string]*regexp.Regexp) - - for key, template := range topics { - regexes[key] = regexp.MustCompile(template) - } - - return Manager{regexes: regexes} -} - -func (m Manager) IsTopicValid(topic string) bool { - return len(m.GetTopicType(topic)) != 0 -} - -func (m Manager) GetTopicType(topic string) string { - for key, regex := range m.regexes { - if regex.MatchString(topic) { - return key - } - } - - return "" -} From 12b23076b4655bb3701c77af80d987dc5e2d33c7 Mon Sep 17 00:00:00 2001 From: Mehdi Date: Sun, 30 Jan 2022 09:54:21 +0330 Subject: [PATCH 141/660] feat: change topic type to string --- pkg/acl/token.go | 5 ++--- pkg/user/user.go | 5 ++--- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/pkg/acl/token.go b/pkg/acl/token.go index 973896d1..1667a42b 100644 --- a/pkg/acl/token.go +++ b/pkg/acl/token.go @@ -2,7 +2,6 @@ package acl import ( "github.com/golang-jwt/jwt/v4" - "gitlab.snapp.ir/dispatching/soteria/v3/internal/topics" ) type Claims struct { @@ -12,8 +11,8 @@ type Claims struct { } type Topic struct { - Type topics.Type `json:"type"` - AccessType AccessType `json:"access_type"` + Type string `json:"type"` + AccessType AccessType `json:"access_type"` } type Endpoint struct { diff --git a/pkg/user/user.go b/pkg/user/user.go index 1bf9e936..89fdbfda 100644 --- a/pkg/user/user.go +++ b/pkg/user/user.go @@ -1,7 +1,6 @@ package user import ( - "gitlab.snapp.ir/dispatching/soteria/v3/internal/topics" "gitlab.snapp.ir/dispatching/soteria/v3/pkg/acl" ) @@ -21,7 +20,7 @@ type User struct { // Rule tells about a access to a specific topic or endpoint. type Rule struct { - Topic topics.Type + Topic string Access acl.AccessType } @@ -31,7 +30,7 @@ func (u User) GetPrimaryKey() string { } // CheckTopicAllowance checks whether the user is allowed to pub/sub/pubsub to a topic or not. -func (u User) CheckTopicAllowance(topic topics.Type, accessType acl.AccessType) bool { +func (u User) CheckTopicAllowance(topic string, accessType acl.AccessType) bool { for _, rule := range u.Rules { if rule.Topic == topic && (rule.Access == acl.PubSub || rule.Access == accessType) { return true From 6c71015a60fe0e481b903373918593c9aaf751f3 Mon Sep 17 00:00:00 2001 From: Mehdi Date: Sun, 30 Jan 2022 09:54:47 +0330 Subject: [PATCH 142/660] feat: add topic and topic template --- internal/topics/topic.go | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 internal/topics/topic.go diff --git a/internal/topics/topic.go b/internal/topics/topic.go new file mode 100644 index 00000000..c77eb258 --- /dev/null +++ b/internal/topics/topic.go @@ -0,0 +1,28 @@ +package topics + +import ( + "regexp" + "strings" + "text/template" +) + +type Topic struct { + Type string `koanf:"type"` + Template string `koanf:"template"` + Regex string `koanf:"regex"` +} + +type Template struct { + Type string + Template *template.Template + Regex *regexp.Regexp +} + +func (t Template) Parse(fields map[string]string) string { + writer := new(strings.Builder) + err := t.Template.Execute(writer, fields) + if err != nil { + return "" + } + return writer.String() +} From ce8fa898a65530541909a467ba0d1a23bf939e6f Mon Sep 17 00:00:00 2001 From: Mehdi Date: Sun, 30 Jan 2022 09:55:16 +0330 Subject: [PATCH 143/660] feat: add topics to config --- internal/config/config.go | 25 +++++++-------- internal/config/default.go | 62 +++++++++++++++++++++++++++++++------- 2 files changed, 64 insertions(+), 23 deletions(-) diff --git a/internal/config/config.go b/internal/config/config.go index 6848dde9..19c0f009 100644 --- a/internal/config/config.go +++ b/internal/config/config.go @@ -4,6 +4,7 @@ import ( "crypto/rsa" "errors" "fmt" + "gitlab.snapp.ir/dispatching/soteria/v3/internal/topics" "io/ioutil" "log" "strings" @@ -28,18 +29,18 @@ const ( type ( // Config is the main container of Soteria's config. Config struct { - AllowedAccessTypes []string `koanf:"allowed_access_types"` - PassengerHashLength int `koanf:"passenger_hash_length"` - DriverHashLength int `koanf:"driver_hash_length"` - PassengerSalt string `koanf:"passenger_salt"` - DriverSalt string `koanf:"driver_salt"` - JWT *JWT `koanf:"jwt"` - Logger logger.Config `koanf:"logger"` - HTTPPort int `koanf:"http_port"` - Tracer tracing.Config `koanf:"tracer"` - Company string `koanf:"company"` - Users []user.User `koanf:"users"` - Topics map[string]string `koanf:"topics"` + AllowedAccessTypes []string `koanf:"allowed_access_types"` + PassengerHashLength int `koanf:"passenger_hash_length"` + DriverHashLength int `koanf:"driver_hash_length"` + PassengerSalt string `koanf:"passenger_salt"` + DriverSalt string `koanf:"driver_salt"` + JWT *JWT `koanf:"jwt"` + Logger logger.Config `koanf:"logger"` + HTTPPort int `koanf:"http_port"` + Tracer tracing.Config `koanf:"tracer"` + Company string `koanf:"company"` + Users []user.User `koanf:"users"` + Topics []topics.Topic `koanf:"topics"` } // JWt contains path of the keys for JWT encryption. diff --git a/internal/config/default.go b/internal/config/default.go index 6f9c142b..de3dd6bb 100644 --- a/internal/config/default.go +++ b/internal/config/default.go @@ -122,17 +122,57 @@ func Default() Config { }, }, }, - Topics: map[string]string{ - "cab_event": `(\w+)-event-[a-zA-Z0-9]+`, - "driver_location": `/driver/[a-zA-Z0-9]+/location`, - "passenger_location": `/passenger/[a-zA-Z0-9]+/location`, - "superapp_event": `/(driver|passenger)/[a-zA-Z0-9]+/(superapp)`, - "box_event": `bucks`, - "shared_location": `/(driver|passenger)/[a-zA-Z0-9]+/(driver-location|passenger-location)`, - "chat": `/(driver|passenger)/[a-zA-Z0-9]+/chat`, - "general_call_entry": `/(driver|passenger)/[a-zA-Z0-9]+/call/send`, - "node_call_entry": `/(driver|passenger)/[a-zA-Z0-9]+/call/[a-zA-Z0-9-]+/send`, - "call_outgoing": `/(driver|passenger)/[a-zA-Z0-9]+/call/receive`, + Topics: []topics.Topic{ + { + Type: "cab_event", + Template: "{{.audience}}-event-{{.hashId}}", + Regex: `(\w+)-event-[a-zA-Z0-9]+`, + }, + { + Type: "driver_location", + Template: "{{.company}}/driver/{{.hashId}}/location", + Regex: `/driver/[a-zA-Z0-9]+/location`, + }, + { + Type: "passenger_location", + Template: "{{.company}}/passenger/{{.hashId}}/location", + Regex: "/passenger/[a-zA-Z0-9]+/location", + }, + { + Type: "superapp_event", + Template: "{{.company}}/{{.audience}}/{{.hashId}}/superapp", + Regex: `/(driver|passenger)/[a-zA-Z0-9]+/(superapp)`, + }, + { + Type: "box_event", + Template: "bucks", + Regex: "bucks", + }, + { + Type: "shared_location", + Template: "{{.company}}/{{.audience}}/{{.hashId}}/{{.peer}}-location", + Regex: `/(driver|passenger)/[a-zA-Z0-9]+/(driver-location|passenger-location)`, + }, + { + Type: "chat", + Template: "{{.company}}/{{.audience}}/{{.hashId}}/chat", + Regex: `/(driver|passenger)/[a-zA-Z0-9]+/chat`, + }, + { + Type: "general_call_entry", + Template: "shared/{{.company}}/{{.audience}}/{{.hashId}}/call/send", + Regex: `/(driver|passenger)/[a-zA-Z0-9]+/call/send`, + }, + { + Type: "node_call_entry", + Template: "{{.company}}/{{.audience}}/{{.hashId}}/call/{{.node}}/send", + Regex: `/(driver|passenger)/[a-zA-Z0-9]+/call/[a-zA-Z0-9-]+/send`, + }, + { + Type: "call_outgoing", + Template: "{{.company}}/{{.audience}}/{{.hashId}}/call/receive", + Regex: `/(driver|passenger)/[a-zA-Z0-9]+/call/receive`, + }, }, } } From b95adaca7615b99f9002f312f000d8cc08c8cc36 Mon Sep 17 00:00:00 2001 From: Mehdi Date: Sun, 30 Jan 2022 09:57:47 +0330 Subject: [PATCH 144/660] feat: add topic manager --- internal/topics/t.go | 210 ++++++++++++++++++++++++++++++++----------- 1 file changed, 159 insertions(+), 51 deletions(-) diff --git a/internal/topics/t.go b/internal/topics/t.go index f8379bb7..10e29b59 100644 --- a/internal/topics/t.go +++ b/internal/topics/t.go @@ -1,73 +1,181 @@ package topics import ( + "crypto/md5" + "errors" + "fmt" + "gitlab.snapp.ir/dispatching/snappids/v2" + "gitlab.snapp.ir/dispatching/soteria/v3/pkg/user" "regexp" + "strconv" "strings" + "text/template" ) -type Topic string +const ( + CabEvent string = "cab_event" + DriverLocation = "driver_location" + PassengerLocation = "passenger_location" + SuperappEvent = "superapp_event" + BoxEvent = "box_event" + SharedLocation = "shared_location" + Chat = "chat" + GeneralCallEntry = "general_call_entry" + NodeCallEntry = "node_call_entry" + CallOutgoing = "call_outgoing" +) -type Type string +const ( + Driver string = "driver" + Passenger = "passenger" +) const ( - CabEvent Type = "cab_event" - DriverLocation Type = "driver_location" - PassengerLocation Type = "passenger_location" - SuperappEvent Type = "superapp_event" - BoxEvent Type = "box_event" - SharedLocation Type = "shared_location" - Chat Type = "chat" - GeneralCallEntry Type = "general_call_entry" - NodeCallEntry Type = "node_call_entry" - CallOutgoing Type = "call_outgoing" + // EmqCabHashPrefix is the default prefix for hashing part of cab topic, default value is 'emqch'. + EmqCabHashPrefix = "emqch" + // EmqSuperAppHashPrefix is the default prefix for hashing part of super app topic, default value is 'superapp'. + EmqSuperAppHashPrefix = "superapp" ) +var ErrDecodeHashID = errors.New("could not decode hash id") + // Topic regular expressions which are used for detecting the topic name. // topics are prefix with the company name will be trimed before matching // so they regular expressions should not contain the company prefix. -var ( - CabEventRegexp = regexp.MustCompile(`(\w+)-event-[a-zA-Z0-9]+`) - DriverLocationRegexp = regexp.MustCompile(`/driver/[a-zA-Z0-9]+/location`) - PassengerLocationRegexp = regexp.MustCompile(`/passenger/[a-zA-Z0-9]+/location`) - SuperappEventRegexp = regexp.MustCompile(`/(driver|passenger)/[a-zA-Z0-9]+/(superapp)`) - SharedLocationRegexp = regexp.MustCompile(`/(driver|passenger)/[a-zA-Z0-9]+/(driver-location|passenger-location)`) - ChatRegexp = regexp.MustCompile(`/(driver|passenger)/[a-zA-Z0-9]+/chat`) - GeneralCallEntryRegexp = regexp.MustCompile(`/(driver|passenger)/[a-zA-Z0-9]+/call/send`) - NodeCallEntryRegexp = regexp.MustCompile(`/(driver|passenger)/[a-zA-Z0-9]+/call/[a-zA-Z0-9-]+/send`) - CallOutgoingRegexp = regexp.MustCompile(`/(driver|passenger)/[a-zA-Z0-9]+/call/receive`) -) -func (t Topic) GetType() Type { - return t.GetTypeWithCompany("snapp") +type Manager struct { + HashIDSManager *snappids.HashIDSManager + Company string + TopicTemplates []Template +} + +// NewTopicManager returns a topic manager to validate topics. +func NewTopicManager(topicList []Topic, hashIDManager *snappids.HashIDSManager, company string) Manager { + templates := make([]Template, 0) + + for _, topic := range topicList { + each := Template{ + Type: topic.Type, + Template: template.Must(template.New(topic.Type).Parse(topic.Template)), + Regex: regexp.MustCompile(topic.Regex), + } + templates = append(templates, each) + } + + return Manager{ + HashIDSManager: hashIDManager, + Company: company, + TopicTemplates: templates, + } } -// nolint: cyclop -func (t Topic) GetTypeWithCompany(company string) Type { - topic := string(t) - topic = strings.TrimPrefix(topic, company) - - switch { - case CabEventRegexp.MatchString(topic): - return CabEvent - case DriverLocationRegexp.MatchString(topic): - return DriverLocation - case PassengerLocationRegexp.MatchString(topic): - return PassengerLocation - case SharedLocationRegexp.MatchString(topic): - return SharedLocation - case ChatRegexp.MatchString(topic): - return Chat - case GeneralCallEntryRegexp.MatchString(topic): - return GeneralCallEntry - case NodeCallEntryRegexp.MatchString(topic): - return NodeCallEntry - case CallOutgoingRegexp.MatchString(topic): - return CallOutgoing - case SuperappEventRegexp.MatchString(topic): - return SuperappEvent - case topic == "bucks": - return BoxEvent +func (t Manager) ValidateTopicBySender(topic string, issuer user.Issuer, sub string) bool { + topicTemplate, ok := t.GetTopicTemplate(topic, "snapp") + if !ok { + return false + } + + fields := make(map[string]string) + audience := issuerToAudienceStr(issuer) + fields["audience"] = audience + fields["company"] = t.Company + fields["peer"] = peerOfAudience(fields["audience"]) + + hashId, err := t.getHashId(topicTemplate.Type, sub, issuer) + if err != nil { + return false + } + fields["hashId"] = hashId + + if topicTemplate.Type == NodeCallEntry { + fields["node"] = strings.Split(topic, "/")[4] + } + + parsedTopic := topicTemplate.Parse(fields) + + return parsedTopic == topic +} + +func (t Manager) getHashId(topicType, sub string, issuer user.Issuer) (string, error) { + switch topicType { + case CabEvent, SuperappEvent: + id, err := t.HashIDSManager.DecodeHashID(sub, issuerToAudience(issuer)) + if err != nil { + return "", ErrDecodeHashID + } + + prefix := EmqCabHashPrefix + if topicType == SuperappEvent { + prefix = EmqSuperAppHashPrefix + } + hid := md5.Sum([]byte(fmt.Sprintf("%s-%s", prefix, strconv.Itoa(id)))) + return fmt.Sprintf("%x", hid), nil + default: + return sub, nil + } +} + +func (t Manager) GetTopicTemplate(input, company string) (Template, bool) { + topic := strings.TrimPrefix(input, company) + + for _, each := range t.TopicTemplates { + if each.Regex.MatchString(topic) { + return each, true + } + } + + return Template{}, false +} + +// IsTopicValid returns true if it finds a topic type for the given topic. +func (t Manager) IsTopicValid(topic string) bool { + return len(t.GetTopicType(topic, "snapp")) != 0 +} + +// GetTopicType finds topic type based on regexes. +func (t Manager) GetTopicType(input, company string) string { + topic := strings.TrimPrefix(input, company) + + for _, each := range t.TopicTemplates { + if each.Regex.MatchString(topic) { + return each.Type + } } return "" } + +// issuerToAudience returns corresponding audience in snappids form. +func issuerToAudience(issuer user.Issuer) snappids.Audience { + switch issuer { + case user.Passenger: + return snappids.PassengerAudience + case user.Driver: + return snappids.DriverAudience + default: + return -1 + } +} + +// issuerToAudienceStr returns corresponding audience in string form. +func issuerToAudienceStr(issuer user.Issuer) string { + switch issuer { + case user.Passenger: + return Passenger + case user.Driver: + return Driver + default: + return "" + } +} + +func peerOfAudience(audience string) string { + switch audience { + case Driver: + return Passenger + case Passenger: + return Driver + default: + return "" + } +} From 0d86c66f8ba303d6724e323876c8559cc0cab4c4 Mon Sep 17 00:00:00 2001 From: Mehdi Date: Sun, 30 Jan 2022 10:01:43 +0330 Subject: [PATCH 145/660] feat: add manager --- internal/api/acl.go | 7 +- internal/authenticator/authenticator.go | 99 ++------------------ internal/authenticator/authenticator_test.go | 15 ++- internal/cmd/serve/main.go | 4 +- internal/topics/t_test.go | 54 +++++++---- 5 files changed, 57 insertions(+), 122 deletions(-) diff --git a/internal/api/acl.go b/internal/api/acl.go index 19e84d98..8886d46b 100644 --- a/internal/api/acl.go +++ b/internal/api/acl.go @@ -7,7 +7,6 @@ import ( "github.com/gofiber/fiber/v2" "gitlab.snapp.ir/dispatching/soteria/v3/internal/app" "gitlab.snapp.ir/dispatching/soteria/v3/internal/authenticator" - "gitlab.snapp.ir/dispatching/soteria/v3/internal/topics" "gitlab.snapp.ir/dispatching/soteria/v3/pkg/acl" "go.opentelemetry.io/otel/attribute" "go.uber.org/zap" @@ -61,10 +60,10 @@ func ACL(c *fiber.Ctx) error { attribute.String("password", request.Username), ) - topic := topics.Topic(request.Topic) - topicType := topic.GetType() + topic := request.Topic + isTopicValid := app.GetInstance().Authenticator.TopicManager.IsTopicValid(topic) - if len(topicType) == 0 { + if !isTopicValid { zap.L(). Warn("acl bad request", zap.String("access", request.Access.String()), diff --git a/internal/authenticator/authenticator.go b/internal/authenticator/authenticator.go index 72629004..6b2714a8 100644 --- a/internal/authenticator/authenticator.go +++ b/internal/authenticator/authenticator.go @@ -4,12 +4,7 @@ import ( "crypto/rsa" "errors" "fmt" - "gitlab.snapp.ir/dispatching/soteria/v3/internal/app" - "regexp" - "strings" - "github.com/golang-jwt/jwt/v4" - "gitlab.snapp.ir/dispatching/snappids/v2" "gitlab.snapp.ir/dispatching/soteria/v3/internal/db" "gitlab.snapp.ir/dispatching/soteria/v3/internal/topics" "gitlab.snapp.ir/dispatching/soteria/v3/pkg/acl" @@ -33,11 +28,12 @@ type TopicNotAllowedError struct { Sub string AccessType acl.AccessType Topic string + TopicType string } func (err TopicNotAllowedError) Error() string { return fmt.Sprintf("issuer %s with sub %s is not allowed to %s on topic %s (%s)", - err.Issuer, err.Sub, err.AccessType, err.Topic, app.GetInstance().Authenticator.GetTopicType(err.Topic), + err.Issuer, err.Sub, err.AccessType, err.Topic, err.TopicType, ) } @@ -50,7 +46,7 @@ func (err PublicKeyNotFoundError) Error() string { } type InvalidTopicError struct { - Topic topics.Topic + Topic string } func (err InvalidTopicError) Error() string { @@ -62,10 +58,8 @@ type Authenticator struct { PublicKeys map[user.Issuer]*rsa.PublicKey AllowedAccessTypes []acl.AccessType ModelHandler db.ModelHandler - EMQTopicManager *snappids.EMQTopicManager - HashIDSManager *snappids.HashIDSManager + TopicManager topics.Manager Company string - Regexes map[string]*regexp.Regexp } // Auth check user authentication by checking the user's token @@ -105,7 +99,7 @@ func (a Authenticator) Auth(tokenString string) (err error) { func (a Authenticator) ACL( accessType acl.AccessType, tokenString string, - topic topics.Topic, + topic string, ) (bool, error) { if !a.ValidateAccessType(accessType) { return false, ErrInvalidAccessType @@ -160,18 +154,13 @@ func (a Authenticator) ACL( user := a.ModelHandler.Get(pk) - id, err := a.HashIDSManager.DecodeHashID(sub, issuerToAudience(issuer)) - if err != nil { - return false, ErrDecodeHashID - } - - if !a.ValidateTopicBySender(topic, issuerToAudience(issuer), id) { + if !a.TopicManager.ValidateTopicBySender(topic, issuer, sub) { return false, InvalidTopicError{Topic: topic} } - if ok := user.CheckTopicAllowance(topic.GetTypeWithCompany(a.Company), accessType); !ok { + if ok := user.CheckTopicAllowance(a.TopicManager.GetTopicType(topic, a.Company), accessType); !ok { return false, - TopicNotAllowedError{issuer, sub, accessType, topic} + TopicNotAllowedError{issuer, sub, accessType, topic, a.TopicManager.GetTopicType(topic, "snapp")} } return true, nil @@ -196,75 +185,3 @@ func primaryKey(issuer user.Issuer, sub string) string { return sub } - -func (a Authenticator) ValidateTopicBySender(topic topics.Topic, audience snappids.Audience, id int) bool { - var ch snappids.Topic - - switch topic.GetType() { - case topics.CabEvent: - ch, _ = a.EMQTopicManager.CreateCabEventTopic(id, audience) - case topics.DriverLocation, topics.PassengerLocation: - ch, _ = a.EMQTopicManager.CreateLocationTopic(id, audience) - case topics.SuperappEvent: - ch, _ = a.EMQTopicManager.CreateSuperAppEventTopic(id, audience) - case topics.SharedLocation: - ch, _ = a.EMQTopicManager.CreateSharedLocationTopic(id, audience) - case topics.Chat: - ch, _ = a.EMQTopicManager.CreateChatTopic(id, audience) - case topics.GeneralCallEntry: - ch, _ = a.EMQTopicManager.CreateGeneralCallEntryTopic(id, audience) - case topics.NodeCallEntry: - node := strings.Split(string(topic), "/")[4] - ch, _ = a.EMQTopicManager.CreateNodeCallEntryTopic(id, audience, node) - case topics.CallOutgoing: - ch, _ = a.EMQTopicManager.CreateCallOutgoingTopic(id, audience) - case topics.BoxEvent: - return true - } - - return string(ch) == string(topic) -} - -func issuerToAudience(issuer user.Issuer) snappids.Audience { - switch issuer { - case user.Passenger: - return snappids.PassengerAudience - case user.Driver: - return snappids.DriverAudience - default: - return -1 - } -} - -// IsTopicValid returns true if it finds a topic type for the given topic. -func (a Authenticator) IsTopicValid(topic string) bool { - return len(a.GetTopicType(topic)) != 0 -} - -// GetTopicType find topic type based on regexes. -func (a Authenticator) GetTopicType(topic string) string { - return a.GetTopicTypeByCompany(topic, "snapp") -} - -func (a Authenticator) GetTopicTypeByCompany(topic, company string) string { - topic = strings.TrimPrefix(topic, company) - - for key, regex := range a.Regexes { - if regex.MatchString(topic) { - return key - } - } - - return "" -} - -// CompileTopicsRegexes compile topic regex template reading from config. -func CompileTopicsRegexes(topics map[string]string) map[string]*regexp.Regexp { - regexes := make(map[string]*regexp.Regexp) - - for key, template := range topics { - regexes[key] = regexp.MustCompile(template) - } - - return regexes -} diff --git a/internal/authenticator/authenticator_test.go b/internal/authenticator/authenticator_test.go index cf9ace94..5ec79dc2 100644 --- a/internal/authenticator/authenticator_test.go +++ b/internal/authenticator/authenticator_test.go @@ -3,6 +3,7 @@ package authenticator_test import ( "crypto/rsa" "fmt" + "gitlab.snapp.ir/dispatching/soteria/v3/internal/config" "io/ioutil" "testing" "time" @@ -119,6 +120,8 @@ func TestAuthenticator_Acl(t *testing.T) { t.Fatal(err) } + cfg := config.New() + hid := &snappids.HashIDSManager{ Salts: map[snappids.Audience]string{ snappids.PassengerAudience: "secret", @@ -139,8 +142,8 @@ func TestAuthenticator_Acl(t *testing.T) { }, AllowedAccessTypes: []acl.AccessType{acl.Pub, acl.Sub, acl.PubSub}, ModelHandler: MockModelHandler{}, - EMQTopicManager: snappids.NewEMQManager(hid), - HashIDSManager: hid, + Company: "snapp", + TopicManager: topics.NewTopicManager(cfg.Topics, hid, "snapp"), } t.Run("testing acl with invalid access type", func(t *testing.T) { ok, err := auth.ACL("invalid-access", passengerToken, "test") @@ -331,16 +334,18 @@ func TestAuthenticator_ValidateTopicBySender(t *testing.T) { }, } + cfg := config.New() + // nolint: exhaustivestruct authenticator := authenticator.Authenticator{ AllowedAccessTypes: []acl.AccessType{acl.Pub, acl.Sub}, ModelHandler: MockModelHandler{}, - EMQTopicManager: snappids.NewEMQManager(hid), - HashIDSManager: hid, + Company: "snapp", + TopicManager: topics.NewTopicManager(cfg.Topics, hid, "snapp"), } t.Run("testing valid driver cab event", func(t *testing.T) { - ok := authenticator.ValidateTopicBySender(validDriverCabEventTopic, snappids.DriverAudience, 123) + ok := authenticator.TopicManager.ValidateTopicBySender(validDriverCabEventTopic, user.Driver, "DXKgaNQa7N5Y7bo") assert.True(t, ok) }) } diff --git a/internal/cmd/serve/main.go b/internal/cmd/serve/main.go index c01b375e..b14c7668 100644 --- a/internal/cmd/serve/main.go +++ b/internal/cmd/serve/main.go @@ -4,6 +4,7 @@ import ( "crypto/rsa" "errors" "fmt" + "gitlab.snapp.ir/dispatching/soteria/v3/internal/topics" "net/http" "os" "os/signal" @@ -54,9 +55,8 @@ func main(cfg config.Config, logger *zap.Logger, tracer trace.Tracer) { }, AllowedAccessTypes: allowedAccessTypes, ModelHandler: db.NewInternal(cfg.Users), - HashIDSManager: hid, - EMQTopicManager: snappids.NewEMQManagerWithCompany(hid, cfg.Company), Company: cfg.Company, + TopicManager: topics.NewTopicManager(cfg.Topics, hid, cfg.Company), }) app.GetInstance().SetTracer(tracer) diff --git a/internal/topics/t_test.go b/internal/topics/t_test.go index 32434c0a..d0ca0e53 100644 --- a/internal/topics/t_test.go +++ b/internal/topics/t_test.go @@ -1,25 +1,28 @@ -package topics +package topics_test import ( "fmt" + "gitlab.snapp.ir/dispatching/soteria/v3/internal/authenticator" + "gitlab.snapp.ir/dispatching/soteria/v3/internal/config" + "gitlab.snapp.ir/dispatching/soteria/v3/internal/topics" "testing" ) func TestTopic_GetType(t1 *testing.T) { tests := []struct { name string - arg Topic - want Type + arg string + want string }{ { name: "testing cab event", - arg: Topic("passenger-event-123456789abcdefgABCDEFG"), - want: CabEvent, + arg: "passenger-event-123456789abcdefgABCDEFG", + want: topics.CabEvent, }, { name: "testing cab event", arg: "driver-event-123456789abcdefgABCDEFG", - want: CabEvent, + want: topics.CabEvent, }, { name: "testing invalid event", @@ -29,12 +32,12 @@ func TestTopic_GetType(t1 *testing.T) { { name: "testing driver location", arg: "snapp/driver/sfhsdkifs475sfhs/location", - want: DriverLocation, + want: topics.DriverLocation, }, { name: "testing passenger location", arg: "snapp/passenger/sfhsdkifs475sfhs/location", - want: PassengerLocation, + want: topics.PassengerLocation, }, { name: "testing invalid location", @@ -44,63 +47,74 @@ func TestTopic_GetType(t1 *testing.T) { { name: "testing superapp event", arg: "snapp/passenger/fhdyfuiksdf5456456adljada/superapp", - want: SuperappEvent, + want: topics.SuperappEvent, }, { name: "testing shared passenger location", arg: "snapp/passenger/py9kdjLYB35RP4q/driver-location", - want: SharedLocation, + want: topics.SharedLocation, }, { name: "testing shared driver location", arg: "snapp/driver/py9kdjLYB35RP4q/passenger-location", - want: SharedLocation, + want: topics.SharedLocation, }, { name: "testing passenger chat", arg: "snapp/passenger/py9kdjLYB35RP4q/chat", - want: Chat, + want: topics.Chat, }, { name: "testing driver chat", arg: "snapp/driver/py9kdjLYB35RP4q/chat", - want: Chat, + want: topics.Chat, }, { name: "testing passenger general call entry", arg: "shared/snapp/passenger/py9kdjLYB35RP4q/call/send", - want: GeneralCallEntry, + want: topics.GeneralCallEntry, }, { name: "testing driver general call entry", arg: "shared/snapp/driver/py9kdjLYB35RP4q/call/send", - want: GeneralCallEntry, + want: topics.GeneralCallEntry, }, { name: "testing passenger node call entry", arg: "snapp/passenger/py9kdjLYB35RP4q/call/heliograph-0/send", - want: NodeCallEntry, + want: topics.NodeCallEntry, }, { name: "testing driver node call entry", arg: "snapp/driver/py9kdjLYB35RP4q/call/heliograph-1/send", - want: NodeCallEntry, + want: topics.NodeCallEntry, }, { name: "testing passenger call", arg: "snapp/passenger/py9kdjLYB35RP4q/call/receive", - want: CallOutgoing, + want: topics.CallOutgoing, }, { name: "testing driver call", arg: "snapp/driver/py9kdjLYB35RP4q/call/receive", - want: CallOutgoing, + want: topics.CallOutgoing, + }, + { + name: "testing box event", + arg: "bucks", + want: topics.BoxEvent, }, } + + cfg := config.New() + auth := authenticator.Authenticator{ + TopicManager: topics.NewTopicManager(cfg.Topics, nil, "snapp"), + } + for i, tt := range tests { t1.Run(fmt.Sprintf("#%d %s", i, tt.name), func(t1 *testing.T) { t := tt.arg - if got := t.GetType(); got != tt.want { + if got := auth.TopicManager.GetTopicType(t, "snapp"); got != tt.want { t1.Errorf("GetType() = %v, want %v", got, tt.want) } }) From 4f7507def14dd4cdb7db6210e30298665eef2435 Mon Sep 17 00:00:00 2001 From: Mehdi Date: Mon, 31 Jan 2022 10:19:46 +0330 Subject: [PATCH 146/660] feat: apply linter suggestions --- internal/authenticator/authenticator.go | 2 +- internal/cmd/serve/main.go | 2 +- internal/config/config.go | 2 +- internal/topics/t.go | 44 ++++++++++++++----------- internal/topics/topic.go | 2 ++ 5 files changed, 29 insertions(+), 23 deletions(-) diff --git a/internal/authenticator/authenticator.go b/internal/authenticator/authenticator.go index 6b2714a8..93c9761c 100644 --- a/internal/authenticator/authenticator.go +++ b/internal/authenticator/authenticator.go @@ -148,7 +148,7 @@ func (a Authenticator) ACL( return false, ErrSubNotFound } - sub := fmt.Sprintf("%v", claims["sub"]) + sub, _ := claims["sub"].(string) pk := primaryKey(issuer, sub) diff --git a/internal/cmd/serve/main.go b/internal/cmd/serve/main.go index b14c7668..10131d32 100644 --- a/internal/cmd/serve/main.go +++ b/internal/cmd/serve/main.go @@ -4,7 +4,6 @@ import ( "crypto/rsa" "errors" "fmt" - "gitlab.snapp.ir/dispatching/soteria/v3/internal/topics" "net/http" "os" "os/signal" @@ -16,6 +15,7 @@ import ( "gitlab.snapp.ir/dispatching/soteria/v3/internal/authenticator" "gitlab.snapp.ir/dispatching/soteria/v3/internal/config" "gitlab.snapp.ir/dispatching/soteria/v3/internal/db" + "gitlab.snapp.ir/dispatching/soteria/v3/internal/topics" "gitlab.snapp.ir/dispatching/soteria/v3/pkg/user" "go.opentelemetry.io/otel/trace" "go.uber.org/zap" diff --git a/internal/config/config.go b/internal/config/config.go index 19c0f009..4f0a23be 100644 --- a/internal/config/config.go +++ b/internal/config/config.go @@ -4,7 +4,6 @@ import ( "crypto/rsa" "errors" "fmt" - "gitlab.snapp.ir/dispatching/soteria/v3/internal/topics" "io/ioutil" "log" "strings" @@ -16,6 +15,7 @@ import ( "github.com/knadh/koanf/providers/file" "github.com/knadh/koanf/providers/structs" "gitlab.snapp.ir/dispatching/soteria/v3/internal/logger" + "gitlab.snapp.ir/dispatching/soteria/v3/internal/topics" "gitlab.snapp.ir/dispatching/soteria/v3/internal/tracing" "gitlab.snapp.ir/dispatching/soteria/v3/pkg/acl" "gitlab.snapp.ir/dispatching/soteria/v3/pkg/user" diff --git a/internal/topics/t.go b/internal/topics/t.go index 10e29b59..0db700f2 100644 --- a/internal/topics/t.go +++ b/internal/topics/t.go @@ -1,33 +1,34 @@ package topics import ( - "crypto/md5" + "crypto/md5" // nolint:gosec "errors" "fmt" - "gitlab.snapp.ir/dispatching/snappids/v2" - "gitlab.snapp.ir/dispatching/soteria/v3/pkg/user" "regexp" "strconv" "strings" "text/template" + + "gitlab.snapp.ir/dispatching/snappids/v2" + "gitlab.snapp.ir/dispatching/soteria/v3/pkg/user" ) const ( CabEvent string = "cab_event" - DriverLocation = "driver_location" - PassengerLocation = "passenger_location" - SuperappEvent = "superapp_event" - BoxEvent = "box_event" - SharedLocation = "shared_location" - Chat = "chat" - GeneralCallEntry = "general_call_entry" - NodeCallEntry = "node_call_entry" - CallOutgoing = "call_outgoing" + DriverLocation string = "driver_location" + PassengerLocation string = "passenger_location" + SuperappEvent string = "superapp_event" + BoxEvent string = "box_event" + SharedLocation string = "shared_location" + Chat string = "chat" + GeneralCallEntry string = "general_call_entry" + NodeCallEntry string = "node_call_entry" + CallOutgoing string = "call_outgoing" ) const ( Driver string = "driver" - Passenger = "passenger" + Passenger string = "passenger" ) const ( @@ -81,11 +82,12 @@ func (t Manager) ValidateTopicBySender(topic string, issuer user.Issuer, sub str fields["company"] = t.Company fields["peer"] = peerOfAudience(fields["audience"]) - hashId, err := t.getHashId(topicTemplate.Type, sub, issuer) + hashID, err := t.getHashID(topicTemplate.Type, sub, issuer) if err != nil { return false } - fields["hashId"] = hashId + + fields["hashId"] = hashID if topicTemplate.Type == NodeCallEntry { fields["node"] = strings.Split(topic, "/")[4] @@ -96,7 +98,7 @@ func (t Manager) ValidateTopicBySender(topic string, issuer user.Issuer, sub str return parsedTopic == topic } -func (t Manager) getHashId(topicType, sub string, issuer user.Issuer) (string, error) { +func (t Manager) getHashID(topicType, sub string, issuer user.Issuer) (string, error) { switch topicType { case CabEvent, SuperappEvent: id, err := t.HashIDSManager.DecodeHashID(sub, issuerToAudience(issuer)) @@ -108,23 +110,25 @@ func (t Manager) getHashId(topicType, sub string, issuer user.Issuer) (string, e if topicType == SuperappEvent { prefix = EmqSuperAppHashPrefix } - hid := md5.Sum([]byte(fmt.Sprintf("%s-%s", prefix, strconv.Itoa(id)))) + + hid := md5.Sum([]byte(fmt.Sprintf("%s-%s", prefix, strconv.Itoa(id)))) // nolint:gosec + return fmt.Sprintf("%x", hid), nil default: return sub, nil } } -func (t Manager) GetTopicTemplate(input, company string) (Template, bool) { +func (t Manager) GetTopicTemplate(input, company string) (*Template, bool) { topic := strings.TrimPrefix(input, company) for _, each := range t.TopicTemplates { if each.Regex.MatchString(topic) { - return each, true + return &each, true } } - return Template{}, false + return nil, false } // IsTopicValid returns true if it finds a topic type for the given topic. diff --git a/internal/topics/topic.go b/internal/topics/topic.go index c77eb258..3d6aa7a1 100644 --- a/internal/topics/topic.go +++ b/internal/topics/topic.go @@ -20,9 +20,11 @@ type Template struct { func (t Template) Parse(fields map[string]string) string { writer := new(strings.Builder) + err := t.Template.Execute(writer, fields) if err != nil { return "" } + return writer.String() } From 1e8b58f2f6372fff96ad0e5d38630b4c58af74e9 Mon Sep 17 00:00:00 2001 From: Mehdi Date: Mon, 31 Jan 2022 10:22:39 +0330 Subject: [PATCH 147/660] fix: remove hardcoded company --- internal/authenticator/authenticator.go | 4 ++-- internal/topics/t.go | 12 ++++++------ internal/topics/t_test.go | 3 ++- 3 files changed, 10 insertions(+), 9 deletions(-) diff --git a/internal/authenticator/authenticator.go b/internal/authenticator/authenticator.go index 93c9761c..02813bd5 100644 --- a/internal/authenticator/authenticator.go +++ b/internal/authenticator/authenticator.go @@ -158,9 +158,9 @@ func (a Authenticator) ACL( return false, InvalidTopicError{Topic: topic} } - if ok := user.CheckTopicAllowance(a.TopicManager.GetTopicType(topic, a.Company), accessType); !ok { + if ok := user.CheckTopicAllowance(a.TopicManager.GetTopicType(topic), accessType); !ok { return false, - TopicNotAllowedError{issuer, sub, accessType, topic, a.TopicManager.GetTopicType(topic, "snapp")} + TopicNotAllowedError{issuer, sub, accessType, topic, a.TopicManager.GetTopicType(topic)} } return true, nil diff --git a/internal/topics/t.go b/internal/topics/t.go index 0db700f2..c0646e37 100644 --- a/internal/topics/t.go +++ b/internal/topics/t.go @@ -71,7 +71,7 @@ func NewTopicManager(topicList []Topic, hashIDManager *snappids.HashIDSManager, } func (t Manager) ValidateTopicBySender(topic string, issuer user.Issuer, sub string) bool { - topicTemplate, ok := t.GetTopicTemplate(topic, "snapp") + topicTemplate, ok := t.GetTopicTemplate(topic) if !ok { return false } @@ -119,8 +119,8 @@ func (t Manager) getHashID(topicType, sub string, issuer user.Issuer) (string, e } } -func (t Manager) GetTopicTemplate(input, company string) (*Template, bool) { - topic := strings.TrimPrefix(input, company) +func (t Manager) GetTopicTemplate(input string) (*Template, bool) { + topic := strings.TrimPrefix(input, t.Company) for _, each := range t.TopicTemplates { if each.Regex.MatchString(topic) { @@ -133,12 +133,12 @@ func (t Manager) GetTopicTemplate(input, company string) (*Template, bool) { // IsTopicValid returns true if it finds a topic type for the given topic. func (t Manager) IsTopicValid(topic string) bool { - return len(t.GetTopicType(topic, "snapp")) != 0 + return len(t.GetTopicType(topic)) != 0 } // GetTopicType finds topic type based on regexes. -func (t Manager) GetTopicType(input, company string) string { - topic := strings.TrimPrefix(input, company) +func (t Manager) GetTopicType(input string) string { + topic := strings.TrimPrefix(input, t.Company) for _, each := range t.TopicTemplates { if each.Regex.MatchString(topic) { diff --git a/internal/topics/t_test.go b/internal/topics/t_test.go index d0ca0e53..767e8268 100644 --- a/internal/topics/t_test.go +++ b/internal/topics/t_test.go @@ -108,13 +108,14 @@ func TestTopic_GetType(t1 *testing.T) { cfg := config.New() auth := authenticator.Authenticator{ + Company: "snapp", TopicManager: topics.NewTopicManager(cfg.Topics, nil, "snapp"), } for i, tt := range tests { t1.Run(fmt.Sprintf("#%d %s", i, tt.name), func(t1 *testing.T) { t := tt.arg - if got := auth.TopicManager.GetTopicType(t, "snapp"); got != tt.want { + if got := auth.TopicManager.GetTopicType(t); got != tt.want { t1.Errorf("GetType() = %v, want %v", got, tt.want) } }) From 5c01c33720ab15a6d74f0eb0bb61e9467a381c5b Mon Sep 17 00:00:00 2001 From: Mehdi Date: Mon, 31 Jan 2022 10:30:34 +0330 Subject: [PATCH 148/660] fix: remove superapp-event hashID calculation superapp events are not published on emq yet. hence, we prevent them from using md5 for hashID. supperapp-event must use hashID library like other topics. --- internal/topics/t.go | 22 ++++++---------------- 1 file changed, 6 insertions(+), 16 deletions(-) diff --git a/internal/topics/t.go b/internal/topics/t.go index c0646e37..f8134ab6 100644 --- a/internal/topics/t.go +++ b/internal/topics/t.go @@ -31,12 +31,8 @@ const ( Passenger string = "passenger" ) -const ( - // EmqCabHashPrefix is the default prefix for hashing part of cab topic, default value is 'emqch'. - EmqCabHashPrefix = "emqch" - // EmqSuperAppHashPrefix is the default prefix for hashing part of super app topic, default value is 'superapp'. - EmqSuperAppHashPrefix = "superapp" -) +// EmqCabHashPrefix is the default prefix for hashing part of cab topic, default value is 'emqch'. +const EmqCabHashPrefix = "emqch" var ErrDecodeHashID = errors.New("could not decode hash id") @@ -99,24 +95,18 @@ func (t Manager) ValidateTopicBySender(topic string, issuer user.Issuer, sub str } func (t Manager) getHashID(topicType, sub string, issuer user.Issuer) (string, error) { - switch topicType { - case CabEvent, SuperappEvent: + if topicType == CabEvent { id, err := t.HashIDSManager.DecodeHashID(sub, issuerToAudience(issuer)) if err != nil { return "", ErrDecodeHashID } - prefix := EmqCabHashPrefix - if topicType == SuperappEvent { - prefix = EmqSuperAppHashPrefix - } - - hid := md5.Sum([]byte(fmt.Sprintf("%s-%s", prefix, strconv.Itoa(id)))) // nolint:gosec + hid := md5.Sum([]byte(fmt.Sprintf("%s-%s", EmqCabHashPrefix, strconv.Itoa(id)))) // nolint:gosec return fmt.Sprintf("%x", hid), nil - default: - return sub, nil } + + return sub, nil } func (t Manager) GetTopicTemplate(input string) (*Template, bool) { From af219f2e407b77fa676d96644fc60534d0fcad26 Mon Sep 17 00:00:00 2001 From: Mehdi Date: Mon, 31 Jan 2022 15:51:41 +0330 Subject: [PATCH 149/660] feat: add none issuer for test --- pkg/user/user.go | 1 + 1 file changed, 1 insertion(+) diff --git a/pkg/user/user.go b/pkg/user/user.go index 89fdbfda..eefbd5c2 100644 --- a/pkg/user/user.go +++ b/pkg/user/user.go @@ -10,6 +10,7 @@ type Issuer string const ( Driver Issuer = "0" Passenger Issuer = "1" + None = "-1" ) // User is Soteria's users db model. From e42b50f73ab3192752718f50e21e924c3c8c7545 Mon Sep 17 00:00:00 2001 From: Mehdi Date: Mon, 31 Jan 2022 15:52:14 +0330 Subject: [PATCH 150/660] feat: add none access type for test --- pkg/acl/acl.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/pkg/acl/acl.go b/pkg/acl/acl.go index 82bc8282..06516cea 100644 --- a/pkg/acl/acl.go +++ b/pkg/acl/acl.go @@ -5,8 +5,9 @@ type AccessType string const ( Sub AccessType = "1" - Pub AccessType = "2" - PubSub AccessType = "3" + Pub = "2" + PubSub = "3" + None = "-1" ClientCredentials = "client_credentials" ) From 1e5dd7732c39a189535ef16e2d096233e5585e47 Mon Sep 17 00:00:00 2001 From: Mehdi Date: Mon, 31 Jan 2022 15:52:41 +0330 Subject: [PATCH 151/660] feat: delete extra check --- internal/api/acl.go | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/internal/api/acl.go b/internal/api/acl.go index 8886d46b..3850fe1a 100644 --- a/internal/api/acl.go +++ b/internal/api/acl.go @@ -61,20 +61,6 @@ func ACL(c *fiber.Ctx) error { ) topic := request.Topic - isTopicValid := app.GetInstance().Authenticator.TopicManager.IsTopicValid(topic) - - if !isTopicValid { - zap.L(). - Warn("acl bad request", - zap.String("access", request.Access.String()), - zap.String("topic", request.Topic), - zap.String("token", request.Token), - zap.String("username", request.Password), - zap.String("password", request.Username), - ) - - return c.Status(http.StatusBadRequest).SendString("bad request") - } ok, err := app.GetInstance().Authenticator.ACL(request.Access, tokenString, topic) if err != nil || !ok { From 9d7db07ceec3a1ca1f0d26bac3b5c8c8edd61461 Mon Sep 17 00:00:00 2001 From: Mehdi Date: Mon, 31 Jan 2022 15:54:05 +0330 Subject: [PATCH 152/660] feat: add hash type --- internal/topics/topic.go | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/internal/topics/topic.go b/internal/topics/topic.go index 3d6aa7a1..9d21c2cf 100644 --- a/internal/topics/topic.go +++ b/internal/topics/topic.go @@ -1,11 +1,18 @@ package topics import ( - "regexp" "strings" "text/template" ) +// HashType topic hashID type. +type HashType int + +const ( + HashID HashType = iota + MD5 +) + type Topic struct { Type string `koanf:"type"` Template string `koanf:"template"` From 319bed64872eee1857cf03b3b2eb483516d48465 Mon Sep 17 00:00:00 2001 From: Mehdi Date: Mon, 31 Jan 2022 15:54:29 +0330 Subject: [PATCH 153/660] feat: add access on topics --- internal/topics/topic.go | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/internal/topics/topic.go b/internal/topics/topic.go index 9d21c2cf..a51b03c8 100644 --- a/internal/topics/topic.go +++ b/internal/topics/topic.go @@ -3,6 +3,8 @@ package topics import ( "strings" "text/template" + + "gitlab.snapp.ir/dispatching/soteria/v3/pkg/acl" ) // HashType topic hashID type. @@ -14,15 +16,17 @@ const ( ) type Topic struct { - Type string `koanf:"type"` - Template string `koanf:"template"` - Regex string `koanf:"regex"` + Type string `koanf:"type"` + Template string `koanf:"template"` + HashType HashType `koanf:"hash_type"` + Accesses map[string]acl.AccessType } type Template struct { Type string Template *template.Template - Regex *regexp.Regexp + HashType HashType `koanf:"hash_type"` + Accesses map[string]acl.AccessType } func (t Template) Parse(fields map[string]string) string { From 47111cf6fe586b2814bb492a1c00bb276cfeb85c Mon Sep 17 00:00:00 2001 From: Mehdi Date: Mon, 31 Jan 2022 15:55:19 +0330 Subject: [PATCH 154/660] feat: add hasAccess function --- internal/topics/topic.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/internal/topics/topic.go b/internal/topics/topic.go index a51b03c8..03c04ff4 100644 --- a/internal/topics/topic.go +++ b/internal/topics/topic.go @@ -39,3 +39,9 @@ func (t Template) Parse(fields map[string]string) string { return writer.String() } + +// HasAccess check if user has access on topic. +func (t Template) HasAccess(audience string, accessType acl.AccessType) bool { + access := t.Accesses[audience] + return access == acl.PubSub || access == accessType +} From 80eab8c028d25de2a85f727da9fc42cd5e1112e9 Mon Sep 17 00:00:00 2001 From: Mehdi Date: Mon, 31 Jan 2022 15:56:59 +0330 Subject: [PATCH 155/660] feat: update topic validation and access check --- internal/authenticator/authenticator.go | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/internal/authenticator/authenticator.go b/internal/authenticator/authenticator.go index 02813bd5..58765f8a 100644 --- a/internal/authenticator/authenticator.go +++ b/internal/authenticator/authenticator.go @@ -150,17 +150,21 @@ func (a Authenticator) ACL( sub, _ := claims["sub"].(string) - pk := primaryKey(issuer, sub) + audience, audienceStr := topics.IssuerToAudience(issuer) - user := a.ModelHandler.Get(pk) - - if !a.TopicManager.ValidateTopicBySender(topic, issuer, sub) { + topicTemplate := a.TopicManager.ValidateTopic(topic, audienceStr, audience, sub) + if topicTemplate == nil { return false, InvalidTopicError{Topic: topic} } - if ok := user.CheckTopicAllowance(a.TopicManager.GetTopicType(topic), accessType); !ok { - return false, - TopicNotAllowedError{issuer, sub, accessType, topic, a.TopicManager.GetTopicType(topic)} + if !topicTemplate.HasAccess(audienceStr, accessType) { + return false, TopicNotAllowedError{ + issuer, + sub, + accessType, + topic, + topicTemplate.Type, + } } return true, nil From c0897349e139fdae74a5ca1becf966c2ca438b89 Mon Sep 17 00:00:00 2001 From: Mehdi Date: Mon, 31 Jan 2022 15:57:38 +0330 Subject: [PATCH 156/660] feat: update tests based on authenticator --- internal/authenticator/authenticator_test.go | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/internal/authenticator/authenticator_test.go b/internal/authenticator/authenticator_test.go index 5ec79dc2..754a0a0e 100644 --- a/internal/authenticator/authenticator_test.go +++ b/internal/authenticator/authenticator_test.go @@ -10,7 +10,7 @@ import ( "github.com/golang-jwt/jwt/v4" "github.com/stretchr/testify/assert" - snappids "gitlab.snapp.ir/dispatching/snappids/v2" + "gitlab.snapp.ir/dispatching/snappids/v2" "gitlab.snapp.ir/dispatching/soteria/v3/internal/authenticator" "gitlab.snapp.ir/dispatching/soteria/v3/internal/topics" "gitlab.snapp.ir/dispatching/soteria/v3/pkg/acl" @@ -28,11 +28,11 @@ const ( validDriverLocationTopic = "snapp/driver/DXKgaNQa7N5Y7bo/location" invalidDriverLocationTopic = "snapp/driver/DXKgaNQa9Q5Y7bo/location" - validPassengerSuperappEventTopic = "snapp/passenger/0956923be632d673560af9adadd2f78a/superapp" - invalidPassengerSuperappEventTopic = "snapp/passenger/0959623be632d673560af9adadd2f78a/superapp" + validPassengerSuperappEventTopic = "snapp/passenger/DXKgaNQa7N5Y7bo/superapp" + invalidPassengerSuperappEventTopic = "snapp/passenger/DXKgaNQa9Q5Y7bo/superapp" - validDriverSuperappEventTopic = "snapp/driver/0956923be632d673560af9adadd2f78a/superapp" - invalidDriverSuperappEventTopic = "snapp/driver/0596923be632d673560af9adadd2f78a/superapp" + validDriverSuperappEventTopic = "snapp/driver/DXKgaNQa7N5Y7bo/superapp" + invalidDriverSuperappEventTopic = "snapp/driver/DXKgaNQa9Q5Y7bo/superapp" validDriverSharedTopic = "snapp/driver/DXKgaNQa7N5Y7bo/passenger-location" validPassengerSharedTopic = "snapp/passenger/DXKgaNQa7N5Y7bo/driver-location" @@ -345,8 +345,9 @@ func TestAuthenticator_ValidateTopicBySender(t *testing.T) { } t.Run("testing valid driver cab event", func(t *testing.T) { - ok := authenticator.TopicManager.ValidateTopicBySender(validDriverCabEventTopic, user.Driver, "DXKgaNQa7N5Y7bo") - assert.True(t, ok) + audience, audienceStr := topics.IssuerToAudience(user.Driver) + topicTemplate := authenticator.TopicManager.ValidateTopic(validDriverCabEventTopic, audienceStr, audience, "DXKgaNQa7N5Y7bo") + assert.True(t, topicTemplate != nil) }) } From 10b2cd5a5d58a4a2cd7ba79cfd64119154ed6742 Mon Sep 17 00:00:00 2001 From: Mehdi Date: Mon, 31 Jan 2022 16:00:20 +0330 Subject: [PATCH 157/660] fix: update TopicManager constructor --- internal/topics/t.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/internal/topics/t.go b/internal/topics/t.go index f8134ab6..41b6fbaf 100644 --- a/internal/topics/t.go +++ b/internal/topics/t.go @@ -54,7 +54,8 @@ func NewTopicManager(topicList []Topic, hashIDManager *snappids.HashIDSManager, each := Template{ Type: topic.Type, Template: template.Must(template.New(topic.Type).Parse(topic.Template)), - Regex: regexp.MustCompile(topic.Regex), + HashType: topic.HashType, + Accesses: topic.Accesses, } templates = append(templates, each) } From 51d5584ced942f75209de40ad78347bb36badeff Mon Sep 17 00:00:00 2001 From: Mehdi Date: Mon, 31 Jan 2022 16:01:29 +0330 Subject: [PATCH 158/660] fix: return hash base on hashType --- internal/topics/t.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/internal/topics/t.go b/internal/topics/t.go index 41b6fbaf..5c81feaa 100644 --- a/internal/topics/t.go +++ b/internal/topics/t.go @@ -95,9 +95,9 @@ func (t Manager) ValidateTopicBySender(topic string, issuer user.Issuer, sub str return parsedTopic == topic } -func (t Manager) getHashID(topicType, sub string, issuer user.Issuer) (string, error) { - if topicType == CabEvent { - id, err := t.HashIDSManager.DecodeHashID(sub, issuerToAudience(issuer)) +func (t Manager) getHashID(hashType HashType, sub string, audience snappids.Audience) (string, error) { + if hashType == MD5 { + id, err := t.HashIDSManager.DecodeHashID(sub, audience) if err != nil { return "", ErrDecodeHashID } From 4283fcc975b2852139d570e14bcf2191ff12bdfd Mon Sep 17 00:00:00 2001 From: Mehdi Date: Mon, 31 Jan 2022 16:02:05 +0330 Subject: [PATCH 159/660] fix: delete getTopicTemplate function --- internal/topics/t.go | 34 ++-------------------------------- 1 file changed, 2 insertions(+), 32 deletions(-) diff --git a/internal/topics/t.go b/internal/topics/t.go index 5c81feaa..12fe8a5d 100644 --- a/internal/topics/t.go +++ b/internal/topics/t.go @@ -110,38 +110,8 @@ func (t Manager) getHashID(hashType HashType, sub string, audience snappids.Audi return sub, nil } -func (t Manager) GetTopicTemplate(input string) (*Template, bool) { - topic := strings.TrimPrefix(input, t.Company) - - for _, each := range t.TopicTemplates { - if each.Regex.MatchString(topic) { - return &each, true - } - } - - return nil, false -} - -// IsTopicValid returns true if it finds a topic type for the given topic. -func (t Manager) IsTopicValid(topic string) bool { - return len(t.GetTopicType(topic)) != 0 -} - -// GetTopicType finds topic type based on regexes. -func (t Manager) GetTopicType(input string) string { - topic := strings.TrimPrefix(input, t.Company) - - for _, each := range t.TopicTemplates { - if each.Regex.MatchString(topic) { - return each.Type - } - } - - return "" -} - -// issuerToAudience returns corresponding audience in snappids form. -func issuerToAudience(issuer user.Issuer) snappids.Audience { +// IssuerToAudience returns corresponding audience in snappids form. +func IssuerToAudience(issuer user.Issuer) (snappids.Audience, string) { switch issuer { case user.Passenger: return snappids.PassengerAudience From 98cd2a688835b42282fb665a6ce06a88a483e368 Mon Sep 17 00:00:00 2001 From: Mehdi Date: Mon, 31 Jan 2022 16:02:52 +0330 Subject: [PATCH 160/660] fix: merge 2 issuerToAudience functions --- internal/topics/t.go | 18 +++--------------- 1 file changed, 3 insertions(+), 15 deletions(-) diff --git a/internal/topics/t.go b/internal/topics/t.go index 12fe8a5d..d11ec194 100644 --- a/internal/topics/t.go +++ b/internal/topics/t.go @@ -114,23 +114,11 @@ func (t Manager) getHashID(hashType HashType, sub string, audience snappids.Audi func IssuerToAudience(issuer user.Issuer) (snappids.Audience, string) { switch issuer { case user.Passenger: - return snappids.PassengerAudience + return snappids.PassengerAudience, Passenger case user.Driver: - return snappids.DriverAudience + return snappids.DriverAudience, Driver default: - return -1 - } -} - -// issuerToAudienceStr returns corresponding audience in string form. -func issuerToAudienceStr(issuer user.Issuer) string { - switch issuer { - case user.Passenger: - return Passenger - case user.Driver: - return Driver - default: - return "" + return -1, "" } } From 283e6209a1ca233ef3272eb6bfabca16a77e9246 Mon Sep 17 00:00:00 2001 From: Mehdi Date: Mon, 31 Jan 2022 16:10:22 +0330 Subject: [PATCH 161/660] feat: update validateTopic function now, validateTopic only validate topics once. --- internal/topics/t.go | 41 ++++++++++++++++++++++------------------- 1 file changed, 22 insertions(+), 19 deletions(-) diff --git a/internal/topics/t.go b/internal/topics/t.go index d11ec194..dadff6a1 100644 --- a/internal/topics/t.go +++ b/internal/topics/t.go @@ -67,32 +67,35 @@ func NewTopicManager(topicList []Topic, hashIDManager *snappids.HashIDSManager, } } -func (t Manager) ValidateTopicBySender(topic string, issuer user.Issuer, sub string) bool { - topicTemplate, ok := t.GetTopicTemplate(topic) - if !ok { - return false - } - +// ValidateTopic checks if a topic is valid based on the given parameters. +func (t Manager) ValidateTopic(topic string, audienceStr string, audience snappids.Audience, sub string) *Template { fields := make(map[string]string) - audience := issuerToAudienceStr(issuer) - fields["audience"] = audience + fields["audience"] = audienceStr fields["company"] = t.Company - fields["peer"] = peerOfAudience(fields["audience"]) + fields["peer"] = peerOfAudience(audienceStr) - hashID, err := t.getHashID(topicTemplate.Type, sub, issuer) - if err != nil { - return false - } + for _, topicTemplate := range t.TopicTemplates { + hashID, err := t.getHashID(topicTemplate.HashType, sub, audience) + if err != nil { + return nil + } - fields["hashId"] = hashID + fields["hashId"] = hashID - if topicTemplate.Type == NodeCallEntry { - fields["node"] = strings.Split(topic, "/")[4] - } + regex := new(strings.Builder) + err = topicTemplate.Template.Execute(regex, fields) + if err != nil { + return nil + } - parsedTopic := topicTemplate.Parse(fields) + // TODO: must be the exact topic + // if didn't match go to next template + if regexp.MustCompile(regex.String()).MatchString(topic) { + return &topicTemplate + } + } - return parsedTopic == topic + return nil } func (t Manager) getHashID(hashType HashType, sub string, audience snappids.Audience) (string, error) { From d1ebb02866767b136d2fb3341ce92ce63183770d Mon Sep 17 00:00:00 2001 From: Mehdi Date: Mon, 31 Jan 2022 16:12:30 +0330 Subject: [PATCH 162/660] refactor: rename --- internal/topics/{t.go => manager.go} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename internal/topics/{t.go => manager.go} (100%) diff --git a/internal/topics/t.go b/internal/topics/manager.go similarity index 100% rename from internal/topics/t.go rename to internal/topics/manager.go From bb025728237e0d79ff32ae0f5f93d1e543842ad2 Mon Sep 17 00:00:00 2001 From: Mehdi Date: Mon, 31 Jan 2022 16:12:57 +0330 Subject: [PATCH 163/660] fix: rename & update tests based on manager --- internal/topics/manager_test.go | 169 ++++++++++++++++++++++++++++++++ internal/topics/t_test.go | 123 ----------------------- 2 files changed, 169 insertions(+), 123 deletions(-) create mode 100644 internal/topics/manager_test.go delete mode 100644 internal/topics/t_test.go diff --git a/internal/topics/manager_test.go b/internal/topics/manager_test.go new file mode 100644 index 00000000..64396b10 --- /dev/null +++ b/internal/topics/manager_test.go @@ -0,0 +1,169 @@ +package topics_test + +import ( + "fmt" + "gitlab.snapp.ir/dispatching/snappids/v2" + "gitlab.snapp.ir/dispatching/soteria/v3/internal/authenticator" + "gitlab.snapp.ir/dispatching/soteria/v3/internal/config" + "gitlab.snapp.ir/dispatching/soteria/v3/internal/topics" + "gitlab.snapp.ir/dispatching/soteria/v3/pkg/user" + "testing" +) + +func TestTopic_GetType(t1 *testing.T) { + tests := []struct { + name string + arg string + issuer user.Issuer + want string + }{ + { + name: "testing cab event", + arg: "passenger-event-152384980615c2bd16143cff29038b67", + issuer: user.Passenger, + want: topics.CabEvent, + }, + { + name: "testing cab event", + arg: "driver-event-152384980615c2bd16143cff29038b67", + issuer: user.Driver, + want: topics.CabEvent, + }, + { + name: "testing invalid event", + arg: "-event-123456789abcdefgABCDEFG", + issuer: user.None, + want: "", + }, + { + name: "testing driver location", + arg: "snapp/driver/DXKgaNQa7N5Y7bo/location", + issuer: user.Driver, + want: topics.DriverLocation, + }, + { + name: "testing passenger location", + arg: "snapp/passenger/DXKgaNQa7N5Y7bo/location", + issuer: user.Passenger, + want: topics.PassengerLocation, + }, + { + name: "testing invalid location", + arg: "snapp/thirdparty/DXKgaNQa7N5Y7bo/location", + issuer: user.None, + want: "", + }, + { + name: "testing superapp event", + arg: "snapp/passenger/DXKgaNQa7N5Y7bo/superapp", + issuer: user.Passenger, + want: topics.SuperappEvent, + }, + { + name: "testing shared passenger location", + arg: "snapp/passenger/DXKgaNQa7N5Y7bo/driver-location", + issuer: user.Passenger, + want: topics.SharedLocation, + }, + { + name: "testing shared driver location", + arg: "snapp/driver/DXKgaNQa7N5Y7bo/passenger-location", + issuer: user.Driver, + want: topics.SharedLocation, + }, + { + name: "testing passenger chat", + arg: "snapp/passenger/DXKgaNQa7N5Y7bo/chat", + issuer: user.Passenger, + want: topics.Chat, + }, + { + name: "testing driver chat", + arg: "snapp/driver/DXKgaNQa7N5Y7bo/chat", + issuer: user.Driver, + want: topics.Chat, + }, + { + name: "testing passenger general call entry", + arg: "shared/snapp/passenger/DXKgaNQa7N5Y7bo/call/send", + issuer: user.Passenger, + want: topics.GeneralCallEntry, + }, + { + name: "testing driver general call entry", + arg: "shared/snapp/driver/DXKgaNQa7N5Y7bo/call/send", + issuer: user.Driver, + want: topics.GeneralCallEntry, + }, + { + name: "testing passenger node call entry", + arg: "snapp/passenger/DXKgaNQa7N5Y7bo/call/heliograph-0/send", + issuer: user.Passenger, + want: topics.NodeCallEntry, + }, + { + name: "testing driver node call entry", + arg: "snapp/driver/DXKgaNQa7N5Y7bo/call/heliograph-1/send", + issuer: user.Driver, + want: topics.NodeCallEntry, + }, + { + name: "testing passenger call", + arg: "snapp/passenger/DXKgaNQa7N5Y7bo/call/receive", + issuer: user.Passenger, + want: topics.CallOutgoing, + }, + { + name: "testing driver call", + arg: "snapp/driver/DXKgaNQa7N5Y7bo/call/receive", + issuer: user.Driver, + want: topics.CallOutgoing, + }, + { + name: "testing box event", + arg: "bucks", + issuer: user.Driver, + want: topics.BoxEvent, + }, + } + + cfg := config.New() + + hid := &snappids.HashIDSManager{ + Salts: map[snappids.Audience]string{ + snappids.PassengerAudience: "secret", + snappids.DriverAudience: "secret", + snappids.ThirdPartyAudience: "secret", + }, + Lengths: map[snappids.Audience]int{ + snappids.PassengerAudience: 15, + snappids.DriverAudience: 15, + snappids.ThirdPartyAudience: 15, + }, + } + auth := authenticator.Authenticator{ + Company: "snapp", + TopicManager: topics.NewTopicManager(cfg.Topics, hid, "snapp"), + } + + sub := "DXKgaNQa7N5Y7bo" + + for i, tt := range tests { + t1.Run(fmt.Sprintf("#%d %s", i, tt.name), func(t1 *testing.T) { + t := tt.arg + audience, audienceStr := topics.IssuerToAudience(tt.issuer) + topicTemplate := auth.TopicManager.ValidateTopic(t, audienceStr, audience, sub) + if topicTemplate != nil { + if len(tt.want) == 0 { + t1.Errorf("topic %s is invalid, must throw error.", tt.arg) + } else if topicTemplate.Type != tt.want { + t1.Errorf("GetType() = %v, want %v", topicTemplate.Type, tt.want) + } + } else { + if len(tt.want) != 0 { + t1.Errorf("failed to find topicTemplate for %s", tt.arg) + } + } + }) + } +} diff --git a/internal/topics/t_test.go b/internal/topics/t_test.go deleted file mode 100644 index 767e8268..00000000 --- a/internal/topics/t_test.go +++ /dev/null @@ -1,123 +0,0 @@ -package topics_test - -import ( - "fmt" - "gitlab.snapp.ir/dispatching/soteria/v3/internal/authenticator" - "gitlab.snapp.ir/dispatching/soteria/v3/internal/config" - "gitlab.snapp.ir/dispatching/soteria/v3/internal/topics" - "testing" -) - -func TestTopic_GetType(t1 *testing.T) { - tests := []struct { - name string - arg string - want string - }{ - { - name: "testing cab event", - arg: "passenger-event-123456789abcdefgABCDEFG", - want: topics.CabEvent, - }, - { - name: "testing cab event", - arg: "driver-event-123456789abcdefgABCDEFG", - want: topics.CabEvent, - }, - { - name: "testing invalid event", - arg: "-event-123456789abcdefgABCDEFG", - want: "", - }, - { - name: "testing driver location", - arg: "snapp/driver/sfhsdkifs475sfhs/location", - want: topics.DriverLocation, - }, - { - name: "testing passenger location", - arg: "snapp/passenger/sfhsdkifs475sfhs/location", - want: topics.PassengerLocation, - }, - { - name: "testing invalid location", - arg: "snapp/thirdparty/sfhsdkifs475sfhs/location", - want: "", - }, - { - name: "testing superapp event", - arg: "snapp/passenger/fhdyfuiksdf5456456adljada/superapp", - want: topics.SuperappEvent, - }, - { - name: "testing shared passenger location", - arg: "snapp/passenger/py9kdjLYB35RP4q/driver-location", - want: topics.SharedLocation, - }, - { - name: "testing shared driver location", - arg: "snapp/driver/py9kdjLYB35RP4q/passenger-location", - want: topics.SharedLocation, - }, - { - name: "testing passenger chat", - arg: "snapp/passenger/py9kdjLYB35RP4q/chat", - want: topics.Chat, - }, - { - name: "testing driver chat", - arg: "snapp/driver/py9kdjLYB35RP4q/chat", - want: topics.Chat, - }, - { - name: "testing passenger general call entry", - arg: "shared/snapp/passenger/py9kdjLYB35RP4q/call/send", - want: topics.GeneralCallEntry, - }, - { - name: "testing driver general call entry", - arg: "shared/snapp/driver/py9kdjLYB35RP4q/call/send", - want: topics.GeneralCallEntry, - }, - { - name: "testing passenger node call entry", - arg: "snapp/passenger/py9kdjLYB35RP4q/call/heliograph-0/send", - want: topics.NodeCallEntry, - }, - { - name: "testing driver node call entry", - arg: "snapp/driver/py9kdjLYB35RP4q/call/heliograph-1/send", - want: topics.NodeCallEntry, - }, - { - name: "testing passenger call", - arg: "snapp/passenger/py9kdjLYB35RP4q/call/receive", - want: topics.CallOutgoing, - }, - { - name: "testing driver call", - arg: "snapp/driver/py9kdjLYB35RP4q/call/receive", - want: topics.CallOutgoing, - }, - { - name: "testing box event", - arg: "bucks", - want: topics.BoxEvent, - }, - } - - cfg := config.New() - auth := authenticator.Authenticator{ - Company: "snapp", - TopicManager: topics.NewTopicManager(cfg.Topics, nil, "snapp"), - } - - for i, tt := range tests { - t1.Run(fmt.Sprintf("#%d %s", i, tt.name), func(t1 *testing.T) { - t := tt.arg - if got := auth.TopicManager.GetTopicType(t); got != tt.want { - t1.Errorf("GetType() = %v, want %v", got, tt.want) - } - }) - } -} From 9ddeb386cc44cf71676e75db3ea389e621048556 Mon Sep 17 00:00:00 2001 From: Mehdi Date: Mon, 31 Jan 2022 16:13:24 +0330 Subject: [PATCH 164/660] feat: add hashType and accesses to topics --- internal/config/default.go | 62 +++++++++++++++++++++++++++++++------- 1 file changed, 51 insertions(+), 11 deletions(-) diff --git a/internal/config/default.go b/internal/config/default.go index de3dd6bb..efdb6903 100644 --- a/internal/config/default.go +++ b/internal/config/default.go @@ -126,52 +126,92 @@ func Default() Config { { Type: "cab_event", Template: "{{.audience}}-event-{{.hashId}}", - Regex: `(\w+)-event-[a-zA-Z0-9]+`, + HashType: topics.MD5, + Accesses: map[string]acl.AccessType{ + topics.Driver: acl.Sub, + topics.Passenger: acl.Sub, + }, }, { Type: "driver_location", Template: "{{.company}}/driver/{{.hashId}}/location", - Regex: `/driver/[a-zA-Z0-9]+/location`, + HashType: topics.HashID, + Accesses: map[string]acl.AccessType{ + topics.Driver: acl.Pub, + topics.Passenger: acl.None, + }, }, { Type: "passenger_location", Template: "{{.company}}/passenger/{{.hashId}}/location", - Regex: "/passenger/[a-zA-Z0-9]+/location", + HashType: topics.HashID, + Accesses: map[string]acl.AccessType{ + topics.Driver: acl.Pub, + topics.Passenger: acl.Pub, + }, }, { Type: "superapp_event", Template: "{{.company}}/{{.audience}}/{{.hashId}}/superapp", - Regex: `/(driver|passenger)/[a-zA-Z0-9]+/(superapp)`, + HashType: topics.HashID, + Accesses: map[string]acl.AccessType{ + topics.Driver: acl.Sub, + topics.Passenger: acl.Sub, + }, }, { Type: "box_event", Template: "bucks", - Regex: "bucks", + HashType: topics.HashID, + Accesses: map[string]acl.AccessType{ + topics.Driver: acl.None, + topics.Passenger: acl.None, + }, }, { Type: "shared_location", Template: "{{.company}}/{{.audience}}/{{.hashId}}/{{.peer}}-location", - Regex: `/(driver|passenger)/[a-zA-Z0-9]+/(driver-location|passenger-location)`, + HashType: topics.HashID, + Accesses: map[string]acl.AccessType{ + topics.Driver: acl.Sub, + topics.Passenger: acl.Sub, + }, }, { Type: "chat", Template: "{{.company}}/{{.audience}}/{{.hashId}}/chat", - Regex: `/(driver|passenger)/[a-zA-Z0-9]+/chat`, + HashType: topics.HashID, + Accesses: map[string]acl.AccessType{ + topics.Driver: acl.Sub, + topics.Passenger: acl.Sub, + }, }, { Type: "general_call_entry", Template: "shared/{{.company}}/{{.audience}}/{{.hashId}}/call/send", - Regex: `/(driver|passenger)/[a-zA-Z0-9]+/call/send`, + HashType: topics.HashID, + Accesses: map[string]acl.AccessType{ + topics.Driver: acl.Pub, + topics.Passenger: acl.Pub, + }, }, { Type: "node_call_entry", - Template: "{{.company}}/{{.audience}}/{{.hashId}}/call/{{.node}}/send", - Regex: `/(driver|passenger)/[a-zA-Z0-9]+/call/[a-zA-Z0-9-]+/send`, + Template: "{{.company}}/{{.audience}}/{{.hashId}}/call/[a-zA-Z0-9-]+/send", + HashType: topics.HashID, + Accesses: map[string]acl.AccessType{ + topics.Driver: acl.Pub, + topics.Passenger: acl.Pub, + }, }, { Type: "call_outgoing", Template: "{{.company}}/{{.audience}}/{{.hashId}}/call/receive", - Regex: `/(driver|passenger)/[a-zA-Z0-9]+/call/receive`, + HashType: topics.HashID, + Accesses: map[string]acl.AccessType{ + topics.Driver: acl.Sub, + topics.Passenger: acl.Sub, + }, }, }, } From 56c9bafdda53615069a814864091557122670493 Mon Sep 17 00:00:00 2001 From: Mehdi Date: Mon, 31 Jan 2022 16:22:14 +0330 Subject: [PATCH 165/660] refactor: remove extra code --- internal/authenticator/authenticator.go | 2 - internal/authenticator/authenticator_test.go | 94 -------------------- internal/cmd/serve/main.go | 2 - internal/config/config.go | 1 - internal/config/default.go | 81 ----------------- internal/db/models.go | 30 ------- pkg/user/user.go | 32 ------- 7 files changed, 242 deletions(-) delete mode 100644 internal/db/models.go diff --git a/internal/authenticator/authenticator.go b/internal/authenticator/authenticator.go index 58765f8a..ff2f28f8 100644 --- a/internal/authenticator/authenticator.go +++ b/internal/authenticator/authenticator.go @@ -5,7 +5,6 @@ import ( "errors" "fmt" "github.com/golang-jwt/jwt/v4" - "gitlab.snapp.ir/dispatching/soteria/v3/internal/db" "gitlab.snapp.ir/dispatching/soteria/v3/internal/topics" "gitlab.snapp.ir/dispatching/soteria/v3/pkg/acl" "gitlab.snapp.ir/dispatching/soteria/v3/pkg/user" @@ -57,7 +56,6 @@ func (err InvalidTopicError) Error() string { type Authenticator struct { PublicKeys map[user.Issuer]*rsa.PublicKey AllowedAccessTypes []acl.AccessType - ModelHandler db.ModelHandler TopicManager topics.Manager Company string } diff --git a/internal/authenticator/authenticator_test.go b/internal/authenticator/authenticator_test.go index 754a0a0e..3ae9611a 100644 --- a/internal/authenticator/authenticator_test.go +++ b/internal/authenticator/authenticator_test.go @@ -83,7 +83,6 @@ func TestAuthenticator_Auth(t *testing.T) { user.Driver: pkey0, user.Passenger: pkey1, }, - ModelHandler: MockModelHandler{}, } t.Run("testing driver token auth", func(t *testing.T) { @@ -141,7 +140,6 @@ func TestAuthenticator_Acl(t *testing.T) { user.Passenger: pkey1, }, AllowedAccessTypes: []acl.AccessType{acl.Pub, acl.Sub, acl.PubSub}, - ModelHandler: MockModelHandler{}, Company: "snapp", TopicManager: topics.NewTopicManager(cfg.Topics, hid, "snapp"), } @@ -339,7 +337,6 @@ func TestAuthenticator_ValidateTopicBySender(t *testing.T) { // nolint: exhaustivestruct authenticator := authenticator.Authenticator{ AllowedAccessTypes: []acl.AccessType{acl.Pub, acl.Sub}, - ModelHandler: MockModelHandler{}, Company: "snapp", TopicManager: topics.NewTopicManager(cfg.Topics, hid, "snapp"), } @@ -438,97 +435,6 @@ func TestAuthenticator_validateAccessType(t *testing.T) { } } -type MockModelHandler struct{} - -func (rmh MockModelHandler) Get(pk string) user.User { - var u user.User - - switch pk { - case "passenger": - u = user.User{ - Username: string(user.Passenger), - Rules: []user.Rule{ - { - Topic: topics.CabEvent, - Access: acl.Sub, - }, - { - Topic: topics.SuperappEvent, - Access: acl.Sub, - }, - { - Topic: topics.PassengerLocation, - Access: acl.Pub, - }, - { - Topic: topics.SharedLocation, - Access: acl.Sub, - }, - { - Topic: topics.Chat, - Access: acl.Sub, - }, - { - Topic: topics.GeneralCallEntry, - Access: acl.Pub, - }, - { - Topic: topics.NodeCallEntry, - Access: acl.Pub, - }, - { - Topic: topics.CallOutgoing, - Access: acl.Sub, - }, - }, - } - case "driver": - u = user.User{ - Username: string(user.Driver), - Rules: []user.Rule{ - { - Topic: topics.DriverLocation, - Access: acl.Pub, - }, - { - Topic: topics.CabEvent, - Access: acl.Sub, - }, - { - Topic: topics.SuperappEvent, - Access: acl.Sub, - }, - { - Topic: topics.PassengerLocation, - Access: acl.Pub, - }, - { - Topic: topics.SharedLocation, - Access: acl.Sub, - }, - { - Topic: topics.Chat, - Access: acl.Sub, - }, - { - Topic: topics.GeneralCallEntry, - Access: acl.Pub, - }, - { - Topic: topics.NodeCallEntry, - Access: acl.Pub, - }, - { - Topic: topics.CallOutgoing, - Access: acl.Sub, - }, - }, - } - } - - return u -} - func getPublicKey(u user.Issuer) (*rsa.PublicKey, error) { var fileName string diff --git a/internal/cmd/serve/main.go b/internal/cmd/serve/main.go index 10131d32..19eba455 100644 --- a/internal/cmd/serve/main.go +++ b/internal/cmd/serve/main.go @@ -14,7 +14,6 @@ import ( "gitlab.snapp.ir/dispatching/soteria/v3/internal/app" "gitlab.snapp.ir/dispatching/soteria/v3/internal/authenticator" "gitlab.snapp.ir/dispatching/soteria/v3/internal/config" - "gitlab.snapp.ir/dispatching/soteria/v3/internal/db" "gitlab.snapp.ir/dispatching/soteria/v3/internal/topics" "gitlab.snapp.ir/dispatching/soteria/v3/pkg/user" "go.opentelemetry.io/otel/trace" @@ -54,7 +53,6 @@ func main(cfg config.Config, logger *zap.Logger, tracer trace.Tracer) { user.Passenger: publicKey1, }, AllowedAccessTypes: allowedAccessTypes, - ModelHandler: db.NewInternal(cfg.Users), Company: cfg.Company, TopicManager: topics.NewTopicManager(cfg.Topics, hid, cfg.Company), }) diff --git a/internal/config/config.go b/internal/config/config.go index 4f0a23be..bf8ff76a 100644 --- a/internal/config/config.go +++ b/internal/config/config.go @@ -39,7 +39,6 @@ type ( HTTPPort int `koanf:"http_port"` Tracer tracing.Config `koanf:"tracer"` Company string `koanf:"company"` - Users []user.User `koanf:"users"` Topics []topics.Topic `koanf:"topics"` } diff --git a/internal/config/default.go b/internal/config/default.go index efdb6903..afeded8f 100644 --- a/internal/config/default.go +++ b/internal/config/default.go @@ -5,7 +5,6 @@ import ( "gitlab.snapp.ir/dispatching/soteria/v3/internal/topics" "gitlab.snapp.ir/dispatching/soteria/v3/internal/tracing" "gitlab.snapp.ir/dispatching/soteria/v3/pkg/acl" - "gitlab.snapp.ir/dispatching/soteria/v3/pkg/user" ) const ( @@ -42,86 +41,6 @@ func Default() Config { }, }, Company: "snapp", - Users: []user.User{ - { - Username: string(user.Driver), - Rules: []user.Rule{ - { - Topic: topics.DriverLocation, - Access: acl.Pub, - }, - { - Topic: topics.CabEvent, - Access: acl.Sub, - }, - { - Topic: topics.SuperappEvent, - Access: acl.Sub, - }, - { - Topic: topics.PassengerLocation, - Access: acl.Pub, - }, - { - Topic: topics.SharedLocation, - Access: acl.Sub, - }, - { - Topic: topics.Chat, - Access: acl.Sub, - }, - { - Topic: topics.GeneralCallEntry, - Access: acl.Pub, - }, - { - Topic: topics.NodeCallEntry, - Access: acl.Pub, - }, - { - Topic: topics.CallOutgoing, - Access: acl.Sub, - }, - }, - }, - { - Username: string(user.Passenger), - Rules: []user.Rule{ - { - Topic: topics.CabEvent, - Access: acl.Sub, - }, - { - Topic: topics.SuperappEvent, - Access: acl.Sub, - }, - { - Topic: topics.PassengerLocation, - Access: acl.Pub, - }, - { - Topic: topics.SharedLocation, - Access: acl.Sub, - }, - { - Topic: topics.Chat, - Access: acl.Sub, - }, - { - Topic: topics.GeneralCallEntry, - Access: acl.Pub, - }, - { - Topic: topics.NodeCallEntry, - Access: acl.Pub, - }, - { - Topic: topics.CallOutgoing, - Access: acl.Sub, - }, - }, - }, - }, Topics: []topics.Topic{ { Type: "cab_event", diff --git a/internal/db/models.go b/internal/db/models.go deleted file mode 100644 index 32136776..00000000 --- a/internal/db/models.go +++ /dev/null @@ -1,30 +0,0 @@ -package db - -import ( - "gitlab.snapp.ir/dispatching/soteria/v3/pkg/user" -) - -type ModelHandler interface { - Get(pk string) user.User -} - -type InternalModelHanlder struct { - users []user.User -} - -func NewInternal(users []user.User) InternalModelHanlder { - return InternalModelHanlder{ - users: users, - } -} - -func (model InternalModelHanlder) Get(pk string) user.User { - for _, user := range model.users { - if user.Username == pk { - return user - } - } - - // nolint: exhaustivestruct - return user.User{} -} diff --git a/pkg/user/user.go b/pkg/user/user.go index eefbd5c2..087ac6ca 100644 --- a/pkg/user/user.go +++ b/pkg/user/user.go @@ -1,9 +1,5 @@ package user -import ( - "gitlab.snapp.ir/dispatching/soteria/v3/pkg/acl" -) - // Issuer indicate issuers. type Issuer string @@ -12,31 +8,3 @@ const ( Passenger Issuer = "1" None = "-1" ) - -// User is Soteria's users db model. -type User struct { - Username string - Rules []Rule -} - -// Rule tells about a access to a specific topic or endpoint. -type Rule struct { - Topic string - Access acl.AccessType -} - -// GetPrimaryKey is for knowing a model primary key. -func (u User) GetPrimaryKey() string { - return u.Username -} - -// CheckTopicAllowance checks whether the user is allowed to pub/sub/pubsub to a topic or not. -func (u User) CheckTopicAllowance(topic string, accessType acl.AccessType) bool { - for _, rule := range u.Rules { - if rule.Topic == topic && (rule.Access == acl.PubSub || rule.Access == accessType) { - return true - } - } - - return false -} From ed1bd6aed64ae0ce494ff1210764b6c226840b60 Mon Sep 17 00:00:00 2001 From: Mehdi Date: Mon, 31 Jan 2022 16:22:57 +0330 Subject: [PATCH 166/660] refactor: remove extra code --- pkg/user/user.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/user/user.go b/pkg/user/user.go index 087ac6ca..88f8c76e 100644 --- a/pkg/user/user.go +++ b/pkg/user/user.go @@ -5,6 +5,6 @@ type Issuer string const ( Driver Issuer = "0" - Passenger Issuer = "1" + Passenger = "1" None = "-1" ) From 2c501181a6eebfe21f4837046d7e005f8d7bf784 Mon Sep 17 00:00:00 2001 From: Mehdi Date: Mon, 31 Jan 2022 16:28:21 +0330 Subject: [PATCH 167/660] refactor: add docs --- internal/topics/manager.go | 3 +++ pkg/acl/acl.go | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/internal/topics/manager.go b/internal/topics/manager.go index dadff6a1..e4c9cabc 100644 --- a/internal/topics/manager.go +++ b/internal/topics/manager.go @@ -98,6 +98,9 @@ func (t Manager) ValidateTopic(topic string, audienceStr string, audience snappi return nil } +// getHashID calculate hashID based on hashType. +// most of the topics have hashID type for their hashIDs but some old topics have different hashTypes. +// if hashType is equal to hashID, sub is returned without any changes. func (t Manager) getHashID(hashType HashType, sub string, audience snappids.Audience) (string, error) { if hashType == MD5 { id, err := t.HashIDSManager.DecodeHashID(sub, audience) diff --git a/pkg/acl/acl.go b/pkg/acl/acl.go index 06516cea..cf687c01 100644 --- a/pkg/acl/acl.go +++ b/pkg/acl/acl.go @@ -1,6 +1,6 @@ package acl -// Access Types for EMQ contains subscribe, publish and publish-subscribe. +// AccessType Types for EMQ contains subscribe, publish and publish-subscribe. type AccessType string const ( From 1793a5052175096da335cfc591d7ceec790096b9 Mon Sep 17 00:00:00 2001 From: Mehdi Date: Mon, 31 Jan 2022 16:30:49 +0330 Subject: [PATCH 168/660] fix: add koanf annotation --- internal/topics/topic.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/internal/topics/topic.go b/internal/topics/topic.go index 03c04ff4..82f6379b 100644 --- a/internal/topics/topic.go +++ b/internal/topics/topic.go @@ -16,10 +16,10 @@ const ( ) type Topic struct { - Type string `koanf:"type"` - Template string `koanf:"template"` - HashType HashType `koanf:"hash_type"` - Accesses map[string]acl.AccessType + Type string `koanf:"type"` + Template string `koanf:"template"` + HashType HashType `koanf:"hash_type"` + Accesses map[string]acl.AccessType `koanf:"accesses"` } type Template struct { From f8aac0ee18cdc03aeb907b92b862049b32964c20 Mon Sep 17 00:00:00 2001 From: Mehdi Date: Mon, 31 Jan 2022 16:40:07 +0330 Subject: [PATCH 169/660] feat: add topics to chart --- deployments/soteria/templates/configmap.yaml | 4 +- deployments/soteria/values.yaml | 102 +++++++++++-------- 2 files changed, 63 insertions(+), 43 deletions(-) diff --git a/deployments/soteria/templates/configmap.yaml b/deployments/soteria/templates/configmap.yaml index c4273705..5dcffad8 100644 --- a/deployments/soteria/templates/configmap.yaml +++ b/deployments/soteria/templates/configmap.yaml @@ -32,7 +32,7 @@ data: {{ with .Values.envs.company }} company: {{ . }} {{ end }} - {{ with .Values.users }} - users: + {{ with .Values.topics }} + topics: {{ toYaml . | nindent 8 }} {{ end }} diff --git a/deployments/soteria/values.yaml b/deployments/soteria/values.yaml index 73dd4fc7..e9791b0e 100644 --- a/deployments/soteria/values.yaml +++ b/deployments/soteria/values.yaml @@ -77,44 +77,64 @@ envs: # company: "baly" logger_level: "warn" -users: - - username: driver - rules: - - topic: cab_event - access: '1' - - topic: driver_location - access: '2' - - topic: shared_location - access: '1' - - topic: superapp_event - access: '1' - - topic: node_call_entry - access: '2' - - topic: general_call_entry - access: '2' - - topic: call_outgoing - access: '1' - - topic: chat - access: '1' - - topic: chat - access: '2' - - username: passenger - rules: - - topic: cab_event - access: '1' - - topic: superapp_event - access: '1' - - topic: passenger_location - access: '2' - - topic: shared_location - access: '1' - - topic: node_call_entry - access: '2' - - topic: general_call_entry - access: '2' - - topic: call_outgoing - access: '1' - - topic: chat - access: '1' - - topic: chat - access: '2' +topics: + - type: cab_event + template: {{.audience}}-event-{{.hashId}} + hash_type: 1 + accesses: + driver: '1' + passenger: '1' + - type: driver_location + template: {{.company}}/driver/{{.hashId}}/location + hash_type: 0 + accesses: + driver: '2' + passenger: '-1' + - type: passenger_location + template: {{.company}}/passenger/{{.hashId}}/location + hash_type: 0 + accesses: + driver: '2' + passenger: '2' + - type: superapp_event + template: {{.company}}/{{.audience}}/{{.hashId}}/superapp + hash_type: 0 + accesses: + driver: '1' + passenger: '1' + - type: box_event + template: bucks + hash_type: 0 + accesses: + driver: '-1' + passenger: '-1' + - type: shared_location + template: bucks + hash_type: 0 + accesses: + driver: '1' + passenger: '1' + - type: chat + template: {{.company}}/{{.audience}}/{{.hashId}}/chat + hash_type: 0 + accesses: + driver: '1' + passenger: '1' + - type: general_call_entry + template: shared/{{.company}}/{{.audience}}/{{.hashId}}/call/send + hash_type: 0 + accesses: + driver: '2' + passenger: '2' + - type: node_call_entry + template: {{.company}}/{{.audience}}/{{.hashId}}/call/[a-zA-Z0-9-]+/send + hash_type: 0 + accesses: + driver: '2' + passenger: '2' + - type: call_outgoing + template: {{.company}}/{{.audience}}/{{.hashId}}/call/receive + hash_type: 0 + accesses: + driver: '1' + passenger: '1' From 3edb999bd74a4d35731e36c0f74e571d181b1d30 Mon Sep 17 00:00:00 2001 From: Mehdi Date: Mon, 31 Jan 2022 16:41:13 +0330 Subject: [PATCH 170/660] refactor: add doc --- internal/topics/manager.go | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/internal/topics/manager.go b/internal/topics/manager.go index e4c9cabc..9238e8c4 100644 --- a/internal/topics/manager.go +++ b/internal/topics/manager.go @@ -1,3 +1,6 @@ +// Package topics regular expressions which are used for detecting the topic name. +// topics are prefix with the company name will be trimed before matching +// so they regular expressions should not contain the company prefix. package topics import ( @@ -36,10 +39,6 @@ const EmqCabHashPrefix = "emqch" var ErrDecodeHashID = errors.New("could not decode hash id") -// Topic regular expressions which are used for detecting the topic name. -// topics are prefix with the company name will be trimed before matching -// so they regular expressions should not contain the company prefix. - type Manager struct { HashIDSManager *snappids.HashIDSManager Company string From 4c1a942f08dfe7b31c74973406ae647b31556ed0 Mon Sep 17 00:00:00 2001 From: Mehdi Date: Mon, 31 Jan 2022 16:57:46 +0330 Subject: [PATCH 171/660] refactor: apply linter suggestions --- internal/authenticator/authenticator.go | 10 ---------- internal/config/config.go | 2 +- internal/topics/manager.go | 3 ++- internal/topics/topic.go | 1 + pkg/acl/acl.go | 8 ++++---- pkg/user/user.go | 4 ++-- 6 files changed, 10 insertions(+), 18 deletions(-) diff --git a/internal/authenticator/authenticator.go b/internal/authenticator/authenticator.go index ff2f28f8..3d2dd292 100644 --- a/internal/authenticator/authenticator.go +++ b/internal/authenticator/authenticator.go @@ -177,13 +177,3 @@ func (a Authenticator) ValidateAccessType(accessType acl.AccessType) bool { return false } - -func primaryKey(issuer user.Issuer, sub string) string { - if issuer == user.Passenger { - return "passenger" - } else if issuer == user.Driver { - return "driver" - } - - return sub -} diff --git a/internal/config/config.go b/internal/config/config.go index bf8ff76a..821122eb 100644 --- a/internal/config/config.go +++ b/internal/config/config.go @@ -86,7 +86,7 @@ func New() Config { func (a *Config) ReadPublicKey(u user.Issuer) (*rsa.PublicKey, error) { var fileName string - switch u { + switch u { // nolint:exhaustive case user.Driver: fileName = fmt.Sprintf("%s%s", a.JWT.Path, "0.pem") case user.Passenger: diff --git a/internal/topics/manager.go b/internal/topics/manager.go index 9238e8c4..b76d398b 100644 --- a/internal/topics/manager.go +++ b/internal/topics/manager.go @@ -13,6 +13,7 @@ import ( "text/template" "gitlab.snapp.ir/dispatching/snappids/v2" + "gitlab.snapp.ir/dispatching/soteria/v3/pkg/user" ) @@ -117,7 +118,7 @@ func (t Manager) getHashID(hashType HashType, sub string, audience snappids.Audi // IssuerToAudience returns corresponding audience in snappids form. func IssuerToAudience(issuer user.Issuer) (snappids.Audience, string) { - switch issuer { + switch issuer { // nolint:exhaustive case user.Passenger: return snappids.PassengerAudience, Passenger case user.Driver: diff --git a/internal/topics/topic.go b/internal/topics/topic.go index 82f6379b..b608e0a3 100644 --- a/internal/topics/topic.go +++ b/internal/topics/topic.go @@ -43,5 +43,6 @@ func (t Template) Parse(fields map[string]string) string { // HasAccess check if user has access on topic. func (t Template) HasAccess(audience string, accessType acl.AccessType) bool { access := t.Accesses[audience] + return access == acl.PubSub || access == accessType } diff --git a/pkg/acl/acl.go b/pkg/acl/acl.go index cf687c01..87db3046 100644 --- a/pkg/acl/acl.go +++ b/pkg/acl/acl.go @@ -5,15 +5,15 @@ type AccessType string const ( Sub AccessType = "1" - Pub = "2" - PubSub = "3" - None = "-1" + Pub AccessType = "2" + PubSub AccessType = "3" + None AccessType = "-1" ClientCredentials = "client_credentials" ) func (a AccessType) String() string { - switch a { + switch a { // nolint:exhaustive case Sub: return "subscribe" case Pub: diff --git a/pkg/user/user.go b/pkg/user/user.go index 88f8c76e..e23c7f55 100644 --- a/pkg/user/user.go +++ b/pkg/user/user.go @@ -5,6 +5,6 @@ type Issuer string const ( Driver Issuer = "0" - Passenger = "1" - None = "-1" + Passenger Issuer = "1" + None Issuer = "-1" ) From c55d8d6e1dc660da372e56d5fc7d1a527513bb7b Mon Sep 17 00:00:00 2001 From: Mehdi Date: Mon, 31 Jan 2022 17:02:30 +0330 Subject: [PATCH 172/660] fix: fix topic exact match --- deployments/soteria/values.yaml | 20 ++++++++++---------- internal/config/default.go | 20 ++++++++++---------- internal/topics/manager.go | 2 -- 3 files changed, 20 insertions(+), 22 deletions(-) diff --git a/deployments/soteria/values.yaml b/deployments/soteria/values.yaml index e9791b0e..c98dd2aa 100644 --- a/deployments/soteria/values.yaml +++ b/deployments/soteria/values.yaml @@ -79,61 +79,61 @@ envs: topics: - type: cab_event - template: {{.audience}}-event-{{.hashId}} + template: ^{{.audience}}-event-{{.hashId}}$ hash_type: 1 accesses: driver: '1' passenger: '1' - type: driver_location - template: {{.company}}/driver/{{.hashId}}/location + template: ^{{.company}}/driver/{{.hashId}}/location$ hash_type: 0 accesses: driver: '2' passenger: '-1' - type: passenger_location - template: {{.company}}/passenger/{{.hashId}}/location + template: ^{{.company}}/passenger/{{.hashId}}/location$ hash_type: 0 accesses: driver: '2' passenger: '2' - type: superapp_event - template: {{.company}}/{{.audience}}/{{.hashId}}/superapp + template: ^{{.company}}/{{.audience}}/{{.hashId}}/superapp$ hash_type: 0 accesses: driver: '1' passenger: '1' - type: box_event - template: bucks + template: ^bucks$ hash_type: 0 accesses: driver: '-1' passenger: '-1' - type: shared_location - template: bucks + template: ^{{.company}}/{{.audience}}/{{.hashId}}/{{.peer}}-location$ hash_type: 0 accesses: driver: '1' passenger: '1' - type: chat - template: {{.company}}/{{.audience}}/{{.hashId}}/chat + template: ^{{.company}}/{{.audience}}/{{.hashId}}/chat$ hash_type: 0 accesses: driver: '1' passenger: '1' - type: general_call_entry - template: shared/{{.company}}/{{.audience}}/{{.hashId}}/call/send + template: ^shared/{{.company}}/{{.audience}}/{{.hashId}}/call/send$ hash_type: 0 accesses: driver: '2' passenger: '2' - type: node_call_entry - template: {{.company}}/{{.audience}}/{{.hashId}}/call/[a-zA-Z0-9-]+/send + template: ^{{.company}}/{{.audience}}/{{.hashId}}/call/[a-zA-Z0-9-]+/send$ hash_type: 0 accesses: driver: '2' passenger: '2' - type: call_outgoing - template: {{.company}}/{{.audience}}/{{.hashId}}/call/receive + template: ^{{.company}}/{{.audience}}/{{.hashId}}/call/receive$ hash_type: 0 accesses: driver: '1' diff --git a/internal/config/default.go b/internal/config/default.go index afeded8f..760500b4 100644 --- a/internal/config/default.go +++ b/internal/config/default.go @@ -44,7 +44,7 @@ func Default() Config { Topics: []topics.Topic{ { Type: "cab_event", - Template: "{{.audience}}-event-{{.hashId}}", + Template: "^{{.audience}}-event-{{.hashId}}$", HashType: topics.MD5, Accesses: map[string]acl.AccessType{ topics.Driver: acl.Sub, @@ -53,7 +53,7 @@ func Default() Config { }, { Type: "driver_location", - Template: "{{.company}}/driver/{{.hashId}}/location", + Template: "^{{.company}}/driver/{{.hashId}}/location$", HashType: topics.HashID, Accesses: map[string]acl.AccessType{ topics.Driver: acl.Pub, @@ -62,7 +62,7 @@ func Default() Config { }, { Type: "passenger_location", - Template: "{{.company}}/passenger/{{.hashId}}/location", + Template: "^{{.company}}/passenger/{{.hashId}}/location$", HashType: topics.HashID, Accesses: map[string]acl.AccessType{ topics.Driver: acl.Pub, @@ -71,7 +71,7 @@ func Default() Config { }, { Type: "superapp_event", - Template: "{{.company}}/{{.audience}}/{{.hashId}}/superapp", + Template: "^{{.company}}/{{.audience}}/{{.hashId}}/superapp$", HashType: topics.HashID, Accesses: map[string]acl.AccessType{ topics.Driver: acl.Sub, @@ -80,7 +80,7 @@ func Default() Config { }, { Type: "box_event", - Template: "bucks", + Template: "^bucks$", HashType: topics.HashID, Accesses: map[string]acl.AccessType{ topics.Driver: acl.None, @@ -89,7 +89,7 @@ func Default() Config { }, { Type: "shared_location", - Template: "{{.company}}/{{.audience}}/{{.hashId}}/{{.peer}}-location", + Template: "^{{.company}}/{{.audience}}/{{.hashId}}/{{.peer}}-location$", HashType: topics.HashID, Accesses: map[string]acl.AccessType{ topics.Driver: acl.Sub, @@ -98,7 +98,7 @@ func Default() Config { }, { Type: "chat", - Template: "{{.company}}/{{.audience}}/{{.hashId}}/chat", + Template: "^{{.company}}/{{.audience}}/{{.hashId}}/chat$", HashType: topics.HashID, Accesses: map[string]acl.AccessType{ topics.Driver: acl.Sub, @@ -107,7 +107,7 @@ func Default() Config { }, { Type: "general_call_entry", - Template: "shared/{{.company}}/{{.audience}}/{{.hashId}}/call/send", + Template: "^shared/{{.company}}/{{.audience}}/{{.hashId}}/call/send$", HashType: topics.HashID, Accesses: map[string]acl.AccessType{ topics.Driver: acl.Pub, @@ -116,7 +116,7 @@ func Default() Config { }, { Type: "node_call_entry", - Template: "{{.company}}/{{.audience}}/{{.hashId}}/call/[a-zA-Z0-9-]+/send", + Template: "^{{.company}}/{{.audience}}/{{.hashId}}/call/[a-zA-Z0-9-]+/send$", HashType: topics.HashID, Accesses: map[string]acl.AccessType{ topics.Driver: acl.Pub, @@ -125,7 +125,7 @@ func Default() Config { }, { Type: "call_outgoing", - Template: "{{.company}}/{{.audience}}/{{.hashId}}/call/receive", + Template: "^{{.company}}/{{.audience}}/{{.hashId}}/call/receive$", HashType: topics.HashID, Accesses: map[string]acl.AccessType{ topics.Driver: acl.Sub, diff --git a/internal/topics/manager.go b/internal/topics/manager.go index b76d398b..43930716 100644 --- a/internal/topics/manager.go +++ b/internal/topics/manager.go @@ -88,8 +88,6 @@ func (t Manager) ValidateTopic(topic string, audienceStr string, audience snappi return nil } - // TODO: must be the exact topic - // if didn't match go to next template if regexp.MustCompile(regex.String()).MatchString(topic) { return &topicTemplate } From e496f15874699c26580d8e440502ed1b64a32228 Mon Sep 17 00:00:00 2001 From: Mehdi Date: Mon, 31 Jan 2022 17:09:25 +0330 Subject: [PATCH 173/660] refactor: apply linter suggestions --- internal/authenticator/authenticator.go | 2 ++ internal/topics/manager.go | 2 +- internal/tracing/tracer.go | 3 +-- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/internal/authenticator/authenticator.go b/internal/authenticator/authenticator.go index 3d2dd292..31438ce8 100644 --- a/internal/authenticator/authenticator.go +++ b/internal/authenticator/authenticator.go @@ -4,7 +4,9 @@ import ( "crypto/rsa" "errors" "fmt" + "github.com/golang-jwt/jwt/v4" + "gitlab.snapp.ir/dispatching/soteria/v3/internal/topics" "gitlab.snapp.ir/dispatching/soteria/v3/pkg/acl" "gitlab.snapp.ir/dispatching/soteria/v3/pkg/user" diff --git a/internal/topics/manager.go b/internal/topics/manager.go index 43930716..714acd28 100644 --- a/internal/topics/manager.go +++ b/internal/topics/manager.go @@ -13,7 +13,6 @@ import ( "text/template" "gitlab.snapp.ir/dispatching/snappids/v2" - "gitlab.snapp.ir/dispatching/soteria/v3/pkg/user" ) @@ -83,6 +82,7 @@ func (t Manager) ValidateTopic(topic string, audienceStr string, audience snappi fields["hashId"] = hashID regex := new(strings.Builder) + err = topicTemplate.Template.Execute(regex, fields) if err != nil { return nil diff --git a/internal/tracing/tracer.go b/internal/tracing/tracer.go index 03f7c9ef..de450e28 100644 --- a/internal/tracing/tracer.go +++ b/internal/tracing/tracer.go @@ -12,8 +12,7 @@ import ( "go.opentelemetry.io/otel/trace" ) -// nolint: ireturn -func New(cfg Config) trace.Tracer { +func New(cfg Config) trace.Tracer { //nolint: ireturn if !cfg.Enabled { return trace.NewNoopTracerProvider().Tracer("snapp.dispatching") } From c19de9133994a2b2850df616bf5ae87508e8a21b Mon Sep 17 00:00:00 2001 From: Mehdi Date: Tue, 1 Feb 2022 08:49:35 +0330 Subject: [PATCH 174/660] refactor: apply linter suggestions --- .golangci.yml | 5 +++++ internal/authenticator/authenticator.go | 1 - internal/topics/manager.go | 2 +- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/.golangci.yml b/.golangci.yml index 30026fdf..4908c1a0 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -13,3 +13,8 @@ linters: - scopelint - golint - interfacer +linters-settings: + gosec: + excludes: + # crypto/md5 + - G501 diff --git a/internal/authenticator/authenticator.go b/internal/authenticator/authenticator.go index 31438ce8..4280277f 100644 --- a/internal/authenticator/authenticator.go +++ b/internal/authenticator/authenticator.go @@ -6,7 +6,6 @@ import ( "fmt" "github.com/golang-jwt/jwt/v4" - "gitlab.snapp.ir/dispatching/soteria/v3/internal/topics" "gitlab.snapp.ir/dispatching/soteria/v3/pkg/acl" "gitlab.snapp.ir/dispatching/soteria/v3/pkg/user" diff --git a/internal/topics/manager.go b/internal/topics/manager.go index 714acd28..4144e6a0 100644 --- a/internal/topics/manager.go +++ b/internal/topics/manager.go @@ -4,7 +4,7 @@ package topics import ( - "crypto/md5" // nolint:gosec + "crypto/md5" "errors" "fmt" "regexp" From 66bef44cef95f75a3a3498ec2cccb2e3bea9c8d6 Mon Sep 17 00:00:00 2001 From: Parham Alvani Date: Tue, 1 Feb 2022 09:40:10 +0330 Subject: [PATCH 175/660] chore: remove unused koanf tag --- internal/topics/topic.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/topics/topic.go b/internal/topics/topic.go index b608e0a3..7b829ec9 100644 --- a/internal/topics/topic.go +++ b/internal/topics/topic.go @@ -25,7 +25,7 @@ type Topic struct { type Template struct { Type string Template *template.Template - HashType HashType `koanf:"hash_type"` + HashType HashType Accesses map[string]acl.AccessType } From 830e800b9b94302daa3344de72a36c0c14b04fa8 Mon Sep 17 00:00:00 2001 From: Parham Alvani Date: Wed, 2 Feb 2022 12:27:20 +0330 Subject: [PATCH 176/660] feat: update authenticator tests --- internal/authenticator/authenticator_test.go | 393 +++++++++---------- 1 file changed, 195 insertions(+), 198 deletions(-) diff --git a/internal/authenticator/authenticator_test.go b/internal/authenticator/authenticator_test.go index 3ae9611a..b07d7302 100644 --- a/internal/authenticator/authenticator_test.go +++ b/internal/authenticator/authenticator_test.go @@ -3,15 +3,16 @@ package authenticator_test import ( "crypto/rsa" "fmt" - "gitlab.snapp.ir/dispatching/soteria/v3/internal/config" "io/ioutil" "testing" "time" "github.com/golang-jwt/jwt/v4" "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/suite" "gitlab.snapp.ir/dispatching/snappids/v2" "gitlab.snapp.ir/dispatching/soteria/v3/internal/authenticator" + "gitlab.snapp.ir/dispatching/soteria/v3/internal/config" "gitlab.snapp.ir/dispatching/soteria/v3/internal/topics" "gitlab.snapp.ir/dispatching/soteria/v3/pkg/acl" "gitlab.snapp.ir/dispatching/soteria/v3/pkg/user" @@ -56,70 +57,40 @@ const ( invalidPassengerCallOutgoingTopic = "snapp/passenger/0596923be632d673560af9adadd2f78a/call/receive" ) -func TestAuthenticator_Auth(t *testing.T) { - driverToken, err := getSampleToken(user.Driver, false) - if err != nil { - t.Fatal(err) - } +type AuthenticatorTestSuite struct { + suite.Suite - passengerToken, err := getSampleToken(user.Passenger, false) - if err != nil { - t.Fatal(err) + Tokens struct { + Passenger string + Driver string } - pkey0, err := getPublicKey(user.Driver) - if err != nil { - t.Fatal(err) + PublicKeys struct { + Passenger *rsa.PublicKey + Driver *rsa.PublicKey } - pkey1, err := getPublicKey(user.Passenger) - if err != nil { - t.Fatal(err) - } - - // nolint: exhaustivestruct - authenticator := authenticator.Authenticator{ - PublicKeys: map[user.Issuer]*rsa.PublicKey{ - user.Driver: pkey0, - user.Passenger: pkey1, - }, - } + Authenticator authenticator.Authenticator +} - t.Run("testing driver token auth", func(t *testing.T) { - err := authenticator.Auth(driverToken) - assert.NoError(t, err) - }) +func (suite *AuthenticatorTestSuite) SetupSuite() { + require := suite.Require() - t.Run("testing passenger token auth", func(t *testing.T) { - err := authenticator.Auth(passengerToken) - assert.NoError(t, err) - }) + driverToken, err := suite.getSampleToken(user.Driver, false) + require.NoError(err) + suite.Tokens.Driver = driverToken - t.Run("testing invalid token auth", func(t *testing.T) { - err := authenticator.Auth(invalidToken) - assert.Error(t, err) - }) -} + passengerToken, err := suite.getSampleToken(user.Passenger, false) + require.NoError(err) + suite.Tokens.Passenger = passengerToken -func TestAuthenticator_Acl(t *testing.T) { - pkey0, err := getPublicKey(user.Driver) - if err != nil { - t.Fatal(err) - } - pkey1, err := getPublicKey(user.Passenger) - if err != nil { - t.Fatal(err) - } - passengerToken, err := getSampleToken(user.Passenger, false) - if err != nil { - t.Fatal(err) - } - driverToken, err := getSampleToken(user.Driver, false) - if err != nil { - t.Fatal(err) - } + pkey0, err := suite.getPublicKey(user.Driver) + require.NoError(err) + suite.PublicKeys.Driver = pkey0 - cfg := config.New() + pkey1, err := suite.getPublicKey(user.Passenger) + require.NoError(err) + suite.PublicKeys.Passenger = pkey1 hid := &snappids.HashIDSManager{ Salts: map[snappids.Audience]string{ @@ -134,191 +105,226 @@ func TestAuthenticator_Acl(t *testing.T) { }, } - auth := authenticator.Authenticator{ + suite.Authenticator = authenticator.Authenticator{ PublicKeys: map[user.Issuer]*rsa.PublicKey{ user.Driver: pkey0, user.Passenger: pkey1, }, AllowedAccessTypes: []acl.AccessType{acl.Pub, acl.Sub, acl.PubSub}, Company: "snapp", - TopicManager: topics.NewTopicManager(cfg.Topics, hid, "snapp"), + TopicManager: topics.NewTopicManager(config.Default().Topics, hid, "snapp"), } - t.Run("testing acl with invalid access type", func(t *testing.T) { - ok, err := auth.ACL("invalid-access", passengerToken, "test") - assert.Error(t, err) - assert.False(t, ok) - assert.Equal(t, authenticator.ErrInvalidAccessType.Error(), err.Error()) +} + +func (suite *AuthenticatorTestSuite) TestAuth() { + require := suite.Require() + + suite.Run("testing driver token auth", func() { + require.NoError(suite.Authenticator.Auth(suite.Tokens.Driver)) }) - t.Run("testing acl with invalid token", func(t *testing.T) { - ok, err := auth.ACL(acl.Pub, invalidToken, validDriverCabEventTopic) - assert.False(t, ok) - assert.Error(t, err) - assert.Equal(t, "token is invalid illegal base64 data at input byte 36", err.Error()) + + suite.Run("testing passenger token auth", func() { + require.NoError(suite.Authenticator.Auth(suite.Tokens.Passenger)) }) - t.Run("testing acl with valid inputs", func(t *testing.T) { - ok, err := auth.ACL(acl.Sub, passengerToken, validPassengerCabEventTopic) - assert.NoError(t, err) - assert.True(t, ok) + + suite.Run("testing invalid token auth", func() { + require.Error(suite.Authenticator.Auth(invalidToken)) }) - t.Run("testing acl with invalid topic", func(t *testing.T) { - ok, err := auth.ACL(acl.Sub, passengerToken, invalidPassengerCabEventTopic) - assert.Error(t, err) - assert.False(t, ok) +} + +func (suite *AuthenticatorTestSuite) TestACL_Basics() { + require := suite.Require() + + suite.Run("testing acl with invalid access type", func() { + ok, err := suite.Authenticator.ACL("invalid-access", suite.Tokens.Passenger, "test") + require.Error(err) + require.False(ok) + require.ErrorIs(err, authenticator.ErrInvalidAccessType) + }) + + suite.Run("testing acl with invalid token", func() { + ok, err := suite.Authenticator.ACL(acl.Pub, invalidToken, validDriverCabEventTopic) + require.False(ok) + require.Error(err) + require.Equal("token is invalid illegal base64 data at input byte 36", err.Error()) + }) + + suite.Run("testing acl with valid inputs", func() { + ok, err := suite.Authenticator.ACL(acl.Sub, suite.Tokens.Passenger, validPassengerCabEventTopic) + require.NoError(err) + require.True(ok) + }) + + suite.Run("testing acl with invalid topic", func() { + ok, err := suite.Authenticator.ACL(acl.Sub, suite.Tokens.Passenger, invalidPassengerCabEventTopic) + require.Error(err) + require.False(ok) }) - t.Run("testing acl with invalid access type", func(t *testing.T) { - ok, err := auth.ACL(acl.Pub, passengerToken, validPassengerCabEventTopic) - assert.Error(t, err) - assert.False(t, ok) + + suite.Run("testing acl with invalid access type", func() { + ok, err := suite.Authenticator.ACL(acl.Pub, suite.Tokens.Passenger, validPassengerCabEventTopic) + require.Error(err) + require.False(ok) }) +} - t.Run("testing driver publish on its location topic", func(t *testing.T) { - ok, err := auth.ACL(acl.Pub, driverToken, validDriverLocationTopic) - assert.NoError(t, err) - assert.True(t, ok) +func (suite *AuthenticatorTestSuite) TestACL_Passenger() { + require := suite.Require() + token := suite.Tokens.Passenger + + suite.Run("testing passenger subscribe on valid superapp event topic", func() { + ok, err := suite.Authenticator.ACL(acl.Sub, token, validPassengerSuperappEventTopic) + require.NoError(err) + require.True(ok) }) - t.Run("testing driver publish on invalid location topic", func(t *testing.T) { - ok, err := auth.ACL(acl.Pub, driverToken, invalidDriverLocationTopic) - assert.Error(t, err) - assert.False(t, ok) + suite.Run("testing passenger subscribe on invalid superapp event topic", func() { + ok, err := suite.Authenticator.ACL(acl.Sub, token, invalidPassengerSuperappEventTopic) + require.Error(err) + require.False(ok) }) - t.Run("testing driver subscribe on invalid cab event topic", func(t *testing.T) { - ok, err := auth.ACL(acl.Sub, driverToken, invalidDriverCabEventTopic) - assert.Error(t, err) - assert.False(t, ok) + suite.Run("testing passenger subscribe on valid shared location topic", func() { + ok, err := suite.Authenticator.ACL(acl.Sub, token, validPassengerSharedTopic) + require.NoError(err) + require.True(ok) }) - t.Run("testing passenger subscribe on valid superapp event topic", func(t *testing.T) { - ok, err := auth.ACL(acl.Sub, passengerToken, validPassengerSuperappEventTopic) - assert.NoError(t, err) - assert.True(t, ok) + suite.Run("testing passenger subscribe on invalid shared location topic", func() { + ok, err := suite.Authenticator.ACL(acl.Sub, token, invalidPassengerSharedTopic) + require.Error(err) + require.False(ok) }) - t.Run("testing passenger subscribe on invalid superapp event topic", func(t *testing.T) { - ok, err := auth.ACL(acl.Sub, passengerToken, invalidPassengerSuperappEventTopic) - assert.Error(t, err) - assert.False(t, ok) + suite.Run("testing passenger subscribe on valid chat topic", func() { + ok, err := suite.Authenticator.ACL(acl.Sub, token, validPassengerChatTopic) + require.NoError(err) + require.True(ok) }) - t.Run("testing driver subscribe on valid superapp event topic", func(t *testing.T) { - ok, err := auth.ACL(acl.Sub, driverToken, validDriverSuperappEventTopic) - assert.NoError(t, err) - assert.True(t, ok) + suite.Run("testing passenger subscribe on invalid chat topic", func() { + ok, err := suite.Authenticator.ACL(acl.Sub, token, invalidPassengerChatTopic) + require.Error(err) + require.False(ok) }) - t.Run("testing driver subscribe on invalid superapp event topic", func(t *testing.T) { - ok, err := auth.ACL(acl.Sub, driverToken, invalidDriverSuperappEventTopic) - assert.Error(t, err) - assert.False(t, ok) + suite.Run("testing passenger subscribe on valid entry call topic", func() { + ok, err := suite.Authenticator.ACL(acl.Pub, token, validPassengerCallEntryTopic) + require.NoError(err) + require.True(ok) }) - t.Run("testing driver subscribe on valid shared location topic", func(t *testing.T) { - ok, err := auth.ACL(acl.Sub, driverToken, validDriverSharedTopic) - assert.NoError(t, err) - assert.True(t, ok) + suite.Run("testing passenger subscribe on invalid call entry topic", func() { + ok, err := suite.Authenticator.ACL(acl.Pub, token, invalidPassengerCallEntryTopic) + require.Error(err) + require.False(ok) }) - t.Run("testing passenger subscribe on valid shared location topic", func(t *testing.T) { - ok, err := auth.ACL(acl.Sub, passengerToken, validPassengerSharedTopic) - assert.NoError(t, err) - assert.True(t, ok) + suite.Run("testing passenger subscribe on valid outgoing call topic", func() { + ok, err := suite.Authenticator.ACL(acl.Sub, token, validPassengerCallOutgoingTopic) + require.NoError(err) + require.True(ok) }) - t.Run("testing driver subscribe on invalid shared location topic", func(t *testing.T) { - ok, err := auth.ACL(acl.Sub, driverToken, invalidDriverSharedTopic) - assert.Error(t, err) - assert.False(t, ok) + suite.Run("testing passenger subscribe on valid outgoing call node topic", func() { + ok, err := suite.Authenticator.ACL(acl.Pub, token, validPassengerNodeCallEntryTopic) + require.NoError(err) + require.True(ok) }) - t.Run("testing passenger subscribe on invalid shared location topic", func(t *testing.T) { - ok, err := auth.ACL(acl.Sub, passengerToken, invalidPassengerSharedTopic) - assert.Error(t, err) - assert.False(t, ok) + suite.Run("testing passenger subscribe on invalid call outgoing topic", func() { + ok, err := suite.Authenticator.ACL(acl.Sub, token, invalidPassengerCallOutgoingTopic) + require.Error(err) + require.False(ok) }) +} + +func (suite *AuthenticatorTestSuite) TestACL_Driver() { + require := suite.Require() + token := suite.Tokens.Driver - t.Run("testing driver subscribe on valid chat topic", func(t *testing.T) { - ok, err := auth.ACL(acl.Sub, driverToken, validDriverChatTopic) - assert.NoError(t, err) - assert.True(t, ok) + suite.Run("testing driver publish on its location topic", func() { + ok, err := suite.Authenticator.ACL(acl.Pub, token, validDriverLocationTopic) + require.NoError(err) + require.True(ok) }) - t.Run("testing passenger subscribe on valid chat topic", func(t *testing.T) { - ok, err := auth.ACL(acl.Sub, passengerToken, validPassengerChatTopic) - assert.NoError(t, err) - assert.True(t, ok) + suite.Run("testing driver publish on invalid location topic", func() { + ok, err := suite.Authenticator.ACL(acl.Pub, token, invalidDriverLocationTopic) + require.Error(err) + require.False(ok) }) - t.Run("testing driver subscribe on invalid chat topic", func(t *testing.T) { - ok, err := auth.ACL(acl.Sub, driverToken, invalidDriverChatTopic) - assert.Error(t, err) - assert.False(t, ok) + suite.Run("testing driver subscribe on invalid cab event topic", func() { + ok, err := suite.Authenticator.ACL(acl.Sub, token, invalidDriverCabEventTopic) + require.Error(err) + require.False(ok) }) - t.Run("testing passenger subscribe on invalid chat topic", func(t *testing.T) { - ok, err := auth.ACL(acl.Sub, passengerToken, invalidPassengerChatTopic) - assert.Error(t, err) - assert.False(t, ok) + suite.Run("testing driver subscribe on valid superapp event topic", func() { + ok, err := suite.Authenticator.ACL(acl.Sub, token, validDriverSuperappEventTopic) + suite.NoError(err) + suite.True(ok) }) - t.Run("testing driver subscribe on valid call entry topic", func(t *testing.T) { - ok, err := auth.ACL(acl.Pub, driverToken, validDriverCallEntryTopic) - assert.NoError(t, err) - assert.True(t, ok) + suite.Run("testing driver subscribe on invalid superapp event topic", func() { + ok, err := suite.Authenticator.ACL(acl.Sub, token, invalidDriverSuperappEventTopic) + suite.Error(err) + suite.False(ok) }) - t.Run("testing passenger subscribe on valid entry call topic", func(t *testing.T) { - ok, err := auth.ACL(acl.Pub, passengerToken, validPassengerCallEntryTopic) - assert.NoError(t, err) - assert.True(t, ok) + suite.Run("testing driver subscribe on valid shared location topic", func() { + ok, err := suite.Authenticator.ACL(acl.Sub, token, validDriverSharedTopic) + require.NoError(err) + require.True(ok) }) - t.Run("testing driver subscribe on invalid call entry topic", func(t *testing.T) { - ok, err := auth.ACL(acl.Pub, driverToken, invalidDriverCallEntryTopic) - assert.Error(t, err) - assert.False(t, ok) + suite.Run("testing driver subscribe on invalid shared location topic", func() { + ok, err := suite.Authenticator.ACL(acl.Sub, token, invalidDriverSharedTopic) + require.Error(err) + require.False(ok) }) - t.Run("testing passenger subscribe on invalid call entry topic", func(t *testing.T) { - ok, err := auth.ACL(acl.Pub, passengerToken, invalidPassengerCallEntryTopic) - assert.Error(t, err) - assert.False(t, ok) + suite.Run("testing driver subscribe on valid chat topic", func() { + ok, err := suite.Authenticator.ACL(acl.Sub, token, validDriverChatTopic) + require.NoError(err) + require.True(ok) }) - t.Run("testing driver subscribe on valid call outgoing topic", func(t *testing.T) { - ok, err := auth.ACL(acl.Sub, driverToken, validDriverCallOutgoingTopic) - assert.NoError(t, err) - assert.True(t, ok) + suite.Run("testing driver subscribe on invalid chat topic", func() { + ok, err := suite.Authenticator.ACL(acl.Sub, token, invalidDriverChatTopic) + require.Error(err) + require.False(ok) }) - t.Run("testing passenger subscribe on valid outgoing call topic", func(t *testing.T) { - ok, err := auth.ACL(acl.Sub, passengerToken, validPassengerCallOutgoingTopic) - assert.NoError(t, err) - assert.True(t, ok) + suite.Run("testing driver subscribe on valid call entry topic", func() { + ok, err := suite.Authenticator.ACL(acl.Pub, token, validDriverCallEntryTopic) + require.NoError(err) + require.True(ok) }) - t.Run("testing driver subscribe on valid call outgoing node topic", func(t *testing.T) { - ok, err := auth.ACL(acl.Pub, driverToken, validDriverNodeCallEntryTopic) - assert.NoError(t, err) - assert.True(t, ok) + suite.Run("testing driver subscribe on invalid call entry topic", func() { + ok, err := suite.Authenticator.ACL(acl.Pub, token, invalidDriverCallEntryTopic) + require.Error(err) + require.False(ok) }) - t.Run("testing passenger subscribe on valid outgoing call node topic", func(t *testing.T) { - ok, err := auth.ACL(acl.Pub, passengerToken, validPassengerNodeCallEntryTopic) - assert.NoError(t, err) - assert.True(t, ok) + suite.Run("testing driver subscribe on valid call outgoing topic", func() { + ok, err := suite.Authenticator.ACL(acl.Sub, token, validDriverCallOutgoingTopic) + require.NoError(err) + require.True(ok) }) - t.Run("testing driver subscribe on invalid call outgoing topic", func(t *testing.T) { - ok, err := auth.ACL(acl.Sub, driverToken, invalidDriverCallOutgoingTopic) - assert.Error(t, err) - assert.False(t, ok) + suite.Run("testing driver subscribe on valid call outgoing node topic", func() { + ok, err := suite.Authenticator.ACL(acl.Pub, token, validDriverNodeCallEntryTopic) + require.NoError(err) + require.True(ok) }) - t.Run("testing passenger subscribe on invalid call outgoing topic", func(t *testing.T) { - ok, err := auth.ACL(acl.Sub, passengerToken, invalidPassengerCallOutgoingTopic) - assert.Error(t, err) - assert.False(t, ok) + suite.Run("testing driver subscribe on invalid call outgoing topic", func() { + ok, err := suite.Authenticator.ACL(acl.Sub, token, invalidDriverCallOutgoingTopic) + require.Error(err) + require.False(ok) }) } @@ -435,7 +441,7 @@ func TestAuthenticator_validateAccessType(t *testing.T) { } } -func getPublicKey(u user.Issuer) (*rsa.PublicKey, error) { +func (suite *AuthenticatorTestSuite) getPublicKey(u user.Issuer) (*rsa.PublicKey, error) { var fileName string switch u { @@ -460,7 +466,7 @@ func getPublicKey(u user.Issuer) (*rsa.PublicKey, error) { return publicKey, nil } -func getPrivateKey(u user.Issuer) (*rsa.PrivateKey, error) { +func (suite *AuthenticatorTestSuite) getPrivateKey(u user.Issuer) (*rsa.PrivateKey, error) { var fileName string switch u { case user.Driver: @@ -481,34 +487,25 @@ func getPrivateKey(u user.Issuer) (*rsa.PrivateKey, error) { return privateKey, nil } -func getSampleToken(issuer user.Issuer, isSuperuser bool) (string, error) { - key, err := getPrivateKey(issuer) +func (suite *AuthenticatorTestSuite) getSampleToken(issuer user.Issuer, isSuperuser bool) (string, error) { + key, err := suite.getPrivateKey(issuer) if err != nil { - panic(err) + suite.Require().NoError(err) } exp := time.Now().Add(time.Hour * 24 * 365 * 10).Unix() sub := "DXKgaNQa7N5Y7bo" var claims jwt.Claims - if isSuperuser { - claims = jwt.MapClaims{ - "exp": exp, - "iss": string(issuer), - "sub": sub, - "is_superuser": true, - } - } else { - claims = jwt.StandardClaims{ - ExpiresAt: exp, - Issuer: string(issuer), - Subject: sub, - } + claims = jwt.StandardClaims{ + ExpiresAt: exp, + Issuer: string(issuer), + Subject: sub, } token := jwt.NewWithClaims(jwt.SigningMethodRS256, claims) tokenString, err := token.SignedString(key) if err != nil { - panic(err) + suite.Require().NoError(err) } return tokenString, nil } From 06ba4577f6cb25b5b9720114bb5787c3444aad71 Mon Sep 17 00:00:00 2001 From: Parham Alvani Date: Wed, 2 Feb 2022 12:27:36 +0330 Subject: [PATCH 177/660] feat: use variables instead of strings for topic names --- internal/config/default.go | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/internal/config/default.go b/internal/config/default.go index 760500b4..cc733549 100644 --- a/internal/config/default.go +++ b/internal/config/default.go @@ -43,7 +43,7 @@ func Default() Config { Company: "snapp", Topics: []topics.Topic{ { - Type: "cab_event", + Type: topics.CabEvent, Template: "^{{.audience}}-event-{{.hashId}}$", HashType: topics.MD5, Accesses: map[string]acl.AccessType{ @@ -52,7 +52,7 @@ func Default() Config { }, }, { - Type: "driver_location", + Type: topics.DriverLocation, Template: "^{{.company}}/driver/{{.hashId}}/location$", HashType: topics.HashID, Accesses: map[string]acl.AccessType{ @@ -61,7 +61,7 @@ func Default() Config { }, }, { - Type: "passenger_location", + Type: topics.PassengerLocation, Template: "^{{.company}}/passenger/{{.hashId}}/location$", HashType: topics.HashID, Accesses: map[string]acl.AccessType{ @@ -70,7 +70,7 @@ func Default() Config { }, }, { - Type: "superapp_event", + Type: topics.SuperappEvent, Template: "^{{.company}}/{{.audience}}/{{.hashId}}/superapp$", HashType: topics.HashID, Accesses: map[string]acl.AccessType{ @@ -79,7 +79,7 @@ func Default() Config { }, }, { - Type: "box_event", + Type: topics.BoxEvent, Template: "^bucks$", HashType: topics.HashID, Accesses: map[string]acl.AccessType{ @@ -88,7 +88,7 @@ func Default() Config { }, }, { - Type: "shared_location", + Type: topics.SharedLocation, Template: "^{{.company}}/{{.audience}}/{{.hashId}}/{{.peer}}-location$", HashType: topics.HashID, Accesses: map[string]acl.AccessType{ @@ -97,7 +97,7 @@ func Default() Config { }, }, { - Type: "chat", + Type: topics.Chat, Template: "^{{.company}}/{{.audience}}/{{.hashId}}/chat$", HashType: topics.HashID, Accesses: map[string]acl.AccessType{ @@ -106,7 +106,7 @@ func Default() Config { }, }, { - Type: "general_call_entry", + Type: topics.GeneralCallEntry, Template: "^shared/{{.company}}/{{.audience}}/{{.hashId}}/call/send$", HashType: topics.HashID, Accesses: map[string]acl.AccessType{ @@ -115,7 +115,7 @@ func Default() Config { }, }, { - Type: "node_call_entry", + Type: topics.NodeCallEntry, Template: "^{{.company}}/{{.audience}}/{{.hashId}}/call/[a-zA-Z0-9-]+/send$", HashType: topics.HashID, Accesses: map[string]acl.AccessType{ @@ -124,7 +124,7 @@ func Default() Config { }, }, { - Type: "call_outgoing", + Type: topics.CallOutgoing, Template: "^{{.company}}/{{.audience}}/{{.hashId}}/call/receive$", HashType: topics.HashID, Accesses: map[string]acl.AccessType{ From 8b4927a78bb7aa0cfc90d38d41f9df59b6c67f91 Mon Sep 17 00:00:00 2001 From: Parham Alvani Date: Wed, 2 Feb 2022 12:31:13 +0330 Subject: [PATCH 178/660] feat: improve authenticator tests --- internal/authenticator/authenticator_test.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/internal/authenticator/authenticator_test.go b/internal/authenticator/authenticator_test.go index b07d7302..32b93ab4 100644 --- a/internal/authenticator/authenticator_test.go +++ b/internal/authenticator/authenticator_test.go @@ -19,7 +19,8 @@ import ( ) const ( - invalidToken = "ey1JhbGciOiJSUzI1NiIsInR5cCI56kpXVCJ9.eyJzdWIiOiJCRzdScDFkcnpWRE5RcjYiLCJuYW1lIjoiSm9obiBEb2UiLCJhZG1pbiI6dHJ1ZSwiaXNzIjowLCJpYXQiOjE1MTYyMzkwMjJ9.1cYXFEhcewOYFjGJYhB8dsaFO9uKEXwlM8954rkt4Tsu0lWMITbRf_hHh1l9QD4MFqD-0LwRPUYaiaemy0OClMu00G2sujLCWaquYDEP37iIt8RoOQAh8Jb5vT8LX5C3PEKvbW_i98u8HHJoFUR9CXJmzrKi48sAcOYvXVYamN0S9KoY38H-Ze37Mdu3o6B58i73krk7QHecsc2_PkCJisvUVAzb0tiInIalBc8-zI3QZSxwNLr_hjlBg1sUxTUvH5SCcRR7hxI8TxJzkOHqAHWDRO84NC_DSAoO2p04vrHpqglN9XPJ8RC2YWpfefvD2ttH554RJWu_0RlR2kAYvQ" + invalidToken = "ey1JhbGciOiJSUzI1NiIsInR5cCI56kpXVCJ9.eyJzdWIiOiJCRzdScDFkcnpWRE5RcjYiLCJuYW1lIjoiSm9obiBEb2UiLCJhZG1pbiI6dHJ1ZSwiaXNzIjowLCJpYXQiOjE1MTYyMzkwMjJ9.1cYXFEhcewOYFjGJYhB8dsaFO9uKEXwlM8954rkt4Tsu0lWMITbRf_hHh1l9QD4MFqD-0LwRPUYaiaemy0OClMu00G2sujLCWaquYDEP37iIt8RoOQAh8Jb5vT8LX5C3PEKvbW_i98u8HHJoFUR9CXJmzrKi48sAcOYvXVYamN0S9KoY38H-Ze37Mdu3o6B58i73krk7QHecsc2_PkCJisvUVAzb0tiInIalBc8-zI3QZSxwNLr_hjlBg1sUxTUvH5SCcRR7hxI8TxJzkOHqAHWDRO84NC_DSAoO2p04vrHpqglN9XPJ8RC2YWpfefvD2ttH554RJWu_0RlR2kAYvQ" + validPassengerCabEventTopic = "passenger-event-152384980615c2bd16143cff29038b67" invalidPassengerCabEventTopic = "passenger-event-152384980615c2bd16156cff29038b67" From dc30c83c7c3db5664e0d43b989462acc1698fa76 Mon Sep 17 00:00:00 2001 From: Parham Alvani Date: Wed, 2 Feb 2022 12:35:57 +0330 Subject: [PATCH 179/660] feat: update chart version --- deployments/soteria/Chart.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/deployments/soteria/Chart.yaml b/deployments/soteria/Chart.yaml index 8656f59a..c9ecb601 100644 --- a/deployments/soteria/Chart.yaml +++ b/deployments/soteria/Chart.yaml @@ -5,6 +5,6 @@ description: Soteria Helm Chart type: application -version: 5.2.1 +version: 6.0.0 -appVersion: "v5-2-1" +appVersion: "v6-0-0" From 4a377e0a80345c93f22fddec5b65566e2f021a41 Mon Sep 17 00:00:00 2001 From: Parham Alvani Date: Wed, 2 Feb 2022 14:43:08 +0330 Subject: [PATCH 180/660] feat: pretty print configuration on load --- go.mod | 1 + go.sum | 2 ++ internal/config/config.go | 15 ++++++++++++++- 3 files changed, 17 insertions(+), 1 deletion(-) diff --git a/go.mod b/go.mod index 44f63f55..3d34da74 100644 --- a/go.mod +++ b/go.mod @@ -50,6 +50,7 @@ require ( github.com/rogpeppe/go-internal v1.8.1 // indirect github.com/speps/go-hashids/v2 v2.0.1 // indirect github.com/spf13/pflag v1.0.5 // indirect + github.com/tidwall/pretty v1.2.0 // indirect github.com/valyala/bytebufferpool v1.0.0 // indirect github.com/valyala/fasthttp v1.32.0 // indirect github.com/valyala/tcplisten v1.0.0 // indirect diff --git a/go.sum b/go.sum index ae3b279f..5393fa76 100644 --- a/go.sum +++ b/go.sum @@ -600,6 +600,8 @@ github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/ github.com/stretchr/testify v1.7.0 h1:nwc3DEeHmmLAfoZucVR881uASk0Mfjw8xYJ99tb5CcY= github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/subosito/gotenv v1.2.0/go.mod h1:N0PQaV/YGNqwC0u51sEeR/aUtSLEXKX9iv69rRypqCw= +github.com/tidwall/pretty v1.2.0 h1:RWIZEg2iJ8/g6fDDYzMpobmaoGh5OLl4AXtGUGPcqCs= +github.com/tidwall/pretty v1.2.0/go.mod h1:ITEVvHYasfjBbM0u2Pg8T2nJnzm8xPwvNhhsoaGGjNU= github.com/tmc/grpc-websocket-proxy v0.0.0-20170815181823-89b8d40f7ca8/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U= github.com/tv42/httpunix v0.0.0-20150427012821-b75d8614f926/go.mod h1:9ESjWnEqriFuLhtthL60Sar/7RFoluCcXsuvEwTV5KM= github.com/urfave/cli v1.20.0/go.mod h1:70zkFmudgCuE/ngEzBv17Jvp/497gISqfk5gWijbERA= diff --git a/internal/config/config.go b/internal/config/config.go index 821122eb..d93e069b 100644 --- a/internal/config/config.go +++ b/internal/config/config.go @@ -2,6 +2,7 @@ package config import ( "crypto/rsa" + "encoding/json" "errors" "fmt" "io/ioutil" @@ -14,6 +15,7 @@ import ( "github.com/knadh/koanf/providers/env" "github.com/knadh/koanf/providers/file" "github.com/knadh/koanf/providers/structs" + "github.com/tidwall/pretty" "gitlab.snapp.ir/dispatching/soteria/v3/internal/logger" "gitlab.snapp.ir/dispatching/soteria/v3/internal/topics" "gitlab.snapp.ir/dispatching/soteria/v3/internal/tracing" @@ -76,7 +78,18 @@ func New() Config { log.Fatalf("error unmarshalling config: %s", err) } - log.Printf("following configuration is loaded:\n%+v", instance) + indent, err := json.MarshalIndent(instance, "", "\t") + if err != nil { + log.Fatalf("error marshaling configuration to json: %s", err) + } + + indent = pretty.Color(indent, nil) + tmpl := ` + ================ Loaded Configuration ================ + %s + ====================================================== + ` + log.Printf(tmpl, string(indent)) return instance } From 0a5c69786134b2ff1fc2b0f92f3b9d9b63346eaa Mon Sep 17 00:00:00 2001 From: Parham Alvani Date: Wed, 2 Feb 2022 14:45:13 +0330 Subject: [PATCH 181/660] feat: update chart version --- deployments/soteria/Chart.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/deployments/soteria/Chart.yaml b/deployments/soteria/Chart.yaml index c9ecb601..5666c79f 100644 --- a/deployments/soteria/Chart.yaml +++ b/deployments/soteria/Chart.yaml @@ -5,6 +5,6 @@ description: Soteria Helm Chart type: application -version: 6.0.0 +version: 6.0.1 -appVersion: "v6-0-0" +appVersion: "v6-0-1" From 488acf1c6f10eb0edf2bb6eda8ce6c2fd18e016d Mon Sep 17 00:00:00 2001 From: Parham Alvani Date: Wed, 2 Feb 2022 14:45:23 +0330 Subject: [PATCH 182/660] feat: remove version from go package --- cmd/soteria/soteria.go | 2 +- go.mod | 2 +- internal/api/acl.go | 6 +++--- internal/api/auth.go | 2 +- internal/app/a.go | 2 +- internal/authenticator/authenticator.go | 6 +++--- internal/authenticator/authenticator_test.go | 10 +++++----- internal/cmd/root.go | 8 ++++---- internal/cmd/serve/main.go | 12 ++++++------ internal/config/config.go | 10 +++++----- internal/config/default.go | 8 ++++---- internal/topics/manager.go | 2 +- internal/topics/manager_test.go | 8 ++++---- internal/topics/topic.go | 2 +- 14 files changed, 40 insertions(+), 40 deletions(-) diff --git a/cmd/soteria/soteria.go b/cmd/soteria/soteria.go index cc899146..233a74c8 100644 --- a/cmd/soteria/soteria.go +++ b/cmd/soteria/soteria.go @@ -1,7 +1,7 @@ package main import ( - "gitlab.snapp.ir/dispatching/soteria/v3/internal/cmd" + "gitlab.snapp.ir/dispatching/soteria/internal/cmd" _ "go.uber.org/automaxprocs" ) diff --git a/go.mod b/go.mod index 3d34da74..2cc670df 100644 --- a/go.mod +++ b/go.mod @@ -1,4 +1,4 @@ -module gitlab.snapp.ir/dispatching/soteria/v3 +module gitlab.snapp.ir/dispatching/soteria go 1.17 diff --git a/internal/api/acl.go b/internal/api/acl.go index 3850fe1a..6c50ac46 100644 --- a/internal/api/acl.go +++ b/internal/api/acl.go @@ -5,9 +5,9 @@ import ( "net/http" "github.com/gofiber/fiber/v2" - "gitlab.snapp.ir/dispatching/soteria/v3/internal/app" - "gitlab.snapp.ir/dispatching/soteria/v3/internal/authenticator" - "gitlab.snapp.ir/dispatching/soteria/v3/pkg/acl" + "gitlab.snapp.ir/dispatching/soteria/internal/app" + "gitlab.snapp.ir/dispatching/soteria/internal/authenticator" + "gitlab.snapp.ir/dispatching/soteria/pkg/acl" "go.opentelemetry.io/otel/attribute" "go.uber.org/zap" ) diff --git a/internal/api/auth.go b/internal/api/auth.go index 695b5133..0cf2c12e 100644 --- a/internal/api/auth.go +++ b/internal/api/auth.go @@ -4,7 +4,7 @@ import ( "net/http" "github.com/gofiber/fiber/v2" - "gitlab.snapp.ir/dispatching/soteria/v3/internal/app" + "gitlab.snapp.ir/dispatching/soteria/internal/app" "go.opentelemetry.io/otel/attribute" "go.uber.org/zap" ) diff --git a/internal/app/a.go b/internal/app/a.go index 29ecfdaa..79ca28c6 100644 --- a/internal/app/a.go +++ b/internal/app/a.go @@ -3,7 +3,7 @@ package app import ( "sync" - "gitlab.snapp.ir/dispatching/soteria/v3/internal/authenticator" + "gitlab.snapp.ir/dispatching/soteria/internal/authenticator" "go.opentelemetry.io/otel/trace" ) diff --git a/internal/authenticator/authenticator.go b/internal/authenticator/authenticator.go index 4280277f..99a4ca0b 100644 --- a/internal/authenticator/authenticator.go +++ b/internal/authenticator/authenticator.go @@ -6,9 +6,9 @@ import ( "fmt" "github.com/golang-jwt/jwt/v4" - "gitlab.snapp.ir/dispatching/soteria/v3/internal/topics" - "gitlab.snapp.ir/dispatching/soteria/v3/pkg/acl" - "gitlab.snapp.ir/dispatching/soteria/v3/pkg/user" + "gitlab.snapp.ir/dispatching/soteria/internal/topics" + "gitlab.snapp.ir/dispatching/soteria/pkg/acl" + "gitlab.snapp.ir/dispatching/soteria/pkg/user" ) var ( diff --git a/internal/authenticator/authenticator_test.go b/internal/authenticator/authenticator_test.go index 32b93ab4..00bd9780 100644 --- a/internal/authenticator/authenticator_test.go +++ b/internal/authenticator/authenticator_test.go @@ -11,11 +11,11 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/suite" "gitlab.snapp.ir/dispatching/snappids/v2" - "gitlab.snapp.ir/dispatching/soteria/v3/internal/authenticator" - "gitlab.snapp.ir/dispatching/soteria/v3/internal/config" - "gitlab.snapp.ir/dispatching/soteria/v3/internal/topics" - "gitlab.snapp.ir/dispatching/soteria/v3/pkg/acl" - "gitlab.snapp.ir/dispatching/soteria/v3/pkg/user" + "gitlab.snapp.ir/dispatching/soteria/internal/authenticator" + "gitlab.snapp.ir/dispatching/soteria/internal/config" + "gitlab.snapp.ir/dispatching/soteria/internal/topics" + "gitlab.snapp.ir/dispatching/soteria/pkg/acl" + "gitlab.snapp.ir/dispatching/soteria/pkg/user" ) const ( diff --git a/internal/cmd/root.go b/internal/cmd/root.go index 74d2bbd7..eba682b8 100644 --- a/internal/cmd/root.go +++ b/internal/cmd/root.go @@ -4,10 +4,10 @@ import ( "os" "github.com/spf13/cobra" - "gitlab.snapp.ir/dispatching/soteria/v3/internal/cmd/serve" - "gitlab.snapp.ir/dispatching/soteria/v3/internal/config" - "gitlab.snapp.ir/dispatching/soteria/v3/internal/logger" - "gitlab.snapp.ir/dispatching/soteria/v3/internal/tracing" + "gitlab.snapp.ir/dispatching/soteria/internal/cmd/serve" + "gitlab.snapp.ir/dispatching/soteria/internal/config" + "gitlab.snapp.ir/dispatching/soteria/internal/logger" + "gitlab.snapp.ir/dispatching/soteria/internal/tracing" "go.uber.org/zap" ) diff --git a/internal/cmd/serve/main.go b/internal/cmd/serve/main.go index 19eba455..a8d1c1a7 100644 --- a/internal/cmd/serve/main.go +++ b/internal/cmd/serve/main.go @@ -10,12 +10,12 @@ import ( "github.com/spf13/cobra" "gitlab.snapp.ir/dispatching/snappids/v2" - "gitlab.snapp.ir/dispatching/soteria/v3/internal/api" - "gitlab.snapp.ir/dispatching/soteria/v3/internal/app" - "gitlab.snapp.ir/dispatching/soteria/v3/internal/authenticator" - "gitlab.snapp.ir/dispatching/soteria/v3/internal/config" - "gitlab.snapp.ir/dispatching/soteria/v3/internal/topics" - "gitlab.snapp.ir/dispatching/soteria/v3/pkg/user" + "gitlab.snapp.ir/dispatching/soteria/internal/api" + "gitlab.snapp.ir/dispatching/soteria/internal/app" + "gitlab.snapp.ir/dispatching/soteria/internal/authenticator" + "gitlab.snapp.ir/dispatching/soteria/internal/config" + "gitlab.snapp.ir/dispatching/soteria/internal/topics" + "gitlab.snapp.ir/dispatching/soteria/pkg/user" "go.opentelemetry.io/otel/trace" "go.uber.org/zap" ) diff --git a/internal/config/config.go b/internal/config/config.go index d93e069b..ddfa1ae2 100644 --- a/internal/config/config.go +++ b/internal/config/config.go @@ -16,11 +16,11 @@ import ( "github.com/knadh/koanf/providers/file" "github.com/knadh/koanf/providers/structs" "github.com/tidwall/pretty" - "gitlab.snapp.ir/dispatching/soteria/v3/internal/logger" - "gitlab.snapp.ir/dispatching/soteria/v3/internal/topics" - "gitlab.snapp.ir/dispatching/soteria/v3/internal/tracing" - "gitlab.snapp.ir/dispatching/soteria/v3/pkg/acl" - "gitlab.snapp.ir/dispatching/soteria/v3/pkg/user" + "gitlab.snapp.ir/dispatching/soteria/internal/logger" + "gitlab.snapp.ir/dispatching/soteria/internal/topics" + "gitlab.snapp.ir/dispatching/soteria/internal/tracing" + "gitlab.snapp.ir/dispatching/soteria/pkg/acl" + "gitlab.snapp.ir/dispatching/soteria/pkg/user" ) const ( diff --git a/internal/config/default.go b/internal/config/default.go index cc733549..2f48ef9e 100644 --- a/internal/config/default.go +++ b/internal/config/default.go @@ -1,10 +1,10 @@ package config import ( - "gitlab.snapp.ir/dispatching/soteria/v3/internal/logger" - "gitlab.snapp.ir/dispatching/soteria/v3/internal/topics" - "gitlab.snapp.ir/dispatching/soteria/v3/internal/tracing" - "gitlab.snapp.ir/dispatching/soteria/v3/pkg/acl" + "gitlab.snapp.ir/dispatching/soteria/internal/logger" + "gitlab.snapp.ir/dispatching/soteria/internal/topics" + "gitlab.snapp.ir/dispatching/soteria/internal/tracing" + "gitlab.snapp.ir/dispatching/soteria/pkg/acl" ) const ( diff --git a/internal/topics/manager.go b/internal/topics/manager.go index 4144e6a0..2046c903 100644 --- a/internal/topics/manager.go +++ b/internal/topics/manager.go @@ -13,7 +13,7 @@ import ( "text/template" "gitlab.snapp.ir/dispatching/snappids/v2" - "gitlab.snapp.ir/dispatching/soteria/v3/pkg/user" + "gitlab.snapp.ir/dispatching/soteria/pkg/user" ) const ( diff --git a/internal/topics/manager_test.go b/internal/topics/manager_test.go index 64396b10..bd4d9b44 100644 --- a/internal/topics/manager_test.go +++ b/internal/topics/manager_test.go @@ -3,10 +3,10 @@ package topics_test import ( "fmt" "gitlab.snapp.ir/dispatching/snappids/v2" - "gitlab.snapp.ir/dispatching/soteria/v3/internal/authenticator" - "gitlab.snapp.ir/dispatching/soteria/v3/internal/config" - "gitlab.snapp.ir/dispatching/soteria/v3/internal/topics" - "gitlab.snapp.ir/dispatching/soteria/v3/pkg/user" + "gitlab.snapp.ir/dispatching/soteria/internal/authenticator" + "gitlab.snapp.ir/dispatching/soteria/internal/config" + "gitlab.snapp.ir/dispatching/soteria/internal/topics" + "gitlab.snapp.ir/dispatching/soteria/pkg/user" "testing" ) diff --git a/internal/topics/topic.go b/internal/topics/topic.go index 7b829ec9..6c6680d3 100644 --- a/internal/topics/topic.go +++ b/internal/topics/topic.go @@ -4,7 +4,7 @@ import ( "strings" "text/template" - "gitlab.snapp.ir/dispatching/soteria/v3/pkg/acl" + "gitlab.snapp.ir/dispatching/soteria/pkg/acl" ) // HashType topic hashID type. From 263030b231fa972d51dcf49e315bab0a41abe813 Mon Sep 17 00:00:00 2001 From: Parham Alvani Date: Tue, 8 Feb 2022 10:01:06 +0330 Subject: [PATCH 183/660] feat: add hadolint --- .gitlab/ci/templates/test.gitlab-ci.yml | 3 +++ Dockerfile | 1 + 2 files changed, 4 insertions(+) diff --git a/.gitlab/ci/templates/test.gitlab-ci.yml b/.gitlab/ci/templates/test.gitlab-ci.yml index f88873cb..f749513c 100644 --- a/.gitlab/ci/templates/test.gitlab-ci.yml +++ b/.gitlab/ci/templates/test.gitlab-ci.yml @@ -2,6 +2,9 @@ lint: extends: .easy_ci:lint +handolint: + extends: .easy-ci:dockerfile:lint + test: image: registry.snapp.tech/docker/golang:1.17-alpine3.14 stage: test diff --git a/Dockerfile b/Dockerfile index 8f6abe69..148e1dd9 100644 --- a/Dockerfile +++ b/Dockerfile @@ -3,6 +3,7 @@ ARG BUILD_DATE ARG VCS_REF ARG BUILD_VERSION +# hadolint ignore=DL3018 RUN echo "https://repo.snapp.tech/repository/alpine/v3.14/main" > /etc/apk/repositories && \ echo "https://repo.snapp.tech/repository/alpine/v3.14/community" >> /etc/apk/repositories && \ apk --no-cache --update add ca-certificates tzdata && \ From fe09bdf980a3b3a0efeb1ab740aff82b138311d5 Mon Sep 17 00:00:00 2001 From: "omid.akhavan" Date: Tue, 8 Feb 2022 17:38:22 +0330 Subject: [PATCH 184/660] change label from kubernetes to snapcloud --- deployments/soteria/templates/_helpers.tpl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/deployments/soteria/templates/_helpers.tpl b/deployments/soteria/templates/_helpers.tpl index b7a6da0c..5f6e7f44 100644 --- a/deployments/soteria/templates/_helpers.tpl +++ b/deployments/soteria/templates/_helpers.tpl @@ -40,7 +40,7 @@ app: soteria {{- if .Chart.AppVersion }} app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} {{- end }} -app.kubernetes.io/managed-by: {{ .Values.labels.managedby }} +app.snappcloud.io/managed-by: {{ .Values.labels.managedby }} app.snappcloud.io/created-by: {{ .Values.labels.createdby }} {{- end }} From 4eb21e68d6840d38fffc3250c1c6a4810b22e6db Mon Sep 17 00:00:00 2001 From: amirhnajafiz Date: Mon, 14 Feb 2022 10:43:49 +0330 Subject: [PATCH 185/660] remove global app todo marks set --- go.mod | 5 +-- go.sum | 62 +++----------------------------------- internal/api/acl.go | 2 ++ internal/api/api.go | 1 + internal/api/auth.go | 2 ++ internal/app/a.go | 1 + internal/cmd/serve/main.go | 1 + 7 files changed, 12 insertions(+), 62 deletions(-) diff --git a/go.mod b/go.mod index 2cc670df..c801a555 100644 --- a/go.mod +++ b/go.mod @@ -18,6 +18,7 @@ require ( ) require ( + github.com/tidwall/pretty v1.2.0 go.opentelemetry.io/otel v1.3.0 go.opentelemetry.io/otel/exporters/jaeger v1.3.0 go.opentelemetry.io/otel/sdk v1.3.0 @@ -38,7 +39,6 @@ require ( github.com/golang/protobuf v1.5.2 // indirect github.com/inconshreveable/mousetrap v1.0.0 // indirect github.com/klauspost/compress v1.14.1 // indirect - github.com/kr/pretty v0.3.0 // indirect github.com/matttproud/golang_protobuf_extensions v1.0.1 // indirect github.com/mitchellh/copystructure v1.2.0 // indirect github.com/mitchellh/mapstructure v1.4.3 // indirect @@ -47,17 +47,14 @@ require ( github.com/prometheus/client_model v0.2.0 // indirect github.com/prometheus/common v0.32.1 // indirect github.com/prometheus/procfs v0.7.3 // indirect - github.com/rogpeppe/go-internal v1.8.1 // indirect github.com/speps/go-hashids/v2 v2.0.1 // indirect github.com/spf13/pflag v1.0.5 // indirect - github.com/tidwall/pretty v1.2.0 // indirect github.com/valyala/bytebufferpool v1.0.0 // indirect github.com/valyala/fasthttp v1.32.0 // indirect github.com/valyala/tcplisten v1.0.0 // indirect go.uber.org/multierr v1.7.0 // indirect golang.org/x/sys v0.0.0-20220111092808-5a964db01320 // indirect google.golang.org/protobuf v1.27.1 // indirect - gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c // indirect gopkg.in/yaml.v2 v2.4.0 // indirect gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b // indirect ) diff --git a/go.sum b/go.sum index 5393fa76..1fa44409 100644 --- a/go.sum +++ b/go.sum @@ -37,7 +37,6 @@ cloud.google.com/go/bigquery v1.7.0/go.mod h1://okPTzCYNXSlb24MZs83e2Do+h+VXtc4g cloud.google.com/go/bigquery v1.8.0/go.mod h1:J5hqkt3O0uAFnINi6JXValWIb1v0goeZM77hZzJN/fQ= cloud.google.com/go/datastore v1.0.0/go.mod h1:LXYbyblFSglQ5pkeyhO+Qmw7ukd3C+pD7TKLgZqpHYE= cloud.google.com/go/datastore v1.1.0/go.mod h1:umbIZjpQpHh4hmRpGhH4tLFup+FVzqBi1b3c64qFpCk= -cloud.google.com/go/firestore v1.1.0/go.mod h1:ulACoGHTpvq5r8rxGJ4ddJZBZqakUQqClKRT5SZwBmk= cloud.google.com/go/firestore v1.6.1/go.mod h1:asNXNOzBdyVQmEU+ggO8UPodTkEVFW5Qx+rwHnAz+EY= cloud.google.com/go/pubsub v1.0.1/go.mod h1:R0Gpsv3s54REJCy4fxDixWD93lHJMoZTyQ2kNxGRt3I= cloud.google.com/go/pubsub v1.1.0/go.mod h1:EwwdRX2sKPjnvnqCa270oGRyludottCI76h+R3AArQw= @@ -65,7 +64,6 @@ github.com/alecthomas/units v0.0.0-20190717042225-c3de453c63f4/go.mod h1:ybxpYRF github.com/alecthomas/units v0.0.0-20190924025748-f65c72e2690d/go.mod h1:rBZYJk541a8SKzHPHnH3zbiI+7dagKZ0cgpgrD7Fyho= github.com/andybalholm/brotli v1.0.0/go.mod h1:loMXtMfwqflxFJPmdbJO0a3KNoPuLBgiu3qAvBg8x/Y= github.com/andybalholm/brotli v1.0.2/go.mod h1:loMXtMfwqflxFJPmdbJO0a3KNoPuLBgiu3qAvBg8x/Y= -github.com/andybalholm/brotli v1.0.3/go.mod h1:fO7iG3H7G2nSZ7m0zPUDn85XEX2GTukHGRSepvi9Eig= github.com/andybalholm/brotli v1.0.4 h1:V7DdXeJtZscaqfNuAdSRuRFzuiKlHSC/Zh3zl9qY3JY= github.com/andybalholm/brotli v1.0.4/go.mod h1:fO7iG3H7G2nSZ7m0zPUDn85XEX2GTukHGRSepvi9Eig= github.com/ansrivas/fiberprometheus/v2 v2.1.2 h1:xhG9rfJuqfpRNVHX4//ZQnKAbBubKDsvVFlGWBH9JsE= @@ -92,15 +90,14 @@ github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.3.2/go.mod h1:72H github.com/aws/aws-sdk-go-v2/service/sso v1.4.2/go.mod h1:NBvT9R1MEF+Ud6ApJKM0G+IkPchKS7p7c2YPKwHmBOk= github.com/aws/aws-sdk-go-v2/service/sts v1.7.2/go.mod h1:8EzeIqfWt2wWT4rJVu3f21TfrhJ8AEMzVybRNSb/b4g= github.com/aws/smithy-go v1.8.0/go.mod h1:SObp3lf9smib00L/v3U2eAKG8FyQ7iLrJnQiAmR5n+E= -github.com/benbjohnson/clock v1.1.0 h1:Q92kusRqC1XV2MjkWETPvjJVqKetz1OzxZB7mHJLju8= github.com/benbjohnson/clock v1.1.0/go.mod h1:J11/hYXuz8f4ySSvYwY0FKfm+ezbsZBKZxNJlLklBHA= +github.com/benbjohnson/clock v1.3.0 h1:ip6w0uFQkncKQ979AypyG0ER7mqUSBdKLOgAle/AT8A= github.com/benbjohnson/clock v1.3.0/go.mod h1:J11/hYXuz8f4ySSvYwY0FKfm+ezbsZBKZxNJlLklBHA= github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q= github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8= 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/bgentry/speakeasy v0.1.0/go.mod h1:+zsyZBPWlz7T6j88CTgSN5bM796AkVf0kBD4zp0CCIs= -github.com/bketelsen/crypt v0.0.4/go.mod h1:aI6NrJ0pMGgvZKL1iVgXLnfIFJtfV+bKCoqOes/6LfM= github.com/casbin/casbin/v2 v2.1.2/go.mod h1:YcPU1XXisHhLzuxH9coDNf2FbKpjGlbCg3n9yuLkIJQ= github.com/cenkalti/backoff v2.2.1+incompatible/go.mod h1:90ReRw6GdpyfrHakVjL/QHaoyV4aDUVVkXQJJJ3NXXM= github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= @@ -135,7 +132,6 @@ github.com/coreos/go-systemd v0.0.0-20180511133405-39ca1b05acc7/go.mod h1:F5haX7 github.com/coreos/go-systemd/v22 v22.3.2/go.mod h1:Y58oyj3AT4RCenI/lSvhwexgC+NSVTIJ3seZv2GcEnc= github.com/coreos/pkg v0.0.0-20160727233714-3ac0863d7acf/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA= github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU= -github.com/cpuguy83/go-md2man/v2 v2.0.0/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU= github.com/cpuguy83/go-md2man/v2 v2.0.1/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= github.com/creack/pty v1.1.7/go.mod h1:lj5s0c3V2DBrqTV7llrYr5NG6My20zk30Fl46Y7DoTY= github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= @@ -195,19 +191,12 @@ github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/me github.com/go-test/deep v1.0.2-0.20181118220953-042da051cf31/go.mod h1:wGDj63lr65AM2AQyKZd/NYHGb0R+1RLqB8NKt3aSFNA= github.com/godbus/dbus/v5 v5.0.4/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA= github.com/gofiber/adaptor/v2 v2.1.1/go.mod h1:jdHkqsqdWzEc0qMB+5svsWL5kdZmaDN2H0C3Hxl8y7c= -github.com/gofiber/adaptor/v2 v2.1.14 h1:fGp2G83lnA5opUk5SQ7YQxnoXMnTXWA4qj/22aYixEU= -github.com/gofiber/adaptor/v2 v2.1.14/go.mod h1:s2KVIM9tgTFdbHFd2yUefy80BMIGjU1w3jc3Umk9ZM8= github.com/gofiber/adaptor/v2 v2.1.16 h1:8dURf+4n/EYFy3+BI1t5xyPQ7ZvOBgXuRFRrWkVNK54= github.com/gofiber/adaptor/v2 v2.1.16/go.mod h1:m6m07fScuw5hpY9ZV027VqorR41XVzi3md6xBg2rdxQ= -github.com/gofiber/contrib/fiberzap v0.0.0-20211104103143-eae1892b9aac h1:oBtsxC4TrZd7WuDro3S8U+AALGq0MzlAYYONzsPypdA= -github.com/gofiber/contrib/fiberzap v0.0.0-20211104103143-eae1892b9aac/go.mod h1:QI2s0bHSHwaic8ssYtm50JvJGgqW+xHxNHXxCaEedwE= github.com/gofiber/contrib/fiberzap v0.0.0-20220112233641-76fa5fde0be2 h1:sZuXSGtb+fccsIrmmuodhYzpaClUp47E7/g+23THt5U= github.com/gofiber/contrib/fiberzap v0.0.0-20220112233641-76fa5fde0be2/go.mod h1:3syX4RQLVr9+5Y6sM9+XrsB5vLVqQ47fFvEUX92stuw= github.com/gofiber/fiber/v2 v2.2.2/go.mod h1:Aso7/M+EQOinVkWp4LUYjdlTpKTBoCk2Qo4djnMsyHE= github.com/gofiber/fiber/v2 v2.6.0/go.mod h1:f8BRRIMjMdRyt2qmJ/0Sea3j3rwwfufPrh9WNBRiVZ0= -github.com/gofiber/fiber/v2 v2.21.0/go.mod h1:MR1usVH3JHYRyQwMe2eZXRSZHRX38fkV+A7CPB+DlDQ= -github.com/gofiber/fiber/v2 v2.22.0 h1:+iyKK4ooDH6z0lAHdaWO1AFIB/DZ9AVo6vz8VZIA0EU= -github.com/gofiber/fiber/v2 v2.22.0/go.mod h1:MR1usVH3JHYRyQwMe2eZXRSZHRX38fkV+A7CPB+DlDQ= github.com/gofiber/fiber/v2 v2.24.0 h1:18rpLoQMJBVlLtX/PwgHj3hIxPSeWfN1YeDJ2lEnzjU= github.com/gofiber/fiber/v2 v2.24.0/go.mod h1:MR1usVH3JHYRyQwMe2eZXRSZHRX38fkV+A7CPB+DlDQ= github.com/gofiber/utils v0.1.2 h1:1SH2YEz4RlNS0tJlMJ0bGwO0JkqPqvq6TbHK9tXZKtk= @@ -217,8 +206,6 @@ github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7a github.com/gogo/protobuf v1.2.0/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= github.com/gogo/protobuf v1.2.1/go.mod h1:hp+jE20tsWTFYpLwKvXlhS1hjn+gTNwPg2I6zVXpSg4= github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q= -github.com/golang-jwt/jwt/v4 v4.1.0 h1:XUgk2Ex5veyVFVeLm0xhusUTQybEbexJXrvPNOKkSY0= -github.com/golang-jwt/jwt/v4 v4.1.0/go.mod h1:/xlHOz8bRuivTWchD4jCa+NbatV+wEUSzwAxVc6locg= github.com/golang-jwt/jwt/v4 v4.2.0 h1:besgBTC8w8HjP6NzQdxwKH9Z5oQMZ24ThTrHp3cZ8eU= github.com/golang-jwt/jwt/v4 v4.2.0/go.mod h1:/xlHOz8bRuivTWchD4jCa+NbatV+wEUSzwAxVc6locg= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= @@ -307,10 +294,8 @@ github.com/grpc-ecosystem/go-grpc-middleware v1.0.1-0.20190118093823-f849b5445de github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0/go.mod h1:8NvIoxWQoOIhqOTXgfV/d3M/q6VIi02HzZEHgUlZvzk= github.com/grpc-ecosystem/grpc-gateway v1.9.5/go.mod h1:vNeuVxBJEsws4ogUvrchl83t/GYV9WGTSLVdBhOQFDY= github.com/grpc-ecosystem/grpc-gateway v1.16.0/go.mod h1:BDjrQk3hbvj6Nolgz8mAMFbcEtjT1g+wF4CSlocrBnw= -github.com/hashicorp/consul/api v1.1.0/go.mod h1:VmuI/Lkw1nC05EYQWNKwWGbkg+FbDBtguAZLlVdkD9Q= github.com/hashicorp/consul/api v1.3.0/go.mod h1:MmDNSzIMUjNpY/mQ398R4bk2FnqQLoPndWW5VkKPlCE= github.com/hashicorp/consul/api v1.11.0/go.mod h1:XjsvQN+RJGWI2TWy1/kqaE16HrR2J/FWgkYjdZQsX9M= -github.com/hashicorp/consul/sdk v0.1.1/go.mod h1:VKf9jXwCTEY1QZP2MOLRhb5i/I/ssyNV1vwHyQBF0x8= github.com/hashicorp/consul/sdk v0.3.0/go.mod h1:VKf9jXwCTEY1QZP2MOLRhb5i/I/ssyNV1vwHyQBF0x8= github.com/hashicorp/consul/sdk v0.8.0/go.mod h1:GBvyrGALthsZObzUGsfgHZQDXjg4lOjagTIwIR1vPms= github.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= @@ -391,12 +376,8 @@ github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= github.com/klauspost/compress v1.10.7/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdYsUV+/s2qKfXs= github.com/klauspost/compress v1.13.4/go.mod h1:8dP1Hq4DHOhN9w426knH3Rhby4rFm6D8eO+e+Dq5Gzg= -github.com/klauspost/compress v1.13.6 h1:P76CopJELS0TiO2mebmnzgWaajssP/EszplttgQxcgc= -github.com/klauspost/compress v1.13.6/go.mod h1:/3/Vjq9QcHkK5uEr5lBEmyoZ1iFhe47etQ6QUkpK6sk= github.com/klauspost/compress v1.14.1 h1:hLQYb23E8/fO+1u53d02A97a8UnsddcvYzq4ERRU4ds= github.com/klauspost/compress v1.14.1/go.mod h1:/3/Vjq9QcHkK5uEr5lBEmyoZ1iFhe47etQ6QUkpK6sk= -github.com/knadh/koanf v1.3.3 h1:eNtBOzQDzkzIIPRCJCx/Ha3DeD/ZFwCAp8JxyqoVAls= -github.com/knadh/koanf v1.3.3/go.mod h1:1cfH5223ZeZUOs8FU2UdTmaNfHpqgtjV0+NHjRO43gs= github.com/knadh/koanf v1.4.0 h1:/k0Bh49SqLyLNfte9r6cvuZWrApOQhglOmhIU3L/zDw= github.com/knadh/koanf v1.4.0/go.mod h1:1cfH5223ZeZUOs8FU2UdTmaNfHpqgtjV0+NHjRO43gs= github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= @@ -450,8 +431,6 @@ github.com/mitchellh/iochan v1.0.0/go.mod h1:JwYml1nuB7xOzsp52dPpHFffvOCDupsG0Qu github.com/mitchellh/mapstructure v0.0.0-20160808181253-ca63d7c062ee/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= github.com/mitchellh/mapstructure v1.4.1/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= -github.com/mitchellh/mapstructure v1.4.2 h1:6h7AQ0yhTcIsmFmnAwQls75jp2Gzs4iB8W7pjMO+rqo= -github.com/mitchellh/mapstructure v1.4.2/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= github.com/mitchellh/mapstructure v1.4.3 h1:OVowDSCllw/YjdLkam3/sm7wEtOy59d8ndGgCcyj8cs= github.com/mitchellh/mapstructure v1.4.3/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= github.com/mitchellh/reflectwalk v1.0.0/go.mod h1:mSTlrgnPZtwu0c4WaC2kGObEpuNDbx0jmZXqmk4esnw= @@ -492,8 +471,7 @@ github.com/pascaldekloe/goe v0.0.0-20180627143212-57f6aae5913c/go.mod h1:lzWF7FI github.com/pascaldekloe/goe v0.1.0/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc= github.com/pborman/uuid v1.2.0/go.mod h1:X/NO0urCmaxf9VXbdlT7C2Yzkj2IKimNn4k+gtPdI/k= github.com/pelletier/go-toml v1.7.0/go.mod h1:vwGMzjaWMwyfHwgIBhI2YUM4fB6nL6lVAvS1LBMMhTE= -github.com/pelletier/go-toml v1.9.3 h1:zeC5b1GviRUyKYd6OJPvBU/mcVDVoL1OhT17FCt5dSQ= -github.com/pelletier/go-toml v1.9.3/go.mod h1:u1nR/EPcESfeI/szUZKdtJ0xRNbUoANCkoOuaOx1Y+c= +github.com/pelletier/go-toml v1.9.4 h1:tjENF6MfZAg8e4ZmZTeWaWiT2vXtsoO6+iuOjFhECwM= github.com/pelletier/go-toml v1.9.4/go.mod h1:u1nR/EPcESfeI/szUZKdtJ0xRNbUoANCkoOuaOx1Y+c= github.com/performancecopilot/speed v3.0.0+incompatible/go.mod h1:/CLtqpZ5gBg1M9iaPbIdPPGyKcA8hKdoy6hAWba7Yac= github.com/pierrec/lz4 v1.0.2-0.20190131084431-473cd7ce01a1/go.mod h1:3/3N9NVKO0jef7pBehbT1qWhCMrIgbYNnFAZCqQ5LRc= @@ -549,8 +527,7 @@ github.com/rogpeppe/fastuuid v0.0.0-20150106093220-6724a57986af/go.mod h1:XWv6So github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6LYCDYWNEvQ= github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= github.com/rogpeppe/go-internal v1.6.1/go.mod h1:xXDCJY+GAPziupqXw64V24skbSoqbTEfhy4qGm1nDQc= -github.com/rogpeppe/go-internal v1.8.0 h1:FCbCCtXNOY3UtUuHUYaghJg4y7Fd14rXifAYUAtL9R8= -github.com/rogpeppe/go-internal v1.8.0/go.mod h1:WmiCO8CzOY8rg0OYDC4/i/2WRWAB6poM+XZ2dLUbcbE= +github.com/rogpeppe/go-internal v1.8.1 h1:geMPLpDpQOgVyCg5z5GoRwLHepNdb71NXb67XFkP+Eg= github.com/rogpeppe/go-internal v1.8.1/go.mod h1:JeRgkft04UBgHMgCIwADu4Pn6Mtm5d4nPKWu0nJ5d+o= github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= @@ -573,18 +550,14 @@ github.com/speps/go-hashids/v2 v2.0.1 h1:ViWOEqWES/pdOSq+C1SLVa8/Tnsd52XC34RY7lt github.com/speps/go-hashids/v2 v2.0.1/go.mod h1:47LKunwvDZki/uRVD6NImtyk712yFzIs3UF3KlHohGw= github.com/spf13/afero v1.3.3/go.mod h1:5KUK8ByomD5Ti5Artl0RtHeI5pTF7MIDuXL3yY520V4= github.com/spf13/afero v1.6.0/go.mod h1:Ai8FlHk4v/PARR026UzYexafAt9roJ7LcLMAmO6Z93I= -github.com/spf13/cast v1.3.1/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE= github.com/spf13/cast v1.4.1/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE= github.com/spf13/cobra v0.0.3/go.mod h1:1l0Ry5zgKvJasoi3XT1TypsSe7PqH0Sj9dhYf7v3XqQ= -github.com/spf13/cobra v1.2.1 h1:+KmjbUw1hriSNMF55oPrkZcb27aECyrj8V2ytv7kWDw= -github.com/spf13/cobra v1.2.1/go.mod h1:ExllRjgxM/piMAM+3tAZvg8fsklGAf3tPfi+i8t68Nk= github.com/spf13/cobra v1.3.0 h1:R7cSvGu+Vv+qX0gW5R/85dx2kmmJT5z5NM8ifdYjdn0= github.com/spf13/cobra v1.3.0/go.mod h1:BrRVncBjOJa/eUcVVm9CE+oC6as8k+VYr4NY7WCi9V4= github.com/spf13/jwalterweatherman v1.1.0/go.mod h1:aNWZUN0dPAAO/Ljvb5BEdw96iTZ0EXowPYD95IqWIGo= github.com/spf13/pflag v1.0.1/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA= github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= -github.com/spf13/viper v1.8.1/go.mod h1:o0Pch8wJ9BVSWGQMbra6iw0oQ5oktSIBaujf1rJH9Ns= github.com/spf13/viper v1.10.0/go.mod h1:SoyBPwAtKDzypXNDFKN5kzH7ppppbGZtls1UpIy5AsM= github.com/streadway/amqp v0.0.0-20190404075320-75d898a42a94/go.mod h1:AZpEONHx3DKn8O/DFsRAY58/XVQiIPMTMB1SddzLXVw= github.com/streadway/amqp v0.0.0-20190827072141-edfb9018d271/go.mod h1:AZpEONHx3DKn8O/DFsRAY58/XVQiIPMTMB1SddzLXVw= @@ -610,7 +583,6 @@ github.com/valyala/bytebufferpool v1.0.0 h1:GqA5TC/0021Y/b9FG4Oi9Mr3q7XYx6Kllzaw github.com/valyala/bytebufferpool v1.0.0/go.mod h1:6bBcMArwyJ5K/AmCkWv1jt77kVWyCJ6HpOuEn7z0Csc= github.com/valyala/fasthttp v1.17.0/go.mod h1:jjraHZVbKOXftJfsOYoAjaeygpj5hr8ermTRJNroD7A= github.com/valyala/fasthttp v1.18.0/go.mod h1:jjraHZVbKOXftJfsOYoAjaeygpj5hr8ermTRJNroD7A= -github.com/valyala/fasthttp v1.31.0 h1:lrauRLII19afgCs2fnWRJ4M5IkV0lo2FqA61uGkNBfE= github.com/valyala/fasthttp v1.31.0/go.mod h1:2rsYD01CKFrjjsvFxx75KlEUNpWNBY9JWD3K/7o2Cus= github.com/valyala/fasthttp v1.32.0 h1:keswgWzyKyNIIjz2a7JmCYHOOIkRp6HMx9oTV6QrZWY= github.com/valyala/fasthttp v1.32.0/go.mod h1:2rsYD01CKFrjjsvFxx75KlEUNpWNBY9JWD3K/7o2Cus= @@ -624,19 +596,12 @@ github.com/yuin/goldmark v1.1.32/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9de github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.3.5/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= github.com/yuin/goldmark v1.4.1/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= -gitlab.snapp.ir/dispatching/snappids/v2 v2.8.0 h1:5BzBqfPB59hEHfHzfU4gcWKfiDBjNWcf68GAUgeRPu4= -gitlab.snapp.ir/dispatching/snappids/v2 v2.8.0/go.mod h1:U7lxAuqPifdXkUNcCXhtk9+6HFAyw5qy8LrF1DQDMuQ= -gitlab.snapp.ir/dispatching/snappids/v2 v2.8.2 h1:yWTrWlnD8ErnVc5D4WLSOIkDwyiFI6+pSaSFd/rTppI= -gitlab.snapp.ir/dispatching/snappids/v2 v2.8.2/go.mod h1:U7lxAuqPifdXkUNcCXhtk9+6HFAyw5qy8LrF1DQDMuQ= gitlab.snapp.ir/dispatching/snappids/v2 v2.9.0 h1:nb3uqHasVp4CGvS8jJKP5c/dkff9XJfOToGwqctXoVo= gitlab.snapp.ir/dispatching/snappids/v2 v2.9.0/go.mod h1:U7lxAuqPifdXkUNcCXhtk9+6HFAyw5qy8LrF1DQDMuQ= go.etcd.io/bbolt v1.3.3/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU= go.etcd.io/etcd v0.0.0-20191023171146-3cf2f69b5738/go.mod h1:dnLIgRNXwCJa5e+c6mIZCrds/GIG4ncV9HhK5PX7jPg= -go.etcd.io/etcd/api/v3 v3.5.0/go.mod h1:cbVKeC6lCfl7j/8jBhAK6aIYO9XOjdptoxU/nLQcPvs= go.etcd.io/etcd/api/v3 v3.5.1/go.mod h1:cbVKeC6lCfl7j/8jBhAK6aIYO9XOjdptoxU/nLQcPvs= -go.etcd.io/etcd/client/pkg/v3 v3.5.0/go.mod h1:IJHfcCEKxYu1Os13ZdwCwIUTUVGYTSAM3YSwc9/Ac1g= go.etcd.io/etcd/client/pkg/v3 v3.5.1/go.mod h1:IJHfcCEKxYu1Os13ZdwCwIUTUVGYTSAM3YSwc9/Ac1g= -go.etcd.io/etcd/client/v2 v2.305.0/go.mod h1:h9puh54ZTgAKtEbut2oe9P4L/oqKCVB6xsXlzd7alYQ= go.etcd.io/etcd/client/v2 v2.305.1/go.mod h1:pMEacxZW7o8pg4CrFE7pquyCJJzZvkvdD2RibOCCCGs= go.opencensus.io v0.20.1/go.mod h1:6WKK9ahsWS3RSO+PY9ZHZUfv2irvY6gN279GOPZjmmk= go.opencensus.io v0.20.2/go.mod h1:6WKK9ahsWS3RSO+PY9ZHZUfv2irvY6gN279GOPZjmmk= @@ -647,20 +612,12 @@ go.opencensus.io v0.22.3/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= go.opencensus.io v0.22.4/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= go.opencensus.io v0.22.5/go.mod h1:5pWMHQbX5EPX2/62yrJeAkowc+lfs/XD7Uxpq3pI6kk= go.opencensus.io v0.23.0/go.mod h1:XItmlyltB5F7CS4xOC1DcqMoFqwtC6OG2xF7mCv7P7E= -go.opentelemetry.io/otel v1.2.0 h1:YOQDvxO1FayUcT9MIhJhgMyNO1WqoduiyvQHzGN0kUQ= -go.opentelemetry.io/otel v1.2.0/go.mod h1:aT17Fk0Z1Nor9e0uisf98LrntPGMnk4frBO9+dkf69I= go.opentelemetry.io/otel v1.3.0 h1:APxLf0eiBwLl+SOXiJJCVYzA1OOJNyAoV8C5RNRyy7Y= go.opentelemetry.io/otel v1.3.0/go.mod h1:PWIKzi6JCp7sM0k9yZ43VX+T345uNbAkDKwHVjb2PTs= -go.opentelemetry.io/otel/exporters/jaeger v1.2.0 h1:C/5Egj3MJBXRJi22cSl07suqPqtZLnLFmH//OxETUEc= -go.opentelemetry.io/otel/exporters/jaeger v1.2.0/go.mod h1:KJLFbEMKTNPIfOxcg/WikIozEoKcPgJRz3Ce1vLlM8E= go.opentelemetry.io/otel/exporters/jaeger v1.3.0 h1:HfydzioALdtcB26H5WHc4K47iTETJCdloL7VN579/L0= go.opentelemetry.io/otel/exporters/jaeger v1.3.0/go.mod h1:KoYHi1BtkUPncGSRtCe/eh1ijsnePhSkxwzz07vU0Fc= -go.opentelemetry.io/otel/sdk v1.2.0 h1:wKN260u4DesJYhyjxDa7LRFkuhH7ncEVKU37LWcyNIo= -go.opentelemetry.io/otel/sdk v1.2.0/go.mod h1:jNN8QtpvbsKhgaC6V5lHiejMoKD+V8uadoSafgHPx1U= go.opentelemetry.io/otel/sdk v1.3.0 h1:3278edCoH89MEJ0Ky8WQXVmDQv3FX4ZJ3Pp+9fJreAI= go.opentelemetry.io/otel/sdk v1.3.0/go.mod h1:rIo4suHNhQwBIPg9axF8V9CA72Wz2mKF1teNrup8yzs= -go.opentelemetry.io/otel/trace v1.2.0 h1:Ys3iqbqZhcf28hHzrm5WAquMkDHNZTUkw7KHbuNjej0= -go.opentelemetry.io/otel/trace v1.2.0/go.mod h1:N5FLswTubnxKxOJHM7XZC074qpeEdLy3CgAVsdMucK0= go.opentelemetry.io/otel/trace v1.3.0 h1:doy8Hzb1RJ+I3yFhtDmwNc7tIyw1tNMOIsyPzp1NOGY= go.opentelemetry.io/otel/trace v1.3.0/go.mod h1:c/VDhno8888bvQYmbYLqe41/Ldmr/KKunbvWM4/fEjk= go.opentelemetry.io/proto/otlp v0.7.0/go.mod h1:PqfVotwruBrMGOCsRd/89rSnXhoiJIqeYNgFYFoEGnI= @@ -671,9 +628,8 @@ go.uber.org/atomic v1.9.0 h1:ECmE8Bn/WFTYwEW/bpKD3M8VtR/zQVbavAoalC1PYyE= go.uber.org/atomic v1.9.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc= go.uber.org/automaxprocs v1.4.0 h1:CpDZl6aOlLhReez+8S3eEotD7Jx0Os++lemPlMULQP0= go.uber.org/automaxprocs v1.4.0/go.mod h1:/mTEdr7LvHhs0v7mjdxDreTz1OG5zdZGqgOnhWiR/+Q= -go.uber.org/goleak v1.1.11-0.20210813005559-691160354723 h1:sHOAIxRGBp443oHZIPB+HsUGaksVCXVQENPxwTfQdH4= -go.uber.org/goleak v1.1.11-0.20210813005559-691160354723/go.mod h1:cwTWslyiVhfpKIDGSZEM2HlOvcqm+tG4zioyIeLoqMQ= go.uber.org/goleak v1.1.11/go.mod h1:cwTWslyiVhfpKIDGSZEM2HlOvcqm+tG4zioyIeLoqMQ= +go.uber.org/goleak v1.1.12 h1:gZAh5/EyT/HQwlpkCy6wTpqfH9H8Lz8zbm3dZh+OyzA= go.uber.org/goleak v1.1.12/go.mod h1:cwTWslyiVhfpKIDGSZEM2HlOvcqm+tG4zioyIeLoqMQ= go.uber.org/multierr v1.1.0/go.mod h1:wR5kodmAFQ0UK8QlbwjlSNy0Z68gJhDJUG5sjR94q/0= go.uber.org/multierr v1.3.0/go.mod h1:VgVr7evmIr6uPjLBxg28wmKNXyqE9akIJ5XnfpiKl+4= @@ -684,8 +640,6 @@ go.uber.org/tools v0.0.0-20190618225709-2cfd321de3ee/go.mod h1:vJERXedbb3MVM5f9E go.uber.org/zap v1.10.0/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q= go.uber.org/zap v1.13.0/go.mod h1:zwrFLgMcdUuIBviXEYEH1YKNaOBnKXsx2IPda5bBwHM= go.uber.org/zap v1.17.0/go.mod h1:MXVU+bhUf/A7Xi2HNOnopQOrmycQ5Ih87HtOu4q5SSo= -go.uber.org/zap v1.19.1 h1:ue41HOKd1vGURxrmeKIgELGb3jPW9DMUDGtsinblHwI= -go.uber.org/zap v1.19.1/go.mod h1:j3DNczoxDZroyBnOT1L/Q79cfUMGZxlv/9dzN7SM1rI= go.uber.org/zap v1.20.0 h1:N4oPlghZwYG55MlU6LXk/Zp00FVNE9X9wrYO8CEs4lc= go.uber.org/zap v1.20.0/go.mod h1:wjWOCqI0f2ZZrJF/UufIOkiC8ii6tm1iqIsLo76RfJw= golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= @@ -798,7 +752,6 @@ golang.org/x/oauth2 v0.0.0-20201208152858-08078c50e5b5/go.mod h1:KelEdhl1UZF7XfJ golang.org/x/oauth2 v0.0.0-20210218202405-ba52d332ba99/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/oauth2 v0.0.0-20210220000619-9bb904979d93/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/oauth2 v0.0.0-20210313182246-cd4f82c27b84/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= -golang.org/x/oauth2 v0.0.0-20210402161424-2e8d93401602/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/oauth2 v0.0.0-20210514164344-f6687ab2804c/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/oauth2 v0.0.0-20210628180205-a41e5a781914/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/oauth2 v0.0.0-20210805134026-6f1e6394065a/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= @@ -895,12 +848,8 @@ golang.org/x/sys v0.0.0-20210823070655-63515b42dcdf/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20210908233432-aa78b53d3365/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210927094055-39ccf1dd6fa6/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20211007075335-d3039528d8ac/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20211013075003-97ac67df715c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20211019181941-9d821ace8654/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20211123173158-ef496fb156ab h1:rfJ1bsoJQQIAoAxTxB7bme+vHrNkRw8CqfsYh9w54cw= -golang.org/x/sys v0.0.0-20211123173158-ef496fb156ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20211124211545-fe61309f8881/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20211205182925-97ca703d548d h1:FjkYO/PPp4Wi0EAUOVLxePm7qVW4r4ctbWpURyuOD0E= golang.org/x/sys v0.0.0-20211205182925-97ca703d548d/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220111092808-5a964db01320 h1:0jf+tOCoZ3LyutmCOWpVni1chK4VfFLhRsDK7MhqGRY= golang.org/x/sys v0.0.0-20220111092808-5a964db01320/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= @@ -940,7 +889,6 @@ golang.org/x/tools v0.0.0-20190911174233-4f2ddba30aff/go.mod h1:b+2E5dAYhXwXZwtn golang.org/x/tools v0.0.0-20191012152004-8de300cfc20a/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191029041327-9cc4af7d6b2c/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191029190741-b9c20aec41a5/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191112195655-aa38f8e97acc/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191113191852-77e3bb0ad9e7/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191115202509-3a792d9c32b2/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= @@ -1008,7 +956,6 @@ google.golang.org/api v0.36.0/go.mod h1:+z5ficQTmoYpPn8LCUNVpK5I7hwkpjbcgqA7I34q google.golang.org/api v0.40.0/go.mod h1:fYKFpnQN0DsDSKRVRcQSDQNtqWPfM9i+zNPxepjRCQ8= google.golang.org/api v0.41.0/go.mod h1:RkxM5lITDfTzmyKFPt+wGrCJbVfniCr2ool8kTBzRTU= google.golang.org/api v0.43.0/go.mod h1:nQsDGjRXMo4lvh5hP0TKqF244gqhGcr/YSIykhUk/94= -google.golang.org/api v0.44.0/go.mod h1:EBOGZqzyhtvMDoxwS97ctnh0zUmYY6CxqXsc1AvkYD8= google.golang.org/api v0.47.0/go.mod h1:Wbvgpq1HddcWVtzsVLyfLp8lDg6AA241LmgIL59tHXo= google.golang.org/api v0.48.0/go.mod h1:71Pr1vy+TAZRPkPs/xlCf5SsU8WjuAWv1Pfjbtukyy4= google.golang.org/api v0.50.0/go.mod h1:4bNT5pAuq5ji4SRZm+5QIkjny9JAyVD/3gaSihNefaw= @@ -1153,7 +1100,6 @@ gopkg.in/cheggaaa/pb.v1 v1.0.25/go.mod h1:V/YB90LKu/1FcN3WVnfiiE5oMCibMjukxqG/qS gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys= gopkg.in/gcfg.v1 v1.2.3/go.mod h1:yesOnuUOFQAhST5vPY4nbZsb/huCgGGXlipJsBn0b3o= -gopkg.in/ini.v1 v1.62.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= gopkg.in/ini.v1 v1.66.2/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= gopkg.in/resty.v1 v1.12.0/go.mod h1:mDo4pnntr5jdWRML875a/NmxYqAlA73dVijT2AXvQQo= gopkg.in/square/go-jose.v2 v2.3.1/go.mod h1:M9dMgbHiYLoDGQrXy7OpJDJWiKiU//h+vD76mk0e1AI= diff --git a/internal/api/acl.go b/internal/api/acl.go index 6c50ac46..f28b233a 100644 --- a/internal/api/acl.go +++ b/internal/api/acl.go @@ -24,6 +24,7 @@ type aclRequest struct { // ACL is the handler responsible for ACL requests. // nolint: wrapcheck, funlen func ACL(c *fiber.Ctx) error { + // TODO: use a type for ACL and Auth to remove the global app _, span := app.GetInstance().Tracer.Start(c.Context(), "api.acl") defer span.End() @@ -62,6 +63,7 @@ func ACL(c *fiber.Ctx) error { topic := request.Topic + // TODO: Also remove it from here ok, err := app.GetInstance().Authenticator.ACL(request.Access, tokenString, topic) if err != nil || !ok { if err != nil { diff --git a/internal/api/api.go b/internal/api/api.go index e5a284fd..5b4d274f 100644 --- a/internal/api/api.go +++ b/internal/api/api.go @@ -20,6 +20,7 @@ func ReSTServer() *fiber.App { prometheus.RegisterAt(app, "/metrics") app.Use(prometheus.Middleware) + // TODO: you can set the api struct somewhere here app.Post("/auth", Auth) app.Post("/acl", ACL) diff --git a/internal/api/auth.go b/internal/api/auth.go index 0cf2c12e..f5566b9e 100644 --- a/internal/api/auth.go +++ b/internal/api/auth.go @@ -19,6 +19,7 @@ type authRequest struct { // Auth is the handler responsible for authentication. // nolint: wrapcheck func Auth(c *fiber.Ctx) error { + // TODO: use the type for app to fix this problem _, span := app.GetInstance().Tracer.Start(c.Context(), "api.auth") defer span.End() @@ -50,6 +51,7 @@ func Auth(c *fiber.Ctx) error { attribute.String("password", request.Username), ) + // TODO: also remove it from here if err := app.GetInstance().Authenticator.Auth(tokenString); err != nil { span.RecordError(err) diff --git a/internal/app/a.go b/internal/app/a.go index 79ca28c6..fec4c321 100644 --- a/internal/app/a.go +++ b/internal/app/a.go @@ -18,6 +18,7 @@ var ( once sync.Once ) +// TODO: We need to get this removed! func GetInstance() *App { once.Do(func() { singleton = new(App) diff --git a/internal/cmd/serve/main.go b/internal/cmd/serve/main.go index a8d1c1a7..a95a2ba5 100644 --- a/internal/cmd/serve/main.go +++ b/internal/cmd/serve/main.go @@ -47,6 +47,7 @@ func main(cfg config.Config, logger *zap.Logger, tracer trace.Tracer) { logger.Fatal("error while getting allowed access types", zap.Error(err)) } + // TODO: After generating the app type struct, set the two following attributes app.GetInstance().SetAuthenticator(&authenticator.Authenticator{ PublicKeys: map[user.Issuer]*rsa.PublicKey{ user.Driver: publicKey0, From af48da48946690b756ea64a276126e3d7245c398 Mon Sep 17 00:00:00 2001 From: amirhnajafiz Date: Mon, 14 Feb 2022 11:08:36 +0330 Subject: [PATCH 186/660] remove global app API struct created --- internal/api/acl.go | 9 +++------ internal/api/api.go | 5 +++++ 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/internal/api/acl.go b/internal/api/acl.go index f28b233a..1e13b6da 100644 --- a/internal/api/acl.go +++ b/internal/api/acl.go @@ -5,7 +5,6 @@ import ( "net/http" "github.com/gofiber/fiber/v2" - "gitlab.snapp.ir/dispatching/soteria/internal/app" "gitlab.snapp.ir/dispatching/soteria/internal/authenticator" "gitlab.snapp.ir/dispatching/soteria/pkg/acl" "go.opentelemetry.io/otel/attribute" @@ -23,9 +22,8 @@ type aclRequest struct { // ACL is the handler responsible for ACL requests. // nolint: wrapcheck, funlen -func ACL(c *fiber.Ctx) error { - // TODO: use a type for ACL and Auth to remove the global app - _, span := app.GetInstance().Tracer.Start(c.Context(), "api.acl") +func (a API) ACL(c *fiber.Ctx) error { + _, span := a.App.Tracer.Start(c.Context(), "api.acl") defer span.End() request := new(aclRequest) @@ -63,8 +61,7 @@ func ACL(c *fiber.Ctx) error { topic := request.Topic - // TODO: Also remove it from here - ok, err := app.GetInstance().Authenticator.ACL(request.Access, tokenString, topic) + ok, err := a.App.Authenticator.ACL(request.Access, tokenString, topic) if err != nil || !ok { if err != nil { span.RecordError(err) diff --git a/internal/api/api.go b/internal/api/api.go index 5b4d274f..e53963b6 100644 --- a/internal/api/api.go +++ b/internal/api/api.go @@ -4,9 +4,14 @@ import ( "github.com/ansrivas/fiberprometheus/v2" "github.com/gofiber/contrib/fiberzap" "github.com/gofiber/fiber/v2" + "gitlab.snapp.ir/dispatching/soteria/internal/app" "go.uber.org/zap" ) +type API struct { + App *app.App +} + // ReSTServer will return fiber app. func ReSTServer() *fiber.App { app := fiber.New() From 579dae18d2b78483a75e92fe9a523a5de6b22258 Mon Sep 17 00:00:00 2001 From: amirhnajafiz Date: Mon, 14 Feb 2022 11:09:43 +0330 Subject: [PATCH 187/660] remove global app from auth --- internal/api/auth.go | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/internal/api/auth.go b/internal/api/auth.go index f5566b9e..a6c86c11 100644 --- a/internal/api/auth.go +++ b/internal/api/auth.go @@ -4,7 +4,6 @@ import ( "net/http" "github.com/gofiber/fiber/v2" - "gitlab.snapp.ir/dispatching/soteria/internal/app" "go.opentelemetry.io/otel/attribute" "go.uber.org/zap" ) @@ -18,9 +17,8 @@ type authRequest struct { // Auth is the handler responsible for authentication. // nolint: wrapcheck -func Auth(c *fiber.Ctx) error { - // TODO: use the type for app to fix this problem - _, span := app.GetInstance().Tracer.Start(c.Context(), "api.auth") +func (a API) Auth(c *fiber.Ctx) error { + _, span := a.App.Tracer.Start(c.Context(), "api.auth") defer span.End() request := new(authRequest) @@ -51,8 +49,7 @@ func Auth(c *fiber.Ctx) error { attribute.String("password", request.Username), ) - // TODO: also remove it from here - if err := app.GetInstance().Authenticator.Auth(tokenString); err != nil { + if err := a.App.Authenticator.Auth(tokenString); err != nil { span.RecordError(err) zap.L(). From 9eac56700af1b0326784f8cda4a5b8a6172d5949 Mon Sep 17 00:00:00 2001 From: amirhnajafiz Date: Mon, 14 Feb 2022 11:13:49 +0330 Subject: [PATCH 188/660] remove global app ReST server method set --- internal/api/api.go | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/internal/api/api.go b/internal/api/api.go index e53963b6..d80adf81 100644 --- a/internal/api/api.go +++ b/internal/api/api.go @@ -13,7 +13,7 @@ type API struct { } // ReSTServer will return fiber app. -func ReSTServer() *fiber.App { +func (a API) ReSTServer() *fiber.App { app := fiber.New() // nolint: exhaustivestruct @@ -25,9 +25,8 @@ func ReSTServer() *fiber.App { prometheus.RegisterAt(app, "/metrics") app.Use(prometheus.Middleware) - // TODO: you can set the api struct somewhere here - app.Post("/auth", Auth) - app.Post("/acl", ACL) + app.Post("/auth", a.Auth) + app.Post("/acl", a.ACL) return app } From 40e0b373662be8f68855205caaade646112aab53 Mon Sep 17 00:00:00 2001 From: amirhnajafiz Date: Mon, 14 Feb 2022 11:16:00 +0330 Subject: [PATCH 189/660] remove global app serve main fixed --- internal/api/api.go | 2 +- internal/cmd/serve/main.go | 24 ++++++++++++++---------- 2 files changed, 15 insertions(+), 11 deletions(-) diff --git a/internal/api/api.go b/internal/api/api.go index d80adf81..1b49259f 100644 --- a/internal/api/api.go +++ b/internal/api/api.go @@ -9,7 +9,7 @@ import ( ) type API struct { - App *app.App + App app.App } // ReSTServer will return fiber app. diff --git a/internal/cmd/serve/main.go b/internal/cmd/serve/main.go index a95a2ba5..5c5aae80 100644 --- a/internal/cmd/serve/main.go +++ b/internal/cmd/serve/main.go @@ -47,18 +47,22 @@ func main(cfg config.Config, logger *zap.Logger, tracer trace.Tracer) { logger.Fatal("error while getting allowed access types", zap.Error(err)) } - // TODO: After generating the app type struct, set the two following attributes - app.GetInstance().SetAuthenticator(&authenticator.Authenticator{ - PublicKeys: map[user.Issuer]*rsa.PublicKey{ - user.Driver: publicKey0, - user.Passenger: publicKey1, + app := app.App{ + Authenticator: &authenticator.Authenticator{ + PublicKeys: map[user.Issuer]*rsa.PublicKey{ + user.Driver: publicKey0, + user.Passenger: publicKey1, + }, + AllowedAccessTypes: allowedAccessTypes, + Company: cfg.Company, + TopicManager: topics.NewTopicManager(cfg.Topics, hid, cfg.Company), }, - AllowedAccessTypes: allowedAccessTypes, - Company: cfg.Company, - TopicManager: topics.NewTopicManager(cfg.Topics, hid, cfg.Company), - }) + Tracer: tracer, + } - app.GetInstance().SetTracer(tracer) + api := api.API{ + App: app, + } rest := api.ReSTServer() From 908e3f6893ab1de70281ebc73e5e7dda90ce5d79 Mon Sep 17 00:00:00 2001 From: amirhnajafiz Date: Mon, 14 Feb 2022 11:17:22 +0330 Subject: [PATCH 190/660] remove global app fixed the app package --- internal/app/a.go | 36 ------------------------------------ internal/app/app.go | 11 +++++++++++ 2 files changed, 11 insertions(+), 36 deletions(-) delete mode 100644 internal/app/a.go create mode 100644 internal/app/app.go diff --git a/internal/app/a.go b/internal/app/a.go deleted file mode 100644 index fec4c321..00000000 --- a/internal/app/a.go +++ /dev/null @@ -1,36 +0,0 @@ -package app - -import ( - "sync" - - "gitlab.snapp.ir/dispatching/soteria/internal/authenticator" - "go.opentelemetry.io/otel/trace" -) - -type App struct { - Authenticator *authenticator.Authenticator - Tracer trace.Tracer -} - -// nolint: gochecknoglobals -var ( - singleton *App - once sync.Once -) - -// TODO: We need to get this removed! -func GetInstance() *App { - once.Do(func() { - singleton = new(App) - }) - - return singleton -} - -func (a *App) SetAuthenticator(authenticator *authenticator.Authenticator) { - a.Authenticator = authenticator -} - -func (a *App) SetTracer(tracer trace.Tracer) { - a.Tracer = tracer -} diff --git a/internal/app/app.go b/internal/app/app.go new file mode 100644 index 00000000..ce5e33de --- /dev/null +++ b/internal/app/app.go @@ -0,0 +1,11 @@ +package app + +import ( + "gitlab.snapp.ir/dispatching/soteria/internal/authenticator" + "go.opentelemetry.io/otel/trace" +) + +type App struct { + Authenticator *authenticator.Authenticator + Tracer trace.Tracer +} From 83d69170645521ec60c841a6f653a7f5d8caae84 Mon Sep 17 00:00:00 2001 From: amirhnajafiz Date: Mon, 14 Feb 2022 11:19:52 +0330 Subject: [PATCH 191/660] remove global app moved to api --- internal/api/api.go | 6 ++++-- internal/cmd/serve/main.go | 9 ++------- 2 files changed, 6 insertions(+), 9 deletions(-) diff --git a/internal/api/api.go b/internal/api/api.go index 1b49259f..c2d940b9 100644 --- a/internal/api/api.go +++ b/internal/api/api.go @@ -4,12 +4,14 @@ import ( "github.com/ansrivas/fiberprometheus/v2" "github.com/gofiber/contrib/fiberzap" "github.com/gofiber/fiber/v2" - "gitlab.snapp.ir/dispatching/soteria/internal/app" + "gitlab.snapp.ir/dispatching/soteria/internal/authenticator" + "go.opentelemetry.io/otel/trace" "go.uber.org/zap" ) type API struct { - App app.App + Authenticator *authenticator.Authenticator + Tracer trace.Tracer } // ReSTServer will return fiber app. diff --git a/internal/cmd/serve/main.go b/internal/cmd/serve/main.go index 5c5aae80..091bfb76 100644 --- a/internal/cmd/serve/main.go +++ b/internal/cmd/serve/main.go @@ -11,7 +11,6 @@ import ( "github.com/spf13/cobra" "gitlab.snapp.ir/dispatching/snappids/v2" "gitlab.snapp.ir/dispatching/soteria/internal/api" - "gitlab.snapp.ir/dispatching/soteria/internal/app" "gitlab.snapp.ir/dispatching/soteria/internal/authenticator" "gitlab.snapp.ir/dispatching/soteria/internal/config" "gitlab.snapp.ir/dispatching/soteria/internal/topics" @@ -47,7 +46,7 @@ func main(cfg config.Config, logger *zap.Logger, tracer trace.Tracer) { logger.Fatal("error while getting allowed access types", zap.Error(err)) } - app := app.App{ + api2 := api.API{ Authenticator: &authenticator.Authenticator{ PublicKeys: map[user.Issuer]*rsa.PublicKey{ user.Driver: publicKey0, @@ -60,11 +59,7 @@ func main(cfg config.Config, logger *zap.Logger, tracer trace.Tracer) { Tracer: tracer, } - api := api.API{ - App: app, - } - - rest := api.ReSTServer() + rest := api2.ReSTServer() go func() { if err := rest.Listen(fmt.Sprintf(":%d", cfg.HTTPPort)); err != nil && !errors.Is(err, http.ErrServerClosed) { From 0800a46871ad4ba7aa0ebb65a627ca4826516148 Mon Sep 17 00:00:00 2001 From: amirhnajafiz Date: Mon, 14 Feb 2022 11:21:14 +0330 Subject: [PATCH 192/660] remove global app api attributes set completly --- internal/api/acl.go | 4 ++-- internal/api/auth.go | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/internal/api/acl.go b/internal/api/acl.go index 1e13b6da..9a1b5389 100644 --- a/internal/api/acl.go +++ b/internal/api/acl.go @@ -23,7 +23,7 @@ type aclRequest struct { // ACL is the handler responsible for ACL requests. // nolint: wrapcheck, funlen func (a API) ACL(c *fiber.Ctx) error { - _, span := a.App.Tracer.Start(c.Context(), "api.acl") + _, span := a.Tracer.Start(c.Context(), "api.acl") defer span.End() request := new(aclRequest) @@ -61,7 +61,7 @@ func (a API) ACL(c *fiber.Ctx) error { topic := request.Topic - ok, err := a.App.Authenticator.ACL(request.Access, tokenString, topic) + ok, err := a.Authenticator.ACL(request.Access, tokenString, topic) if err != nil || !ok { if err != nil { span.RecordError(err) diff --git a/internal/api/auth.go b/internal/api/auth.go index a6c86c11..6580b326 100644 --- a/internal/api/auth.go +++ b/internal/api/auth.go @@ -18,7 +18,7 @@ type authRequest struct { // Auth is the handler responsible for authentication. // nolint: wrapcheck func (a API) Auth(c *fiber.Ctx) error { - _, span := a.App.Tracer.Start(c.Context(), "api.auth") + _, span := a.Tracer.Start(c.Context(), "api.auth") defer span.End() request := new(authRequest) @@ -49,7 +49,7 @@ func (a API) Auth(c *fiber.Ctx) error { attribute.String("password", request.Username), ) - if err := a.App.Authenticator.Auth(tokenString); err != nil { + if err := a.Authenticator.Auth(tokenString); err != nil { span.RecordError(err) zap.L(). From a3cc379b8bd9d4b18c251c734fad792ceef9ff4f Mon Sep 17 00:00:00 2001 From: amirhnajafiz Date: Mon, 14 Feb 2022 11:22:14 +0330 Subject: [PATCH 193/660] remove global app package removed --- internal/app/app.go | 11 ----------- 1 file changed, 11 deletions(-) delete mode 100644 internal/app/app.go diff --git a/internal/app/app.go b/internal/app/app.go deleted file mode 100644 index ce5e33de..00000000 --- a/internal/app/app.go +++ /dev/null @@ -1,11 +0,0 @@ -package app - -import ( - "gitlab.snapp.ir/dispatching/soteria/internal/authenticator" - "go.opentelemetry.io/otel/trace" -) - -type App struct { - Authenticator *authenticator.Authenticator - Tracer trace.Tracer -} From 70a82972effc591f9dbd8dab41105e0107f7425f Mon Sep 17 00:00:00 2001 From: Parham Alvani Date: Wed, 16 Feb 2022 07:30:20 +0330 Subject: [PATCH 194/660] feat: update packages --- go.mod | 26 +++++++++++++------------- go.sum | 32 ++++++++++++++++++++++++++++++++ 2 files changed, 45 insertions(+), 13 deletions(-) diff --git a/go.mod b/go.mod index c801a555..4c1d2bac 100644 --- a/go.mod +++ b/go.mod @@ -4,25 +4,25 @@ go 1.17 require ( github.com/ansrivas/fiberprometheus/v2 v2.1.2 - github.com/gofiber/contrib/fiberzap v0.0.0-20220112233641-76fa5fde0be2 - github.com/gofiber/fiber/v2 v2.24.0 - github.com/golang-jwt/jwt/v4 v4.2.0 + github.com/gofiber/contrib/fiberzap v0.0.0-20220215083858-d7416de5f637 + github.com/gofiber/fiber/v2 v2.27.0 + github.com/golang-jwt/jwt/v4 v4.3.0 github.com/knadh/koanf v1.4.0 - github.com/prometheus/client_golang v1.11.0 // indirect + github.com/prometheus/client_golang v1.12.1 // indirect github.com/spf13/cobra v1.3.0 github.com/stretchr/testify v1.7.0 gitlab.snapp.ir/dispatching/snappids/v2 v2.9.0 go.uber.org/atomic v1.9.0 // indirect go.uber.org/automaxprocs v1.4.0 - go.uber.org/zap v1.20.0 + go.uber.org/zap v1.21.0 ) require ( github.com/tidwall/pretty v1.2.0 - go.opentelemetry.io/otel v1.3.0 - go.opentelemetry.io/otel/exporters/jaeger v1.3.0 - go.opentelemetry.io/otel/sdk v1.3.0 - go.opentelemetry.io/otel/trace v1.3.0 + go.opentelemetry.io/otel v1.4.0 + go.opentelemetry.io/otel/exporters/jaeger v1.4.0 + go.opentelemetry.io/otel/sdk v1.4.0 + go.opentelemetry.io/otel/trace v1.4.0 ) require ( @@ -34,11 +34,11 @@ require ( github.com/fsnotify/fsnotify v1.5.1 // indirect github.com/go-logr/logr v1.2.2 // indirect github.com/go-logr/stdr v1.2.2 // indirect - github.com/gofiber/adaptor/v2 v2.1.16 // indirect + github.com/gofiber/adaptor/v2 v2.1.18 // indirect github.com/gofiber/utils v0.1.2 // indirect github.com/golang/protobuf v1.5.2 // indirect github.com/inconshreveable/mousetrap v1.0.0 // indirect - github.com/klauspost/compress v1.14.1 // indirect + github.com/klauspost/compress v1.14.2 // indirect github.com/matttproud/golang_protobuf_extensions v1.0.1 // indirect github.com/mitchellh/copystructure v1.2.0 // indirect github.com/mitchellh/mapstructure v1.4.3 // indirect @@ -50,10 +50,10 @@ require ( github.com/speps/go-hashids/v2 v2.0.1 // indirect github.com/spf13/pflag v1.0.5 // indirect github.com/valyala/bytebufferpool v1.0.0 // indirect - github.com/valyala/fasthttp v1.32.0 // indirect + github.com/valyala/fasthttp v1.33.0 // indirect github.com/valyala/tcplisten v1.0.0 // indirect go.uber.org/multierr v1.7.0 // indirect - golang.org/x/sys v0.0.0-20220111092808-5a964db01320 // indirect + golang.org/x/sys v0.0.0-20220209214540-3681064d5158 // indirect google.golang.org/protobuf v1.27.1 // indirect gopkg.in/yaml.v2 v2.4.0 // indirect gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b // indirect diff --git a/go.sum b/go.sum index 1fa44409..ffc45c69 100644 --- a/go.sum +++ b/go.sum @@ -193,12 +193,18 @@ github.com/godbus/dbus/v5 v5.0.4/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5x github.com/gofiber/adaptor/v2 v2.1.1/go.mod h1:jdHkqsqdWzEc0qMB+5svsWL5kdZmaDN2H0C3Hxl8y7c= github.com/gofiber/adaptor/v2 v2.1.16 h1:8dURf+4n/EYFy3+BI1t5xyPQ7ZvOBgXuRFRrWkVNK54= github.com/gofiber/adaptor/v2 v2.1.16/go.mod h1:m6m07fScuw5hpY9ZV027VqorR41XVzi3md6xBg2rdxQ= +github.com/gofiber/adaptor/v2 v2.1.18 h1:J0UlV40ng4K0Nb9mBw7b8bgX4AcFfPQw1+cybnSyXLU= +github.com/gofiber/adaptor/v2 v2.1.18/go.mod h1:20XTo3Nxorrxwi5vBFdPpaZstEM4n/Nx3pSfakFrczg= github.com/gofiber/contrib/fiberzap v0.0.0-20220112233641-76fa5fde0be2 h1:sZuXSGtb+fccsIrmmuodhYzpaClUp47E7/g+23THt5U= github.com/gofiber/contrib/fiberzap v0.0.0-20220112233641-76fa5fde0be2/go.mod h1:3syX4RQLVr9+5Y6sM9+XrsB5vLVqQ47fFvEUX92stuw= +github.com/gofiber/contrib/fiberzap v0.0.0-20220215083858-d7416de5f637 h1:0oUJsQddXrPwsDiBEChd/xx/v+qSWfUILHZzv9SEy9k= +github.com/gofiber/contrib/fiberzap v0.0.0-20220215083858-d7416de5f637/go.mod h1:U7hH82bwDTwfqu9NjVJ68ccUEv+Cz3ro0/qJmyYj8dc= github.com/gofiber/fiber/v2 v2.2.2/go.mod h1:Aso7/M+EQOinVkWp4LUYjdlTpKTBoCk2Qo4djnMsyHE= github.com/gofiber/fiber/v2 v2.6.0/go.mod h1:f8BRRIMjMdRyt2qmJ/0Sea3j3rwwfufPrh9WNBRiVZ0= github.com/gofiber/fiber/v2 v2.24.0 h1:18rpLoQMJBVlLtX/PwgHj3hIxPSeWfN1YeDJ2lEnzjU= github.com/gofiber/fiber/v2 v2.24.0/go.mod h1:MR1usVH3JHYRyQwMe2eZXRSZHRX38fkV+A7CPB+DlDQ= +github.com/gofiber/fiber/v2 v2.27.0 h1:u34t1nOea7zz4jcZDK7+ZMiG+MVFYrHqMhTdYQDiFA8= +github.com/gofiber/fiber/v2 v2.27.0/go.mod h1:0bPXdTu+jRqINrEq1T6mHeVBnE0lQd67PGu35jD3hLk= github.com/gofiber/utils v0.1.2 h1:1SH2YEz4RlNS0tJlMJ0bGwO0JkqPqvq6TbHK9tXZKtk= github.com/gofiber/utils v0.1.2/go.mod h1:pacRFtghAE3UoknMOUiXh2Io/nLWSUHtQCi/3QASsOc= github.com/gogo/googleapis v1.1.0/go.mod h1:gf4bu3Q80BeJ6H1S1vYPm8/ELATdvryBaNFGgqEef3s= @@ -208,6 +214,8 @@ github.com/gogo/protobuf v1.2.1/go.mod h1:hp+jE20tsWTFYpLwKvXlhS1hjn+gTNwPg2I6zV github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q= github.com/golang-jwt/jwt/v4 v4.2.0 h1:besgBTC8w8HjP6NzQdxwKH9Z5oQMZ24ThTrHp3cZ8eU= github.com/golang-jwt/jwt/v4 v4.2.0/go.mod h1:/xlHOz8bRuivTWchD4jCa+NbatV+wEUSzwAxVc6locg= +github.com/golang-jwt/jwt/v4 v4.3.0 h1:kHL1vqdqWNfATmA0FNMdmZNMyZI1U6O31X4rlIPoBog= +github.com/golang-jwt/jwt/v4 v4.3.0/go.mod h1:/xlHOz8bRuivTWchD4jCa+NbatV+wEUSzwAxVc6locg= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= github.com/golang/groupcache v0.0.0-20160516000752-02826c3e7903/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= @@ -259,6 +267,8 @@ github.com/google/go-cmp v0.5.4/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/ github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.6 h1:BKbKCqvP6I+rmFHt06ZmyQtvB8xAkWdhFyr0ZUNZcxQ= github.com/google/go-cmp v0.5.6/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.7 h1:81/ik6ipDQS2aGcBfIN5dHDB36BwrStyeAQquSYCV4o= +github.com/google/go-cmp v0.5.7/go.mod h1:n+brtR0CgQNWTVd5ZUFpTBC8YFBDLK/h/bpaJ8/DtOE= github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs= github.com/google/martian/v3 v3.0.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0= @@ -378,6 +388,8 @@ github.com/klauspost/compress v1.10.7/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdYs github.com/klauspost/compress v1.13.4/go.mod h1:8dP1Hq4DHOhN9w426knH3Rhby4rFm6D8eO+e+Dq5Gzg= github.com/klauspost/compress v1.14.1 h1:hLQYb23E8/fO+1u53d02A97a8UnsddcvYzq4ERRU4ds= github.com/klauspost/compress v1.14.1/go.mod h1:/3/Vjq9QcHkK5uEr5lBEmyoZ1iFhe47etQ6QUkpK6sk= +github.com/klauspost/compress v1.14.2 h1:S0OHlFk/Gbon/yauFJ4FfJJF5V0fc5HbBTJazi28pRw= +github.com/klauspost/compress v1.14.2/go.mod h1:/3/Vjq9QcHkK5uEr5lBEmyoZ1iFhe47etQ6QUkpK6sk= github.com/knadh/koanf v1.4.0 h1:/k0Bh49SqLyLNfte9r6cvuZWrApOQhglOmhIU3L/zDw= github.com/knadh/koanf v1.4.0/go.mod h1:1cfH5223ZeZUOs8FU2UdTmaNfHpqgtjV0+NHjRO43gs= github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= @@ -496,6 +508,8 @@ github.com/prometheus/client_golang v1.7.1/go.mod h1:PY5Wy2awLA44sXw4AOSfFBetzPP github.com/prometheus/client_golang v1.9.0/go.mod h1:FqZLKOZnGdFAhOK4nqGHa7D66IdsO+O441Eve7ptJDU= github.com/prometheus/client_golang v1.11.0 h1:HNkLOAEQMIDv/K+04rukrLx6ch7msSRwf3/SASFAGtQ= github.com/prometheus/client_golang v1.11.0/go.mod h1:Z6t4BnS23TR94PD6BsDNk8yVqroYurpAkEiz0P2BEV0= +github.com/prometheus/client_golang v1.12.1 h1:ZiaPsmm9uiBeaSMRznKsCDNtPCS0T3JVDGF+06gjBzk= +github.com/prometheus/client_golang v1.12.1/go.mod h1:3Z9XVyYiZYEO+YQWt3RD2R3jrbd179Rt297l4aS6nDY= github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= github.com/prometheus/client_model v0.0.0-20190115171406-56726106282f/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= @@ -586,6 +600,8 @@ github.com/valyala/fasthttp v1.18.0/go.mod h1:jjraHZVbKOXftJfsOYoAjaeygpj5hr8erm github.com/valyala/fasthttp v1.31.0/go.mod h1:2rsYD01CKFrjjsvFxx75KlEUNpWNBY9JWD3K/7o2Cus= github.com/valyala/fasthttp v1.32.0 h1:keswgWzyKyNIIjz2a7JmCYHOOIkRp6HMx9oTV6QrZWY= github.com/valyala/fasthttp v1.32.0/go.mod h1:2rsYD01CKFrjjsvFxx75KlEUNpWNBY9JWD3K/7o2Cus= +github.com/valyala/fasthttp v1.33.0 h1:mHBKd98J5NcXuBddgjvim1i3kWzlng1SzLhrnBOU9g8= +github.com/valyala/fasthttp v1.33.0/go.mod h1:KJRK/MXx0J+yd0c5hlR+s1tIHD72sniU8ZJjl97LIw4= github.com/valyala/tcplisten v0.0.0-20161114210144-ceec8f93295a/go.mod h1:v3UYOV9WzVtRmSR+PDvWpU/qWl4Wa5LApYYX4ZtKbio= github.com/valyala/tcplisten v1.0.0 h1:rBHj/Xf+E1tRGZyWIWwJDiRY0zc1Js+CV5DqwacVSA8= github.com/valyala/tcplisten v1.0.0/go.mod h1:T0xQ8SeCZGxckz9qRXTfG43PvQ/mcWh7FwZEA7Ioqkc= @@ -614,12 +630,20 @@ go.opencensus.io v0.22.5/go.mod h1:5pWMHQbX5EPX2/62yrJeAkowc+lfs/XD7Uxpq3pI6kk= go.opencensus.io v0.23.0/go.mod h1:XItmlyltB5F7CS4xOC1DcqMoFqwtC6OG2xF7mCv7P7E= go.opentelemetry.io/otel v1.3.0 h1:APxLf0eiBwLl+SOXiJJCVYzA1OOJNyAoV8C5RNRyy7Y= go.opentelemetry.io/otel v1.3.0/go.mod h1:PWIKzi6JCp7sM0k9yZ43VX+T345uNbAkDKwHVjb2PTs= +go.opentelemetry.io/otel v1.4.0 h1:7ESuKPq6zpjRaY5nvVDGiuwK7VAJ8MwkKnmNJ9whNZ4= +go.opentelemetry.io/otel v1.4.0/go.mod h1:jeAqMFKy2uLIxCtKxoFj0FAL5zAPKQagc3+GtBWakzk= go.opentelemetry.io/otel/exporters/jaeger v1.3.0 h1:HfydzioALdtcB26H5WHc4K47iTETJCdloL7VN579/L0= go.opentelemetry.io/otel/exporters/jaeger v1.3.0/go.mod h1:KoYHi1BtkUPncGSRtCe/eh1ijsnePhSkxwzz07vU0Fc= +go.opentelemetry.io/otel/exporters/jaeger v1.4.0 h1:EX/spHhVkHbobTeSozT1zpbuc3oO70CISkw+dspgR9M= +go.opentelemetry.io/otel/exporters/jaeger v1.4.0/go.mod h1:C4UfuVfyi7qAk/PAz6QodaEkES7RnLNHeAAj6QOu2gI= go.opentelemetry.io/otel/sdk v1.3.0 h1:3278edCoH89MEJ0Ky8WQXVmDQv3FX4ZJ3Pp+9fJreAI= go.opentelemetry.io/otel/sdk v1.3.0/go.mod h1:rIo4suHNhQwBIPg9axF8V9CA72Wz2mKF1teNrup8yzs= +go.opentelemetry.io/otel/sdk v1.4.0 h1:LJE4SW3jd4lQTESnlpQZcBhQ3oci0U2MLR5uhicfTHQ= +go.opentelemetry.io/otel/sdk v1.4.0/go.mod h1:71GJPNJh4Qju6zJuYl1CrYtXbrgfau/M9UAggqiy1UE= go.opentelemetry.io/otel/trace v1.3.0 h1:doy8Hzb1RJ+I3yFhtDmwNc7tIyw1tNMOIsyPzp1NOGY= go.opentelemetry.io/otel/trace v1.3.0/go.mod h1:c/VDhno8888bvQYmbYLqe41/Ldmr/KKunbvWM4/fEjk= +go.opentelemetry.io/otel/trace v1.4.0 h1:4OOUrPZdVFQkbzl/JSdvGCWIdw5ONXXxzHlaLlWppmo= +go.opentelemetry.io/otel/trace v1.4.0/go.mod h1:uc3eRsqDfWs9R7b92xbQbU42/eTNz4N+gLP8qJCi4aE= go.opentelemetry.io/proto/otlp v0.7.0/go.mod h1:PqfVotwruBrMGOCsRd/89rSnXhoiJIqeYNgFYFoEGnI= go.uber.org/atomic v1.3.2/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= go.uber.org/atomic v1.5.0/go.mod h1:sABNBOSYdrvTF6hTgEIbc7YasKWGhgEQZyfxyTvoXHQ= @@ -642,6 +666,8 @@ go.uber.org/zap v1.13.0/go.mod h1:zwrFLgMcdUuIBviXEYEH1YKNaOBnKXsx2IPda5bBwHM= go.uber.org/zap v1.17.0/go.mod h1:MXVU+bhUf/A7Xi2HNOnopQOrmycQ5Ih87HtOu4q5SSo= go.uber.org/zap v1.20.0 h1:N4oPlghZwYG55MlU6LXk/Zp00FVNE9X9wrYO8CEs4lc= go.uber.org/zap v1.20.0/go.mod h1:wjWOCqI0f2ZZrJF/UufIOkiC8ii6tm1iqIsLo76RfJw= +go.uber.org/zap v1.21.0 h1:WefMeulhovoZ2sYXz7st6K0sLj7bBhpiFaud4r4zST8= +go.uber.org/zap v1.21.0/go.mod h1:wjWOCqI0f2ZZrJF/UufIOkiC8ii6tm1iqIsLo76RfJw= golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20181029021203-45a5f77698d3/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= @@ -654,6 +680,7 @@ golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8U golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20210513164829-c07d793c2f9a/go.mod h1:P+XmwS30IXTQdn5tA2iutPOUgjI07+tq3H3K9MVA1s8= golang.org/x/crypto v0.0.0-20210817164053-32db794688a5/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= +golang.org/x/crypto v0.0.0-20220112180741-5e0467b6c7ce/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= @@ -741,6 +768,8 @@ golang.org/x/net v0.0.0-20210510120150-4163338589ed/go.mod h1:9nx3DQGgdP8bBQD5qx golang.org/x/net v0.0.0-20210525063256-abc453219eb5/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20210813160813-60bc85c4be6d/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20211015210444-4f30a5c0130f/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= +golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= +golang.org/x/net v0.0.0-20220111093109-d55c255bac03/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= @@ -853,6 +882,9 @@ golang.org/x/sys v0.0.0-20211124211545-fe61309f8881/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20211205182925-97ca703d548d/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220111092808-5a964db01320 h1:0jf+tOCoZ3LyutmCOWpVni1chK4VfFLhRsDK7MhqGRY= golang.org/x/sys v0.0.0-20220111092808-5a964db01320/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220114195835-da31bd327af9/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220209214540-3681064d5158 h1:rm+CHSpPEEW2IsXUib1ThaHIjuBVZjxNgSKmBLFfD4c= +golang.org/x/sys v0.0.0-20220209214540-3681064d5158/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= From 1c98064e11ba00e1675e84e70b4b9944252abf36 Mon Sep 17 00:00:00 2001 From: Parham Alvani Date: Wed, 16 Feb 2022 07:33:11 +0330 Subject: [PATCH 195/660] chore: remove api2 variable --- internal/cmd/serve/main.go | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/internal/cmd/serve/main.go b/internal/cmd/serve/main.go index 091bfb76..f63fa272 100644 --- a/internal/cmd/serve/main.go +++ b/internal/cmd/serve/main.go @@ -46,7 +46,7 @@ func main(cfg config.Config, logger *zap.Logger, tracer trace.Tracer) { logger.Fatal("error while getting allowed access types", zap.Error(err)) } - api2 := api.API{ + rest := api.API{ Authenticator: &authenticator.Authenticator{ PublicKeys: map[user.Issuer]*rsa.PublicKey{ user.Driver: publicKey0, @@ -57,9 +57,7 @@ func main(cfg config.Config, logger *zap.Logger, tracer trace.Tracer) { TopicManager: topics.NewTopicManager(cfg.Topics, hid, cfg.Company), }, Tracer: tracer, - } - - rest := api2.ReSTServer() + }.ReSTServer() go func() { if err := rest.Listen(fmt.Sprintf(":%d", cfg.HTTPPort)); err != nil && !errors.Is(err, http.ErrServerClosed) { From 38d3d5eff0f00289d17a8e5ed6e7878bc1a8cc03 Mon Sep 17 00:00:00 2001 From: amirhnajafiz Date: Wed, 16 Feb 2022 10:05:18 +0330 Subject: [PATCH 196/660] remove global logger from api package --- go.sum | 32 -------------------------------- internal/api/acl.go | 8 ++++---- internal/api/api.go | 3 ++- internal/api/auth.go | 6 +++--- 4 files changed, 9 insertions(+), 40 deletions(-) diff --git a/go.sum b/go.sum index ffc45c69..8dba59bf 100644 --- a/go.sum +++ b/go.sum @@ -63,7 +63,6 @@ github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRF github.com/alecthomas/units v0.0.0-20190717042225-c3de453c63f4/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= github.com/alecthomas/units v0.0.0-20190924025748-f65c72e2690d/go.mod h1:rBZYJk541a8SKzHPHnH3zbiI+7dagKZ0cgpgrD7Fyho= github.com/andybalholm/brotli v1.0.0/go.mod h1:loMXtMfwqflxFJPmdbJO0a3KNoPuLBgiu3qAvBg8x/Y= -github.com/andybalholm/brotli v1.0.2/go.mod h1:loMXtMfwqflxFJPmdbJO0a3KNoPuLBgiu3qAvBg8x/Y= github.com/andybalholm/brotli v1.0.4 h1:V7DdXeJtZscaqfNuAdSRuRFzuiKlHSC/Zh3zl9qY3JY= github.com/andybalholm/brotli v1.0.4/go.mod h1:fO7iG3H7G2nSZ7m0zPUDn85XEX2GTukHGRSepvi9Eig= github.com/ansrivas/fiberprometheus/v2 v2.1.2 h1:xhG9rfJuqfpRNVHX4//ZQnKAbBubKDsvVFlGWBH9JsE= @@ -179,11 +178,8 @@ github.com/go-ldap/ldap v3.0.2+incompatible/go.mod h1:qfd9rJvER9Q0/D/Sqn1DfHRoBp github.com/go-logfmt/logfmt v0.3.0/go.mod h1:Qt1PoO58o5twSAckw1HlFXLmHsOX5/0LbT9GBnD5lWE= github.com/go-logfmt/logfmt v0.4.0/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V4qmtdjCk= github.com/go-logfmt/logfmt v0.5.0/go.mod h1:wCYkCAKZfumFQihp8CzCvQ3paCTfi41vtzG1KdI/P7A= -github.com/go-logr/logr v1.2.0/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= -github.com/go-logr/logr v1.2.1/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= github.com/go-logr/logr v1.2.2 h1:ahHml/yUpnlb96Rp8HCvtYVPY8ZYpxq3g7UYchIYwbs= github.com/go-logr/logr v1.2.2/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= -github.com/go-logr/stdr v1.2.0/go.mod h1:YkVgnZu1ZjjL7xTxrfm/LLZBfkhTqSR1ydtm6jTKKwI= github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag= github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE= github.com/go-sql-driver/mysql v1.4.0/go.mod h1:zAC/RDZ24gD3HViQzih4MyKcchzm+sOG5ZlKdlhCg5w= @@ -191,18 +187,12 @@ github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/me github.com/go-test/deep v1.0.2-0.20181118220953-042da051cf31/go.mod h1:wGDj63lr65AM2AQyKZd/NYHGb0R+1RLqB8NKt3aSFNA= github.com/godbus/dbus/v5 v5.0.4/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA= github.com/gofiber/adaptor/v2 v2.1.1/go.mod h1:jdHkqsqdWzEc0qMB+5svsWL5kdZmaDN2H0C3Hxl8y7c= -github.com/gofiber/adaptor/v2 v2.1.16 h1:8dURf+4n/EYFy3+BI1t5xyPQ7ZvOBgXuRFRrWkVNK54= -github.com/gofiber/adaptor/v2 v2.1.16/go.mod h1:m6m07fScuw5hpY9ZV027VqorR41XVzi3md6xBg2rdxQ= github.com/gofiber/adaptor/v2 v2.1.18 h1:J0UlV40ng4K0Nb9mBw7b8bgX4AcFfPQw1+cybnSyXLU= github.com/gofiber/adaptor/v2 v2.1.18/go.mod h1:20XTo3Nxorrxwi5vBFdPpaZstEM4n/Nx3pSfakFrczg= -github.com/gofiber/contrib/fiberzap v0.0.0-20220112233641-76fa5fde0be2 h1:sZuXSGtb+fccsIrmmuodhYzpaClUp47E7/g+23THt5U= -github.com/gofiber/contrib/fiberzap v0.0.0-20220112233641-76fa5fde0be2/go.mod h1:3syX4RQLVr9+5Y6sM9+XrsB5vLVqQ47fFvEUX92stuw= github.com/gofiber/contrib/fiberzap v0.0.0-20220215083858-d7416de5f637 h1:0oUJsQddXrPwsDiBEChd/xx/v+qSWfUILHZzv9SEy9k= github.com/gofiber/contrib/fiberzap v0.0.0-20220215083858-d7416de5f637/go.mod h1:U7hH82bwDTwfqu9NjVJ68ccUEv+Cz3ro0/qJmyYj8dc= github.com/gofiber/fiber/v2 v2.2.2/go.mod h1:Aso7/M+EQOinVkWp4LUYjdlTpKTBoCk2Qo4djnMsyHE= github.com/gofiber/fiber/v2 v2.6.0/go.mod h1:f8BRRIMjMdRyt2qmJ/0Sea3j3rwwfufPrh9WNBRiVZ0= -github.com/gofiber/fiber/v2 v2.24.0 h1:18rpLoQMJBVlLtX/PwgHj3hIxPSeWfN1YeDJ2lEnzjU= -github.com/gofiber/fiber/v2 v2.24.0/go.mod h1:MR1usVH3JHYRyQwMe2eZXRSZHRX38fkV+A7CPB+DlDQ= github.com/gofiber/fiber/v2 v2.27.0 h1:u34t1nOea7zz4jcZDK7+ZMiG+MVFYrHqMhTdYQDiFA8= github.com/gofiber/fiber/v2 v2.27.0/go.mod h1:0bPXdTu+jRqINrEq1T6mHeVBnE0lQd67PGu35jD3hLk= github.com/gofiber/utils v0.1.2 h1:1SH2YEz4RlNS0tJlMJ0bGwO0JkqPqvq6TbHK9tXZKtk= @@ -212,8 +202,6 @@ github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7a github.com/gogo/protobuf v1.2.0/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= github.com/gogo/protobuf v1.2.1/go.mod h1:hp+jE20tsWTFYpLwKvXlhS1hjn+gTNwPg2I6zVXpSg4= github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q= -github.com/golang-jwt/jwt/v4 v4.2.0 h1:besgBTC8w8HjP6NzQdxwKH9Z5oQMZ24ThTrHp3cZ8eU= -github.com/golang-jwt/jwt/v4 v4.2.0/go.mod h1:/xlHOz8bRuivTWchD4jCa+NbatV+wEUSzwAxVc6locg= github.com/golang-jwt/jwt/v4 v4.3.0 h1:kHL1vqdqWNfATmA0FNMdmZNMyZI1U6O31X4rlIPoBog= github.com/golang-jwt/jwt/v4 v4.3.0/go.mod h1:/xlHOz8bRuivTWchD4jCa+NbatV+wEUSzwAxVc6locg= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= @@ -265,7 +253,6 @@ github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/ github.com/google/go-cmp v0.5.3/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.4/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.6 h1:BKbKCqvP6I+rmFHt06ZmyQtvB8xAkWdhFyr0ZUNZcxQ= github.com/google/go-cmp v0.5.6/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.7 h1:81/ik6ipDQS2aGcBfIN5dHDB36BwrStyeAQquSYCV4o= github.com/google/go-cmp v0.5.7/go.mod h1:n+brtR0CgQNWTVd5ZUFpTBC8YFBDLK/h/bpaJ8/DtOE= @@ -385,8 +372,6 @@ github.com/kisielk/errcheck v1.1.0/go.mod h1:EZBBE59ingxPouuu3KfxchcWSUPOHkagtvW github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8= github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= github.com/klauspost/compress v1.10.7/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdYsUV+/s2qKfXs= -github.com/klauspost/compress v1.13.4/go.mod h1:8dP1Hq4DHOhN9w426knH3Rhby4rFm6D8eO+e+Dq5Gzg= -github.com/klauspost/compress v1.14.1 h1:hLQYb23E8/fO+1u53d02A97a8UnsddcvYzq4ERRU4ds= github.com/klauspost/compress v1.14.1/go.mod h1:/3/Vjq9QcHkK5uEr5lBEmyoZ1iFhe47etQ6QUkpK6sk= github.com/klauspost/compress v1.14.2 h1:S0OHlFk/Gbon/yauFJ4FfJJF5V0fc5HbBTJazi28pRw= github.com/klauspost/compress v1.14.2/go.mod h1:/3/Vjq9QcHkK5uEr5lBEmyoZ1iFhe47etQ6QUkpK6sk= @@ -506,7 +491,6 @@ github.com/prometheus/client_golang v1.3.0/go.mod h1:hJaj2vgQTGQmVCsAACORcieXFeD github.com/prometheus/client_golang v1.4.0/go.mod h1:e9GMxYsXl05ICDXkRhurwBS4Q3OK1iX/F2sw+iXX5zU= github.com/prometheus/client_golang v1.7.1/go.mod h1:PY5Wy2awLA44sXw4AOSfFBetzPP4j5+D6mVACh+pe2M= github.com/prometheus/client_golang v1.9.0/go.mod h1:FqZLKOZnGdFAhOK4nqGHa7D66IdsO+O441Eve7ptJDU= -github.com/prometheus/client_golang v1.11.0 h1:HNkLOAEQMIDv/K+04rukrLx6ch7msSRwf3/SASFAGtQ= github.com/prometheus/client_golang v1.11.0/go.mod h1:Z6t4BnS23TR94PD6BsDNk8yVqroYurpAkEiz0P2BEV0= github.com/prometheus/client_golang v1.12.1 h1:ZiaPsmm9uiBeaSMRznKsCDNtPCS0T3JVDGF+06gjBzk= github.com/prometheus/client_golang v1.12.1/go.mod h1:3Z9XVyYiZYEO+YQWt3RD2R3jrbd179Rt297l4aS6nDY= @@ -597,9 +581,6 @@ github.com/valyala/bytebufferpool v1.0.0 h1:GqA5TC/0021Y/b9FG4Oi9Mr3q7XYx6Kllzaw github.com/valyala/bytebufferpool v1.0.0/go.mod h1:6bBcMArwyJ5K/AmCkWv1jt77kVWyCJ6HpOuEn7z0Csc= github.com/valyala/fasthttp v1.17.0/go.mod h1:jjraHZVbKOXftJfsOYoAjaeygpj5hr8ermTRJNroD7A= github.com/valyala/fasthttp v1.18.0/go.mod h1:jjraHZVbKOXftJfsOYoAjaeygpj5hr8ermTRJNroD7A= -github.com/valyala/fasthttp v1.31.0/go.mod h1:2rsYD01CKFrjjsvFxx75KlEUNpWNBY9JWD3K/7o2Cus= -github.com/valyala/fasthttp v1.32.0 h1:keswgWzyKyNIIjz2a7JmCYHOOIkRp6HMx9oTV6QrZWY= -github.com/valyala/fasthttp v1.32.0/go.mod h1:2rsYD01CKFrjjsvFxx75KlEUNpWNBY9JWD3K/7o2Cus= github.com/valyala/fasthttp v1.33.0 h1:mHBKd98J5NcXuBddgjvim1i3kWzlng1SzLhrnBOU9g8= github.com/valyala/fasthttp v1.33.0/go.mod h1:KJRK/MXx0J+yd0c5hlR+s1tIHD72sniU8ZJjl97LIw4= github.com/valyala/tcplisten v0.0.0-20161114210144-ceec8f93295a/go.mod h1:v3UYOV9WzVtRmSR+PDvWpU/qWl4Wa5LApYYX4ZtKbio= @@ -628,20 +609,12 @@ go.opencensus.io v0.22.3/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= go.opencensus.io v0.22.4/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= go.opencensus.io v0.22.5/go.mod h1:5pWMHQbX5EPX2/62yrJeAkowc+lfs/XD7Uxpq3pI6kk= go.opencensus.io v0.23.0/go.mod h1:XItmlyltB5F7CS4xOC1DcqMoFqwtC6OG2xF7mCv7P7E= -go.opentelemetry.io/otel v1.3.0 h1:APxLf0eiBwLl+SOXiJJCVYzA1OOJNyAoV8C5RNRyy7Y= -go.opentelemetry.io/otel v1.3.0/go.mod h1:PWIKzi6JCp7sM0k9yZ43VX+T345uNbAkDKwHVjb2PTs= go.opentelemetry.io/otel v1.4.0 h1:7ESuKPq6zpjRaY5nvVDGiuwK7VAJ8MwkKnmNJ9whNZ4= go.opentelemetry.io/otel v1.4.0/go.mod h1:jeAqMFKy2uLIxCtKxoFj0FAL5zAPKQagc3+GtBWakzk= -go.opentelemetry.io/otel/exporters/jaeger v1.3.0 h1:HfydzioALdtcB26H5WHc4K47iTETJCdloL7VN579/L0= -go.opentelemetry.io/otel/exporters/jaeger v1.3.0/go.mod h1:KoYHi1BtkUPncGSRtCe/eh1ijsnePhSkxwzz07vU0Fc= go.opentelemetry.io/otel/exporters/jaeger v1.4.0 h1:EX/spHhVkHbobTeSozT1zpbuc3oO70CISkw+dspgR9M= go.opentelemetry.io/otel/exporters/jaeger v1.4.0/go.mod h1:C4UfuVfyi7qAk/PAz6QodaEkES7RnLNHeAAj6QOu2gI= -go.opentelemetry.io/otel/sdk v1.3.0 h1:3278edCoH89MEJ0Ky8WQXVmDQv3FX4ZJ3Pp+9fJreAI= -go.opentelemetry.io/otel/sdk v1.3.0/go.mod h1:rIo4suHNhQwBIPg9axF8V9CA72Wz2mKF1teNrup8yzs= go.opentelemetry.io/otel/sdk v1.4.0 h1:LJE4SW3jd4lQTESnlpQZcBhQ3oci0U2MLR5uhicfTHQ= go.opentelemetry.io/otel/sdk v1.4.0/go.mod h1:71GJPNJh4Qju6zJuYl1CrYtXbrgfau/M9UAggqiy1UE= -go.opentelemetry.io/otel/trace v1.3.0 h1:doy8Hzb1RJ+I3yFhtDmwNc7tIyw1tNMOIsyPzp1NOGY= -go.opentelemetry.io/otel/trace v1.3.0/go.mod h1:c/VDhno8888bvQYmbYLqe41/Ldmr/KKunbvWM4/fEjk= go.opentelemetry.io/otel/trace v1.4.0 h1:4OOUrPZdVFQkbzl/JSdvGCWIdw5ONXXxzHlaLlWppmo= go.opentelemetry.io/otel/trace v1.4.0/go.mod h1:uc3eRsqDfWs9R7b92xbQbU42/eTNz4N+gLP8qJCi4aE= go.opentelemetry.io/proto/otlp v0.7.0/go.mod h1:PqfVotwruBrMGOCsRd/89rSnXhoiJIqeYNgFYFoEGnI= @@ -664,8 +637,6 @@ go.uber.org/tools v0.0.0-20190618225709-2cfd321de3ee/go.mod h1:vJERXedbb3MVM5f9E go.uber.org/zap v1.10.0/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q= go.uber.org/zap v1.13.0/go.mod h1:zwrFLgMcdUuIBviXEYEH1YKNaOBnKXsx2IPda5bBwHM= go.uber.org/zap v1.17.0/go.mod h1:MXVU+bhUf/A7Xi2HNOnopQOrmycQ5Ih87HtOu4q5SSo= -go.uber.org/zap v1.20.0 h1:N4oPlghZwYG55MlU6LXk/Zp00FVNE9X9wrYO8CEs4lc= -go.uber.org/zap v1.20.0/go.mod h1:wjWOCqI0f2ZZrJF/UufIOkiC8ii6tm1iqIsLo76RfJw= go.uber.org/zap v1.21.0 h1:WefMeulhovoZ2sYXz7st6K0sLj7bBhpiFaud4r4zST8= go.uber.org/zap v1.21.0/go.mod h1:wjWOCqI0f2ZZrJF/UufIOkiC8ii6tm1iqIsLo76RfJw= golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= @@ -678,7 +649,6 @@ golang.org/x/crypto v0.0.0-20190820162420-60c769a6c586/go.mod h1:yigFU9vqHzYiE8U golang.org/x/crypto v0.0.0-20190923035154-9ee001bba392/go.mod h1:/lpIB1dKB+9EgE3H3cr1v9wB50oz8l4C4h62xy7jSTY= golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/crypto v0.0.0-20210513164829-c07d793c2f9a/go.mod h1:P+XmwS30IXTQdn5tA2iutPOUgjI07+tq3H3K9MVA1s8= golang.org/x/crypto v0.0.0-20210817164053-32db794688a5/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.0.0-20220112180741-5e0467b6c7ce/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= @@ -764,7 +734,6 @@ golang.org/x/net v0.0.0-20210316092652-d523dce5a7f4/go.mod h1:RBQZq4jEuRlivfhVLd golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM= golang.org/x/net v0.0.0-20210410081132-afb366fc7cd1/go.mod h1:9tjilg8BloeKEkVJvy7fQ90B1CfIiPueXVOjqfkSzI8= golang.org/x/net v0.0.0-20210503060351-7fd8e65b6420/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= -golang.org/x/net v0.0.0-20210510120150-4163338589ed/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20210525063256-abc453219eb5/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20210813160813-60bc85c4be6d/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20211015210444-4f30a5c0130f/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= @@ -880,7 +849,6 @@ golang.org/x/sys v0.0.0-20211007075335-d3039528d8ac/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20211019181941-9d821ace8654/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20211124211545-fe61309f8881/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20211205182925-97ca703d548d/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220111092808-5a964db01320 h1:0jf+tOCoZ3LyutmCOWpVni1chK4VfFLhRsDK7MhqGRY= golang.org/x/sys v0.0.0-20220111092808-5a964db01320/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220114195835-da31bd327af9/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220209214540-3681064d5158 h1:rm+CHSpPEEW2IsXUib1ThaHIjuBVZjxNgSKmBLFfD4c= diff --git a/internal/api/acl.go b/internal/api/acl.go index 9a1b5389..3206e943 100644 --- a/internal/api/acl.go +++ b/internal/api/acl.go @@ -28,7 +28,7 @@ func (a API) ACL(c *fiber.Ctx) error { request := new(aclRequest) if err := c.BodyParser(request); err != nil { - zap.L(). + a.Logger. Warn("acl bad request", zap.Error(err), zap.String("access", request.Access.String()), @@ -69,11 +69,11 @@ func (a API) ACL(c *fiber.Ctx) error { // nolint: exhaustivestruct if errors.Is(err, authenticator.TopicNotAllowedError{}) { - zap.L(). + a.Logger. Warn("acl request is not authorized", zap.Error(err)) } else { - zap.L(). + a.Logger. Error("acl request is not authorized", zap.Error(err)) } @@ -81,7 +81,7 @@ func (a API) ACL(c *fiber.Ctx) error { return c.Status(http.StatusUnauthorized).SendString("request is not authorized") } - zap.L(). + a.Logger. Info("acl ok", zap.String("access", request.Access.String()), zap.String("topic", request.Topic), diff --git a/internal/api/api.go b/internal/api/api.go index c2d940b9..5e645b2a 100644 --- a/internal/api/api.go +++ b/internal/api/api.go @@ -12,6 +12,7 @@ import ( type API struct { Authenticator *authenticator.Authenticator Tracer trace.Tracer + Logger zap.Logger } // ReSTServer will return fiber app. @@ -20,7 +21,7 @@ func (a API) ReSTServer() *fiber.App { // nolint: exhaustivestruct app.Use(fiberzap.New(fiberzap.Config{ - Logger: zap.L(), + Logger: a.Logger.Named("fiber"), })) prometheus := fiberprometheus.NewWith("http", "dispatching", "soteria") diff --git a/internal/api/auth.go b/internal/api/auth.go index 6580b326..6af6e35d 100644 --- a/internal/api/auth.go +++ b/internal/api/auth.go @@ -26,7 +26,7 @@ func (a API) Auth(c *fiber.Ctx) error { if err := c.BodyParser(request); err != nil { span.RecordError(err) - zap.L(). + a.Logger. Warn("bad request", zap.Error(err), ) @@ -52,7 +52,7 @@ func (a API) Auth(c *fiber.Ctx) error { if err := a.Authenticator.Auth(tokenString); err != nil { span.RecordError(err) - zap.L(). + a.Logger. Error("auth request is not authorized", zap.Error(err), zap.String("token", request.Token), @@ -63,7 +63,7 @@ func (a API) Auth(c *fiber.Ctx) error { return c.Status(http.StatusUnauthorized).SendString("request is not authorized") } - zap.L(). + a.Logger. Info("auth ok", zap.String("token", request.Token), zap.String("username", request.Password), From 7dd97144189b74a821a11878b16c7330468b66b4 Mon Sep 17 00:00:00 2001 From: amirhnajafiz Date: Wed, 16 Feb 2022 10:09:03 +0330 Subject: [PATCH 197/660] remove global logger from cmd and serve --- internal/cmd/root.go | 7 +++---- internal/cmd/serve/main.go | 1 + 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/internal/cmd/root.go b/internal/cmd/root.go index eba682b8..c001e1b4 100644 --- a/internal/cmd/root.go +++ b/internal/cmd/root.go @@ -19,8 +19,7 @@ const ExitFailure = 1 func Execute() { cfg := config.New() - logger := logger.New(cfg.Logger) - zap.ReplaceGlobals(logger) + l := logger.New(cfg.Logger).Named("cmd") tracer := tracing.New(cfg.Tracer) @@ -34,10 +33,10 @@ func Execute() { }, } - serve.Register(root, cfg, logger, tracer) + serve.Register(root, cfg, l.Named("serve"), tracer) if err := root.Execute(); err != nil { - logger.Error("failed to execute root command", zap.Error(err)) + l.Error("failed to execute root command", zap.Error(err)) os.Exit(ExitFailure) } diff --git a/internal/cmd/serve/main.go b/internal/cmd/serve/main.go index f63fa272..77c12dd8 100644 --- a/internal/cmd/serve/main.go +++ b/internal/cmd/serve/main.go @@ -57,6 +57,7 @@ func main(cfg config.Config, logger *zap.Logger, tracer trace.Tracer) { TopicManager: topics.NewTopicManager(cfg.Topics, hid, cfg.Company), }, Tracer: tracer, + Logger: *logger.Named("api"), }.ReSTServer() go func() { From bf9078b124a543cc35eee51130def48ca0306f69 Mon Sep 17 00:00:00 2001 From: amirhnajafiz Date: Wed, 16 Feb 2022 10:17:05 +0330 Subject: [PATCH 198/660] add zap logger to tracer package --- internal/cmd/root.go | 2 +- internal/tracing/tracer.go | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/internal/cmd/root.go b/internal/cmd/root.go index c001e1b4..89d836ed 100644 --- a/internal/cmd/root.go +++ b/internal/cmd/root.go @@ -21,7 +21,7 @@ func Execute() { l := logger.New(cfg.Logger).Named("cmd") - tracer := tracing.New(cfg.Tracer) + tracer := tracing.New(cfg.Tracer, l.Named("tracer")) // nolint: exhaustivestruct root := &cobra.Command{ diff --git a/internal/tracing/tracer.go b/internal/tracing/tracer.go index de450e28..3f5dd489 100644 --- a/internal/tracing/tracer.go +++ b/internal/tracing/tracer.go @@ -1,7 +1,8 @@ package tracing import ( - "log" + "fmt" + "go.uber.org/zap" "go.opentelemetry.io/otel" "go.opentelemetry.io/otel/exporters/jaeger" @@ -12,7 +13,7 @@ import ( "go.opentelemetry.io/otel/trace" ) -func New(cfg Config) trace.Tracer { //nolint: ireturn +func New(cfg Config, logger *zap.Logger) trace.Tracer { //nolint: ireturn if !cfg.Enabled { return trace.NewNoopTracerProvider().Tracer("snapp.dispatching") } @@ -21,7 +22,7 @@ func New(cfg Config) trace.Tracer { //nolint: ireturn jaeger.WithAgentEndpoint(jaeger.WithAgentHost(cfg.Agent.Host), jaeger.WithAgentPort(cfg.Agent.Port)), ) if err != nil { - log.Fatalf("failed to initialize export pipeline: %v", err) + logger.Fatal(fmt.Errorf("failed to initialize export pipeline: %v", err).Error()) } res, err := resource.Merge( From 7f03886eb270ed14791460a7fad3e7f22133e353 Mon Sep 17 00:00:00 2001 From: amirhnajafiz Date: Wed, 16 Feb 2022 10:20:44 +0330 Subject: [PATCH 199/660] refactor logger package file name and l variable --- internal/cmd/root.go | 8 ++++---- internal/logger/{l.go => logger.go} | 0 2 files changed, 4 insertions(+), 4 deletions(-) rename internal/logger/{l.go => logger.go} (100%) diff --git a/internal/cmd/root.go b/internal/cmd/root.go index 89d836ed..1706ac4e 100644 --- a/internal/cmd/root.go +++ b/internal/cmd/root.go @@ -19,9 +19,9 @@ const ExitFailure = 1 func Execute() { cfg := config.New() - l := logger.New(cfg.Logger).Named("cmd") + logger := logger.New(cfg.Logger).Named("cmd") - tracer := tracing.New(cfg.Tracer, l.Named("tracer")) + tracer := tracing.New(cfg.Tracer, logger.Named("tracer")) // nolint: exhaustivestruct root := &cobra.Command{ @@ -33,10 +33,10 @@ func Execute() { }, } - serve.Register(root, cfg, l.Named("serve"), tracer) + serve.Register(root, cfg, logger.Named("serve"), tracer) if err := root.Execute(); err != nil { - l.Error("failed to execute root command", zap.Error(err)) + logger.Error("failed to execute root command", zap.Error(err)) os.Exit(ExitFailure) } diff --git a/internal/logger/l.go b/internal/logger/logger.go similarity index 100% rename from internal/logger/l.go rename to internal/logger/logger.go From 6bcc338c72ab5dc6151684da9c7437d59402e978 Mon Sep 17 00:00:00 2001 From: amirhnajafiz Date: Wed, 16 Feb 2022 10:22:54 +0330 Subject: [PATCH 200/660] struct type of serve added to serve package --- internal/cmd/serve/main.go | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/internal/cmd/serve/main.go b/internal/cmd/serve/main.go index 77c12dd8..468c148c 100644 --- a/internal/cmd/serve/main.go +++ b/internal/cmd/serve/main.go @@ -19,7 +19,13 @@ import ( "go.uber.org/zap" ) -func main(cfg config.Config, logger *zap.Logger, tracer trace.Tracer) { +type Serve struct { + Cfg config.Config + Logger zap.Logger + Tracer trace.Tracer +} + +func (s Serve) main(cfg config.Config, logger *zap.Logger, tracer trace.Tracer) { publicKey0, err := cfg.ReadPublicKey(user.Driver) if err != nil { logger.Fatal("could not read driver public key") @@ -76,7 +82,7 @@ func main(cfg config.Config, logger *zap.Logger, tracer trace.Tracer) { } // Register serve command. -func Register(root *cobra.Command, cfg config.Config, logger *zap.Logger, tracer trace.Tracer) { +func (s Serve) Register(root *cobra.Command, cfg config.Config, logger *zap.Logger, tracer trace.Tracer) { root.AddCommand( // nolint: exhaustivestruct &cobra.Command{ @@ -84,7 +90,7 @@ func Register(root *cobra.Command, cfg config.Config, logger *zap.Logger, tracer Short: "serve runs the application", Long: `serve will run Soteria ReST server and waits until user disrupts.`, Run: func(cmd *cobra.Command, args []string) { - main(cfg, logger, tracer) + s.main(cfg, logger, tracer) }, }, ) From f1eb0c56e12f0a3d381f371b6fb4479651b97d21 Mon Sep 17 00:00:00 2001 From: amirhnajafiz Date: Wed, 16 Feb 2022 10:25:29 +0330 Subject: [PATCH 201/660] serve main method all inputs are removed --- internal/cmd/serve/main.go | 40 +++++++++++++++++++------------------- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/internal/cmd/serve/main.go b/internal/cmd/serve/main.go index 468c148c..b27f79a6 100644 --- a/internal/cmd/serve/main.go +++ b/internal/cmd/serve/main.go @@ -25,31 +25,31 @@ type Serve struct { Tracer trace.Tracer } -func (s Serve) main(cfg config.Config, logger *zap.Logger, tracer trace.Tracer) { - publicKey0, err := cfg.ReadPublicKey(user.Driver) +func (s Serve) main() { + publicKey0, err := s.Cfg.ReadPublicKey(user.Driver) if err != nil { - logger.Fatal("could not read driver public key") + s.Logger.Fatal("could not read driver public key") } - publicKey1, err := cfg.ReadPublicKey(user.Passenger) + publicKey1, err := s.Cfg.ReadPublicKey(user.Passenger) if err != nil { - logger.Fatal("could not read passenger public key") + s.Logger.Fatal("could not read passenger public key") } hid := &snappids.HashIDSManager{ Salts: map[snappids.Audience]string{ - snappids.DriverAudience: cfg.DriverSalt, - snappids.PassengerAudience: cfg.PassengerSalt, + snappids.DriverAudience: s.Cfg.DriverSalt, + snappids.PassengerAudience: s.Cfg.PassengerSalt, }, Lengths: map[snappids.Audience]int{ - snappids.DriverAudience: cfg.DriverHashLength, - snappids.PassengerAudience: cfg.PassengerHashLength, + snappids.DriverAudience: s.Cfg.DriverHashLength, + snappids.PassengerAudience: s.Cfg.PassengerHashLength, }, } - allowedAccessTypes, err := cfg.GetAllowedAccessTypes() + allowedAccessTypes, err := s.Cfg.GetAllowedAccessTypes() if err != nil { - logger.Fatal("error while getting allowed access types", zap.Error(err)) + s.Logger.Fatal("error while getting allowed access types", zap.Error(err)) } rest := api.API{ @@ -59,16 +59,16 @@ func (s Serve) main(cfg config.Config, logger *zap.Logger, tracer trace.Tracer) user.Passenger: publicKey1, }, AllowedAccessTypes: allowedAccessTypes, - Company: cfg.Company, - TopicManager: topics.NewTopicManager(cfg.Topics, hid, cfg.Company), + Company: s.Cfg.Company, + TopicManager: topics.NewTopicManager(s.Cfg.Topics, hid, s.Cfg.Company), }, - Tracer: tracer, - Logger: *logger.Named("api"), + Tracer: s.Tracer, + Logger: *s.Logger.Named("api"), }.ReSTServer() go func() { - if err := rest.Listen(fmt.Sprintf(":%d", cfg.HTTPPort)); err != nil && !errors.Is(err, http.ErrServerClosed) { - logger.Fatal("failed to run REST HTTP server", zap.Error(err)) + if err := rest.Listen(fmt.Sprintf(":%d", s.Cfg.HTTPPort)); err != nil && !errors.Is(err, http.ErrServerClosed) { + s.Logger.Fatal("failed to run REST HTTP server", zap.Error(err)) } }() @@ -77,12 +77,12 @@ func (s Serve) main(cfg config.Config, logger *zap.Logger, tracer trace.Tracer) <-c if err := rest.Shutdown(); err != nil { - logger.Error("error happened during REST API shutdown", zap.Error(err)) + s.Logger.Error("error happened during REST API shutdown", zap.Error(err)) } } // Register serve command. -func (s Serve) Register(root *cobra.Command, cfg config.Config, logger *zap.Logger, tracer trace.Tracer) { +func (s Serve) Register(root *cobra.Command) { root.AddCommand( // nolint: exhaustivestruct &cobra.Command{ @@ -90,7 +90,7 @@ func (s Serve) Register(root *cobra.Command, cfg config.Config, logger *zap.Logg Short: "serve runs the application", Long: `serve will run Soteria ReST server and waits until user disrupts.`, Run: func(cmd *cobra.Command, args []string) { - s.main(cfg, logger, tracer) + s.main() }, }, ) From c409fcae86be2eb170e690f1671e478de9064f4e Mon Sep 17 00:00:00 2001 From: amirhnajafiz Date: Wed, 16 Feb 2022 10:29:25 +0330 Subject: [PATCH 202/660] removed register call in cmd root with serve type method calling --- internal/cmd/root.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/internal/cmd/root.go b/internal/cmd/root.go index 1706ac4e..cd9a0051 100644 --- a/internal/cmd/root.go +++ b/internal/cmd/root.go @@ -33,7 +33,11 @@ func Execute() { }, } - serve.Register(root, cfg, logger.Named("serve"), tracer) + serve.Serve{ + Cfg: cfg, + Logger: *logger.Named("serve"), + Tracer: tracer, + }.Register(root) if err := root.Execute(); err != nil { logger.Error("failed to execute root command", zap.Error(err)) From fe82deecd3a308bee3547a86a0eed6d28ad73a47 Mon Sep 17 00:00:00 2001 From: amirhnajafiz Date: Wed, 16 Feb 2022 10:31:06 +0330 Subject: [PATCH 203/660] updated main logger name from cmd to root --- internal/cmd/root.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/cmd/root.go b/internal/cmd/root.go index cd9a0051..a3acc76b 100644 --- a/internal/cmd/root.go +++ b/internal/cmd/root.go @@ -19,7 +19,7 @@ const ExitFailure = 1 func Execute() { cfg := config.New() - logger := logger.New(cfg.Logger).Named("cmd") + logger := logger.New(cfg.Logger).Named("root") tracer := tracing.New(cfg.Tracer, logger.Named("tracer")) From 79bfa2ff858ff16682a255af516cacf005f1879d Mon Sep 17 00:00:00 2001 From: amirhnajafiz Date: Wed, 16 Feb 2022 10:40:45 +0330 Subject: [PATCH 204/660] fix lint warning for logger in tracer package --- internal/tracing/tracer.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/internal/tracing/tracer.go b/internal/tracing/tracer.go index 3f5dd489..fdd55d29 100644 --- a/internal/tracing/tracer.go +++ b/internal/tracing/tracer.go @@ -1,7 +1,6 @@ package tracing import ( - "fmt" "go.uber.org/zap" "go.opentelemetry.io/otel" @@ -22,7 +21,7 @@ func New(cfg Config, logger *zap.Logger) trace.Tracer { //nolint: ireturn jaeger.WithAgentEndpoint(jaeger.WithAgentHost(cfg.Agent.Host), jaeger.WithAgentPort(cfg.Agent.Port)), ) if err != nil { - logger.Fatal(fmt.Errorf("failed to initialize export pipeline: %v", err).Error()) + logger.Fatal("failed to initialize export pipeline", zap.Error(err)) } res, err := resource.Merge( From b0b2989b5b4ffdded22647947037e6df597c8210 Mon Sep 17 00:00:00 2001 From: amirhnajafiz Date: Wed, 16 Feb 2022 10:53:07 +0330 Subject: [PATCH 205/660] fixed lint gci problem in tracing --- internal/tracing/tracer.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/internal/tracing/tracer.go b/internal/tracing/tracer.go index fdd55d29..d1058ed3 100644 --- a/internal/tracing/tracer.go +++ b/internal/tracing/tracer.go @@ -1,8 +1,6 @@ package tracing import ( - "go.uber.org/zap" - "go.opentelemetry.io/otel" "go.opentelemetry.io/otel/exporters/jaeger" "go.opentelemetry.io/otel/propagation" @@ -10,6 +8,7 @@ import ( sdktrace "go.opentelemetry.io/otel/sdk/trace" semconv "go.opentelemetry.io/otel/semconv/v1.7.0" "go.opentelemetry.io/otel/trace" + "go.uber.org/zap" ) func New(cfg Config, logger *zap.Logger) trace.Tracer { //nolint: ireturn From 7e7d07d6ef3d39431a1edb698dc73cb99c3fe7b8 Mon Sep 17 00:00:00 2001 From: Parham Alvani Date: Sun, 29 May 2022 18:40:18 +0430 Subject: [PATCH 206/660] feat: update packages to go 1.18 --- .gitlab/ci/templates/compile.gitlab-ci.yml | 2 +- .gitlab/ci/templates/test.gitlab-ci.yml | 3 +- go.mod | 53 +- go.sum | 574 +++------------------ 4 files changed, 90 insertions(+), 542 deletions(-) diff --git a/.gitlab/ci/templates/compile.gitlab-ci.yml b/.gitlab/ci/templates/compile.gitlab-ci.yml index bbdd82c3..96ed1a38 100644 --- a/.gitlab/ci/templates/compile.gitlab-ci.yml +++ b/.gitlab/ci/templates/compile.gitlab-ci.yml @@ -1,7 +1,7 @@ --- compile: stage: compile - image: registry.snapp.tech/docker/golang:1.17-alpine3.14 + image: registry.snapp.tech/docker/golang:1.18-alpine3.15 variables: GOOS: "linux" GOARCH: "amd64" diff --git a/.gitlab/ci/templates/test.gitlab-ci.yml b/.gitlab/ci/templates/test.gitlab-ci.yml index f749513c..ce0f2da7 100644 --- a/.gitlab/ci/templates/test.gitlab-ci.yml +++ b/.gitlab/ci/templates/test.gitlab-ci.yml @@ -6,14 +6,13 @@ handolint: extends: .easy-ci:dockerfile:lint test: - image: registry.snapp.tech/docker/golang:1.17-alpine3.14 + image: registry.snapp.tech/docker/golang:1.18-alpine3.15 stage: test coverage: '/total:\s*\(statements\)\s*([\d.]+)%/' before_script: - go env -w GOPROXY="https://repo.snapp.tech/repository/goproxy/" script: - go test -gcflags=-l -v -coverprofile .coverage.out.tmp ./... - - cat .coverage.out.tmp | grep -v "mock.go" > .coverage.out - rm -rf .coverage.out.tmp - go tool cover -func .coverage.out dependencies: diff --git a/go.mod b/go.mod index 4c1d2bac..59ee559f 100644 --- a/go.mod +++ b/go.mod @@ -1,60 +1,57 @@ module gitlab.snapp.ir/dispatching/soteria -go 1.17 +go 1.18 require ( - github.com/ansrivas/fiberprometheus/v2 v2.1.2 - github.com/gofiber/contrib/fiberzap v0.0.0-20220215083858-d7416de5f637 - github.com/gofiber/fiber/v2 v2.27.0 - github.com/golang-jwt/jwt/v4 v4.3.0 - github.com/knadh/koanf v1.4.0 - github.com/prometheus/client_golang v1.12.1 // indirect - github.com/spf13/cobra v1.3.0 - github.com/stretchr/testify v1.7.0 + github.com/ansrivas/fiberprometheus/v2 v2.2.0 + github.com/gofiber/contrib/fiberzap v0.0.0-20220524060257-8ccfafc37b12 + github.com/gofiber/fiber/v2 v2.34.0 + github.com/golang-jwt/jwt/v4 v4.4.1 + github.com/knadh/koanf v1.4.1 + github.com/prometheus/client_golang v1.12.2 // indirect + github.com/spf13/cobra v1.4.0 + github.com/stretchr/testify v1.7.1 + github.com/tidwall/pretty v1.2.0 gitlab.snapp.ir/dispatching/snappids/v2 v2.9.0 + go.opentelemetry.io/otel v1.7.0 + go.opentelemetry.io/otel/exporters/jaeger v1.7.0 + go.opentelemetry.io/otel/sdk v1.7.0 + go.opentelemetry.io/otel/trace v1.7.0 go.uber.org/atomic v1.9.0 // indirect - go.uber.org/automaxprocs v1.4.0 + go.uber.org/automaxprocs v1.5.1 go.uber.org/zap v1.21.0 ) -require ( - github.com/tidwall/pretty v1.2.0 - go.opentelemetry.io/otel v1.4.0 - go.opentelemetry.io/otel/exporters/jaeger v1.4.0 - go.opentelemetry.io/otel/sdk v1.4.0 - go.opentelemetry.io/otel/trace v1.4.0 -) - require ( github.com/andybalholm/brotli v1.0.4 // indirect github.com/beorn7/perks v1.0.1 // indirect github.com/cespare/xxhash/v2 v2.1.2 // indirect github.com/davecgh/go-spew v1.1.1 // indirect github.com/fatih/structs v1.1.0 // indirect - github.com/fsnotify/fsnotify v1.5.1 // indirect - github.com/go-logr/logr v1.2.2 // indirect + github.com/fsnotify/fsnotify v1.5.4 // indirect + github.com/go-logr/logr v1.2.3 // indirect github.com/go-logr/stdr v1.2.2 // indirect - github.com/gofiber/adaptor/v2 v2.1.18 // indirect + github.com/gofiber/adaptor/v2 v2.1.24 // indirect github.com/gofiber/utils v0.1.2 // indirect github.com/golang/protobuf v1.5.2 // indirect github.com/inconshreveable/mousetrap v1.0.0 // indirect - github.com/klauspost/compress v1.14.2 // indirect + github.com/klauspost/compress v1.15.5 // indirect github.com/matttproud/golang_protobuf_extensions v1.0.1 // indirect github.com/mitchellh/copystructure v1.2.0 // indirect - github.com/mitchellh/mapstructure v1.4.3 // indirect + github.com/mitchellh/mapstructure v1.5.0 // indirect github.com/mitchellh/reflectwalk v1.0.2 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect github.com/prometheus/client_model v0.2.0 // indirect - github.com/prometheus/common v0.32.1 // indirect + github.com/prometheus/common v0.34.0 // indirect github.com/prometheus/procfs v0.7.3 // indirect github.com/speps/go-hashids/v2 v2.0.1 // indirect github.com/spf13/pflag v1.0.5 // indirect github.com/valyala/bytebufferpool v1.0.0 // indirect - github.com/valyala/fasthttp v1.33.0 // indirect + github.com/valyala/fasthttp v1.37.0 // indirect github.com/valyala/tcplisten v1.0.0 // indirect - go.uber.org/multierr v1.7.0 // indirect - golang.org/x/sys v0.0.0-20220209214540-3681064d5158 // indirect - google.golang.org/protobuf v1.27.1 // indirect + go.uber.org/multierr v1.8.0 // indirect + golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a // indirect + google.golang.org/protobuf v1.28.0 // indirect gopkg.in/yaml.v2 v2.4.0 // indirect gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b // indirect ) diff --git a/go.sum b/go.sum index 8dba59bf..c1e8937a 100644 --- a/go.sum +++ b/go.sum @@ -15,20 +15,6 @@ cloud.google.com/go v0.56.0/go.mod h1:jr7tqZxxKOVYizybht9+26Z/gUq7tiRzu+ACVAMbKV cloud.google.com/go v0.57.0/go.mod h1:oXiQ6Rzq3RAkkY7N6t3TcE6jE+CIBBbA36lwQ1JyzZs= cloud.google.com/go v0.62.0/go.mod h1:jmCYTdRCQuc1PHIIJ/maLInMho30T/Y0M4hTdTShOYc= cloud.google.com/go v0.65.0/go.mod h1:O5N8zS7uWy9vkA9vayVHs65eM1ubvY4h553ofrNHObY= -cloud.google.com/go v0.72.0/go.mod h1:M+5Vjvlc2wnp6tjzE102Dw08nGShTscUx2nZMufOKPI= -cloud.google.com/go v0.74.0/go.mod h1:VV1xSbzvo+9QJOxLDaJfTjx5e+MePCpCWwvftOeQmWk= -cloud.google.com/go v0.78.0/go.mod h1:QjdrLG0uq+YwhjoVOLsS1t7TW8fs36kLs4XO5R5ECHg= -cloud.google.com/go v0.79.0/go.mod h1:3bzgcEeQlzbuEAYu4mrWhKqWjmpprinYgKJLgKHnbb8= -cloud.google.com/go v0.81.0/go.mod h1:mk/AM35KwGk/Nm2YSeZbxXdrNK3KZOYHmLkOqC2V6E0= -cloud.google.com/go v0.83.0/go.mod h1:Z7MJUsANfY0pYPdw0lbnivPx4/vhy/e2FEkSkF7vAVY= -cloud.google.com/go v0.84.0/go.mod h1:RazrYuxIK6Kb7YrzzhPoLmCVzl7Sup4NrbKPg8KHSUM= -cloud.google.com/go v0.87.0/go.mod h1:TpDYlFy7vuLzZMMZ+B6iRiELaY7z/gJPaqbMx6mlWcY= -cloud.google.com/go v0.90.0/go.mod h1:kRX0mNRHe0e2rC6oNakvwQqzyDmg57xJ+SZU1eT2aDQ= -cloud.google.com/go v0.93.3/go.mod h1:8utlLll2EF5XMAV15woO4lSbWQlk8rer9aLOfLh7+YI= -cloud.google.com/go v0.94.1/go.mod h1:qAlAugsXlC+JWO+Bke5vCtc9ONxjQT3drlTTnAplMW4= -cloud.google.com/go v0.97.0/go.mod h1:GF7l59pYBVlXQIBLx3a761cZ41F9bBH3JUlihCt2Udc= -cloud.google.com/go v0.98.0/go.mod h1:ua6Ush4NALrHk5QXDWnjvZHN93OuF0HfuEPq9I1X0cM= -cloud.google.com/go v0.99.0/go.mod h1:w0Xx2nLzqWJPuozYQX+hFfCSI8WioryfRDzkoI/Y2ZA= cloud.google.com/go/bigquery v1.0.1/go.mod h1:i/xbL2UlR5RvWAURpBYZTtm/cXjCha9lbfbpx4poX+o= cloud.google.com/go/bigquery v1.3.0/go.mod h1:PjpwJnslEMmckchkHFfq+HTD2DmtT67aNFKH1/VBDHE= cloud.google.com/go/bigquery v1.4.0/go.mod h1:S8dzgnTigyfTmLBfrtrhyYhwRxG72rYxvftPBK2Dvzc= @@ -37,7 +23,6 @@ cloud.google.com/go/bigquery v1.7.0/go.mod h1://okPTzCYNXSlb24MZs83e2Do+h+VXtc4g cloud.google.com/go/bigquery v1.8.0/go.mod h1:J5hqkt3O0uAFnINi6JXValWIb1v0goeZM77hZzJN/fQ= cloud.google.com/go/datastore v1.0.0/go.mod h1:LXYbyblFSglQ5pkeyhO+Qmw7ukd3C+pD7TKLgZqpHYE= cloud.google.com/go/datastore v1.1.0/go.mod h1:umbIZjpQpHh4hmRpGhH4tLFup+FVzqBi1b3c64qFpCk= -cloud.google.com/go/firestore v1.6.1/go.mod h1:asNXNOzBdyVQmEU+ggO8UPodTkEVFW5Qx+rwHnAz+EY= cloud.google.com/go/pubsub v1.0.1/go.mod h1:R0Gpsv3s54REJCy4fxDixWD93lHJMoZTyQ2kNxGRt3I= cloud.google.com/go/pubsub v1.1.0/go.mod h1:EwwdRX2sKPjnvnqCa270oGRyludottCI76h+R3AArQw= cloud.google.com/go/pubsub v1.2.0/go.mod h1:jhfEVHT8odbXTkndysNHCcx0awwzvfOlguIAii9o8iA= @@ -50,35 +35,17 @@ cloud.google.com/go/storage v1.10.0/go.mod h1:FLPqc6j+Ki4BU591ie1oL6qBQGu2Bl/tZ9 dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= -github.com/DataDog/datadog-go v3.2.0+incompatible/go.mod h1:LButxg5PwREeZtORoXG3tL4fMGNddJ+vMq1mwgfaqoQ= -github.com/Knetic/govaluate v3.0.1-0.20171022003610-9aa49832a739+incompatible/go.mod h1:r7JcOSlj0wfOMncg0iLm8Leh48TZaKVeNIfJntJ2wa0= -github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU= -github.com/Shopify/sarama v1.19.0/go.mod h1:FVkBWblsNy7DGZRfXLU0O9RCGt5g3g3yEuWXgklEdEo= -github.com/Shopify/toxiproxy v2.1.4+incompatible/go.mod h1:OXgGpZ6Cli1/URJOF1DMxUHB2q5Ap20/P/eIdh4G0pI= -github.com/VividCortex/gohistogram v1.0.0/go.mod h1:Pf5mBqqDxYaXu3hDrrU+w6nw50o/4+TcAqDqk/vUH7g= -github.com/afex/hystrix-go v0.0.0-20180502004556-fa1af6a1f4f5/go.mod h1:SkGFH1ia65gfNATL8TAiHDNxPzPdmEL5uirI2Uyuz6c= github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= github.com/alecthomas/units v0.0.0-20190717042225-c3de453c63f4/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= github.com/alecthomas/units v0.0.0-20190924025748-f65c72e2690d/go.mod h1:rBZYJk541a8SKzHPHnH3zbiI+7dagKZ0cgpgrD7Fyho= -github.com/andybalholm/brotli v1.0.0/go.mod h1:loMXtMfwqflxFJPmdbJO0a3KNoPuLBgiu3qAvBg8x/Y= github.com/andybalholm/brotli v1.0.4 h1:V7DdXeJtZscaqfNuAdSRuRFzuiKlHSC/Zh3zl9qY3JY= github.com/andybalholm/brotli v1.0.4/go.mod h1:fO7iG3H7G2nSZ7m0zPUDn85XEX2GTukHGRSepvi9Eig= -github.com/ansrivas/fiberprometheus/v2 v2.1.2 h1:xhG9rfJuqfpRNVHX4//ZQnKAbBubKDsvVFlGWBH9JsE= -github.com/ansrivas/fiberprometheus/v2 v2.1.2/go.mod h1:M8p5I/jCzqpD8V/IprHLmLzRIx5cJFE+/76NavR4PXI= -github.com/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kdvxnR2qWY= -github.com/apache/thrift v0.12.0/go.mod h1:cp2SuWMxlEZw2r+iP2GNCdIi4C1qmUzdZFSVb+bacwQ= -github.com/apache/thrift v0.13.0/go.mod h1:cp2SuWMxlEZw2r+iP2GNCdIi4C1qmUzdZFSVb+bacwQ= -github.com/armon/circbuf v0.0.0-20150827004946-bbbad097214e/go.mod h1:3U/XgcO3hCbHZ8TKRvWD2dDTCfh9M9ya+I9JpbB7O8o= +github.com/ansrivas/fiberprometheus/v2 v2.2.0 h1:9k459f75k5oaw0FmpTPizBry710vlhoBjzNaXW+/gls= +github.com/ansrivas/fiberprometheus/v2 v2.2.0/go.mod h1:uJNa1TvTLLwP1wzmg0vg+YPlsqXkQHX+557hfltg+iY= github.com/armon/go-metrics v0.0.0-20180917152333-f0300d1749da/go.mod h1:Q73ZrmVTwzkszR9V5SSuryQ31EELlFMUz1kKyl939pY= -github.com/armon/go-metrics v0.3.10/go.mod h1:4O98XIr/9W0sxpJ8UaYkvjk10Iff7SnFrb4QAOwNTFc= github.com/armon/go-radix v0.0.0-20180808171621-7fddfc383310/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8= -github.com/armon/go-radix v1.0.0/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8= -github.com/aryann/difflib v0.0.0-20170710044230-e206f873d14a/go.mod h1:DAHtR1m6lCRdSC2Tm3DSWRPvIPr6xNKyeHdqDQSQT+A= -github.com/aws/aws-lambda-go v1.13.3/go.mod h1:4UKl9IzQMoD+QF79YdCuzCwp8VbmG4VAQwij/eHl5CU= -github.com/aws/aws-sdk-go v1.27.0/go.mod h1:KmX6BPdI08NWTb3/sm4ZGu5ShLoqVDhKgpiN924inxo= -github.com/aws/aws-sdk-go-v2 v0.18.0/go.mod h1:JWVYvqSMppoMJC0x5wdwiImzgXTI9FuZwxzkQq9wy+g= github.com/aws/aws-sdk-go-v2 v1.9.2/go.mod h1:cK/D0BBs0b/oWPIcX/Z/obahJK1TT7IPVjy53i/mX/4= github.com/aws/aws-sdk-go-v2/config v1.8.3/go.mod h1:4AEiLtAb8kLs7vgw2ZV3p2VZ1+hBavOc84hqxVNpCyw= github.com/aws/aws-sdk-go-v2/credentials v1.4.3/go.mod h1:FNNC6nQZQUuyhq5aE5c7ata8o9e4ECGmS4lAXC7o1mQ= @@ -97,119 +64,67 @@ github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+Ce 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/bgentry/speakeasy v0.1.0/go.mod h1:+zsyZBPWlz7T6j88CTgSN5bM796AkVf0kBD4zp0CCIs= -github.com/casbin/casbin/v2 v2.1.2/go.mod h1:YcPU1XXisHhLzuxH9coDNf2FbKpjGlbCg3n9yuLkIJQ= -github.com/cenkalti/backoff v2.2.1+incompatible/go.mod h1:90ReRw6GdpyfrHakVjL/QHaoyV4aDUVVkXQJJJ3NXXM= github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= -github.com/census-instrumentation/opencensus-proto v0.3.0/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= -github.com/cespare/xxhash v1.1.0 h1:a6HrQnmkObjyL+Gs60czilIUGqrzKutQD6XZog3p+ko= -github.com/cespare/xxhash v1.1.0/go.mod h1:XrSqR1VqqWfGrhpAt58auRo0WTKS1nRRg3ghfAqPWnc= github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= github.com/cespare/xxhash/v2 v2.1.2 h1:YRXhKfTDauu4ajMg1TPgFO5jnlC2HCbmLXMcTG5cbYE= github.com/cespare/xxhash/v2 v2.1.2/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI= github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI= github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU= -github.com/circonus-labs/circonus-gometrics v2.3.1+incompatible/go.mod h1:nmEj6Dob7S7YxXgwXpfOuvO54S+tGdZdw9fuRZt25Ag= -github.com/circonus-labs/circonusllhist v0.1.3/go.mod h1:kMXHVDlOchFAehlya5ePtbp5jckzBHf4XRpQvBOLI+I= -github.com/clbanning/x2j v0.0.0-20191024224557-825249438eec/go.mod h1:jMjuTZXRI4dUb/I5gc9Hdhagfvm9+RyrPryS/auMzxE= github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc= -github.com/cncf/udpa/go v0.0.0-20200629203442-efcf912fb354/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= -github.com/cncf/udpa/go v0.0.0-20201120205902-5459f2c99403/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= -github.com/cncf/udpa/go v0.0.0-20210930031921-04548b0d99d4/go.mod h1:6pvJx4me5XPnfI9Z40ddWsdw2W/uZgQLFXToKeRcDiI= -github.com/cncf/xds/go v0.0.0-20210312221358-fbca930ec8ed/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= -github.com/cncf/xds/go v0.0.0-20210805033703-aa0b78936158/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= -github.com/cncf/xds/go v0.0.0-20210922020428-25de7278fc84/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= -github.com/cncf/xds/go v0.0.0-20211001041855-01bcc9b48dfe/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= -github.com/cncf/xds/go v0.0.0-20211011173535-cb28da3451f1/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= -github.com/cncf/xds/go v0.0.0-20211130200136-a8f946100490/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= -github.com/cockroachdb/datadriven v0.0.0-20190809214429-80d97fb3cbaa/go.mod h1:zn76sxSg3SzpJ0PPJaLDCu+Bu0Lg3sKTORVIj19EIF8= -github.com/codahale/hdrhistogram v0.0.0-20161010025455-3a0bb77429bd/go.mod h1:sE/e/2PUdi/liOCUjSTXgM1o87ZssimdTWN964YiIeI= -github.com/coreos/go-semver v0.2.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk= -github.com/coreos/go-semver v0.3.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk= -github.com/coreos/go-systemd v0.0.0-20180511133405-39ca1b05acc7/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4= -github.com/coreos/go-systemd/v22 v22.3.2/go.mod h1:Y58oyj3AT4RCenI/lSvhwexgC+NSVTIJ3seZv2GcEnc= -github.com/coreos/pkg v0.0.0-20160727233714-3ac0863d7acf/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA= -github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU= github.com/cpuguy83/go-md2man/v2 v2.0.1/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= -github.com/creack/pty v1.1.7/go.mod h1:lj5s0c3V2DBrqTV7llrYr5NG6My20zk30Fl46Y7DoTY= github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ= -github.com/dustin/go-humanize v0.0.0-20171111073723-bb3d318650d4/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk= -github.com/eapache/go-resiliency v1.1.0/go.mod h1:kFI+JgMyC7bLPUVY133qvEBtVayf5mFgVsvEsIPBvNs= -github.com/eapache/go-xerial-snappy v0.0.0-20180814174437-776d5712da21/go.mod h1:+020luEh2TKB4/GOp8oxxtq0Daoen/Cii55CzbTV6DU= -github.com/eapache/queue v1.1.0/go.mod h1:6eCeP0CKFpHLu8blIFXhExK/dRa7WDZfr6jVFPTqq+I= -github.com/edsrzf/mmap-go v1.0.0/go.mod h1:YO35OhQPt3KJa3ryjFM5Bs14WD66h8eGKpfaBNrHW5M= -github.com/envoyproxy/go-control-plane v0.6.9/go.mod h1:SBwIajubJHhxtWwsL9s8ss4safvEdbitLhGGK48rN6g= github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98= -github.com/envoyproxy/go-control-plane v0.9.7/go.mod h1:cwu0lG7PUMfa9snN8LXBig5ynNVH9qI8YYLbd1fK2po= -github.com/envoyproxy/go-control-plane v0.9.9-0.20201210154907-fd9021fe5dad/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk= -github.com/envoyproxy/go-control-plane v0.9.9-0.20210217033140-668b12f5399d/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk= -github.com/envoyproxy/go-control-plane v0.9.9-0.20210512163311-63b5d3c536b0/go.mod h1:hliV/p42l8fGbc6Y9bQ70uLwIvmJyVE5k4iMKlh8wCQ= -github.com/envoyproxy/go-control-plane v0.9.10-0.20210907150352-cf90f659a021/go.mod h1:AFq3mo9L8Lqqiid3OhADV3RfLJnjiw63cSpi+fDTRC0= -github.com/envoyproxy/go-control-plane v0.10.1/go.mod h1:AY7fTTXNdv/aJ2O5jwpxAPOWUZ7hQAEvzN5Pf27BkQQ= github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= -github.com/envoyproxy/protoc-gen-validate v0.6.2/go.mod h1:2t7qjJNvHPx8IjnBOzl9E9/baC+qXE/TeeyBRzgJDws= github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= -github.com/fatih/color v1.9.0/go.mod h1:eQcE1qtQxscV5RaZvpXrrb8Drkc3/DdQ+uUYCNjL+zU= -github.com/fatih/color v1.13.0/go.mod h1:kLAiJbzzSOZDVNGyDpeOxJ47H46qBXwg5ILebYFFOfk= github.com/fatih/structs v1.1.0 h1:Q7juDM0QtcnhCpeyLGQKyg4TOIghuNXrkL32pHAUMxo= github.com/fatih/structs v1.1.0/go.mod h1:9NiDSp5zOcgEDl+j00MP/WkGVPOlPRLejGD8Ga6PJ7M= -github.com/franela/goblin v0.0.0-20200105215937-c9ffbefa60db/go.mod h1:7dvUGVsVBjqR7JHJk0brhHOZYGmfBYOrK0ZhYMEtBr4= -github.com/franela/goreq v0.0.0-20171204163338-bcd34c9993f8/go.mod h1:ZhphrRTfi2rbfLwlschooIH4+wKKDR4Pdxhh+TRoA20= -github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ= -github.com/fsnotify/fsnotify v1.5.1 h1:mZcQUHVQUQWoPXXtuf9yuEXKudkV2sx1E06UadKWpgI= -github.com/fsnotify/fsnotify v1.5.1/go.mod h1:T3375wBYaZdLLcVNkcVbzGHY7f1l/uK5T5Ai1i3InKU= -github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= +github.com/fsnotify/fsnotify v1.5.4 h1:jRbGcIw6P2Meqdwuo0H1p6JVLbL5DHKAKlYndzMwVZI= +github.com/fsnotify/fsnotify v1.5.4/go.mod h1:OVB6XrOHzAwXMpEM7uPOzcehqUV2UqJxmVXmkdnm1bU= github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU= github.com/go-gl/glfw/v3.3/glfw v0.0.0-20191125211704-12ad95a8df72/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= github.com/go-gl/glfw/v3.3/glfw v0.0.0-20200222043503-6f7a984d4dc4/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= github.com/go-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= github.com/go-kit/kit v0.9.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= -github.com/go-kit/kit v0.10.0/go.mod h1:xUsJbQ/Fp4kEt7AFgCuvyX4a71u8h9jB8tj/ORgOZ7o= github.com/go-kit/log v0.1.0/go.mod h1:zbhenjAZHb184qTLMA9ZjW7ThYL0H2mk7Q6pNt4vbaY= +github.com/go-kit/log v0.2.0/go.mod h1:NwTd00d/i8cPZ3xOwwiv2PO5MOcx78fFErGNcVmBjv0= github.com/go-ldap/ldap v3.0.2+incompatible/go.mod h1:qfd9rJvER9Q0/D/Sqn1DfHRoBp40uXYvFoEVrNEPqRc= github.com/go-logfmt/logfmt v0.3.0/go.mod h1:Qt1PoO58o5twSAckw1HlFXLmHsOX5/0LbT9GBnD5lWE= github.com/go-logfmt/logfmt v0.4.0/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V4qmtdjCk= github.com/go-logfmt/logfmt v0.5.0/go.mod h1:wCYkCAKZfumFQihp8CzCvQ3paCTfi41vtzG1KdI/P7A= -github.com/go-logr/logr v1.2.2 h1:ahHml/yUpnlb96Rp8HCvtYVPY8ZYpxq3g7UYchIYwbs= +github.com/go-logfmt/logfmt v0.5.1/go.mod h1:WYhtIu8zTZfxdn5+rREduYbwxfcBr/Vr6KEVveWlfTs= github.com/go-logr/logr v1.2.2/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= +github.com/go-logr/logr v1.2.3 h1:2DntVwHkVopvECVRSlL5PSo9eG+cAkDCuckLubN+rq0= +github.com/go-logr/logr v1.2.3/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag= github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE= -github.com/go-sql-driver/mysql v1.4.0/go.mod h1:zAC/RDZ24gD3HViQzih4MyKcchzm+sOG5ZlKdlhCg5w= github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= github.com/go-test/deep v1.0.2-0.20181118220953-042da051cf31/go.mod h1:wGDj63lr65AM2AQyKZd/NYHGb0R+1RLqB8NKt3aSFNA= -github.com/godbus/dbus/v5 v5.0.4/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA= -github.com/gofiber/adaptor/v2 v2.1.1/go.mod h1:jdHkqsqdWzEc0qMB+5svsWL5kdZmaDN2H0C3Hxl8y7c= -github.com/gofiber/adaptor/v2 v2.1.18 h1:J0UlV40ng4K0Nb9mBw7b8bgX4AcFfPQw1+cybnSyXLU= -github.com/gofiber/adaptor/v2 v2.1.18/go.mod h1:20XTo3Nxorrxwi5vBFdPpaZstEM4n/Nx3pSfakFrczg= -github.com/gofiber/contrib/fiberzap v0.0.0-20220215083858-d7416de5f637 h1:0oUJsQddXrPwsDiBEChd/xx/v+qSWfUILHZzv9SEy9k= -github.com/gofiber/contrib/fiberzap v0.0.0-20220215083858-d7416de5f637/go.mod h1:U7hH82bwDTwfqu9NjVJ68ccUEv+Cz3ro0/qJmyYj8dc= -github.com/gofiber/fiber/v2 v2.2.2/go.mod h1:Aso7/M+EQOinVkWp4LUYjdlTpKTBoCk2Qo4djnMsyHE= -github.com/gofiber/fiber/v2 v2.6.0/go.mod h1:f8BRRIMjMdRyt2qmJ/0Sea3j3rwwfufPrh9WNBRiVZ0= -github.com/gofiber/fiber/v2 v2.27.0 h1:u34t1nOea7zz4jcZDK7+ZMiG+MVFYrHqMhTdYQDiFA8= -github.com/gofiber/fiber/v2 v2.27.0/go.mod h1:0bPXdTu+jRqINrEq1T6mHeVBnE0lQd67PGu35jD3hLk= +github.com/gofiber/adaptor/v2 v2.1.19/go.mod h1:BI6lLkHBVNAVxm9hVPXfYoAKZJnsvAxBnPnhfipgBGQ= +github.com/gofiber/adaptor/v2 v2.1.24 h1:EdQWVODtOTRAHZRuNMbmNrlvgY+4liPO/JOwKk/Dkm0= +github.com/gofiber/adaptor/v2 v2.1.24/go.mod h1:4g5V9/lhwLwgHHlQNEWXa3WUigzNjDXNmEN9BmQ2VME= +github.com/gofiber/contrib/fiberzap v0.0.0-20220524060257-8ccfafc37b12 h1:JYRErtl8SCkpb+Q6SqJCnv7yNj0YdIEgXdT7c2jk3Cs= +github.com/gofiber/contrib/fiberzap v0.0.0-20220524060257-8ccfafc37b12/go.mod h1:slKtSiIxJ2Fi5wX9iYZxUEay6OMXxYFfuBCqqXDqUaU= +github.com/gofiber/fiber/v2 v2.28.0/go.mod h1:0bPXdTu+jRqINrEq1T6mHeVBnE0lQd67PGu35jD3hLk= +github.com/gofiber/fiber/v2 v2.29.0/go.mod h1:1Ega6O199a3Y7yDGuM9FyXDPYQfv+7/y48wl6WCwUF4= +github.com/gofiber/fiber/v2 v2.34.0 h1:96BJMw6uaxQhJsHY54SFGOtGgp9pgombK5Hbi4JSEQA= +github.com/gofiber/fiber/v2 v2.34.0/go.mod h1:ozRQfS+D7EL1+hMH+gutku0kfx1wLX4hAxDCtDzpj4U= github.com/gofiber/utils v0.1.2 h1:1SH2YEz4RlNS0tJlMJ0bGwO0JkqPqvq6TbHK9tXZKtk= github.com/gofiber/utils v0.1.2/go.mod h1:pacRFtghAE3UoknMOUiXh2Io/nLWSUHtQCi/3QASsOc= -github.com/gogo/googleapis v1.1.0/go.mod h1:gf4bu3Q80BeJ6H1S1vYPm8/ELATdvryBaNFGgqEef3s= github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= -github.com/gogo/protobuf v1.2.0/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= -github.com/gogo/protobuf v1.2.1/go.mod h1:hp+jE20tsWTFYpLwKvXlhS1hjn+gTNwPg2I6zVXpSg4= -github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q= -github.com/golang-jwt/jwt/v4 v4.3.0 h1:kHL1vqdqWNfATmA0FNMdmZNMyZI1U6O31X4rlIPoBog= -github.com/golang-jwt/jwt/v4 v4.3.0/go.mod h1:/xlHOz8bRuivTWchD4jCa+NbatV+wEUSzwAxVc6locg= +github.com/golang-jwt/jwt/v4 v4.4.1 h1:pC5DB52sCeK48Wlb9oPcdhnjkz1TKt1D/P7WKJ0kUcQ= +github.com/golang-jwt/jwt/v4 v4.4.1/go.mod h1:m21LjoU+eqJr34lmDMbreY2eSTRJ1cv77w39/MY0Ch0= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= -github.com/golang/groupcache v0.0.0-20160516000752-02826c3e7903/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/groupcache v0.0.0-20191227052852-215e87163ea7/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= -github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= github.com/golang/mock v1.2.0/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= github.com/golang/mock v1.3.1/go.mod h1:sBzyDLLjw3U8JLTeZvSv8jJB+tU5PVekmnlKIyFUx0Y= @@ -217,8 +132,6 @@ github.com/golang/mock v1.4.0/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt github.com/golang/mock v1.4.1/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= github.com/golang/mock v1.4.3/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= github.com/golang/mock v1.4.4/go.mod h1:l3mdAwkq5BuhzHwde/uurv3sEJeZMXNpwsxVWU71h+4= -github.com/golang/mock v1.5.0/go.mod h1:CWnOUgYIOo4TcNZ0wHX3YZCqsaM1I1Jvs6v3mP3KVu8= -github.com/golang/mock v1.6.0/go.mod h1:p6yTPP+5HYm5mzsMV8JkE6ZKdX+/wYM6Hr+LicevLPs= github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= @@ -234,12 +147,9 @@ github.com/golang/protobuf v1.4.1/go.mod h1:U8fpvMrcmy5pZrNK1lt4xCsGvpyWQ/VVv6QD github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= github.com/golang/protobuf v1.4.3/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= -github.com/golang/protobuf v1.5.1/go.mod h1:DopwsBzvsk0Fs44TXzsVbJyPhcCPeIwnvohx4u74HPM= github.com/golang/protobuf v1.5.2 h1:ROPKBNFfQgOUMifHyP+KYbvpjbdoFNs+aK7DXlji0Tw= github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= -github.com/golang/snappy v0.0.0-20180518054509-2e65f85255db/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= github.com/golang/snappy v0.0.1/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= -github.com/golang/snappy v0.0.3/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= @@ -249,8 +159,6 @@ github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/ github.com/google/go-cmp v0.4.1/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.1/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.5.4/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.6/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= @@ -259,8 +167,6 @@ github.com/google/go-cmp v0.5.7/go.mod h1:n+brtR0CgQNWTVd5ZUFpTBC8YFBDLK/h/bpaJ8 github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs= github.com/google/martian/v3 v3.0.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0= -github.com/google/martian/v3 v3.1.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0= -github.com/google/martian/v3 v3.2.1/go.mod h1:oBOf6HBosgwRXnUGWUB05QECsc6uvmMiJ3+6W4l/CUk= github.com/google/pprof v0.0.0-20181206194817-3ea8567a2e57/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= github.com/google/pprof v0.0.0-20190515194954-54271f7e092f/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= github.com/google/pprof v0.0.0-20191218002539-d4f498aebedc/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= @@ -268,121 +174,58 @@ github.com/google/pprof v0.0.0-20200212024743-f11f1df84d12/go.mod h1:ZgVRPoUq/hf github.com/google/pprof v0.0.0-20200229191704-1ebb73c60ed3/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= github.com/google/pprof v0.0.0-20200430221834-fc25d7d30c6d/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= github.com/google/pprof v0.0.0-20200708004538-1a94d8640e99/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= -github.com/google/pprof v0.0.0-20201023163331-3e6fc7fc9c4c/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= -github.com/google/pprof v0.0.0-20201203190320-1bf35d6f28c2/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= -github.com/google/pprof v0.0.0-20210122040257-d980be63207e/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= -github.com/google/pprof v0.0.0-20210226084205-cbba55b83ad5/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= -github.com/google/pprof v0.0.0-20210601050228-01bbb1931b22/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= -github.com/google/pprof v0.0.0-20210609004039-a478d1d731e9/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= -github.com/google/pprof v0.0.0-20210720184732-4bb14d4b1be1/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= -github.com/google/uuid v1.0.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg= github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk= -github.com/googleapis/gax-go/v2 v2.1.0/go.mod h1:Q3nei7sK6ybPYH7twZdmQpAd1MKb7pfu6SK+H1/DsU0= -github.com/googleapis/gax-go/v2 v2.1.1/go.mod h1:hddJymUZASv3XPyGkUpKj8pPO47Rmb0eJc8R6ouapiM= -github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= -github.com/gorilla/context v1.1.1/go.mod h1:kBGZzfjB9CEq2AlWe17Uuf7NDRt0dE0s8S51q0aT7Yg= -github.com/gorilla/mux v1.6.2/go.mod h1:1lud6UwP+6orDFRuTfBEV8e9/aOM/c4fVVCaMa2zaAs= -github.com/gorilla/mux v1.7.3/go.mod h1:1lud6UwP+6orDFRuTfBEV8e9/aOM/c4fVVCaMa2zaAs= -github.com/gorilla/websocket v0.0.0-20170926233335-4201258b820c/go.mod h1:E7qHFY5m1UJ88s3WnNqhKjPHQ0heANvMoAMk2YaljkQ= -github.com/grpc-ecosystem/go-grpc-middleware v1.0.1-0.20190118093823-f849b5445de4/go.mod h1:FiyG127CGDf3tlThmgyCl78X/SZQqEOJBCDaAfeWzPs= -github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0/go.mod h1:8NvIoxWQoOIhqOTXgfV/d3M/q6VIi02HzZEHgUlZvzk= -github.com/grpc-ecosystem/grpc-gateway v1.9.5/go.mod h1:vNeuVxBJEsws4ogUvrchl83t/GYV9WGTSLVdBhOQFDY= -github.com/grpc-ecosystem/grpc-gateway v1.16.0/go.mod h1:BDjrQk3hbvj6Nolgz8mAMFbcEtjT1g+wF4CSlocrBnw= -github.com/hashicorp/consul/api v1.3.0/go.mod h1:MmDNSzIMUjNpY/mQ398R4bk2FnqQLoPndWW5VkKPlCE= -github.com/hashicorp/consul/api v1.11.0/go.mod h1:XjsvQN+RJGWI2TWy1/kqaE16HrR2J/FWgkYjdZQsX9M= -github.com/hashicorp/consul/sdk v0.3.0/go.mod h1:VKf9jXwCTEY1QZP2MOLRhb5i/I/ssyNV1vwHyQBF0x8= -github.com/hashicorp/consul/sdk v0.8.0/go.mod h1:GBvyrGALthsZObzUGsfgHZQDXjg4lOjagTIwIR1vPms= github.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= github.com/hashicorp/go-cleanhttp v0.5.0/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtngrth3wmdIIUrZ80= github.com/hashicorp/go-cleanhttp v0.5.1/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtngrth3wmdIIUrZ80= -github.com/hashicorp/go-cleanhttp v0.5.2/go.mod h1:kO/YDlP8L1346E6Sodw+PrpBSV4/SoxCXGY6BqNFT48= github.com/hashicorp/go-hclog v0.0.0-20180709165350-ff2cf002a8dd/go.mod h1:9bjs9uLqI8l75knNv3lV1kA55veR+WUPSiKIWcQHudI= github.com/hashicorp/go-hclog v0.8.0/go.mod h1:5CU+agLiy3J7N7QjHK5d05KxGsuXiQLrjA0H7acj2lQ= -github.com/hashicorp/go-hclog v0.12.0/go.mod h1:whpDNt7SSdeAju8AWKIWsul05p54N/39EeqMAyrmvFQ= -github.com/hashicorp/go-hclog v1.0.0/go.mod h1:whpDNt7SSdeAju8AWKIWsul05p54N/39EeqMAyrmvFQ= github.com/hashicorp/go-immutable-radix v1.0.0/go.mod h1:0y9vanUI8NX6FsYoO3zeMjhV/C5i9g4Q3DwcSNZ4P60= -github.com/hashicorp/go-immutable-radix v1.3.1/go.mod h1:0y9vanUI8NX6FsYoO3zeMjhV/C5i9g4Q3DwcSNZ4P60= -github.com/hashicorp/go-msgpack v0.5.3/go.mod h1:ahLV/dePpqEmjfWmKiqvPkv/twdG7iPBM1vqhUKIvfM= github.com/hashicorp/go-multierror v1.0.0/go.mod h1:dHtQlpGsu+cZNNAkkCN/P3hoUDHhCYQXV3UM06sGGrk= -github.com/hashicorp/go-multierror v1.1.0/go.mod h1:spPvp8C1qA32ftKqdAHm4hHTbPw+vmowP0z+KUhOZdA= github.com/hashicorp/go-plugin v1.0.1/go.mod h1:++UyYGoz3o5w9ZzAdZxtQKrWWP+iqPBn3cQptSMzBuY= -github.com/hashicorp/go-retryablehttp v0.5.3/go.mod h1:9B5zBasrRhHXnJnui7y6sL7es7NDiJgTc6Er0maI1Xs= github.com/hashicorp/go-retryablehttp v0.5.4/go.mod h1:9B5zBasrRhHXnJnui7y6sL7es7NDiJgTc6Er0maI1Xs= -github.com/hashicorp/go-rootcerts v1.0.0/go.mod h1:K6zTfqpRlCUIjkwsN4Z+hiSfzSTQa6eBIzfwKfwNnHU= github.com/hashicorp/go-rootcerts v1.0.1/go.mod h1:pqUvnprVnM5bf7AOirdbb01K4ccR319Vf4pU3K5EGc8= -github.com/hashicorp/go-rootcerts v1.0.2/go.mod h1:pqUvnprVnM5bf7AOirdbb01K4ccR319Vf4pU3K5EGc8= -github.com/hashicorp/go-sockaddr v1.0.0/go.mod h1:7Xibr9yA9JjQq1JpNB2Vw7kxv8xerXegt+ozgdvDeDU= github.com/hashicorp/go-sockaddr v1.0.2/go.mod h1:rB4wwRAUzs07qva3c5SdrY/NEtAUjGlgmH/UkBUC97A= -github.com/hashicorp/go-syslog v1.0.0/go.mod h1:qPfqrKkXGihmCqbJM2mZgkZGvKG1dFdvsLplgctolz4= github.com/hashicorp/go-uuid v1.0.0/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= github.com/hashicorp/go-uuid v1.0.1/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= github.com/hashicorp/go-version v1.1.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= -github.com/hashicorp/go-version v1.2.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= -github.com/hashicorp/go.net v0.0.1/go.mod h1:hjKkEWcCURg++eb33jQU7oqQcI9XDCnUzHA0oac0k90= github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= -github.com/hashicorp/golang-lru v0.5.4/go.mod h1:iADmTwqILo4mZ8BN3D2Q6+9jd8WM5uGBxy+E8yxSoD4= github.com/hashicorp/hcl v1.0.0 h1:0Anlzjpi4vEasTeNFn2mLJgTSwt0+6sfsiTG8qcWGx4= github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ= -github.com/hashicorp/logutils v1.0.0/go.mod h1:QIAnNjmIWmVIIkWDTG1z5v++HQmx9WQRO+LraFDTW64= -github.com/hashicorp/mdns v1.0.0/go.mod h1:tL+uN++7HEJ6SQLQ2/p+z2pH24WQKWjBPkE0mNTz8vQ= -github.com/hashicorp/mdns v1.0.1/go.mod h1:4gW7WsVCke5TE7EPeYliwHlRUyBtfCwuFwuMg2DmyNY= -github.com/hashicorp/mdns v1.0.4/go.mod h1:mtBihi+LeNXGtG8L9dX59gAEa12BDtBQSp4v/YAJqrc= -github.com/hashicorp/memberlist v0.1.3/go.mod h1:ajVTdAv/9Im8oMAAj5G31PhhMCZJV2pPBoIllUwCN7I= -github.com/hashicorp/memberlist v0.2.2/go.mod h1:MS2lj3INKhZjWNqd3N0m3J+Jxf3DAOnAH9VT3Sh9MUE= -github.com/hashicorp/memberlist v0.3.0/go.mod h1:MS2lj3INKhZjWNqd3N0m3J+Jxf3DAOnAH9VT3Sh9MUE= -github.com/hashicorp/serf v0.8.2/go.mod h1:6hOLApaqBFA1NXqRQAsxw9QxuDEvNxSQRwA/JwenrHc= -github.com/hashicorp/serf v0.9.5/go.mod h1:UWDWwZeL5cuWDJdl0C6wrvrUwEqtQ4ZKBKKENpqIUyk= -github.com/hashicorp/serf v0.9.6/go.mod h1:TXZNMjZQijwlDvp+r0b63xZ45H7JmCmgg4gpTwn9UV4= github.com/hashicorp/vault/api v1.0.4/go.mod h1:gDcqh3WGcR1cpF5AJz/B1UFheUEneMoIospckxBxk6Q= github.com/hashicorp/vault/sdk v0.1.13/go.mod h1:B+hVj7TpuQY1Y/GPbCpffmgd+tSEwvhkWnjtSYCaS2M= github.com/hashicorp/yamux v0.0.0-20180604194846-3520598351bb/go.mod h1:+NfK9FKeTrX5uv1uIXGdwYDTeHna2qgaIlx54MXqjAM= github.com/hashicorp/yamux v0.0.0-20181012175058-2f1d1f20f75d/go.mod h1:+NfK9FKeTrX5uv1uIXGdwYDTeHna2qgaIlx54MXqjAM= -github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= -github.com/hudl/fargo v1.3.0/go.mod h1:y3CKSmjA+wD2gak7sUSXTAoopbhU08POFhmITJgmKTg= -github.com/iancoleman/strcase v0.2.0/go.mod h1:iwCmte+B7n89clKwxIoIXy/HfoL7AsD47ZCWhYzw7ho= github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= -github.com/ianlancetaylor/demangle v0.0.0-20200824232613-28f6c0f3b639/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= github.com/inconshreveable/mousetrap v1.0.0 h1:Z8tu5sraLXCXIcARxBp/8cbvlwVa7Z1NHg9XEKhtSvM= github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8= -github.com/influxdata/influxdb1-client v0.0.0-20191209144304-8bf82d3c094d/go.mod h1:qj24IKcXYK6Iy9ceXlo3Tc+vtHo9lIhSX5JddghvEPo= -github.com/jmespath/go-jmespath v0.0.0-20180206201540-c2b33e8439af/go.mod h1:Nht3zPeWKUH0NzdCt2Blrr5ys8VGpn0CEB0cQHVjt7k= github.com/jmespath/go-jmespath v0.4.0/go.mod h1:T8mJZnbsbmF+m6zOOFylbeCJqk5+pHWvzYPziyZiYoo= github.com/jmespath/go-jmespath/internal/testify v1.5.1/go.mod h1:L3OGu8Wl2/fWfCI6z80xFu9LTZmf1ZRjMHUOPmWr69U= github.com/joho/godotenv v1.3.0 h1:Zjp+RcGpHhGlrMbJzXTrZZPrWj+1vfm90La1wgB6Bhc= github.com/joho/godotenv v1.3.0/go.mod h1:7hK45KPybAkOC6peb+G5yklZfMxEjkZhHbwpqxOKXbg= -github.com/jonboulle/clockwork v0.1.0/go.mod h1:Ii8DK3G1RaLaWxj9trq07+26W01tbo22gdxWY5EU2bo= github.com/jpillora/backoff v1.0.0/go.mod h1:J/6gKK9jxlEcS3zixgDgUAsiuZ7yrSoa/FX5e0EB2j4= github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= -github.com/json-iterator/go v1.1.7/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= -github.com/json-iterator/go v1.1.8/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= -github.com/json-iterator/go v1.1.9/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= github.com/json-iterator/go v1.1.10/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= github.com/json-iterator/go v1.1.11/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo= github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU= github.com/jstemmer/go-junit-report v0.9.1/go.mod h1:Brl9GWCQeLvo8nXZwPNNblvFj/XSXhF0NWZEnDohbsk= -github.com/jtolds/gls v4.20.0+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfVYBRgL+9YlvaHOwJU= github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w= github.com/julienschmidt/httprouter v1.3.0/go.mod h1:JR6WtHb+2LUe8TCKY3cZOxFyyO8IZAc4RVcycCCAKdM= -github.com/kisielk/errcheck v1.1.0/go.mod h1:EZBBE59ingxPouuu3KfxchcWSUPOHkagtvWXihfKN4Q= -github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8= github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= -github.com/klauspost/compress v1.10.7/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdYsUV+/s2qKfXs= github.com/klauspost/compress v1.14.1/go.mod h1:/3/Vjq9QcHkK5uEr5lBEmyoZ1iFhe47etQ6QUkpK6sk= -github.com/klauspost/compress v1.14.2 h1:S0OHlFk/Gbon/yauFJ4FfJJF5V0fc5HbBTJazi28pRw= -github.com/klauspost/compress v1.14.2/go.mod h1:/3/Vjq9QcHkK5uEr5lBEmyoZ1iFhe47etQ6QUkpK6sk= -github.com/knadh/koanf v1.4.0 h1:/k0Bh49SqLyLNfte9r6cvuZWrApOQhglOmhIU3L/zDw= -github.com/knadh/koanf v1.4.0/go.mod h1:1cfH5223ZeZUOs8FU2UdTmaNfHpqgtjV0+NHjRO43gs= +github.com/klauspost/compress v1.15.0/go.mod h1:/3/Vjq9QcHkK5uEr5lBEmyoZ1iFhe47etQ6QUkpK6sk= +github.com/klauspost/compress v1.15.5 h1:qyCLMz2JCrKADihKOh9FxnW3houKeNsp2h5OEz0QSEA= +github.com/klauspost/compress v1.15.5/go.mod h1:PhcZ0MbTNciWF3rruxRgKxI5NkcHHrHUDtV4Yw2GlzU= +github.com/knadh/koanf v1.4.1 h1:Z0VGW/uo8NJmjd+L1Dc3S5frq6c62w5xQ9Yf4Mg3wFQ= +github.com/knadh/koanf v1.4.1/go.mod h1:1cfH5223ZeZUOs8FU2UdTmaNfHpqgtjV0+NHjRO43gs= github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/konsorten/go-windows-terminal-sequences v1.0.3/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= -github.com/kr/fs v0.1.0/go.mod h1:FFnZGqtBN9Gxj7eW1uZ42v5BccTP0vu6NEaFoC2HwRg= github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc= github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= -github.com/kr/pretty v0.2.0/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= github.com/kr/pretty v0.3.0 h1:WgNl7dwNpEZ6jJ9k1snq4pZsg7DOEN8hP9Xw0Tsjwk0= github.com/kr/pretty v0.3.0/go.mod h1:640gp4NfQd8pI5XOwp5fnNeVWj67G7CFk/SaSQn7NBk= @@ -390,46 +233,22 @@ github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= -github.com/lightstep/lightstep-tracer-common/golang/gogo v0.0.0-20190605223551-bc2310a04743/go.mod h1:qklhhLq1aX+mtWk9cPHPzaBjWImj5ULL6C7HFJtXQMM= -github.com/lightstep/lightstep-tracer-go v0.18.1/go.mod h1:jlF1pusYV4pidLvZ+XD0UBX0ZE6WURAspgAczcDHrL4= -github.com/lyft/protoc-gen-star v0.5.3/go.mod h1:V0xaHgaf5oCCqmcxYcWiDfTiKsZsRc87/1qhoTACD8w= -github.com/lyft/protoc-gen-validate v0.0.13/go.mod h1:XbGvPuh87YZc5TdIa2/I4pLk0QoUACkjt2znoq26NVQ= -github.com/magiconair/properties v1.8.5/go.mod h1:y3VJvCyxH9uVvJTWEGAELF3aiYNyPKd5NZ3oSwXrF60= github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU= -github.com/mattn/go-colorable v0.1.4/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE= -github.com/mattn/go-colorable v0.1.6/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= -github.com/mattn/go-colorable v0.1.9/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= -github.com/mattn/go-colorable v0.1.12/go.mod h1:u5H1YNBxpqRaxsYJYSkiCWKzEfiAb1Gb520KVy5xxl4= github.com/mattn/go-isatty v0.0.3/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= -github.com/mattn/go-isatty v0.0.4/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= -github.com/mattn/go-isatty v0.0.8/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s= -github.com/mattn/go-isatty v0.0.10/go.mod h1:qgIWMr58cqv1PHHyhnkY9lrL7etaEgOFcMEpPG5Rm84= -github.com/mattn/go-isatty v0.0.11/go.mod h1:PhnuNfih5lzO57/f3n+odYbM4JtupLOxQOAqxQCu2WE= -github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU= -github.com/mattn/go-isatty v0.0.14/go.mod h1:7GGIvUiUoEMVVmxf/4nioHXj79iQHKdU27kJ6hsGG94= -github.com/mattn/go-runewidth v0.0.2/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzpuz5H//U1FU= github.com/matttproud/golang_protobuf_extensions v1.0.1 h1:4hp9jkHxhMHkqkrB3Ix0jegS5sx/RkqARlsWZ6pIwiU= github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= -github.com/miekg/dns v1.0.14/go.mod h1:W1PPwlIAgtquWBMBEV9nkV9Cazfe8ScdGz/Lj7v3Nrg= -github.com/miekg/dns v1.1.26/go.mod h1:bPDLeHnStXmXAq1m/Ch/hvfNHr14JKNPMBo3VZKjuso= -github.com/miekg/dns v1.1.41/go.mod h1:p6aan82bvRIyn+zDIv9xYNUpwa73JcSh9BKwknJysuI= github.com/mitchellh/cli v1.0.0/go.mod h1:hNIlj7HEI86fIcpObd7a0FcrxTWetlwJDGcceTlRvqc= -github.com/mitchellh/cli v1.1.0/go.mod h1:xcISNoH86gajksDmfB23e/pu+B+GeFRMYmoHXxx3xhI= github.com/mitchellh/copystructure v1.0.0/go.mod h1:SNtv71yrdKgLRyLFxmLdkAbkKEFWgYaq1OVrnRcwhnw= github.com/mitchellh/copystructure v1.2.0 h1:vpKXTN4ewci03Vljg/q9QvCGUDttBOGBIa15WveJJGw= github.com/mitchellh/copystructure v1.2.0/go.mod h1:qLl+cE2AmVv+CoeAwDPye/v+N2HKCj9FbZEVFJRxO9s= -github.com/mitchellh/go-homedir v1.0.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= github.com/mitchellh/go-testing-interface v0.0.0-20171004221916-a61a99592b77/go.mod h1:kRemZodwjscx+RGhAo8eIhFbs2+BFgRtFPeD/KE+zxI= github.com/mitchellh/go-testing-interface v1.0.0/go.mod h1:kRemZodwjscx+RGhAo8eIhFbs2+BFgRtFPeD/KE+zxI= github.com/mitchellh/go-wordwrap v1.0.0/go.mod h1:ZXFpozHsX6DPmq2I0TCekCxypsnAUbP2oI0UX1GXzOo= -github.com/mitchellh/gox v0.4.0/go.mod h1:Sd9lOJ0+aimLBi73mGofS1ycjY8lL3uZM3JPS42BGNg= -github.com/mitchellh/iochan v1.0.0/go.mod h1:JwYml1nuB7xOzsp52dPpHFffvOCDupsG0QubkSMEySY= -github.com/mitchellh/mapstructure v0.0.0-20160808181253-ca63d7c062ee/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= github.com/mitchellh/mapstructure v1.4.1/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= -github.com/mitchellh/mapstructure v1.4.3 h1:OVowDSCllw/YjdLkam3/sm7wEtOy59d8ndGgCcyj8cs= -github.com/mitchellh/mapstructure v1.4.3/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= +github.com/mitchellh/mapstructure v1.5.0 h1:jeMsZIYE/09sWLaz43PL7Gy6RuMjD2eJVyuac5Z2hdY= +github.com/mitchellh/mapstructure v1.5.0/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= github.com/mitchellh/reflectwalk v1.0.0/go.mod h1:mSTlrgnPZtwu0c4WaC2kGObEpuNDbx0jmZXqmk4esnw= github.com/mitchellh/reflectwalk v1.0.2 h1:G2LzWKi524PWgd3mLHV8Y5k7s6XUvT0Gef6zxSIeXaQ= github.com/mitchellh/reflectwalk v1.0.2/go.mod h1:mSTlrgnPZtwu0c4WaC2kGObEpuNDbx0jmZXqmk4esnw= @@ -440,126 +259,62 @@ github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3Rllmb github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk= github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= -github.com/nats-io/jwt v0.3.0/go.mod h1:fRYCDE99xlTsqUzISS1Bi75UBJ6ljOJQOAAu5VglpSg= -github.com/nats-io/jwt v0.3.2/go.mod h1:/euKqTS1ZD+zzjYrY7pseZrTtWQSjujC7xjPc8wL6eU= -github.com/nats-io/nats-server/v2 v2.1.2/go.mod h1:Afk+wRZqkMQs/p45uXdrVLuab3gwv3Z8C4HTBu8GD/k= -github.com/nats-io/nats.go v1.9.1/go.mod h1:ZjDU1L/7fJ09jvUSRVBR2e7+RnLiiIQyqyzEE/Zbp4w= -github.com/nats-io/nkeys v0.1.0/go.mod h1:xpnFELMwJABBLVhffcfd1MZx6VsNRFpEugbxziKVo7w= -github.com/nats-io/nkeys v0.1.3/go.mod h1:xpnFELMwJABBLVhffcfd1MZx6VsNRFpEugbxziKVo7w= -github.com/nats-io/nuid v1.0.1/go.mod h1:19wcPz3Ph3q0Jbyiqsd0kePYG7A95tJPxeL+1OSON2c= github.com/npillmayer/nestext v0.1.3/go.mod h1:h2lrijH8jpicr25dFY+oAJLyzlya6jhnuG+zWp9L0Uk= -github.com/oklog/oklog v0.3.2/go.mod h1:FCV+B7mhrz4o+ueLpx+KqkyXRGMWOYEvfiXtdGtbWGs= github.com/oklog/run v1.0.0/go.mod h1:dlhp/R75TPv97u0XWUtDeV/lRKWPKSdTuV0TZvrmrQA= -github.com/olekukonko/tablewriter v0.0.0-20170122224234-a0225b3f23b5/go.mod h1:vsDQFd/mU46D+Z4whnwzcISnGGzXWMclvtLoiIKAKIo= -github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= -github.com/onsi/ginkgo v1.7.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= -github.com/onsi/gomega v1.4.3/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= -github.com/op/go-logging v0.0.0-20160315200505-970db520ece7/go.mod h1:HzydrMdWErDVzsI23lYNej1Htcns9BCg93Dk0bBINWk= -github.com/opentracing-contrib/go-observer v0.0.0-20170622124052-a52f23424492/go.mod h1:Ngi6UdF0k5OKD5t5wlmGhe/EDKPoUM3BXZSSfIuJbis= -github.com/opentracing/basictracer-go v1.0.0/go.mod h1:QfBfYuafItcjQuMwinw9GhYKwFXS9KnPs5lxoYwgW74= -github.com/opentracing/opentracing-go v1.0.2/go.mod h1:UkNAQd3GIcIGf0SeVgPpRdFStlNbqXla1AfSYxPUl2o= -github.com/opentracing/opentracing-go v1.1.0/go.mod h1:UkNAQd3GIcIGf0SeVgPpRdFStlNbqXla1AfSYxPUl2o= -github.com/openzipkin-contrib/zipkin-go-opentracing v0.4.5/go.mod h1:/wsWhb9smxSfWAKL3wpBW7V8scJMt8N8gnaMCS9E/cA= -github.com/openzipkin/zipkin-go v0.1.6/go.mod h1:QgAqvLzwWbR/WpD4A3cGpPtJrZXNIiJc5AZX7/PBEpw= -github.com/openzipkin/zipkin-go v0.2.1/go.mod h1:NaW6tEwdmWMaCDZzg8sh+IBNOxHMPnhQw8ySjnjRyN4= -github.com/openzipkin/zipkin-go v0.2.2/go.mod h1:NaW6tEwdmWMaCDZzg8sh+IBNOxHMPnhQw8ySjnjRyN4= -github.com/pact-foundation/pact-go v1.0.4/go.mod h1:uExwJY4kCzNPcHRj+hCR/HBbOOIwwtUjcrb0b5/5kLM= -github.com/pascaldekloe/goe v0.0.0-20180627143212-57f6aae5913c/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc= github.com/pascaldekloe/goe v0.1.0/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc= -github.com/pborman/uuid v1.2.0/go.mod h1:X/NO0urCmaxf9VXbdlT7C2Yzkj2IKimNn4k+gtPdI/k= +github.com/pelletier/go-toml v1.7.0 h1:7utD74fnzVc/cpcyy8sjrlFr5vYpypUixARcHIMIGuI= github.com/pelletier/go-toml v1.7.0/go.mod h1:vwGMzjaWMwyfHwgIBhI2YUM4fB6nL6lVAvS1LBMMhTE= -github.com/pelletier/go-toml v1.9.4 h1:tjENF6MfZAg8e4ZmZTeWaWiT2vXtsoO6+iuOjFhECwM= -github.com/pelletier/go-toml v1.9.4/go.mod h1:u1nR/EPcESfeI/szUZKdtJ0xRNbUoANCkoOuaOx1Y+c= -github.com/performancecopilot/speed v3.0.0+incompatible/go.mod h1:/CLtqpZ5gBg1M9iaPbIdPPGyKcA8hKdoy6hAWba7Yac= -github.com/pierrec/lz4 v1.0.2-0.20190131084431-473cd7ce01a1/go.mod h1:3/3N9NVKO0jef7pBehbT1qWhCMrIgbYNnFAZCqQ5LRc= github.com/pierrec/lz4 v2.0.5+incompatible/go.mod h1:pdkljMzZIN41W+lC3N2tnIh5sFi+IEE17M5jbnwPHcY= github.com/pkg/diff v0.0.0-20210226163009-20ebb0f2a09e/go.mod h1:pJLUxLENpZxwdsKMEsNbx1VGcRFpLqf3715MtcvvzbA= github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= -github.com/pkg/profile v1.2.1/go.mod h1:hJw3o1OdXxsrSjjVksARp5W95eeEaEfptyVZyv6JUPA= -github.com/pkg/sftp v1.10.1/go.mod h1:lYOWFsE0bwd1+KfKJaKeuokY15vzFx25BLbzYYoAxZI= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/posener/complete v1.1.1/go.mod h1:em0nMJCgc9GFtwrmVmEMR/ZL6WyhyjMBndrE9hABlRI= -github.com/posener/complete v1.2.3/go.mod h1:WZIdtGGp+qx0sLrYKtIRAruyNpv6hFCicSgv7Sy7s/s= +github.com/prashantv/gostub v1.1.0 h1:BTyx3RfQjRHnUWaGF9oQos79AlQ5k8WNktv7VGvVH4g= github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw= -github.com/prometheus/client_golang v0.9.3-0.20190127221311-3c4408c8b829/go.mod h1:p2iRAGwDERtqlqzRXnrOVns+ignqQo//hLXqYxZYVNs= github.com/prometheus/client_golang v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5FsnadC4Ky3P0J6CfImo= -github.com/prometheus/client_golang v1.3.0/go.mod h1:hJaj2vgQTGQmVCsAACORcieXFeDPbaTKGT+JTgUa3og= -github.com/prometheus/client_golang v1.4.0/go.mod h1:e9GMxYsXl05ICDXkRhurwBS4Q3OK1iX/F2sw+iXX5zU= github.com/prometheus/client_golang v1.7.1/go.mod h1:PY5Wy2awLA44sXw4AOSfFBetzPP4j5+D6mVACh+pe2M= -github.com/prometheus/client_golang v1.9.0/go.mod h1:FqZLKOZnGdFAhOK4nqGHa7D66IdsO+O441Eve7ptJDU= github.com/prometheus/client_golang v1.11.0/go.mod h1:Z6t4BnS23TR94PD6BsDNk8yVqroYurpAkEiz0P2BEV0= -github.com/prometheus/client_golang v1.12.1 h1:ZiaPsmm9uiBeaSMRznKsCDNtPCS0T3JVDGF+06gjBzk= github.com/prometheus/client_golang v1.12.1/go.mod h1:3Z9XVyYiZYEO+YQWt3RD2R3jrbd179Rt297l4aS6nDY= +github.com/prometheus/client_golang v1.12.2 h1:51L9cDoUHVrXx4zWYlcLQIZ+d+VXHgqnYKkIuq4g/34= +github.com/prometheus/client_golang v1.12.2/go.mod h1:3Z9XVyYiZYEO+YQWt3RD2R3jrbd179Rt297l4aS6nDY= github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= -github.com/prometheus/client_model v0.0.0-20190115171406-56726106282f/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= -github.com/prometheus/client_model v0.1.0/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/client_model v0.2.0 h1:uq5h0d+GuxiXLJLNABMgp2qUWDPiLvgCzz2dUR+/W/M= github.com/prometheus/client_model v0.2.0/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= -github.com/prometheus/common v0.2.0/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= github.com/prometheus/common v0.4.1/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= -github.com/prometheus/common v0.7.0/go.mod h1:DjGbpBbp5NYNiECxcL/VnbXCCaQpKd3tt26CguLLsqA= -github.com/prometheus/common v0.9.1/go.mod h1:yhUN8i9wzaXS3w1O07YhxHEBxD+W35wd8bs7vj7HSQ4= github.com/prometheus/common v0.10.0/go.mod h1:Tlit/dnDKsSWFlCLTWaA1cyBgKHSMdTB80sz/V91rCo= -github.com/prometheus/common v0.15.0/go.mod h1:U+gB1OBLb1lF3O42bTCL+FK18tX9Oar16Clt/msog/s= github.com/prometheus/common v0.26.0/go.mod h1:M7rCNAaPfAosfx8veZJCuw84e35h3Cfd9VFqTh1DIvc= -github.com/prometheus/common v0.32.1 h1:hWIdL3N2HoUx3B8j3YN9mWor0qhY/NlEKZEaXxuIRh4= github.com/prometheus/common v0.32.1/go.mod h1:vu+V0TpY+O6vW9J44gczi3Ap/oXXR10b+M/gUGO4Hls= +github.com/prometheus/common v0.34.0 h1:RBmGO9d/FVjqHT0yUGQwBJhkwKV+wPCn7KGpvfab0uE= +github.com/prometheus/common v0.34.0/go.mod h1:gB3sOl7P0TvJabZpLY5uQMpUqRCPPCyRLCZYc7JZTNE= github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= -github.com/prometheus/procfs v0.0.0-20190117184657-bf6a532e95b1/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= -github.com/prometheus/procfs v0.0.8/go.mod h1:7Qr8sr6344vo1JqZ6HhLceV9o3AJ1Ff+GxbHq6oeK9A= github.com/prometheus/procfs v0.1.3/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU= -github.com/prometheus/procfs v0.2.0/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU= github.com/prometheus/procfs v0.6.0/go.mod h1:cz+aTbrPOrUb4q7XlbU9ygM+/jj0fzG6c1xBZuNvfVA= github.com/prometheus/procfs v0.7.3 h1:4jVXhlkAyzOScmCkXBTOLRLTz8EeU+eyjrwB/EPq0VU= github.com/prometheus/procfs v0.7.3/go.mod h1:cz+aTbrPOrUb4q7XlbU9ygM+/jj0fzG6c1xBZuNvfVA= -github.com/rcrowley/go-metrics v0.0.0-20181016184325-3113b8401b8a/go.mod h1:bCqnVzQkZxMG4s8nGwiZ5l3QUCyqpo9Y+/ZMZ9VjZe4= github.com/rhnvrm/simples3 v0.6.1/go.mod h1:Y+3vYm2V7Y4VijFoJHHTrja6OgPrJ2cBti8dPGkC3sA= -github.com/rogpeppe/fastuuid v0.0.0-20150106093220-6724a57986af/go.mod h1:XWv6SoW27p1b0cqNHllgS5HIMJraePCO15w5zCzIWYg= -github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6LYCDYWNEvQ= github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= github.com/rogpeppe/go-internal v1.6.1/go.mod h1:xXDCJY+GAPziupqXw64V24skbSoqbTEfhy4qGm1nDQc= github.com/rogpeppe/go-internal v1.8.1 h1:geMPLpDpQOgVyCg5z5GoRwLHepNdb71NXb67XFkP+Eg= github.com/rogpeppe/go-internal v1.8.1/go.mod h1:JeRgkft04UBgHMgCIwADu4Pn6Mtm5d4nPKWu0nJ5d+o= -github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= -github.com/ryanuber/columnize v0.0.0-20160712163229-9b3edd62028f/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts= github.com/ryanuber/columnize v2.1.0+incompatible/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts= github.com/ryanuber/go-glob v1.0.0/go.mod h1:807d1WSdnB0XRJzKNil9Om6lcp/3a0v4qIHxIXzX/Yc= -github.com/sagikazarmark/crypt v0.3.0/go.mod h1:uD/D+6UF4SrIR1uGEv7bBNkNqLGqUr43MRiaGWX1Nig= -github.com/samuel/go-zookeeper v0.0.0-20190923202752-2cc03de413da/go.mod h1:gi+0XIa01GRL2eRQVjQkKGqKF3SF9vZR/HnPullcV2E= -github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529/go.mod h1:DxrIzT+xaE7yg65j358z/aeFdxmN0P9QXhEzd20vsDc= -github.com/shurcooL/sanitized_anchor_name v1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc= github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE= github.com/sirupsen/logrus v1.6.0/go.mod h1:7uNnSEd1DgxDLC74fIahvMZmmYsHGZGEOFrfsX/uA88= -github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc= -github.com/smartystreets/goconvey v1.6.4/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9QV7WQ/tjFTllLA= -github.com/soheilhy/cmux v0.1.4/go.mod h1:IM3LyeVVIOuxMH7sFAkER9+bJ4dT7Ms6E4xg4kGIyLM= -github.com/sony/gobreaker v0.4.1/go.mod h1:ZKptC7FHNvhBz7dN2LGjPVBz2sZJmc0/PkyDJOjmxWY= -github.com/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA= github.com/speps/go-hashids/v2 v2.0.1 h1:ViWOEqWES/pdOSq+C1SLVa8/Tnsd52XC34RY7lt7m4g= github.com/speps/go-hashids/v2 v2.0.1/go.mod h1:47LKunwvDZki/uRVD6NImtyk712yFzIs3UF3KlHohGw= -github.com/spf13/afero v1.3.3/go.mod h1:5KUK8ByomD5Ti5Artl0RtHeI5pTF7MIDuXL3yY520V4= -github.com/spf13/afero v1.6.0/go.mod h1:Ai8FlHk4v/PARR026UzYexafAt9roJ7LcLMAmO6Z93I= -github.com/spf13/cast v1.4.1/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE= -github.com/spf13/cobra v0.0.3/go.mod h1:1l0Ry5zgKvJasoi3XT1TypsSe7PqH0Sj9dhYf7v3XqQ= -github.com/spf13/cobra v1.3.0 h1:R7cSvGu+Vv+qX0gW5R/85dx2kmmJT5z5NM8ifdYjdn0= -github.com/spf13/cobra v1.3.0/go.mod h1:BrRVncBjOJa/eUcVVm9CE+oC6as8k+VYr4NY7WCi9V4= -github.com/spf13/jwalterweatherman v1.1.0/go.mod h1:aNWZUN0dPAAO/Ljvb5BEdw96iTZ0EXowPYD95IqWIGo= -github.com/spf13/pflag v1.0.1/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= +github.com/spf13/cobra v1.4.0 h1:y+wJpx64xcgO1V+RcnwW0LEHxTKRi2ZDPSBjWnrg88Q= +github.com/spf13/cobra v1.4.0/go.mod h1:Wo4iy3BUC+X2Fybo0PDqwJIv3dNRiZLHQymsfxlB84g= github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA= github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= -github.com/spf13/viper v1.10.0/go.mod h1:SoyBPwAtKDzypXNDFKN5kzH7ppppbGZtls1UpIy5AsM= -github.com/streadway/amqp v0.0.0-20190404075320-75d898a42a94/go.mod h1:AZpEONHx3DKn8O/DFsRAY58/XVQiIPMTMB1SddzLXVw= -github.com/streadway/amqp v0.0.0-20190827072141-edfb9018d271/go.mod h1:AZpEONHx3DKn8O/DFsRAY58/XVQiIPMTMB1SddzLXVw= -github.com/streadway/handy v0.0.0-20190108123426-d5acb3125c2a/go.mod h1:qNTQ5P5JnDBl6z3cMAg/SywNDC5ABu5ApDIw6lUbRmI= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.1.1 h1:2vfRuCMp5sSVIDSqO8oNnWJq7mPa6KVP3iPIwFBuy8A= github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= @@ -567,90 +322,61 @@ github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXf github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA= -github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= -github.com/stretchr/testify v1.7.0 h1:nwc3DEeHmmLAfoZucVR881uASk0Mfjw8xYJ99tb5CcY= github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= -github.com/subosito/gotenv v1.2.0/go.mod h1:N0PQaV/YGNqwC0u51sEeR/aUtSLEXKX9iv69rRypqCw= +github.com/stretchr/testify v1.7.1 h1:5TQK59W5E3v0r2duFAb7P95B6hEeOyEnHRa8MjYSMTY= +github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/tidwall/pretty v1.2.0 h1:RWIZEg2iJ8/g6fDDYzMpobmaoGh5OLl4AXtGUGPcqCs= github.com/tidwall/pretty v1.2.0/go.mod h1:ITEVvHYasfjBbM0u2Pg8T2nJnzm8xPwvNhhsoaGGjNU= -github.com/tmc/grpc-websocket-proxy v0.0.0-20170815181823-89b8d40f7ca8/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U= -github.com/tv42/httpunix v0.0.0-20150427012821-b75d8614f926/go.mod h1:9ESjWnEqriFuLhtthL60Sar/7RFoluCcXsuvEwTV5KM= -github.com/urfave/cli v1.20.0/go.mod h1:70zkFmudgCuE/ngEzBv17Jvp/497gISqfk5gWijbERA= -github.com/urfave/cli v1.22.1/go.mod h1:Gos4lmkARVdJ6EkW0WaNv/tZAAMe9V7XWyB60NtXRu0= github.com/valyala/bytebufferpool v1.0.0 h1:GqA5TC/0021Y/b9FG4Oi9Mr3q7XYx6KllzawFIhcdPw= github.com/valyala/bytebufferpool v1.0.0/go.mod h1:6bBcMArwyJ5K/AmCkWv1jt77kVWyCJ6HpOuEn7z0Csc= -github.com/valyala/fasthttp v1.17.0/go.mod h1:jjraHZVbKOXftJfsOYoAjaeygpj5hr8ermTRJNroD7A= -github.com/valyala/fasthttp v1.18.0/go.mod h1:jjraHZVbKOXftJfsOYoAjaeygpj5hr8ermTRJNroD7A= -github.com/valyala/fasthttp v1.33.0 h1:mHBKd98J5NcXuBddgjvim1i3kWzlng1SzLhrnBOU9g8= github.com/valyala/fasthttp v1.33.0/go.mod h1:KJRK/MXx0J+yd0c5hlR+s1tIHD72sniU8ZJjl97LIw4= -github.com/valyala/tcplisten v0.0.0-20161114210144-ceec8f93295a/go.mod h1:v3UYOV9WzVtRmSR+PDvWpU/qWl4Wa5LApYYX4ZtKbio= +github.com/valyala/fasthttp v1.34.0/go.mod h1:epZA5N+7pY6ZaEKRmstzOuYJx9HI8DI1oaCGZpdH4h0= +github.com/valyala/fasthttp v1.37.0 h1:7WHCyI7EAkQMVmrfBhWTCOaeROb1aCBiTopx63LkMbE= +github.com/valyala/fasthttp v1.37.0/go.mod h1:t/G+3rLek+CyY9bnIE+YlMRddxVAAGjhxndDB4i4C0I= github.com/valyala/tcplisten v1.0.0 h1:rBHj/Xf+E1tRGZyWIWwJDiRY0zc1Js+CV5DqwacVSA8= github.com/valyala/tcplisten v1.0.0/go.mod h1:T0xQ8SeCZGxckz9qRXTfG43PvQ/mcWh7FwZEA7Ioqkc= -github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2/go.mod h1:UETIi67q53MR2AWcXfiuqkDkRtnGDLqkBTpCHuJHxtU= github.com/yuin/goldmark v1.1.25/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.1.32/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= -github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.3.5/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= github.com/yuin/goldmark v1.4.1/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= gitlab.snapp.ir/dispatching/snappids/v2 v2.9.0 h1:nb3uqHasVp4CGvS8jJKP5c/dkff9XJfOToGwqctXoVo= gitlab.snapp.ir/dispatching/snappids/v2 v2.9.0/go.mod h1:U7lxAuqPifdXkUNcCXhtk9+6HFAyw5qy8LrF1DQDMuQ= -go.etcd.io/bbolt v1.3.3/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU= -go.etcd.io/etcd v0.0.0-20191023171146-3cf2f69b5738/go.mod h1:dnLIgRNXwCJa5e+c6mIZCrds/GIG4ncV9HhK5PX7jPg= -go.etcd.io/etcd/api/v3 v3.5.1/go.mod h1:cbVKeC6lCfl7j/8jBhAK6aIYO9XOjdptoxU/nLQcPvs= -go.etcd.io/etcd/client/pkg/v3 v3.5.1/go.mod h1:IJHfcCEKxYu1Os13ZdwCwIUTUVGYTSAM3YSwc9/Ac1g= -go.etcd.io/etcd/client/v2 v2.305.1/go.mod h1:pMEacxZW7o8pg4CrFE7pquyCJJzZvkvdD2RibOCCCGs= -go.opencensus.io v0.20.1/go.mod h1:6WKK9ahsWS3RSO+PY9ZHZUfv2irvY6gN279GOPZjmmk= -go.opencensus.io v0.20.2/go.mod h1:6WKK9ahsWS3RSO+PY9ZHZUfv2irvY6gN279GOPZjmmk= go.opencensus.io v0.21.0/go.mod h1:mSImk1erAIZhrmZN+AvHh14ztQfjbGwt4TtuofqLduU= go.opencensus.io v0.22.0/go.mod h1:+kGneAE2xo2IficOXnaByMWTGM9T73dGwxeWcUqIpI8= go.opencensus.io v0.22.2/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= go.opencensus.io v0.22.3/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= go.opencensus.io v0.22.4/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= -go.opencensus.io v0.22.5/go.mod h1:5pWMHQbX5EPX2/62yrJeAkowc+lfs/XD7Uxpq3pI6kk= -go.opencensus.io v0.23.0/go.mod h1:XItmlyltB5F7CS4xOC1DcqMoFqwtC6OG2xF7mCv7P7E= -go.opentelemetry.io/otel v1.4.0 h1:7ESuKPq6zpjRaY5nvVDGiuwK7VAJ8MwkKnmNJ9whNZ4= -go.opentelemetry.io/otel v1.4.0/go.mod h1:jeAqMFKy2uLIxCtKxoFj0FAL5zAPKQagc3+GtBWakzk= -go.opentelemetry.io/otel/exporters/jaeger v1.4.0 h1:EX/spHhVkHbobTeSozT1zpbuc3oO70CISkw+dspgR9M= -go.opentelemetry.io/otel/exporters/jaeger v1.4.0/go.mod h1:C4UfuVfyi7qAk/PAz6QodaEkES7RnLNHeAAj6QOu2gI= -go.opentelemetry.io/otel/sdk v1.4.0 h1:LJE4SW3jd4lQTESnlpQZcBhQ3oci0U2MLR5uhicfTHQ= -go.opentelemetry.io/otel/sdk v1.4.0/go.mod h1:71GJPNJh4Qju6zJuYl1CrYtXbrgfau/M9UAggqiy1UE= -go.opentelemetry.io/otel/trace v1.4.0 h1:4OOUrPZdVFQkbzl/JSdvGCWIdw5ONXXxzHlaLlWppmo= -go.opentelemetry.io/otel/trace v1.4.0/go.mod h1:uc3eRsqDfWs9R7b92xbQbU42/eTNz4N+gLP8qJCi4aE= -go.opentelemetry.io/proto/otlp v0.7.0/go.mod h1:PqfVotwruBrMGOCsRd/89rSnXhoiJIqeYNgFYFoEGnI= -go.uber.org/atomic v1.3.2/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= -go.uber.org/atomic v1.5.0/go.mod h1:sABNBOSYdrvTF6hTgEIbc7YasKWGhgEQZyfxyTvoXHQ= +go.opentelemetry.io/otel v1.7.0 h1:Z2lA3Tdch0iDcrhJXDIlC94XE+bxok1F9B+4Lz/lGsM= +go.opentelemetry.io/otel v1.7.0/go.mod h1:5BdUoMIz5WEs0vt0CUEMtSSaTSHBBVwrhnz7+nrD5xk= +go.opentelemetry.io/otel/exporters/jaeger v1.7.0 h1:wXgjiRldljksZkZrldGVe6XrG9u3kYDyQmkZwmm5dI0= +go.opentelemetry.io/otel/exporters/jaeger v1.7.0/go.mod h1:PwQAOqBgqbLQRKlj466DuD2qyMjbtcPpfPfj+AqbSBs= +go.opentelemetry.io/otel/sdk v1.7.0 h1:4OmStpcKVOfvDOgCt7UriAPtKolwIhxpnSNI/yK+1B0= +go.opentelemetry.io/otel/sdk v1.7.0/go.mod h1:uTEOTwaqIVuTGiJN7ii13Ibp75wJmYUDe374q6cZwUU= +go.opentelemetry.io/otel/trace v1.7.0 h1:O37Iogk1lEkMRXewVtZ1BBTVn5JEp8GrJvP92bJqC6o= +go.opentelemetry.io/otel/trace v1.7.0/go.mod h1:fzLSB9nqR2eXzxPXb2JW9IKE+ScyXA48yyE4TNvoHqU= go.uber.org/atomic v1.7.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc= go.uber.org/atomic v1.9.0 h1:ECmE8Bn/WFTYwEW/bpKD3M8VtR/zQVbavAoalC1PYyE= go.uber.org/atomic v1.9.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc= -go.uber.org/automaxprocs v1.4.0 h1:CpDZl6aOlLhReez+8S3eEotD7Jx0Os++lemPlMULQP0= -go.uber.org/automaxprocs v1.4.0/go.mod h1:/mTEdr7LvHhs0v7mjdxDreTz1OG5zdZGqgOnhWiR/+Q= +go.uber.org/automaxprocs v1.5.1 h1:e1YG66Lrk73dn4qhg8WFSvhF0JuFQF0ERIp4rpuV8Qk= +go.uber.org/automaxprocs v1.5.1/go.mod h1:BF4eumQw0P9GtnuxxovUd06vwm1o18oMzFtK66vU6XU= go.uber.org/goleak v1.1.11/go.mod h1:cwTWslyiVhfpKIDGSZEM2HlOvcqm+tG4zioyIeLoqMQ= go.uber.org/goleak v1.1.12 h1:gZAh5/EyT/HQwlpkCy6wTpqfH9H8Lz8zbm3dZh+OyzA= go.uber.org/goleak v1.1.12/go.mod h1:cwTWslyiVhfpKIDGSZEM2HlOvcqm+tG4zioyIeLoqMQ= -go.uber.org/multierr v1.1.0/go.mod h1:wR5kodmAFQ0UK8QlbwjlSNy0Z68gJhDJUG5sjR94q/0= -go.uber.org/multierr v1.3.0/go.mod h1:VgVr7evmIr6uPjLBxg28wmKNXyqE9akIJ5XnfpiKl+4= go.uber.org/multierr v1.6.0/go.mod h1:cdWPpRnG4AhwMwsgIHip0KRBQjJy5kYEpYjJxpXp9iU= -go.uber.org/multierr v1.7.0 h1:zaiO/rmgFjbmCXdSYJWQcdvOCsthmdaHfr3Gm2Kx4Ec= go.uber.org/multierr v1.7.0/go.mod h1:7EAYxJLBy9rStEaz58O2t4Uvip6FSURkq8/ppBp95ak= -go.uber.org/tools v0.0.0-20190618225709-2cfd321de3ee/go.mod h1:vJERXedbb3MVM5f9Ejo0C68/HhF8uaILCdgjnY+goOA= -go.uber.org/zap v1.10.0/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q= -go.uber.org/zap v1.13.0/go.mod h1:zwrFLgMcdUuIBviXEYEH1YKNaOBnKXsx2IPda5bBwHM= -go.uber.org/zap v1.17.0/go.mod h1:MXVU+bhUf/A7Xi2HNOnopQOrmycQ5Ih87HtOu4q5SSo= +go.uber.org/multierr v1.8.0 h1:dg6GjLku4EH+249NNmoIciG9N/jURbDG+pFlTkhzIC8= +go.uber.org/multierr v1.8.0/go.mod h1:7EAYxJLBy9rStEaz58O2t4Uvip6FSURkq8/ppBp95ak= go.uber.org/zap v1.21.0 h1:WefMeulhovoZ2sYXz7st6K0sLj7bBhpiFaud4r4zST8= go.uber.org/zap v1.21.0/go.mod h1:wjWOCqI0f2ZZrJF/UufIOkiC8ii6tm1iqIsLo76RfJw= golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= -golang.org/x/crypto v0.0.0-20181029021203-45a5f77698d3/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/crypto v0.0.0-20190701094942-4def268fd1a4/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/crypto v0.0.0-20190820162420-60c769a6c586/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/crypto v0.0.0-20190923035154-9ee001bba392/go.mod h1:/lpIB1dKB+9EgE3H3cr1v9wB50oz8l4C4h62xy7jSTY= golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/crypto v0.0.0-20210817164053-32db794688a5/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.0.0-20220112180741-5e0467b6c7ce/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= +golang.org/x/crypto v0.0.0-20220214200702-86341886e292/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= @@ -673,7 +399,6 @@ golang.org/x/lint v0.0.0-20190930215403-16217165b5de/go.mod h1:6SW0HCj/g11FgYtHl golang.org/x/lint v0.0.0-20191125180803-fdd1cda4f05f/go.mod h1:5qLYkcX4OjUUV8bRuDixDT3tpyyb+LUpUlRWLxfhWrs= golang.org/x/lint v0.0.0-20200130185559-910be7a94367/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= golang.org/x/lint v0.0.0-20200302205851-738671d3881b/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= -golang.org/x/lint v0.0.0-20201208152925-83fdc39ff7b5/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= golang.org/x/lint v0.0.0-20210508222113-6edffad5e616/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= golang.org/x/mobile v0.0.0-20190312151609-d3739f865fa6/go.mod h1:z+o9i4GpDbdi3rU15maQ/Ox0txvL9dWGYEHz965HBQE= golang.org/x/mobile v0.0.0-20190719004257-d2bd2a29d028/go.mod h1:E/iHnbuqvinMTCcRqshq8CkpyQDoeVncDDYHnLhea+o= @@ -683,20 +408,12 @@ golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee/go.mod h1:QqPTAvyqsEbceGzB golang.org/x/mod v0.1.1-0.20191107180719-034126e5016b/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= -golang.org/x/mod v0.4.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= -golang.org/x/mod v0.4.1/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= -golang.org/x/mod v0.5.0/go.mod h1:5OXOZSfqPIIbmVBIIKWRFfZjPR0E5r58TLhUjH0a2Ro= golang.org/x/mod v0.5.1/go.mod h1:5OXOZSfqPIIbmVBIIKWRFfZjPR0E5r58TLhUjH0a2Ro= golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20181023162649-9b4f9f5ad519/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20181114220301-adae6a3d119a/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20181201002055-351d144fa1fc/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20181220203305-927f97764cc3/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20190125091013-d26f9f9a57f3/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= @@ -707,8 +424,6 @@ golang.org/x/net v0.0.0-20190613194153-d28f0bde5980/go.mod h1:z5CRVTTTmAJ677TzLL golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20190628185345-da137c7871d7/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20190724013045-ca1201d0de80/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20190813141303-74dc4d7220e7/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20190923162816-aa69164e4478/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20191209160850-c0dbc17a3553/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200114155413-6afb5195e5aa/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200202094626-16171245cfb2/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= @@ -723,39 +438,20 @@ golang.org/x/net v0.0.0-20200520182314-0ba52f642ac2/go.mod h1:qpuaurCH72eLCgpAm/ golang.org/x/net v0.0.0-20200625001655-4c5254603344/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= golang.org/x/net v0.0.0-20200707034311-ab3426394381/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= golang.org/x/net v0.0.0-20200822124328-c89045814202/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= -golang.org/x/net v0.0.0-20201016165138-7b1cca2348c0/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= -golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= -golang.org/x/net v0.0.0-20201031054903-ff519b6c9102/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= -golang.org/x/net v0.0.0-20201110031124-69a78807bb2b/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= -golang.org/x/net v0.0.0-20201209123823-ac852fbbde11/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= -golang.org/x/net v0.0.0-20210119194325-5f4716e94777/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= -golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= -golang.org/x/net v0.0.0-20210316092652-d523dce5a7f4/go.mod h1:RBQZq4jEuRlivfhVLdyRGr576XBO4/greRjx4P4O3yc= golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM= -golang.org/x/net v0.0.0-20210410081132-afb366fc7cd1/go.mod h1:9tjilg8BloeKEkVJvy7fQ90B1CfIiPueXVOjqfkSzI8= -golang.org/x/net v0.0.0-20210503060351-7fd8e65b6420/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20210525063256-abc453219eb5/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= -golang.org/x/net v0.0.0-20210813160813-60bc85c4be6d/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20211015210444-4f30a5c0130f/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20220111093109-d55c255bac03/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= +golang.org/x/net v0.0.0-20220127200216-cd36cc0744dd/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= +golang.org/x/net v0.0.0-20220225172249-27dd8689420f/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20191202225959-858c2ad4c8b6/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= -golang.org/x/oauth2 v0.0.0-20200902213428-5d25da1a8d43/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= -golang.org/x/oauth2 v0.0.0-20201109201403-9fd604954f58/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= -golang.org/x/oauth2 v0.0.0-20201208152858-08078c50e5b5/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= -golang.org/x/oauth2 v0.0.0-20210218202405-ba52d332ba99/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= -golang.org/x/oauth2 v0.0.0-20210220000619-9bb904979d93/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= -golang.org/x/oauth2 v0.0.0-20210313182246-cd4f82c27b84/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/oauth2 v0.0.0-20210514164344-f6687ab2804c/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= -golang.org/x/oauth2 v0.0.0-20210628180205-a41e5a781914/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= -golang.org/x/oauth2 v0.0.0-20210805134026-6f1e6394065a/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= -golang.org/x/oauth2 v0.0.0-20210819190943-2bc19b11175f/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= -golang.org/x/oauth2 v0.0.0-20211005180243-6b3c2da341f1/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= -golang.org/x/oauth2 v0.0.0-20211104180415-d3ed0bb246c8/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= +golang.org/x/oauth2 v0.0.0-20220223155221-ee480838109b/go.mod h1:DAh4E804XQdzx2j+YRIaUnCqCV2RuMz24cGBJ5QYIrc= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -764,20 +460,14 @@ golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20200317015054-43a5402ce75a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20200625203802-6e8e738ad208/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201207232520-09787c993a3a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sys v0.0.0-20180823144017-11551d06cbcc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20181026203630-95b1ffbd15a5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20181107165924-66b7b1311ac8/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20181116152217-5ac8a444bdc5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20181122145206-62eef0e2fa9b/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190129075346-302c3dd5f1cc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20190222072716-a9d3bda3a223/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190312061237-fead79001313/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190403152447-81d4e9dc473e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -787,21 +477,13 @@ golang.org/x/sys v0.0.0-20190507160741-ecd444e8653b/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20190606165138-5da285871e9c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190624142023-c5567b49c5d0/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190726091711-fc99dfbffb4e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190826190057-c7b8b68b1456/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190922100055-0a153f010e69/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190924154521-2837fb4f24fe/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191001151750-bb3f8db39f24/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191005200804-aed5e4c7ecf9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20191008105621-543471e840be/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20191026070338-33540a1f6037/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191204072324-ce4227a45e2e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20191220142924-d4481acd189f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191228213918-04cbcbbfeed8/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200106162015-b016eb3dc98e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200113162924-86b910548bc1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200116001909-b77594299b42/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200122134326-e047566fdf82/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200124204421-9fbb57f87de9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200202164722-d101bd2416d5/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200212091648-12a6c2dcc1e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -815,68 +497,41 @@ golang.org/x/sys v0.0.0-20200523222454-059865788121/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20200615200032-f1bc736245b1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200625212154-ddb9806d33ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200803210538-64077c9b5642/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200905004654-be1d3432aa8f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20201201145000-ef89a241ccb3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20201210223839-7e3030f88018/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20201214210602-f9fddec55a1e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210104204734-6f8348627aad/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210119212857-b64e53b001e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210220050731-9a76102bfb43/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210303074136-134d130e1a04/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210305230114-8fe3ee5dd75b/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210315160823-c6e025ad8005/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210320140829-1e4c9ba3b0c4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210330210617-4fbd30eecc44/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210403161142-5e06dd20ab57/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210423185535-09eb48e85fd7/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20210514084401-e8d321eab015/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210603081109-ebe580a85c40/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20210603125802-9665404d3644/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20210616094352-59db8d763f22/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20210806184541-e5e7981a1069/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20210816183151-1e6c022a8912/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20210823070655-63515b42dcdf/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20210908233432-aa78b53d3365/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20210927094055-39ccf1dd6fa6/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20211007075335-d3039528d8ac/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20211019181941-9d821ace8654/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20211124211545-fe61309f8881/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20211205182925-97ca703d548d/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220111092808-5a964db01320/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220114195835-da31bd327af9/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220209214540-3681064d5158 h1:rm+CHSpPEEW2IsXUib1ThaHIjuBVZjxNgSKmBLFfD4c= -golang.org/x/sys v0.0.0-20220209214540-3681064d5158/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220227234510-4e6760a101f9/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220412211240-33da011f77ad/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a h1:dGzPydgVsqGcTRVwiLJ1jVbufYwmzD3LfVPLKsKg+0k= +golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= +golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.1-0.20181227161524-e6919f6577db/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/text v0.3.4/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= -golang.org/x/time v0.0.0-20180412165947-fbb02b2291d2/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= -golang.org/x/tools v0.0.0-20180221164845-07fd8470d635/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -golang.org/x/tools v0.0.0-20180828015842-6cd1fcedba52/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= golang.org/x/tools v0.0.0-20190312151545-0bb0c0a6e846/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= golang.org/x/tools v0.0.0-20190312170243-e65039ee4138/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= -golang.org/x/tools v0.0.0-20190328211700-ab21143f2384/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= golang.org/x/tools v0.0.0-20190425150028-36563e24a262/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= golang.org/x/tools v0.0.0-20190506145303-2d16b83fe98c/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= @@ -884,11 +539,8 @@ golang.org/x/tools v0.0.0-20190606124116-d0a3d012864b/go.mod h1:/rFqwRUd4F7ZHNgw golang.org/x/tools v0.0.0-20190621195816-6e04913cbbac/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= golang.org/x/tools v0.0.0-20190628153133-6cdbf07be9d0/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= golang.org/x/tools v0.0.0-20190816200558-6889da9d5479/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20190907020128-2ca718005c18/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20190911174233-4f2ddba30aff/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191012152004-8de300cfc20a/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191029041327-9cc4af7d6b2c/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191029190741-b9c20aec41a5/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191113191852-77e3bb0ad9e7/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191115202509-3a792d9c32b2/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= @@ -896,7 +548,6 @@ golang.org/x/tools v0.0.0-20191125144606-a911d9008d1f/go.mod h1:b+2E5dAYhXwXZwtn golang.org/x/tools v0.0.0-20191130070609-6e064ea0cf2d/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191216173652-a0e659d51361/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20191227053925-7b8e75db28f4/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200103221440-774c71fcf114/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20200117161641-43d50277825c/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20200122220014-bf1340f18c4a/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20200130002326-2f3ba24bd6e7/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= @@ -912,21 +563,9 @@ golang.org/x/tools v0.0.0-20200501065659-ab2804fb9c9d/go.mod h1:EkVYQZoAsY45+roY golang.org/x/tools v0.0.0-20200512131952-2bc93b1c0c88/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= golang.org/x/tools v0.0.0-20200515010526-7d3b6ebf133d/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= golang.org/x/tools v0.0.0-20200618134242-20370b0cb4b2/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= -golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= golang.org/x/tools v0.0.0-20200729194436-6467de6f59a7/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= golang.org/x/tools v0.0.0-20200804011535-6c149bb5ef0d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= golang.org/x/tools v0.0.0-20200825202427-b303f430e36d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= -golang.org/x/tools v0.0.0-20200904185747-39188db58858/go.mod h1:Cj7w3i3Rnn0Xh82ur9kSqwfTHTeVxaDqrfMjpcNT6bE= -golang.org/x/tools v0.0.0-20201110124207-079ba7bd75cd/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= -golang.org/x/tools v0.0.0-20201201161351-ac6f37ff4c2a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= -golang.org/x/tools v0.0.0-20201208233053-a543418bbed2/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= -golang.org/x/tools v0.0.0-20210105154028-b0ab187a4818/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= -golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= -golang.org/x/tools v0.1.0/go.mod h1:xkSsbof2nBLbhDlRMhhhyNLN/zl3eTqcnHD5viDpcZ0= -golang.org/x/tools v0.1.1/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= -golang.org/x/tools v0.1.2/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= -golang.org/x/tools v0.1.3/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= -golang.org/x/tools v0.1.4/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.5/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.8/go.mod h1:nABZi5QlRsZVlzPpHl034qft6wpY4eDcsTt5AaioBiU= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= @@ -934,7 +573,6 @@ golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8T golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 h1:go1bK/D/BFZV2I8cIQd1NKEZ+0owSTG1fDTci4IqFcE= golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -google.golang.org/api v0.3.1/go.mod h1:6wY9I6uQWHQ8EM57III9mq/AjF+i8G65rmVagqKMtkk= google.golang.org/api v0.4.0/go.mod h1:8k5glujaEP+g9n7WNsDg8QP6cUVNI86fCNMcbazEtwE= google.golang.org/api v0.7.0/go.mod h1:WtwebWUNSVBH/HAw79HIFXZNqEvBhG+Ra+ax0hx3E3M= google.golang.org/api v0.8.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg= @@ -951,37 +589,18 @@ google.golang.org/api v0.24.0/go.mod h1:lIXQywCXRcnZPGlsd8NbLnOjtAoL6em04bJ9+z0M google.golang.org/api v0.28.0/go.mod h1:lIXQywCXRcnZPGlsd8NbLnOjtAoL6em04bJ9+z0MncE= google.golang.org/api v0.29.0/go.mod h1:Lcubydp8VUV7KeIHD9z2Bys/sm/vGKnG1UHuDBSrHWM= google.golang.org/api v0.30.0/go.mod h1:QGmEvQ87FHZNiUVJkT14jQNYJ4ZJjdRF23ZXz5138Fc= -google.golang.org/api v0.35.0/go.mod h1:/XrVsuzM0rZmrsbjJutiuftIzeuTQcEeaYcSk/mQ1dg= -google.golang.org/api v0.36.0/go.mod h1:+z5ficQTmoYpPn8LCUNVpK5I7hwkpjbcgqA7I34qYtE= -google.golang.org/api v0.40.0/go.mod h1:fYKFpnQN0DsDSKRVRcQSDQNtqWPfM9i+zNPxepjRCQ8= -google.golang.org/api v0.41.0/go.mod h1:RkxM5lITDfTzmyKFPt+wGrCJbVfniCr2ool8kTBzRTU= -google.golang.org/api v0.43.0/go.mod h1:nQsDGjRXMo4lvh5hP0TKqF244gqhGcr/YSIykhUk/94= -google.golang.org/api v0.47.0/go.mod h1:Wbvgpq1HddcWVtzsVLyfLp8lDg6AA241LmgIL59tHXo= -google.golang.org/api v0.48.0/go.mod h1:71Pr1vy+TAZRPkPs/xlCf5SsU8WjuAWv1Pfjbtukyy4= -google.golang.org/api v0.50.0/go.mod h1:4bNT5pAuq5ji4SRZm+5QIkjny9JAyVD/3gaSihNefaw= -google.golang.org/api v0.51.0/go.mod h1:t4HdrdoNgyN5cbEfm7Lum0lcLDLiise1F8qDKX00sOU= -google.golang.org/api v0.54.0/go.mod h1:7C4bFFOvVDGXjfDTAsgGwDgAxRDeQ4X8NvUedIt6z3k= -google.golang.org/api v0.55.0/go.mod h1:38yMfeP1kfjsl8isn0tliTjIb1rJXcQi4UXlbqivdVE= -google.golang.org/api v0.56.0/go.mod h1:38yMfeP1kfjsl8isn0tliTjIb1rJXcQi4UXlbqivdVE= -google.golang.org/api v0.57.0/go.mod h1:dVPlbZyBo2/OjBpmvNdpn2GRm6rPy75jyU7bmhdrMgI= -google.golang.org/api v0.59.0/go.mod h1:sT2boj7M9YJxZzgeZqXogmhfmRWDtPzT31xkieUbuZU= -google.golang.org/api v0.61.0/go.mod h1:xQRti5UdCmoCEqFxcz93fTl338AVqDgyaDRuOZ3hg9I= -google.golang.org/api v0.62.0/go.mod h1:dKmwPCydfsad4qCH08MSdgWjfHOyfpd4VtDGgRFdavw= google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= -google.golang.org/appengine v1.2.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= google.golang.org/appengine v1.5.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= google.golang.org/appengine v1.6.1/go.mod h1:i06prIuMbXzDqacNJfV5OdTW448YApPu5ww/cMBSeb0= google.golang.org/appengine v1.6.5/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= google.golang.org/appengine v1.6.6/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= -google.golang.org/appengine v1.6.7/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= google.golang.org/genproto v0.0.0-20190307195333-5fe7a883aa19/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= google.golang.org/genproto v0.0.0-20190404172233-64821d5d2107/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= google.golang.org/genproto v0.0.0-20190418145605-e7d98fc518a7/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= google.golang.org/genproto v0.0.0-20190425155659-357c62f0e4bb/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= google.golang.org/genproto v0.0.0-20190502173448-54afdca5d873/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= -google.golang.org/genproto v0.0.0-20190530194941-fb225487d101/go.mod h1:z3L6/3dTEVtUr6QSP8miRzeRqwQOioJ9I66odjN4I7s= google.golang.org/genproto v0.0.0-20190801165951-fa694d86fc64/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= google.golang.org/genproto v0.0.0-20190911173649-1774047e7e51/go.mod h1:IbNlFCBrqXvoKpeg0TB2l7cyZUmoaFKYIwrEpbDKLA8= @@ -1000,57 +619,18 @@ google.golang.org/genproto v0.0.0-20200312145019-da6875a35672/go.mod h1:55QSHmfG google.golang.org/genproto v0.0.0-20200331122359-1ee6d9798940/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= google.golang.org/genproto v0.0.0-20200430143042-b979b6f78d84/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= google.golang.org/genproto v0.0.0-20200511104702-f5ebc3bea380/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= -google.golang.org/genproto v0.0.0-20200513103714-09dca8ec2884/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= google.golang.org/genproto v0.0.0-20200515170657-fc4c6c6a6587/go.mod h1:YsZOwe1myG/8QRHRsmBRE1LrgQY60beZKjly0O1fX9U= google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo= google.golang.org/genproto v0.0.0-20200618031413-b414f8b61790/go.mod h1:jDfRM7FcilCzHH/e9qn6dsT145K34l5v+OpcnNgKAAA= google.golang.org/genproto v0.0.0-20200729003335-053ba62fc06f/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20200804131852-c06518451d9c/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20200825200019-8632dd797987/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20200904004341-0bd0a958aa1d/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20201109203340-2640f1f9cdfb/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20201201144952-b05cb90ed32e/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20201210142538-e3217bee35cc/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20201214200347-8c77b98c765d/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20210222152913-aa3ee6e6a81c/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20210303154014-9728d6b83eeb/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20210310155132-4ce2db91004e/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20210319143718-93e7006c17a6/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20210402141018-6c239bbf2bb1/go.mod h1:9lPAdzaEmUacj36I+k7YKbEc5CXzPIeORRgDAUOu28A= -google.golang.org/genproto v0.0.0-20210513213006-bf773b8c8384/go.mod h1:P3QM42oQyzQSnHPnZ/vqoCdDmzH28fzWByN9asMeM8A= -google.golang.org/genproto v0.0.0-20210602131652-f16073e35f0c/go.mod h1:UODoCrxHCcBojKKwX1terBiRUaqAsFqJiF615XL43r0= -google.golang.org/genproto v0.0.0-20210604141403-392c879c8b08/go.mod h1:UODoCrxHCcBojKKwX1terBiRUaqAsFqJiF615XL43r0= -google.golang.org/genproto v0.0.0-20210608205507-b6d2f5bf0d7d/go.mod h1:UODoCrxHCcBojKKwX1terBiRUaqAsFqJiF615XL43r0= -google.golang.org/genproto v0.0.0-20210624195500-8bfb893ecb84/go.mod h1:SzzZ/N+nwJDaO1kznhnlzqS8ocJICar6hYhVyhi++24= -google.golang.org/genproto v0.0.0-20210713002101-d411969a0d9a/go.mod h1:AxrInvYm1dci+enl5hChSFPOmmUF1+uAa/UsgNRWd7k= -google.golang.org/genproto v0.0.0-20210716133855-ce7ef5c701ea/go.mod h1:AxrInvYm1dci+enl5hChSFPOmmUF1+uAa/UsgNRWd7k= -google.golang.org/genproto v0.0.0-20210728212813-7823e685a01f/go.mod h1:ob2IJxKrgPT52GcgX759i1sleT07tiKowYBGbczaW48= -google.golang.org/genproto v0.0.0-20210805201207-89edb61ffb67/go.mod h1:ob2IJxKrgPT52GcgX759i1sleT07tiKowYBGbczaW48= -google.golang.org/genproto v0.0.0-20210813162853-db860fec028c/go.mod h1:cFeNkxwySK631ADgubI+/XFU/xp8FD5KIVV4rj8UC5w= -google.golang.org/genproto v0.0.0-20210821163610-241b8fcbd6c8/go.mod h1:eFjDcFEctNawg4eG61bRv87N7iHBWyVhJu7u1kqDUXY= -google.golang.org/genproto v0.0.0-20210828152312-66f60bf46e71/go.mod h1:eFjDcFEctNawg4eG61bRv87N7iHBWyVhJu7u1kqDUXY= -google.golang.org/genproto v0.0.0-20210831024726-fe130286e0e2/go.mod h1:eFjDcFEctNawg4eG61bRv87N7iHBWyVhJu7u1kqDUXY= -google.golang.org/genproto v0.0.0-20210903162649-d08c68adba83/go.mod h1:eFjDcFEctNawg4eG61bRv87N7iHBWyVhJu7u1kqDUXY= -google.golang.org/genproto v0.0.0-20210909211513-a8c4777a87af/go.mod h1:eFjDcFEctNawg4eG61bRv87N7iHBWyVhJu7u1kqDUXY= -google.golang.org/genproto v0.0.0-20210924002016-3dee208752a0/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= -google.golang.org/genproto v0.0.0-20211008145708-270636b82663/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= -google.golang.org/genproto v0.0.0-20211028162531-8db9c33dc351/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= -google.golang.org/genproto v0.0.0-20211118181313-81c1377c94b1/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= -google.golang.org/genproto v0.0.0-20211129164237-f09f9a12af12/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= -google.golang.org/genproto v0.0.0-20211203200212-54befc351ae9/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= -google.golang.org/genproto v0.0.0-20211206160659-862468c7d6e0/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= -google.golang.org/genproto v0.0.0-20211208223120-3a66f561d7aa/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= google.golang.org/grpc v1.14.0/go.mod h1:yo6s7OP7yaDglbqo1J04qKzAhqBH6lvTonzMVmEdcZw= -google.golang.org/grpc v1.17.0/go.mod h1:6QZJwpn2B+Zp71q/5VxRsJ6NXXVCE5NRUHRo+f3cWCs= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= -google.golang.org/grpc v1.20.0/go.mod h1:chYK+tFQF0nDUGJgXMSgLCQk3phJEuONr2DCgLDdAQM= google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38= -google.golang.org/grpc v1.21.0/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= google.golang.org/grpc v1.21.1/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= google.golang.org/grpc v1.22.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= -google.golang.org/grpc v1.22.1/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= -google.golang.org/grpc v1.23.1/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQciAY= google.golang.org/grpc v1.26.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= @@ -1059,22 +639,6 @@ google.golang.org/grpc v1.28.0/go.mod h1:rpkK4SK4GF4Ach/+MFLZUBavHOvF2JJB5uozKKa google.golang.org/grpc v1.29.1/go.mod h1:itym6AZVZYACWQqET3MqgPpjcuV5QH3BxFS3IjizoKk= google.golang.org/grpc v1.30.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= google.golang.org/grpc v1.31.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= -google.golang.org/grpc v1.31.1/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= -google.golang.org/grpc v1.33.1/go.mod h1:fr5YgcSWrqhRRxogOsw7RzIpsmvOZ6IcH4kBYTpR3n0= -google.golang.org/grpc v1.33.2/go.mod h1:JMHMWHQWaTccqQQlmk3MJZS+GWXOdAesneDmEnv2fbc= -google.golang.org/grpc v1.34.0/go.mod h1:WotjhfgOW/POjDeRt8vscBtXq+2VjORFy659qA51WJ8= -google.golang.org/grpc v1.35.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= -google.golang.org/grpc v1.36.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= -google.golang.org/grpc v1.36.1/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= -google.golang.org/grpc v1.37.0/go.mod h1:NREThFqKR1f3iQ6oBuvc5LadQuXVGo9rkm5ZGrQdJfM= -google.golang.org/grpc v1.37.1/go.mod h1:NREThFqKR1f3iQ6oBuvc5LadQuXVGo9rkm5ZGrQdJfM= -google.golang.org/grpc v1.38.0/go.mod h1:NREThFqKR1f3iQ6oBuvc5LadQuXVGo9rkm5ZGrQdJfM= -google.golang.org/grpc v1.39.0/go.mod h1:PImNr+rS9TWYb2O4/emRugxiyHZ5JyHW5F+RPnDzfrE= -google.golang.org/grpc v1.39.1/go.mod h1:PImNr+rS9TWYb2O4/emRugxiyHZ5JyHW5F+RPnDzfrE= -google.golang.org/grpc v1.40.0/go.mod h1:ogyxbiOoUXAkP+4+xa6PZSE9DZgIHtSpzjDTB9KAK34= -google.golang.org/grpc v1.40.1/go.mod h1:ogyxbiOoUXAkP+4+xa6PZSE9DZgIHtSpzjDTB9KAK34= -google.golang.org/grpc v1.42.0/go.mod h1:k+4IHHFw41K8+bbowsex27ge2rCb65oeWqe4jJ590SU= -google.golang.org/grpc/cmd/protoc-gen-go-grpc v1.1.0/go.mod h1:6Kw0yEErY5E/yWrBtf03jp27GLLJujG4z/JK95pnjjw= 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= @@ -1087,8 +651,8 @@ google.golang.org/protobuf v1.24.0/go.mod h1:r/3tXBNzIEhYS9I1OUVjXDlt8tc493IdKGj google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c= google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= -google.golang.org/protobuf v1.27.1 h1:SnqbnDw1V7RiZcXPx5MEeqPv2s79L9i7BJUlG/+RurQ= -google.golang.org/protobuf v1.27.1/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= +google.golang.org/protobuf v1.28.0 h1:w43yiav+6bVFTBQFZX0r7ipe9JQ1QsbMgHwbBziscLw= +google.golang.org/protobuf v1.28.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= gopkg.in/asn1-ber.v1 v1.0.0-20181015200546-f715ec2f112d/go.mod h1:cuepJuh7vyXfUyUwEgHQXw849cJrilpS5NeIjOWESAw= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= @@ -1096,19 +660,10 @@ gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8 gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= -gopkg.in/cheggaaa/pb.v1 v1.0.25/go.mod h1:V/YB90LKu/1FcN3WVnfiiE5oMCibMjukxqG/qStrOgw= gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= -gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys= -gopkg.in/gcfg.v1 v1.2.3/go.mod h1:yesOnuUOFQAhST5vPY4nbZsb/huCgGGXlipJsBn0b3o= -gopkg.in/ini.v1 v1.66.2/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= -gopkg.in/resty.v1 v1.12.0/go.mod h1:mDo4pnntr5jdWRML875a/NmxYqAlA73dVijT2AXvQQo= gopkg.in/square/go-jose.v2 v2.3.1/go.mod h1:M9dMgbHiYLoDGQrXy7OpJDJWiKiU//h+vD76mk0e1AI= -gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw= -gopkg.in/warnings.v0 v0.1.2/go.mod h1:jksf8JmL6Qr/oQM2OXTHunEvvTAsrWBLb6OOjuVWRNI= -gopkg.in/yaml.v2 v2.0.0-20170812160011-eb3733d160e7/go.mod h1:JAlM8MvJe8wmxCU4Bli9HhUf9+ttbYbLASfIpnQbh74= gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v2 v2.2.3/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.5/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= @@ -1118,7 +673,6 @@ gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b h1:h8qDotaEPuJATrMmW04NCwg7v22aHH28wwpauUhK9Oo= gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -honnef.co/go/tools v0.0.0-20180728063816-88497007e858/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190106161140-3f1c8253044a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190418001031-e561f6794a2a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= @@ -1129,5 +683,3 @@ honnef.co/go/tools v0.0.1-2020.1.4/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9 rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8= rsc.io/quote/v3 v3.1.0/go.mod h1:yEA65RcK8LyAZtP9Kv3t0HmxON59tX3rD+tICJqUlj0= rsc.io/sampler v1.3.0/go.mod h1:T1hPZKmBbMNahiBKFy5HrXp6adAjACjK9JXDnKaTXpA= -sigs.k8s.io/yaml v1.1.0/go.mod h1:UJmg0vDUVViEyp3mgSv9WPwZCDxu4rQW1olrI1uml+o= -sourcegraph.com/sourcegraph/appdash v0.0.0-20190731080439-ebfcffb1b5c0/go.mod h1:hI742Nqp5OhwiqlzhgfbWU4mW4yO10fP+LoT9WOswdU= From 1f04159c0242379f75824550196e45f731f6276a Mon Sep 17 00:00:00 2001 From: Parham Alvani Date: Sun, 29 May 2022 18:54:24 +0430 Subject: [PATCH 207/660] feat: update golang-ci configuration --- .golangci.yml | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/.golangci.yml b/.golangci.yml index 4908c1a0..5acc4ef8 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -1,6 +1,4 @@ --- -run: - tests: false linters: enable-all: true disable: @@ -8,13 +6,10 @@ linters: - tagliatelle # it should improve to support more known patterns - varnamelen + - ireturn # deprecated linters - maligned - scopelint - golint - interfacer -linters-settings: - gosec: - excludes: - # crypto/md5 - - G501 + - exhaustivestruct From 246d082bffa03db1c8f603b093db838fb6a1bbff Mon Sep 17 00:00:00 2001 From: Parham Alvani Date: Sun, 29 May 2022 18:54:32 +0430 Subject: [PATCH 208/660] fix: correct test step --- .gitlab/ci/templates/test.gitlab-ci.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.gitlab/ci/templates/test.gitlab-ci.yml b/.gitlab/ci/templates/test.gitlab-ci.yml index ce0f2da7..135d2d22 100644 --- a/.gitlab/ci/templates/test.gitlab-ci.yml +++ b/.gitlab/ci/templates/test.gitlab-ci.yml @@ -12,8 +12,7 @@ test: before_script: - go env -w GOPROXY="https://repo.snapp.tech/repository/goproxy/" script: - - go test -gcflags=-l -v -coverprofile .coverage.out.tmp ./... - - rm -rf .coverage.out.tmp + - go test -gcflags=-l -v -coverprofile .coverage.out ./... - go tool cover -func .coverage.out dependencies: - compile From a74ee535d19338b3580bc5f5b61d6697f8be6302 Mon Sep 17 00:00:00 2001 From: Parham Alvani Date: Sun, 29 May 2022 18:54:55 +0430 Subject: [PATCH 209/660] feat: update alpine version --- Dockerfile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Dockerfile b/Dockerfile index 148e1dd9..94e86716 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,11 +1,11 @@ -FROM alpine:3.14 +FROM alpine:3.15 ARG BUILD_DATE ARG VCS_REF ARG BUILD_VERSION # hadolint ignore=DL3018 -RUN echo "https://repo.snapp.tech/repository/alpine/v3.14/main" > /etc/apk/repositories && \ - echo "https://repo.snapp.tech/repository/alpine/v3.14/community" >> /etc/apk/repositories && \ +RUN echo "https://repo.snapp.tech/repository/alpine/v3.15/main" > /etc/apk/repositories && \ + echo "https://repo.snapp.tech/repository/alpine/v3.15/community" >> /etc/apk/repositories && \ apk --no-cache --update add ca-certificates tzdata && \ mkdir /app From 37a9d509aa8698c069f43be016fdfcb40ecf0247 Mon Sep 17 00:00:00 2001 From: Parham Alvani Date: Sun, 29 May 2022 19:20:55 +0430 Subject: [PATCH 210/660] fix: correct lint issues --- internal/api/acl.go | 7 +-- internal/api/api.go | 2 +- internal/authenticator/authenticator.go | 4 +- internal/authenticator/authenticator_test.go | 45 +++++++++++++++----- internal/cmd/root.go | 2 +- internal/cmd/serve/main.go | 2 +- internal/topics/manager.go | 6 ++- internal/topics/manager_test.go | 35 +++++++++------ 8 files changed, 69 insertions(+), 34 deletions(-) diff --git a/internal/api/acl.go b/internal/api/acl.go index 3206e943..72019ddb 100644 --- a/internal/api/acl.go +++ b/internal/api/acl.go @@ -67,11 +67,12 @@ func (a API) ACL(c *fiber.Ctx) error { span.RecordError(err) } - // nolint: exhaustivestruct - if errors.Is(err, authenticator.TopicNotAllowedError{}) { + var tnaErr authenticator.TopicNotAllowedError + + if errors.As(err, &tnaErr) { a.Logger. Warn("acl request is not authorized", - zap.Error(err)) + zap.Error(tnaErr)) } else { a.Logger. Error("acl request is not authorized", diff --git a/internal/api/api.go b/internal/api/api.go index 5e645b2a..cc32dbbe 100644 --- a/internal/api/api.go +++ b/internal/api/api.go @@ -19,7 +19,7 @@ type API struct { func (a API) ReSTServer() *fiber.App { app := fiber.New() - // nolint: exhaustivestruct + // nolint: exhaustruct app.Use(fiberzap.New(fiberzap.Config{ Logger: a.Logger.Named("fiber"), })) diff --git a/internal/authenticator/authenticator.go b/internal/authenticator/authenticator.go index 99a4ca0b..d8176f7e 100644 --- a/internal/authenticator/authenticator.go +++ b/internal/authenticator/authenticator.go @@ -63,8 +63,8 @@ type Authenticator struct { // Auth check user authentication by checking the user's token // isSuperuser is a flag that authenticator set it true when credentials is related to a superuser. -func (a Authenticator) Auth(tokenString string) (err error) { - _, err = jwt.Parse(tokenString, func(token *jwt.Token) (i interface{}, err error) { +func (a Authenticator) Auth(tokenString string) error { + _, err := jwt.Parse(tokenString, func(token *jwt.Token) (interface{}, error) { if _, ok := token.Method.(*jwt.SigningMethodRSA); !ok { return nil, ErrInvalidSigningMethod } diff --git a/internal/authenticator/authenticator_test.go b/internal/authenticator/authenticator_test.go index 00bd9780..087bcea1 100644 --- a/internal/authenticator/authenticator_test.go +++ b/internal/authenticator/authenticator_test.go @@ -2,7 +2,7 @@ package authenticator_test import ( "crypto/rsa" - "fmt" + "errors" "io/ioutil" "testing" "time" @@ -19,6 +19,7 @@ import ( ) const ( + // nolint: gosec, lll invalidToken = "ey1JhbGciOiJSUzI1NiIsInR5cCI56kpXVCJ9.eyJzdWIiOiJCRzdScDFkcnpWRE5RcjYiLCJuYW1lIjoiSm9obiBEb2UiLCJhZG1pbiI6dHJ1ZSwiaXNzIjowLCJpYXQiOjE1MTYyMzkwMjJ9.1cYXFEhcewOYFjGJYhB8dsaFO9uKEXwlM8954rkt4Tsu0lWMITbRf_hHh1l9QD4MFqD-0LwRPUYaiaemy0OClMu00G2sujLCWaquYDEP37iIt8RoOQAh8Jb5vT8LX5C3PEKvbW_i98u8HHJoFUR9CXJmzrKi48sAcOYvXVYamN0S9KoY38H-Ze37Mdu3o6B58i73krk7QHecsc2_PkCJisvUVAzb0tiInIalBc8-zI3QZSxwNLr_hjlBg1sUxTUvH5SCcRR7hxI8TxJzkOHqAHWDRO84NC_DSAoO2p04vrHpqglN9XPJ8RC2YWpfefvD2ttH554RJWu_0RlR2kAYvQ" validPassengerCabEventTopic = "passenger-event-152384980615c2bd16143cff29038b67" @@ -79,18 +80,22 @@ func (suite *AuthenticatorTestSuite) SetupSuite() { driverToken, err := suite.getSampleToken(user.Driver, false) require.NoError(err) + suite.Tokens.Driver = driverToken passengerToken, err := suite.getSampleToken(user.Passenger, false) require.NoError(err) + suite.Tokens.Passenger = passengerToken pkey0, err := suite.getPublicKey(user.Driver) require.NoError(err) + suite.PublicKeys.Driver = pkey0 pkey1, err := suite.getPublicKey(user.Passenger) require.NoError(err) + suite.PublicKeys.Passenger = pkey1 hid := &snappids.HashIDSManager{ @@ -169,6 +174,7 @@ func (suite *AuthenticatorTestSuite) TestACL_Basics() { }) } +// nolint: funlen func (suite *AuthenticatorTestSuite) TestACL_Passenger() { require := suite.Require() token := suite.Tokens.Passenger @@ -240,6 +246,7 @@ func (suite *AuthenticatorTestSuite) TestACL_Passenger() { }) } +// nolint: funlen func (suite *AuthenticatorTestSuite) TestACL_Driver() { require := suite.Require() token := suite.Tokens.Driver @@ -330,6 +337,8 @@ func (suite *AuthenticatorTestSuite) TestACL_Driver() { } func TestAuthenticator_ValidateTopicBySender(t *testing.T) { + t.Parallel() + hid := &snappids.HashIDSManager{ Salts: map[snappids.Audience]string{ snappids.DriverAudience: "secret", @@ -341,7 +350,7 @@ func TestAuthenticator_ValidateTopicBySender(t *testing.T) { cfg := config.New() - // nolint: exhaustivestruct + // nolint: exhaustruct authenticator := authenticator.Authenticator{ AllowedAccessTypes: []acl.AccessType{acl.Pub, acl.Sub}, Company: "snapp", @@ -350,12 +359,16 @@ func TestAuthenticator_ValidateTopicBySender(t *testing.T) { t.Run("testing valid driver cab event", func(t *testing.T) { audience, audienceStr := topics.IssuerToAudience(user.Driver) - topicTemplate := authenticator.TopicManager.ValidateTopic(validDriverCabEventTopic, audienceStr, audience, "DXKgaNQa7N5Y7bo") + topicTemplate := authenticator.TopicManager.ValidateTopic( + validDriverCabEventTopic, audienceStr, audience, "DXKgaNQa7N5Y7bo") assert.True(t, topicTemplate != nil) }) } +// nolint: funlen func TestAuthenticator_validateAccessType(t *testing.T) { + t.Parallel() + type fields struct { AllowedAccessTypes []acl.AccessType } @@ -431,7 +444,7 @@ func TestAuthenticator_validateAccessType(t *testing.T) { t.Run(tt.name, func(t *testing.T) { t.Parallel() - // nolint: exhaustivestruct + // nolint: exhaustruct a := authenticator.Authenticator{ AllowedAccessTypes: tt.fields.AllowedAccessTypes, } @@ -442,6 +455,7 @@ func TestAuthenticator_validateAccessType(t *testing.T) { } } +// nolint: goerr113, wrapcheck func (suite *AuthenticatorTestSuite) getPublicKey(u user.Issuer) (*rsa.PublicKey, error) { var fileName string @@ -450,8 +464,10 @@ func (suite *AuthenticatorTestSuite) getPublicKey(u user.Issuer) (*rsa.PublicKey fileName = "../../test/1.pem" case user.Driver: fileName = "../../test/0.pem" + case user.None: + fallthrough default: - return nil, fmt.Errorf("invalid user, public key not found") + return nil, errors.New("invalid user, public key not found") } pem, err := ioutil.ReadFile(fileName) @@ -467,24 +483,31 @@ func (suite *AuthenticatorTestSuite) getPublicKey(u user.Issuer) (*rsa.PublicKey return publicKey, nil } +// nolint: goerr113, wrapcheck func (suite *AuthenticatorTestSuite) getPrivateKey(u user.Issuer) (*rsa.PrivateKey, error) { var fileName string + switch u { case user.Driver: fileName = "../../test/0.private.pem" case user.Passenger: fileName = "../../test/1.private.pem" + case user.None: + fallthrough default: - return nil, fmt.Errorf("invalid user, private key not found") + return nil, errors.New("invalid user, private key not found") } + pem, err := ioutil.ReadFile(fileName) if err != nil { return nil, err } + privateKey, err := jwt.ParseRSAPrivateKeyFromPEM(pem) if err != nil { return nil, err } + return privateKey, nil } @@ -494,19 +517,21 @@ func (suite *AuthenticatorTestSuite) getSampleToken(issuer user.Issuer, isSuperu suite.Require().NoError(err) } - exp := time.Now().Add(time.Hour * 24 * 365 * 10).Unix() + exp := time.Now().Add(time.Hour * 24 * 365 * 10) sub := "DXKgaNQa7N5Y7bo" - var claims jwt.Claims - claims = jwt.StandardClaims{ - ExpiresAt: exp, + // nolint: exhaustruct + claims := jwt.RegisteredClaims{ + ExpiresAt: jwt.NewNumericDate(exp), Issuer: string(issuer), Subject: sub, } token := jwt.NewWithClaims(jwt.SigningMethodRS256, claims) + tokenString, err := token.SignedString(key) if err != nil { suite.Require().NoError(err) } + return tokenString, nil } diff --git a/internal/cmd/root.go b/internal/cmd/root.go index a3acc76b..af9bde58 100644 --- a/internal/cmd/root.go +++ b/internal/cmd/root.go @@ -23,7 +23,7 @@ func Execute() { tracer := tracing.New(cfg.Tracer, logger.Named("tracer")) - // nolint: exhaustivestruct + // nolint: exhaustruct root := &cobra.Command{ Use: "soteria", Short: "Soteria is the authentication service.", diff --git a/internal/cmd/serve/main.go b/internal/cmd/serve/main.go index b27f79a6..c56bcb70 100644 --- a/internal/cmd/serve/main.go +++ b/internal/cmd/serve/main.go @@ -84,7 +84,7 @@ func (s Serve) main() { // Register serve command. func (s Serve) Register(root *cobra.Command) { root.AddCommand( - // nolint: exhaustivestruct + // nolint: exhaustruct &cobra.Command{ Use: "serve", Short: "serve runs the application", diff --git a/internal/topics/manager.go b/internal/topics/manager.go index 2046c903..81bc0245 100644 --- a/internal/topics/manager.go +++ b/internal/topics/manager.go @@ -4,7 +4,7 @@ package topics import ( - "crypto/md5" + "crypto/md5" // nolint: gosec "errors" "fmt" "regexp" @@ -116,11 +116,13 @@ func (t Manager) getHashID(hashType HashType, sub string, audience snappids.Audi // IssuerToAudience returns corresponding audience in snappids form. func IssuerToAudience(issuer user.Issuer) (snappids.Audience, string) { - switch issuer { // nolint:exhaustive + switch issuer { case user.Passenger: return snappids.PassengerAudience, Passenger case user.Driver: return snappids.DriverAudience, Driver + case user.None: + fallthrough default: return -1, "" } diff --git a/internal/topics/manager_test.go b/internal/topics/manager_test.go index bd4d9b44..a0426140 100644 --- a/internal/topics/manager_test.go +++ b/internal/topics/manager_test.go @@ -1,16 +1,19 @@ package topics_test import ( - "fmt" + "testing" + "gitlab.snapp.ir/dispatching/snappids/v2" "gitlab.snapp.ir/dispatching/soteria/internal/authenticator" "gitlab.snapp.ir/dispatching/soteria/internal/config" "gitlab.snapp.ir/dispatching/soteria/internal/topics" "gitlab.snapp.ir/dispatching/soteria/pkg/user" - "testing" ) -func TestTopic_GetType(t1 *testing.T) { +// nolint: funlen +func TestTopic_GetType(t *testing.T) { + t.Parallel() + tests := []struct { name string arg string @@ -141,6 +144,7 @@ func TestTopic_GetType(t1 *testing.T) { snappids.ThirdPartyAudience: 15, }, } + // nolint: exhaustruct auth := authenticator.Authenticator{ Company: "snapp", TopicManager: topics.NewTopicManager(cfg.Topics, hid, "snapp"), @@ -148,20 +152,23 @@ func TestTopic_GetType(t1 *testing.T) { sub := "DXKgaNQa7N5Y7bo" - for i, tt := range tests { - t1.Run(fmt.Sprintf("#%d %s", i, tt.name), func(t1 *testing.T) { - t := tt.arg - audience, audienceStr := topics.IssuerToAudience(tt.issuer) - topicTemplate := auth.TopicManager.ValidateTopic(t, audienceStr, audience, sub) + for _, tc := range tests { + tc := tc + t.Run(tc.name, func(t *testing.T) { + t.Parallel() + + topic := tc.arg + audience, audienceStr := topics.IssuerToAudience(tc.issuer) + topicTemplate := auth.TopicManager.ValidateTopic(topic, audienceStr, audience, sub) if topicTemplate != nil { - if len(tt.want) == 0 { - t1.Errorf("topic %s is invalid, must throw error.", tt.arg) - } else if topicTemplate.Type != tt.want { - t1.Errorf("GetType() = %v, want %v", topicTemplate.Type, tt.want) + if len(tc.want) == 0 { + t.Errorf("topic %s is invalid, must throw error.", tc.arg) + } else if topicTemplate.Type != tc.want { + t.Errorf("GetType() = %v, want %v", topicTemplate.Type, tc.want) } } else { - if len(tt.want) != 0 { - t1.Errorf("failed to find topicTemplate for %s", tt.arg) + if len(tc.want) != 0 { + t.Errorf("failed to find topicTemplate for %s", tc.arg) } } }) From dcff69186a6d23fdfbd878150bf2fbdd7752a6e7 Mon Sep 17 00:00:00 2001 From: Parham Alvani Date: Tue, 7 Jun 2022 17:20:06 +0430 Subject: [PATCH 211/660] feat: update packages --- .gitlab/ci/templates/compile.gitlab-ci.yml | 2 +- .gitlab/ci/templates/test.gitlab-ci.yml | 2 +- Dockerfile | 6 +++--- go.mod | 2 +- go.sum | 2 ++ 5 files changed, 8 insertions(+), 6 deletions(-) diff --git a/.gitlab/ci/templates/compile.gitlab-ci.yml b/.gitlab/ci/templates/compile.gitlab-ci.yml index 96ed1a38..5cb6ef77 100644 --- a/.gitlab/ci/templates/compile.gitlab-ci.yml +++ b/.gitlab/ci/templates/compile.gitlab-ci.yml @@ -1,7 +1,7 @@ --- compile: stage: compile - image: registry.snapp.tech/docker/golang:1.18-alpine3.15 + image: registry.snapp.tech/docker/golang:1.18-alpine variables: GOOS: "linux" GOARCH: "amd64" diff --git a/.gitlab/ci/templates/test.gitlab-ci.yml b/.gitlab/ci/templates/test.gitlab-ci.yml index 135d2d22..40fec0ca 100644 --- a/.gitlab/ci/templates/test.gitlab-ci.yml +++ b/.gitlab/ci/templates/test.gitlab-ci.yml @@ -6,7 +6,7 @@ handolint: extends: .easy-ci:dockerfile:lint test: - image: registry.snapp.tech/docker/golang:1.18-alpine3.15 + image: registry.snapp.tech/docker/golang:1.18-alpine stage: test coverage: '/total:\s*\(statements\)\s*([\d.]+)%/' before_script: diff --git a/Dockerfile b/Dockerfile index 94e86716..f0b3f13f 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,11 +1,11 @@ -FROM alpine:3.15 +FROM alpine:3.16 ARG BUILD_DATE ARG VCS_REF ARG BUILD_VERSION # hadolint ignore=DL3018 -RUN echo "https://repo.snapp.tech/repository/alpine/v3.15/main" > /etc/apk/repositories && \ - echo "https://repo.snapp.tech/repository/alpine/v3.15/community" >> /etc/apk/repositories && \ +RUN echo "https://repo.snapp.tech/repository/alpine/v3.16/main" > /etc/apk/repositories && \ + echo "https://repo.snapp.tech/repository/alpine/v3.16/community" >> /etc/apk/repositories && \ apk --no-cache --update add ca-certificates tzdata && \ mkdir /app diff --git a/go.mod b/go.mod index 59ee559f..2bcad31d 100644 --- a/go.mod +++ b/go.mod @@ -35,7 +35,7 @@ require ( github.com/gofiber/utils v0.1.2 // indirect github.com/golang/protobuf v1.5.2 // indirect github.com/inconshreveable/mousetrap v1.0.0 // indirect - github.com/klauspost/compress v1.15.5 // indirect + github.com/klauspost/compress v1.15.6 // indirect github.com/matttproud/golang_protobuf_extensions v1.0.1 // indirect github.com/mitchellh/copystructure v1.2.0 // indirect github.com/mitchellh/mapstructure v1.5.0 // indirect diff --git a/go.sum b/go.sum index c1e8937a..82d99423 100644 --- a/go.sum +++ b/go.sum @@ -220,6 +220,8 @@ github.com/klauspost/compress v1.14.1/go.mod h1:/3/Vjq9QcHkK5uEr5lBEmyoZ1iFhe47e github.com/klauspost/compress v1.15.0/go.mod h1:/3/Vjq9QcHkK5uEr5lBEmyoZ1iFhe47etQ6QUkpK6sk= github.com/klauspost/compress v1.15.5 h1:qyCLMz2JCrKADihKOh9FxnW3houKeNsp2h5OEz0QSEA= github.com/klauspost/compress v1.15.5/go.mod h1:PhcZ0MbTNciWF3rruxRgKxI5NkcHHrHUDtV4Yw2GlzU= +github.com/klauspost/compress v1.15.6 h1:6D9PcO8QWu0JyaQ2zUMmu16T1T+zjjEpP91guRsvDfY= +github.com/klauspost/compress v1.15.6/go.mod h1:PhcZ0MbTNciWF3rruxRgKxI5NkcHHrHUDtV4Yw2GlzU= github.com/knadh/koanf v1.4.1 h1:Z0VGW/uo8NJmjd+L1Dc3S5frq6c62w5xQ9Yf4Mg3wFQ= github.com/knadh/koanf v1.4.1/go.mod h1:1cfH5223ZeZUOs8FU2UdTmaNfHpqgtjV0+NHjRO43gs= github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= From e00fe5e0277a7c03b62daa0ade0046a0aa37e11e Mon Sep 17 00:00:00 2001 From: Parham Alvani Date: Tue, 7 Jun 2022 17:20:31 +0430 Subject: [PATCH 212/660] feat: update chart version --- deployments/soteria/Chart.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/deployments/soteria/Chart.yaml b/deployments/soteria/Chart.yaml index 5666c79f..de3dc092 100644 --- a/deployments/soteria/Chart.yaml +++ b/deployments/soteria/Chart.yaml @@ -5,6 +5,6 @@ description: Soteria Helm Chart type: application -version: 6.0.1 +version: 6.5.0 -appVersion: "v6-0-1" +appVersion: "v6-5-0" From fec2d2b90cbd703263bf004e12669cd0f21460e1 Mon Sep 17 00:00:00 2001 From: "ahmad.mohammadi" Date: Sat, 18 Jun 2022 15:50:44 +0430 Subject: [PATCH 213/660] fix: add underline character to call topic --- deployments/soteria/values.yaml | 2 +- internal/config/default.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/deployments/soteria/values.yaml b/deployments/soteria/values.yaml index c98dd2aa..fd6d98b3 100644 --- a/deployments/soteria/values.yaml +++ b/deployments/soteria/values.yaml @@ -127,7 +127,7 @@ topics: driver: '2' passenger: '2' - type: node_call_entry - template: ^{{.company}}/{{.audience}}/{{.hashId}}/call/[a-zA-Z0-9-]+/send$ + template: ^{{.company}}/{{.audience}}/{{.hashId}}/call/[a-zA-Z0-9-_]+/send$ hash_type: 0 accesses: driver: '2' diff --git a/internal/config/default.go b/internal/config/default.go index 2f48ef9e..1d531a93 100644 --- a/internal/config/default.go +++ b/internal/config/default.go @@ -116,7 +116,7 @@ func Default() Config { }, { Type: topics.NodeCallEntry, - Template: "^{{.company}}/{{.audience}}/{{.hashId}}/call/[a-zA-Z0-9-]+/send$", + Template: "^{{.company}}/{{.audience}}/{{.hashId}}/call/[a-zA-Z0-9-_]+/send$", HashType: topics.HashID, Accesses: map[string]acl.AccessType{ topics.Driver: acl.Pub, From 2f30fa9a102e80c589f2d42209a64384bdc0c732 Mon Sep 17 00:00:00 2001 From: Parham Alvani Date: Sun, 19 Jun 2022 00:32:05 +0430 Subject: [PATCH 214/660] feat: update deployment version --- deployments/soteria/Chart.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/deployments/soteria/Chart.yaml b/deployments/soteria/Chart.yaml index de3dc092..d5486f4e 100644 --- a/deployments/soteria/Chart.yaml +++ b/deployments/soteria/Chart.yaml @@ -5,6 +5,6 @@ description: Soteria Helm Chart type: application -version: 6.5.0 +version: 6.5.1 -appVersion: "v6-5-0" +appVersion: "v6-5-1" From 4054900be2467d4665116a8d45adc05583a8c959 Mon Sep 17 00:00:00 2001 From: "ahmad.mohammadi" Date: Wed, 22 Jun 2022 10:45:30 +0430 Subject: [PATCH 215/660] feat: disable metric endpoint log in stdout --- internal/api/api.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/internal/api/api.go b/internal/api/api.go index cc32dbbe..864a0f26 100644 --- a/internal/api/api.go +++ b/internal/api/api.go @@ -15,12 +15,20 @@ type API struct { Logger zap.Logger } +// MetricLogSkipper check if route is equal "metric" disable log. +func MetricLogSkipper(ctx *fiber.Ctx) bool { + route := string(ctx.Request().URI().Path()) + + return route == "/metrics" +} + // ReSTServer will return fiber app. func (a API) ReSTServer() *fiber.App { app := fiber.New() // nolint: exhaustruct app.Use(fiberzap.New(fiberzap.Config{ + Next: MetricLogSkipper, Logger: a.Logger.Named("fiber"), })) From 353d1754e8e03fce2da5b4a97cdea6c0ead1664e Mon Sep 17 00:00:00 2001 From: Mohammadmehdi Teymorian Date: Mon, 25 Jul 2022 15:27:50 +0430 Subject: [PATCH 216/660] feat: add authenticator map for different vendors --- internal/api/acl.go | 2 +- internal/api/api.go | 14 +++++++++++--- internal/api/auth.go | 2 +- internal/authenticator/authenticator.go | 2 ++ 4 files changed, 15 insertions(+), 5 deletions(-) diff --git a/internal/api/acl.go b/internal/api/acl.go index 72019ddb..f681f568 100644 --- a/internal/api/acl.go +++ b/internal/api/acl.go @@ -61,7 +61,7 @@ func (a API) ACL(c *fiber.Ctx) error { topic := request.Topic - ok, err := a.Authenticator.ACL(request.Access, tokenString, topic) + ok, err := a.Authenticator(request.Password).ACL(request.Access, tokenString, topic) if err != nil || !ok { if err != nil { span.RecordError(err) diff --git a/internal/api/api.go b/internal/api/api.go index 864a0f26..04e375df 100644 --- a/internal/api/api.go +++ b/internal/api/api.go @@ -10,9 +10,9 @@ import ( ) type API struct { - Authenticator *authenticator.Authenticator - Tracer trace.Tracer - Logger zap.Logger + Authenticators map[string]*authenticator.Authenticator + Tracer trace.Tracer + Logger zap.Logger } // MetricLogSkipper check if route is equal "metric" disable log. @@ -41,3 +41,11 @@ func (a API) ReSTServer() *fiber.App { return app } + +func (a API) Authenticator(vendor string) *authenticator.Authenticator { + if vendor == "" { + return a.Authenticators[authenticator.DefaultVendor] + } + + return a.Authenticators[vendor] +} diff --git a/internal/api/auth.go b/internal/api/auth.go index 6af6e35d..f9f993a2 100644 --- a/internal/api/auth.go +++ b/internal/api/auth.go @@ -49,7 +49,7 @@ func (a API) Auth(c *fiber.Ctx) error { attribute.String("password", request.Username), ) - if err := a.Authenticator.Auth(tokenString); err != nil { + if err := a.Authenticator(request.Password).Auth(tokenString); err != nil { span.RecordError(err) a.Logger. diff --git a/internal/authenticator/authenticator.go b/internal/authenticator/authenticator.go index d8176f7e..c569e061 100644 --- a/internal/authenticator/authenticator.go +++ b/internal/authenticator/authenticator.go @@ -11,6 +11,8 @@ import ( "gitlab.snapp.ir/dispatching/soteria/pkg/user" ) +const DefaultVendor = "snapp" + var ( ErrInvalidSigningMethod = errors.New("token is not valid, signing method is not RSA") ErrIssNotFound = errors.New("could not found iss in token claims") From 1b0c3d410104ae7786c3d4a506f68f018fd9479b Mon Sep 17 00:00:00 2001 From: Mohammadmehdi Teymorian Date: Mon, 25 Jul 2022 15:39:29 +0430 Subject: [PATCH 217/660] feat: check vendor's authenticator existence --- internal/api/acl.go | 9 ++++++++- internal/api/api.go | 8 +++++--- internal/api/auth.go | 9 ++++++++- 3 files changed, 21 insertions(+), 5 deletions(-) diff --git a/internal/api/acl.go b/internal/api/acl.go index f681f568..6c8d4752 100644 --- a/internal/api/acl.go +++ b/internal/api/acl.go @@ -61,7 +61,14 @@ func (a API) ACL(c *fiber.Ctx) error { topic := request.Topic - ok, err := a.Authenticator(request.Password).ACL(request.Access, tokenString, topic) + auth, ok := a.Authenticator(request.Password) + if !ok { + a.Logger.Warn("vendor not supported", zap.String("vendor", request.Password)) + + return c.Status(http.StatusBadRequest).SendString("bad request") + } + + ok, err := auth.ACL(request.Access, tokenString, topic) if err != nil || !ok { if err != nil { span.RecordError(err) diff --git a/internal/api/api.go b/internal/api/api.go index 04e375df..6df8e574 100644 --- a/internal/api/api.go +++ b/internal/api/api.go @@ -42,10 +42,12 @@ func (a API) ReSTServer() *fiber.App { return app } -func (a API) Authenticator(vendor string) *authenticator.Authenticator { +func (a API) Authenticator(vendor string) (*authenticator.Authenticator, bool) { if vendor == "" { - return a.Authenticators[authenticator.DefaultVendor] + return a.Authenticators[authenticator.DefaultVendor], true } - return a.Authenticators[vendor] + auth, ok := a.Authenticators[vendor] + + return auth, ok } diff --git a/internal/api/auth.go b/internal/api/auth.go index f9f993a2..535d4fa4 100644 --- a/internal/api/auth.go +++ b/internal/api/auth.go @@ -49,7 +49,14 @@ func (a API) Auth(c *fiber.Ctx) error { attribute.String("password", request.Username), ) - if err := a.Authenticator(request.Password).Auth(tokenString); err != nil { + auth, ok := a.Authenticator(request.Password) + if !ok { + a.Logger.Warn("vendor not supported", zap.String("vendor", request.Password)) + + return c.Status(http.StatusBadRequest).SendString("bad request") + } + + if err := auth.Auth(tokenString); err != nil { span.RecordError(err) a.Logger. From aff901c5ebc30a5fd2f0de31fa64fa20c4cd8d26 Mon Sep 17 00:00:00 2001 From: Mohammadmehdi Teymorian Date: Mon, 25 Jul 2022 15:59:12 +0430 Subject: [PATCH 218/660] feat: add default authenticator --- internal/cmd/serve/main.go | 58 ++++++++++++++++++++++---------------- 1 file changed, 33 insertions(+), 25 deletions(-) diff --git a/internal/cmd/serve/main.go b/internal/cmd/serve/main.go index c56bcb70..918fe58f 100644 --- a/internal/cmd/serve/main.go +++ b/internal/cmd/serve/main.go @@ -26,6 +26,30 @@ type Serve struct { } func (s Serve) main() { + rest := api.API{ + Authenticators: s.Authenticators(), + Tracer: s.Tracer, + Logger: *s.Logger.Named("api"), + }.ReSTServer() + + go func() { + if err := rest.Listen(fmt.Sprintf(":%d", s.Cfg.HTTPPort)); err != nil && !errors.Is(err, http.ErrServerClosed) { + s.Logger.Fatal("failed to run REST HTTP server", zap.Error(err)) + } + }() + + c := make(chan os.Signal, 1) + signal.Notify(c, os.Interrupt) + <-c + + if err := rest.Shutdown(); err != nil { + s.Logger.Error("error happened during REST API shutdown", zap.Error(err)) + } +} + +func (s Serve) Authenticators() map[string]*authenticator.Authenticator { + all := make(map[string]*authenticator.Authenticator) + publicKey0, err := s.Cfg.ReadPublicKey(user.Driver) if err != nil { s.Logger.Fatal("could not read driver public key") @@ -52,33 +76,17 @@ func (s Serve) main() { s.Logger.Fatal("error while getting allowed access types", zap.Error(err)) } - rest := api.API{ - Authenticator: &authenticator.Authenticator{ - PublicKeys: map[user.Issuer]*rsa.PublicKey{ - user.Driver: publicKey0, - user.Passenger: publicKey1, - }, - AllowedAccessTypes: allowedAccessTypes, - Company: s.Cfg.Company, - TopicManager: topics.NewTopicManager(s.Cfg.Topics, hid, s.Cfg.Company), + all[authenticator.DefaultVendor] = &authenticator.Authenticator{ + PublicKeys: map[user.Issuer]*rsa.PublicKey{ + user.Driver: publicKey0, + user.Passenger: publicKey1, }, - Tracer: s.Tracer, - Logger: *s.Logger.Named("api"), - }.ReSTServer() - - go func() { - if err := rest.Listen(fmt.Sprintf(":%d", s.Cfg.HTTPPort)); err != nil && !errors.Is(err, http.ErrServerClosed) { - s.Logger.Fatal("failed to run REST HTTP server", zap.Error(err)) - } - }() - - c := make(chan os.Signal, 1) - signal.Notify(c, os.Interrupt) - <-c - - if err := rest.Shutdown(); err != nil { - s.Logger.Error("error happened during REST API shutdown", zap.Error(err)) + AllowedAccessTypes: allowedAccessTypes, + Company: s.Cfg.Company, + TopicManager: topics.NewTopicManager(s.Cfg.Topics, hid, s.Cfg.Company), } + + return all } // Register serve command. From aa2e898dc08c202fd2f27f6bab58142162fe6b94 Mon Sep 17 00:00:00 2001 From: Mohammadmehdi Teymorian Date: Tue, 26 Jul 2022 09:43:33 +0430 Subject: [PATCH 219/660] feat: add vendor config --- internal/config/config.go | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/internal/config/config.go b/internal/config/config.go index ddfa1ae2..32244955 100644 --- a/internal/config/config.go +++ b/internal/config/config.go @@ -31,23 +31,27 @@ const ( type ( // Config is the main container of Soteria's config. Config struct { + Vendors []Vendor `koanf:"vendors"` + Logger logger.Config `koanf:"logger"` + HTTPPort int `koanf:"http_port"` + Tracer tracing.Config `koanf:"tracer"` + } + + // JWt contains path of the keys for JWT encryption. + JWT struct { + Path string `koanf:"path"` + } + + Vendor struct { AllowedAccessTypes []string `koanf:"allowed_access_types"` PassengerHashLength int `koanf:"passenger_hash_length"` DriverHashLength int `koanf:"driver_hash_length"` PassengerSalt string `koanf:"passenger_salt"` DriverSalt string `koanf:"driver_salt"` JWT *JWT `koanf:"jwt"` - Logger logger.Config `koanf:"logger"` - HTTPPort int `koanf:"http_port"` - Tracer tracing.Config `koanf:"tracer"` Company string `koanf:"company"` Topics []topics.Topic `koanf:"topics"` } - - // JWt contains path of the keys for JWT encryption. - JWT struct { - Path string `koanf:"path"` - } ) // New reads configuration with koanf. From 1a30b07ca686c269c0ba07f4f62623ee5084aced Mon Sep 17 00:00:00 2001 From: Mohammadmehdi Teymorian Date: Tue, 26 Jul 2022 10:04:11 +0430 Subject: [PATCH 220/660] feat: move functions to main --- internal/cmd/serve/main.go | 88 ++++++++++++++++++++++++++++++++++++++ internal/config/config.go | 65 ---------------------------- 2 files changed, 88 insertions(+), 65 deletions(-) diff --git a/internal/cmd/serve/main.go b/internal/cmd/serve/main.go index 918fe58f..ef94b998 100644 --- a/internal/cmd/serve/main.go +++ b/internal/cmd/serve/main.go @@ -4,16 +4,19 @@ import ( "crypto/rsa" "errors" "fmt" + "io/ioutil" "net/http" "os" "os/signal" + "github.com/golang-jwt/jwt/v4" "github.com/spf13/cobra" "gitlab.snapp.ir/dispatching/snappids/v2" "gitlab.snapp.ir/dispatching/soteria/internal/api" "gitlab.snapp.ir/dispatching/soteria/internal/authenticator" "gitlab.snapp.ir/dispatching/soteria/internal/config" "gitlab.snapp.ir/dispatching/soteria/internal/topics" + "gitlab.snapp.ir/dispatching/soteria/pkg/acl" "gitlab.snapp.ir/dispatching/soteria/pkg/user" "go.opentelemetry.io/otel/trace" "go.uber.org/zap" @@ -103,3 +106,88 @@ func (s Serve) Register(root *cobra.Command) { }, ) } + +func HIDManager(driverSalt string, driverHashLength int, passengerSalt string, passengerHashLength int) *snappids.HashIDSManager { + return &snappids.HashIDSManager{ + Salts: map[snappids.Audience]string{ + snappids.DriverAudience: driverSalt, + snappids.PassengerAudience: passengerSalt, + }, + Lengths: map[snappids.Audience]int{ + snappids.DriverAudience: driverHashLength, + snappids.PassengerAudience: passengerHashLength, + }, + } +} + +func (s Serve) ReadKeys(path string) (*rsa.PublicKey, *rsa.PublicKey) { + driverPublicKey, err := ReadPublicKey(path, user.Driver) + if err != nil { + s.Logger.Fatal("could not read driver public key") + } + + passengerPublicKey, err := ReadPublicKey(path, user.Passenger) + if err != nil { + s.Logger.Fatal("could not read passenger public key") + } + + return driverPublicKey, passengerPublicKey +} + +// ReadPrivateKey will read and return private key that is used for JWT encryption. +// nolint: wrapcheck, goerr113 +func ReadPublicKey(path string, u user.Issuer) (*rsa.PublicKey, error) { + var fileName string + + switch u { // nolint:exhaustive + case user.Driver: + fileName = fmt.Sprintf("%s%s", path, "0.pem") + case user.Passenger: + fileName = fmt.Sprintf("%s%s", path, "1.pem") + default: + return nil, errors.New("invalid issuer, public key not found") + } + + pem, err := ioutil.ReadFile(fileName) + if err != nil { + return nil, err + } + + publicKey, err := jwt.ParseRSAPublicKeyFromPEM(pem) + if err != nil { + return nil, err + } + + return publicKey, nil +} + +// GetAllowedAccessTypes will return all allowed access types in Soteria. +func GetAllowedAccessTypes(accessTypes []string) ([]acl.AccessType, error) { + allowedAccessTypes := make([]acl.AccessType, 0, len(accessTypes)) + + for _, a := range accessTypes { + at, err := toUserAccessType(a) + if err != nil { + return nil, fmt.Errorf("could not convert %s: %w", at, err) + } + + allowedAccessTypes = append(allowedAccessTypes, at) + } + + return allowedAccessTypes, nil +} + +// toUserAccessType will convert string access type to it's own type. +// nolint: goerr113 +func toUserAccessType(access string) (acl.AccessType, error) { + switch access { + case "pub": + return acl.Pub, nil + case "sub": + return acl.Sub, nil + case "pubsub": + return acl.PubSub, nil + } + + return "", fmt.Errorf("%v is a invalid acces type", access) +} diff --git a/internal/config/config.go b/internal/config/config.go index 32244955..f3b43d86 100644 --- a/internal/config/config.go +++ b/internal/config/config.go @@ -1,15 +1,10 @@ package config import ( - "crypto/rsa" "encoding/json" - "errors" - "fmt" - "io/ioutil" "log" "strings" - "github.com/golang-jwt/jwt/v4" "github.com/knadh/koanf" "github.com/knadh/koanf/parsers/yaml" "github.com/knadh/koanf/providers/env" @@ -19,8 +14,6 @@ import ( "gitlab.snapp.ir/dispatching/soteria/internal/logger" "gitlab.snapp.ir/dispatching/soteria/internal/topics" "gitlab.snapp.ir/dispatching/soteria/internal/tracing" - "gitlab.snapp.ir/dispatching/soteria/pkg/acl" - "gitlab.snapp.ir/dispatching/soteria/pkg/user" ) const ( @@ -97,61 +90,3 @@ func New() Config { return instance } - -// ReadPrivateKey will read and return private key that is used for JWT encryption. -// nolint: wrapcheck, goerr113 -func (a *Config) ReadPublicKey(u user.Issuer) (*rsa.PublicKey, error) { - var fileName string - - switch u { // nolint:exhaustive - case user.Driver: - fileName = fmt.Sprintf("%s%s", a.JWT.Path, "0.pem") - case user.Passenger: - fileName = fmt.Sprintf("%s%s", a.JWT.Path, "1.pem") - default: - return nil, errors.New("invalid issuer, public key not found") - } - - pem, err := ioutil.ReadFile(fileName) - if err != nil { - return nil, err - } - - publicKey, err := jwt.ParseRSAPublicKeyFromPEM(pem) - if err != nil { - return nil, err - } - - return publicKey, nil -} - -// GetAllowedAccessTypes will return all allowed access types in Soteria. -func (a *Config) GetAllowedAccessTypes() ([]acl.AccessType, error) { - allowedAccessTypes := make([]acl.AccessType, 0, len(a.AllowedAccessTypes)) - - for _, a := range a.AllowedAccessTypes { - at, err := toUserAccessType(a) - if err != nil { - return nil, fmt.Errorf("could not convert %s: %w", at, err) - } - - allowedAccessTypes = append(allowedAccessTypes, at) - } - - return allowedAccessTypes, nil -} - -// toUserAccessType will convert string access type to it's own type. -// nolint: goerr113 -func toUserAccessType(access string) (acl.AccessType, error) { - switch access { - case "pub": - return acl.Pub, nil - case "sub": - return acl.Sub, nil - case "pubsub": - return acl.PubSub, nil - } - - return "", fmt.Errorf("%v is a invalid acces type", access) -} From 3ad4f4c3ebef80aa53ed4094b3ac44af9a5f5ffa Mon Sep 17 00:00:00 2001 From: Mohammadmehdi Teymorian Date: Tue, 26 Jul 2022 10:37:19 +0430 Subject: [PATCH 221/660] feat: remove return error --- internal/cmd/serve/main.go | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/internal/cmd/serve/main.go b/internal/cmd/serve/main.go index ef94b998..056c6b1b 100644 --- a/internal/cmd/serve/main.go +++ b/internal/cmd/serve/main.go @@ -162,19 +162,20 @@ func ReadPublicKey(path string, u user.Issuer) (*rsa.PublicKey, error) { } // GetAllowedAccessTypes will return all allowed access types in Soteria. -func GetAllowedAccessTypes(accessTypes []string) ([]acl.AccessType, error) { +func (s Serve) GetAllowedAccessTypes(accessTypes []string) []acl.AccessType { allowedAccessTypes := make([]acl.AccessType, 0, len(accessTypes)) for _, a := range accessTypes { at, err := toUserAccessType(a) if err != nil { - return nil, fmt.Errorf("could not convert %s: %w", at, err) + err = fmt.Errorf("could not convert %s: %w", at, err) + s.Logger.Fatal("error while getting allowed access types", zap.Error(err)) } allowedAccessTypes = append(allowedAccessTypes, at) } - return allowedAccessTypes, nil + return allowedAccessTypes } // toUserAccessType will convert string access type to it's own type. From 4bf32e531e132b0393bec86f40a9967e1d12df20 Mon Sep 17 00:00:00 2001 From: Mohammadmehdi Teymorian Date: Tue, 26 Jul 2022 10:37:56 +0430 Subject: [PATCH 222/660] feat: return public keys map --- internal/cmd/serve/main.go | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/internal/cmd/serve/main.go b/internal/cmd/serve/main.go index 056c6b1b..509c5606 100644 --- a/internal/cmd/serve/main.go +++ b/internal/cmd/serve/main.go @@ -120,7 +120,7 @@ func HIDManager(driverSalt string, driverHashLength int, passengerSalt string, p } } -func (s Serve) ReadKeys(path string) (*rsa.PublicKey, *rsa.PublicKey) { +func (s Serve) PublicKeys(path string) map[user.Issuer]*rsa.PublicKey { driverPublicKey, err := ReadPublicKey(path, user.Driver) if err != nil { s.Logger.Fatal("could not read driver public key") @@ -131,7 +131,10 @@ func (s Serve) ReadKeys(path string) (*rsa.PublicKey, *rsa.PublicKey) { s.Logger.Fatal("could not read passenger public key") } - return driverPublicKey, passengerPublicKey + return map[user.Issuer]*rsa.PublicKey{ + user.Driver: driverPublicKey, + user.Passenger: passengerPublicKey, + } } // ReadPrivateKey will read and return private key that is used for JWT encryption. From 4d5e21d8db030893bec30c6f30833cbe436fbbfe Mon Sep 17 00:00:00 2001 From: Mohammadmehdi Teymorian Date: Tue, 26 Jul 2022 10:38:19 +0430 Subject: [PATCH 223/660] feat: add all vendors authenticators --- internal/cmd/serve/main.go | 45 ++++++++++---------------------------- 1 file changed, 12 insertions(+), 33 deletions(-) diff --git a/internal/cmd/serve/main.go b/internal/cmd/serve/main.go index 509c5606..ba7b727a 100644 --- a/internal/cmd/serve/main.go +++ b/internal/cmd/serve/main.go @@ -53,40 +53,19 @@ func (s Serve) main() { func (s Serve) Authenticators() map[string]*authenticator.Authenticator { all := make(map[string]*authenticator.Authenticator) - publicKey0, err := s.Cfg.ReadPublicKey(user.Driver) - if err != nil { - s.Logger.Fatal("could not read driver public key") - } - - publicKey1, err := s.Cfg.ReadPublicKey(user.Passenger) - if err != nil { - s.Logger.Fatal("could not read passenger public key") - } - - hid := &snappids.HashIDSManager{ - Salts: map[snappids.Audience]string{ - snappids.DriverAudience: s.Cfg.DriverSalt, - snappids.PassengerAudience: s.Cfg.PassengerSalt, - }, - Lengths: map[snappids.Audience]int{ - snappids.DriverAudience: s.Cfg.DriverHashLength, - snappids.PassengerAudience: s.Cfg.PassengerHashLength, - }, - } - - allowedAccessTypes, err := s.Cfg.GetAllowedAccessTypes() - if err != nil { - s.Logger.Fatal("error while getting allowed access types", zap.Error(err)) - } + for _, vendor := range s.Cfg.Vendors { + publicKeys := s.PublicKeys(vendor.JWT.Path) + hid := HIDManager(vendor.DriverSalt, vendor.DriverHashLength, vendor.PassengerSalt, vendor.PassengerHashLength) + allowedAccessTypes := s.GetAllowedAccessTypes(vendor.AllowedAccessTypes) + + auth := &authenticator.Authenticator{ + PublicKeys: publicKeys, + AllowedAccessTypes: allowedAccessTypes, + Company: vendor.Company, + TopicManager: topics.NewTopicManager(vendor.Topics, hid, vendor.Company), + } - all[authenticator.DefaultVendor] = &authenticator.Authenticator{ - PublicKeys: map[user.Issuer]*rsa.PublicKey{ - user.Driver: publicKey0, - user.Passenger: publicKey1, - }, - AllowedAccessTypes: allowedAccessTypes, - Company: s.Cfg.Company, - TopicManager: topics.NewTopicManager(s.Cfg.Topics, hid, s.Cfg.Company), + all[vendor.Company] = auth } return all From deb624c257496fa49f9772c0e49e9275ebe6b51a Mon Sep 17 00:00:00 2001 From: Mohammadmehdi Teymorian Date: Tue, 26 Jul 2022 11:06:17 +0430 Subject: [PATCH 224/660] refactor: improve code readability --- internal/cmd/serve/main.go | 32 ++++++++++++++++---------------- internal/config/config.go | 2 +- 2 files changed, 17 insertions(+), 17 deletions(-) diff --git a/internal/cmd/serve/main.go b/internal/cmd/serve/main.go index ba7b727a..231a5f70 100644 --- a/internal/cmd/serve/main.go +++ b/internal/cmd/serve/main.go @@ -50,11 +50,26 @@ func (s Serve) main() { } } +// Register serve command. +func (s Serve) Register(root *cobra.Command) { + root.AddCommand( + // nolint: exhaustruct + &cobra.Command{ + Use: "serve", + Short: "serve runs the application", + Long: `serve will run Soteria ReST server and waits until user disrupts.`, + Run: func(cmd *cobra.Command, args []string) { + s.main() + }, + }, + ) +} + func (s Serve) Authenticators() map[string]*authenticator.Authenticator { all := make(map[string]*authenticator.Authenticator) for _, vendor := range s.Cfg.Vendors { - publicKeys := s.PublicKeys(vendor.JWT.Path) + publicKeys := s.PublicKeys(vendor.JWT) hid := HIDManager(vendor.DriverSalt, vendor.DriverHashLength, vendor.PassengerSalt, vendor.PassengerHashLength) allowedAccessTypes := s.GetAllowedAccessTypes(vendor.AllowedAccessTypes) @@ -71,21 +86,6 @@ func (s Serve) Authenticators() map[string]*authenticator.Authenticator { return all } -// Register serve command. -func (s Serve) Register(root *cobra.Command) { - root.AddCommand( - // nolint: exhaustruct - &cobra.Command{ - Use: "serve", - Short: "serve runs the application", - Long: `serve will run Soteria ReST server and waits until user disrupts.`, - Run: func(cmd *cobra.Command, args []string) { - s.main() - }, - }, - ) -} - func HIDManager(driverSalt string, driverHashLength int, passengerSalt string, passengerHashLength int) *snappids.HashIDSManager { return &snappids.HashIDSManager{ Salts: map[snappids.Audience]string{ diff --git a/internal/config/config.go b/internal/config/config.go index f3b43d86..52559f74 100644 --- a/internal/config/config.go +++ b/internal/config/config.go @@ -41,7 +41,7 @@ type ( DriverHashLength int `koanf:"driver_hash_length"` PassengerSalt string `koanf:"passenger_salt"` DriverSalt string `koanf:"driver_salt"` - JWT *JWT `koanf:"jwt"` + JWT string `koanf:"jwt"` Company string `koanf:"company"` Topics []topics.Topic `koanf:"topics"` } From c495caf599cd61cac74e8f56c346e322f5f44ce4 Mon Sep 17 00:00:00 2001 From: Mohammadmehdi Teymorian Date: Tue, 26 Jul 2022 11:08:27 +0430 Subject: [PATCH 225/660] feat: update default config --- internal/config/default.go | 28 +++++++++++++++++----------- 1 file changed, 17 insertions(+), 11 deletions(-) diff --git a/internal/config/default.go b/internal/config/default.go index 1d531a93..d4d10433 100644 --- a/internal/config/default.go +++ b/internal/config/default.go @@ -17,16 +17,8 @@ const ( // nolint: funlen, gomnd func Default() Config { return Config{ - AllowedAccessTypes: []string{ - "pub", - "sub", - }, - PassengerHashLength: DefaultPassengerHashLength, - DriverHashLength: DefaultDriverHashLength, - PassengerSalt: "secret", - DriverSalt: "secret", - JWT: &JWT{ - Path: "test/", + Vendors: []Vendor{ + snappVendor(), }, Logger: logger.Config{ Level: "warn", @@ -40,7 +32,21 @@ func Default() Config { Port: "6831", }, }, - Company: "snapp", + } +} + +func snappVendor() Vendor { + return Vendor{ + AllowedAccessTypes: []string{ + "pub", + "sub", + }, + PassengerHashLength: DefaultPassengerHashLength, + DriverHashLength: DefaultDriverHashLength, + PassengerSalt: "secret", + DriverSalt: "secret", + JWT: "test/", + Company: "snapp", Topics: []topics.Topic{ { Type: topics.CabEvent, From daadd861b6f26db9458884215d8d261c0e3c97af Mon Sep 17 00:00:00 2001 From: Mohammadmehdi Teymorian Date: Tue, 26 Jul 2022 11:12:03 +0430 Subject: [PATCH 226/660] feat: fix lint issues --- internal/authenticator/authenticator_test.go | 4 ++-- internal/cmd/serve/main.go | 7 ++++++- internal/config/default.go | 7 ++++--- internal/topics/manager_test.go | 2 +- 4 files changed, 13 insertions(+), 7 deletions(-) diff --git a/internal/authenticator/authenticator_test.go b/internal/authenticator/authenticator_test.go index 087bcea1..bcc25ac4 100644 --- a/internal/authenticator/authenticator_test.go +++ b/internal/authenticator/authenticator_test.go @@ -118,7 +118,7 @@ func (suite *AuthenticatorTestSuite) SetupSuite() { }, AllowedAccessTypes: []acl.AccessType{acl.Pub, acl.Sub, acl.PubSub}, Company: "snapp", - TopicManager: topics.NewTopicManager(config.Default().Topics, hid, "snapp"), + TopicManager: topics.NewTopicManager(config.SnappVendor().Topics, hid, "snapp"), } } @@ -348,7 +348,7 @@ func TestAuthenticator_ValidateTopicBySender(t *testing.T) { }, } - cfg := config.New() + cfg := config.SnappVendor() // nolint: exhaustruct authenticator := authenticator.Authenticator{ diff --git a/internal/cmd/serve/main.go b/internal/cmd/serve/main.go index 231a5f70..8ff3fb0a 100644 --- a/internal/cmd/serve/main.go +++ b/internal/cmd/serve/main.go @@ -86,7 +86,12 @@ func (s Serve) Authenticators() map[string]*authenticator.Authenticator { return all } -func HIDManager(driverSalt string, driverHashLength int, passengerSalt string, passengerHashLength int) *snappids.HashIDSManager { +func HIDManager( + driverSalt string, + driverHashLength int, + passengerSalt string, + passengerHashLength int, +) *snappids.HashIDSManager { return &snappids.HashIDSManager{ Salts: map[snappids.Audience]string{ snappids.DriverAudience: driverSalt, diff --git a/internal/config/default.go b/internal/config/default.go index d4d10433..1a599a0c 100644 --- a/internal/config/default.go +++ b/internal/config/default.go @@ -14,11 +14,11 @@ const ( ) // Default return default configuration. -// nolint: funlen, gomnd +// nolint: gomnd func Default() Config { return Config{ Vendors: []Vendor{ - snappVendor(), + SnappVendor(), }, Logger: logger.Config{ Level: "warn", @@ -35,7 +35,8 @@ func Default() Config { } } -func snappVendor() Vendor { +//nolint:funlen +func SnappVendor() Vendor { return Vendor{ AllowedAccessTypes: []string{ "pub", diff --git a/internal/topics/manager_test.go b/internal/topics/manager_test.go index a0426140..3d12abd9 100644 --- a/internal/topics/manager_test.go +++ b/internal/topics/manager_test.go @@ -130,7 +130,7 @@ func TestTopic_GetType(t *testing.T) { }, } - cfg := config.New() + cfg := config.SnappVendor() hid := &snappids.HashIDSManager{ Salts: map[snappids.Audience]string{ From 027d08e8160f5108a0355fe760ef370b48d67c0f Mon Sep 17 00:00:00 2001 From: Mohammadmehdi Teymorian Date: Tue, 26 Jul 2022 14:48:36 +0430 Subject: [PATCH 227/660] refactor: fix typo --- internal/cmd/serve/main.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/cmd/serve/main.go b/internal/cmd/serve/main.go index 8ff3fb0a..f6ea4c64 100644 --- a/internal/cmd/serve/main.go +++ b/internal/cmd/serve/main.go @@ -121,7 +121,7 @@ func (s Serve) PublicKeys(path string) map[user.Issuer]*rsa.PublicKey { } } -// ReadPrivateKey will read and return private key that is used for JWT encryption. +// ReadPublicKey will read and return private key that is used for JWT encryption. // nolint: wrapcheck, goerr113 func ReadPublicKey(path string, u user.Issuer) (*rsa.PublicKey, error) { var fileName string From a07251097cde4c4ebbbbf3ece0452fabd81e5808 Mon Sep 17 00:00:00 2001 From: Mohammadmehdi Teymorian Date: Tue, 26 Jul 2022 15:00:06 +0430 Subject: [PATCH 228/660] feat: add snapp vendor configs --- deployments/soteria/values.yaml | 72 +++++++++++++++++++++++++++++++++ 1 file changed, 72 insertions(+) diff --git a/deployments/soteria/values.yaml b/deployments/soteria/values.yaml index fd6d98b3..341a01bc 100644 --- a/deployments/soteria/values.yaml +++ b/deployments/soteria/values.yaml @@ -138,3 +138,75 @@ topics: accesses: driver: '1' passenger: '1' + +snapp: + company: "snapp" + jwt: "/jwt_pems/" + driver_salt: "secret" + passenger_salt: "secret" + driver_hash_length: 15 + passenger_hash_length: 15 + allowed_access_types: [ "pub", "sub" ] + topics: + - type: cab_event + template: ^{{.audience}}-event-{{.hashId}}$ + hash_type: 1 + accesses: + driver: '1' + passenger: '1' + - type: driver_location + template: ^{{.company}}/driver/{{.hashId}}/location$ + hash_type: 0 + accesses: + driver: '2' + passenger: '-1' + - type: passenger_location + template: ^{{.company}}/passenger/{{.hashId}}/location$ + hash_type: 0 + accesses: + driver: '2' + passenger: '2' + - type: superapp_event + template: ^{{.company}}/{{.audience}}/{{.hashId}}/superapp$ + hash_type: 0 + accesses: + driver: '1' + passenger: '1' + - type: box_event + template: ^bucks$ + hash_type: 0 + accesses: + driver: '-1' + passenger: '-1' + - type: shared_location + template: ^{{.company}}/{{.audience}}/{{.hashId}}/{{.peer}}-location$ + hash_type: 0 + accesses: + driver: '1' + passenger: '1' + - type: chat + template: ^{{.company}}/{{.audience}}/{{.hashId}}/chat$ + hash_type: 0 + accesses: + driver: '1' + passenger: '1' + - type: general_call_entry + template: ^shared/{{.company}}/{{.audience}}/{{.hashId}}/call/send$ + hash_type: 0 + accesses: + driver: '2' + passenger: '2' + - type: node_call_entry + template: ^{{.company}}/{{.audience}}/{{.hashId}}/call/[a-zA-Z0-9-_]+/send$ + hash_type: 0 + accesses: + driver: '2' + passenger: '2' + - type: call_outgoing + template: ^{{.company}}/{{.audience}}/{{.hashId}}/call/receive$ + hash_type: 0 + accesses: + driver: '1' + passenger: '1' + + From 81082dc43c7fc26dce2844f3ee638038bed95565 Mon Sep 17 00:00:00 2001 From: Mohammadmehdi Teymorian Date: Tue, 26 Jul 2022 15:19:12 +0430 Subject: [PATCH 229/660] feat: add configs to configmap --- deployments/soteria/templates/configmap.yaml | 31 +------ deployments/soteria/templates/deployment.yaml | 2 +- deployments/soteria/values.yaml | 89 +++---------------- 3 files changed, 17 insertions(+), 105 deletions(-) diff --git a/deployments/soteria/templates/configmap.yaml b/deployments/soteria/templates/configmap.yaml index 5dcffad8..01bd5313 100644 --- a/deployments/soteria/templates/configmap.yaml +++ b/deployments/soteria/templates/configmap.yaml @@ -8,31 +8,6 @@ metadata: {{- include "soteria.labels" . | nindent 4 }} data: config.yaml: | - {{ with .Values.envs.allowed_access_types }} - allowed_access_types: - {{ toYaml . | nindent 8 }} - {{ end }} - passenger_hash_length: {{ .Values.authEnvs.passenger_hash_length }} - driver_hash_length: {{ .Values.authEnvs.driver_hash_length }} - passenger_salt: {{ .Values.authEnvs.passenger_salt }} - driver_salt: {{ .Values.authEnvs.driver_salt }} - jwt: - path: {{ .Values.authEnvs.jwt_keys_path }} - logger: - level: {{ .Values.envs.logger_level }} - http_port: 9999 - {{ with .Values.envs.tracer }} - tracer: - enabled: {{ .enabled }} - ratio: {{ .ratio }} - agent: - host: {{ .host }} - port: {{ .port }} - {{ end }} - {{ with .Values.envs.company }} - company: {{ . }} - {{ end }} - {{ with .Values.topics }} - topics: - {{ toYaml . | nindent 8 }} - {{ end }} + {{- toYaml .Values.config | nindent 4}} + vendors: + - {{- toYaml .Values.snapp | nindent 8}} \ No newline at end of file diff --git a/deployments/soteria/templates/deployment.yaml b/deployments/soteria/templates/deployment.yaml index 64a27481..225804bf 100644 --- a/deployments/soteria/templates/deployment.yaml +++ b/deployments/soteria/templates/deployment.yaml @@ -72,7 +72,7 @@ spec: readOnly: true {{- range $key, $value := .Values.jwtKeys }} - name: {{ include "soteria.fullname" $ }}-jwt-keys - mountPath: "{{ $.Values.authEnvs.jwt_keys_path }}{{ $key }}" + mountPath: "{{ $.Values.config.jwt }}{{ $key }}" subPath: {{ $key }} readOnly: true {{ end }} diff --git a/deployments/soteria/values.yaml b/deployments/soteria/values.yaml index 341a01bc..93e6fc7d 100644 --- a/deployments/soteria/values.yaml +++ b/deployments/soteria/values.yaml @@ -44,7 +44,7 @@ serviceMonitor: enabled: false jwtKeys: - 0.pem: |- + snapp-0.pem: |- -----BEGIN PUBLIC KEY----- MIIBITANBgkqhkiG9w0BAQEFAAOCAQ4AMIIBCQKCAQBk7O6M5p4eYNAwtVU2beGa W4mhFG94OtYUWDl1E7UUrhUNGf97Eb/45NjQszu0YPERnApJc2RUm2TrS7iq0mHz @@ -54,7 +54,7 @@ jwtKeys: TSv4UAN20lsBDejpnGEZKJrxHZ56gHgaJn6PKKCD6ItJA7y7iraCdBhCfAIUIz/z AgMBAAE= -----END PUBLIC KEY----- - 1.pem: |- + snapp-1.pem: |- -----BEGIN PUBLIC KEY----- MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA1lNRwyNsDieWs6LvHOJ+ GyehhRC4Pn5yL5edKP3565F3LtRDMrkzwDRsQbqnUtTea9HCdTdBv+lI8vE17qRi @@ -65,83 +65,20 @@ jwtKeys: zQIDAQAB -----END PUBLIC KEY----- -authEnvs: - jwt_keys_path: "/jwt_pems/" - driver_salt: "secret" - passenger_salt: "secret" - driver_hash_length: 15 - passenger_hash_length: 15 - -envs: - allowed_access_types: [ "pub", "sub" ] - # company: "baly" - logger_level: "warn" - -topics: - - type: cab_event - template: ^{{.audience}}-event-{{.hashId}}$ - hash_type: 1 - accesses: - driver: '1' - passenger: '1' - - type: driver_location - template: ^{{.company}}/driver/{{.hashId}}/location$ - hash_type: 0 - accesses: - driver: '2' - passenger: '-1' - - type: passenger_location - template: ^{{.company}}/passenger/{{.hashId}}/location$ - hash_type: 0 - accesses: - driver: '2' - passenger: '2' - - type: superapp_event - template: ^{{.company}}/{{.audience}}/{{.hashId}}/superapp$ - hash_type: 0 - accesses: - driver: '1' - passenger: '1' - - type: box_event - template: ^bucks$ - hash_type: 0 - accesses: - driver: '-1' - passenger: '-1' - - type: shared_location - template: ^{{.company}}/{{.audience}}/{{.hashId}}/{{.peer}}-location$ - hash_type: 0 - accesses: - driver: '1' - passenger: '1' - - type: chat - template: ^{{.company}}/{{.audience}}/{{.hashId}}/chat$ - hash_type: 0 - accesses: - driver: '1' - passenger: '1' - - type: general_call_entry - template: ^shared/{{.company}}/{{.audience}}/{{.hashId}}/call/send$ - hash_type: 0 - accesses: - driver: '2' - passenger: '2' - - type: node_call_entry - template: ^{{.company}}/{{.audience}}/{{.hashId}}/call/[a-zA-Z0-9-_]+/send$ - hash_type: 0 - accesses: - driver: '2' - passenger: '2' - - type: call_outgoing - template: ^{{.company}}/{{.audience}}/{{.hashId}}/call/receive$ - hash_type: 0 - accesses: - driver: '1' - passenger: '1' +config: + jwt: "/jwt_pems/" + http_port: 9999 + logger: + level: "warn" + tracer: + enabled: false + ratio: 0.1 + agent: + host: 127.0.0.1 + port: 6831 snapp: company: "snapp" - jwt: "/jwt_pems/" driver_salt: "secret" passenger_salt: "secret" driver_hash_length: 15 From 8845546b922fc7644911c6d19cdfe1e684865efc Mon Sep 17 00:00:00 2001 From: Mohammadmehdi Teymorian Date: Tue, 26 Jul 2022 15:21:14 +0430 Subject: [PATCH 230/660] feat: add jwt path to root config --- internal/config/config.go | 6 +----- internal/config/default.go | 2 +- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/internal/config/config.go b/internal/config/config.go index 52559f74..51b3802c 100644 --- a/internal/config/config.go +++ b/internal/config/config.go @@ -24,17 +24,13 @@ const ( type ( // Config is the main container of Soteria's config. Config struct { + JWT string `koanf:"jwt"` Vendors []Vendor `koanf:"vendors"` Logger logger.Config `koanf:"logger"` HTTPPort int `koanf:"http_port"` Tracer tracing.Config `koanf:"tracer"` } - // JWt contains path of the keys for JWT encryption. - JWT struct { - Path string `koanf:"path"` - } - Vendor struct { AllowedAccessTypes []string `koanf:"allowed_access_types"` PassengerHashLength int `koanf:"passenger_hash_length"` diff --git a/internal/config/default.go b/internal/config/default.go index 1a599a0c..b7d7d470 100644 --- a/internal/config/default.go +++ b/internal/config/default.go @@ -17,6 +17,7 @@ const ( // nolint: gomnd func Default() Config { return Config{ + JWT: "test/", Vendors: []Vendor{ SnappVendor(), }, @@ -46,7 +47,6 @@ func SnappVendor() Vendor { DriverHashLength: DefaultDriverHashLength, PassengerSalt: "secret", DriverSalt: "secret", - JWT: "test/", Company: "snapp", Topics: []topics.Topic{ { From ba750aa1c769f143fd11c2f40c241d745b90a7b6 Mon Sep 17 00:00:00 2001 From: Mohammadmehdi Teymorian Date: Tue, 26 Jul 2022 15:23:37 +0430 Subject: [PATCH 231/660] feat: read pems with company names --- internal/cmd/serve/main.go | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/internal/cmd/serve/main.go b/internal/cmd/serve/main.go index f6ea4c64..6f7eae27 100644 --- a/internal/cmd/serve/main.go +++ b/internal/cmd/serve/main.go @@ -69,7 +69,7 @@ func (s Serve) Authenticators() map[string]*authenticator.Authenticator { all := make(map[string]*authenticator.Authenticator) for _, vendor := range s.Cfg.Vendors { - publicKeys := s.PublicKeys(vendor.JWT) + publicKeys := s.PublicKeys(s.Cfg.JWT, vendor.Company) hid := HIDManager(vendor.DriverSalt, vendor.DriverHashLength, vendor.PassengerSalt, vendor.PassengerHashLength) allowedAccessTypes := s.GetAllowedAccessTypes(vendor.AllowedAccessTypes) @@ -104,13 +104,13 @@ func HIDManager( } } -func (s Serve) PublicKeys(path string) map[user.Issuer]*rsa.PublicKey { - driverPublicKey, err := ReadPublicKey(path, user.Driver) +func (s Serve) PublicKeys(path, company string) map[user.Issuer]*rsa.PublicKey { + driverPublicKey, err := ReadPublicKey(path, company, user.Driver) if err != nil { s.Logger.Fatal("could not read driver public key") } - passengerPublicKey, err := ReadPublicKey(path, user.Passenger) + passengerPublicKey, err := ReadPublicKey(path, company, user.Passenger) if err != nil { s.Logger.Fatal("could not read passenger public key") } @@ -123,14 +123,14 @@ func (s Serve) PublicKeys(path string) map[user.Issuer]*rsa.PublicKey { // ReadPublicKey will read and return private key that is used for JWT encryption. // nolint: wrapcheck, goerr113 -func ReadPublicKey(path string, u user.Issuer) (*rsa.PublicKey, error) { +func ReadPublicKey(path, company string, u user.Issuer) (*rsa.PublicKey, error) { var fileName string switch u { // nolint:exhaustive case user.Driver: - fileName = fmt.Sprintf("%s%s", path, "0.pem") + fileName = fmt.Sprintf("%s%s%s", path, company, "0.pem") case user.Passenger: - fileName = fmt.Sprintf("%s%s", path, "1.pem") + fileName = fmt.Sprintf("%s%s%s", path, company, "1.pem") default: return nil, errors.New("invalid issuer, public key not found") } From 669c28ab01841d0d8f479424ba735dcb835452ba Mon Sep 17 00:00:00 2001 From: Mohammadmehdi Teymorian Date: Tue, 26 Jul 2022 15:24:25 +0430 Subject: [PATCH 232/660] feat: update pems names --- test/{0.pem => snapp-0.pem} | 0 test/{0.private.pem => snapp-0.private.pem} | 0 test/{1.pem => snapp-1.pem} | 0 test/{1.private.pem => snapp-1.private.pem} | 0 4 files changed, 0 insertions(+), 0 deletions(-) rename test/{0.pem => snapp-0.pem} (100%) rename test/{0.private.pem => snapp-0.private.pem} (100%) rename test/{1.pem => snapp-1.pem} (100%) rename test/{1.private.pem => snapp-1.private.pem} (100%) diff --git a/test/0.pem b/test/snapp-0.pem similarity index 100% rename from test/0.pem rename to test/snapp-0.pem diff --git a/test/0.private.pem b/test/snapp-0.private.pem similarity index 100% rename from test/0.private.pem rename to test/snapp-0.private.pem diff --git a/test/1.pem b/test/snapp-1.pem similarity index 100% rename from test/1.pem rename to test/snapp-1.pem diff --git a/test/1.private.pem b/test/snapp-1.private.pem similarity index 100% rename from test/1.private.pem rename to test/snapp-1.private.pem From 8fd90b2c036d5b861f1efb4a2d71d1af58969986 Mon Sep 17 00:00:00 2001 From: Mohammadmehdi Teymorian Date: Tue, 26 Jul 2022 16:01:30 +0430 Subject: [PATCH 233/660] feat: add vendors for configmap --- deployments/soteria/templates/configmap.yaml | 6 +- deployments/soteria/values.yaml | 157 +++++++++++-------- 2 files changed, 94 insertions(+), 69 deletions(-) diff --git a/deployments/soteria/templates/configmap.yaml b/deployments/soteria/templates/configmap.yaml index 01bd5313..b430d367 100644 --- a/deployments/soteria/templates/configmap.yaml +++ b/deployments/soteria/templates/configmap.yaml @@ -10,4 +10,8 @@ data: config.yaml: | {{- toYaml .Values.config | nindent 4}} vendors: - - {{- toYaml .Values.snapp | nindent 8}} \ No newline at end of file + {{- range $key, $value := .Values.vendors}} + {{- if $value}} + - {{- toYaml $value | nindent 8}} + {{- end}} + {{- end}} diff --git a/deployments/soteria/values.yaml b/deployments/soteria/values.yaml index 93e6fc7d..02964044 100644 --- a/deployments/soteria/values.yaml +++ b/deployments/soteria/values.yaml @@ -77,73 +77,94 @@ config: host: 127.0.0.1 port: 6831 -snapp: - company: "snapp" - driver_salt: "secret" - passenger_salt: "secret" - driver_hash_length: 15 - passenger_hash_length: 15 - allowed_access_types: [ "pub", "sub" ] - topics: - - type: cab_event - template: ^{{.audience}}-event-{{.hashId}}$ - hash_type: 1 - accesses: - driver: '1' - passenger: '1' - - type: driver_location - template: ^{{.company}}/driver/{{.hashId}}/location$ - hash_type: 0 - accesses: - driver: '2' - passenger: '-1' - - type: passenger_location - template: ^{{.company}}/passenger/{{.hashId}}/location$ - hash_type: 0 - accesses: - driver: '2' - passenger: '2' - - type: superapp_event - template: ^{{.company}}/{{.audience}}/{{.hashId}}/superapp$ - hash_type: 0 - accesses: - driver: '1' - passenger: '1' - - type: box_event - template: ^bucks$ - hash_type: 0 - accesses: - driver: '-1' - passenger: '-1' - - type: shared_location - template: ^{{.company}}/{{.audience}}/{{.hashId}}/{{.peer}}-location$ - hash_type: 0 - accesses: - driver: '1' - passenger: '1' - - type: chat - template: ^{{.company}}/{{.audience}}/{{.hashId}}/chat$ - hash_type: 0 - accesses: - driver: '1' - passenger: '1' - - type: general_call_entry - template: ^shared/{{.company}}/{{.audience}}/{{.hashId}}/call/send$ - hash_type: 0 - accesses: - driver: '2' - passenger: '2' - - type: node_call_entry - template: ^{{.company}}/{{.audience}}/{{.hashId}}/call/[a-zA-Z0-9-_]+/send$ - hash_type: 0 - accesses: - driver: '2' - passenger: '2' - - type: call_outgoing - template: ^{{.company}}/{{.audience}}/{{.hashId}}/call/receive$ - hash_type: 0 - accesses: - driver: '1' - passenger: '1' +vendors: + snapp: + company: "snapp" + driver_salt: "secret" + passenger_salt: "secret" + driver_hash_length: 15 + passenger_hash_length: 15 + allowed_access_types: [ "pub", "sub" ] + topics: + - type: cab_event + template: ^{{.audience}}-event-{{.hashId}}$ + hash_type: 1 + accesses: + driver: '1' + passenger: '1' + - type: driver_location + template: ^{{.company}}/driver/{{.hashId}}/location$ + hash_type: 0 + accesses: + driver: '2' + passenger: '-1' + - type: passenger_location + template: ^{{.company}}/passenger/{{.hashId}}/location$ + hash_type: 0 + accesses: + driver: '2' + passenger: '2' + - type: superapp_event + template: ^{{.company}}/{{.audience}}/{{.hashId}}/superapp$ + hash_type: 0 + accesses: + driver: '1' + passenger: '1' + - type: box_event + template: ^bucks$ + hash_type: 0 + accesses: + driver: '-1' + passenger: '-1' + - type: shared_location + template: ^{{.company}}/{{.audience}}/{{.hashId}}/{{.peer}}-location$ + hash_type: 0 + accesses: + driver: '1' + passenger: '1' + - type: chat + template: ^{{.company}}/{{.audience}}/{{.hashId}}/chat$ + hash_type: 0 + accesses: + driver: '1' + passenger: '1' + - type: general_call_entry + template: ^shared/{{.company}}/{{.audience}}/{{.hashId}}/call/send$ + hash_type: 0 + accesses: + driver: '2' + passenger: '2' + - type: node_call_entry + template: ^{{.company}}/{{.audience}}/{{.hashId}}/call/[a-zA-Z0-9-_]+/send$ + hash_type: 0 + accesses: + driver: '2' + passenger: '2' + - type: call_outgoing + template: ^{{.company}}/{{.audience}}/{{.hashId}}/call/receive$ + hash_type: 0 + accesses: + driver: '1' + passenger: '1' + passenger_key: |- + -----BEGIN PUBLIC KEY----- + MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA1lNRwyNsDieWs6LvHOJ+ + GyehhRC4Pn5yL5edKP3565F3LtRDMrkzwDRsQbqnUtTea9HCdTdBv+lI8vE17qRi + RQn10IMaIH6e4Aa3OWNClFhuqNOag7VmffsjTOgxHgHpfGAKVF/4BwqOHrdHFbAD + VOiWB1hv9Uc0C5laffGAub7fj+EAI02zlrsNDxYW8vyF2H47N7VWcvgd3RhZpxlG + 8bq9phl7Ja55YmQiT2Ic3/K5tsazg5z9lz6OTrx+JvWbefHFlJpjCLz5yefEaRmX + 9L/zyDMi4jgFTZEWNXC2vIrxwZMFwFhBXEp0PcCbuHJgJIucbRrbwukQC16uHJwP + zQIDAQAB + -----END PUBLIC KEY----- + driver_key: |- + -----BEGIN PUBLIC KEY----- + MIIBITANBgkqhkiG9w0BAQEFAAOCAQ4AMIIBCQKCAQBk7O6M5p4eYNAwtVU2beGa + W4mhFG94OtYUWDl1E7UUrhUNGf97Eb/45NjQszu0YPERnApJc2RUm2TrS7iq0mHz + Xbwf+CbNF54Q5mjuHcpBKgvFwUUSCCYBftmRc4xbFIH4Oh3nHC2GeukUS9TmJwjM + tJKyU0Ve8BK5BgjhagM7XSs+scE2mxemoWtcs6mJLtBuEgRGMgHW00mSdOcLp/+l + oHpSzRYN92/DomwmmjGVy8Ji0faeHx+r79ZzE0E8Rcc29Yhrg1ymrjfkXg98WjAb + TSv4UAN20lsBDejpnGEZKJrxHZ56gHgaJn6PKKCD6ItJA7y7iraCdBhCfAIUIz/z + AgMBAAE= + -----END PUBLIC KEY----- From d202830ca2c98c760ea07146317cb504b0d34dfb Mon Sep 17 00:00:00 2001 From: Mohammadmehdi Teymorian Date: Tue, 26 Jul 2022 16:03:12 +0430 Subject: [PATCH 234/660] feat: remove jwt pem files --- deployments/soteria/templates/deployment.yaml | 9 -------- deployments/soteria/values.yaml | 23 ------------------- 2 files changed, 32 deletions(-) diff --git a/deployments/soteria/templates/deployment.yaml b/deployments/soteria/templates/deployment.yaml index 225804bf..664005e3 100644 --- a/deployments/soteria/templates/deployment.yaml +++ b/deployments/soteria/templates/deployment.yaml @@ -70,20 +70,11 @@ spec: mountPath: "/app/config.yml" subPath: "config.yaml" readOnly: true - {{- range $key, $value := .Values.jwtKeys }} - - name: {{ include "soteria.fullname" $ }}-jwt-keys - mountPath: "{{ $.Values.config.jwt }}{{ $key }}" - subPath: {{ $key }} - readOnly: true - {{ end }} volumes: - name: configuration configMap: defaultMode: 0440 name: {{ include "soteria.fullname" . }} - - name: {{ include "soteria.fullname" . }}-jwt-keys - secret: - secretName: {{ include "soteria.fullname" . }}-jwt-keys dnsPolicy: ClusterFirst restartPolicy: Always terminationGracePeriodSeconds: 30 diff --git a/deployments/soteria/values.yaml b/deployments/soteria/values.yaml index 02964044..216b1e86 100644 --- a/deployments/soteria/values.yaml +++ b/deployments/soteria/values.yaml @@ -43,30 +43,7 @@ rollingParams: serviceMonitor: enabled: false -jwtKeys: - snapp-0.pem: |- - -----BEGIN PUBLIC KEY----- - MIIBITANBgkqhkiG9w0BAQEFAAOCAQ4AMIIBCQKCAQBk7O6M5p4eYNAwtVU2beGa - W4mhFG94OtYUWDl1E7UUrhUNGf97Eb/45NjQszu0YPERnApJc2RUm2TrS7iq0mHz - Xbwf+CbNF54Q5mjuHcpBKgvFwUUSCCYBftmRc4xbFIH4Oh3nHC2GeukUS9TmJwjM - tJKyU0Ve8BK5BgjhagM7XSs+scE2mxemoWtcs6mJLtBuEgRGMgHW00mSdOcLp/+l - oHpSzRYN92/DomwmmjGVy8Ji0faeHx+r79ZzE0E8Rcc29Yhrg1ymrjfkXg98WjAb - TSv4UAN20lsBDejpnGEZKJrxHZ56gHgaJn6PKKCD6ItJA7y7iraCdBhCfAIUIz/z - AgMBAAE= - -----END PUBLIC KEY----- - snapp-1.pem: |- - -----BEGIN PUBLIC KEY----- - MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA1lNRwyNsDieWs6LvHOJ+ - GyehhRC4Pn5yL5edKP3565F3LtRDMrkzwDRsQbqnUtTea9HCdTdBv+lI8vE17qRi - RQn10IMaIH6e4Aa3OWNClFhuqNOag7VmffsjTOgxHgHpfGAKVF/4BwqOHrdHFbAD - VOiWB1hv9Uc0C5laffGAub7fj+EAI02zlrsNDxYW8vyF2H47N7VWcvgd3RhZpxlG - 8bq9phl7Ja55YmQiT2Ic3/K5tsazg5z9lz6OTrx+JvWbefHFlJpjCLz5yefEaRmX - 9L/zyDMi4jgFTZEWNXC2vIrxwZMFwFhBXEp0PcCbuHJgJIucbRrbwukQC16uHJwP - zQIDAQAB - -----END PUBLIC KEY----- - config: - jwt: "/jwt_pems/" http_port: 9999 logger: level: "warn" From 09957068379235043ec942db1ff85fc6717f4d9b Mon Sep 17 00:00:00 2001 From: Mohammadmehdi Teymorian Date: Tue, 26 Jul 2022 16:08:32 +0430 Subject: [PATCH 235/660] feat: add users public keys to config --- internal/cmd/serve/main.go | 36 ++++-------------------------------- internal/config/config.go | 4 ++-- internal/config/default.go | 19 ++++++++++++++++++- 3 files changed, 24 insertions(+), 35 deletions(-) diff --git a/internal/cmd/serve/main.go b/internal/cmd/serve/main.go index 6f7eae27..9695f89d 100644 --- a/internal/cmd/serve/main.go +++ b/internal/cmd/serve/main.go @@ -4,7 +4,6 @@ import ( "crypto/rsa" "errors" "fmt" - "io/ioutil" "net/http" "os" "os/signal" @@ -69,7 +68,7 @@ func (s Serve) Authenticators() map[string]*authenticator.Authenticator { all := make(map[string]*authenticator.Authenticator) for _, vendor := range s.Cfg.Vendors { - publicKeys := s.PublicKeys(s.Cfg.JWT, vendor.Company) + publicKeys := s.PublicKeys(vendor.DriverKey, vendor.PassengerKey) hid := HIDManager(vendor.DriverSalt, vendor.DriverHashLength, vendor.PassengerSalt, vendor.PassengerHashLength) allowedAccessTypes := s.GetAllowedAccessTypes(vendor.AllowedAccessTypes) @@ -104,13 +103,13 @@ func HIDManager( } } -func (s Serve) PublicKeys(path, company string) map[user.Issuer]*rsa.PublicKey { - driverPublicKey, err := ReadPublicKey(path, company, user.Driver) +func (s Serve) PublicKeys(driverKey, passengerKey string) map[user.Issuer]*rsa.PublicKey { + driverPublicKey, err := jwt.ParseRSAPublicKeyFromPEM([]byte(driverKey)) if err != nil { s.Logger.Fatal("could not read driver public key") } - passengerPublicKey, err := ReadPublicKey(path, company, user.Passenger) + passengerPublicKey, err := jwt.ParseRSAPublicKeyFromPEM([]byte(passengerKey)) if err != nil { s.Logger.Fatal("could not read passenger public key") } @@ -121,33 +120,6 @@ func (s Serve) PublicKeys(path, company string) map[user.Issuer]*rsa.PublicKey { } } -// ReadPublicKey will read and return private key that is used for JWT encryption. -// nolint: wrapcheck, goerr113 -func ReadPublicKey(path, company string, u user.Issuer) (*rsa.PublicKey, error) { - var fileName string - - switch u { // nolint:exhaustive - case user.Driver: - fileName = fmt.Sprintf("%s%s%s", path, company, "0.pem") - case user.Passenger: - fileName = fmt.Sprintf("%s%s%s", path, company, "1.pem") - default: - return nil, errors.New("invalid issuer, public key not found") - } - - pem, err := ioutil.ReadFile(fileName) - if err != nil { - return nil, err - } - - publicKey, err := jwt.ParseRSAPublicKeyFromPEM(pem) - if err != nil { - return nil, err - } - - return publicKey, nil -} - // GetAllowedAccessTypes will return all allowed access types in Soteria. func (s Serve) GetAllowedAccessTypes(accessTypes []string) []acl.AccessType { allowedAccessTypes := make([]acl.AccessType, 0, len(accessTypes)) diff --git a/internal/config/config.go b/internal/config/config.go index 51b3802c..def1c7d8 100644 --- a/internal/config/config.go +++ b/internal/config/config.go @@ -24,7 +24,6 @@ const ( type ( // Config is the main container of Soteria's config. Config struct { - JWT string `koanf:"jwt"` Vendors []Vendor `koanf:"vendors"` Logger logger.Config `koanf:"logger"` HTTPPort int `koanf:"http_port"` @@ -37,9 +36,10 @@ type ( DriverHashLength int `koanf:"driver_hash_length"` PassengerSalt string `koanf:"passenger_salt"` DriverSalt string `koanf:"driver_salt"` - JWT string `koanf:"jwt"` Company string `koanf:"company"` Topics []topics.Topic `koanf:"topics"` + DriverKey string `koanf:"driver_key"` + PassengerKey string `koanf:"passenger_key"` } ) diff --git a/internal/config/default.go b/internal/config/default.go index b7d7d470..50b324dd 100644 --- a/internal/config/default.go +++ b/internal/config/default.go @@ -17,7 +17,6 @@ const ( // nolint: gomnd func Default() Config { return Config{ - JWT: "test/", Vendors: []Vendor{ SnappVendor(), }, @@ -140,5 +139,23 @@ func SnappVendor() Vendor { }, }, }, + DriverKey: `-----BEGIN PUBLIC KEY----- +MIIBITANBgkqhkiG9w0BAQEFAAOCAQ4AMIIBCQKCAQBk7O6M5p4eYNAwtVU2beGa +W4mhFG94OtYUWDl1E7UUrhUNGf97Eb/45NjQszu0YPERnApJc2RUm2TrS7iq0mHz +Xbwf+CbNF54Q5mjuHcpBKgvFwUUSCCYBftmRc4xbFIH4Oh3nHC2GeukUS9TmJwjM +tJKyU0Ve8BK5BgjhagM7XSs+scE2mxemoWtcs6mJLtBuEgRGMgHW00mSdOcLp/+l +oHpSzRYN92/DomwmmjGVy8Ji0faeHx+r79ZzE0E8Rcc29Yhrg1ymrjfkXg98WjAb +TSv4UAN20lsBDejpnGEZKJrxHZ56gHgaJn6PKKCD6ItJA7y7iraCdBhCfAIUIz/z +AgMBAAE= +-----END PUBLIC KEY-----`, + PassengerKey: `-----BEGIN PUBLIC KEY----- +MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA1lNRwyNsDieWs6LvHOJ+ +GyehhRC4Pn5yL5edKP3565F3LtRDMrkzwDRsQbqnUtTea9HCdTdBv+lI8vE17qRi +RQn10IMaIH6e4Aa3OWNClFhuqNOag7VmffsjTOgxHgHpfGAKVF/4BwqOHrdHFbAD +VOiWB1hv9Uc0C5laffGAub7fj+EAI02zlrsNDxYW8vyF2H47N7VWcvgd3RhZpxlG +8bq9phl7Ja55YmQiT2Ic3/K5tsazg5z9lz6OTrx+JvWbefHFlJpjCLz5yefEaRmX +9L/zyDMi4jgFTZEWNXC2vIrxwZMFwFhBXEp0PcCbuHJgJIucbRrbwukQC16uHJwP +zQIDAQAB +-----END PUBLIC KEY-----`, } } From 996302386165877a509544291b50f5a94d72e256 Mon Sep 17 00:00:00 2001 From: Mohammadmehdi Teymorian Date: Tue, 26 Jul 2022 16:17:21 +0430 Subject: [PATCH 236/660] feat: add "add vendor" description --- README.md | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/README.md b/README.md index b00bbbb7..0e15de21 100644 --- a/README.md +++ b/README.md @@ -62,6 +62,30 @@ For VM deployments following 2 steps are required. [dispatching/ignite](https://gitlab.snapp.ir/dispatching/ignite) is responsible for production deployments on Cloud (okd). +# Add Vendor +Soteria is a multivendor authenticator for EMQX. to add a vendor for authentication, go to chart directory and in the`values.yaml`, add the following template named after the desired vendor: +```yaml +snapp: + company: "snapp" + driver_salt: "secret" + passenger_salt: "secret" + driver_hash_length: 15 + passenger_hash_length: 15 + allowed_access_types: [ "pub", "sub" ] + topics: + - type: cab_event + template: ^{{.audience}}-event-{{.hashId}}$ + hash_type: 1 + accesses: + driver: '1' + passenger: '1' + - ... + driver_key: |- + ... + passenger_key: |- + ... +``` + # Folder Structure - `.api`: API documentation like swagger files From 2a2e3211d6d836cabb574ed21cceee934f161b7e Mon Sep 17 00:00:00 2001 From: Mohammadmehdi Teymorian Date: Tue, 26 Jul 2022 16:19:39 +0430 Subject: [PATCH 237/660] feat: remove unnecessary descriptions --- README.md | 27 --------------------------- 1 file changed, 27 deletions(-) diff --git a/README.md b/README.md index 0e15de21..1f7715c9 100644 --- a/README.md +++ b/README.md @@ -1,33 +1,6 @@ # Soteria - -# What is Soteria? - Soteria is responsible for Authentication and Authorization of every request sent to EMQ and Herald. -# How to compile? - -- [Install Golang](https://golang.org/doc/install) - -- Set `snapp goproxy` - -`go env -w GOPROXY="https://repo.snapp.tech/repository/goproxy/"` - -- Run the following command to compile the application - -`make compile` - -# How to run it locally? - -By executing the following command Herald will be up with EMQX and RabbitMQ brokers. - -`make up` - -# How to test? - -## Unit testing - -`make test` - # Deployment ## Staging From 7a36ec605240d80cb4c26fad89bd822c076fe9ec Mon Sep 17 00:00:00 2001 From: Mohammadmehdi Teymorian Date: Tue, 26 Jul 2022 16:56:39 +0430 Subject: [PATCH 238/660] feat: set snapp authenticator as default --- internal/api/acl.go | 9 +-------- internal/api/api.go | 12 ++++++------ internal/api/auth.go | 9 +-------- 3 files changed, 8 insertions(+), 22 deletions(-) diff --git a/internal/api/acl.go b/internal/api/acl.go index 6c8d4752..f681f568 100644 --- a/internal/api/acl.go +++ b/internal/api/acl.go @@ -61,14 +61,7 @@ func (a API) ACL(c *fiber.Ctx) error { topic := request.Topic - auth, ok := a.Authenticator(request.Password) - if !ok { - a.Logger.Warn("vendor not supported", zap.String("vendor", request.Password)) - - return c.Status(http.StatusBadRequest).SendString("bad request") - } - - ok, err := auth.ACL(request.Access, tokenString, topic) + ok, err := a.Authenticator(request.Password).ACL(request.Access, tokenString, topic) if err != nil || !ok { if err != nil { span.RecordError(err) diff --git a/internal/api/api.go b/internal/api/api.go index 6df8e574..24077b46 100644 --- a/internal/api/api.go +++ b/internal/api/api.go @@ -42,12 +42,12 @@ func (a API) ReSTServer() *fiber.App { return app } -func (a API) Authenticator(vendor string) (*authenticator.Authenticator, bool) { - if vendor == "" { - return a.Authenticators[authenticator.DefaultVendor], true - } - +func (a API) Authenticator(vendor string) *authenticator.Authenticator { auth, ok := a.Authenticators[vendor] - return auth, ok + if ok { + return auth + } + + return a.Authenticators[authenticator.DefaultVendor] } diff --git a/internal/api/auth.go b/internal/api/auth.go index 535d4fa4..f9f993a2 100644 --- a/internal/api/auth.go +++ b/internal/api/auth.go @@ -49,14 +49,7 @@ func (a API) Auth(c *fiber.Ctx) error { attribute.String("password", request.Username), ) - auth, ok := a.Authenticator(request.Password) - if !ok { - a.Logger.Warn("vendor not supported", zap.String("vendor", request.Password)) - - return c.Status(http.StatusBadRequest).SendString("bad request") - } - - if err := auth.Auth(tokenString); err != nil { + if err := a.Authenticator(request.Password).Auth(tokenString); err != nil { span.RecordError(err) a.Logger. From df7df514bb4e704833ef939358ffb59344221435 Mon Sep 17 00:00:00 2001 From: Mehdi Date: Wed, 27 Jul 2022 11:17:04 +0430 Subject: [PATCH 239/660] refactor: update chart version --- deployments/soteria/Chart.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/deployments/soteria/Chart.yaml b/deployments/soteria/Chart.yaml index d5486f4e..5ef03ae1 100644 --- a/deployments/soteria/Chart.yaml +++ b/deployments/soteria/Chart.yaml @@ -5,6 +5,6 @@ description: Soteria Helm Chart type: application -version: 6.5.1 +version: 6.6.1 -appVersion: "v6-5-1" +appVersion: "v6-6-1" From 0e724a24a280aaab5448cc5c08fdf052b5a9d54f Mon Sep 17 00:00:00 2001 From: Mehdi Date: Wed, 27 Jul 2022 16:29:53 +0430 Subject: [PATCH 240/660] fix: update log fields --- internal/api/acl.go | 12 ++++++------ internal/api/auth.go | 12 ++++++------ 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/internal/api/acl.go b/internal/api/acl.go index f681f568..425c6fb0 100644 --- a/internal/api/acl.go +++ b/internal/api/acl.go @@ -34,8 +34,8 @@ func (a API) ACL(c *fiber.Ctx) error { zap.String("access", request.Access.String()), zap.String("topic", request.Topic), zap.String("token", request.Token), - zap.String("username", request.Password), - zap.String("password", request.Username), + zap.String("username", request.Username), + zap.String("password", request.Password), ) return c.Status(http.StatusBadRequest).SendString("bad request") @@ -55,8 +55,8 @@ func (a API) ACL(c *fiber.Ctx) error { attribute.String("access", request.Access.String()), attribute.String("topic", request.Topic), attribute.String("token", request.Token), - attribute.String("username", request.Password), - attribute.String("password", request.Username), + attribute.String("username", request.Username), + attribute.String("password", request.Password), ) topic := request.Topic @@ -87,8 +87,8 @@ func (a API) ACL(c *fiber.Ctx) error { zap.String("access", request.Access.String()), zap.String("topic", request.Topic), zap.String("token", request.Token), - zap.String("username", request.Password), - zap.String("password", request.Username), + zap.String("username", request.Username), + zap.String("password", request.Password), ) return c.Status(http.StatusOK).SendString("ok") diff --git a/internal/api/auth.go b/internal/api/auth.go index f9f993a2..6e2034bc 100644 --- a/internal/api/auth.go +++ b/internal/api/auth.go @@ -45,8 +45,8 @@ func (a API) Auth(c *fiber.Ctx) error { span.SetAttributes( attribute.String("token", request.Token), - attribute.String("username", request.Password), - attribute.String("password", request.Username), + attribute.String("username", request.Username), + attribute.String("password", request.Password), ) if err := a.Authenticator(request.Password).Auth(tokenString); err != nil { @@ -56,8 +56,8 @@ func (a API) Auth(c *fiber.Ctx) error { Error("auth request is not authorized", zap.Error(err), zap.String("token", request.Token), - zap.String("username", request.Password), - zap.String("password", request.Username), + zap.String("username", request.Username), + zap.String("password", request.Password), ) return c.Status(http.StatusUnauthorized).SendString("request is not authorized") @@ -66,8 +66,8 @@ func (a API) Auth(c *fiber.Ctx) error { a.Logger. Info("auth ok", zap.String("token", request.Token), - zap.String("username", request.Password), - zap.String("password", request.Username), + zap.String("username", request.Username), + zap.String("password", request.Password), ) return c.Status(http.StatusOK).SendString("ok") From 58dc214ebd405949965d070d26f5d0a8c287661d Mon Sep 17 00:00:00 2001 From: Mehdi Date: Wed, 27 Jul 2022 16:51:30 +0430 Subject: [PATCH 241/660] feat: add authenticator to logging --- internal/api/acl.go | 17 +++++++++++------ internal/api/auth.go | 7 ++++++- 2 files changed, 17 insertions(+), 7 deletions(-) diff --git a/internal/api/acl.go b/internal/api/acl.go index 425c6fb0..9da327eb 100644 --- a/internal/api/acl.go +++ b/internal/api/acl.go @@ -2,12 +2,12 @@ package api import ( "errors" + "go.opentelemetry.io/otel/attribute" "net/http" "github.com/gofiber/fiber/v2" "gitlab.snapp.ir/dispatching/soteria/internal/authenticator" "gitlab.snapp.ir/dispatching/soteria/pkg/acl" - "go.opentelemetry.io/otel/attribute" "go.uber.org/zap" ) @@ -51,17 +51,19 @@ func (a API) ACL(c *fiber.Ctx) error { tokenString = request.Password } + topic := request.Topic + auth := a.Authenticator(request.Password) + span.SetAttributes( attribute.String("access", request.Access.String()), attribute.String("topic", request.Topic), attribute.String("token", request.Token), attribute.String("username", request.Username), attribute.String("password", request.Password), + attribute.String("authenticator", auth.Company), ) - topic := request.Topic - - ok, err := a.Authenticator(request.Password).ACL(request.Access, tokenString, topic) + ok, err := auth.ACL(request.Access, tokenString, topic) if err != nil || !ok { if err != nil { span.RecordError(err) @@ -72,11 +74,13 @@ func (a API) ACL(c *fiber.Ctx) error { if errors.As(err, &tnaErr) { a.Logger. Warn("acl request is not authorized", - zap.Error(tnaErr)) + zap.Error(tnaErr), + zap.String("authenticator", auth.Company)) } else { a.Logger. Error("acl request is not authorized", - zap.Error(err)) + zap.Error(err), + zap.String("authenticator", auth.Company)) } return c.Status(http.StatusUnauthorized).SendString("request is not authorized") @@ -89,6 +93,7 @@ func (a API) ACL(c *fiber.Ctx) error { zap.String("token", request.Token), zap.String("username", request.Username), zap.String("password", request.Password), + zap.String("authenticator", auth.Company), ) return c.Status(http.StatusOK).SendString("ok") diff --git a/internal/api/auth.go b/internal/api/auth.go index 6e2034bc..6ed96663 100644 --- a/internal/api/auth.go +++ b/internal/api/auth.go @@ -43,13 +43,16 @@ func (a API) Auth(c *fiber.Ctx) error { tokenString = request.Password } + authenticator := a.Authenticator(request.Password) + span.SetAttributes( attribute.String("token", request.Token), attribute.String("username", request.Username), attribute.String("password", request.Password), + attribute.String("authenticator", authenticator.Company), ) - if err := a.Authenticator(request.Password).Auth(tokenString); err != nil { + if err := authenticator.Auth(tokenString); err != nil { span.RecordError(err) a.Logger. @@ -58,6 +61,7 @@ func (a API) Auth(c *fiber.Ctx) error { zap.String("token", request.Token), zap.String("username", request.Username), zap.String("password", request.Password), + zap.String("authenticator", authenticator.Company), ) return c.Status(http.StatusUnauthorized).SendString("request is not authorized") @@ -68,6 +72,7 @@ func (a API) Auth(c *fiber.Ctx) error { zap.String("token", request.Token), zap.String("username", request.Username), zap.String("password", request.Password), + zap.String("authenticator", authenticator.Company), ) return c.Status(http.StatusOK).SendString("ok") From 9bbe45ea9cebfd5f89e07feaec2441d06f76aad4 Mon Sep 17 00:00:00 2001 From: Mehdi Date: Wed, 27 Jul 2022 16:53:44 +0430 Subject: [PATCH 242/660] feat: update chart version --- deployments/soteria/Chart.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/deployments/soteria/Chart.yaml b/deployments/soteria/Chart.yaml index 5ef03ae1..83a180a3 100644 --- a/deployments/soteria/Chart.yaml +++ b/deployments/soteria/Chart.yaml @@ -5,6 +5,6 @@ description: Soteria Helm Chart type: application -version: 6.6.1 +version: 6.6.2 -appVersion: "v6-6-1" +appVersion: "v6-6-2" From 5f79f8995c0ad5ef19fa6ecb99f2b109757d3924 Mon Sep 17 00:00:00 2001 From: Mohammadmehdi Teymorian Date: Sat, 30 Jul 2022 09:43:41 +0430 Subject: [PATCH 243/660] refactor: fix lint issue --- internal/api/acl.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/api/acl.go b/internal/api/acl.go index 9da327eb..4f7ffd9b 100644 --- a/internal/api/acl.go +++ b/internal/api/acl.go @@ -2,12 +2,12 @@ package api import ( "errors" - "go.opentelemetry.io/otel/attribute" "net/http" "github.com/gofiber/fiber/v2" "gitlab.snapp.ir/dispatching/soteria/internal/authenticator" "gitlab.snapp.ir/dispatching/soteria/pkg/acl" + "go.opentelemetry.io/otel/attribute" "go.uber.org/zap" ) From 7ec1c081d41ad0d2dae924dd263fa0e0b18c1363 Mon Sep 17 00:00:00 2001 From: Mohammadmehdi Teymorian Date: Sat, 30 Jul 2022 15:06:26 +0430 Subject: [PATCH 244/660] feat: add token generation --- README.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/README.md b/README.md index 1f7715c9..e7714722 100644 --- a/README.md +++ b/README.md @@ -59,6 +59,12 @@ snapp: ... ``` +# Generate JWT Token +replace `driver` and `0` for issuer and id respectively. +```curl +curl -s -u 'admin:admin' -L https://doago-snapp-ode-020.apps.private.teh-1.snappcloud.io/api/snapp/driver/0 +``` + # Folder Structure - `.api`: API documentation like swagger files From 79a90114e7e697720116dc0dbc087f5225f2bd99 Mon Sep 17 00:00:00 2001 From: Parham Alvani Date: Sat, 30 Jul 2022 20:42:31 +0430 Subject: [PATCH 245/660] Update README.md --- README.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index e7714722..e310d8ee 100644 --- a/README.md +++ b/README.md @@ -37,6 +37,7 @@ for production deployments on Cloud (okd). # Add Vendor Soteria is a multivendor authenticator for EMQX. to add a vendor for authentication, go to chart directory and in the`values.yaml`, add the following template named after the desired vendor: + ```yaml snapp: company: "snapp" @@ -61,8 +62,9 @@ snapp: # Generate JWT Token replace `driver` and `0` for issuer and id respectively. -```curl -curl -s -u 'admin:admin' -L https://doago-snapp-ode-020.apps.private.teh-1.snappcloud.io/api/snapp/driver/0 + +```sh +curl -s -u 'admin:admin' -L https://doago-snapp-ode-020.apps.private.teh-1.snappcloud.io/api/snapp/driver/0 | jq '.Token' -r ``` # Folder Structure From ffdc3db0d55273102ba66c5171cd57a94d3fda68 Mon Sep 17 00:00:00 2001 From: Parham Alvani Date: Sat, 30 Jul 2022 20:51:54 +0430 Subject: [PATCH 246/660] feat: add more logs on soteria --- internal/api/acl.go | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/internal/api/acl.go b/internal/api/acl.go index 4f7ffd9b..bd5e06c6 100644 --- a/internal/api/acl.go +++ b/internal/api/acl.go @@ -75,11 +75,23 @@ func (a API) ACL(c *fiber.Ctx) error { a.Logger. Warn("acl request is not authorized", zap.Error(tnaErr), + zap.String("access", request.Access.String()), + zap.String("topic", request.Topic), + zap.String("token", request.Token), + zap.String("username", request.Username), + zap.String("password", request.Password), + zap.String("authenticator", auth.Company), zap.String("authenticator", auth.Company)) } else { a.Logger. Error("acl request is not authorized", zap.Error(err), + zap.String("access", request.Access.String()), + zap.String("topic", request.Topic), + zap.String("token", request.Token), + zap.String("username", request.Username), + zap.String("password", request.Password), + zap.String("authenticator", auth.Company), zap.String("authenticator", auth.Company)) } From 8100cc2aae0e23390a6ea91eb1c34f39acf3ea7f Mon Sep 17 00:00:00 2001 From: Mehdi Teymorian Date: Mon, 1 Aug 2022 18:10:09 +0430 Subject: [PATCH 247/660] feat: add vendor & token extraction function --- internal/api/acl.go | 17 +++------- internal/api/api.go | 26 +++++++++++++++ internal/api/api_test.go | 69 ++++++++++++++++++++++++++++++++++++++++ internal/api/auth.go | 18 ++++------- 4 files changed, 105 insertions(+), 25 deletions(-) create mode 100644 internal/api/api_test.go diff --git a/internal/api/acl.go b/internal/api/acl.go index bd5e06c6..3d89b5bc 100644 --- a/internal/api/acl.go +++ b/internal/api/acl.go @@ -2,13 +2,12 @@ package api import ( "errors" - "net/http" - "github.com/gofiber/fiber/v2" "gitlab.snapp.ir/dispatching/soteria/internal/authenticator" "gitlab.snapp.ir/dispatching/soteria/pkg/acl" "go.opentelemetry.io/otel/attribute" "go.uber.org/zap" + "net/http" ) // aclRequest is the body payload structure of the ACL endpoint. @@ -41,18 +40,10 @@ func (a API) ACL(c *fiber.Ctx) error { return c.Status(http.StatusBadRequest).SendString("bad request") } - tokenString := request.Token - - if len(request.Token) == 0 { - tokenString = request.Username - } - - if len(tokenString) == 0 { - tokenString = request.Password - } + vendor, token := ExtractVendorToken(request.Token, request.Username, request.Password) topic := request.Topic - auth := a.Authenticator(request.Password) + auth := a.Authenticator(vendor) span.SetAttributes( attribute.String("access", request.Access.String()), @@ -63,7 +54,7 @@ func (a API) ACL(c *fiber.Ctx) error { attribute.String("authenticator", auth.Company), ) - ok, err := auth.ACL(request.Access, tokenString, topic) + ok, err := auth.ACL(request.Access, token, topic) if err != nil || !ok { if err != nil { span.RecordError(err) diff --git a/internal/api/api.go b/internal/api/api.go index 24077b46..acd9e662 100644 --- a/internal/api/api.go +++ b/internal/api/api.go @@ -7,6 +7,7 @@ import ( "gitlab.snapp.ir/dispatching/soteria/internal/authenticator" "go.opentelemetry.io/otel/trace" "go.uber.org/zap" + "strings" ) type API struct { @@ -51,3 +52,28 @@ func (a API) Authenticator(vendor string) *authenticator.Authenticator { return a.Authenticators[authenticator.DefaultVendor] } + +func ExtractVendorToken(rawToken, username, password string) (string, string) { + split := strings.Split(username, VendorTokenSeparator) + + var vendor, usernameToken string + + if len(split) == 2 { + vendor = split[0] + usernameToken = split[1] + } else { + vendor = "" + usernameToken = split[0] + } + + tokenString := rawToken + if len(tokenString) == 0 { + tokenString = usernameToken + } + + if len(tokenString) == 0 { + tokenString = password + } + + return vendor, tokenString +} diff --git a/internal/api/api_test.go b/internal/api/api_test.go new file mode 100644 index 00000000..916a718f --- /dev/null +++ b/internal/api/api_test.go @@ -0,0 +1,69 @@ +package api + +import "testing" + +func TestExtractVendorToken(t *testing.T) { + type fields struct { + Token string + Username string + Password string + } + tests := []struct { + name string + fields fields + vendor string + token string + }{ + { + name: "token field as token", + fields: fields{ + Token: "token", + Username: "vendor:username", + Password: "password", + }, + vendor: "vendor", + token: "token", + }, + { + name: "username as token without vendor", + fields: fields{ + Token: "", + Username: "username", + Password: "password", + }, + vendor: "", + token: "username", + }, + { + name: "username as token with vendor", + fields: fields{ + Token: "", + Username: "vendor:username", + Password: "", + }, + vendor: "vendor", + token: "username", + }, + { + name: "password as token", + fields: fields{ + Token: "", + Username: "", + Password: "password", + }, + vendor: "", + token: "password", + }, + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + vendor, token := ExtractVendorToken(tt.fields.Token, tt.fields.Username, tt.fields.Password) + if vendor != tt.vendor { + t.Errorf("ExtractVendorToken() vendor = %v, vendor %v", vendor, tt.vendor) + } + if token != tt.token { + t.Errorf("ExtractVendorToken() token = %v, vendor %v", token, tt.token) + } + }) + } +} diff --git a/internal/api/auth.go b/internal/api/auth.go index 6ed96663..b0729b07 100644 --- a/internal/api/auth.go +++ b/internal/api/auth.go @@ -1,13 +1,14 @@ package api import ( - "net/http" - "github.com/gofiber/fiber/v2" "go.opentelemetry.io/otel/attribute" "go.uber.org/zap" + "net/http" ) +const VendorTokenSeparator = ":" + // authRequest is the body payload structure of the auth endpoint. type authRequest struct { Token string `form:"token"` @@ -34,16 +35,9 @@ func (a API) Auth(c *fiber.Ctx) error { return c.Status(http.StatusBadRequest).SendString("bad request") } - tokenString := request.Token - if len(tokenString) == 0 { - tokenString = request.Username - } - - if len(tokenString) == 0 { - tokenString = request.Password - } + vendor, token := ExtractVendorToken(request.Token, request.Username, request.Password) - authenticator := a.Authenticator(request.Password) + authenticator := a.Authenticator(vendor) span.SetAttributes( attribute.String("token", request.Token), @@ -52,7 +46,7 @@ func (a API) Auth(c *fiber.Ctx) error { attribute.String("authenticator", authenticator.Company), ) - if err := authenticator.Auth(tokenString); err != nil { + if err := authenticator.Auth(token); err != nil { span.RecordError(err) a.Logger. From 93ffade69900b5a152e95fd3ab4c58ef162df1f5 Mon Sep 17 00:00:00 2001 From: Mehdi Teymorian Date: Mon, 1 Aug 2022 19:08:26 +0430 Subject: [PATCH 248/660] fix: correct lint issues --- .golangci.yml | 3 +++ internal/api/acl.go | 3 ++- internal/api/api.go | 7 +++++-- internal/api/api_test.go | 9 ++++++--- internal/api/auth.go | 5 ++--- 5 files changed, 18 insertions(+), 9 deletions(-) diff --git a/.golangci.yml b/.golangci.yml index 5acc4ef8..f9c375b7 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -13,3 +13,6 @@ linters: - golint - interfacer - exhaustivestruct +run: + skip-files: + - ".*_test.go" \ No newline at end of file diff --git a/internal/api/acl.go b/internal/api/acl.go index 3d89b5bc..b98acb3b 100644 --- a/internal/api/acl.go +++ b/internal/api/acl.go @@ -2,12 +2,13 @@ package api import ( "errors" + "net/http" + "github.com/gofiber/fiber/v2" "gitlab.snapp.ir/dispatching/soteria/internal/authenticator" "gitlab.snapp.ir/dispatching/soteria/pkg/acl" "go.opentelemetry.io/otel/attribute" "go.uber.org/zap" - "net/http" ) // aclRequest is the body payload structure of the ACL endpoint. diff --git a/internal/api/api.go b/internal/api/api.go index acd9e662..b82d44d9 100644 --- a/internal/api/api.go +++ b/internal/api/api.go @@ -1,15 +1,18 @@ package api import ( + "strings" + "github.com/ansrivas/fiberprometheus/v2" "github.com/gofiber/contrib/fiberzap" "github.com/gofiber/fiber/v2" "gitlab.snapp.ir/dispatching/soteria/internal/authenticator" "go.opentelemetry.io/otel/trace" "go.uber.org/zap" - "strings" ) +const VendorTokenSeparator = ":" + type API struct { Authenticators map[string]*authenticator.Authenticator Tracer trace.Tracer @@ -58,7 +61,7 @@ func ExtractVendorToken(rawToken, username, password string) (string, string) { var vendor, usernameToken string - if len(split) == 2 { + if len(split) == 2 { //nolint:gomnd vendor = split[0] usernameToken = split[1] } else { diff --git a/internal/api/api_test.go b/internal/api/api_test.go index 916a718f..6eabdce2 100644 --- a/internal/api/api_test.go +++ b/internal/api/api_test.go @@ -1,6 +1,9 @@ -package api +package api_test -import "testing" +import ( + "gitlab.snapp.ir/dispatching/soteria/internal/api" + "testing" +) func TestExtractVendorToken(t *testing.T) { type fields struct { @@ -57,7 +60,7 @@ func TestExtractVendorToken(t *testing.T) { } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { - vendor, token := ExtractVendorToken(tt.fields.Token, tt.fields.Username, tt.fields.Password) + vendor, token := api.ExtractVendorToken(tt.fields.Token, tt.fields.Username, tt.fields.Password) if vendor != tt.vendor { t.Errorf("ExtractVendorToken() vendor = %v, vendor %v", vendor, tt.vendor) } diff --git a/internal/api/auth.go b/internal/api/auth.go index b0729b07..95526f97 100644 --- a/internal/api/auth.go +++ b/internal/api/auth.go @@ -1,14 +1,13 @@ package api import ( + "net/http" + "github.com/gofiber/fiber/v2" "go.opentelemetry.io/otel/attribute" "go.uber.org/zap" - "net/http" ) -const VendorTokenSeparator = ":" - // authRequest is the body payload structure of the auth endpoint. type authRequest struct { Token string `form:"token"` From 016bfc1cb21d129e14c7c4724a381db536437dde Mon Sep 17 00:00:00 2001 From: Mehdi Teymorian Date: Wed, 10 Aug 2022 14:29:34 +0430 Subject: [PATCH 249/660] feat: change PublicKeys from user.Issuer to string --- internal/authenticator/authenticator.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/internal/authenticator/authenticator.go b/internal/authenticator/authenticator.go index c569e061..c92023f5 100644 --- a/internal/authenticator/authenticator.go +++ b/internal/authenticator/authenticator.go @@ -40,7 +40,7 @@ func (err TopicNotAllowedError) Error() string { } type PublicKeyNotFoundError struct { - Issuer user.Issuer + Issuer string } func (err PublicKeyNotFoundError) Error() string { @@ -57,7 +57,7 @@ func (err InvalidTopicError) Error() string { // Authenticator is responsible for Acl/Auth/Token of users. type Authenticator struct { - PublicKeys map[user.Issuer]*rsa.PublicKey + PublicKeys map[string]*rsa.PublicKey AllowedAccessTypes []acl.AccessType TopicManager topics.Manager Company string @@ -79,7 +79,7 @@ func (a Authenticator) Auth(tokenString string) error { return nil, ErrIssNotFound } - issuer := user.Issuer(fmt.Sprintf("%v", claims["iss"])) + issuer := fmt.Sprintf("%v", claims["iss"]) key := a.PublicKeys[issuer] if key == nil { @@ -122,7 +122,7 @@ func (a Authenticator) ACL( return nil, ErrSubNotFound } - issuer := user.Issuer(fmt.Sprintf("%v", claims["iss"])) + issuer := fmt.Sprintf("%v", claims["iss"]) key := a.PublicKeys[issuer] if key == nil { return nil, PublicKeyNotFoundError{Issuer: issuer} From 0e1e24e5b972a08d0394cf278eddefe2679474a2 Mon Sep 17 00:00:00 2001 From: Mehdi Teymorian Date: Wed, 10 Aug 2022 14:32:58 +0430 Subject: [PATCH 250/660] feat: replace driver & passenger's keys with a map of keys --- internal/config/config.go | 17 ++++++++--------- internal/config/default.go | 7 +++++-- 2 files changed, 13 insertions(+), 11 deletions(-) diff --git a/internal/config/config.go b/internal/config/config.go index def1c7d8..98a2d29d 100644 --- a/internal/config/config.go +++ b/internal/config/config.go @@ -31,15 +31,14 @@ type ( } Vendor struct { - AllowedAccessTypes []string `koanf:"allowed_access_types"` - PassengerHashLength int `koanf:"passenger_hash_length"` - DriverHashLength int `koanf:"driver_hash_length"` - PassengerSalt string `koanf:"passenger_salt"` - DriverSalt string `koanf:"driver_salt"` - Company string `koanf:"company"` - Topics []topics.Topic `koanf:"topics"` - DriverKey string `koanf:"driver_key"` - PassengerKey string `koanf:"passenger_key"` + AllowedAccessTypes []string `koanf:"allowed_access_types"` + PassengerHashLength int `koanf:"passenger_hash_length"` + DriverHashLength int `koanf:"driver_hash_length"` + PassengerSalt string `koanf:"passenger_salt"` + DriverSalt string `koanf:"driver_salt"` + Company string `koanf:"company"` + Topics []topics.Topic `koanf:"topics"` + Keys map[string]string `koanf:"keys"` } ) diff --git a/internal/config/default.go b/internal/config/default.go index 50b324dd..4e15d44a 100644 --- a/internal/config/default.go +++ b/internal/config/default.go @@ -139,7 +139,8 @@ func SnappVendor() Vendor { }, }, }, - DriverKey: `-----BEGIN PUBLIC KEY----- + Keys: map[string]string{ + "0": `-----BEGIN PUBLIC KEY----- MIIBITANBgkqhkiG9w0BAQEFAAOCAQ4AMIIBCQKCAQBk7O6M5p4eYNAwtVU2beGa W4mhFG94OtYUWDl1E7UUrhUNGf97Eb/45NjQszu0YPERnApJc2RUm2TrS7iq0mHz Xbwf+CbNF54Q5mjuHcpBKgvFwUUSCCYBftmRc4xbFIH4Oh3nHC2GeukUS9TmJwjM @@ -148,7 +149,8 @@ oHpSzRYN92/DomwmmjGVy8Ji0faeHx+r79ZzE0E8Rcc29Yhrg1ymrjfkXg98WjAb TSv4UAN20lsBDejpnGEZKJrxHZ56gHgaJn6PKKCD6ItJA7y7iraCdBhCfAIUIz/z AgMBAAE= -----END PUBLIC KEY-----`, - PassengerKey: `-----BEGIN PUBLIC KEY----- + + "1": `-----BEGIN PUBLIC KEY----- MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA1lNRwyNsDieWs6LvHOJ+ GyehhRC4Pn5yL5edKP3565F3LtRDMrkzwDRsQbqnUtTea9HCdTdBv+lI8vE17qRi RQn10IMaIH6e4Aa3OWNClFhuqNOag7VmffsjTOgxHgHpfGAKVF/4BwqOHrdHFbAD @@ -157,5 +159,6 @@ VOiWB1hv9Uc0C5laffGAub7fj+EAI02zlrsNDxYW8vyF2H47N7VWcvgd3RhZpxlG 9L/zyDMi4jgFTZEWNXC2vIrxwZMFwFhBXEp0PcCbuHJgJIucbRrbwukQC16uHJwP zQIDAQAB -----END PUBLIC KEY-----`, + }, } } From d4541176a0a3e75445cd0bcf855c3f00d2c80f11 Mon Sep 17 00:00:00 2001 From: Mehdi Teymorian Date: Wed, 10 Aug 2022 14:43:22 +0430 Subject: [PATCH 251/660] feat: create rsa public keys based on vendor's public key map --- internal/cmd/serve/main.go | 25 +++++++++++-------------- 1 file changed, 11 insertions(+), 14 deletions(-) diff --git a/internal/cmd/serve/main.go b/internal/cmd/serve/main.go index 9695f89d..68f6e075 100644 --- a/internal/cmd/serve/main.go +++ b/internal/cmd/serve/main.go @@ -16,7 +16,6 @@ import ( "gitlab.snapp.ir/dispatching/soteria/internal/config" "gitlab.snapp.ir/dispatching/soteria/internal/topics" "gitlab.snapp.ir/dispatching/soteria/pkg/acl" - "gitlab.snapp.ir/dispatching/soteria/pkg/user" "go.opentelemetry.io/otel/trace" "go.uber.org/zap" ) @@ -68,7 +67,7 @@ func (s Serve) Authenticators() map[string]*authenticator.Authenticator { all := make(map[string]*authenticator.Authenticator) for _, vendor := range s.Cfg.Vendors { - publicKeys := s.PublicKeys(vendor.DriverKey, vendor.PassengerKey) + publicKeys := s.PublicKeys(vendor.Keys) hid := HIDManager(vendor.DriverSalt, vendor.DriverHashLength, vendor.PassengerSalt, vendor.PassengerHashLength) allowedAccessTypes := s.GetAllowedAccessTypes(vendor.AllowedAccessTypes) @@ -103,21 +102,19 @@ func HIDManager( } } -func (s Serve) PublicKeys(driverKey, passengerKey string) map[user.Issuer]*rsa.PublicKey { - driverPublicKey, err := jwt.ParseRSAPublicKeyFromPEM([]byte(driverKey)) - if err != nil { - s.Logger.Fatal("could not read driver public key") - } +func (s Serve) PublicKeys(keys map[string]string) map[string]*rsa.PublicKey { + rsaKeys := make(map[string]*rsa.PublicKey) - passengerPublicKey, err := jwt.ParseRSAPublicKeyFromPEM([]byte(passengerKey)) - if err != nil { - s.Logger.Fatal("could not read passenger public key") - } + for iss, publicKey := range keys { + rsaKey, err := jwt.ParseRSAPublicKeyFromPEM([]byte(publicKey)) + if err != nil { + s.Logger.Fatal("could not read public key", zap.String("issuer", iss)) + } - return map[user.Issuer]*rsa.PublicKey{ - user.Driver: driverPublicKey, - user.Passenger: passengerPublicKey, + rsaKeys[iss] = rsaKey } + + return rsaKeys } // GetAllowedAccessTypes will return all allowed access types in Soteria. From 93992994485edde5be1b7cdc2eb2c84c4557b290 Mon Sep 17 00:00:00 2001 From: Mehdi Teymorian Date: Wed, 10 Aug 2022 14:50:59 +0430 Subject: [PATCH 252/660] refactor: move authenticators builder to authenticator package --- internal/authenticator/builder.go | 103 ++++++++++++++++++++++++++++++ internal/cmd/serve/main.go | 93 +-------------------------- 2 files changed, 104 insertions(+), 92 deletions(-) create mode 100644 internal/authenticator/builder.go diff --git a/internal/authenticator/builder.go b/internal/authenticator/builder.go new file mode 100644 index 00000000..ee0f492a --- /dev/null +++ b/internal/authenticator/builder.go @@ -0,0 +1,103 @@ +package authenticator + +import ( + "crypto/rsa" + "fmt" + "github.com/golang-jwt/jwt/v4" + "gitlab.snapp.ir/dispatching/snappids/v2" + "gitlab.snapp.ir/dispatching/soteria/internal/config" + "gitlab.snapp.ir/dispatching/soteria/internal/topics" + "gitlab.snapp.ir/dispatching/soteria/pkg/acl" + "go.uber.org/zap" +) + +type Builder struct { + Vendors []config.Vendor + Logger zap.Logger +} + +func (b Builder) Authenticators() map[string]*Authenticator { + all := make(map[string]*Authenticator) + + for _, vendor := range b.Vendors { + publicKeys := b.PublicKeys(vendor.Keys) + hid := HIDManager(vendor.DriverSalt, vendor.DriverHashLength, vendor.PassengerSalt, vendor.PassengerHashLength) + allowedAccessTypes := b.GetAllowedAccessTypes(vendor.AllowedAccessTypes) + + auth := &Authenticator{ + PublicKeys: publicKeys, + AllowedAccessTypes: allowedAccessTypes, + Company: vendor.Company, + TopicManager: topics.NewTopicManager(vendor.Topics, hid, vendor.Company), + } + + all[vendor.Company] = auth + } + + return all +} + +func (b Builder) PublicKeys(keys map[string]string) map[string]*rsa.PublicKey { + rsaKeys := make(map[string]*rsa.PublicKey) + + for iss, publicKey := range keys { + rsaKey, err := jwt.ParseRSAPublicKeyFromPEM([]byte(publicKey)) + if err != nil { + b.Logger.Fatal("could not read public key", zap.String("issuer", iss)) + } + + rsaKeys[iss] = rsaKey + } + + return rsaKeys +} + +// GetAllowedAccessTypes will return all allowed access types in Soteria. +func (b Builder) GetAllowedAccessTypes(accessTypes []string) []acl.AccessType { + allowedAccessTypes := make([]acl.AccessType, 0, len(accessTypes)) + + for _, a := range accessTypes { + at, err := toUserAccessType(a) + if err != nil { + err = fmt.Errorf("could not convert %s: %w", at, err) + b.Logger.Fatal("error while getting allowed access types", zap.Error(err)) + } + + allowedAccessTypes = append(allowedAccessTypes, at) + } + + return allowedAccessTypes +} + +func HIDManager( + driverSalt string, + driverHashLength int, + passengerSalt string, + passengerHashLength int, +) *snappids.HashIDSManager { + return &snappids.HashIDSManager{ + Salts: map[snappids.Audience]string{ + snappids.DriverAudience: driverSalt, + snappids.PassengerAudience: passengerSalt, + }, + Lengths: map[snappids.Audience]int{ + snappids.DriverAudience: driverHashLength, + snappids.PassengerAudience: passengerHashLength, + }, + } +} + +// toUserAccessType will convert string access type to it's own type. +// nolint: goerr113 +func toUserAccessType(access string) (acl.AccessType, error) { + switch access { + case "pub": + return acl.Pub, nil + case "sub": + return acl.Sub, nil + case "pubsub": + return acl.PubSub, nil + } + + return "", fmt.Errorf("%v is a invalid acces type", access) +} diff --git a/internal/cmd/serve/main.go b/internal/cmd/serve/main.go index 68f6e075..327b9d6b 100644 --- a/internal/cmd/serve/main.go +++ b/internal/cmd/serve/main.go @@ -1,21 +1,16 @@ package serve import ( - "crypto/rsa" "errors" "fmt" "net/http" "os" "os/signal" - "github.com/golang-jwt/jwt/v4" "github.com/spf13/cobra" - "gitlab.snapp.ir/dispatching/snappids/v2" "gitlab.snapp.ir/dispatching/soteria/internal/api" "gitlab.snapp.ir/dispatching/soteria/internal/authenticator" "gitlab.snapp.ir/dispatching/soteria/internal/config" - "gitlab.snapp.ir/dispatching/soteria/internal/topics" - "gitlab.snapp.ir/dispatching/soteria/pkg/acl" "go.opentelemetry.io/otel/trace" "go.uber.org/zap" ) @@ -28,7 +23,7 @@ type Serve struct { func (s Serve) main() { rest := api.API{ - Authenticators: s.Authenticators(), + Authenticators: authenticator.Builder{Vendors: s.Cfg.Vendors, Logger: s.Logger}.Authenticators(), Tracer: s.Tracer, Logger: *s.Logger.Named("api"), }.ReSTServer() @@ -62,89 +57,3 @@ func (s Serve) Register(root *cobra.Command) { }, ) } - -func (s Serve) Authenticators() map[string]*authenticator.Authenticator { - all := make(map[string]*authenticator.Authenticator) - - for _, vendor := range s.Cfg.Vendors { - publicKeys := s.PublicKeys(vendor.Keys) - hid := HIDManager(vendor.DriverSalt, vendor.DriverHashLength, vendor.PassengerSalt, vendor.PassengerHashLength) - allowedAccessTypes := s.GetAllowedAccessTypes(vendor.AllowedAccessTypes) - - auth := &authenticator.Authenticator{ - PublicKeys: publicKeys, - AllowedAccessTypes: allowedAccessTypes, - Company: vendor.Company, - TopicManager: topics.NewTopicManager(vendor.Topics, hid, vendor.Company), - } - - all[vendor.Company] = auth - } - - return all -} - -func HIDManager( - driverSalt string, - driverHashLength int, - passengerSalt string, - passengerHashLength int, -) *snappids.HashIDSManager { - return &snappids.HashIDSManager{ - Salts: map[snappids.Audience]string{ - snappids.DriverAudience: driverSalt, - snappids.PassengerAudience: passengerSalt, - }, - Lengths: map[snappids.Audience]int{ - snappids.DriverAudience: driverHashLength, - snappids.PassengerAudience: passengerHashLength, - }, - } -} - -func (s Serve) PublicKeys(keys map[string]string) map[string]*rsa.PublicKey { - rsaKeys := make(map[string]*rsa.PublicKey) - - for iss, publicKey := range keys { - rsaKey, err := jwt.ParseRSAPublicKeyFromPEM([]byte(publicKey)) - if err != nil { - s.Logger.Fatal("could not read public key", zap.String("issuer", iss)) - } - - rsaKeys[iss] = rsaKey - } - - return rsaKeys -} - -// GetAllowedAccessTypes will return all allowed access types in Soteria. -func (s Serve) GetAllowedAccessTypes(accessTypes []string) []acl.AccessType { - allowedAccessTypes := make([]acl.AccessType, 0, len(accessTypes)) - - for _, a := range accessTypes { - at, err := toUserAccessType(a) - if err != nil { - err = fmt.Errorf("could not convert %s: %w", at, err) - s.Logger.Fatal("error while getting allowed access types", zap.Error(err)) - } - - allowedAccessTypes = append(allowedAccessTypes, at) - } - - return allowedAccessTypes -} - -// toUserAccessType will convert string access type to it's own type. -// nolint: goerr113 -func toUserAccessType(access string) (acl.AccessType, error) { - switch access { - case "pub": - return acl.Pub, nil - case "sub": - return acl.Sub, nil - case "pubsub": - return acl.PubSub, nil - } - - return "", fmt.Errorf("%v is a invalid acces type", access) -} From 0d24eb1fcba6938dc1c883a37bc1b9b52842fede Mon Sep 17 00:00:00 2001 From: Mehdi Teymorian Date: Wed, 10 Aug 2022 17:03:29 +0430 Subject: [PATCH 253/660] feat: replace audience with issuer --- internal/authenticator/authenticator.go | 11 +++---- internal/config/default.go | 40 ++++++++++++------------- internal/topics/manager.go | 11 +++++-- internal/topics/manager_test.go | 11 ++----- pkg/user/user.go | 6 ++-- 5 files changed, 38 insertions(+), 41 deletions(-) diff --git a/internal/authenticator/authenticator.go b/internal/authenticator/authenticator.go index c92023f5..7d2ab1a8 100644 --- a/internal/authenticator/authenticator.go +++ b/internal/authenticator/authenticator.go @@ -8,7 +8,6 @@ import ( "github.com/golang-jwt/jwt/v4" "gitlab.snapp.ir/dispatching/soteria/internal/topics" "gitlab.snapp.ir/dispatching/soteria/pkg/acl" - "gitlab.snapp.ir/dispatching/soteria/pkg/user" ) const DefaultVendor = "snapp" @@ -26,7 +25,7 @@ var ( ) type TopicNotAllowedError struct { - Issuer user.Issuer + Issuer string Sub string AccessType acl.AccessType Topic string @@ -143,7 +142,7 @@ func (a Authenticator) ACL( return false, ErrIssNotFound } - issuer := user.Issuer(fmt.Sprintf("%v", claims["iss"])) + issuer := fmt.Sprintf("%v", claims["iss"]) if claims["sub"] == nil { return false, ErrSubNotFound @@ -151,14 +150,12 @@ func (a Authenticator) ACL( sub, _ := claims["sub"].(string) - audience, audienceStr := topics.IssuerToAudience(issuer) - - topicTemplate := a.TopicManager.ValidateTopic(topic, audienceStr, audience, sub) + topicTemplate := a.TopicManager.ValidateTopic(topic, issuer, sub) if topicTemplate == nil { return false, InvalidTopicError{Topic: topic} } - if !topicTemplate.HasAccess(audienceStr, accessType) { + if !topicTemplate.HasAccess(issuer, accessType) { return false, TopicNotAllowedError{ issuer, sub, diff --git a/internal/config/default.go b/internal/config/default.go index 4e15d44a..d416a398 100644 --- a/internal/config/default.go +++ b/internal/config/default.go @@ -53,8 +53,8 @@ func SnappVendor() Vendor { Template: "^{{.audience}}-event-{{.hashId}}$", HashType: topics.MD5, Accesses: map[string]acl.AccessType{ - topics.Driver: acl.Sub, - topics.Passenger: acl.Sub, + topics.DriverIss: acl.Sub, + topics.PassengerIss: acl.Sub, }, }, { @@ -62,8 +62,8 @@ func SnappVendor() Vendor { Template: "^{{.company}}/driver/{{.hashId}}/location$", HashType: topics.HashID, Accesses: map[string]acl.AccessType{ - topics.Driver: acl.Pub, - topics.Passenger: acl.None, + topics.DriverIss: acl.Pub, + topics.PassengerIss: acl.None, }, }, { @@ -71,8 +71,8 @@ func SnappVendor() Vendor { Template: "^{{.company}}/passenger/{{.hashId}}/location$", HashType: topics.HashID, Accesses: map[string]acl.AccessType{ - topics.Driver: acl.Pub, - topics.Passenger: acl.Pub, + topics.DriverIss: acl.Pub, + topics.PassengerIss: acl.Pub, }, }, { @@ -80,8 +80,8 @@ func SnappVendor() Vendor { Template: "^{{.company}}/{{.audience}}/{{.hashId}}/superapp$", HashType: topics.HashID, Accesses: map[string]acl.AccessType{ - topics.Driver: acl.Sub, - topics.Passenger: acl.Sub, + topics.DriverIss: acl.Sub, + topics.PassengerIss: acl.Sub, }, }, { @@ -89,8 +89,8 @@ func SnappVendor() Vendor { Template: "^bucks$", HashType: topics.HashID, Accesses: map[string]acl.AccessType{ - topics.Driver: acl.None, - topics.Passenger: acl.None, + topics.DriverIss: acl.None, + topics.PassengerIss: acl.None, }, }, { @@ -98,8 +98,8 @@ func SnappVendor() Vendor { Template: "^{{.company}}/{{.audience}}/{{.hashId}}/{{.peer}}-location$", HashType: topics.HashID, Accesses: map[string]acl.AccessType{ - topics.Driver: acl.Sub, - topics.Passenger: acl.Sub, + topics.DriverIss: acl.Sub, + topics.PassengerIss: acl.Sub, }, }, { @@ -107,8 +107,8 @@ func SnappVendor() Vendor { Template: "^{{.company}}/{{.audience}}/{{.hashId}}/chat$", HashType: topics.HashID, Accesses: map[string]acl.AccessType{ - topics.Driver: acl.Sub, - topics.Passenger: acl.Sub, + topics.DriverIss: acl.Sub, + topics.PassengerIss: acl.Sub, }, }, { @@ -116,8 +116,8 @@ func SnappVendor() Vendor { Template: "^shared/{{.company}}/{{.audience}}/{{.hashId}}/call/send$", HashType: topics.HashID, Accesses: map[string]acl.AccessType{ - topics.Driver: acl.Pub, - topics.Passenger: acl.Pub, + topics.DriverIss: acl.Pub, + topics.PassengerIss: acl.Pub, }, }, { @@ -125,8 +125,8 @@ func SnappVendor() Vendor { Template: "^{{.company}}/{{.audience}}/{{.hashId}}/call/[a-zA-Z0-9-_]+/send$", HashType: topics.HashID, Accesses: map[string]acl.AccessType{ - topics.Driver: acl.Pub, - topics.Passenger: acl.Pub, + topics.DriverIss: acl.Pub, + topics.PassengerIss: acl.Pub, }, }, { @@ -134,8 +134,8 @@ func SnappVendor() Vendor { Template: "^{{.company}}/{{.audience}}/{{.hashId}}/call/receive$", HashType: topics.HashID, Accesses: map[string]acl.AccessType{ - topics.Driver: acl.Sub, - topics.Passenger: acl.Sub, + topics.DriverIss: acl.Sub, + topics.PassengerIss: acl.Sub, }, }, }, diff --git a/internal/topics/manager.go b/internal/topics/manager.go index 81bc0245..2372c121 100644 --- a/internal/topics/manager.go +++ b/internal/topics/manager.go @@ -31,7 +31,10 @@ const ( const ( Driver string = "driver" - Passenger string = "passenger" + DriverIss string = "0" + + Passenger string = "passenger" + PassengerIss string = "1" ) // EmqCabHashPrefix is the default prefix for hashing part of cab topic, default value is 'emqch'. @@ -67,7 +70,9 @@ func NewTopicManager(topicList []Topic, hashIDManager *snappids.HashIDSManager, } // ValidateTopic checks if a topic is valid based on the given parameters. -func (t Manager) ValidateTopic(topic string, audienceStr string, audience snappids.Audience, sub string) *Template { +func (t Manager) ValidateTopic(topic, iss, sub string) *Template { + audience, audienceStr := IssuerToAudience(iss) + fields := make(map[string]string) fields["audience"] = audienceStr fields["company"] = t.Company @@ -115,7 +120,7 @@ func (t Manager) getHashID(hashType HashType, sub string, audience snappids.Audi } // IssuerToAudience returns corresponding audience in snappids form. -func IssuerToAudience(issuer user.Issuer) (snappids.Audience, string) { +func IssuerToAudience(issuer string) (snappids.Audience, string) { switch issuer { case user.Passenger: return snappids.PassengerAudience, Passenger diff --git a/internal/topics/manager_test.go b/internal/topics/manager_test.go index 3d12abd9..ba8b71a0 100644 --- a/internal/topics/manager_test.go +++ b/internal/topics/manager_test.go @@ -4,7 +4,6 @@ import ( "testing" "gitlab.snapp.ir/dispatching/snappids/v2" - "gitlab.snapp.ir/dispatching/soteria/internal/authenticator" "gitlab.snapp.ir/dispatching/soteria/internal/config" "gitlab.snapp.ir/dispatching/soteria/internal/topics" "gitlab.snapp.ir/dispatching/soteria/pkg/user" @@ -17,7 +16,7 @@ func TestTopic_GetType(t *testing.T) { tests := []struct { name string arg string - issuer user.Issuer + issuer string want string }{ { @@ -145,10 +144,7 @@ func TestTopic_GetType(t *testing.T) { }, } // nolint: exhaustruct - auth := authenticator.Authenticator{ - Company: "snapp", - TopicManager: topics.NewTopicManager(cfg.Topics, hid, "snapp"), - } + topicManager := topics.NewTopicManager(cfg.Topics, hid, "snapp") sub := "DXKgaNQa7N5Y7bo" @@ -158,8 +154,7 @@ func TestTopic_GetType(t *testing.T) { t.Parallel() topic := tc.arg - audience, audienceStr := topics.IssuerToAudience(tc.issuer) - topicTemplate := auth.TopicManager.ValidateTopic(topic, audienceStr, audience, sub) + topicTemplate := topicManager.ValidateTopic(topic, tc.issuer, sub) if topicTemplate != nil { if len(tc.want) == 0 { t.Errorf("topic %s is invalid, must throw error.", tc.arg) diff --git a/pkg/user/user.go b/pkg/user/user.go index e23c7f55..e690e914 100644 --- a/pkg/user/user.go +++ b/pkg/user/user.go @@ -4,7 +4,7 @@ package user type Issuer string const ( - Driver Issuer = "0" - Passenger Issuer = "1" - None Issuer = "-1" + Driver string = "0" + Passenger string = "1" + None string = "-1" ) From 98ed2f6dcc37dcc79f2f4cba3bedd362593eb63b Mon Sep 17 00:00:00 2001 From: Mehdi Teymorian Date: Sat, 13 Aug 2022 10:01:42 +0430 Subject: [PATCH 254/660] feat: add iss mapper to vendor config --- internal/config/config.go | 1 + internal/config/default.go | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/internal/config/config.go b/internal/config/config.go index 98a2d29d..e5372074 100644 --- a/internal/config/config.go +++ b/internal/config/config.go @@ -39,6 +39,7 @@ type ( Company string `koanf:"company"` Topics []topics.Topic `koanf:"topics"` Keys map[string]string `koanf:"keys"` + IssMapper map[string]string `koanf:"iss_mapper"` } ) diff --git a/internal/config/default.go b/internal/config/default.go index d416a398..e3624134 100644 --- a/internal/config/default.go +++ b/internal/config/default.go @@ -160,5 +160,9 @@ VOiWB1hv9Uc0C5laffGAub7fj+EAI02zlrsNDxYW8vyF2H47N7VWcvgd3RhZpxlG zQIDAQAB -----END PUBLIC KEY-----`, }, + IssMapper: map[string]string{ + "0": "driver", + "1": "passenger", + }, } } From 4507533cc1204eeedf8578849d3ad22195991561 Mon Sep 17 00:00:00 2001 From: Mehdi Teymorian Date: Sat, 13 Aug 2022 10:09:07 +0430 Subject: [PATCH 255/660] feat: add iss mapper function --- internal/topics/manager.go | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/internal/topics/manager.go b/internal/topics/manager.go index 2372c121..c9f10083 100644 --- a/internal/topics/manager.go +++ b/internal/topics/manager.go @@ -46,10 +46,12 @@ type Manager struct { HashIDSManager *snappids.HashIDSManager Company string TopicTemplates []Template + IssMap map[string]string + Functions template.FuncMap } // NewTopicManager returns a topic manager to validate topics. -func NewTopicManager(topicList []Topic, hashIDManager *snappids.HashIDSManager, company string) Manager { +func NewTopicManager(topicList []Topic, hashIDManager *snappids.HashIDSManager, company string, issMap map[string]string) Manager { templates := make([]Template, 0) for _, topic := range topicList { @@ -62,11 +64,18 @@ func NewTopicManager(topicList []Topic, hashIDManager *snappids.HashIDSManager, templates = append(templates, each) } - return Manager{ + manager := Manager{ HashIDSManager: hashIDManager, Company: company, TopicTemplates: templates, + IssMap: issMap, } + + manager.Functions = template.FuncMap{ + "IssMapper": manager.IssMapper, + } + + return manager } // ValidateTopic checks if a topic is valid based on the given parameters. @@ -119,6 +128,15 @@ func (t Manager) getHashID(hashType HashType, sub string, audience snappids.Audi return sub, nil } +func (t Manager) IssMapper(iss string) string { + result, ok := t.IssMap[iss] + if ok { + return result + } + + return iss +} + // IssuerToAudience returns corresponding audience in snappids form. func IssuerToAudience(issuer string) (snappids.Audience, string) { switch issuer { From fea2b5254401e65686e45f475559eb3e671914e2 Mon Sep 17 00:00:00 2001 From: Mehdi Teymorian Date: Sat, 13 Aug 2022 10:09:35 +0430 Subject: [PATCH 256/660] fix: update test based on changes --- internal/authenticator/authenticator_test.go | 17 ++++++++--------- internal/topics/manager_test.go | 2 +- 2 files changed, 9 insertions(+), 10 deletions(-) diff --git a/internal/authenticator/authenticator_test.go b/internal/authenticator/authenticator_test.go index bcc25ac4..1de9d567 100644 --- a/internal/authenticator/authenticator_test.go +++ b/internal/authenticator/authenticator_test.go @@ -111,14 +111,15 @@ func (suite *AuthenticatorTestSuite) SetupSuite() { }, } + cfg := config.SnappVendor() suite.Authenticator = authenticator.Authenticator{ - PublicKeys: map[user.Issuer]*rsa.PublicKey{ + PublicKeys: map[string]*rsa.PublicKey{ user.Driver: pkey0, user.Passenger: pkey1, }, AllowedAccessTypes: []acl.AccessType{acl.Pub, acl.Sub, acl.PubSub}, Company: "snapp", - TopicManager: topics.NewTopicManager(config.SnappVendor().Topics, hid, "snapp"), + TopicManager: topics.NewTopicManager(cfg.Topics, hid, "snapp", cfg.IssMapper), } } @@ -354,13 +355,11 @@ func TestAuthenticator_ValidateTopicBySender(t *testing.T) { authenticator := authenticator.Authenticator{ AllowedAccessTypes: []acl.AccessType{acl.Pub, acl.Sub}, Company: "snapp", - TopicManager: topics.NewTopicManager(cfg.Topics, hid, "snapp"), + TopicManager: topics.NewTopicManager(cfg.Topics, hid, "snapp", cfg.IssMapper), } t.Run("testing valid driver cab event", func(t *testing.T) { - audience, audienceStr := topics.IssuerToAudience(user.Driver) - topicTemplate := authenticator.TopicManager.ValidateTopic( - validDriverCabEventTopic, audienceStr, audience, "DXKgaNQa7N5Y7bo") + topicTemplate := authenticator.TopicManager.ValidateTopic(validDriverCabEventTopic, user.Driver, "DXKgaNQa7N5Y7bo") assert.True(t, topicTemplate != nil) }) } @@ -456,7 +455,7 @@ func TestAuthenticator_validateAccessType(t *testing.T) { } // nolint: goerr113, wrapcheck -func (suite *AuthenticatorTestSuite) getPublicKey(u user.Issuer) (*rsa.PublicKey, error) { +func (suite *AuthenticatorTestSuite) getPublicKey(u string) (*rsa.PublicKey, error) { var fileName string switch u { @@ -484,7 +483,7 @@ func (suite *AuthenticatorTestSuite) getPublicKey(u user.Issuer) (*rsa.PublicKey } // nolint: goerr113, wrapcheck -func (suite *AuthenticatorTestSuite) getPrivateKey(u user.Issuer) (*rsa.PrivateKey, error) { +func (suite *AuthenticatorTestSuite) getPrivateKey(u string) (*rsa.PrivateKey, error) { var fileName string switch u { @@ -511,7 +510,7 @@ func (suite *AuthenticatorTestSuite) getPrivateKey(u user.Issuer) (*rsa.PrivateK return privateKey, nil } -func (suite *AuthenticatorTestSuite) getSampleToken(issuer user.Issuer, isSuperuser bool) (string, error) { +func (suite *AuthenticatorTestSuite) getSampleToken(issuer string, isSuperuser bool) (string, error) { key, err := suite.getPrivateKey(issuer) if err != nil { suite.Require().NoError(err) diff --git a/internal/topics/manager_test.go b/internal/topics/manager_test.go index ba8b71a0..dc669826 100644 --- a/internal/topics/manager_test.go +++ b/internal/topics/manager_test.go @@ -144,7 +144,7 @@ func TestTopic_GetType(t *testing.T) { }, } // nolint: exhaustruct - topicManager := topics.NewTopicManager(cfg.Topics, hid, "snapp") + topicManager := topics.NewTopicManager(cfg.Topics, hid, "snapp", cfg.IssMapper) sub := "DXKgaNQa7N5Y7bo" From 1735ecece293bd8cbb3b609952a0518d6a0a7fb8 Mon Sep 17 00:00:00 2001 From: Mehdi Teymorian Date: Sat, 13 Aug 2022 10:09:58 +0430 Subject: [PATCH 257/660] feat: add issMap to constructor --- internal/authenticator/builder.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/authenticator/builder.go b/internal/authenticator/builder.go index ee0f492a..e839adf2 100644 --- a/internal/authenticator/builder.go +++ b/internal/authenticator/builder.go @@ -28,7 +28,7 @@ func (b Builder) Authenticators() map[string]*Authenticator { PublicKeys: publicKeys, AllowedAccessTypes: allowedAccessTypes, Company: vendor.Company, - TopicManager: topics.NewTopicManager(vendor.Topics, hid, vendor.Company), + TopicManager: topics.NewTopicManager(vendor.Topics, hid, vendor.Company, vendor.IssMapper), } all[vendor.Company] = auth From 598d473b2edc59f57ee42951f38a62c5033f94f5 Mon Sep 17 00:00:00 2001 From: Mehdi Teymorian Date: Sat, 13 Aug 2022 10:17:03 +0430 Subject: [PATCH 258/660] feat: add issuer to snappID function --- internal/topics/manager.go | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/internal/topics/manager.go b/internal/topics/manager.go index c9f10083..8d08d966 100644 --- a/internal/topics/manager.go +++ b/internal/topics/manager.go @@ -151,6 +151,20 @@ func IssuerToAudience(issuer string) (snappids.Audience, string) { } } +// IssuerToSnappID returns corresponding audience in snappids form. +func IssuerToSnappID(issuer string) snappids.Audience { + switch issuer { + case user.Passenger: + return snappids.PassengerAudience + case user.Driver: + return snappids.DriverAudience + case user.None: + fallthrough + default: + return -1 + } +} + func peerOfAudience(audience string) string { switch audience { case Driver: From ea53e0d9d8908c9bc4a20bb156ce8861ff2cb655 Mon Sep 17 00:00:00 2001 From: Mehdi Teymorian Date: Sat, 13 Aug 2022 10:17:27 +0430 Subject: [PATCH 259/660] feat: create template function map --- internal/topics/manager.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/internal/topics/manager.go b/internal/topics/manager.go index 8d08d966..5f496199 100644 --- a/internal/topics/manager.go +++ b/internal/topics/manager.go @@ -72,7 +72,10 @@ func NewTopicManager(topicList []Topic, hashIDManager *snappids.HashIDSManager, } manager.Functions = template.FuncMap{ - "IssMapper": manager.IssMapper, + "IssToEntity": manager.IssMapper, + "HashID": manager.getHashID, + "IssToSnappID": IssuerToSnappID, + "IssToPeer": peerOfAudience, } return manager From f06c327e43472b9b683dad3fd746991ed6fcb414 Mon Sep 17 00:00:00 2001 From: Mehdi Teymorian Date: Sat, 13 Aug 2022 10:19:47 +0430 Subject: [PATCH 260/660] feat: rename issMapper to IssEntityMap --- internal/authenticator/authenticator_test.go | 4 ++-- internal/authenticator/builder.go | 2 +- internal/config/config.go | 2 +- internal/config/default.go | 2 +- internal/topics/manager.go | 12 ++++++------ internal/topics/manager_test.go | 2 +- 6 files changed, 12 insertions(+), 12 deletions(-) diff --git a/internal/authenticator/authenticator_test.go b/internal/authenticator/authenticator_test.go index 1de9d567..8ff055cd 100644 --- a/internal/authenticator/authenticator_test.go +++ b/internal/authenticator/authenticator_test.go @@ -119,7 +119,7 @@ func (suite *AuthenticatorTestSuite) SetupSuite() { }, AllowedAccessTypes: []acl.AccessType{acl.Pub, acl.Sub, acl.PubSub}, Company: "snapp", - TopicManager: topics.NewTopicManager(cfg.Topics, hid, "snapp", cfg.IssMapper), + TopicManager: topics.NewTopicManager(cfg.Topics, hid, "snapp", cfg.IssEntityMap), } } @@ -355,7 +355,7 @@ func TestAuthenticator_ValidateTopicBySender(t *testing.T) { authenticator := authenticator.Authenticator{ AllowedAccessTypes: []acl.AccessType{acl.Pub, acl.Sub}, Company: "snapp", - TopicManager: topics.NewTopicManager(cfg.Topics, hid, "snapp", cfg.IssMapper), + TopicManager: topics.NewTopicManager(cfg.Topics, hid, "snapp", cfg.IssEntityMap), } t.Run("testing valid driver cab event", func(t *testing.T) { diff --git a/internal/authenticator/builder.go b/internal/authenticator/builder.go index e839adf2..2039f2f7 100644 --- a/internal/authenticator/builder.go +++ b/internal/authenticator/builder.go @@ -28,7 +28,7 @@ func (b Builder) Authenticators() map[string]*Authenticator { PublicKeys: publicKeys, AllowedAccessTypes: allowedAccessTypes, Company: vendor.Company, - TopicManager: topics.NewTopicManager(vendor.Topics, hid, vendor.Company, vendor.IssMapper), + TopicManager: topics.NewTopicManager(vendor.Topics, hid, vendor.Company, vendor.IssEntityMap), } all[vendor.Company] = auth diff --git a/internal/config/config.go b/internal/config/config.go index e5372074..49230c23 100644 --- a/internal/config/config.go +++ b/internal/config/config.go @@ -39,7 +39,7 @@ type ( Company string `koanf:"company"` Topics []topics.Topic `koanf:"topics"` Keys map[string]string `koanf:"keys"` - IssMapper map[string]string `koanf:"iss_mapper"` + IssEntityMap map[string]string `koanf:"iss_entity_map"` } ) diff --git a/internal/config/default.go b/internal/config/default.go index e3624134..d65c09da 100644 --- a/internal/config/default.go +++ b/internal/config/default.go @@ -160,7 +160,7 @@ VOiWB1hv9Uc0C5laffGAub7fj+EAI02zlrsNDxYW8vyF2H47N7VWcvgd3RhZpxlG zQIDAQAB -----END PUBLIC KEY-----`, }, - IssMapper: map[string]string{ + IssEntityMap: map[string]string{ "0": "driver", "1": "passenger", }, diff --git a/internal/topics/manager.go b/internal/topics/manager.go index 5f496199..4d2cbcd6 100644 --- a/internal/topics/manager.go +++ b/internal/topics/manager.go @@ -46,12 +46,12 @@ type Manager struct { HashIDSManager *snappids.HashIDSManager Company string TopicTemplates []Template - IssMap map[string]string + IssEntityMap map[string]string Functions template.FuncMap } // NewTopicManager returns a topic manager to validate topics. -func NewTopicManager(topicList []Topic, hashIDManager *snappids.HashIDSManager, company string, issMap map[string]string) Manager { +func NewTopicManager(topicList []Topic, hashIDManager *snappids.HashIDSManager, company string, issEntityMap map[string]string) Manager { templates := make([]Template, 0) for _, topic := range topicList { @@ -68,11 +68,11 @@ func NewTopicManager(topicList []Topic, hashIDManager *snappids.HashIDSManager, HashIDSManager: hashIDManager, Company: company, TopicTemplates: templates, - IssMap: issMap, + IssEntityMap: issEntityMap, } manager.Functions = template.FuncMap{ - "IssToEntity": manager.IssMapper, + "IssToEntity": manager.IssEntityMapper, "HashID": manager.getHashID, "IssToSnappID": IssuerToSnappID, "IssToPeer": peerOfAudience, @@ -131,8 +131,8 @@ func (t Manager) getHashID(hashType HashType, sub string, audience snappids.Audi return sub, nil } -func (t Manager) IssMapper(iss string) string { - result, ok := t.IssMap[iss] +func (t Manager) IssEntityMapper(iss string) string { + result, ok := t.IssEntityMap[iss] if ok { return result } diff --git a/internal/topics/manager_test.go b/internal/topics/manager_test.go index dc669826..262d31e5 100644 --- a/internal/topics/manager_test.go +++ b/internal/topics/manager_test.go @@ -144,7 +144,7 @@ func TestTopic_GetType(t *testing.T) { }, } // nolint: exhaustruct - topicManager := topics.NewTopicManager(cfg.Topics, hid, "snapp", cfg.IssMapper) + topicManager := topics.NewTopicManager(cfg.Topics, hid, "snapp", cfg.IssEntityMap) sub := "DXKgaNQa7N5Y7bo" From 64b5c476697a612ebc61f8550eb2da795a06a1af Mon Sep 17 00:00:00 2001 From: Mehdi Teymorian Date: Sat, 13 Aug 2022 10:22:15 +0430 Subject: [PATCH 261/660] feat: add iss peer map to config --- internal/config/config.go | 1 + internal/config/default.go | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/internal/config/config.go b/internal/config/config.go index 49230c23..c9ffd2cb 100644 --- a/internal/config/config.go +++ b/internal/config/config.go @@ -40,6 +40,7 @@ type ( Topics []topics.Topic `koanf:"topics"` Keys map[string]string `koanf:"keys"` IssEntityMap map[string]string `koanf:"iss_entity_map"` + IssPeerMap map[string]string `koanf:"iss_peer_map"` } ) diff --git a/internal/config/default.go b/internal/config/default.go index d65c09da..a0be0a77 100644 --- a/internal/config/default.go +++ b/internal/config/default.go @@ -164,5 +164,9 @@ zQIDAQAB "0": "driver", "1": "passenger", }, + IssPeerMap: map[string]string{ + "0": "passenger", + "1": "driver", + }, } } From 732de44e87c95f3394b60a4dc3ee986bca760bee Mon Sep 17 00:00:00 2001 From: Mehdi Teymorian Date: Sat, 13 Aug 2022 10:45:44 +0430 Subject: [PATCH 262/660] feat: add iss peer map to topic manager --- internal/authenticator/authenticator_test.go | 4 ++-- internal/authenticator/builder.go | 2 +- internal/topics/manager.go | 4 +++- internal/topics/manager_test.go | 2 +- 4 files changed, 7 insertions(+), 5 deletions(-) diff --git a/internal/authenticator/authenticator_test.go b/internal/authenticator/authenticator_test.go index 8ff055cd..ca6a2e90 100644 --- a/internal/authenticator/authenticator_test.go +++ b/internal/authenticator/authenticator_test.go @@ -119,7 +119,7 @@ func (suite *AuthenticatorTestSuite) SetupSuite() { }, AllowedAccessTypes: []acl.AccessType{acl.Pub, acl.Sub, acl.PubSub}, Company: "snapp", - TopicManager: topics.NewTopicManager(cfg.Topics, hid, "snapp", cfg.IssEntityMap), + TopicManager: topics.NewTopicManager(cfg.Topics, hid, "snapp", cfg.IssEntityMap, cfg.IssPeerMap), } } @@ -355,7 +355,7 @@ func TestAuthenticator_ValidateTopicBySender(t *testing.T) { authenticator := authenticator.Authenticator{ AllowedAccessTypes: []acl.AccessType{acl.Pub, acl.Sub}, Company: "snapp", - TopicManager: topics.NewTopicManager(cfg.Topics, hid, "snapp", cfg.IssEntityMap), + TopicManager: topics.NewTopicManager(cfg.Topics, hid, "snapp", cfg.IssEntityMap, cfg.IssPeerMap), } t.Run("testing valid driver cab event", func(t *testing.T) { diff --git a/internal/authenticator/builder.go b/internal/authenticator/builder.go index 2039f2f7..94a2c620 100644 --- a/internal/authenticator/builder.go +++ b/internal/authenticator/builder.go @@ -28,7 +28,7 @@ func (b Builder) Authenticators() map[string]*Authenticator { PublicKeys: publicKeys, AllowedAccessTypes: allowedAccessTypes, Company: vendor.Company, - TopicManager: topics.NewTopicManager(vendor.Topics, hid, vendor.Company, vendor.IssEntityMap), + TopicManager: topics.NewTopicManager(vendor.Topics, hid, vendor.Company, vendor.IssEntityMap, vendor.IssPeerMap), } all[vendor.Company] = auth diff --git a/internal/topics/manager.go b/internal/topics/manager.go index 4d2cbcd6..794da51d 100644 --- a/internal/topics/manager.go +++ b/internal/topics/manager.go @@ -47,11 +47,12 @@ type Manager struct { Company string TopicTemplates []Template IssEntityMap map[string]string + IssPeerMap map[string]string Functions template.FuncMap } // NewTopicManager returns a topic manager to validate topics. -func NewTopicManager(topicList []Topic, hashIDManager *snappids.HashIDSManager, company string, issEntityMap map[string]string) Manager { +func NewTopicManager(topicList []Topic, hashIDManager *snappids.HashIDSManager, company string, issEntityMap, issPeerMap map[string]string) Manager { templates := make([]Template, 0) for _, topic := range topicList { @@ -69,6 +70,7 @@ func NewTopicManager(topicList []Topic, hashIDManager *snappids.HashIDSManager, Company: company, TopicTemplates: templates, IssEntityMap: issEntityMap, + IssPeerMap: issPeerMap, } manager.Functions = template.FuncMap{ diff --git a/internal/topics/manager_test.go b/internal/topics/manager_test.go index 262d31e5..036f2c51 100644 --- a/internal/topics/manager_test.go +++ b/internal/topics/manager_test.go @@ -144,7 +144,7 @@ func TestTopic_GetType(t *testing.T) { }, } // nolint: exhaustruct - topicManager := topics.NewTopicManager(cfg.Topics, hid, "snapp", cfg.IssEntityMap) + topicManager := topics.NewTopicManager(cfg.Topics, hid, "snapp", cfg.IssEntityMap, cfg.IssPeerMap) sub := "DXKgaNQa7N5Y7bo" From bf577399f9b7e16f8ee090c9698fd199c8fd6cb2 Mon Sep 17 00:00:00 2001 From: Mehdi Teymorian Date: Sat, 13 Aug 2022 10:47:04 +0430 Subject: [PATCH 263/660] feat: add iss peer mapper to template functions --- internal/topics/manager.go | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/internal/topics/manager.go b/internal/topics/manager.go index 794da51d..4e047cf1 100644 --- a/internal/topics/manager.go +++ b/internal/topics/manager.go @@ -77,7 +77,7 @@ func NewTopicManager(topicList []Topic, hashIDManager *snappids.HashIDSManager, "IssToEntity": manager.IssEntityMapper, "HashID": manager.getHashID, "IssToSnappID": IssuerToSnappID, - "IssToPeer": peerOfAudience, + "IssToPeer": manager.IssPeerMapper, } return manager @@ -142,6 +142,15 @@ func (t Manager) IssEntityMapper(iss string) string { return iss } +func (t Manager) IssPeerMapper(iss string) string { + result, ok := t.IssPeerMap[iss] + if ok { + return result + } + + return iss +} + // IssuerToAudience returns corresponding audience in snappids form. func IssuerToAudience(issuer string) (snappids.Audience, string) { switch issuer { From 77b60cba1d55c9a463be5ad2e4d7cf9002619eed Mon Sep 17 00:00:00 2001 From: Mehdi Teymorian Date: Sat, 13 Aug 2022 10:56:00 +0430 Subject: [PATCH 264/660] feat: remove err in getHashID --- internal/topics/manager.go | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/internal/topics/manager.go b/internal/topics/manager.go index 4e047cf1..8b4f6783 100644 --- a/internal/topics/manager.go +++ b/internal/topics/manager.go @@ -93,16 +93,13 @@ func (t Manager) ValidateTopic(topic, iss, sub string) *Template { fields["peer"] = peerOfAudience(audienceStr) for _, topicTemplate := range t.TopicTemplates { - hashID, err := t.getHashID(topicTemplate.HashType, sub, audience) - if err != nil { - return nil - } + hashID := t.getHashID(topicTemplate.HashType, sub, audience) fields["hashId"] = hashID regex := new(strings.Builder) - err = topicTemplate.Template.Execute(regex, fields) + err := topicTemplate.Template.Execute(regex, fields) if err != nil { return nil } @@ -118,19 +115,19 @@ func (t Manager) ValidateTopic(topic, iss, sub string) *Template { // getHashID calculate hashID based on hashType. // most of the topics have hashID type for their hashIDs but some old topics have different hashTypes. // if hashType is equal to hashID, sub is returned without any changes. -func (t Manager) getHashID(hashType HashType, sub string, audience snappids.Audience) (string, error) { +func (t Manager) getHashID(hashType HashType, sub string, audience snappids.Audience) string { if hashType == MD5 { id, err := t.HashIDSManager.DecodeHashID(sub, audience) if err != nil { - return "", ErrDecodeHashID + return "" } hid := md5.Sum([]byte(fmt.Sprintf("%s-%s", EmqCabHashPrefix, strconv.Itoa(id)))) // nolint:gosec - return fmt.Sprintf("%x", hid), nil + return fmt.Sprintf("%x", hid) } - return sub, nil + return sub } func (t Manager) IssEntityMapper(iss string) string { From e73d675e3475e010119bb29cfa76d9ef57d1d3f4 Mon Sep 17 00:00:00 2001 From: Mehdi Teymorian Date: Sat, 13 Aug 2022 11:00:12 +0430 Subject: [PATCH 265/660] feat: add functions to template execution --- internal/topics/manager.go | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/internal/topics/manager.go b/internal/topics/manager.go index 8b4f6783..bb34d12e 100644 --- a/internal/topics/manager.go +++ b/internal/topics/manager.go @@ -85,21 +85,17 @@ func NewTopicManager(topicList []Topic, hashIDManager *snappids.HashIDSManager, // ValidateTopic checks if a topic is valid based on the given parameters. func (t Manager) ValidateTopic(topic, iss, sub string) *Template { - audience, audienceStr := IssuerToAudience(iss) - - fields := make(map[string]string) - fields["audience"] = audienceStr + fields := make(map[string]any) + fields["iss"] = iss fields["company"] = t.Company - fields["peer"] = peerOfAudience(audienceStr) + fields["sub"] = sub for _, topicTemplate := range t.TopicTemplates { - hashID := t.getHashID(topicTemplate.HashType, sub, audience) - - fields["hashId"] = hashID + fields["hashType"] = topicTemplate.HashType regex := new(strings.Builder) - err := topicTemplate.Template.Execute(regex, fields) + err := topicTemplate.Template.Funcs(t.Functions).Execute(regex, fields) if err != nil { return nil } From 1338b5fafa5e76e004e4b7a901e30896b509fc0e Mon Sep 17 00:00:00 2001 From: Mehdi Teymorian Date: Sat, 13 Aug 2022 11:02:28 +0430 Subject: [PATCH 266/660] refactor: rename issuer to snappID --- internal/topics/manager.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/internal/topics/manager.go b/internal/topics/manager.go index bb34d12e..47a3b78b 100644 --- a/internal/topics/manager.go +++ b/internal/topics/manager.go @@ -76,7 +76,7 @@ func NewTopicManager(topicList []Topic, hashIDManager *snappids.HashIDSManager, manager.Functions = template.FuncMap{ "IssToEntity": manager.IssEntityMapper, "HashID": manager.getHashID, - "IssToSnappID": IssuerToSnappID, + "IssToSnappID": IssToSnappID, "IssToPeer": manager.IssPeerMapper, } @@ -158,8 +158,8 @@ func IssuerToAudience(issuer string) (snappids.Audience, string) { } } -// IssuerToSnappID returns corresponding audience in snappids form. -func IssuerToSnappID(issuer string) snappids.Audience { +// IssToSnappID returns corresponding audience in snappids form. +func IssToSnappID(issuer string) snappids.Audience { switch issuer { case user.Passenger: return snappids.PassengerAudience From 0c90a08f1d1966b1e326912f1a9199a711187803 Mon Sep 17 00:00:00 2001 From: Mehdi Teymorian Date: Sat, 13 Aug 2022 11:04:56 +0430 Subject: [PATCH 267/660] feat: set iss as local variable --- internal/topics/manager.go | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/internal/topics/manager.go b/internal/topics/manager.go index 47a3b78b..fde84f37 100644 --- a/internal/topics/manager.go +++ b/internal/topics/manager.go @@ -49,6 +49,8 @@ type Manager struct { IssEntityMap map[string]string IssPeerMap map[string]string Functions template.FuncMap + + currentIss string } // NewTopicManager returns a topic manager to validate topics. @@ -76,7 +78,7 @@ func NewTopicManager(topicList []Topic, hashIDManager *snappids.HashIDSManager, manager.Functions = template.FuncMap{ "IssToEntity": manager.IssEntityMapper, "HashID": manager.getHashID, - "IssToSnappID": IssToSnappID, + "IssToSnappID": manager.IssToSnappID, "IssToPeer": manager.IssPeerMapper, } @@ -90,6 +92,8 @@ func (t Manager) ValidateTopic(topic, iss, sub string) *Template { fields["company"] = t.Company fields["sub"] = sub + t.currentIss = iss + for _, topicTemplate := range t.TopicTemplates { fields["hashType"] = topicTemplate.HashType @@ -126,7 +130,9 @@ func (t Manager) getHashID(hashType HashType, sub string, audience snappids.Audi return sub } -func (t Manager) IssEntityMapper(iss string) string { +func (t Manager) IssEntityMapper() string { + iss := t.currentIss + result, ok := t.IssEntityMap[iss] if ok { return result @@ -135,7 +141,9 @@ func (t Manager) IssEntityMapper(iss string) string { return iss } -func (t Manager) IssPeerMapper(iss string) string { +func (t Manager) IssPeerMapper() string { + iss := t.currentIss + result, ok := t.IssPeerMap[iss] if ok { return result @@ -159,8 +167,8 @@ func IssuerToAudience(issuer string) (snappids.Audience, string) { } // IssToSnappID returns corresponding audience in snappids form. -func IssToSnappID(issuer string) snappids.Audience { - switch issuer { +func (t Manager) IssToSnappID() snappids.Audience { + switch t.currentIss { case user.Passenger: return snappids.PassengerAudience case user.Driver: From 00ba9915fd2a476755cf522150b4497103bb973d Mon Sep 17 00:00:00 2001 From: Mehdi Teymorian Date: Sat, 13 Aug 2022 11:58:59 +0430 Subject: [PATCH 268/660] feat: update topic templates --- internal/config/default.go | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/internal/config/default.go b/internal/config/default.go index a0be0a77..8f5e0c22 100644 --- a/internal/config/default.go +++ b/internal/config/default.go @@ -50,7 +50,7 @@ func SnappVendor() Vendor { Topics: []topics.Topic{ { Type: topics.CabEvent, - Template: "^{{.audience}}-event-{{.hashId}}$", + Template: "^{{IssToEntity .iss}}-event-{{HashID .hashType .sub (IssToSnappID .iss)}}$", HashType: topics.MD5, Accesses: map[string]acl.AccessType{ topics.DriverIss: acl.Sub, @@ -59,7 +59,7 @@ func SnappVendor() Vendor { }, { Type: topics.DriverLocation, - Template: "^{{.company}}/driver/{{.hashId}}/location$", + Template: "^{{.company}}/driver/{{HashID .hashType .sub (IssToSnappID .iss)}}/location$", HashType: topics.HashID, Accesses: map[string]acl.AccessType{ topics.DriverIss: acl.Pub, @@ -68,7 +68,7 @@ func SnappVendor() Vendor { }, { Type: topics.PassengerLocation, - Template: "^{{.company}}/passenger/{{.hashId}}/location$", + Template: "^{{.company}}/passenger/{{HashID .hashType .sub (IssToSnappID .iss)}}/location$", HashType: topics.HashID, Accesses: map[string]acl.AccessType{ topics.DriverIss: acl.Pub, @@ -77,7 +77,7 @@ func SnappVendor() Vendor { }, { Type: topics.SuperappEvent, - Template: "^{{.company}}/{{.audience}}/{{.hashId}}/superapp$", + Template: "^{{.company}}/{{IssToEntity .iss}}/{{HashID .hashType .sub (IssToSnappID .iss)}}/superapp$", HashType: topics.HashID, Accesses: map[string]acl.AccessType{ topics.DriverIss: acl.Sub, @@ -95,7 +95,7 @@ func SnappVendor() Vendor { }, { Type: topics.SharedLocation, - Template: "^{{.company}}/{{.audience}}/{{.hashId}}/{{.peer}}-location$", + Template: "^{{.company}}/{{IssToEntity .iss}}/{{HashID .hashType .sub (IssToSnappID .iss)}}/{{IssToPeer .iss}}-location$", HashType: topics.HashID, Accesses: map[string]acl.AccessType{ topics.DriverIss: acl.Sub, @@ -104,7 +104,7 @@ func SnappVendor() Vendor { }, { Type: topics.Chat, - Template: "^{{.company}}/{{.audience}}/{{.hashId}}/chat$", + Template: "^{{.company}}/{{IssToEntity .iss}}/{{HashID .hashType .sub (IssToSnappID .iss)}}/chat$", HashType: topics.HashID, Accesses: map[string]acl.AccessType{ topics.DriverIss: acl.Sub, @@ -113,7 +113,7 @@ func SnappVendor() Vendor { }, { Type: topics.GeneralCallEntry, - Template: "^shared/{{.company}}/{{.audience}}/{{.hashId}}/call/send$", + Template: "^shared/{{.company}}/{{IssToEntity .iss}}/{{HashID .hashType .sub (IssToSnappID .iss)}}/call/send$", HashType: topics.HashID, Accesses: map[string]acl.AccessType{ topics.DriverIss: acl.Pub, @@ -122,7 +122,7 @@ func SnappVendor() Vendor { }, { Type: topics.NodeCallEntry, - Template: "^{{.company}}/{{.audience}}/{{.hashId}}/call/[a-zA-Z0-9-_]+/send$", + Template: "^{{.company}}/{{IssToEntity .iss}}/{{HashID .hashType .sub (IssToSnappID .iss)}}/call/[a-zA-Z0-9-_]+/send$", HashType: topics.HashID, Accesses: map[string]acl.AccessType{ topics.DriverIss: acl.Pub, @@ -131,7 +131,7 @@ func SnappVendor() Vendor { }, { Type: topics.CallOutgoing, - Template: "^{{.company}}/{{.audience}}/{{.hashId}}/call/receive$", + Template: "^{{.company}}/{{IssToEntity .iss}}/{{HashID .hashType .sub (IssToSnappID .iss)}}/call/receive$", HashType: topics.HashID, Accesses: map[string]acl.AccessType{ topics.DriverIss: acl.Sub, From dedfe816619c8da8ef5447b0c8816a3665c46e41 Mon Sep 17 00:00:00 2001 From: Mehdi Teymorian Date: Sat, 13 Aug 2022 12:00:09 +0430 Subject: [PATCH 269/660] fix: rearrange initialization to pass functions to template parsing --- internal/topics/manager.go | 33 +++++++++++++++++---------------- 1 file changed, 17 insertions(+), 16 deletions(-) diff --git a/internal/topics/manager.go b/internal/topics/manager.go index fde84f37..af51f49d 100644 --- a/internal/topics/manager.go +++ b/internal/topics/manager.go @@ -54,23 +54,10 @@ type Manager struct { } // NewTopicManager returns a topic manager to validate topics. -func NewTopicManager(topicList []Topic, hashIDManager *snappids.HashIDSManager, company string, issEntityMap, issPeerMap map[string]string) Manager { - templates := make([]Template, 0) - - for _, topic := range topicList { - each := Template{ - Type: topic.Type, - Template: template.Must(template.New(topic.Type).Parse(topic.Template)), - HashType: topic.HashType, - Accesses: topic.Accesses, - } - templates = append(templates, each) - } - - manager := Manager{ +func NewTopicManager(topicList []Topic, hashIDManager *snappids.HashIDSManager, company string, issEntityMap, issPeerMap map[string]string) *Manager { + manager := &Manager{ HashIDSManager: hashIDManager, Company: company, - TopicTemplates: templates, IssEntityMap: issEntityMap, IssPeerMap: issPeerMap, } @@ -82,6 +69,20 @@ func NewTopicManager(topicList []Topic, hashIDManager *snappids.HashIDSManager, "IssToPeer": manager.IssPeerMapper, } + templates := make([]Template, 0) + + for _, topic := range topicList { + each := Template{ + Type: topic.Type, + Template: template.Must(template.New(topic.Type).Funcs(manager.Functions).Parse(topic.Template)), + HashType: topic.HashType, + Accesses: topic.Accesses, + } + templates = append(templates, each) + } + + manager.TopicTemplates = templates + return manager } @@ -99,7 +100,7 @@ func (t Manager) ValidateTopic(topic, iss, sub string) *Template { regex := new(strings.Builder) - err := topicTemplate.Template.Funcs(t.Functions).Execute(regex, fields) + err := topicTemplate.Template.Execute(regex, fields) if err != nil { return nil } From 643179a0742467f1321353c106ddd533375d4582 Mon Sep 17 00:00:00 2001 From: Mehdi Teymorian Date: Sat, 13 Aug 2022 12:00:58 +0430 Subject: [PATCH 270/660] feat: pass iss to functions --- internal/topics/manager.go | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/internal/topics/manager.go b/internal/topics/manager.go index af51f49d..9e517426 100644 --- a/internal/topics/manager.go +++ b/internal/topics/manager.go @@ -49,8 +49,6 @@ type Manager struct { IssEntityMap map[string]string IssPeerMap map[string]string Functions template.FuncMap - - currentIss string } // NewTopicManager returns a topic manager to validate topics. @@ -93,8 +91,6 @@ func (t Manager) ValidateTopic(topic, iss, sub string) *Template { fields["company"] = t.Company fields["sub"] = sub - t.currentIss = iss - for _, topicTemplate := range t.TopicTemplates { fields["hashType"] = topicTemplate.HashType @@ -131,9 +127,7 @@ func (t Manager) getHashID(hashType HashType, sub string, audience snappids.Audi return sub } -func (t Manager) IssEntityMapper() string { - iss := t.currentIss - +func (t *Manager) IssEntityMapper(iss string) string { result, ok := t.IssEntityMap[iss] if ok { return result @@ -142,9 +136,7 @@ func (t Manager) IssEntityMapper() string { return iss } -func (t Manager) IssPeerMapper() string { - iss := t.currentIss - +func (t *Manager) IssPeerMapper(iss string) string { result, ok := t.IssPeerMap[iss] if ok { return result @@ -168,8 +160,8 @@ func IssuerToAudience(issuer string) (snappids.Audience, string) { } // IssToSnappID returns corresponding audience in snappids form. -func (t Manager) IssToSnappID() snappids.Audience { - switch t.currentIss { +func (t *Manager) IssToSnappID(iss string) snappids.Audience { + switch iss { case user.Passenger: return snappids.PassengerAudience case user.Driver: From b49e77269389f0b3742f8f147d432d02478810c5 Mon Sep 17 00:00:00 2001 From: Mehdi Teymorian Date: Sat, 13 Aug 2022 12:01:35 +0430 Subject: [PATCH 271/660] feat: add pointer to manager --- internal/authenticator/authenticator.go | 2 +- internal/topics/manager.go | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/internal/authenticator/authenticator.go b/internal/authenticator/authenticator.go index 7d2ab1a8..89ff256d 100644 --- a/internal/authenticator/authenticator.go +++ b/internal/authenticator/authenticator.go @@ -58,7 +58,7 @@ func (err InvalidTopicError) Error() string { type Authenticator struct { PublicKeys map[string]*rsa.PublicKey AllowedAccessTypes []acl.AccessType - TopicManager topics.Manager + TopicManager *topics.Manager Company string } diff --git a/internal/topics/manager.go b/internal/topics/manager.go index 9e517426..e735d95f 100644 --- a/internal/topics/manager.go +++ b/internal/topics/manager.go @@ -85,7 +85,7 @@ func NewTopicManager(topicList []Topic, hashIDManager *snappids.HashIDSManager, } // ValidateTopic checks if a topic is valid based on the given parameters. -func (t Manager) ValidateTopic(topic, iss, sub string) *Template { +func (t *Manager) ValidateTopic(topic, iss, sub string) *Template { fields := make(map[string]any) fields["iss"] = iss fields["company"] = t.Company @@ -112,7 +112,7 @@ func (t Manager) ValidateTopic(topic, iss, sub string) *Template { // getHashID calculate hashID based on hashType. // most of the topics have hashID type for their hashIDs but some old topics have different hashTypes. // if hashType is equal to hashID, sub is returned without any changes. -func (t Manager) getHashID(hashType HashType, sub string, audience snappids.Audience) string { +func (t *Manager) getHashID(hashType HashType, sub string, audience snappids.Audience) string { if hashType == MD5 { id, err := t.HashIDSManager.DecodeHashID(sub, audience) if err != nil { From 729c963b05c39897281b5e9b182c229ad724e643 Mon Sep 17 00:00:00 2001 From: Mehdi Teymorian Date: Sat, 13 Aug 2022 12:02:10 +0430 Subject: [PATCH 272/660] refactor: remove unused functions --- internal/topics/manager.go | 25 ------------------------- 1 file changed, 25 deletions(-) diff --git a/internal/topics/manager.go b/internal/topics/manager.go index e735d95f..13ab2615 100644 --- a/internal/topics/manager.go +++ b/internal/topics/manager.go @@ -145,20 +145,6 @@ func (t *Manager) IssPeerMapper(iss string) string { return iss } -// IssuerToAudience returns corresponding audience in snappids form. -func IssuerToAudience(issuer string) (snappids.Audience, string) { - switch issuer { - case user.Passenger: - return snappids.PassengerAudience, Passenger - case user.Driver: - return snappids.DriverAudience, Driver - case user.None: - fallthrough - default: - return -1, "" - } -} - // IssToSnappID returns corresponding audience in snappids form. func (t *Manager) IssToSnappID(iss string) snappids.Audience { switch iss { @@ -172,14 +158,3 @@ func (t *Manager) IssToSnappID(iss string) snappids.Audience { return -1 } } - -func peerOfAudience(audience string) string { - switch audience { - case Driver: - return Passenger - case Passenger: - return Driver - default: - return "" - } -} From 003bcaca2baf2ad76b82c810ec4f30a046773775 Mon Sep 17 00:00:00 2001 From: Mehdi Teymorian Date: Sat, 13 Aug 2022 15:04:07 +0430 Subject: [PATCH 273/660] refactor: remove unused err --- internal/topics/manager.go | 3 --- 1 file changed, 3 deletions(-) diff --git a/internal/topics/manager.go b/internal/topics/manager.go index 13ab2615..5482194c 100644 --- a/internal/topics/manager.go +++ b/internal/topics/manager.go @@ -5,7 +5,6 @@ package topics import ( "crypto/md5" // nolint: gosec - "errors" "fmt" "regexp" "strconv" @@ -40,8 +39,6 @@ const ( // EmqCabHashPrefix is the default prefix for hashing part of cab topic, default value is 'emqch'. const EmqCabHashPrefix = "emqch" -var ErrDecodeHashID = errors.New("could not decode hash id") - type Manager struct { HashIDSManager *snappids.HashIDSManager Company string From d1663818c3e9da75da501fc3bda81b65ff7172e4 Mon Sep 17 00:00:00 2001 From: Mehdi Teymorian Date: Sat, 13 Aug 2022 15:28:17 +0430 Subject: [PATCH 274/660] refactor: fix lint issues --- internal/api/api.go | 2 +- internal/authenticator/builder.go | 8 +++++++- internal/cmd/root.go | 2 +- internal/cmd/serve/main.go | 2 +- internal/config/default.go | 4 ++-- internal/topics/manager.go | 13 +++++++++---- pkg/acl/acl.go | 2 +- 7 files changed, 22 insertions(+), 11 deletions(-) diff --git a/internal/api/api.go b/internal/api/api.go index b82d44d9..016c9b8d 100644 --- a/internal/api/api.go +++ b/internal/api/api.go @@ -30,7 +30,7 @@ func MetricLogSkipper(ctx *fiber.Ctx) bool { func (a API) ReSTServer() *fiber.App { app := fiber.New() - // nolint: exhaustruct + //nolint: exhaustruct app.Use(fiberzap.New(fiberzap.Config{ Next: MetricLogSkipper, Logger: a.Logger.Named("fiber"), diff --git a/internal/authenticator/builder.go b/internal/authenticator/builder.go index 94a2c620..eedf3583 100644 --- a/internal/authenticator/builder.go +++ b/internal/authenticator/builder.go @@ -28,7 +28,13 @@ func (b Builder) Authenticators() map[string]*Authenticator { PublicKeys: publicKeys, AllowedAccessTypes: allowedAccessTypes, Company: vendor.Company, - TopicManager: topics.NewTopicManager(vendor.Topics, hid, vendor.Company, vendor.IssEntityMap, vendor.IssPeerMap), + TopicManager: topics.NewTopicManager( + vendor.Topics, + hid, + vendor.Company, + vendor.IssEntityMap, + vendor.IssPeerMap, + ), } all[vendor.Company] = auth diff --git a/internal/cmd/root.go b/internal/cmd/root.go index af9bde58..0783efc1 100644 --- a/internal/cmd/root.go +++ b/internal/cmd/root.go @@ -23,7 +23,7 @@ func Execute() { tracer := tracing.New(cfg.Tracer, logger.Named("tracer")) - // nolint: exhaustruct + //nolint: exhaustruct root := &cobra.Command{ Use: "soteria", Short: "Soteria is the authentication service.", diff --git a/internal/cmd/serve/main.go b/internal/cmd/serve/main.go index 327b9d6b..cd4b7b2d 100644 --- a/internal/cmd/serve/main.go +++ b/internal/cmd/serve/main.go @@ -46,7 +46,7 @@ func (s Serve) main() { // Register serve command. func (s Serve) Register(root *cobra.Command) { root.AddCommand( - // nolint: exhaustruct + //nolint: exhaustruct &cobra.Command{ Use: "serve", Short: "serve runs the application", diff --git a/internal/config/default.go b/internal/config/default.go index 8f5e0c22..f1cdf868 100644 --- a/internal/config/default.go +++ b/internal/config/default.go @@ -95,7 +95,7 @@ func SnappVendor() Vendor { }, { Type: topics.SharedLocation, - Template: "^{{.company}}/{{IssToEntity .iss}}/{{HashID .hashType .sub (IssToSnappID .iss)}}/{{IssToPeer .iss}}-location$", + Template: "^{{.company}}/{{IssToEntity .iss}}/{{HashID .hashType .sub (IssToSnappID .iss)}}/{{IssToPeer .iss}}-location$", //nolint:lll HashType: topics.HashID, Accesses: map[string]acl.AccessType{ topics.DriverIss: acl.Sub, @@ -122,7 +122,7 @@ func SnappVendor() Vendor { }, { Type: topics.NodeCallEntry, - Template: "^{{.company}}/{{IssToEntity .iss}}/{{HashID .hashType .sub (IssToSnappID .iss)}}/call/[a-zA-Z0-9-_]+/send$", + Template: "^{{.company}}/{{IssToEntity .iss}}/{{HashID .hashType .sub (IssToSnappID .iss)}}/call/[a-zA-Z0-9-_]+/send$", //nolint: lll HashType: topics.HashID, Accesses: map[string]acl.AccessType{ topics.DriverIss: acl.Pub, diff --git a/internal/topics/manager.go b/internal/topics/manager.go index 5482194c..99f00e27 100644 --- a/internal/topics/manager.go +++ b/internal/topics/manager.go @@ -4,7 +4,7 @@ package topics import ( - "crypto/md5" // nolint: gosec + "crypto/md5" //nolint: gosec "fmt" "regexp" "strconv" @@ -49,8 +49,13 @@ type Manager struct { } // NewTopicManager returns a topic manager to validate topics. -func NewTopicManager(topicList []Topic, hashIDManager *snappids.HashIDSManager, company string, issEntityMap, issPeerMap map[string]string) *Manager { - manager := &Manager{ +func NewTopicManager( + topicList []Topic, + hashIDManager *snappids.HashIDSManager, + company string, + issEntityMap, issPeerMap map[string]string, +) *Manager { + manager := &Manager{ //nolint: exhaustruct HashIDSManager: hashIDManager, Company: company, IssEntityMap: issEntityMap, @@ -116,7 +121,7 @@ func (t *Manager) getHashID(hashType HashType, sub string, audience snappids.Aud return "" } - hid := md5.Sum([]byte(fmt.Sprintf("%s-%s", EmqCabHashPrefix, strconv.Itoa(id)))) // nolint:gosec + hid := md5.Sum([]byte(fmt.Sprintf("%s-%s", EmqCabHashPrefix, strconv.Itoa(id)))) //nolint:gosec return fmt.Sprintf("%x", hid) } diff --git a/pkg/acl/acl.go b/pkg/acl/acl.go index 87db3046..bfdb4ce0 100644 --- a/pkg/acl/acl.go +++ b/pkg/acl/acl.go @@ -13,7 +13,7 @@ const ( ) func (a AccessType) String() string { - switch a { // nolint:exhaustive + switch a { //nolint:exhaustive case Sub: return "subscribe" case Pub: From 6fbf50e36c79e62bbe2762adeeacbd87de3c384b Mon Sep 17 00:00:00 2001 From: Mehdi Teymorian Date: Sat, 13 Aug 2022 15:43:54 +0430 Subject: [PATCH 275/660] refactor: rename validateTopic to ParseTopic --- internal/authenticator/authenticator.go | 2 +- internal/authenticator/authenticator_test.go | 2 +- internal/topics/manager.go | 4 ++-- internal/topics/manager_test.go | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/internal/authenticator/authenticator.go b/internal/authenticator/authenticator.go index 89ff256d..30ea006b 100644 --- a/internal/authenticator/authenticator.go +++ b/internal/authenticator/authenticator.go @@ -150,7 +150,7 @@ func (a Authenticator) ACL( sub, _ := claims["sub"].(string) - topicTemplate := a.TopicManager.ValidateTopic(topic, issuer, sub) + topicTemplate := a.TopicManager.ParseTopic(topic, issuer, sub) if topicTemplate == nil { return false, InvalidTopicError{Topic: topic} } diff --git a/internal/authenticator/authenticator_test.go b/internal/authenticator/authenticator_test.go index ca6a2e90..64a0275d 100644 --- a/internal/authenticator/authenticator_test.go +++ b/internal/authenticator/authenticator_test.go @@ -359,7 +359,7 @@ func TestAuthenticator_ValidateTopicBySender(t *testing.T) { } t.Run("testing valid driver cab event", func(t *testing.T) { - topicTemplate := authenticator.TopicManager.ValidateTopic(validDriverCabEventTopic, user.Driver, "DXKgaNQa7N5Y7bo") + topicTemplate := authenticator.TopicManager.ParseTopic(validDriverCabEventTopic, user.Driver, "DXKgaNQa7N5Y7bo") assert.True(t, topicTemplate != nil) }) } diff --git a/internal/topics/manager.go b/internal/topics/manager.go index 99f00e27..ab5bd566 100644 --- a/internal/topics/manager.go +++ b/internal/topics/manager.go @@ -86,8 +86,8 @@ func NewTopicManager( return manager } -// ValidateTopic checks if a topic is valid based on the given parameters. -func (t *Manager) ValidateTopic(topic, iss, sub string) *Template { +// ParseTopic checks if a topic is valid based on the given parameters. +func (t *Manager) ParseTopic(topic, iss, sub string) *Template { fields := make(map[string]any) fields["iss"] = iss fields["company"] = t.Company diff --git a/internal/topics/manager_test.go b/internal/topics/manager_test.go index 036f2c51..1490f6fd 100644 --- a/internal/topics/manager_test.go +++ b/internal/topics/manager_test.go @@ -154,7 +154,7 @@ func TestTopic_GetType(t *testing.T) { t.Parallel() topic := tc.arg - topicTemplate := topicManager.ValidateTopic(topic, tc.issuer, sub) + topicTemplate := topicManager.ParseTopic(topic, tc.issuer, sub) if topicTemplate != nil { if len(tc.want) == 0 { t.Errorf("topic %s is invalid, must throw error.", tc.arg) From ee615631e5a3891072695e3318716f5601465dac Mon Sep 17 00:00:00 2001 From: Mehdi Teymorian Date: Sat, 13 Aug 2022 15:52:33 +0430 Subject: [PATCH 276/660] feat: update chart config --- deployments/soteria/values.yaml | 48 ++++++++++++++++++--------------- 1 file changed, 27 insertions(+), 21 deletions(-) diff --git a/deployments/soteria/values.yaml b/deployments/soteria/values.yaml index 216b1e86..68a20858 100644 --- a/deployments/soteria/values.yaml +++ b/deployments/soteria/values.yaml @@ -123,25 +123,31 @@ vendors: accesses: driver: '1' passenger: '1' - passenger_key: |- - -----BEGIN PUBLIC KEY----- - MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA1lNRwyNsDieWs6LvHOJ+ - GyehhRC4Pn5yL5edKP3565F3LtRDMrkzwDRsQbqnUtTea9HCdTdBv+lI8vE17qRi - RQn10IMaIH6e4Aa3OWNClFhuqNOag7VmffsjTOgxHgHpfGAKVF/4BwqOHrdHFbAD - VOiWB1hv9Uc0C5laffGAub7fj+EAI02zlrsNDxYW8vyF2H47N7VWcvgd3RhZpxlG - 8bq9phl7Ja55YmQiT2Ic3/K5tsazg5z9lz6OTrx+JvWbefHFlJpjCLz5yefEaRmX - 9L/zyDMi4jgFTZEWNXC2vIrxwZMFwFhBXEp0PcCbuHJgJIucbRrbwukQC16uHJwP - zQIDAQAB - -----END PUBLIC KEY----- - driver_key: |- - -----BEGIN PUBLIC KEY----- - MIIBITANBgkqhkiG9w0BAQEFAAOCAQ4AMIIBCQKCAQBk7O6M5p4eYNAwtVU2beGa - W4mhFG94OtYUWDl1E7UUrhUNGf97Eb/45NjQszu0YPERnApJc2RUm2TrS7iq0mHz - Xbwf+CbNF54Q5mjuHcpBKgvFwUUSCCYBftmRc4xbFIH4Oh3nHC2GeukUS9TmJwjM - tJKyU0Ve8BK5BgjhagM7XSs+scE2mxemoWtcs6mJLtBuEgRGMgHW00mSdOcLp/+l - oHpSzRYN92/DomwmmjGVy8Ji0faeHx+r79ZzE0E8Rcc29Yhrg1ymrjfkXg98WjAb - TSv4UAN20lsBDejpnGEZKJrxHZ56gHgaJn6PKKCD6ItJA7y7iraCdBhCfAIUIz/z - AgMBAAE= - -----END PUBLIC KEY----- - + keys: + 1: |- + -----BEGIN PUBLIC KEY----- + MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA1lNRwyNsDieWs6LvHOJ+ + GyehhRC4Pn5yL5edKP3565F3LtRDMrkzwDRsQbqnUtTea9HCdTdBv+lI8vE17qRi + RQn10IMaIH6e4Aa3OWNClFhuqNOag7VmffsjTOgxHgHpfGAKVF/4BwqOHrdHFbAD + VOiWB1hv9Uc0C5laffGAub7fj+EAI02zlrsNDxYW8vyF2H47N7VWcvgd3RhZpxlG + 8bq9phl7Ja55YmQiT2Ic3/K5tsazg5z9lz6OTrx+JvWbefHFlJpjCLz5yefEaRmX + 9L/zyDMi4jgFTZEWNXC2vIrxwZMFwFhBXEp0PcCbuHJgJIucbRrbwukQC16uHJwP + zQIDAQAB + -----END PUBLIC KEY----- + 0: |- + -----BEGIN PUBLIC KEY----- + MIIBITANBgkqhkiG9w0BAQEFAAOCAQ4AMIIBCQKCAQBk7O6M5p4eYNAwtVU2beGa + W4mhFG94OtYUWDl1E7UUrhUNGf97Eb/45NjQszu0YPERnApJc2RUm2TrS7iq0mHz + Xbwf+CbNF54Q5mjuHcpBKgvFwUUSCCYBftmRc4xbFIH4Oh3nHC2GeukUS9TmJwjM + tJKyU0Ve8BK5BgjhagM7XSs+scE2mxemoWtcs6mJLtBuEgRGMgHW00mSdOcLp/+l + oHpSzRYN92/DomwmmjGVy8Ji0faeHx+r79ZzE0E8Rcc29Yhrg1ymrjfkXg98WjAb + TSv4UAN20lsBDejpnGEZKJrxHZ56gHgaJn6PKKCD6ItJA7y7iraCdBhCfAIUIz/z + AgMBAAE= + -----END PUBLIC KEY----- + iss_entity_map: + 0: "driver" + 1: "passenger" + iss_peer_map: + 0: "passenger" + 1: "driver" From a4b386097dd21dbaf0f5f65d276f6b2f0e085f76 Mon Sep 17 00:00:00 2001 From: Mehdi Teymorian Date: Sat, 13 Aug 2022 15:55:03 +0430 Subject: [PATCH 277/660] feat: update topic templates --- deployments/soteria/values.yaml | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/deployments/soteria/values.yaml b/deployments/soteria/values.yaml index 68a20858..6fac259a 100644 --- a/deployments/soteria/values.yaml +++ b/deployments/soteria/values.yaml @@ -64,25 +64,25 @@ vendors: allowed_access_types: [ "pub", "sub" ] topics: - type: cab_event - template: ^{{.audience}}-event-{{.hashId}}$ + template: ^{{IssToEntity .iss}}-event-{{HashID .hashType .sub (IssToSnappID .iss)}}$ hash_type: 1 accesses: driver: '1' passenger: '1' - type: driver_location - template: ^{{.company}}/driver/{{.hashId}}/location$ + template: ^{{.company}}/driver/{{HashID .hashType .sub (IssToSnappID .iss)}}/location$ hash_type: 0 accesses: driver: '2' passenger: '-1' - type: passenger_location - template: ^{{.company}}/passenger/{{.hashId}}/location$ + template: ^{{.company}}/passenger/{{HashID .hashType .sub (IssToSnappID .iss)}}/location$ hash_type: 0 accesses: driver: '2' passenger: '2' - type: superapp_event - template: ^{{.company}}/{{.audience}}/{{.hashId}}/superapp$ + template: ^{{.company}}/{{IssToEntity .iss}}/{{HashID .hashType .sub (IssToSnappID .iss)}}/superapp$ hash_type: 0 accesses: driver: '1' @@ -94,31 +94,31 @@ vendors: driver: '-1' passenger: '-1' - type: shared_location - template: ^{{.company}}/{{.audience}}/{{.hashId}}/{{.peer}}-location$ + template: ^{{.company}}/{{IssToEntity .iss}}/{{HashID .hashType .sub (IssToSnappID .iss)}}/{{IssToPeer .iss}}-location$ hash_type: 0 accesses: driver: '1' passenger: '1' - type: chat - template: ^{{.company}}/{{.audience}}/{{.hashId}}/chat$ + template: ^{{.company}}/{{IssToEntity .iss}}/{{HashID .hashType .sub (IssToSnappID .iss)}}/chat$ hash_type: 0 accesses: driver: '1' passenger: '1' - type: general_call_entry - template: ^shared/{{.company}}/{{.audience}}/{{.hashId}}/call/send$ + template: ^shared/{{.company}}/{{IssToEntity .iss}}/{{HashID .hashType .sub (IssToSnappID .iss)}}/call/send$ hash_type: 0 accesses: driver: '2' passenger: '2' - type: node_call_entry - template: ^{{.company}}/{{.audience}}/{{.hashId}}/call/[a-zA-Z0-9-_]+/send$ + template: ^{{.company}}/{{IssToEntity .iss}}/{{HashID .hashType .sub (IssToSnappID .iss)}}/call/[a-zA-Z0-9-_]+/send$ hash_type: 0 accesses: driver: '2' passenger: '2' - type: call_outgoing - template: ^{{.company}}/{{.audience}}/{{.hashId}}/call/receive$ + template: ^{{.company}}/{{IssToEntity .iss}}/{{HashID .hashType .sub (IssToSnappID .iss)}}/call/receive$ hash_type: 0 accesses: driver: '1' From 90139d97f05b531c4ce4871a1c43fb9955e52987 Mon Sep 17 00:00:00 2001 From: Mehdi Teymorian Date: Sun, 14 Aug 2022 11:54:38 +0430 Subject: [PATCH 278/660] feat: disable nolintlint --- .golangci.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.golangci.yml b/.golangci.yml index f9c375b7..7b7a75e2 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -13,6 +13,7 @@ linters: - golint - interfacer - exhaustivestruct + - nolintlint run: skip-files: - ".*_test.go" \ No newline at end of file From 9f63f8d54a4bd31744fa6e5b82187f5bda66abdd Mon Sep 17 00:00:00 2001 From: Mehdi Teymorian Date: Sun, 14 Aug 2022 11:57:04 +0430 Subject: [PATCH 279/660] refactor: update imports --- internal/authenticator/builder.go | 1 + 1 file changed, 1 insertion(+) diff --git a/internal/authenticator/builder.go b/internal/authenticator/builder.go index eedf3583..ed98ae3f 100644 --- a/internal/authenticator/builder.go +++ b/internal/authenticator/builder.go @@ -3,6 +3,7 @@ package authenticator import ( "crypto/rsa" "fmt" + "github.com/golang-jwt/jwt/v4" "gitlab.snapp.ir/dispatching/snappids/v2" "gitlab.snapp.ir/dispatching/soteria/internal/config" From 71a57bb613daba25f0685a06ed3463fc67a88479 Mon Sep 17 00:00:00 2001 From: Mehdi Teymorian Date: Sun, 14 Aug 2022 12:05:53 +0430 Subject: [PATCH 280/660] feat: update chart version --- deployments/soteria/Chart.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/deployments/soteria/Chart.yaml b/deployments/soteria/Chart.yaml index 83a180a3..5ea36780 100644 --- a/deployments/soteria/Chart.yaml +++ b/deployments/soteria/Chart.yaml @@ -5,6 +5,6 @@ description: Soteria Helm Chart type: application -version: 6.6.2 +version: 6.6.3 -appVersion: "v6-6-2" +appVersion: "v6-6-3" From df555230051d9ca23043cfafd42dc151d7a2a75a Mon Sep 17 00:00:00 2001 From: Mehdi Teymorian Date: Sun, 14 Aug 2022 15:37:29 +0430 Subject: [PATCH 281/660] refactor: rename audience to iss --- internal/topics/topic.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/internal/topics/topic.go b/internal/topics/topic.go index 6c6680d3..c0665562 100644 --- a/internal/topics/topic.go +++ b/internal/topics/topic.go @@ -41,8 +41,8 @@ func (t Template) Parse(fields map[string]string) string { } // HasAccess check if user has access on topic. -func (t Template) HasAccess(audience string, accessType acl.AccessType) bool { - access := t.Accesses[audience] +func (t Template) HasAccess(iss string, accessType acl.AccessType) bool { + access := t.Accesses[iss] return access == acl.PubSub || access == accessType } From e17ed564159c534ff59976e50f4bc652f5e3a7b0 Mon Sep 17 00:00:00 2001 From: Mehdi Teymorian Date: Sun, 14 Aug 2022 17:29:57 +0430 Subject: [PATCH 282/660] feat: add default case for iss-entity and iss-peer maps --- deployments/soteria/values.yaml | 2 ++ internal/authenticator/builder.go | 12 ++++++++++++ internal/topics/manager.go | 11 +++++++---- 3 files changed, 21 insertions(+), 4 deletions(-) diff --git a/deployments/soteria/values.yaml b/deployments/soteria/values.yaml index 6fac259a..28a31b41 100644 --- a/deployments/soteria/values.yaml +++ b/deployments/soteria/values.yaml @@ -147,7 +147,9 @@ vendors: iss_entity_map: 0: "driver" 1: "passenger" + default: "none" iss_peer_map: 0: "passenger" 1: "driver" + default: "none" diff --git a/internal/authenticator/builder.go b/internal/authenticator/builder.go index ed98ae3f..de6488aa 100644 --- a/internal/authenticator/builder.go +++ b/internal/authenticator/builder.go @@ -21,6 +21,8 @@ func (b Builder) Authenticators() map[string]*Authenticator { all := make(map[string]*Authenticator) for _, vendor := range b.Vendors { + b.ValidateMappers(vendor.IssEntityMap, vendor.IssPeerMap) + publicKeys := b.PublicKeys(vendor.Keys) hid := HIDManager(vendor.DriverSalt, vendor.DriverHashLength, vendor.PassengerSalt, vendor.PassengerHashLength) allowedAccessTypes := b.GetAllowedAccessTypes(vendor.AllowedAccessTypes) @@ -108,3 +110,13 @@ func toUserAccessType(access string) (acl.AccessType, error) { return "", fmt.Errorf("%v is a invalid acces type", access) } + +func (b Builder) ValidateMappers(issEntityMap, issPeerMap map[string]string) { + if _, ok := issEntityMap[topics.Default]; !ok { + b.Logger.Fatal("default case for iss-entity map is required") + } + + if _, ok := issPeerMap[topics.Default]; !ok { + b.Logger.Fatal("default case for iss-peer map is required") + } +} diff --git a/internal/topics/manager.go b/internal/topics/manager.go index ab5bd566..a2d78287 100644 --- a/internal/topics/manager.go +++ b/internal/topics/manager.go @@ -35,9 +35,12 @@ const ( Passenger string = "passenger" PassengerIss string = "1" ) +const ( + // EmqCabHashPrefix is the default prefix for hashing part of cab topic, default value is 'emqch'. + EmqCabHashPrefix = "emqch" -// EmqCabHashPrefix is the default prefix for hashing part of cab topic, default value is 'emqch'. -const EmqCabHashPrefix = "emqch" + Default = "default" +) type Manager struct { HashIDSManager *snappids.HashIDSManager @@ -135,7 +138,7 @@ func (t *Manager) IssEntityMapper(iss string) string { return result } - return iss + return t.IssEntityMap[Default] } func (t *Manager) IssPeerMapper(iss string) string { @@ -144,7 +147,7 @@ func (t *Manager) IssPeerMapper(iss string) string { return result } - return iss + return t.IssPeerMap[Default] } // IssToSnappID returns corresponding audience in snappids form. From 55e97f214f5d177dcea1966d070c7f39f7aad4e7 Mon Sep 17 00:00:00 2001 From: Mehdi Teymorian Date: Mon, 15 Aug 2022 09:56:37 +0430 Subject: [PATCH 283/660] feat: add jwt configuration --- internal/config/config.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/internal/config/config.go b/internal/config/config.go index c9ffd2cb..e3041729 100644 --- a/internal/config/config.go +++ b/internal/config/config.go @@ -41,6 +41,13 @@ type ( Keys map[string]string `koanf:"keys"` IssEntityMap map[string]string `koanf:"iss_entity_map"` IssPeerMap map[string]string `koanf:"iss_peer_map"` + JwtInfo JwtInfo `koanf:"jwt_info"` + } + + JwtInfo struct { + IssName string `koanf:"iss_name"` + SubName string `koanf:"sub_name"` + SigningMethod string `koanf:"signing_method"` } ) From d7485fd5914209e1e00e22352486c5a52a1b140d Mon Sep 17 00:00:00 2001 From: Mehdi Teymorian Date: Mon, 15 Aug 2022 09:58:04 +0430 Subject: [PATCH 284/660] refactor: move errors to separate file --- internal/authenticator/authenticator.go | 43 ---------------------- internal/authenticator/errors.go | 49 +++++++++++++++++++++++++ 2 files changed, 49 insertions(+), 43 deletions(-) create mode 100644 internal/authenticator/errors.go diff --git a/internal/authenticator/authenticator.go b/internal/authenticator/authenticator.go index 30ea006b..360112ed 100644 --- a/internal/authenticator/authenticator.go +++ b/internal/authenticator/authenticator.go @@ -2,7 +2,6 @@ package authenticator import ( "crypto/rsa" - "errors" "fmt" "github.com/golang-jwt/jwt/v4" @@ -12,48 +11,6 @@ import ( const DefaultVendor = "snapp" -var ( - ErrInvalidSigningMethod = errors.New("token is not valid, signing method is not RSA") - ErrIssNotFound = errors.New("could not found iss in token claims") - ErrSubNotFound = errors.New("could not found sub in token claims") - ErrInvalidClaims = errors.New("invalid claims") - ErrInvalidIP = errors.New("IP is not valid") - ErrInvalidAccessType = errors.New("requested access type is invalid") - ErrDecodeHashID = errors.New("could not decode hash id") - ErrInvalidSecret = errors.New("invalid secret") - ErrIncorrectPassword = errors.New("username or password is worng") -) - -type TopicNotAllowedError struct { - Issuer string - Sub string - AccessType acl.AccessType - Topic string - TopicType string -} - -func (err TopicNotAllowedError) Error() string { - return fmt.Sprintf("issuer %s with sub %s is not allowed to %s on topic %s (%s)", - err.Issuer, err.Sub, err.AccessType, err.Topic, err.TopicType, - ) -} - -type PublicKeyNotFoundError struct { - Issuer string -} - -func (err PublicKeyNotFoundError) Error() string { - return fmt.Sprintf("cannot find issuer %s public key", err.Issuer) -} - -type InvalidTopicError struct { - Topic string -} - -func (err InvalidTopicError) Error() string { - return fmt.Sprintf("provided topic %s is not valid", err.Topic) -} - // Authenticator is responsible for Acl/Auth/Token of users. type Authenticator struct { PublicKeys map[string]*rsa.PublicKey diff --git a/internal/authenticator/errors.go b/internal/authenticator/errors.go new file mode 100644 index 00000000..065dace4 --- /dev/null +++ b/internal/authenticator/errors.go @@ -0,0 +1,49 @@ +package authenticator + +import ( + "errors" + "fmt" + "gitlab.snapp.ir/dispatching/soteria/pkg/acl" +) + +var ( + ErrInvalidSigningMethod = errors.New("token is not valid, signing method is not RSA") + ErrIssNotFound = errors.New("could not found iss in token claims") + ErrSubNotFound = errors.New("could not found sub in token claims") + ErrInvalidClaims = errors.New("invalid claims") + ErrInvalidIP = errors.New("IP is not valid") + ErrInvalidAccessType = errors.New("requested access type is invalid") + ErrDecodeHashID = errors.New("could not decode hash id") + ErrInvalidSecret = errors.New("invalid secret") + ErrIncorrectPassword = errors.New("username or password is worng") +) + +type TopicNotAllowedError struct { + Issuer string + Sub string + AccessType acl.AccessType + Topic string + TopicType string +} + +func (err TopicNotAllowedError) Error() string { + return fmt.Sprintf("issuer %s with sub %s is not allowed to %s on topic %s (%s)", + err.Issuer, err.Sub, err.AccessType, err.Topic, err.TopicType, + ) +} + +type PublicKeyNotFoundError struct { + Issuer string +} + +func (err PublicKeyNotFoundError) Error() string { + return fmt.Sprintf("cannot find issuer %s public key", err.Issuer) +} + +type InvalidTopicError struct { + Topic string +} + +func (err InvalidTopicError) Error() string { + return fmt.Sprintf("provided topic %s is not valid", err.Topic) +} From 387d0a6bc81e8a77b6255243c1b3298ea14ffa59 Mon Sep 17 00:00:00 2001 From: Mehdi Teymorian Date: Mon, 15 Aug 2022 10:33:16 +0430 Subject: [PATCH 285/660] feat: configure authenticator using jwt info --- internal/authenticator/authenticator.go | 24 +++++++++++++----------- internal/authenticator/builder.go | 1 + 2 files changed, 14 insertions(+), 11 deletions(-) diff --git a/internal/authenticator/authenticator.go b/internal/authenticator/authenticator.go index 360112ed..d37d0fa3 100644 --- a/internal/authenticator/authenticator.go +++ b/internal/authenticator/authenticator.go @@ -5,6 +5,7 @@ import ( "fmt" "github.com/golang-jwt/jwt/v4" + "gitlab.snapp.ir/dispatching/soteria/internal/config" "gitlab.snapp.ir/dispatching/soteria/internal/topics" "gitlab.snapp.ir/dispatching/soteria/pkg/acl" ) @@ -17,13 +18,14 @@ type Authenticator struct { AllowedAccessTypes []acl.AccessType TopicManager *topics.Manager Company string + JwtConfig config.JwtInfo } // Auth check user authentication by checking the user's token // isSuperuser is a flag that authenticator set it true when credentials is related to a superuser. func (a Authenticator) Auth(tokenString string) error { _, err := jwt.Parse(tokenString, func(token *jwt.Token) (interface{}, error) { - if _, ok := token.Method.(*jwt.SigningMethodRSA); !ok { + if token.Method.Alg() != a.JwtConfig.SigningMethod { return nil, ErrInvalidSigningMethod } @@ -31,11 +33,11 @@ func (a Authenticator) Auth(tokenString string) error { if !ok { return nil, ErrInvalidClaims } - if claims["iss"] == nil { + if claims[a.JwtConfig.IssName] == nil { return nil, ErrIssNotFound } - issuer := fmt.Sprintf("%v", claims["iss"]) + issuer := fmt.Sprintf("%v", claims[a.JwtConfig.IssName]) key := a.PublicKeys[issuer] if key == nil { @@ -63,7 +65,7 @@ func (a Authenticator) ACL( } token, err := jwt.Parse(tokenString, func(token *jwt.Token) (interface{}, error) { - if _, ok := token.Method.(*jwt.SigningMethodRSA); !ok { + if token.Method.Alg() != a.JwtConfig.SigningMethod { return nil, ErrInvalidSigningMethod } @@ -71,14 +73,14 @@ func (a Authenticator) ACL( if !ok { return nil, ErrInvalidClaims } - if claims["iss"] == nil { + if claims[a.JwtConfig.IssName] == nil { return nil, ErrIssNotFound } - if claims["sub"] == nil { + if claims[a.JwtConfig.SubName] == nil { return nil, ErrSubNotFound } - issuer := fmt.Sprintf("%v", claims["iss"]) + issuer := fmt.Sprintf("%v", claims[a.JwtConfig.IssName]) key := a.PublicKeys[issuer] if key == nil { return nil, PublicKeyNotFoundError{Issuer: issuer} @@ -95,17 +97,17 @@ func (a Authenticator) ACL( return false, ErrInvalidClaims } - if claims["iss"] == nil { + if claims[a.JwtConfig.IssName] == nil { return false, ErrIssNotFound } - issuer := fmt.Sprintf("%v", claims["iss"]) + issuer := fmt.Sprintf("%v", claims[a.JwtConfig.IssName]) - if claims["sub"] == nil { + if claims[a.JwtConfig.SubName] == nil { return false, ErrSubNotFound } - sub, _ := claims["sub"].(string) + sub, _ := claims[a.JwtConfig.SubName].(string) topicTemplate := a.TopicManager.ParseTopic(topic, issuer, sub) if topicTemplate == nil { diff --git a/internal/authenticator/builder.go b/internal/authenticator/builder.go index de6488aa..8bcc2eb8 100644 --- a/internal/authenticator/builder.go +++ b/internal/authenticator/builder.go @@ -38,6 +38,7 @@ func (b Builder) Authenticators() map[string]*Authenticator { vendor.IssEntityMap, vendor.IssPeerMap, ), + JwtConfig: vendor.JwtInfo, } all[vendor.Company] = auth From 0a8b0f861436de4387b1461df59b4fefa54d5456 Mon Sep 17 00:00:00 2001 From: Mehdi Teymorian Date: Mon, 15 Aug 2022 10:39:14 +0430 Subject: [PATCH 286/660] feat: add jwt config to default --- internal/config/default.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/internal/config/default.go b/internal/config/default.go index f1cdf868..a1b0cf0a 100644 --- a/internal/config/default.go +++ b/internal/config/default.go @@ -168,5 +168,10 @@ zQIDAQAB "0": "passenger", "1": "driver", }, + JwtInfo: JwtInfo{ + IssName: "iss", + SubName: "sub", + SigningMethod: "RSA512", + }, } } From 77587df4c825110f9ae2465989f3e663ab69f488 Mon Sep 17 00:00:00 2001 From: Mehdi Teymorian Date: Mon, 15 Aug 2022 10:47:31 +0430 Subject: [PATCH 287/660] refactor: rename jwt config --- internal/authenticator/authenticator.go | 2 +- internal/authenticator/builder.go | 2 +- internal/config/config.go | 4 ++-- internal/config/default.go | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/internal/authenticator/authenticator.go b/internal/authenticator/authenticator.go index d37d0fa3..ed1c4db2 100644 --- a/internal/authenticator/authenticator.go +++ b/internal/authenticator/authenticator.go @@ -18,7 +18,7 @@ type Authenticator struct { AllowedAccessTypes []acl.AccessType TopicManager *topics.Manager Company string - JwtConfig config.JwtInfo + JwtConfig config.Jwt } // Auth check user authentication by checking the user's token diff --git a/internal/authenticator/builder.go b/internal/authenticator/builder.go index 8bcc2eb8..c1af3f84 100644 --- a/internal/authenticator/builder.go +++ b/internal/authenticator/builder.go @@ -38,7 +38,7 @@ func (b Builder) Authenticators() map[string]*Authenticator { vendor.IssEntityMap, vendor.IssPeerMap, ), - JwtConfig: vendor.JwtInfo, + JwtConfig: vendor.Jwt, } all[vendor.Company] = auth diff --git a/internal/config/config.go b/internal/config/config.go index e3041729..eaa732dc 100644 --- a/internal/config/config.go +++ b/internal/config/config.go @@ -41,10 +41,10 @@ type ( Keys map[string]string `koanf:"keys"` IssEntityMap map[string]string `koanf:"iss_entity_map"` IssPeerMap map[string]string `koanf:"iss_peer_map"` - JwtInfo JwtInfo `koanf:"jwt_info"` + Jwt Jwt `koanf:"jwt"` } - JwtInfo struct { + Jwt struct { IssName string `koanf:"iss_name"` SubName string `koanf:"sub_name"` SigningMethod string `koanf:"signing_method"` diff --git a/internal/config/default.go b/internal/config/default.go index a1b0cf0a..cf7bb1dd 100644 --- a/internal/config/default.go +++ b/internal/config/default.go @@ -168,7 +168,7 @@ zQIDAQAB "0": "passenger", "1": "driver", }, - JwtInfo: JwtInfo{ + Jwt: Jwt{ IssName: "iss", SubName: "sub", SigningMethod: "RSA512", From 36aa07814668663eca77b27d86f61c71a3140c7c Mon Sep 17 00:00:00 2001 From: Mehdi Teymorian Date: Mon, 15 Aug 2022 10:47:53 +0430 Subject: [PATCH 288/660] feat: add jwt config to chart --- deployments/soteria/values.yaml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/deployments/soteria/values.yaml b/deployments/soteria/values.yaml index 28a31b41..3950acd9 100644 --- a/deployments/soteria/values.yaml +++ b/deployments/soteria/values.yaml @@ -152,4 +152,8 @@ vendors: 0: "passenger" 1: "driver" default: "none" + jwt: + iss_name: "iss" + sub_name: "sub" + signing_method: "RSA512" From 4410a8a0cdf51a707e861901677b153814d82b32 Mon Sep 17 00:00:00 2001 From: Mehdi Teymorian Date: Mon, 15 Aug 2022 10:53:10 +0430 Subject: [PATCH 289/660] feat: update chart version --- deployments/soteria/Chart.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/deployments/soteria/Chart.yaml b/deployments/soteria/Chart.yaml index 5ea36780..7ee0931b 100644 --- a/deployments/soteria/Chart.yaml +++ b/deployments/soteria/Chart.yaml @@ -5,6 +5,6 @@ description: Soteria Helm Chart type: application -version: 6.6.3 +version: 6.6.4 -appVersion: "v6-6-3" +appVersion: "v6-6-4" From afcff4a1b1e512f567855f67aafa04e315072bfc Mon Sep 17 00:00:00 2001 From: Mehdi Teymorian Date: Mon, 15 Aug 2022 10:55:00 +0430 Subject: [PATCH 290/660] refacotr: fix lint issues --- internal/authenticator/errors.go | 1 + internal/topics/manager.go | 1 + 2 files changed, 2 insertions(+) diff --git a/internal/authenticator/errors.go b/internal/authenticator/errors.go index 065dace4..f0840272 100644 --- a/internal/authenticator/errors.go +++ b/internal/authenticator/errors.go @@ -3,6 +3,7 @@ package authenticator import ( "errors" "fmt" + "gitlab.snapp.ir/dispatching/soteria/pkg/acl" ) diff --git a/internal/topics/manager.go b/internal/topics/manager.go index a2d78287..c787feb0 100644 --- a/internal/topics/manager.go +++ b/internal/topics/manager.go @@ -35,6 +35,7 @@ const ( Passenger string = "passenger" PassengerIss string = "1" ) + const ( // EmqCabHashPrefix is the default prefix for hashing part of cab topic, default value is 'emqch'. EmqCabHashPrefix = "emqch" From 2d870b1855421de6df2aa23f540508a881c93aa7 Mon Sep 17 00:00:00 2001 From: Mehdi Teymorian Date: Mon, 15 Aug 2022 15:21:51 +0430 Subject: [PATCH 291/660] feat: add key generator --- internal/authenticator/key.go | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 internal/authenticator/key.go diff --git a/internal/authenticator/key.go b/internal/authenticator/key.go new file mode 100644 index 00000000..2a6f7d8a --- /dev/null +++ b/internal/authenticator/key.go @@ -0,0 +1,31 @@ +package authenticator + +import ( + "github.com/golang-jwt/jwt/v4" + "go.uber.org/zap" +) + +func (b Builder) GenerateRsaKeys(raw map[string]string) map[string]any { + rsaKeys := make(map[string]any) + + for iss, publicKey := range raw { + rsaKey, err := jwt.ParseRSAPublicKeyFromPEM([]byte(publicKey)) + if err != nil { + b.Logger.Fatal("could not read public key", zap.String("issuer", iss)) + } + + rsaKeys[iss] = rsaKey + } + + return rsaKeys +} + +func (b Builder) GenerateHMacKeys(raw map[string]string) map[string]any { + keys := make(map[string]any) + + for iss, key := range raw { + keys[iss] = []byte(key) + } + + return keys +} From 630c5d2b3971f10fd3546c7da86a73d879f2dec1 Mon Sep 17 00:00:00 2001 From: Mehdi Teymorian Date: Mon, 15 Aug 2022 15:24:50 +0430 Subject: [PATCH 292/660] fix: add different key generators for different signing methods --- internal/authenticator/authenticator.go | 7 ++--- internal/authenticator/authenticator_test.go | 2 +- internal/authenticator/builder.go | 30 ++++++++++---------- 3 files changed, 19 insertions(+), 20 deletions(-) diff --git a/internal/authenticator/authenticator.go b/internal/authenticator/authenticator.go index ed1c4db2..f6ab2749 100644 --- a/internal/authenticator/authenticator.go +++ b/internal/authenticator/authenticator.go @@ -1,7 +1,6 @@ package authenticator import ( - "crypto/rsa" "fmt" "github.com/golang-jwt/jwt/v4" @@ -14,7 +13,7 @@ const DefaultVendor = "snapp" // Authenticator is responsible for Acl/Auth/Token of users. type Authenticator struct { - PublicKeys map[string]*rsa.PublicKey + Keys map[string]any AllowedAccessTypes []acl.AccessType TopicManager *topics.Manager Company string @@ -39,7 +38,7 @@ func (a Authenticator) Auth(tokenString string) error { issuer := fmt.Sprintf("%v", claims[a.JwtConfig.IssName]) - key := a.PublicKeys[issuer] + key := a.Keys[issuer] if key == nil { return nil, PublicKeyNotFoundError{Issuer: issuer} } @@ -81,7 +80,7 @@ func (a Authenticator) ACL( } issuer := fmt.Sprintf("%v", claims[a.JwtConfig.IssName]) - key := a.PublicKeys[issuer] + key := a.Keys[issuer] if key == nil { return nil, PublicKeyNotFoundError{Issuer: issuer} } diff --git a/internal/authenticator/authenticator_test.go b/internal/authenticator/authenticator_test.go index 64a0275d..1bfdebf5 100644 --- a/internal/authenticator/authenticator_test.go +++ b/internal/authenticator/authenticator_test.go @@ -113,7 +113,7 @@ func (suite *AuthenticatorTestSuite) SetupSuite() { cfg := config.SnappVendor() suite.Authenticator = authenticator.Authenticator{ - PublicKeys: map[string]*rsa.PublicKey{ + Keys: map[string]any{ user.Driver: pkey0, user.Passenger: pkey1, }, diff --git a/internal/authenticator/builder.go b/internal/authenticator/builder.go index c1af3f84..1e5f4487 100644 --- a/internal/authenticator/builder.go +++ b/internal/authenticator/builder.go @@ -1,10 +1,9 @@ package authenticator import ( - "crypto/rsa" "fmt" + "strings" - "github.com/golang-jwt/jwt/v4" "gitlab.snapp.ir/dispatching/snappids/v2" "gitlab.snapp.ir/dispatching/soteria/internal/config" "gitlab.snapp.ir/dispatching/soteria/internal/topics" @@ -23,12 +22,12 @@ func (b Builder) Authenticators() map[string]*Authenticator { for _, vendor := range b.Vendors { b.ValidateMappers(vendor.IssEntityMap, vendor.IssPeerMap) - publicKeys := b.PublicKeys(vendor.Keys) + keys := b.GenerateKeys(vendor.Jwt.SigningMethod, vendor.Keys) hid := HIDManager(vendor.DriverSalt, vendor.DriverHashLength, vendor.PassengerSalt, vendor.PassengerHashLength) allowedAccessTypes := b.GetAllowedAccessTypes(vendor.AllowedAccessTypes) auth := &Authenticator{ - PublicKeys: publicKeys, + Keys: keys, AllowedAccessTypes: allowedAccessTypes, Company: vendor.Company, TopicManager: topics.NewTopicManager( @@ -47,19 +46,20 @@ func (b Builder) Authenticators() map[string]*Authenticator { return all } -func (b Builder) PublicKeys(keys map[string]string) map[string]*rsa.PublicKey { - rsaKeys := make(map[string]*rsa.PublicKey) - - for iss, publicKey := range keys { - rsaKey, err := jwt.ParseRSAPublicKeyFromPEM([]byte(publicKey)) - if err != nil { - b.Logger.Fatal("could not read public key", zap.String("issuer", iss)) - } - - rsaKeys[iss] = rsaKey +func (b Builder) GenerateKeys(method string, keys map[string]string) map[string]any { + var keyList map[string]any + + // ES RS HS PS EdDSA + switch { + case strings.HasPrefix(method, "RS"): + keyList = b.GenerateRsaKeys(keys) + case strings.HasPrefix(method, "HS"): + keyList = b.GenerateHMacKeys(keys) + default: + keyList = make(map[string]any) } - return rsaKeys + return keyList } // GetAllowedAccessTypes will return all allowed access types in Soteria. From b88a9e88c18caa6957e908a9dcded602bf3e907c Mon Sep 17 00:00:00 2001 From: Mehdi Teymorian Date: Mon, 15 Aug 2022 15:25:31 +0430 Subject: [PATCH 293/660] fix: update chart version --- deployments/soteria/Chart.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/deployments/soteria/Chart.yaml b/deployments/soteria/Chart.yaml index 7ee0931b..35b0b925 100644 --- a/deployments/soteria/Chart.yaml +++ b/deployments/soteria/Chart.yaml @@ -5,6 +5,6 @@ description: Soteria Helm Chart type: application -version: 6.6.4 +version: 6.6.5 -appVersion: "v6-6-4" +appVersion: "v6-6-5" From e77fd94f12fec234bbfd65e3fca0d62ebe6242bd Mon Sep 17 00:00:00 2001 From: Mehdi Teymorian Date: Mon, 15 Aug 2022 16:03:26 +0430 Subject: [PATCH 294/660] fix!: update extract vendor token extract vendor & token from all the available fields including token, username, and password. previously vendor was only extracted from username field --- go.sum | 2 -- internal/api/api.go | 29 +++++++++++++++-------------- internal/api/api_test.go | 6 +++--- 3 files changed, 18 insertions(+), 19 deletions(-) diff --git a/go.sum b/go.sum index 82d99423..bbe20f8e 100644 --- a/go.sum +++ b/go.sum @@ -218,8 +218,6 @@ github.com/julienschmidt/httprouter v1.3.0/go.mod h1:JR6WtHb+2LUe8TCKY3cZOxFyyO8 github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= github.com/klauspost/compress v1.14.1/go.mod h1:/3/Vjq9QcHkK5uEr5lBEmyoZ1iFhe47etQ6QUkpK6sk= github.com/klauspost/compress v1.15.0/go.mod h1:/3/Vjq9QcHkK5uEr5lBEmyoZ1iFhe47etQ6QUkpK6sk= -github.com/klauspost/compress v1.15.5 h1:qyCLMz2JCrKADihKOh9FxnW3houKeNsp2h5OEz0QSEA= -github.com/klauspost/compress v1.15.5/go.mod h1:PhcZ0MbTNciWF3rruxRgKxI5NkcHHrHUDtV4Yw2GlzU= github.com/klauspost/compress v1.15.6 h1:6D9PcO8QWu0JyaQ2zUMmu16T1T+zjjEpP91guRsvDfY= github.com/klauspost/compress v1.15.6/go.mod h1:PhcZ0MbTNciWF3rruxRgKxI5NkcHHrHUDtV4Yw2GlzU= github.com/knadh/koanf v1.4.1 h1:Z0VGW/uo8NJmjd+L1Dc3S5frq6c62w5xQ9Yf4Mg3wFQ= diff --git a/internal/api/api.go b/internal/api/api.go index 016c9b8d..2679a8c2 100644 --- a/internal/api/api.go +++ b/internal/api/api.go @@ -57,26 +57,27 @@ func (a API) Authenticator(vendor string) *authenticator.Authenticator { } func ExtractVendorToken(rawToken, username, password string) (string, string) { - split := strings.Split(username, VendorTokenSeparator) - - var vendor, usernameToken string - - if len(split) == 2 { //nolint:gomnd - vendor = split[0] - usernameToken = split[1] - } else { - vendor = "" - usernameToken = split[0] - } - tokenString := rawToken + if len(tokenString) == 0 { - tokenString = usernameToken + tokenString = username } if len(tokenString) == 0 { tokenString = password } - return vendor, tokenString + split := strings.Split(tokenString, VendorTokenSeparator) + + var vendor, token string + + if len(split) == 2 { //nolint:gomnd + vendor = split[0] + token = split[1] + } else { + vendor = "" + token = split[0] + } + + return vendor, token } diff --git a/internal/api/api_test.go b/internal/api/api_test.go index 6eabdce2..d9c21b01 100644 --- a/internal/api/api_test.go +++ b/internal/api/api_test.go @@ -20,7 +20,7 @@ func TestExtractVendorToken(t *testing.T) { { name: "token field as token", fields: fields{ - Token: "token", + Token: "vendor:token", Username: "vendor:username", Password: "password", }, @@ -52,9 +52,9 @@ func TestExtractVendorToken(t *testing.T) { fields: fields{ Token: "", Username: "", - Password: "password", + Password: "vendor:password", }, - vendor: "", + vendor: "vendor", token: "password", }, } From 58a47670c16fb0e378da2cf62795d3d203043184 Mon Sep 17 00:00:00 2001 From: Mehdi Teymorian Date: Mon, 15 Aug 2022 16:04:27 +0430 Subject: [PATCH 295/660] feat: update chart version --- deployments/soteria/Chart.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/deployments/soteria/Chart.yaml b/deployments/soteria/Chart.yaml index 35b0b925..9deab092 100644 --- a/deployments/soteria/Chart.yaml +++ b/deployments/soteria/Chart.yaml @@ -5,6 +5,6 @@ description: Soteria Helm Chart type: application -version: 6.6.5 +version: 6.6.6 -appVersion: "v6-6-5" +appVersion: "v6-6-6" From d5b931ce9ad2eee387aa0cd0b03ac91c4db5ea18 Mon Sep 17 00:00:00 2001 From: Mehdi Teymorian Date: Tue, 16 Aug 2022 10:43:46 +0430 Subject: [PATCH 296/660] feat: update invalid signing method error message --- internal/authenticator/errors.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/authenticator/errors.go b/internal/authenticator/errors.go index f0840272..ad9da643 100644 --- a/internal/authenticator/errors.go +++ b/internal/authenticator/errors.go @@ -8,7 +8,7 @@ import ( ) var ( - ErrInvalidSigningMethod = errors.New("token is not valid, signing method is not RSA") + ErrInvalidSigningMethod = errors.New("token is not valid, signing method does not match with authenticator signing method") ErrIssNotFound = errors.New("could not found iss in token claims") ErrSubNotFound = errors.New("could not found sub in token claims") ErrInvalidClaims = errors.New("invalid claims") From 1719c39e6fe0fa4a130eea8f29e2e99c45683ed3 Mon Sep 17 00:00:00 2001 From: Mehdi Teymorian Date: Tue, 16 Aug 2022 10:45:27 +0430 Subject: [PATCH 297/660] feat: rename error --- internal/authenticator/authenticator.go | 4 ++-- internal/authenticator/errors.go | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/internal/authenticator/authenticator.go b/internal/authenticator/authenticator.go index f6ab2749..6bb1e2d0 100644 --- a/internal/authenticator/authenticator.go +++ b/internal/authenticator/authenticator.go @@ -40,7 +40,7 @@ func (a Authenticator) Auth(tokenString string) error { key := a.Keys[issuer] if key == nil { - return nil, PublicKeyNotFoundError{Issuer: issuer} + return nil, KeyNotFoundError{Issuer: issuer} } return key, nil @@ -82,7 +82,7 @@ func (a Authenticator) ACL( issuer := fmt.Sprintf("%v", claims[a.JwtConfig.IssName]) key := a.Keys[issuer] if key == nil { - return nil, PublicKeyNotFoundError{Issuer: issuer} + return nil, KeyNotFoundError{Issuer: issuer} } return key, nil diff --git a/internal/authenticator/errors.go b/internal/authenticator/errors.go index ad9da643..1548426e 100644 --- a/internal/authenticator/errors.go +++ b/internal/authenticator/errors.go @@ -33,12 +33,12 @@ func (err TopicNotAllowedError) Error() string { ) } -type PublicKeyNotFoundError struct { +type KeyNotFoundError struct { Issuer string } -func (err PublicKeyNotFoundError) Error() string { - return fmt.Sprintf("cannot find issuer %s public key", err.Issuer) +func (err KeyNotFoundError) Error() string { + return fmt.Sprintf("cannot find issuer %s key", err.Issuer) } type InvalidTopicError struct { From 548569fd977bf177c3e0404dd9b476b875eecae6 Mon Sep 17 00:00:00 2001 From: Mehdi Teymorian Date: Tue, 16 Aug 2022 10:49:38 +0430 Subject: [PATCH 298/660] feat: update chart version --- deployments/soteria/Chart.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/deployments/soteria/Chart.yaml b/deployments/soteria/Chart.yaml index 9deab092..7b94ecbf 100644 --- a/deployments/soteria/Chart.yaml +++ b/deployments/soteria/Chart.yaml @@ -5,6 +5,6 @@ description: Soteria Helm Chart type: application -version: 6.6.6 +version: 6.6.7 -appVersion: "v6-6-6" +appVersion: "v6-6-7" From e356f35ea035a6abc5dd11d9c3b1db4d33ac1bbe Mon Sep 17 00:00:00 2001 From: Mehdi Teymorian Date: Tue, 16 Aug 2022 11:00:30 +0430 Subject: [PATCH 299/660] feat: update error message --- internal/authenticator/errors.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/authenticator/errors.go b/internal/authenticator/errors.go index 1548426e..abdc868c 100644 --- a/internal/authenticator/errors.go +++ b/internal/authenticator/errors.go @@ -8,7 +8,7 @@ import ( ) var ( - ErrInvalidSigningMethod = errors.New("token is not valid, signing method does not match with authenticator signing method") + ErrInvalidSigningMethod = errors.New("signing method does not match with authenticator signing method") ErrIssNotFound = errors.New("could not found iss in token claims") ErrSubNotFound = errors.New("could not found sub in token claims") ErrInvalidClaims = errors.New("invalid claims") From 188ca06f33febe7287a892e7b283f64bc2ed014a Mon Sep 17 00:00:00 2001 From: Mehdi Teymorian Date: Tue, 16 Aug 2022 11:01:11 +0430 Subject: [PATCH 300/660] feat: update chart --- deployments/soteria/Chart.yaml | 4 ++-- deployments/soteria/values.yaml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/deployments/soteria/Chart.yaml b/deployments/soteria/Chart.yaml index 7b94ecbf..7ded1e2f 100644 --- a/deployments/soteria/Chart.yaml +++ b/deployments/soteria/Chart.yaml @@ -5,6 +5,6 @@ description: Soteria Helm Chart type: application -version: 6.6.7 +version: 6.6.8 -appVersion: "v6-6-7" +appVersion: "v6-6-8" diff --git a/deployments/soteria/values.yaml b/deployments/soteria/values.yaml index 3950acd9..9f017084 100644 --- a/deployments/soteria/values.yaml +++ b/deployments/soteria/values.yaml @@ -155,5 +155,5 @@ vendors: jwt: iss_name: "iss" sub_name: "sub" - signing_method: "RSA512" + signing_method: "RS512" From bc24763ae1fee3484762bff2315739c90cafeedd Mon Sep 17 00:00:00 2001 From: Parham Alvani Date: Tue, 16 Aug 2022 19:34:38 +0430 Subject: [PATCH 301/660] feat: update readme --- README.md | 33 ++++++++++++--------------------- 1 file changed, 12 insertions(+), 21 deletions(-) diff --git a/README.md b/README.md index e310d8ee..2b7ea0a3 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,6 @@ # Soteria -Soteria is responsible for Authentication and Authorization of every request sent to EMQ and Herald. + +Soteria is responsible for Authentication and Authorization of every request sent to EMQ. # Deployment @@ -8,27 +9,14 @@ Soteria is responsible for Authentication and Authorization of every request sen You can deploy `soteria` to the staging environments using helm charts. -``` -cd deployments -helm install soteria --generate-name +```bash +cd deployments/soteria +helm install soteria . ``` ## Production -We deploy `soteria` on two different infrastructures. - -- VM -- Cloud (okd) - -### VM - -For VM deployments following 2 steps are required. - -- Preparing VMs which is done by `ansible playbooks`. You can find `herald`'s - `ansible playbooks` in the following link - [bravo/new-ansible-playbook](https://gitlab.snapp.ir/bravo/new-ansible-playbook) - -- Deploying `soteria` with CI/CD pipelines. +We deploy `soteria` on `Cloud (okd)` infrastructures. ### Cloud (okd) @@ -36,7 +24,9 @@ For VM deployments following 2 steps are required. for production deployments on Cloud (okd). # Add Vendor -Soteria is a multivendor authenticator for EMQX. to add a vendor for authentication, go to chart directory and in the`values.yaml`, add the following template named after the desired vendor: + +Soteria is a multivendor authenticator for EMQX. To add a vendor for authentication, +go to chart directory and in the`values.yaml`, add the following template named after the desired vendor: ```yaml snapp: @@ -61,9 +51,10 @@ snapp: ``` # Generate JWT Token -replace `driver` and `0` for issuer and id respectively. -```sh +Replace `driver` and `0` for issuer and ID respectively. + +```bash curl -s -u 'admin:admin' -L https://doago-snapp-ode-020.apps.private.teh-1.snappcloud.io/api/snapp/driver/0 | jq '.Token' -r ``` From 9fced19a07902cf016cace0257bd991648a09cc1 Mon Sep 17 00:00:00 2001 From: Mehdi Teymorian Date: Wed, 17 Aug 2022 11:08:02 +0430 Subject: [PATCH 302/660] feat: update access key on topic based on iss --- deployments/soteria/values.yaml | 40 ++++++++++++++++----------------- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/deployments/soteria/values.yaml b/deployments/soteria/values.yaml index 9f017084..df8ddb04 100644 --- a/deployments/soteria/values.yaml +++ b/deployments/soteria/values.yaml @@ -67,62 +67,62 @@ vendors: template: ^{{IssToEntity .iss}}-event-{{HashID .hashType .sub (IssToSnappID .iss)}}$ hash_type: 1 accesses: - driver: '1' - passenger: '1' + 0: '1' + 1: '1' - type: driver_location template: ^{{.company}}/driver/{{HashID .hashType .sub (IssToSnappID .iss)}}/location$ hash_type: 0 accesses: - driver: '2' - passenger: '-1' + 0: '2' + 1: '-1' - type: passenger_location template: ^{{.company}}/passenger/{{HashID .hashType .sub (IssToSnappID .iss)}}/location$ hash_type: 0 accesses: - driver: '2' - passenger: '2' + 0: '2' + 1: '2' - type: superapp_event template: ^{{.company}}/{{IssToEntity .iss}}/{{HashID .hashType .sub (IssToSnappID .iss)}}/superapp$ hash_type: 0 accesses: - driver: '1' - passenger: '1' + 0: '1' + 1: '1' - type: box_event template: ^bucks$ hash_type: 0 accesses: - driver: '-1' - passenger: '-1' + 0: '-1' + 1: '-1' - type: shared_location template: ^{{.company}}/{{IssToEntity .iss}}/{{HashID .hashType .sub (IssToSnappID .iss)}}/{{IssToPeer .iss}}-location$ hash_type: 0 accesses: - driver: '1' - passenger: '1' + 0: '1' + 1: '1' - type: chat template: ^{{.company}}/{{IssToEntity .iss}}/{{HashID .hashType .sub (IssToSnappID .iss)}}/chat$ hash_type: 0 accesses: - driver: '1' - passenger: '1' + 0: '1' + 1: '1' - type: general_call_entry template: ^shared/{{.company}}/{{IssToEntity .iss}}/{{HashID .hashType .sub (IssToSnappID .iss)}}/call/send$ hash_type: 0 accesses: - driver: '2' - passenger: '2' + 0: '2' + 1: '2' - type: node_call_entry template: ^{{.company}}/{{IssToEntity .iss}}/{{HashID .hashType .sub (IssToSnappID .iss)}}/call/[a-zA-Z0-9-_]+/send$ hash_type: 0 accesses: - driver: '2' - passenger: '2' + 0: '2' + 1: '2' - type: call_outgoing template: ^{{.company}}/{{IssToEntity .iss}}/{{HashID .hashType .sub (IssToSnappID .iss)}}/call/receive$ hash_type: 0 accesses: - driver: '1' - passenger: '1' + 0: '1' + 1: '1' keys: 1: |- -----BEGIN PUBLIC KEY----- From 58eff2e970f671b15bd42353caa767d76063583e Mon Sep 17 00:00:00 2001 From: Mehdi Teymorian Date: Wed, 17 Aug 2022 12:27:10 +0430 Subject: [PATCH 303/660] feat: add vendor documentation --- README.md | 24 +------- docs/vendor.md | 148 +++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 149 insertions(+), 23 deletions(-) create mode 100644 docs/vendor.md diff --git a/README.md b/README.md index e310d8ee..e9ddc794 100644 --- a/README.md +++ b/README.md @@ -36,29 +36,7 @@ For VM deployments following 2 steps are required. for production deployments on Cloud (okd). # Add Vendor -Soteria is a multivendor authenticator for EMQX. to add a vendor for authentication, go to chart directory and in the`values.yaml`, add the following template named after the desired vendor: - -```yaml -snapp: - company: "snapp" - driver_salt: "secret" - passenger_salt: "secret" - driver_hash_length: 15 - passenger_hash_length: 15 - allowed_access_types: [ "pub", "sub" ] - topics: - - type: cab_event - template: ^{{.audience}}-event-{{.hashId}}$ - hash_type: 1 - accesses: - driver: '1' - passenger: '1' - - ... - driver_key: |- - ... - passenger_key: |- - ... -``` +Soteria is a multivendor authenticator for EMQX. Follow instruction from [here](docs/vendor.md) # Generate JWT Token replace `driver` and `0` for issuer and id respectively. diff --git a/docs/vendor.md b/docs/vendor.md new file mode 100644 index 00000000..7574fb26 --- /dev/null +++ b/docs/vendor.md @@ -0,0 +1,148 @@ +# Add Vendor +add vendors in the <>/values.yaml. + +# Vendor Configuration +```yaml +company: "<>" +driver_salt: "" +passenger_salt: "" +passenger_hash_length: 15 +driver_hash_length: 15 +allowed_access_types: [ "pub", "sub" ] +keys: + iss-0: "key-value" + iss-1: "key-value" + ... +iss_entity_map: + 0: "entity-0" + 1: "entity-1" + default: "default-entity" +iss_peer_map: + 0: "peer-0" + 1: "peer-1" + default: "default-peer" +jwt: + iss_name: "iss" + sub_name: "sub" + signing_method: "RS512" +topics: + - topic1 + - topic2 + - ... +``` + +## HashID Manager +`driver_salt` ,`passenger_salt`, `passenger_hash_length`, `driver_hash_length` are used for HashIDManager. This component only works for passenger and driver issuers. + +## Keys +this is a map of issuer to key for opening jwt token. + +## IssEntityMap & IssPeerMap +These two configuration map iss to entity and peer respectively. + +**Note**: default case is `required` + +## JWT +This is the jwt configuration. `iss_name` and `sub_name` are the name of issuer and subject in the jwt token's payload respectively. + +`signing_method` is the method that is used to sign the jwt token. +Here are list of different signing methods +- ES384 +- RS512 * +- PS512 +- RS384 * +- HS256 * +- HS384 * +- RS256 * +- PS384 +- ES256 +- ES512 +- EdDSA +- HS512 * +- PS256 + **Note**: only the methods with `*` are supported for now. + + +# Topic Configuration +```yaml +type: "<>" +template: "<>" +hash_type: 0|1 +accesses: + iss-0: "<>" + iss-1: "<>" + ... +``` + +## Template +Topic template is a string consists of [Variables](##Available_Variables) and [Functions](##Available_Functions) and regular expressions. Variables and Function are replaced first and then the whole template will compile as a regular expression. The end result will be compared against the requested topic. + +### Example +This is template topic given in `vendor:topics[#]:template`. +```regex +^{{.company}}/driver/{{HashID .hashType .sub (IssToSnappID .iss)}}/location/[a-zA-Z0-9-_]+$ +``` + +After parsing the template we get something like this +```regex +// company=snapp +// hashType=0 +// sub=D96ZbvJakLp4PYd +// iss=0 +^snapp/driver/D96ZbvJakLp4PYd/location/[a-zA-Z0-9-_]+$ +``` + +Now if the requested topic match the create topic it is consider a valid topic for that particular user. +```text +requested_topic: snapp/driver/D96ZbvJakLp4PYd/location/23fw49vxd +created_topic_regex: ^snapp/driver/D96ZbvJakLp4PYd/location/[a-zA-Z0-9-_]+$ +``` + +# Values + +## Available Variables +These are the variables available to use in the topic templates. +- iss + issuer obtained from jwt-token +- sub + subject obtained from jwt-token +- hashType + Hash type field defined in topic template configuration + + | HashType | Value | + | -------- | ----- | + | HashID | 0 | + | MD5 | 1 | +- company + company field defined in vendor configuration + +## Available Functions +These are the function available to use in the topic templates. +- IssToEntity(iss string) string + convert `iss` obtained from jwt-token to defined entity in `issEntityMap` +- IssToPeer(iss string) string + convert `iss` onbtained from jwt-token to define peer in `issPeerMap` +- IssToSnappID(iss string) string + convert `iss` obtained from jwt-token to snappid.audience +- HashID(hashType int, sub string, snappID snappid.audience) + generated `hashID` for the given `subject` base on the `hashType` and `snappid.audience` + +**Note**: snappid.audience only is available for issuer 0 and 1 which are for driver and passenger respectively. + +## Accesses +List of all types of access on a topic. + +| Access | Value | +| ------------------- | ----- | +| Subscribe | 1 | +| Publish | 2 | +| Subscribe & Publish | 3 | +| None | -1 | + +## Suggested Issuers +Use any value for issuer but if you have an entity called `Driver` or `Passenger`, we recommend to use the following issuers for them. + +| Issuer | Value | +| --------- | ----- | +| Driver | 0 | +| Passenger | 1 | From 7268ef650fadc0cfd40de2ed91738bcab8c899c3 Mon Sep 17 00:00:00 2001 From: Mehdi Teymorian Date: Mon, 22 Aug 2022 09:47:27 +0430 Subject: [PATCH 304/660] fix: decode hmac base64 key --- internal/authenticator/key.go | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/internal/authenticator/key.go b/internal/authenticator/key.go index 2a6f7d8a..b189f32b 100644 --- a/internal/authenticator/key.go +++ b/internal/authenticator/key.go @@ -1,6 +1,9 @@ package authenticator import ( + "encoding/base64" + "log" + "github.com/golang-jwt/jwt/v4" "go.uber.org/zap" ) @@ -24,7 +27,12 @@ func (b Builder) GenerateHMacKeys(raw map[string]string) map[string]any { keys := make(map[string]any) for iss, key := range raw { - keys[iss] = []byte(key) + bytes, err := base64.StdEncoding.DecodeString(key) + if err != nil { + log.Fatalf("failed to generate hmac key: %v", err) + } + + keys[iss] = bytes } return keys From 591a1a8042fc2545c14718d54274783934a9d742 Mon Sep 17 00:00:00 2001 From: Mehdi Teymorian Date: Mon, 22 Aug 2022 09:49:45 +0430 Subject: [PATCH 305/660] refactor: move generate keys function to key file --- internal/authenticator/builder.go | 18 ------------------ internal/authenticator/key.go | 17 +++++++++++++++++ 2 files changed, 17 insertions(+), 18 deletions(-) diff --git a/internal/authenticator/builder.go b/internal/authenticator/builder.go index 1e5f4487..86072ff9 100644 --- a/internal/authenticator/builder.go +++ b/internal/authenticator/builder.go @@ -2,8 +2,6 @@ package authenticator import ( "fmt" - "strings" - "gitlab.snapp.ir/dispatching/snappids/v2" "gitlab.snapp.ir/dispatching/soteria/internal/config" "gitlab.snapp.ir/dispatching/soteria/internal/topics" @@ -46,22 +44,6 @@ func (b Builder) Authenticators() map[string]*Authenticator { return all } -func (b Builder) GenerateKeys(method string, keys map[string]string) map[string]any { - var keyList map[string]any - - // ES RS HS PS EdDSA - switch { - case strings.HasPrefix(method, "RS"): - keyList = b.GenerateRsaKeys(keys) - case strings.HasPrefix(method, "HS"): - keyList = b.GenerateHMacKeys(keys) - default: - keyList = make(map[string]any) - } - - return keyList -} - // GetAllowedAccessTypes will return all allowed access types in Soteria. func (b Builder) GetAllowedAccessTypes(accessTypes []string) []acl.AccessType { allowedAccessTypes := make([]acl.AccessType, 0, len(accessTypes)) diff --git a/internal/authenticator/key.go b/internal/authenticator/key.go index b189f32b..1224a230 100644 --- a/internal/authenticator/key.go +++ b/internal/authenticator/key.go @@ -3,11 +3,28 @@ package authenticator import ( "encoding/base64" "log" + "strings" "github.com/golang-jwt/jwt/v4" "go.uber.org/zap" ) +func (b Builder) GenerateKeys(method string, keys map[string]string) map[string]any { + var keyList map[string]any + + // ES RS HS PS EdDSA + switch { + case strings.HasPrefix(method, "RS"): + keyList = b.GenerateRsaKeys(keys) + case strings.HasPrefix(method, "HS"): + keyList = b.GenerateHMacKeys(keys) + default: + keyList = make(map[string]any) + } + + return keyList +} + func (b Builder) GenerateRsaKeys(raw map[string]string) map[string]any { rsaKeys := make(map[string]any) From 099a40fb606cc2d84cd6a54a0bed38f2d8393a1a Mon Sep 17 00:00:00 2001 From: Mehdi Teymorian Date: Mon, 22 Aug 2022 09:57:32 +0430 Subject: [PATCH 306/660] refactor: remove duplicate driver & passenger iss --- internal/authenticator/authenticator_test.go | 27 ++++++-------- internal/topics/manager.go | 9 +++-- internal/topics/manager_test.go | 37 ++++++++++---------- pkg/user/user.go | 10 ------ 4 files changed, 33 insertions(+), 50 deletions(-) delete mode 100644 pkg/user/user.go diff --git a/internal/authenticator/authenticator_test.go b/internal/authenticator/authenticator_test.go index 1bfdebf5..7c987e4a 100644 --- a/internal/authenticator/authenticator_test.go +++ b/internal/authenticator/authenticator_test.go @@ -15,7 +15,6 @@ import ( "gitlab.snapp.ir/dispatching/soteria/internal/config" "gitlab.snapp.ir/dispatching/soteria/internal/topics" "gitlab.snapp.ir/dispatching/soteria/pkg/acl" - "gitlab.snapp.ir/dispatching/soteria/pkg/user" ) const ( @@ -78,22 +77,22 @@ type AuthenticatorTestSuite struct { func (suite *AuthenticatorTestSuite) SetupSuite() { require := suite.Require() - driverToken, err := suite.getSampleToken(user.Driver, false) + driverToken, err := suite.getSampleToken(topics.DriverIss, false) require.NoError(err) suite.Tokens.Driver = driverToken - passengerToken, err := suite.getSampleToken(user.Passenger, false) + passengerToken, err := suite.getSampleToken(topics.PassengerIss, false) require.NoError(err) suite.Tokens.Passenger = passengerToken - pkey0, err := suite.getPublicKey(user.Driver) + pkey0, err := suite.getPublicKey(topics.DriverIss) require.NoError(err) suite.PublicKeys.Driver = pkey0 - pkey1, err := suite.getPublicKey(user.Passenger) + pkey1, err := suite.getPublicKey(topics.PassengerIss) require.NoError(err) suite.PublicKeys.Passenger = pkey1 @@ -114,8 +113,8 @@ func (suite *AuthenticatorTestSuite) SetupSuite() { cfg := config.SnappVendor() suite.Authenticator = authenticator.Authenticator{ Keys: map[string]any{ - user.Driver: pkey0, - user.Passenger: pkey1, + topics.DriverIss: pkey0, + topics.PassengerIss: pkey1, }, AllowedAccessTypes: []acl.AccessType{acl.Pub, acl.Sub, acl.PubSub}, Company: "snapp", @@ -359,7 +358,7 @@ func TestAuthenticator_ValidateTopicBySender(t *testing.T) { } t.Run("testing valid driver cab event", func(t *testing.T) { - topicTemplate := authenticator.TopicManager.ParseTopic(validDriverCabEventTopic, user.Driver, "DXKgaNQa7N5Y7bo") + topicTemplate := authenticator.TopicManager.ParseTopic(validDriverCabEventTopic, topics.DriverIss, "DXKgaNQa7N5Y7bo") assert.True(t, topicTemplate != nil) }) } @@ -459,12 +458,10 @@ func (suite *AuthenticatorTestSuite) getPublicKey(u string) (*rsa.PublicKey, err var fileName string switch u { - case user.Passenger: + case topics.PassengerIss: fileName = "../../test/1.pem" - case user.Driver: + case topics.DriverIss: fileName = "../../test/0.pem" - case user.None: - fallthrough default: return nil, errors.New("invalid user, public key not found") } @@ -487,12 +484,10 @@ func (suite *AuthenticatorTestSuite) getPrivateKey(u string) (*rsa.PrivateKey, e var fileName string switch u { - case user.Driver: + case topics.DriverIss: fileName = "../../test/0.private.pem" - case user.Passenger: + case topics.PassengerIss: fileName = "../../test/1.private.pem" - case user.None: - fallthrough default: return nil, errors.New("invalid user, private key not found") } diff --git a/internal/topics/manager.go b/internal/topics/manager.go index c787feb0..b9f136d4 100644 --- a/internal/topics/manager.go +++ b/internal/topics/manager.go @@ -12,7 +12,6 @@ import ( "text/template" "gitlab.snapp.ir/dispatching/snappids/v2" - "gitlab.snapp.ir/dispatching/soteria/pkg/user" ) const ( @@ -34,6 +33,8 @@ const ( Passenger string = "passenger" PassengerIss string = "1" + + NoneIss string = "-1" ) const ( @@ -154,12 +155,10 @@ func (t *Manager) IssPeerMapper(iss string) string { // IssToSnappID returns corresponding audience in snappids form. func (t *Manager) IssToSnappID(iss string) snappids.Audience { switch iss { - case user.Passenger: + case PassengerIss: return snappids.PassengerAudience - case user.Driver: + case DriverIss: return snappids.DriverAudience - case user.None: - fallthrough default: return -1 } diff --git a/internal/topics/manager_test.go b/internal/topics/manager_test.go index 1490f6fd..35cdbf44 100644 --- a/internal/topics/manager_test.go +++ b/internal/topics/manager_test.go @@ -6,7 +6,6 @@ import ( "gitlab.snapp.ir/dispatching/snappids/v2" "gitlab.snapp.ir/dispatching/soteria/internal/config" "gitlab.snapp.ir/dispatching/soteria/internal/topics" - "gitlab.snapp.ir/dispatching/soteria/pkg/user" ) // nolint: funlen @@ -22,109 +21,109 @@ func TestTopic_GetType(t *testing.T) { { name: "testing cab event", arg: "passenger-event-152384980615c2bd16143cff29038b67", - issuer: user.Passenger, + issuer: topics.PassengerIss, want: topics.CabEvent, }, { name: "testing cab event", arg: "driver-event-152384980615c2bd16143cff29038b67", - issuer: user.Driver, + issuer: topics.DriverIss, want: topics.CabEvent, }, { name: "testing invalid event", arg: "-event-123456789abcdefgABCDEFG", - issuer: user.None, + issuer: topics.NoneIss, want: "", }, { name: "testing driver location", arg: "snapp/driver/DXKgaNQa7N5Y7bo/location", - issuer: user.Driver, + issuer: topics.DriverIss, want: topics.DriverLocation, }, { name: "testing passenger location", arg: "snapp/passenger/DXKgaNQa7N5Y7bo/location", - issuer: user.Passenger, + issuer: topics.PassengerIss, want: topics.PassengerLocation, }, { name: "testing invalid location", arg: "snapp/thirdparty/DXKgaNQa7N5Y7bo/location", - issuer: user.None, + issuer: topics.NoneIss, want: "", }, { name: "testing superapp event", arg: "snapp/passenger/DXKgaNQa7N5Y7bo/superapp", - issuer: user.Passenger, + issuer: topics.PassengerIss, want: topics.SuperappEvent, }, { name: "testing shared passenger location", arg: "snapp/passenger/DXKgaNQa7N5Y7bo/driver-location", - issuer: user.Passenger, + issuer: topics.PassengerIss, want: topics.SharedLocation, }, { name: "testing shared driver location", arg: "snapp/driver/DXKgaNQa7N5Y7bo/passenger-location", - issuer: user.Driver, + issuer: topics.DriverIss, want: topics.SharedLocation, }, { name: "testing passenger chat", arg: "snapp/passenger/DXKgaNQa7N5Y7bo/chat", - issuer: user.Passenger, + issuer: topics.PassengerIss, want: topics.Chat, }, { name: "testing driver chat", arg: "snapp/driver/DXKgaNQa7N5Y7bo/chat", - issuer: user.Driver, + issuer: topics.DriverIss, want: topics.Chat, }, { name: "testing passenger general call entry", arg: "shared/snapp/passenger/DXKgaNQa7N5Y7bo/call/send", - issuer: user.Passenger, + issuer: topics.PassengerIss, want: topics.GeneralCallEntry, }, { name: "testing driver general call entry", arg: "shared/snapp/driver/DXKgaNQa7N5Y7bo/call/send", - issuer: user.Driver, + issuer: topics.DriverIss, want: topics.GeneralCallEntry, }, { name: "testing passenger node call entry", arg: "snapp/passenger/DXKgaNQa7N5Y7bo/call/heliograph-0/send", - issuer: user.Passenger, + issuer: topics.PassengerIss, want: topics.NodeCallEntry, }, { name: "testing driver node call entry", arg: "snapp/driver/DXKgaNQa7N5Y7bo/call/heliograph-1/send", - issuer: user.Driver, + issuer: topics.DriverIss, want: topics.NodeCallEntry, }, { name: "testing passenger call", arg: "snapp/passenger/DXKgaNQa7N5Y7bo/call/receive", - issuer: user.Passenger, + issuer: topics.PassengerIss, want: topics.CallOutgoing, }, { name: "testing driver call", arg: "snapp/driver/DXKgaNQa7N5Y7bo/call/receive", - issuer: user.Driver, + issuer: topics.DriverIss, want: topics.CallOutgoing, }, { name: "testing box event", arg: "bucks", - issuer: user.Driver, + issuer: topics.DriverIss, want: topics.BoxEvent, }, } diff --git a/pkg/user/user.go b/pkg/user/user.go deleted file mode 100644 index e690e914..00000000 --- a/pkg/user/user.go +++ /dev/null @@ -1,10 +0,0 @@ -package user - -// Issuer indicate issuers. -type Issuer string - -const ( - Driver string = "0" - Passenger string = "1" - None string = "-1" -) From 9ed16a945b34fce6746573ef740c069a4d7d3086 Mon Sep 17 00:00:00 2001 From: Mehdi Teymorian Date: Mon, 22 Aug 2022 10:01:28 +0430 Subject: [PATCH 307/660] refactor: remove unused code --- pkg/acl/token.go | 25 ------------------------- 1 file changed, 25 deletions(-) delete mode 100644 pkg/acl/token.go diff --git a/pkg/acl/token.go b/pkg/acl/token.go deleted file mode 100644 index 1667a42b..00000000 --- a/pkg/acl/token.go +++ /dev/null @@ -1,25 +0,0 @@ -package acl - -import ( - "github.com/golang-jwt/jwt/v4" -) - -type Claims struct { - jwt.StandardClaims - Topics []Topic `json:"topics"` - Endpoints []Endpoint `json:"endpoints"` -} - -type Topic struct { - Type string `json:"type"` - AccessType AccessType `json:"access_type"` -} - -type Endpoint struct { - Name string `json:"name"` -} - -type SuperuserClaims struct { - jwt.StandardClaims - IsSuperuser bool `json:"is_superuser"` -} From 8b20ffebcebb406a4fb2c0a1e50f02ec2528988c Mon Sep 17 00:00:00 2001 From: Mehdi Teymorian Date: Mon, 22 Aug 2022 10:03:37 +0430 Subject: [PATCH 308/660] refactor: apply linter suggestions --- internal/authenticator/builder.go | 1 + 1 file changed, 1 insertion(+) diff --git a/internal/authenticator/builder.go b/internal/authenticator/builder.go index 86072ff9..dc7e74fd 100644 --- a/internal/authenticator/builder.go +++ b/internal/authenticator/builder.go @@ -2,6 +2,7 @@ package authenticator import ( "fmt" + "gitlab.snapp.ir/dispatching/snappids/v2" "gitlab.snapp.ir/dispatching/soteria/internal/config" "gitlab.snapp.ir/dispatching/soteria/internal/topics" From 2cf2b1028fc29248d9306e382dc654134d4e6569 Mon Sep 17 00:00:00 2001 From: Mehdi Teymorian Date: Mon, 22 Aug 2022 10:13:27 +0430 Subject: [PATCH 309/660] feat: update chart version --- deployments/soteria/Chart.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/deployments/soteria/Chart.yaml b/deployments/soteria/Chart.yaml index 7ded1e2f..b25559d0 100644 --- a/deployments/soteria/Chart.yaml +++ b/deployments/soteria/Chart.yaml @@ -5,6 +5,6 @@ description: Soteria Helm Chart type: application -version: 6.6.8 +version: 6.6.9 -appVersion: "v6-6-8" +appVersion: "v6-6-9" From 260d88c21394af8f7a95a6ea43aee06515dedbd6 Mon Sep 17 00:00:00 2001 From: Parham Alvani Date: Sun, 28 Aug 2022 12:19:20 +0430 Subject: [PATCH 310/660] feat: panic when there is not vendor available --- internal/authenticator/builder.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/internal/authenticator/builder.go b/internal/authenticator/builder.go index dc7e74fd..c09558be 100644 --- a/internal/authenticator/builder.go +++ b/internal/authenticator/builder.go @@ -42,6 +42,10 @@ func (b Builder) Authenticators() map[string]*Authenticator { all[vendor.Company] = auth } + if len(all) == 0 { + b.Logger.Fatal("at least one vendor should be enable to have soteria") + } + return all } From 861ba2e929d796e47db62f43cb06b2dacaf33b4a Mon Sep 17 00:00:00 2001 From: Parham Alvani Date: Sun, 28 Aug 2022 13:27:43 +0430 Subject: [PATCH 311/660] fix: use configurable default vendor --- deployments/soteria/values.yaml | 1 + internal/api/api.go | 3 ++- internal/authenticator/authenticator.go | 2 -- internal/config/config.go | 9 +++++---- internal/config/default.go | 1 + 5 files changed, 9 insertions(+), 7 deletions(-) diff --git a/deployments/soteria/values.yaml b/deployments/soteria/values.yaml index df8ddb04..35ebbbcd 100644 --- a/deployments/soteria/values.yaml +++ b/deployments/soteria/values.yaml @@ -44,6 +44,7 @@ serviceMonitor: enabled: false config: + default_vendor: "snapp" http_port: 9999 logger: level: "warn" diff --git a/internal/api/api.go b/internal/api/api.go index 2679a8c2..052ac1f3 100644 --- a/internal/api/api.go +++ b/internal/api/api.go @@ -15,6 +15,7 @@ const VendorTokenSeparator = ":" type API struct { Authenticators map[string]*authenticator.Authenticator + DefaultVendor string Tracer trace.Tracer Logger zap.Logger } @@ -53,7 +54,7 @@ func (a API) Authenticator(vendor string) *authenticator.Authenticator { return auth } - return a.Authenticators[authenticator.DefaultVendor] + return a.Authenticators[a.DefaultVendor] } func ExtractVendorToken(rawToken, username, password string) (string, string) { diff --git a/internal/authenticator/authenticator.go b/internal/authenticator/authenticator.go index 6bb1e2d0..afd15458 100644 --- a/internal/authenticator/authenticator.go +++ b/internal/authenticator/authenticator.go @@ -9,8 +9,6 @@ import ( "gitlab.snapp.ir/dispatching/soteria/pkg/acl" ) -const DefaultVendor = "snapp" - // Authenticator is responsible for Acl/Auth/Token of users. type Authenticator struct { Keys map[string]any diff --git a/internal/config/config.go b/internal/config/config.go index eaa732dc..04bb703f 100644 --- a/internal/config/config.go +++ b/internal/config/config.go @@ -24,10 +24,11 @@ const ( type ( // Config is the main container of Soteria's config. Config struct { - Vendors []Vendor `koanf:"vendors"` - Logger logger.Config `koanf:"logger"` - HTTPPort int `koanf:"http_port"` - Tracer tracing.Config `koanf:"tracer"` + Vendors []Vendor `koanf:"vendors"` + Logger logger.Config `koanf:"logger"` + HTTPPort int `koanf:"http_port"` + Tracer tracing.Config `koanf:"tracer"` + DefaultVendor string `koanf:"default_vendor"` } Vendor struct { diff --git a/internal/config/default.go b/internal/config/default.go index cf7bb1dd..d1a2b9b3 100644 --- a/internal/config/default.go +++ b/internal/config/default.go @@ -17,6 +17,7 @@ const ( // nolint: gomnd func Default() Config { return Config{ + DefaultVendor: "snapp", Vendors: []Vendor{ SnappVendor(), }, From 129d1873f3fe6353133324abf6b58f4c926ad2c4 Mon Sep 17 00:00:00 2001 From: Parham Alvani Date: Sun, 28 Aug 2022 13:32:18 +0430 Subject: [PATCH 312/660] fix: add default vendor into main --- internal/cmd/serve/main.go | 1 + 1 file changed, 1 insertion(+) diff --git a/internal/cmd/serve/main.go b/internal/cmd/serve/main.go index cd4b7b2d..2ec0e3bc 100644 --- a/internal/cmd/serve/main.go +++ b/internal/cmd/serve/main.go @@ -23,6 +23,7 @@ type Serve struct { func (s Serve) main() { rest := api.API{ + DefaultVendor: s.Cfg.DefaultVendor, Authenticators: authenticator.Builder{Vendors: s.Cfg.Vendors, Logger: s.Logger}.Authenticators(), Tracer: s.Tracer, Logger: *s.Logger.Named("api"), From cae4354b1f38380d162bbbb506ad65588af56eb4 Mon Sep 17 00:00:00 2001 From: Parham Alvani Date: Sun, 28 Aug 2022 14:35:45 +0430 Subject: [PATCH 313/660] feat: update packages and create fatal log on empty vendor --- go.mod | 46 ++++++------- go.sum | 131 +++++++++++++++++++++++++++++++++++++ internal/api/api.go | 2 +- internal/cmd/serve/main.go | 12 +++- 4 files changed, 164 insertions(+), 27 deletions(-) diff --git a/go.mod b/go.mod index 2bcad31d..51a39fee 100644 --- a/go.mod +++ b/go.mod @@ -3,23 +3,23 @@ module gitlab.snapp.ir/dispatching/soteria go 1.18 require ( - github.com/ansrivas/fiberprometheus/v2 v2.2.0 - github.com/gofiber/contrib/fiberzap v0.0.0-20220524060257-8ccfafc37b12 - github.com/gofiber/fiber/v2 v2.34.0 - github.com/golang-jwt/jwt/v4 v4.4.1 - github.com/knadh/koanf v1.4.1 - github.com/prometheus/client_golang v1.12.2 // indirect - github.com/spf13/cobra v1.4.0 - github.com/stretchr/testify v1.7.1 + github.com/ansrivas/fiberprometheus/v2 v2.4.0 + github.com/gofiber/contrib/fiberzap v0.0.0-20220822164234-32bc232b53bd + github.com/gofiber/fiber/v2 v2.36.0 + github.com/golang-jwt/jwt/v4 v4.4.2 + github.com/knadh/koanf v1.4.3 + github.com/prometheus/client_golang v1.13.0 // indirect + github.com/spf13/cobra v1.5.0 + github.com/stretchr/testify v1.8.0 github.com/tidwall/pretty v1.2.0 gitlab.snapp.ir/dispatching/snappids/v2 v2.9.0 - go.opentelemetry.io/otel v1.7.0 - go.opentelemetry.io/otel/exporters/jaeger v1.7.0 - go.opentelemetry.io/otel/sdk v1.7.0 - go.opentelemetry.io/otel/trace v1.7.0 - go.uber.org/atomic v1.9.0 // indirect + go.opentelemetry.io/otel v1.9.0 + go.opentelemetry.io/otel/exporters/jaeger v1.9.0 + go.opentelemetry.io/otel/sdk v1.9.0 + go.opentelemetry.io/otel/trace v1.9.0 + go.uber.org/atomic v1.10.0 // indirect go.uber.org/automaxprocs v1.5.1 - go.uber.org/zap v1.21.0 + go.uber.org/zap v1.23.0 ) require ( @@ -31,27 +31,27 @@ require ( github.com/fsnotify/fsnotify v1.5.4 // indirect github.com/go-logr/logr v1.2.3 // indirect github.com/go-logr/stdr v1.2.2 // indirect - github.com/gofiber/adaptor/v2 v2.1.24 // indirect + github.com/gofiber/adaptor/v2 v2.1.25 // indirect github.com/gofiber/utils v0.1.2 // indirect github.com/golang/protobuf v1.5.2 // indirect - github.com/inconshreveable/mousetrap v1.0.0 // indirect - github.com/klauspost/compress v1.15.6 // indirect + github.com/inconshreveable/mousetrap v1.0.1 // indirect + github.com/klauspost/compress v1.15.9 // indirect github.com/matttproud/golang_protobuf_extensions v1.0.1 // indirect github.com/mitchellh/copystructure v1.2.0 // indirect github.com/mitchellh/mapstructure v1.5.0 // indirect github.com/mitchellh/reflectwalk v1.0.2 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect github.com/prometheus/client_model v0.2.0 // indirect - github.com/prometheus/common v0.34.0 // indirect - github.com/prometheus/procfs v0.7.3 // indirect + github.com/prometheus/common v0.37.0 // indirect + github.com/prometheus/procfs v0.8.0 // indirect github.com/speps/go-hashids/v2 v2.0.1 // indirect github.com/spf13/pflag v1.0.5 // indirect github.com/valyala/bytebufferpool v1.0.0 // indirect - github.com/valyala/fasthttp v1.37.0 // indirect + github.com/valyala/fasthttp v1.39.0 // indirect github.com/valyala/tcplisten v1.0.0 // indirect go.uber.org/multierr v1.8.0 // indirect - golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a // indirect - google.golang.org/protobuf v1.28.0 // indirect + golang.org/x/sys v0.0.0-20220825204002-c680a09ffe64 // indirect + google.golang.org/protobuf v1.28.1 // indirect gopkg.in/yaml.v2 v2.4.0 // indirect - gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b // indirect + gopkg.in/yaml.v3 v3.0.1 // indirect ) diff --git a/go.sum b/go.sum index bbe20f8e..73c93547 100644 --- a/go.sum +++ b/go.sum @@ -44,8 +44,13 @@ github.com/andybalholm/brotli v1.0.4 h1:V7DdXeJtZscaqfNuAdSRuRFzuiKlHSC/Zh3zl9qY github.com/andybalholm/brotli v1.0.4/go.mod h1:fO7iG3H7G2nSZ7m0zPUDn85XEX2GTukHGRSepvi9Eig= github.com/ansrivas/fiberprometheus/v2 v2.2.0 h1:9k459f75k5oaw0FmpTPizBry710vlhoBjzNaXW+/gls= github.com/ansrivas/fiberprometheus/v2 v2.2.0/go.mod h1:uJNa1TvTLLwP1wzmg0vg+YPlsqXkQHX+557hfltg+iY= +github.com/ansrivas/fiberprometheus/v2 v2.4.0 h1:oUCcrLFaoXgbWOqdg7GoKESO9aDwbkdGBHVtGEhraTo= +github.com/ansrivas/fiberprometheus/v2 v2.4.0/go.mod h1:lArdP4S+TlsxQw1vgO8ZkteUVQ9fYyKgXVdycuu0L3g= +github.com/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kdvxnR2qWY= +github.com/armon/circbuf v0.0.0-20150827004946-bbbad097214e/go.mod h1:3U/XgcO3hCbHZ8TKRvWD2dDTCfh9M9ya+I9JpbB7O8o= github.com/armon/go-metrics v0.0.0-20180917152333-f0300d1749da/go.mod h1:Q73ZrmVTwzkszR9V5SSuryQ31EELlFMUz1kKyl939pY= github.com/armon/go-radix v0.0.0-20180808171621-7fddfc383310/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8= +github.com/armon/go-radix v1.0.0/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8= github.com/aws/aws-sdk-go-v2 v1.9.2/go.mod h1:cK/D0BBs0b/oWPIcX/Z/obahJK1TT7IPVjy53i/mX/4= github.com/aws/aws-sdk-go-v2/config v1.8.3/go.mod h1:4AEiLtAb8kLs7vgw2ZV3p2VZ1+hBavOc84hqxVNpCyw= github.com/aws/aws-sdk-go-v2/credentials v1.4.3/go.mod h1:FNNC6nQZQUuyhq5aE5c7ata8o9e4ECGmS4lAXC7o1mQ= @@ -73,21 +78,29 @@ github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5P github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU= github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc= +github.com/cncf/udpa/go v0.0.0-20201120205902-5459f2c99403/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= +github.com/coreos/go-semver v0.3.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk= +github.com/coreos/go-systemd/v22 v22.3.2/go.mod h1:Y58oyj3AT4RCenI/lSvhwexgC+NSVTIJ3seZv2GcEnc= github.com/cpuguy83/go-md2man/v2 v2.0.1/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= +github.com/cpuguy83/go-md2man/v2 v2.0.2/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/dustin/go-humanize v1.0.0/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk= github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98= +github.com/envoyproxy/go-control-plane v0.9.9-0.20210217033140-668b12f5399d/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk= github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= +github.com/fatih/color v1.9.0/go.mod h1:eQcE1qtQxscV5RaZvpXrrb8Drkc3/DdQ+uUYCNjL+zU= github.com/fatih/structs v1.1.0 h1:Q7juDM0QtcnhCpeyLGQKyg4TOIghuNXrkL32pHAUMxo= github.com/fatih/structs v1.1.0/go.mod h1:9NiDSp5zOcgEDl+j00MP/WkGVPOlPRLejGD8Ga6PJ7M= github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ= github.com/fsnotify/fsnotify v1.5.4 h1:jRbGcIw6P2Meqdwuo0H1p6JVLbL5DHKAKlYndzMwVZI= github.com/fsnotify/fsnotify v1.5.4/go.mod h1:OVB6XrOHzAwXMpEM7uPOzcehqUV2UqJxmVXmkdnm1bU= +github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU= github.com/go-gl/glfw/v3.3/glfw v0.0.0-20191125211704-12ad95a8df72/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= github.com/go-gl/glfw/v3.3/glfw v0.0.0-20200222043503-6f7a984d4dc4/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= @@ -107,20 +120,33 @@ github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag= github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE= github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= github.com/go-test/deep v1.0.2-0.20181118220953-042da051cf31/go.mod h1:wGDj63lr65AM2AQyKZd/NYHGb0R+1RLqB8NKt3aSFNA= +github.com/godbus/dbus/v5 v5.0.4/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA= github.com/gofiber/adaptor/v2 v2.1.19/go.mod h1:BI6lLkHBVNAVxm9hVPXfYoAKZJnsvAxBnPnhfipgBGQ= +github.com/gofiber/adaptor/v2 v2.1.23/go.mod h1:hnYEQBPF2x1JaBHygutJJF5d0+J2eYnKKsUMCSsfxKk= github.com/gofiber/adaptor/v2 v2.1.24 h1:EdQWVODtOTRAHZRuNMbmNrlvgY+4liPO/JOwKk/Dkm0= github.com/gofiber/adaptor/v2 v2.1.24/go.mod h1:4g5V9/lhwLwgHHlQNEWXa3WUigzNjDXNmEN9BmQ2VME= +github.com/gofiber/adaptor/v2 v2.1.25 h1:K2Ef2a7mUsCfL/oJdzbjyMXchGYuUUwIVXrYVm+P+xs= +github.com/gofiber/adaptor/v2 v2.1.25/go.mod h1:gOxtwMVqUStB5goAYtKd+hSvGupdd+aRIafZHPLNaUk= github.com/gofiber/contrib/fiberzap v0.0.0-20220524060257-8ccfafc37b12 h1:JYRErtl8SCkpb+Q6SqJCnv7yNj0YdIEgXdT7c2jk3Cs= github.com/gofiber/contrib/fiberzap v0.0.0-20220524060257-8ccfafc37b12/go.mod h1:slKtSiIxJ2Fi5wX9iYZxUEay6OMXxYFfuBCqqXDqUaU= +github.com/gofiber/contrib/fiberzap v0.0.0-20220822164234-32bc232b53bd h1:GOgvE+/XmCHmTV4s54l4Xons8jwbYkdluVy5Sng1sNU= +github.com/gofiber/contrib/fiberzap v0.0.0-20220822164234-32bc232b53bd/go.mod h1:et6yk+/rccV7HhnGdJbU2spMOvfK+wXZUoaubUkL0nQ= github.com/gofiber/fiber/v2 v2.28.0/go.mod h1:0bPXdTu+jRqINrEq1T6mHeVBnE0lQd67PGu35jD3hLk= github.com/gofiber/fiber/v2 v2.29.0/go.mod h1:1Ega6O199a3Y7yDGuM9FyXDPYQfv+7/y48wl6WCwUF4= +github.com/gofiber/fiber/v2 v2.32.0/go.mod h1:CMy5ZLiXkn6qwthrl03YMyW1NLfj0rhxz2LKl4t7ZTY= +github.com/gofiber/fiber/v2 v2.33.0/go.mod h1:CMy5ZLiXkn6qwthrl03YMyW1NLfj0rhxz2LKl4t7ZTY= github.com/gofiber/fiber/v2 v2.34.0 h1:96BJMw6uaxQhJsHY54SFGOtGgp9pgombK5Hbi4JSEQA= github.com/gofiber/fiber/v2 v2.34.0/go.mod h1:ozRQfS+D7EL1+hMH+gutku0kfx1wLX4hAxDCtDzpj4U= +github.com/gofiber/fiber/v2 v2.36.0 h1:1qLMe5rhXFLPa2SjK10Wz7WFgLwYi4TYg7XrjztJHqA= +github.com/gofiber/fiber/v2 v2.36.0/go.mod h1:tgCr+lierLwLoVHHO/jn3Niannv34WRkQETU8wiL9fQ= github.com/gofiber/utils v0.1.2 h1:1SH2YEz4RlNS0tJlMJ0bGwO0JkqPqvq6TbHK9tXZKtk= github.com/gofiber/utils v0.1.2/go.mod h1:pacRFtghAE3UoknMOUiXh2Io/nLWSUHtQCi/3QASsOc= github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= +github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q= github.com/golang-jwt/jwt/v4 v4.4.1 h1:pC5DB52sCeK48Wlb9oPcdhnjkz1TKt1D/P7WKJ0kUcQ= github.com/golang-jwt/jwt/v4 v4.4.1/go.mod h1:m21LjoU+eqJr34lmDMbreY2eSTRJ1cv77w39/MY0Ch0= +github.com/golang-jwt/jwt/v4 v4.4.2 h1:rcc4lwaZgFMCZ5jxF9ABolDcIHdBytAFgqFPbSJQAYs= +github.com/golang-jwt/jwt/v4 v4.4.2/go.mod h1:m21LjoU+eqJr34lmDMbreY2eSTRJ1cv77w39/MY0Ch0= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/groupcache v0.0.0-20191227052852-215e87163ea7/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= @@ -175,19 +201,30 @@ github.com/google/pprof v0.0.0-20200229191704-1ebb73c60ed3/go.mod h1:ZgVRPoUq/hf github.com/google/pprof v0.0.0-20200430221834-fc25d7d30c6d/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= github.com/google/pprof v0.0.0-20200708004538-1a94d8640e99/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= +github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg= github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk= +github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0/go.mod h1:8NvIoxWQoOIhqOTXgfV/d3M/q6VIi02HzZEHgUlZvzk= +github.com/grpc-ecosystem/grpc-gateway v1.16.0/go.mod h1:BDjrQk3hbvj6Nolgz8mAMFbcEtjT1g+wF4CSlocrBnw= +github.com/hashicorp/consul/api v1.13.0/go.mod h1:ZlVrynguJKcYr54zGaDbaL3fOvKC9m72FhPvA8T35KQ= +github.com/hashicorp/consul/sdk v0.8.0/go.mod h1:GBvyrGALthsZObzUGsfgHZQDXjg4lOjagTIwIR1vPms= github.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= github.com/hashicorp/go-cleanhttp v0.5.0/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtngrth3wmdIIUrZ80= github.com/hashicorp/go-cleanhttp v0.5.1/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtngrth3wmdIIUrZ80= github.com/hashicorp/go-hclog v0.0.0-20180709165350-ff2cf002a8dd/go.mod h1:9bjs9uLqI8l75knNv3lV1kA55veR+WUPSiKIWcQHudI= github.com/hashicorp/go-hclog v0.8.0/go.mod h1:5CU+agLiy3J7N7QjHK5d05KxGsuXiQLrjA0H7acj2lQ= +github.com/hashicorp/go-hclog v0.12.0/go.mod h1:whpDNt7SSdeAju8AWKIWsul05p54N/39EeqMAyrmvFQ= github.com/hashicorp/go-immutable-radix v1.0.0/go.mod h1:0y9vanUI8NX6FsYoO3zeMjhV/C5i9g4Q3DwcSNZ4P60= +github.com/hashicorp/go-msgpack v0.5.3/go.mod h1:ahLV/dePpqEmjfWmKiqvPkv/twdG7iPBM1vqhUKIvfM= github.com/hashicorp/go-multierror v1.0.0/go.mod h1:dHtQlpGsu+cZNNAkkCN/P3hoUDHhCYQXV3UM06sGGrk= +github.com/hashicorp/go-multierror v1.1.0/go.mod h1:spPvp8C1qA32ftKqdAHm4hHTbPw+vmowP0z+KUhOZdA= github.com/hashicorp/go-plugin v1.0.1/go.mod h1:++UyYGoz3o5w9ZzAdZxtQKrWWP+iqPBn3cQptSMzBuY= github.com/hashicorp/go-retryablehttp v0.5.4/go.mod h1:9B5zBasrRhHXnJnui7y6sL7es7NDiJgTc6Er0maI1Xs= github.com/hashicorp/go-rootcerts v1.0.1/go.mod h1:pqUvnprVnM5bf7AOirdbb01K4ccR319Vf4pU3K5EGc8= +github.com/hashicorp/go-rootcerts v1.0.2/go.mod h1:pqUvnprVnM5bf7AOirdbb01K4ccR319Vf4pU3K5EGc8= +github.com/hashicorp/go-sockaddr v1.0.0/go.mod h1:7Xibr9yA9JjQq1JpNB2Vw7kxv8xerXegt+ozgdvDeDU= github.com/hashicorp/go-sockaddr v1.0.2/go.mod h1:rB4wwRAUzs07qva3c5SdrY/NEtAUjGlgmH/UkBUC97A= +github.com/hashicorp/go-syslog v1.0.0/go.mod h1:qPfqrKkXGihmCqbJM2mZgkZGvKG1dFdvsLplgctolz4= github.com/hashicorp/go-uuid v1.0.0/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= github.com/hashicorp/go-uuid v1.0.1/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= github.com/hashicorp/go-version v1.1.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= @@ -195,13 +232,20 @@ github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= github.com/hashicorp/hcl v1.0.0 h1:0Anlzjpi4vEasTeNFn2mLJgTSwt0+6sfsiTG8qcWGx4= github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ= +github.com/hashicorp/logutils v1.0.0/go.mod h1:QIAnNjmIWmVIIkWDTG1z5v++HQmx9WQRO+LraFDTW64= +github.com/hashicorp/mdns v1.0.4/go.mod h1:mtBihi+LeNXGtG8L9dX59gAEa12BDtBQSp4v/YAJqrc= +github.com/hashicorp/memberlist v0.3.0/go.mod h1:MS2lj3INKhZjWNqd3N0m3J+Jxf3DAOnAH9VT3Sh9MUE= +github.com/hashicorp/serf v0.9.6/go.mod h1:TXZNMjZQijwlDvp+r0b63xZ45H7JmCmgg4gpTwn9UV4= github.com/hashicorp/vault/api v1.0.4/go.mod h1:gDcqh3WGcR1cpF5AJz/B1UFheUEneMoIospckxBxk6Q= github.com/hashicorp/vault/sdk v0.1.13/go.mod h1:B+hVj7TpuQY1Y/GPbCpffmgd+tSEwvhkWnjtSYCaS2M= github.com/hashicorp/yamux v0.0.0-20180604194846-3520598351bb/go.mod h1:+NfK9FKeTrX5uv1uIXGdwYDTeHna2qgaIlx54MXqjAM= github.com/hashicorp/yamux v0.0.0-20181012175058-2f1d1f20f75d/go.mod h1:+NfK9FKeTrX5uv1uIXGdwYDTeHna2qgaIlx54MXqjAM= +github.com/hjson/hjson-go/v4 v4.0.0/go.mod h1:KaYt3bTw3zhBjYqnXkYywcYctk0A2nxeEFTse3rH13E= github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= github.com/inconshreveable/mousetrap v1.0.0 h1:Z8tu5sraLXCXIcARxBp/8cbvlwVa7Z1NHg9XEKhtSvM= github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8= +github.com/inconshreveable/mousetrap v1.0.1 h1:U3uMjPSQEBMNp1lFxmllqCPM6P5u/Xq7Pgzkat/bFNc= +github.com/inconshreveable/mousetrap v1.0.1/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw= github.com/jmespath/go-jmespath v0.4.0/go.mod h1:T8mJZnbsbmF+m6zOOFylbeCJqk5+pHWvzYPziyZiYoo= github.com/jmespath/go-jmespath/internal/testify v1.5.1/go.mod h1:L3OGu8Wl2/fWfCI6z80xFu9LTZmf1ZRjMHUOPmWr69U= github.com/joho/godotenv v1.3.0 h1:Zjp+RcGpHhGlrMbJzXTrZZPrWj+1vfm90La1wgB6Bhc= @@ -215,17 +259,23 @@ github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1 github.com/jstemmer/go-junit-report v0.9.1/go.mod h1:Brl9GWCQeLvo8nXZwPNNblvFj/XSXhF0NWZEnDohbsk= github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w= github.com/julienschmidt/httprouter v1.3.0/go.mod h1:JR6WtHb+2LUe8TCKY3cZOxFyyO8IZAc4RVcycCCAKdM= +github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8= github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= github.com/klauspost/compress v1.14.1/go.mod h1:/3/Vjq9QcHkK5uEr5lBEmyoZ1iFhe47etQ6QUkpK6sk= github.com/klauspost/compress v1.15.0/go.mod h1:/3/Vjq9QcHkK5uEr5lBEmyoZ1iFhe47etQ6QUkpK6sk= github.com/klauspost/compress v1.15.6 h1:6D9PcO8QWu0JyaQ2zUMmu16T1T+zjjEpP91guRsvDfY= github.com/klauspost/compress v1.15.6/go.mod h1:PhcZ0MbTNciWF3rruxRgKxI5NkcHHrHUDtV4Yw2GlzU= +github.com/klauspost/compress v1.15.9 h1:wKRjX6JRtDdrE9qwa4b/Cip7ACOshUI4smpCQanqjSY= +github.com/klauspost/compress v1.15.9/go.mod h1:PhcZ0MbTNciWF3rruxRgKxI5NkcHHrHUDtV4Yw2GlzU= github.com/knadh/koanf v1.4.1 h1:Z0VGW/uo8NJmjd+L1Dc3S5frq6c62w5xQ9Yf4Mg3wFQ= github.com/knadh/koanf v1.4.1/go.mod h1:1cfH5223ZeZUOs8FU2UdTmaNfHpqgtjV0+NHjRO43gs= +github.com/knadh/koanf v1.4.3 h1:rSJcSH5LSFhvzBRsAYfT3k7eLP0I4UxeZqjtAatk+wc= +github.com/knadh/koanf v1.4.3/go.mod h1:5FAkuykKXZvLqhAbP4peWgM5CTcZmn7L1d27k/a+kfg= github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/konsorten/go-windows-terminal-sequences v1.0.3/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc= github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= +github.com/kr/pretty v0.2.0/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= github.com/kr/pretty v0.3.0 h1:WgNl7dwNpEZ6jJ9k1snq4pZsg7DOEN8hP9Xw0Tsjwk0= github.com/kr/pretty v0.3.0/go.mod h1:640gp4NfQd8pI5XOwp5fnNeVWj67G7CFk/SaSQn7NBk= @@ -234,10 +284,19 @@ github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU= +github.com/mattn/go-colorable v0.1.4/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE= +github.com/mattn/go-colorable v0.1.6/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= github.com/mattn/go-isatty v0.0.3/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= +github.com/mattn/go-isatty v0.0.8/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s= +github.com/mattn/go-isatty v0.0.10/go.mod h1:qgIWMr58cqv1PHHyhnkY9lrL7etaEgOFcMEpPG5Rm84= +github.com/mattn/go-isatty v0.0.11/go.mod h1:PhnuNfih5lzO57/f3n+odYbM4JtupLOxQOAqxQCu2WE= +github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU= github.com/matttproud/golang_protobuf_extensions v1.0.1 h1:4hp9jkHxhMHkqkrB3Ix0jegS5sx/RkqARlsWZ6pIwiU= github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= +github.com/miekg/dns v1.1.26/go.mod h1:bPDLeHnStXmXAq1m/Ch/hvfNHr14JKNPMBo3VZKjuso= +github.com/miekg/dns v1.1.41/go.mod h1:p6aan82bvRIyn+zDIv9xYNUpwa73JcSh9BKwknJysuI= github.com/mitchellh/cli v1.0.0/go.mod h1:hNIlj7HEI86fIcpObd7a0FcrxTWetlwJDGcceTlRvqc= +github.com/mitchellh/cli v1.1.0/go.mod h1:xcISNoH86gajksDmfB23e/pu+B+GeFRMYmoHXxx3xhI= github.com/mitchellh/copystructure v1.0.0/go.mod h1:SNtv71yrdKgLRyLFxmLdkAbkKEFWgYaq1OVrnRcwhnw= github.com/mitchellh/copystructure v1.2.0 h1:vpKXTN4ewci03Vljg/q9QvCGUDttBOGBIa15WveJJGw= github.com/mitchellh/copystructure v1.2.0/go.mod h1:qLl+cE2AmVv+CoeAwDPye/v+N2HKCj9FbZEVFJRxO9s= @@ -245,6 +304,7 @@ github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrk github.com/mitchellh/go-testing-interface v0.0.0-20171004221916-a61a99592b77/go.mod h1:kRemZodwjscx+RGhAo8eIhFbs2+BFgRtFPeD/KE+zxI= github.com/mitchellh/go-testing-interface v1.0.0/go.mod h1:kRemZodwjscx+RGhAo8eIhFbs2+BFgRtFPeD/KE+zxI= github.com/mitchellh/go-wordwrap v1.0.0/go.mod h1:ZXFpozHsX6DPmq2I0TCekCxypsnAUbP2oI0UX1GXzOo= +github.com/mitchellh/mapstructure v0.0.0-20160808181253-ca63d7c062ee/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= github.com/mitchellh/mapstructure v1.4.1/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= github.com/mitchellh/mapstructure v1.5.0 h1:jeMsZIYE/09sWLaz43PL7Gy6RuMjD2eJVyuac5Z2hdY= @@ -261,6 +321,7 @@ github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRW github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= github.com/npillmayer/nestext v0.1.3/go.mod h1:h2lrijH8jpicr25dFY+oAJLyzlya6jhnuG+zWp9L0Uk= github.com/oklog/run v1.0.0/go.mod h1:dlhp/R75TPv97u0XWUtDeV/lRKWPKSdTuV0TZvrmrQA= +github.com/pascaldekloe/goe v0.0.0-20180627143212-57f6aae5913c/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc= github.com/pascaldekloe/goe v0.1.0/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc= github.com/pelletier/go-toml v1.7.0 h1:7utD74fnzVc/cpcyy8sjrlFr5vYpypUixARcHIMIGuI= github.com/pelletier/go-toml v1.7.0/go.mod h1:vwGMzjaWMwyfHwgIBhI2YUM4fB6nL6lVAvS1LBMMhTE= @@ -273,14 +334,18 @@ github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINE github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/posener/complete v1.1.1/go.mod h1:em0nMJCgc9GFtwrmVmEMR/ZL6WyhyjMBndrE9hABlRI= +github.com/posener/complete v1.2.3/go.mod h1:WZIdtGGp+qx0sLrYKtIRAruyNpv6hFCicSgv7Sy7s/s= github.com/prashantv/gostub v1.1.0 h1:BTyx3RfQjRHnUWaGF9oQos79AlQ5k8WNktv7VGvVH4g= github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw= github.com/prometheus/client_golang v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5FsnadC4Ky3P0J6CfImo= github.com/prometheus/client_golang v1.7.1/go.mod h1:PY5Wy2awLA44sXw4AOSfFBetzPP4j5+D6mVACh+pe2M= github.com/prometheus/client_golang v1.11.0/go.mod h1:Z6t4BnS23TR94PD6BsDNk8yVqroYurpAkEiz0P2BEV0= +github.com/prometheus/client_golang v1.11.1/go.mod h1:Z6t4BnS23TR94PD6BsDNk8yVqroYurpAkEiz0P2BEV0= github.com/prometheus/client_golang v1.12.1/go.mod h1:3Z9XVyYiZYEO+YQWt3RD2R3jrbd179Rt297l4aS6nDY= github.com/prometheus/client_golang v1.12.2 h1:51L9cDoUHVrXx4zWYlcLQIZ+d+VXHgqnYKkIuq4g/34= github.com/prometheus/client_golang v1.12.2/go.mod h1:3Z9XVyYiZYEO+YQWt3RD2R3jrbd179Rt297l4aS6nDY= +github.com/prometheus/client_golang v1.13.0 h1:b71QUfeo5M8gq2+evJdTPfZhYMAU0uKPkyPJ7TPsloU= +github.com/prometheus/client_golang v1.13.0/go.mod h1:vTeo+zgvILHsnnj/39Ou/1fPN5nJFOEMgftOUOmlvYQ= github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= @@ -292,20 +357,27 @@ github.com/prometheus/common v0.26.0/go.mod h1:M7rCNAaPfAosfx8veZJCuw84e35h3Cfd9 github.com/prometheus/common v0.32.1/go.mod h1:vu+V0TpY+O6vW9J44gczi3Ap/oXXR10b+M/gUGO4Hls= github.com/prometheus/common v0.34.0 h1:RBmGO9d/FVjqHT0yUGQwBJhkwKV+wPCn7KGpvfab0uE= github.com/prometheus/common v0.34.0/go.mod h1:gB3sOl7P0TvJabZpLY5uQMpUqRCPPCyRLCZYc7JZTNE= +github.com/prometheus/common v0.37.0 h1:ccBbHCgIiT9uSoFY0vX8H3zsNR5eLt17/RQLUvn8pXE= +github.com/prometheus/common v0.37.0/go.mod h1:phzohg0JFMnBEFGxTDbfu3QyL5GI8gTQJFhYO5B3mfA= github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= github.com/prometheus/procfs v0.1.3/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU= github.com/prometheus/procfs v0.6.0/go.mod h1:cz+aTbrPOrUb4q7XlbU9ygM+/jj0fzG6c1xBZuNvfVA= github.com/prometheus/procfs v0.7.3 h1:4jVXhlkAyzOScmCkXBTOLRLTz8EeU+eyjrwB/EPq0VU= github.com/prometheus/procfs v0.7.3/go.mod h1:cz+aTbrPOrUb4q7XlbU9ygM+/jj0fzG6c1xBZuNvfVA= +github.com/prometheus/procfs v0.8.0 h1:ODq8ZFEaYeCaZOJlZZdJA2AbQR98dSHSM1KW/You5mo= +github.com/prometheus/procfs v0.8.0/go.mod h1:z7EfXMXOkbkqb9IINtpCn86r/to3BnA0uaxHdg830/4= github.com/rhnvrm/simples3 v0.6.1/go.mod h1:Y+3vYm2V7Y4VijFoJHHTrja6OgPrJ2cBti8dPGkC3sA= +github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6LYCDYWNEvQ= github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= github.com/rogpeppe/go-internal v1.6.1/go.mod h1:xXDCJY+GAPziupqXw64V24skbSoqbTEfhy4qGm1nDQc= github.com/rogpeppe/go-internal v1.8.1 h1:geMPLpDpQOgVyCg5z5GoRwLHepNdb71NXb67XFkP+Eg= github.com/rogpeppe/go-internal v1.8.1/go.mod h1:JeRgkft04UBgHMgCIwADu4Pn6Mtm5d4nPKWu0nJ5d+o= github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= +github.com/ryanuber/columnize v0.0.0-20160712163229-9b3edd62028f/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts= github.com/ryanuber/columnize v2.1.0+incompatible/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts= github.com/ryanuber/go-glob v1.0.0/go.mod h1:807d1WSdnB0XRJzKNil9Om6lcp/3a0v4qIHxIXzX/Yc= +github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529/go.mod h1:DxrIzT+xaE7yg65j358z/aeFdxmN0P9QXhEzd20vsDc= github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE= github.com/sirupsen/logrus v1.6.0/go.mod h1:7uNnSEd1DgxDLC74fIahvMZmmYsHGZGEOFrfsX/uA88= @@ -313,11 +385,14 @@ github.com/speps/go-hashids/v2 v2.0.1 h1:ViWOEqWES/pdOSq+C1SLVa8/Tnsd52XC34RY7lt github.com/speps/go-hashids/v2 v2.0.1/go.mod h1:47LKunwvDZki/uRVD6NImtyk712yFzIs3UF3KlHohGw= github.com/spf13/cobra v1.4.0 h1:y+wJpx64xcgO1V+RcnwW0LEHxTKRi2ZDPSBjWnrg88Q= github.com/spf13/cobra v1.4.0/go.mod h1:Wo4iy3BUC+X2Fybo0PDqwJIv3dNRiZLHQymsfxlB84g= +github.com/spf13/cobra v1.5.0 h1:X+jTBEBqF0bHN+9cSMgmfuvv2VHJ9ezmFNf9Y/XstYU= +github.com/spf13/cobra v1.5.0/go.mod h1:dWXEIy2H428czQCjInthrTRUg7yKbok+2Qi/yBIJoUM= github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA= github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.1.1 h1:2vfRuCMp5sSVIDSqO8oNnWJq7mPa6KVP3iPIwFBuy8A= github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= +github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw= github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= @@ -325,23 +400,32 @@ github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5 github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.7.1 h1:5TQK59W5E3v0r2duFAb7P95B6hEeOyEnHRa8MjYSMTY= github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= +github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= github.com/tidwall/pretty v1.2.0 h1:RWIZEg2iJ8/g6fDDYzMpobmaoGh5OLl4AXtGUGPcqCs= github.com/tidwall/pretty v1.2.0/go.mod h1:ITEVvHYasfjBbM0u2Pg8T2nJnzm8xPwvNhhsoaGGjNU= github.com/valyala/bytebufferpool v1.0.0 h1:GqA5TC/0021Y/b9FG4Oi9Mr3q7XYx6KllzawFIhcdPw= github.com/valyala/bytebufferpool v1.0.0/go.mod h1:6bBcMArwyJ5K/AmCkWv1jt77kVWyCJ6HpOuEn7z0Csc= github.com/valyala/fasthttp v1.33.0/go.mod h1:KJRK/MXx0J+yd0c5hlR+s1tIHD72sniU8ZJjl97LIw4= github.com/valyala/fasthttp v1.34.0/go.mod h1:epZA5N+7pY6ZaEKRmstzOuYJx9HI8DI1oaCGZpdH4h0= +github.com/valyala/fasthttp v1.35.0/go.mod h1:t/G+3rLek+CyY9bnIE+YlMRddxVAAGjhxndDB4i4C0I= github.com/valyala/fasthttp v1.37.0 h1:7WHCyI7EAkQMVmrfBhWTCOaeROb1aCBiTopx63LkMbE= github.com/valyala/fasthttp v1.37.0/go.mod h1:t/G+3rLek+CyY9bnIE+YlMRddxVAAGjhxndDB4i4C0I= +github.com/valyala/fasthttp v1.38.0/go.mod h1:t/G+3rLek+CyY9bnIE+YlMRddxVAAGjhxndDB4i4C0I= +github.com/valyala/fasthttp v1.39.0 h1:lW8mGeM7yydOqZKmwyMTaz/PH/A+CLgtmmcjv+OORfU= +github.com/valyala/fasthttp v1.39.0/go.mod h1:t/G+3rLek+CyY9bnIE+YlMRddxVAAGjhxndDB4i4C0I= github.com/valyala/tcplisten v1.0.0 h1:rBHj/Xf+E1tRGZyWIWwJDiRY0zc1Js+CV5DqwacVSA8= github.com/valyala/tcplisten v1.0.0/go.mod h1:T0xQ8SeCZGxckz9qRXTfG43PvQ/mcWh7FwZEA7Ioqkc= github.com/yuin/goldmark v1.1.25/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.1.32/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= +github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.3.5/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= github.com/yuin/goldmark v1.4.1/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= gitlab.snapp.ir/dispatching/snappids/v2 v2.9.0 h1:nb3uqHasVp4CGvS8jJKP5c/dkff9XJfOToGwqctXoVo= gitlab.snapp.ir/dispatching/snappids/v2 v2.9.0/go.mod h1:U7lxAuqPifdXkUNcCXhtk9+6HFAyw5qy8LrF1DQDMuQ= +go.etcd.io/etcd/api/v3 v3.5.4/go.mod h1:5GB2vv4A4AOn3yk7MftYGHkUfGtDHnEraIjym4dYz5A= +go.etcd.io/etcd/client/pkg/v3 v3.5.4/go.mod h1:IJHfcCEKxYu1Os13ZdwCwIUTUVGYTSAM3YSwc9/Ac1g= +go.etcd.io/etcd/client/v3 v3.5.4/go.mod h1:ZaRkVgBZC+L+dLCjTcF1hRXpgZXQPOvnA/Ak/gq3kiY= go.opencensus.io v0.21.0/go.mod h1:mSImk1erAIZhrmZN+AvHh14ztQfjbGwt4TtuofqLduU= go.opencensus.io v0.22.0/go.mod h1:+kGneAE2xo2IficOXnaByMWTGM9T73dGwxeWcUqIpI8= go.opencensus.io v0.22.2/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= @@ -349,15 +433,25 @@ go.opencensus.io v0.22.3/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= go.opencensus.io v0.22.4/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= go.opentelemetry.io/otel v1.7.0 h1:Z2lA3Tdch0iDcrhJXDIlC94XE+bxok1F9B+4Lz/lGsM= go.opentelemetry.io/otel v1.7.0/go.mod h1:5BdUoMIz5WEs0vt0CUEMtSSaTSHBBVwrhnz7+nrD5xk= +go.opentelemetry.io/otel v1.9.0 h1:8WZNQFIB2a71LnANS9JeyidJKKGOOremcUtb/OtHISw= +go.opentelemetry.io/otel v1.9.0/go.mod h1:np4EoPGzoPs3O67xUVNoPPcmSvsfOxNlNA4F4AC+0Eo= go.opentelemetry.io/otel/exporters/jaeger v1.7.0 h1:wXgjiRldljksZkZrldGVe6XrG9u3kYDyQmkZwmm5dI0= go.opentelemetry.io/otel/exporters/jaeger v1.7.0/go.mod h1:PwQAOqBgqbLQRKlj466DuD2qyMjbtcPpfPfj+AqbSBs= +go.opentelemetry.io/otel/exporters/jaeger v1.9.0 h1:gAEgEVGDWwFjcis9jJTOJqZNxDzoZfR12WNIxr7g9Ww= +go.opentelemetry.io/otel/exporters/jaeger v1.9.0/go.mod h1:hquezOLVAybNW6vanIxkdLXTXvzlj2Vn3wevSP15RYs= go.opentelemetry.io/otel/sdk v1.7.0 h1:4OmStpcKVOfvDOgCt7UriAPtKolwIhxpnSNI/yK+1B0= go.opentelemetry.io/otel/sdk v1.7.0/go.mod h1:uTEOTwaqIVuTGiJN7ii13Ibp75wJmYUDe374q6cZwUU= +go.opentelemetry.io/otel/sdk v1.9.0 h1:LNXp1vrr83fNXTHgU8eO89mhzxb/bbWAsHG6fNf3qWo= +go.opentelemetry.io/otel/sdk v1.9.0/go.mod h1:AEZc8nt5bd2F7BC24J5R0mrjYnpEgYHyTcM/vrSple4= go.opentelemetry.io/otel/trace v1.7.0 h1:O37Iogk1lEkMRXewVtZ1BBTVn5JEp8GrJvP92bJqC6o= go.opentelemetry.io/otel/trace v1.7.0/go.mod h1:fzLSB9nqR2eXzxPXb2JW9IKE+ScyXA48yyE4TNvoHqU= +go.opentelemetry.io/otel/trace v1.9.0 h1:oZaCNJUjWcg60VXWee8lJKlqhPbXAPB51URuR47pQYc= +go.opentelemetry.io/otel/trace v1.9.0/go.mod h1:2737Q0MuG8q1uILYm2YYVkAyLtOofiTNGg6VODnOiPo= go.uber.org/atomic v1.7.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc= go.uber.org/atomic v1.9.0 h1:ECmE8Bn/WFTYwEW/bpKD3M8VtR/zQVbavAoalC1PYyE= go.uber.org/atomic v1.9.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc= +go.uber.org/atomic v1.10.0 h1:9qC72Qh0+3MqyJbAn8YU5xVq1frD8bn3JtD2oXtafVQ= +go.uber.org/atomic v1.10.0/go.mod h1:LUxbIzbOniOlMKjJjyPfpl4v+PKK2cNJn91OQbhoJI0= go.uber.org/automaxprocs v1.5.1 h1:e1YG66Lrk73dn4qhg8WFSvhF0JuFQF0ERIp4rpuV8Qk= go.uber.org/automaxprocs v1.5.1/go.mod h1:BF4eumQw0P9GtnuxxovUd06vwm1o18oMzFtK66vU6XU= go.uber.org/goleak v1.1.11/go.mod h1:cwTWslyiVhfpKIDGSZEM2HlOvcqm+tG4zioyIeLoqMQ= @@ -367,12 +461,16 @@ go.uber.org/multierr v1.6.0/go.mod h1:cdWPpRnG4AhwMwsgIHip0KRBQjJy5kYEpYjJxpXp9i go.uber.org/multierr v1.7.0/go.mod h1:7EAYxJLBy9rStEaz58O2t4Uvip6FSURkq8/ppBp95ak= go.uber.org/multierr v1.8.0 h1:dg6GjLku4EH+249NNmoIciG9N/jURbDG+pFlTkhzIC8= go.uber.org/multierr v1.8.0/go.mod h1:7EAYxJLBy9rStEaz58O2t4Uvip6FSURkq8/ppBp95ak= +go.uber.org/zap v1.17.0/go.mod h1:MXVU+bhUf/A7Xi2HNOnopQOrmycQ5Ih87HtOu4q5SSo= go.uber.org/zap v1.21.0 h1:WefMeulhovoZ2sYXz7st6K0sLj7bBhpiFaud4r4zST8= go.uber.org/zap v1.21.0/go.mod h1:wjWOCqI0f2ZZrJF/UufIOkiC8ii6tm1iqIsLo76RfJw= +go.uber.org/zap v1.23.0 h1:OjGQ5KQDEUawVHxNwQgPpiypGHOxo2mNZsOqTak4fFY= +go.uber.org/zap v1.23.0/go.mod h1:D+nX8jyLsMHMYrln8A0rJjFt/T/9/bGgIhAqxv5URuY= golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +golang.org/x/crypto v0.0.0-20190923035154-9ee001bba392/go.mod h1:/lpIB1dKB+9EgE3H3cr1v9wB50oz8l4C4h62xy7jSTY= golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20220112180741-5e0467b6c7ce/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= @@ -424,6 +522,7 @@ golang.org/x/net v0.0.0-20190613194153-d28f0bde5980/go.mod h1:z5CRVTTTmAJ677TzLL golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20190628185345-da137c7871d7/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20190724013045-ca1201d0de80/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20190923162816-aa69164e4478/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20191209160850-c0dbc17a3553/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200114155413-6afb5195e5aa/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200202094626-16171245cfb2/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= @@ -438,7 +537,10 @@ golang.org/x/net v0.0.0-20200520182314-0ba52f642ac2/go.mod h1:qpuaurCH72eLCgpAm/ golang.org/x/net v0.0.0-20200625001655-4c5254603344/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= golang.org/x/net v0.0.0-20200707034311-ab3426394381/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= golang.org/x/net v0.0.0-20200822124328-c89045814202/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= +golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= +golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM= +golang.org/x/net v0.0.0-20210410081132-afb366fc7cd1/go.mod h1:9tjilg8BloeKEkVJvy7fQ90B1CfIiPueXVOjqfkSzI8= golang.org/x/net v0.0.0-20210525063256-abc453219eb5/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20211015210444-4f30a5c0130f/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= @@ -460,6 +562,7 @@ golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20200317015054-43a5402ce75a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20200625203802-6e8e738ad208/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201207232520-09787c993a3a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sys v0.0.0-20180823144017-11551d06cbcc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= @@ -468,6 +571,7 @@ golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5h golang.org/x/sys v0.0.0-20181116152217-5ac8a444bdc5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190129075346-302c3dd5f1cc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20190222072716-a9d3bda3a223/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190312061237-fead79001313/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190403152447-81d4e9dc473e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -477,13 +581,19 @@ golang.org/x/sys v0.0.0-20190507160741-ecd444e8653b/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20190606165138-5da285871e9c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190624142023-c5567b49c5d0/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190726091711-fc99dfbffb4e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190922100055-0a153f010e69/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190924154521-2837fb4f24fe/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191001151750-bb3f8db39f24/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191005200804-aed5e4c7ecf9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191008105621-543471e840be/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191026070338-33540a1f6037/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191204072324-ce4227a45e2e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191228213918-04cbcbbfeed8/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200106162015-b016eb3dc98e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200113162924-86b910548bc1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200116001909-b77594299b42/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200122134326-e047566fdf82/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200124204421-9fbb57f87de9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200202164722-d101bd2416d5/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200212091648-12a6c2dcc1e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -497,9 +607,12 @@ golang.org/x/sys v0.0.0-20200523222454-059865788121/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20200615200032-f1bc736245b1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200625212154-ddb9806d33ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200803210538-64077c9b5642/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210303074136-134d130e1a04/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210330210617-4fbd30eecc44/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210403161142-5e06dd20ab57/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210423185535-09eb48e85fd7/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= @@ -513,6 +626,8 @@ golang.org/x/sys v0.0.0-20220227234510-4e6760a101f9/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20220412211240-33da011f77ad/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a h1:dGzPydgVsqGcTRVwiLJ1jVbufYwmzD3LfVPLKsKg+0k= golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220825204002-c680a09ffe64 h1:UiNENfZ8gDvpiWw7IpOMQ27spWmThO1RwwdQVbJahJM= +golang.org/x/sys v0.0.0-20220825204002-c680a09ffe64/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= @@ -521,6 +636,7 @@ golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3 golang.org/x/text v0.3.1-0.20181227161524-e6919f6577db/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= +golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= @@ -539,6 +655,7 @@ golang.org/x/tools v0.0.0-20190606124116-d0a3d012864b/go.mod h1:/rFqwRUd4F7ZHNgw golang.org/x/tools v0.0.0-20190621195816-6e04913cbbac/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= golang.org/x/tools v0.0.0-20190628153133-6cdbf07be9d0/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= golang.org/x/tools v0.0.0-20190816200558-6889da9d5479/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20190907020128-2ca718005c18/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20190911174233-4f2ddba30aff/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191012152004-8de300cfc20a/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191113191852-77e3bb0ad9e7/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= @@ -563,9 +680,12 @@ golang.org/x/tools v0.0.0-20200501065659-ab2804fb9c9d/go.mod h1:EkVYQZoAsY45+roY golang.org/x/tools v0.0.0-20200512131952-2bc93b1c0c88/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= golang.org/x/tools v0.0.0-20200515010526-7d3b6ebf133d/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= golang.org/x/tools v0.0.0-20200618134242-20370b0cb4b2/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= +golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= golang.org/x/tools v0.0.0-20200729194436-6467de6f59a7/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= golang.org/x/tools v0.0.0-20200804011535-6c149bb5ef0d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= golang.org/x/tools v0.0.0-20200825202427-b303f430e36d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= +golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= +golang.org/x/tools v0.1.2/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.5/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.8/go.mod h1:nABZi5QlRsZVlzPpHl034qft6wpY4eDcsTt5AaioBiU= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= @@ -619,12 +739,14 @@ google.golang.org/genproto v0.0.0-20200312145019-da6875a35672/go.mod h1:55QSHmfG google.golang.org/genproto v0.0.0-20200331122359-1ee6d9798940/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= google.golang.org/genproto v0.0.0-20200430143042-b979b6f78d84/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= google.golang.org/genproto v0.0.0-20200511104702-f5ebc3bea380/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200513103714-09dca8ec2884/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= google.golang.org/genproto v0.0.0-20200515170657-fc4c6c6a6587/go.mod h1:YsZOwe1myG/8QRHRsmBRE1LrgQY60beZKjly0O1fX9U= google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo= google.golang.org/genproto v0.0.0-20200618031413-b414f8b61790/go.mod h1:jDfRM7FcilCzHH/e9qn6dsT145K34l5v+OpcnNgKAAA= google.golang.org/genproto v0.0.0-20200729003335-053ba62fc06f/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20200804131852-c06518451d9c/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20200825200019-8632dd797987/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20210602131652-f16073e35f0c/go.mod h1:UODoCrxHCcBojKKwX1terBiRUaqAsFqJiF615XL43r0= google.golang.org/grpc v1.14.0/go.mod h1:yo6s7OP7yaDglbqo1J04qKzAhqBH6lvTonzMVmEdcZw= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38= @@ -639,6 +761,8 @@ google.golang.org/grpc v1.28.0/go.mod h1:rpkK4SK4GF4Ach/+MFLZUBavHOvF2JJB5uozKKa google.golang.org/grpc v1.29.1/go.mod h1:itym6AZVZYACWQqET3MqgPpjcuV5QH3BxFS3IjizoKk= google.golang.org/grpc v1.30.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= google.golang.org/grpc v1.31.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= +google.golang.org/grpc v1.33.1/go.mod h1:fr5YgcSWrqhRRxogOsw7RzIpsmvOZ6IcH4kBYTpR3n0= +google.golang.org/grpc v1.38.0/go.mod h1:NREThFqKR1f3iQ6oBuvc5LadQuXVGo9rkm5ZGrQdJfM= 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= @@ -653,6 +777,8 @@ google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp0 google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= google.golang.org/protobuf v1.28.0 h1:w43yiav+6bVFTBQFZX0r7ipe9JQ1QsbMgHwbBziscLw= google.golang.org/protobuf v1.28.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= +google.golang.org/protobuf v1.28.1 h1:d0NfwRgPtno5B1Wa6L2DAG+KivqkdutMf1UhdNx175w= +google.golang.org/protobuf v1.28.1/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= gopkg.in/asn1-ber.v1 v1.0.0-20181015200546-f715ec2f112d/go.mod h1:cuepJuh7vyXfUyUwEgHQXw849cJrilpS5NeIjOWESAw= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= @@ -664,6 +790,7 @@ gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= gopkg.in/square/go-jose.v2 v2.3.1/go.mod h1:M9dMgbHiYLoDGQrXy7OpJDJWiKiU//h+vD76mk0e1AI= gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.2.3/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.5/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= @@ -673,6 +800,9 @@ gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b h1:h8qDotaEPuJATrMmW04NCwg7v22aHH28wwpauUhK9Oo= gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +gopkg.in/yaml.v3 v3.0.0/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= +gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190106161140-3f1c8253044a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190418001031-e561f6794a2a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= @@ -683,3 +813,4 @@ honnef.co/go/tools v0.0.1-2020.1.4/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9 rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8= rsc.io/quote/v3 v3.1.0/go.mod h1:yEA65RcK8LyAZtP9Kv3t0HmxON59tX3rD+tICJqUlj0= rsc.io/sampler v1.3.0/go.mod h1:T1hPZKmBbMNahiBKFy5HrXp6adAjACjK9JXDnKaTXpA= +sigs.k8s.io/yaml v1.2.0/go.mod h1:yfXDCHCao9+ENCvLSE62v9VSji2MKu5jeNfTrofGhJc= diff --git a/internal/api/api.go b/internal/api/api.go index 052ac1f3..f58b0b79 100644 --- a/internal/api/api.go +++ b/internal/api/api.go @@ -17,7 +17,7 @@ type API struct { Authenticators map[string]*authenticator.Authenticator DefaultVendor string Tracer trace.Tracer - Logger zap.Logger + Logger *zap.Logger } // MetricLogSkipper check if route is equal "metric" disable log. diff --git a/internal/cmd/serve/main.go b/internal/cmd/serve/main.go index 2ec0e3bc..a956b205 100644 --- a/internal/cmd/serve/main.go +++ b/internal/cmd/serve/main.go @@ -22,12 +22,18 @@ type Serve struct { } func (s Serve) main() { - rest := api.API{ + api := api.API{ DefaultVendor: s.Cfg.DefaultVendor, Authenticators: authenticator.Builder{Vendors: s.Cfg.Vendors, Logger: s.Logger}.Authenticators(), Tracer: s.Tracer, - Logger: *s.Logger.Named("api"), - }.ReSTServer() + Logger: s.Logger.Named("api"), + } + + if _, ok := api.Authenticators[s.Cfg.DefaultVendor]; !ok { + s.Logger.Fatal("default vendor shouldn't be nil, please set it") + } + + rest := api.ReSTServer() go func() { if err := rest.Listen(fmt.Sprintf(":%d", s.Cfg.HTTPPort)); err != nil && !errors.Is(err, http.ErrServerClosed) { From b8103cd1bf597589f66407dea694a98171a4fc08 Mon Sep 17 00:00:00 2001 From: Parham Alvani Date: Sun, 28 Aug 2022 14:42:06 +0430 Subject: [PATCH 314/660] fix: add testify package --- go.mod | 1 + go.sum | 2 ++ 2 files changed, 3 insertions(+) diff --git a/go.mod b/go.mod index 51a39fee..21629171 100644 --- a/go.mod +++ b/go.mod @@ -46,6 +46,7 @@ require ( github.com/prometheus/procfs v0.8.0 // indirect github.com/speps/go-hashids/v2 v2.0.1 // indirect github.com/spf13/pflag v1.0.5 // indirect + github.com/stretchr/objx v0.4.0 // indirect github.com/valyala/bytebufferpool v1.0.0 // indirect github.com/valyala/fasthttp v1.39.0 // indirect github.com/valyala/tcplisten v1.0.0 // indirect diff --git a/go.sum b/go.sum index 73c93547..b845fdb6 100644 --- a/go.sum +++ b/go.sum @@ -392,6 +392,7 @@ github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.1.1 h1:2vfRuCMp5sSVIDSqO8oNnWJq7mPa6KVP3iPIwFBuy8A= github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= +github.com/stretchr/objx v0.4.0 h1:M2gUjqZET1qApGOWNSnZ49BAIMX4F/1plDv3+l31EJ4= github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw= github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= @@ -400,6 +401,7 @@ github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5 github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.7.1 h1:5TQK59W5E3v0r2duFAb7P95B6hEeOyEnHRa8MjYSMTY= github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= +github.com/stretchr/testify v1.8.0 h1:pSgiaMZlXftHpm5L7V1+rVB+AZJydKsMxsQBIJw4PKk= github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= github.com/tidwall/pretty v1.2.0 h1:RWIZEg2iJ8/g6fDDYzMpobmaoGh5OLl4AXtGUGPcqCs= github.com/tidwall/pretty v1.2.0/go.mod h1:ITEVvHYasfjBbM0u2Pg8T2nJnzm8xPwvNhhsoaGGjNU= From 2f33f181cd8520fc8e3feb8094b9f6911a690f2f Mon Sep 17 00:00:00 2001 From: Parham Alvani Date: Sun, 28 Aug 2022 15:55:02 +0430 Subject: [PATCH 315/660] fix: remove duplicate fields --- internal/api/acl.go | 2 -- 1 file changed, 2 deletions(-) diff --git a/internal/api/acl.go b/internal/api/acl.go index b98acb3b..168f8273 100644 --- a/internal/api/acl.go +++ b/internal/api/acl.go @@ -72,7 +72,6 @@ func (a API) ACL(c *fiber.Ctx) error { zap.String("token", request.Token), zap.String("username", request.Username), zap.String("password", request.Password), - zap.String("authenticator", auth.Company), zap.String("authenticator", auth.Company)) } else { a.Logger. @@ -83,7 +82,6 @@ func (a API) ACL(c *fiber.Ctx) error { zap.String("token", request.Token), zap.String("username", request.Username), zap.String("password", request.Password), - zap.String("authenticator", auth.Company), zap.String("authenticator", auth.Company)) } From 8df85bd44480852dcbfcbe12d2d2aefae03b2002 Mon Sep 17 00:00:00 2001 From: Mehdi Teymorian Date: Sun, 28 Aug 2022 17:25:46 +0430 Subject: [PATCH 316/660] feat: add vendors config to ode values --- deployments/soteria/values.ode.yaml | 125 ++++++++++++++++++++++++++++ 1 file changed, 125 insertions(+) diff --git a/deployments/soteria/values.ode.yaml b/deployments/soteria/values.ode.yaml index 396d8d7e..e18ad8bc 100644 --- a/deployments/soteria/values.ode.yaml +++ b/deployments/soteria/values.ode.yaml @@ -11,3 +11,128 @@ image: repository: mozart/soteria tag: main pullPolicy: Always + +vendors: + snapp: + company: "snapp" + driver_salt: "secret" + passenger_salt: "secret" + driver_hash_length: 15 + passenger_hash_length: 15 + allowed_access_types: [ "pub", "sub" ] + topics: + - type: cab_event + template: ^{{IssToEntity .iss}}-event-{{HashID .hashType .sub (IssToSnappID .iss)}}$ + hash_type: 1 + accesses: + 0: '1' + 1: '1' + - type: driver_location + template: ^{{.company}}/driver/{{HashID .hashType .sub (IssToSnappID .iss)}}/location$ + hash_type: 0 + accesses: + 0: '2' + 1: '-1' + - type: passenger_location + template: ^{{.company}}/passenger/{{HashID .hashType .sub (IssToSnappID .iss)}}/location$ + hash_type: 0 + accesses: + 0: '2' + 1: '2' + - type: superapp_event + template: ^{{.company}}/{{IssToEntity .iss}}/{{HashID .hashType .sub (IssToSnappID .iss)}}/superapp$ + hash_type: 0 + accesses: + 0: '1' + 1: '1' + - type: box_event + template: ^bucks$ + hash_type: 0 + accesses: + 0: '-1' + 1: '-1' + - type: shared_location + template: ^{{.company}}/{{IssToEntity .iss}}/{{HashID .hashType .sub (IssToSnappID .iss)}}/{{IssToPeer .iss}}-location$ + hash_type: 0 + accesses: + 0: '1' + 1: '1' + - type: chat + template: ^{{.company}}/{{IssToEntity .iss}}/{{HashID .hashType .sub (IssToSnappID .iss)}}/chat$ + hash_type: 0 + accesses: + 0: '1' + 1: '1' + - type: general_call_entry + template: ^shared/{{.company}}/{{IssToEntity .iss}}/{{HashID .hashType .sub (IssToSnappID .iss)}}/call/send$ + hash_type: 0 + accesses: + 0: '2' + 1: '2' + - type: node_call_entry + template: ^{{.company}}/{{IssToEntity .iss}}/{{HashID .hashType .sub (IssToSnappID .iss)}}/call/[a-zA-Z0-9-_]+/send$ + hash_type: 0 + accesses: + 0: '2' + 1: '2' + - type: call_outgoing + template: ^{{.company}}/{{IssToEntity .iss}}/{{HashID .hashType .sub (IssToSnappID .iss)}}/call/receive$ + hash_type: 0 + accesses: + 0: '1' + 1: '1' + keys: + 1: |- + -----BEGIN PUBLIC KEY----- + MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA1lNRwyNsDieWs6LvHOJ+ + GyehhRC4Pn5yL5edKP3565F3LtRDMrkzwDRsQbqnUtTea9HCdTdBv+lI8vE17qRi + RQn10IMaIH6e4Aa3OWNClFhuqNOag7VmffsjTOgxHgHpfGAKVF/4BwqOHrdHFbAD + VOiWB1hv9Uc0C5laffGAub7fj+EAI02zlrsNDxYW8vyF2H47N7VWcvgd3RhZpxlG + 8bq9phl7Ja55YmQiT2Ic3/K5tsazg5z9lz6OTrx+JvWbefHFlJpjCLz5yefEaRmX + 9L/zyDMi4jgFTZEWNXC2vIrxwZMFwFhBXEp0PcCbuHJgJIucbRrbwukQC16uHJwP + zQIDAQAB + -----END PUBLIC KEY----- + 0: |- + -----BEGIN PUBLIC KEY----- + MIIBITANBgkqhkiG9w0BAQEFAAOCAQ4AMIIBCQKCAQBk7O6M5p4eYNAwtVU2beGa + W4mhFG94OtYUWDl1E7UUrhUNGf97Eb/45NjQszu0YPERnApJc2RUm2TrS7iq0mHz + Xbwf+CbNF54Q5mjuHcpBKgvFwUUSCCYBftmRc4xbFIH4Oh3nHC2GeukUS9TmJwjM + tJKyU0Ve8BK5BgjhagM7XSs+scE2mxemoWtcs6mJLtBuEgRGMgHW00mSdOcLp/+l + oHpSzRYN92/DomwmmjGVy8Ji0faeHx+r79ZzE0E8Rcc29Yhrg1ymrjfkXg98WjAb + TSv4UAN20lsBDejpnGEZKJrxHZ56gHgaJn6PKKCD6ItJA7y7iraCdBhCfAIUIz/z + AgMBAAE= + -----END PUBLIC KEY----- + iss_entity_map: + 0: "driver" + 1: "passenger" + default: "none" + iss_peer_map: + 0: "passenger" + 1: "driver" + default: "none" + jwt: + iss_name: "iss" + sub_name: "sub" + signing_method: "RS512" + snapp_pay: + company: "snapp_pay" + passenger_hash_length: "20" + passenger_salt: "UKjqkklfurigkvoslxp7vi0vcm66w" + allowed_access_types: ["pub", "sub"] + keys: + snpay: "eQsE0XOZWc99gc36Gc7bI750si8UIi" + iss_entity_map: + snpay: "passenger" + default: "none" + iss_peer_map: + default: "none" + jwt: + iss_name: "iss" + sub_name: "ud" + signing_method: "HS512" + topics: + - type: test + template: snapp_pay/passenger/{{HashID .hashType .sub (IssToSnappID .iss)}}/pay + hash_type: 0 + accesses: + snpay: '1' From 2ed6bf18e8f2f65358c0d43fc5d21fae3d3864b5 Mon Sep 17 00:00:00 2001 From: Mehdi Teymorian Date: Sun, 28 Aug 2022 17:30:49 +0430 Subject: [PATCH 317/660] feat: add cab event topic to snapp pay venture config --- deployments/soteria/values.ode.yaml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/deployments/soteria/values.ode.yaml b/deployments/soteria/values.ode.yaml index e18ad8bc..5c0a2840 100644 --- a/deployments/soteria/values.ode.yaml +++ b/deployments/soteria/values.ode.yaml @@ -136,3 +136,8 @@ vendors: hash_type: 0 accesses: snpay: '1' + - type: cab_event + template: ^{{IssToEntity .iss}}-event-{{HashID .hashType .sub (IssToSnappID .iss)}}$ + hash_type: 1 + accesses: + snpay: '1' From d9a7dd363c51cc33403d9c1260308d4835a28a87 Mon Sep 17 00:00:00 2001 From: Parham Alvani Date: Mon, 29 Aug 2022 09:33:40 +0430 Subject: [PATCH 318/660] feat: switch to url encoding to see what is going on --- internal/authenticator/key.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/authenticator/key.go b/internal/authenticator/key.go index 1224a230..4fcfbb1f 100644 --- a/internal/authenticator/key.go +++ b/internal/authenticator/key.go @@ -44,7 +44,7 @@ func (b Builder) GenerateHMacKeys(raw map[string]string) map[string]any { keys := make(map[string]any) for iss, key := range raw { - bytes, err := base64.StdEncoding.DecodeString(key) + bytes, err := base64.URLEncoding.DecodeString(key) if err != nil { log.Fatalf("failed to generate hmac key: %v", err) } From 08e1f1e32272af30be139fd91a9b219d6b2fbab4 Mon Sep 17 00:00:00 2001 From: Parham Alvani Date: Mon, 29 Aug 2022 10:28:46 +0430 Subject: [PATCH 319/660] feat: add fallback for non-base 64 keys --- internal/authenticator/key.go | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/internal/authenticator/key.go b/internal/authenticator/key.go index 4fcfbb1f..23f94079 100644 --- a/internal/authenticator/key.go +++ b/internal/authenticator/key.go @@ -2,7 +2,6 @@ package authenticator import ( "encoding/base64" - "log" "strings" "github.com/golang-jwt/jwt/v4" @@ -31,7 +30,7 @@ func (b Builder) GenerateRsaKeys(raw map[string]string) map[string]any { for iss, publicKey := range raw { rsaKey, err := jwt.ParseRSAPublicKeyFromPEM([]byte(publicKey)) if err != nil { - b.Logger.Fatal("could not read public key", zap.String("issuer", iss)) + b.Logger.Fatal("could not read public key", zap.String("issuer", iss), zap.Error(err)) } rsaKeys[iss] = rsaKey @@ -44,12 +43,14 @@ func (b Builder) GenerateHMacKeys(raw map[string]string) map[string]any { keys := make(map[string]any) for iss, key := range raw { - bytes, err := base64.URLEncoding.DecodeString(key) + bytes, err := base64.StdEncoding.DecodeString(key) if err != nil { - log.Fatalf("failed to generate hmac key: %v", err) - } + b.Logger.Error("failed to generate hmac key from base64 fallback to plain", zap.Error(err)) - keys[iss] = bytes + keys[iss] = key + } else { + keys[iss] = bytes + } } return keys From c0c9cd671f853324eafbf27e941dd257d4c0957a Mon Sep 17 00:00:00 2001 From: Mehdi Teymorian Date: Mon, 29 Aug 2022 10:48:01 +0430 Subject: [PATCH 320/660] fix: convert string key to byte array key for hmac --- internal/authenticator/key.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/authenticator/key.go b/internal/authenticator/key.go index 23f94079..5bf1985d 100644 --- a/internal/authenticator/key.go +++ b/internal/authenticator/key.go @@ -47,7 +47,7 @@ func (b Builder) GenerateHMacKeys(raw map[string]string) map[string]any { if err != nil { b.Logger.Error("failed to generate hmac key from base64 fallback to plain", zap.Error(err)) - keys[iss] = key + keys[iss] = []byte(key) } else { keys[iss] = bytes } From f21fca37c6a84f8fb2e223890288b4cf84ba00e3 Mon Sep 17 00:00:00 2001 From: Parham Alvani Date: Mon, 29 Aug 2022 22:03:55 +0430 Subject: [PATCH 321/660] revert: remove fall back to plain for hmac keys --- internal/authenticator/key.go | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/internal/authenticator/key.go b/internal/authenticator/key.go index 5bf1985d..4f2b6a78 100644 --- a/internal/authenticator/key.go +++ b/internal/authenticator/key.go @@ -45,12 +45,10 @@ func (b Builder) GenerateHMacKeys(raw map[string]string) map[string]any { for iss, key := range raw { bytes, err := base64.StdEncoding.DecodeString(key) if err != nil { - b.Logger.Error("failed to generate hmac key from base64 fallback to plain", zap.Error(err)) - - keys[iss] = []byte(key) - } else { - keys[iss] = bytes + b.Logger.Fatal("failed to generate hmac key from base64", zap.Error(err)) } + + keys[iss] = bytes } return keys From 0265931f11379d562c3b0d687d337b088c11c0a5 Mon Sep 17 00:00:00 2001 From: Mehdi Teymorian Date: Tue, 30 Aug 2022 08:17:34 +0430 Subject: [PATCH 322/660] feat: update ode jwt token --- deployments/soteria/values.ode.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/deployments/soteria/values.ode.yaml b/deployments/soteria/values.ode.yaml index 5c0a2840..451ee78d 100644 --- a/deployments/soteria/values.ode.yaml +++ b/deployments/soteria/values.ode.yaml @@ -120,7 +120,7 @@ vendors: passenger_salt: "UKjqkklfurigkvoslxp7vi0vcm66w" allowed_access_types: ["pub", "sub"] keys: - snpay: "eQsE0XOZWc99gc36Gc7bI750si8UIi" + snpay: "ZVFzRTBYT1pXYzk5Z2MzNkdjN2JJNzUwc2k4VUlp" iss_entity_map: snpay: "passenger" default: "none" From a2d87fcc518e0f0b92b8be484d900381658e3eac Mon Sep 17 00:00:00 2001 From: Parham Alvani Date: Tue, 30 Aug 2022 16:19:13 +0430 Subject: [PATCH 323/660] fix: use empty map for vendors --- deployments/soteria/values.yaml | 104 +------------------------------- 1 file changed, 1 insertion(+), 103 deletions(-) diff --git a/deployments/soteria/values.yaml b/deployments/soteria/values.yaml index 35ebbbcd..3bfdf44e 100644 --- a/deployments/soteria/values.yaml +++ b/deployments/soteria/values.yaml @@ -55,106 +55,4 @@ config: host: 127.0.0.1 port: 6831 -vendors: - snapp: - company: "snapp" - driver_salt: "secret" - passenger_salt: "secret" - driver_hash_length: 15 - passenger_hash_length: 15 - allowed_access_types: [ "pub", "sub" ] - topics: - - type: cab_event - template: ^{{IssToEntity .iss}}-event-{{HashID .hashType .sub (IssToSnappID .iss)}}$ - hash_type: 1 - accesses: - 0: '1' - 1: '1' - - type: driver_location - template: ^{{.company}}/driver/{{HashID .hashType .sub (IssToSnappID .iss)}}/location$ - hash_type: 0 - accesses: - 0: '2' - 1: '-1' - - type: passenger_location - template: ^{{.company}}/passenger/{{HashID .hashType .sub (IssToSnappID .iss)}}/location$ - hash_type: 0 - accesses: - 0: '2' - 1: '2' - - type: superapp_event - template: ^{{.company}}/{{IssToEntity .iss}}/{{HashID .hashType .sub (IssToSnappID .iss)}}/superapp$ - hash_type: 0 - accesses: - 0: '1' - 1: '1' - - type: box_event - template: ^bucks$ - hash_type: 0 - accesses: - 0: '-1' - 1: '-1' - - type: shared_location - template: ^{{.company}}/{{IssToEntity .iss}}/{{HashID .hashType .sub (IssToSnappID .iss)}}/{{IssToPeer .iss}}-location$ - hash_type: 0 - accesses: - 0: '1' - 1: '1' - - type: chat - template: ^{{.company}}/{{IssToEntity .iss}}/{{HashID .hashType .sub (IssToSnappID .iss)}}/chat$ - hash_type: 0 - accesses: - 0: '1' - 1: '1' - - type: general_call_entry - template: ^shared/{{.company}}/{{IssToEntity .iss}}/{{HashID .hashType .sub (IssToSnappID .iss)}}/call/send$ - hash_type: 0 - accesses: - 0: '2' - 1: '2' - - type: node_call_entry - template: ^{{.company}}/{{IssToEntity .iss}}/{{HashID .hashType .sub (IssToSnappID .iss)}}/call/[a-zA-Z0-9-_]+/send$ - hash_type: 0 - accesses: - 0: '2' - 1: '2' - - type: call_outgoing - template: ^{{.company}}/{{IssToEntity .iss}}/{{HashID .hashType .sub (IssToSnappID .iss)}}/call/receive$ - hash_type: 0 - accesses: - 0: '1' - 1: '1' - keys: - 1: |- - -----BEGIN PUBLIC KEY----- - MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA1lNRwyNsDieWs6LvHOJ+ - GyehhRC4Pn5yL5edKP3565F3LtRDMrkzwDRsQbqnUtTea9HCdTdBv+lI8vE17qRi - RQn10IMaIH6e4Aa3OWNClFhuqNOag7VmffsjTOgxHgHpfGAKVF/4BwqOHrdHFbAD - VOiWB1hv9Uc0C5laffGAub7fj+EAI02zlrsNDxYW8vyF2H47N7VWcvgd3RhZpxlG - 8bq9phl7Ja55YmQiT2Ic3/K5tsazg5z9lz6OTrx+JvWbefHFlJpjCLz5yefEaRmX - 9L/zyDMi4jgFTZEWNXC2vIrxwZMFwFhBXEp0PcCbuHJgJIucbRrbwukQC16uHJwP - zQIDAQAB - -----END PUBLIC KEY----- - 0: |- - -----BEGIN PUBLIC KEY----- - MIIBITANBgkqhkiG9w0BAQEFAAOCAQ4AMIIBCQKCAQBk7O6M5p4eYNAwtVU2beGa - W4mhFG94OtYUWDl1E7UUrhUNGf97Eb/45NjQszu0YPERnApJc2RUm2TrS7iq0mHz - Xbwf+CbNF54Q5mjuHcpBKgvFwUUSCCYBftmRc4xbFIH4Oh3nHC2GeukUS9TmJwjM - tJKyU0Ve8BK5BgjhagM7XSs+scE2mxemoWtcs6mJLtBuEgRGMgHW00mSdOcLp/+l - oHpSzRYN92/DomwmmjGVy8Ji0faeHx+r79ZzE0E8Rcc29Yhrg1ymrjfkXg98WjAb - TSv4UAN20lsBDejpnGEZKJrxHZ56gHgaJn6PKKCD6ItJA7y7iraCdBhCfAIUIz/z - AgMBAAE= - -----END PUBLIC KEY----- - iss_entity_map: - 0: "driver" - 1: "passenger" - default: "none" - iss_peer_map: - 0: "passenger" - 1: "driver" - default: "none" - jwt: - iss_name: "iss" - sub_name: "sub" - signing_method: "RS512" - +vendors: {} From 3716baeba0b8eea01915046e26cf5fa2f08b34b0 Mon Sep 17 00:00:00 2001 From: Parham Alvani Date: Wed, 31 Aug 2022 11:26:16 +0430 Subject: [PATCH 324/660] feat: reformat on readme --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index 4132cc17..96bc1687 100644 --- a/README.md +++ b/README.md @@ -24,9 +24,11 @@ We deploy `soteria` on `Cloud (okd)` infrastructures. for production deployments on Cloud (okd). # Add Vendor + Soteria is a multivendor authenticator for EMQX. Follow instruction from [here](docs/vendor.md) # Generate JWT Token + Replace `driver` and `0` for issuer and ID respectively. ```bash From fd3ca5f7f9ab74462b02b7bc4f317be00c497aba Mon Sep 17 00:00:00 2001 From: Parham Alvani Date: Thu, 1 Sep 2022 06:38:33 +0430 Subject: [PATCH 325/660] feat: add alphabets and remove snappids --- internal/authenticator/builder.go | 19 ++++++++++++++++++- internal/config/config.go | 25 ++++++++++++++----------- internal/config/default.go | 2 ++ internal/topics/manager.go | 31 +++++++++---------------------- 4 files changed, 43 insertions(+), 34 deletions(-) diff --git a/internal/authenticator/builder.go b/internal/authenticator/builder.go index c09558be..fd7c31f7 100644 --- a/internal/authenticator/builder.go +++ b/internal/authenticator/builder.go @@ -3,6 +3,7 @@ package authenticator import ( "fmt" + "github.com/speps/go-hashids/v2" "gitlab.snapp.ir/dispatching/snappids/v2" "gitlab.snapp.ir/dispatching/soteria/internal/config" "gitlab.snapp.ir/dispatching/soteria/internal/topics" @@ -22,9 +23,25 @@ func (b Builder) Authenticators() map[string]*Authenticator { b.ValidateMappers(vendor.IssEntityMap, vendor.IssPeerMap) keys := b.GenerateKeys(vendor.Jwt.SigningMethod, vendor.Keys) - hid := HIDManager(vendor.DriverSalt, vendor.DriverHashLength, vendor.PassengerSalt, vendor.PassengerHashLength) allowedAccessTypes := b.GetAllowedAccessTypes(vendor.AllowedAccessTypes) + hid := make(map[string]*hashids.HashID) + for iss, data := range vendor.HashIDMap { + var err error + + hd := hashids.NewData() + hd.Salt = data.Salt + hd.MinLength = data.Length + if data.Alphabet != "" { + hd.Alphabet = data.Alphabet + } + + hid[iss], err = hashids.NewWithData(hd) + if err != nil { + b.Logger.Fatal("cannot create hashid", zap.Error(err), zap.Any("configuration", data), zap.String("iss", iss)) + } + } + auth := &Authenticator{ Keys: keys, AllowedAccessTypes: allowedAccessTypes, diff --git a/internal/config/config.go b/internal/config/config.go index 04bb703f..c3bc69ed 100644 --- a/internal/config/config.go +++ b/internal/config/config.go @@ -32,17 +32,20 @@ type ( } Vendor struct { - AllowedAccessTypes []string `koanf:"allowed_access_types"` - PassengerHashLength int `koanf:"passenger_hash_length"` - DriverHashLength int `koanf:"driver_hash_length"` - PassengerSalt string `koanf:"passenger_salt"` - DriverSalt string `koanf:"driver_salt"` - Company string `koanf:"company"` - Topics []topics.Topic `koanf:"topics"` - Keys map[string]string `koanf:"keys"` - IssEntityMap map[string]string `koanf:"iss_entity_map"` - IssPeerMap map[string]string `koanf:"iss_peer_map"` - Jwt Jwt `koanf:"jwt"` + AllowedAccessTypes []string `koanf:"allowed_access_types"` + Company string `koanf:"company"` + Topics []topics.Topic `koanf:"topics"` + Keys map[string]string `koanf:"keys"` + IssEntityMap map[string]string `koanf:"iss_entity_map"` + IssPeerMap map[string]string `koanf:"iss_peer_map"` + Jwt Jwt `koanf:"jwt"` + HashIDMap map[string]HashID `koanf:"hashid_map"` + } + + HashID struct { + Length int `koanf:"length"` + Salt string `koanf:"salt"` + Alphabet string `koanf:"alphabet"` } Jwt struct { diff --git a/internal/config/default.go b/internal/config/default.go index d1a2b9b3..b7069e87 100644 --- a/internal/config/default.go +++ b/internal/config/default.go @@ -43,6 +43,8 @@ func SnappVendor() Vendor { "pub", "sub", }, + DriverAlphabet: "", + PassengerAlphabet: "", PassengerHashLength: DefaultPassengerHashLength, DriverHashLength: DefaultDriverHashLength, PassengerSalt: "secret", diff --git a/internal/topics/manager.go b/internal/topics/manager.go index b9f136d4..56f5fe57 100644 --- a/internal/topics/manager.go +++ b/internal/topics/manager.go @@ -11,7 +11,7 @@ import ( "strings" "text/template" - "gitlab.snapp.ir/dispatching/snappids/v2" + "github.com/speps/go-hashids/v2" ) const ( @@ -45,7 +45,7 @@ const ( ) type Manager struct { - HashIDSManager *snappids.HashIDSManager + HashIDSManager map[string]*hashids.HashID Company string TopicTemplates []Template IssEntityMap map[string]string @@ -56,7 +56,7 @@ type Manager struct { // NewTopicManager returns a topic manager to validate topics. func NewTopicManager( topicList []Topic, - hashIDManager *snappids.HashIDSManager, + hashIDManager map[string]*hashids.HashID, company string, issEntityMap, issPeerMap map[string]string, ) *Manager { @@ -68,10 +68,9 @@ func NewTopicManager( } manager.Functions = template.FuncMap{ - "IssToEntity": manager.IssEntityMapper, - "HashID": manager.getHashID, - "IssToSnappID": manager.IssToSnappID, - "IssToPeer": manager.IssPeerMapper, + "IssToEntity": manager.IssEntityMapper, + "HashID": manager.getHashID, + "IssToPeer": manager.IssPeerMapper, } templates := make([]Template, 0) @@ -119,14 +118,14 @@ func (t *Manager) ParseTopic(topic, iss, sub string) *Template { // getHashID calculate hashID based on hashType. // most of the topics have hashID type for their hashIDs but some old topics have different hashTypes. // if hashType is equal to hashID, sub is returned without any changes. -func (t *Manager) getHashID(hashType HashType, sub string, audience snappids.Audience) string { +func (t *Manager) getHashID(hashType HashType, sub string, iss string) string { if hashType == MD5 { - id, err := t.HashIDSManager.DecodeHashID(sub, audience) + id, err := t.HashIDSManager[iss].DecodeWithError(sub) if err != nil { return "" } - hid := md5.Sum([]byte(fmt.Sprintf("%s-%s", EmqCabHashPrefix, strconv.Itoa(id)))) //nolint:gosec + hid := md5.Sum([]byte(fmt.Sprintf("%s-%s", EmqCabHashPrefix, strconv.Itoa(id[0])))) //nolint:gosec return fmt.Sprintf("%x", hid) } @@ -151,15 +150,3 @@ func (t *Manager) IssPeerMapper(iss string) string { return t.IssPeerMap[Default] } - -// IssToSnappID returns corresponding audience in snappids form. -func (t *Manager) IssToSnappID(iss string) snappids.Audience { - switch iss { - case PassengerIss: - return snappids.PassengerAudience - case DriverIss: - return snappids.DriverAudience - default: - return -1 - } -} From f2b6ab35dfaa1bcaea5860d91a0574b7264d7253 Mon Sep 17 00:00:00 2001 From: Parham Alvani Date: Thu, 1 Sep 2022 06:45:09 +0430 Subject: [PATCH 326/660] feat: update default configuration with new alphabet support --- internal/config/default.go | 38 ++++++++++++++++++++++---------------- 1 file changed, 22 insertions(+), 16 deletions(-) diff --git a/internal/config/default.go b/internal/config/default.go index b7069e87..1acbb89e 100644 --- a/internal/config/default.go +++ b/internal/config/default.go @@ -43,17 +43,23 @@ func SnappVendor() Vendor { "pub", "sub", }, - DriverAlphabet: "", - PassengerAlphabet: "", - PassengerHashLength: DefaultPassengerHashLength, - DriverHashLength: DefaultDriverHashLength, - PassengerSalt: "secret", - DriverSalt: "secret", - Company: "snapp", + HashIDMap: map[string]HashID{ + "0": { + Alphabet: "", + Length: DefaultDriverHashLength, + Salt: "secret", + }, + "1": { + Alphabet: "", + Length: DefaultPassengerHashLength, + Salt: "secret", + }, + }, + Company: "snapp", Topics: []topics.Topic{ { Type: topics.CabEvent, - Template: "^{{IssToEntity .iss}}-event-{{HashID .hashType .sub (IssToSnappID .iss)}}$", + Template: "^{{IssToEntity .iss}}-event-{{HashID .hashType .sub .iss}}$", HashType: topics.MD5, Accesses: map[string]acl.AccessType{ topics.DriverIss: acl.Sub, @@ -62,7 +68,7 @@ func SnappVendor() Vendor { }, { Type: topics.DriverLocation, - Template: "^{{.company}}/driver/{{HashID .hashType .sub (IssToSnappID .iss)}}/location$", + Template: "^{{.company}}/driver/{{HashID .hashType .sub .iss}}/location$", HashType: topics.HashID, Accesses: map[string]acl.AccessType{ topics.DriverIss: acl.Pub, @@ -71,7 +77,7 @@ func SnappVendor() Vendor { }, { Type: topics.PassengerLocation, - Template: "^{{.company}}/passenger/{{HashID .hashType .sub (IssToSnappID .iss)}}/location$", + Template: "^{{.company}}/passenger/{{HashID .hashType .sub .iss}}/location$", HashType: topics.HashID, Accesses: map[string]acl.AccessType{ topics.DriverIss: acl.Pub, @@ -80,7 +86,7 @@ func SnappVendor() Vendor { }, { Type: topics.SuperappEvent, - Template: "^{{.company}}/{{IssToEntity .iss}}/{{HashID .hashType .sub (IssToSnappID .iss)}}/superapp$", + Template: "^{{.company}}/{{IssToEntity .iss}}/{{HashID .hashType .sub .iss}}/superapp$", HashType: topics.HashID, Accesses: map[string]acl.AccessType{ topics.DriverIss: acl.Sub, @@ -98,7 +104,7 @@ func SnappVendor() Vendor { }, { Type: topics.SharedLocation, - Template: "^{{.company}}/{{IssToEntity .iss}}/{{HashID .hashType .sub (IssToSnappID .iss)}}/{{IssToPeer .iss}}-location$", //nolint:lll + Template: "^{{.company}}/{{IssToEntity .iss}}/{{HashID .hashType .sub .iss}}/{{IssToPeer .iss}}-location$", //nolint:lll HashType: topics.HashID, Accesses: map[string]acl.AccessType{ topics.DriverIss: acl.Sub, @@ -107,7 +113,7 @@ func SnappVendor() Vendor { }, { Type: topics.Chat, - Template: "^{{.company}}/{{IssToEntity .iss}}/{{HashID .hashType .sub (IssToSnappID .iss)}}/chat$", + Template: "^{{.company}}/{{IssToEntity .iss}}/{{HashID .hashType .sub .iss}}/chat$", HashType: topics.HashID, Accesses: map[string]acl.AccessType{ topics.DriverIss: acl.Sub, @@ -116,7 +122,7 @@ func SnappVendor() Vendor { }, { Type: topics.GeneralCallEntry, - Template: "^shared/{{.company}}/{{IssToEntity .iss}}/{{HashID .hashType .sub (IssToSnappID .iss)}}/call/send$", + Template: "^shared/{{.company}}/{{IssToEntity .iss}}/{{HashID .hashType .sub .iss}}/call/send$", HashType: topics.HashID, Accesses: map[string]acl.AccessType{ topics.DriverIss: acl.Pub, @@ -125,7 +131,7 @@ func SnappVendor() Vendor { }, { Type: topics.NodeCallEntry, - Template: "^{{.company}}/{{IssToEntity .iss}}/{{HashID .hashType .sub (IssToSnappID .iss)}}/call/[a-zA-Z0-9-_]+/send$", //nolint: lll + Template: "^{{.company}}/{{IssToEntity .iss}}/{{HashID .hashType .sub .iss}}/call/[a-zA-Z0-9-_]+/send$", //nolint: lll HashType: topics.HashID, Accesses: map[string]acl.AccessType{ topics.DriverIss: acl.Pub, @@ -134,7 +140,7 @@ func SnappVendor() Vendor { }, { Type: topics.CallOutgoing, - Template: "^{{.company}}/{{IssToEntity .iss}}/{{HashID .hashType .sub (IssToSnappID .iss)}}/call/receive$", + Template: "^{{.company}}/{{IssToEntity .iss}}/{{HashID .hashType .sub .iss}}/call/receive$", HashType: topics.HashID, Accesses: map[string]acl.AccessType{ topics.DriverIss: acl.Sub, From 18ad67cdf788ada9b98a2922eacac0a81850d516 Mon Sep 17 00:00:00 2001 From: Parham Alvani Date: Thu, 1 Sep 2022 06:46:36 +0430 Subject: [PATCH 327/660] feat: remove snappids :dancer: --- internal/authenticator/builder.go | 21 ++------------------- 1 file changed, 2 insertions(+), 19 deletions(-) diff --git a/internal/authenticator/builder.go b/internal/authenticator/builder.go index fd7c31f7..e2d708c6 100644 --- a/internal/authenticator/builder.go +++ b/internal/authenticator/builder.go @@ -4,7 +4,6 @@ import ( "fmt" "github.com/speps/go-hashids/v2" - "gitlab.snapp.ir/dispatching/snappids/v2" "gitlab.snapp.ir/dispatching/soteria/internal/config" "gitlab.snapp.ir/dispatching/soteria/internal/topics" "gitlab.snapp.ir/dispatching/soteria/pkg/acl" @@ -26,12 +25,14 @@ func (b Builder) Authenticators() map[string]*Authenticator { allowedAccessTypes := b.GetAllowedAccessTypes(vendor.AllowedAccessTypes) hid := make(map[string]*hashids.HashID) + for iss, data := range vendor.HashIDMap { var err error hd := hashids.NewData() hd.Salt = data.Salt hd.MinLength = data.Length + if data.Alphabet != "" { hd.Alphabet = data.Alphabet } @@ -83,24 +84,6 @@ func (b Builder) GetAllowedAccessTypes(accessTypes []string) []acl.AccessType { return allowedAccessTypes } -func HIDManager( - driverSalt string, - driverHashLength int, - passengerSalt string, - passengerHashLength int, -) *snappids.HashIDSManager { - return &snappids.HashIDSManager{ - Salts: map[snappids.Audience]string{ - snappids.DriverAudience: driverSalt, - snappids.PassengerAudience: passengerSalt, - }, - Lengths: map[snappids.Audience]int{ - snappids.DriverAudience: driverHashLength, - snappids.PassengerAudience: passengerHashLength, - }, - } -} - // toUserAccessType will convert string access type to it's own type. // nolint: goerr113 func toUserAccessType(access string) (acl.AccessType, error) { From 6fc504b887b4bfa91f3949a5bedde7c7ebfd9343 Mon Sep 17 00:00:00 2001 From: Parham Alvani Date: Thu, 1 Sep 2022 07:02:34 +0430 Subject: [PATCH 328/660] feat: remove snappids :dancer: --- go.mod | 7 ++----- go.sum | 62 ++-------------------------------------------------------- 2 files changed, 4 insertions(+), 65 deletions(-) diff --git a/go.mod b/go.mod index 21629171..07d1354c 100644 --- a/go.mod +++ b/go.mod @@ -12,7 +12,6 @@ require ( github.com/spf13/cobra v1.5.0 github.com/stretchr/testify v1.8.0 github.com/tidwall/pretty v1.2.0 - gitlab.snapp.ir/dispatching/snappids/v2 v2.9.0 go.opentelemetry.io/otel v1.9.0 go.opentelemetry.io/otel/exporters/jaeger v1.9.0 go.opentelemetry.io/otel/sdk v1.9.0 @@ -22,6 +21,8 @@ require ( go.uber.org/zap v1.23.0 ) +require github.com/speps/go-hashids/v2 v2.0.1 + require ( github.com/andybalholm/brotli v1.0.4 // indirect github.com/beorn7/perks v1.0.1 // indirect @@ -32,7 +33,6 @@ require ( github.com/go-logr/logr v1.2.3 // indirect github.com/go-logr/stdr v1.2.2 // indirect github.com/gofiber/adaptor/v2 v2.1.25 // indirect - github.com/gofiber/utils v0.1.2 // indirect github.com/golang/protobuf v1.5.2 // indirect github.com/inconshreveable/mousetrap v1.0.1 // indirect github.com/klauspost/compress v1.15.9 // indirect @@ -44,15 +44,12 @@ require ( github.com/prometheus/client_model v0.2.0 // indirect github.com/prometheus/common v0.37.0 // indirect github.com/prometheus/procfs v0.8.0 // indirect - github.com/speps/go-hashids/v2 v2.0.1 // indirect github.com/spf13/pflag v1.0.5 // indirect - github.com/stretchr/objx v0.4.0 // indirect github.com/valyala/bytebufferpool v1.0.0 // indirect github.com/valyala/fasthttp v1.39.0 // indirect github.com/valyala/tcplisten v1.0.0 // indirect go.uber.org/multierr v1.8.0 // indirect golang.org/x/sys v0.0.0-20220825204002-c680a09ffe64 // indirect google.golang.org/protobuf v1.28.1 // indirect - gopkg.in/yaml.v2 v2.4.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect ) diff --git a/go.sum b/go.sum index b845fdb6..b1c96306 100644 --- a/go.sum +++ b/go.sum @@ -1,5 +1,3 @@ -bou.ke/monkey v1.0.2 h1:kWcnsrCNUatbxncxR/ThdYqbytgOIArtYWqcQLQzKLI= -bou.ke/monkey v1.0.2/go.mod h1:OqickVX3tNx6t33n1xvtTtu85YN5s6cKwVug+oHMaIA= cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= cloud.google.com/go v0.38.0/go.mod h1:990N+gfupTy94rShfmMCWGDn0LpTmnzTp2qbd1dvSRU= @@ -42,8 +40,6 @@ github.com/alecthomas/units v0.0.0-20190717042225-c3de453c63f4/go.mod h1:ybxpYRF github.com/alecthomas/units v0.0.0-20190924025748-f65c72e2690d/go.mod h1:rBZYJk541a8SKzHPHnH3zbiI+7dagKZ0cgpgrD7Fyho= github.com/andybalholm/brotli v1.0.4 h1:V7DdXeJtZscaqfNuAdSRuRFzuiKlHSC/Zh3zl9qY3JY= github.com/andybalholm/brotli v1.0.4/go.mod h1:fO7iG3H7G2nSZ7m0zPUDn85XEX2GTukHGRSepvi9Eig= -github.com/ansrivas/fiberprometheus/v2 v2.2.0 h1:9k459f75k5oaw0FmpTPizBry710vlhoBjzNaXW+/gls= -github.com/ansrivas/fiberprometheus/v2 v2.2.0/go.mod h1:uJNa1TvTLLwP1wzmg0vg+YPlsqXkQHX+557hfltg+iY= github.com/ansrivas/fiberprometheus/v2 v2.4.0 h1:oUCcrLFaoXgbWOqdg7GoKESO9aDwbkdGBHVtGEhraTo= github.com/ansrivas/fiberprometheus/v2 v2.4.0/go.mod h1:lArdP4S+TlsxQw1vgO8ZkteUVQ9fYyKgXVdycuu0L3g= github.com/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kdvxnR2qWY= @@ -81,7 +77,6 @@ github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGX github.com/cncf/udpa/go v0.0.0-20201120205902-5459f2c99403/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= github.com/coreos/go-semver v0.3.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk= github.com/coreos/go-systemd/v22 v22.3.2/go.mod h1:Y58oyj3AT4RCenI/lSvhwexgC+NSVTIJ3seZv2GcEnc= -github.com/cpuguy83/go-md2man/v2 v2.0.1/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= github.com/cpuguy83/go-md2man/v2 v2.0.2/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= @@ -121,30 +116,18 @@ github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= github.com/go-test/deep v1.0.2-0.20181118220953-042da051cf31/go.mod h1:wGDj63lr65AM2AQyKZd/NYHGb0R+1RLqB8NKt3aSFNA= github.com/godbus/dbus/v5 v5.0.4/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA= -github.com/gofiber/adaptor/v2 v2.1.19/go.mod h1:BI6lLkHBVNAVxm9hVPXfYoAKZJnsvAxBnPnhfipgBGQ= github.com/gofiber/adaptor/v2 v2.1.23/go.mod h1:hnYEQBPF2x1JaBHygutJJF5d0+J2eYnKKsUMCSsfxKk= -github.com/gofiber/adaptor/v2 v2.1.24 h1:EdQWVODtOTRAHZRuNMbmNrlvgY+4liPO/JOwKk/Dkm0= -github.com/gofiber/adaptor/v2 v2.1.24/go.mod h1:4g5V9/lhwLwgHHlQNEWXa3WUigzNjDXNmEN9BmQ2VME= github.com/gofiber/adaptor/v2 v2.1.25 h1:K2Ef2a7mUsCfL/oJdzbjyMXchGYuUUwIVXrYVm+P+xs= github.com/gofiber/adaptor/v2 v2.1.25/go.mod h1:gOxtwMVqUStB5goAYtKd+hSvGupdd+aRIafZHPLNaUk= -github.com/gofiber/contrib/fiberzap v0.0.0-20220524060257-8ccfafc37b12 h1:JYRErtl8SCkpb+Q6SqJCnv7yNj0YdIEgXdT7c2jk3Cs= -github.com/gofiber/contrib/fiberzap v0.0.0-20220524060257-8ccfafc37b12/go.mod h1:slKtSiIxJ2Fi5wX9iYZxUEay6OMXxYFfuBCqqXDqUaU= github.com/gofiber/contrib/fiberzap v0.0.0-20220822164234-32bc232b53bd h1:GOgvE+/XmCHmTV4s54l4Xons8jwbYkdluVy5Sng1sNU= github.com/gofiber/contrib/fiberzap v0.0.0-20220822164234-32bc232b53bd/go.mod h1:et6yk+/rccV7HhnGdJbU2spMOvfK+wXZUoaubUkL0nQ= -github.com/gofiber/fiber/v2 v2.28.0/go.mod h1:0bPXdTu+jRqINrEq1T6mHeVBnE0lQd67PGu35jD3hLk= -github.com/gofiber/fiber/v2 v2.29.0/go.mod h1:1Ega6O199a3Y7yDGuM9FyXDPYQfv+7/y48wl6WCwUF4= github.com/gofiber/fiber/v2 v2.32.0/go.mod h1:CMy5ZLiXkn6qwthrl03YMyW1NLfj0rhxz2LKl4t7ZTY= github.com/gofiber/fiber/v2 v2.33.0/go.mod h1:CMy5ZLiXkn6qwthrl03YMyW1NLfj0rhxz2LKl4t7ZTY= -github.com/gofiber/fiber/v2 v2.34.0 h1:96BJMw6uaxQhJsHY54SFGOtGgp9pgombK5Hbi4JSEQA= -github.com/gofiber/fiber/v2 v2.34.0/go.mod h1:ozRQfS+D7EL1+hMH+gutku0kfx1wLX4hAxDCtDzpj4U= github.com/gofiber/fiber/v2 v2.36.0 h1:1qLMe5rhXFLPa2SjK10Wz7WFgLwYi4TYg7XrjztJHqA= github.com/gofiber/fiber/v2 v2.36.0/go.mod h1:tgCr+lierLwLoVHHO/jn3Niannv34WRkQETU8wiL9fQ= -github.com/gofiber/utils v0.1.2 h1:1SH2YEz4RlNS0tJlMJ0bGwO0JkqPqvq6TbHK9tXZKtk= github.com/gofiber/utils v0.1.2/go.mod h1:pacRFtghAE3UoknMOUiXh2Io/nLWSUHtQCi/3QASsOc= github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q= -github.com/golang-jwt/jwt/v4 v4.4.1 h1:pC5DB52sCeK48Wlb9oPcdhnjkz1TKt1D/P7WKJ0kUcQ= -github.com/golang-jwt/jwt/v4 v4.4.1/go.mod h1:m21LjoU+eqJr34lmDMbreY2eSTRJ1cv77w39/MY0Ch0= github.com/golang-jwt/jwt/v4 v4.4.2 h1:rcc4lwaZgFMCZ5jxF9ABolDcIHdBytAFgqFPbSJQAYs= github.com/golang-jwt/jwt/v4 v4.4.2/go.mod h1:m21LjoU+eqJr34lmDMbreY2eSTRJ1cv77w39/MY0Ch0= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= @@ -188,8 +171,8 @@ github.com/google/go-cmp v0.5.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/ github.com/google/go-cmp v0.5.4/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.6/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.7 h1:81/ik6ipDQS2aGcBfIN5dHDB36BwrStyeAQquSYCV4o= github.com/google/go-cmp v0.5.7/go.mod h1:n+brtR0CgQNWTVd5ZUFpTBC8YFBDLK/h/bpaJ8/DtOE= +github.com/google/go-cmp v0.5.8 h1:e6P7q2lk1O+qJJb4BtCQXlK8vWEO8V1ZeuEdJNOqZyg= github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs= github.com/google/martian/v3 v3.0.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0= @@ -240,9 +223,9 @@ github.com/hashicorp/vault/api v1.0.4/go.mod h1:gDcqh3WGcR1cpF5AJz/B1UFheUEneMoI github.com/hashicorp/vault/sdk v0.1.13/go.mod h1:B+hVj7TpuQY1Y/GPbCpffmgd+tSEwvhkWnjtSYCaS2M= github.com/hashicorp/yamux v0.0.0-20180604194846-3520598351bb/go.mod h1:+NfK9FKeTrX5uv1uIXGdwYDTeHna2qgaIlx54MXqjAM= github.com/hashicorp/yamux v0.0.0-20181012175058-2f1d1f20f75d/go.mod h1:+NfK9FKeTrX5uv1uIXGdwYDTeHna2qgaIlx54MXqjAM= +github.com/hjson/hjson-go/v4 v4.0.0 h1:wlm6IYYqHjOdXH1gHev4VoXCaW20HdQAGCxdOEEg2cs= github.com/hjson/hjson-go/v4 v4.0.0/go.mod h1:KaYt3bTw3zhBjYqnXkYywcYctk0A2nxeEFTse3rH13E= github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= -github.com/inconshreveable/mousetrap v1.0.0 h1:Z8tu5sraLXCXIcARxBp/8cbvlwVa7Z1NHg9XEKhtSvM= github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8= github.com/inconshreveable/mousetrap v1.0.1 h1:U3uMjPSQEBMNp1lFxmllqCPM6P5u/Xq7Pgzkat/bFNc= github.com/inconshreveable/mousetrap v1.0.1/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw= @@ -261,14 +244,9 @@ github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7V github.com/julienschmidt/httprouter v1.3.0/go.mod h1:JR6WtHb+2LUe8TCKY3cZOxFyyO8IZAc4RVcycCCAKdM= github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8= github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= -github.com/klauspost/compress v1.14.1/go.mod h1:/3/Vjq9QcHkK5uEr5lBEmyoZ1iFhe47etQ6QUkpK6sk= github.com/klauspost/compress v1.15.0/go.mod h1:/3/Vjq9QcHkK5uEr5lBEmyoZ1iFhe47etQ6QUkpK6sk= -github.com/klauspost/compress v1.15.6 h1:6D9PcO8QWu0JyaQ2zUMmu16T1T+zjjEpP91guRsvDfY= -github.com/klauspost/compress v1.15.6/go.mod h1:PhcZ0MbTNciWF3rruxRgKxI5NkcHHrHUDtV4Yw2GlzU= github.com/klauspost/compress v1.15.9 h1:wKRjX6JRtDdrE9qwa4b/Cip7ACOshUI4smpCQanqjSY= github.com/klauspost/compress v1.15.9/go.mod h1:PhcZ0MbTNciWF3rruxRgKxI5NkcHHrHUDtV4Yw2GlzU= -github.com/knadh/koanf v1.4.1 h1:Z0VGW/uo8NJmjd+L1Dc3S5frq6c62w5xQ9Yf4Mg3wFQ= -github.com/knadh/koanf v1.4.1/go.mod h1:1cfH5223ZeZUOs8FU2UdTmaNfHpqgtjV0+NHjRO43gs= github.com/knadh/koanf v1.4.3 h1:rSJcSH5LSFhvzBRsAYfT3k7eLP0I4UxeZqjtAatk+wc= github.com/knadh/koanf v1.4.3/go.mod h1:5FAkuykKXZvLqhAbP4peWgM5CTcZmn7L1d27k/a+kfg= github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= @@ -306,7 +284,6 @@ github.com/mitchellh/go-testing-interface v1.0.0/go.mod h1:kRemZodwjscx+RGhAo8eI github.com/mitchellh/go-wordwrap v1.0.0/go.mod h1:ZXFpozHsX6DPmq2I0TCekCxypsnAUbP2oI0UX1GXzOo= github.com/mitchellh/mapstructure v0.0.0-20160808181253-ca63d7c062ee/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= -github.com/mitchellh/mapstructure v1.4.1/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= github.com/mitchellh/mapstructure v1.5.0 h1:jeMsZIYE/09sWLaz43PL7Gy6RuMjD2eJVyuac5Z2hdY= github.com/mitchellh/mapstructure v1.5.0/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= github.com/mitchellh/reflectwalk v1.0.0/go.mod h1:mSTlrgnPZtwu0c4WaC2kGObEpuNDbx0jmZXqmk4esnw= @@ -342,7 +319,6 @@ github.com/prometheus/client_golang v1.7.1/go.mod h1:PY5Wy2awLA44sXw4AOSfFBetzPP github.com/prometheus/client_golang v1.11.0/go.mod h1:Z6t4BnS23TR94PD6BsDNk8yVqroYurpAkEiz0P2BEV0= github.com/prometheus/client_golang v1.11.1/go.mod h1:Z6t4BnS23TR94PD6BsDNk8yVqroYurpAkEiz0P2BEV0= github.com/prometheus/client_golang v1.12.1/go.mod h1:3Z9XVyYiZYEO+YQWt3RD2R3jrbd179Rt297l4aS6nDY= -github.com/prometheus/client_golang v1.12.2 h1:51L9cDoUHVrXx4zWYlcLQIZ+d+VXHgqnYKkIuq4g/34= github.com/prometheus/client_golang v1.12.2/go.mod h1:3Z9XVyYiZYEO+YQWt3RD2R3jrbd179Rt297l4aS6nDY= github.com/prometheus/client_golang v1.13.0 h1:b71QUfeo5M8gq2+evJdTPfZhYMAU0uKPkyPJ7TPsloU= github.com/prometheus/client_golang v1.13.0/go.mod h1:vTeo+zgvILHsnnj/39Ou/1fPN5nJFOEMgftOUOmlvYQ= @@ -355,15 +331,12 @@ github.com/prometheus/common v0.4.1/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y8 github.com/prometheus/common v0.10.0/go.mod h1:Tlit/dnDKsSWFlCLTWaA1cyBgKHSMdTB80sz/V91rCo= github.com/prometheus/common v0.26.0/go.mod h1:M7rCNAaPfAosfx8veZJCuw84e35h3Cfd9VFqTh1DIvc= github.com/prometheus/common v0.32.1/go.mod h1:vu+V0TpY+O6vW9J44gczi3Ap/oXXR10b+M/gUGO4Hls= -github.com/prometheus/common v0.34.0 h1:RBmGO9d/FVjqHT0yUGQwBJhkwKV+wPCn7KGpvfab0uE= -github.com/prometheus/common v0.34.0/go.mod h1:gB3sOl7P0TvJabZpLY5uQMpUqRCPPCyRLCZYc7JZTNE= github.com/prometheus/common v0.37.0 h1:ccBbHCgIiT9uSoFY0vX8H3zsNR5eLt17/RQLUvn8pXE= github.com/prometheus/common v0.37.0/go.mod h1:phzohg0JFMnBEFGxTDbfu3QyL5GI8gTQJFhYO5B3mfA= github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= github.com/prometheus/procfs v0.1.3/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU= github.com/prometheus/procfs v0.6.0/go.mod h1:cz+aTbrPOrUb4q7XlbU9ygM+/jj0fzG6c1xBZuNvfVA= -github.com/prometheus/procfs v0.7.3 h1:4jVXhlkAyzOScmCkXBTOLRLTz8EeU+eyjrwB/EPq0VU= github.com/prometheus/procfs v0.7.3/go.mod h1:cz+aTbrPOrUb4q7XlbU9ygM+/jj0fzG6c1xBZuNvfVA= github.com/prometheus/procfs v0.8.0 h1:ODq8ZFEaYeCaZOJlZZdJA2AbQR98dSHSM1KW/You5mo= github.com/prometheus/procfs v0.8.0/go.mod h1:z7EfXMXOkbkqb9IINtpCn86r/to3BnA0uaxHdg830/4= @@ -383,14 +356,11 @@ github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6Mwd github.com/sirupsen/logrus v1.6.0/go.mod h1:7uNnSEd1DgxDLC74fIahvMZmmYsHGZGEOFrfsX/uA88= github.com/speps/go-hashids/v2 v2.0.1 h1:ViWOEqWES/pdOSq+C1SLVa8/Tnsd52XC34RY7lt7m4g= github.com/speps/go-hashids/v2 v2.0.1/go.mod h1:47LKunwvDZki/uRVD6NImtyk712yFzIs3UF3KlHohGw= -github.com/spf13/cobra v1.4.0 h1:y+wJpx64xcgO1V+RcnwW0LEHxTKRi2ZDPSBjWnrg88Q= -github.com/spf13/cobra v1.4.0/go.mod h1:Wo4iy3BUC+X2Fybo0PDqwJIv3dNRiZLHQymsfxlB84g= github.com/spf13/cobra v1.5.0 h1:X+jTBEBqF0bHN+9cSMgmfuvv2VHJ9ezmFNf9Y/XstYU= github.com/spf13/cobra v1.5.0/go.mod h1:dWXEIy2H428czQCjInthrTRUg7yKbok+2Qi/yBIJoUM= github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA= github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= -github.com/stretchr/objx v0.1.1 h1:2vfRuCMp5sSVIDSqO8oNnWJq7mPa6KVP3iPIwFBuy8A= github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.4.0 h1:M2gUjqZET1qApGOWNSnZ49BAIMX4F/1plDv3+l31EJ4= github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw= @@ -399,7 +369,6 @@ github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UV github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA= github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= -github.com/stretchr/testify v1.7.1 h1:5TQK59W5E3v0r2duFAb7P95B6hEeOyEnHRa8MjYSMTY= github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.8.0 h1:pSgiaMZlXftHpm5L7V1+rVB+AZJydKsMxsQBIJw4PKk= github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= @@ -407,11 +376,7 @@ github.com/tidwall/pretty v1.2.0 h1:RWIZEg2iJ8/g6fDDYzMpobmaoGh5OLl4AXtGUGPcqCs= github.com/tidwall/pretty v1.2.0/go.mod h1:ITEVvHYasfjBbM0u2Pg8T2nJnzm8xPwvNhhsoaGGjNU= github.com/valyala/bytebufferpool v1.0.0 h1:GqA5TC/0021Y/b9FG4Oi9Mr3q7XYx6KllzawFIhcdPw= github.com/valyala/bytebufferpool v1.0.0/go.mod h1:6bBcMArwyJ5K/AmCkWv1jt77kVWyCJ6HpOuEn7z0Csc= -github.com/valyala/fasthttp v1.33.0/go.mod h1:KJRK/MXx0J+yd0c5hlR+s1tIHD72sniU8ZJjl97LIw4= -github.com/valyala/fasthttp v1.34.0/go.mod h1:epZA5N+7pY6ZaEKRmstzOuYJx9HI8DI1oaCGZpdH4h0= github.com/valyala/fasthttp v1.35.0/go.mod h1:t/G+3rLek+CyY9bnIE+YlMRddxVAAGjhxndDB4i4C0I= -github.com/valyala/fasthttp v1.37.0 h1:7WHCyI7EAkQMVmrfBhWTCOaeROb1aCBiTopx63LkMbE= -github.com/valyala/fasthttp v1.37.0/go.mod h1:t/G+3rLek+CyY9bnIE+YlMRddxVAAGjhxndDB4i4C0I= github.com/valyala/fasthttp v1.38.0/go.mod h1:t/G+3rLek+CyY9bnIE+YlMRddxVAAGjhxndDB4i4C0I= github.com/valyala/fasthttp v1.39.0 h1:lW8mGeM7yydOqZKmwyMTaz/PH/A+CLgtmmcjv+OORfU= github.com/valyala/fasthttp v1.39.0/go.mod h1:t/G+3rLek+CyY9bnIE+YlMRddxVAAGjhxndDB4i4C0I= @@ -423,8 +388,6 @@ github.com/yuin/goldmark v1.1.32/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9de github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.3.5/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= github.com/yuin/goldmark v1.4.1/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= -gitlab.snapp.ir/dispatching/snappids/v2 v2.9.0 h1:nb3uqHasVp4CGvS8jJKP5c/dkff9XJfOToGwqctXoVo= -gitlab.snapp.ir/dispatching/snappids/v2 v2.9.0/go.mod h1:U7lxAuqPifdXkUNcCXhtk9+6HFAyw5qy8LrF1DQDMuQ= go.etcd.io/etcd/api/v3 v3.5.4/go.mod h1:5GB2vv4A4AOn3yk7MftYGHkUfGtDHnEraIjym4dYz5A= go.etcd.io/etcd/client/pkg/v3 v3.5.4/go.mod h1:IJHfcCEKxYu1Os13ZdwCwIUTUVGYTSAM3YSwc9/Ac1g= go.etcd.io/etcd/client/v3 v3.5.4/go.mod h1:ZaRkVgBZC+L+dLCjTcF1hRXpgZXQPOvnA/Ak/gq3kiY= @@ -433,24 +396,15 @@ go.opencensus.io v0.22.0/go.mod h1:+kGneAE2xo2IficOXnaByMWTGM9T73dGwxeWcUqIpI8= go.opencensus.io v0.22.2/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= go.opencensus.io v0.22.3/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= go.opencensus.io v0.22.4/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= -go.opentelemetry.io/otel v1.7.0 h1:Z2lA3Tdch0iDcrhJXDIlC94XE+bxok1F9B+4Lz/lGsM= -go.opentelemetry.io/otel v1.7.0/go.mod h1:5BdUoMIz5WEs0vt0CUEMtSSaTSHBBVwrhnz7+nrD5xk= go.opentelemetry.io/otel v1.9.0 h1:8WZNQFIB2a71LnANS9JeyidJKKGOOremcUtb/OtHISw= go.opentelemetry.io/otel v1.9.0/go.mod h1:np4EoPGzoPs3O67xUVNoPPcmSvsfOxNlNA4F4AC+0Eo= -go.opentelemetry.io/otel/exporters/jaeger v1.7.0 h1:wXgjiRldljksZkZrldGVe6XrG9u3kYDyQmkZwmm5dI0= -go.opentelemetry.io/otel/exporters/jaeger v1.7.0/go.mod h1:PwQAOqBgqbLQRKlj466DuD2qyMjbtcPpfPfj+AqbSBs= go.opentelemetry.io/otel/exporters/jaeger v1.9.0 h1:gAEgEVGDWwFjcis9jJTOJqZNxDzoZfR12WNIxr7g9Ww= go.opentelemetry.io/otel/exporters/jaeger v1.9.0/go.mod h1:hquezOLVAybNW6vanIxkdLXTXvzlj2Vn3wevSP15RYs= -go.opentelemetry.io/otel/sdk v1.7.0 h1:4OmStpcKVOfvDOgCt7UriAPtKolwIhxpnSNI/yK+1B0= -go.opentelemetry.io/otel/sdk v1.7.0/go.mod h1:uTEOTwaqIVuTGiJN7ii13Ibp75wJmYUDe374q6cZwUU= go.opentelemetry.io/otel/sdk v1.9.0 h1:LNXp1vrr83fNXTHgU8eO89mhzxb/bbWAsHG6fNf3qWo= go.opentelemetry.io/otel/sdk v1.9.0/go.mod h1:AEZc8nt5bd2F7BC24J5R0mrjYnpEgYHyTcM/vrSple4= -go.opentelemetry.io/otel/trace v1.7.0 h1:O37Iogk1lEkMRXewVtZ1BBTVn5JEp8GrJvP92bJqC6o= -go.opentelemetry.io/otel/trace v1.7.0/go.mod h1:fzLSB9nqR2eXzxPXb2JW9IKE+ScyXA48yyE4TNvoHqU= go.opentelemetry.io/otel/trace v1.9.0 h1:oZaCNJUjWcg60VXWee8lJKlqhPbXAPB51URuR47pQYc= go.opentelemetry.io/otel/trace v1.9.0/go.mod h1:2737Q0MuG8q1uILYm2YYVkAyLtOofiTNGg6VODnOiPo= go.uber.org/atomic v1.7.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc= -go.uber.org/atomic v1.9.0 h1:ECmE8Bn/WFTYwEW/bpKD3M8VtR/zQVbavAoalC1PYyE= go.uber.org/atomic v1.9.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc= go.uber.org/atomic v1.10.0 h1:9qC72Qh0+3MqyJbAn8YU5xVq1frD8bn3JtD2oXtafVQ= go.uber.org/atomic v1.10.0/go.mod h1:LUxbIzbOniOlMKjJjyPfpl4v+PKK2cNJn91OQbhoJI0= @@ -464,7 +418,6 @@ go.uber.org/multierr v1.7.0/go.mod h1:7EAYxJLBy9rStEaz58O2t4Uvip6FSURkq8/ppBp95a go.uber.org/multierr v1.8.0 h1:dg6GjLku4EH+249NNmoIciG9N/jURbDG+pFlTkhzIC8= go.uber.org/multierr v1.8.0/go.mod h1:7EAYxJLBy9rStEaz58O2t4Uvip6FSURkq8/ppBp95ak= go.uber.org/zap v1.17.0/go.mod h1:MXVU+bhUf/A7Xi2HNOnopQOrmycQ5Ih87HtOu4q5SSo= -go.uber.org/zap v1.21.0 h1:WefMeulhovoZ2sYXz7st6K0sLj7bBhpiFaud4r4zST8= go.uber.org/zap v1.21.0/go.mod h1:wjWOCqI0f2ZZrJF/UufIOkiC8ii6tm1iqIsLo76RfJw= go.uber.org/zap v1.23.0 h1:OjGQ5KQDEUawVHxNwQgPpiypGHOxo2mNZsOqTak4fFY= go.uber.org/zap v1.23.0/go.mod h1:D+nX8jyLsMHMYrln8A0rJjFt/T/9/bGgIhAqxv5URuY= @@ -475,7 +428,6 @@ golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8U golang.org/x/crypto v0.0.0-20190923035154-9ee001bba392/go.mod h1:/lpIB1dKB+9EgE3H3cr1v9wB50oz8l4C4h62xy7jSTY= golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/crypto v0.0.0-20220112180741-5e0467b6c7ce/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= golang.org/x/crypto v0.0.0-20220214200702-86341886e292/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= @@ -546,7 +498,6 @@ golang.org/x/net v0.0.0-20210410081132-afb366fc7cd1/go.mod h1:9tjilg8BloeKEkVJvy golang.org/x/net v0.0.0-20210525063256-abc453219eb5/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20211015210444-4f30a5c0130f/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= -golang.org/x/net v0.0.0-20220111093109-d55c255bac03/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20220127200216-cd36cc0744dd/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= golang.org/x/net v0.0.0-20220225172249-27dd8689420f/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= @@ -616,18 +567,14 @@ golang.org/x/sys v0.0.0-20210303074136-134d130e1a04/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20210330210617-4fbd30eecc44/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210403161142-5e06dd20ab57/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210423185535-09eb48e85fd7/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210603081109-ebe580a85c40/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20211019181941-9d821ace8654/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220111092808-5a964db01320/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220114195835-da31bd327af9/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220227234510-4e6760a101f9/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220412211240-33da011f77ad/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a h1:dGzPydgVsqGcTRVwiLJ1jVbufYwmzD3LfVPLKsKg+0k= -golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220825204002-c680a09ffe64 h1:UiNENfZ8gDvpiWw7IpOMQ27spWmThO1RwwdQVbJahJM= golang.org/x/sys v0.0.0-20220825204002-c680a09ffe64/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= @@ -693,7 +640,6 @@ golang.org/x/tools v0.1.8/go.mod h1:nABZi5QlRsZVlzPpHl034qft6wpY4eDcsTt5AaioBiU= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 h1:go1bK/D/BFZV2I8cIQd1NKEZ+0owSTG1fDTci4IqFcE= golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= google.golang.org/api v0.4.0/go.mod h1:8k5glujaEP+g9n7WNsDg8QP6cUVNI86fCNMcbazEtwE= google.golang.org/api v0.7.0/go.mod h1:WtwebWUNSVBH/HAw79HIFXZNqEvBhG+Ra+ax0hx3E3M= @@ -777,8 +723,6 @@ google.golang.org/protobuf v1.24.0/go.mod h1:r/3tXBNzIEhYS9I1OUVjXDlt8tc493IdKGj google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c= google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= -google.golang.org/protobuf v1.28.0 h1:w43yiav+6bVFTBQFZX0r7ipe9JQ1QsbMgHwbBziscLw= -google.golang.org/protobuf v1.28.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= google.golang.org/protobuf v1.28.1 h1:d0NfwRgPtno5B1Wa6L2DAG+KivqkdutMf1UhdNx175w= google.golang.org/protobuf v1.28.1/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= @@ -797,10 +741,8 @@ gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.5/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b h1:h8qDotaEPuJATrMmW04NCwg7v22aHH28wwpauUhK9Oo= gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.0/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= From d604baeed845a656db9ac3640743f2e0f6fa6b65 Mon Sep 17 00:00:00 2001 From: Parham Alvani Date: Thu, 1 Sep 2022 07:02:38 +0430 Subject: [PATCH 329/660] feat: remove snappids :dancer: --- internal/authenticator/authenticator_test.go | 30 +++++--------------- internal/authenticator/builder.go | 20 ++----------- internal/config/config.go | 22 ++++++-------- internal/config/default.go | 2 +- internal/topics/config.go | 7 +++++ internal/topics/manager.go | 23 +++++++++++++++ internal/topics/manager_test.go | 16 +++-------- 7 files changed, 53 insertions(+), 67 deletions(-) create mode 100644 internal/topics/config.go diff --git a/internal/authenticator/authenticator_test.go b/internal/authenticator/authenticator_test.go index 7c987e4a..f364e086 100644 --- a/internal/authenticator/authenticator_test.go +++ b/internal/authenticator/authenticator_test.go @@ -10,7 +10,6 @@ import ( "github.com/golang-jwt/jwt/v4" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/suite" - "gitlab.snapp.ir/dispatching/snappids/v2" "gitlab.snapp.ir/dispatching/soteria/internal/authenticator" "gitlab.snapp.ir/dispatching/soteria/internal/config" "gitlab.snapp.ir/dispatching/soteria/internal/topics" @@ -97,20 +96,11 @@ func (suite *AuthenticatorTestSuite) SetupSuite() { suite.PublicKeys.Passenger = pkey1 - hid := &snappids.HashIDSManager{ - Salts: map[snappids.Audience]string{ - snappids.PassengerAudience: "secret", - snappids.DriverAudience: "secret", - snappids.ThirdPartyAudience: "secret", - }, - Lengths: map[snappids.Audience]int{ - snappids.PassengerAudience: 15, - snappids.DriverAudience: 15, - snappids.ThirdPartyAudience: 15, - }, - } - cfg := config.SnappVendor() + + hid, err := topics.NewHashIDManager(cfg.HashIDMap) + require.NoError(err) + suite.Authenticator = authenticator.Authenticator{ Keys: map[string]any{ topics.DriverIss: pkey0, @@ -339,17 +329,11 @@ func (suite *AuthenticatorTestSuite) TestACL_Driver() { func TestAuthenticator_ValidateTopicBySender(t *testing.T) { t.Parallel() - hid := &snappids.HashIDSManager{ - Salts: map[snappids.Audience]string{ - snappids.DriverAudience: "secret", - }, - Lengths: map[snappids.Audience]int{ - snappids.DriverAudience: 15, - }, - } - cfg := config.SnappVendor() + hid, err := topics.NewHashIDManager(cfg.HashIDMap) + assert.NoError(t, err) + // nolint: exhaustruct authenticator := authenticator.Authenticator{ AllowedAccessTypes: []acl.AccessType{acl.Pub, acl.Sub}, diff --git a/internal/authenticator/builder.go b/internal/authenticator/builder.go index e2d708c6..ca7f0771 100644 --- a/internal/authenticator/builder.go +++ b/internal/authenticator/builder.go @@ -24,23 +24,9 @@ func (b Builder) Authenticators() map[string]*Authenticator { keys := b.GenerateKeys(vendor.Jwt.SigningMethod, vendor.Keys) allowedAccessTypes := b.GetAllowedAccessTypes(vendor.AllowedAccessTypes) - hid := make(map[string]*hashids.HashID) - - for iss, data := range vendor.HashIDMap { - var err error - - hd := hashids.NewData() - hd.Salt = data.Salt - hd.MinLength = data.Length - - if data.Alphabet != "" { - hd.Alphabet = data.Alphabet - } - - hid[iss], err = hashids.NewWithData(hd) - if err != nil { - b.Logger.Fatal("cannot create hashid", zap.Error(err), zap.Any("configuration", data), zap.String("iss", iss)) - } + hid, err := topics.NewHashIDManager(vendor.HashIDMap) + if err != nil { + b.Logger.Fatal("cannot create hash-id manager", zap.Error(err)) } auth := &Authenticator{ diff --git a/internal/config/config.go b/internal/config/config.go index c3bc69ed..c95e525f 100644 --- a/internal/config/config.go +++ b/internal/config/config.go @@ -32,20 +32,14 @@ type ( } Vendor struct { - AllowedAccessTypes []string `koanf:"allowed_access_types"` - Company string `koanf:"company"` - Topics []topics.Topic `koanf:"topics"` - Keys map[string]string `koanf:"keys"` - IssEntityMap map[string]string `koanf:"iss_entity_map"` - IssPeerMap map[string]string `koanf:"iss_peer_map"` - Jwt Jwt `koanf:"jwt"` - HashIDMap map[string]HashID `koanf:"hashid_map"` - } - - HashID struct { - Length int `koanf:"length"` - Salt string `koanf:"salt"` - Alphabet string `koanf:"alphabet"` + AllowedAccessTypes []string `koanf:"allowed_access_types"` + Company string `koanf:"company"` + Topics []topics.Topic `koanf:"topics"` + Keys map[string]string `koanf:"keys"` + IssEntityMap map[string]string `koanf:"iss_entity_map"` + IssPeerMap map[string]string `koanf:"iss_peer_map"` + Jwt Jwt `koanf:"jwt"` + HashIDMap map[string]topics.HashData `koanf:"hashid_map"` } Jwt struct { diff --git a/internal/config/default.go b/internal/config/default.go index 1acbb89e..bd6bc38c 100644 --- a/internal/config/default.go +++ b/internal/config/default.go @@ -43,7 +43,7 @@ func SnappVendor() Vendor { "pub", "sub", }, - HashIDMap: map[string]HashID{ + HashIDMap: map[string]topics.HashData{ "0": { Alphabet: "", Length: DefaultDriverHashLength, diff --git a/internal/topics/config.go b/internal/topics/config.go new file mode 100644 index 00000000..341e8901 --- /dev/null +++ b/internal/topics/config.go @@ -0,0 +1,7 @@ +package topics + +type HashData struct { + Length int `koanf:"length"` + Salt string `koanf:"salt"` + Alphabet string `koanf:"alphabet"` +} diff --git a/internal/topics/manager.go b/internal/topics/manager.go index 56f5fe57..16e7a225 100644 --- a/internal/topics/manager.go +++ b/internal/topics/manager.go @@ -150,3 +150,26 @@ func (t *Manager) IssPeerMapper(iss string) string { return t.IssPeerMap[Default] } + +func NewHashIDManager(hidmap map[string]HashData) (map[string]*hashids.HashID, error) { + hid := make(map[string]*hashids.HashID) + + for iss, data := range hidmap { + var err error + + hd := hashids.NewData() + hd.Salt = data.Salt + hd.MinLength = data.Length + + if data.Alphabet != "" { + hd.Alphabet = data.Alphabet + } + + hid[iss], err = hashids.NewWithData(hd) + if err != nil { + return nil, fmt.Errorf("cannot create hashid enc/dec %w", err) + } + } + + return hid, nil +} diff --git a/internal/topics/manager_test.go b/internal/topics/manager_test.go index 35cdbf44..04aa1e01 100644 --- a/internal/topics/manager_test.go +++ b/internal/topics/manager_test.go @@ -3,7 +3,6 @@ package topics_test import ( "testing" - "gitlab.snapp.ir/dispatching/snappids/v2" "gitlab.snapp.ir/dispatching/soteria/internal/config" "gitlab.snapp.ir/dispatching/soteria/internal/topics" ) @@ -130,18 +129,11 @@ func TestTopic_GetType(t *testing.T) { cfg := config.SnappVendor() - hid := &snappids.HashIDSManager{ - Salts: map[snappids.Audience]string{ - snappids.PassengerAudience: "secret", - snappids.DriverAudience: "secret", - snappids.ThirdPartyAudience: "secret", - }, - Lengths: map[snappids.Audience]int{ - snappids.PassengerAudience: 15, - snappids.DriverAudience: 15, - snappids.ThirdPartyAudience: 15, - }, + hid, err := topics.NewHashIDManager(cfg.HashIDMap) + if err != nil { + t.Errorf("invalid default hash-id: %s", err) } + // nolint: exhaustruct topicManager := topics.NewTopicManager(cfg.Topics, hid, "snapp", cfg.IssEntityMap, cfg.IssPeerMap) From f485f72c8462aa2569b8b695a9a5329d769e7075 Mon Sep 17 00:00:00 2001 From: Parham Alvani Date: Thu, 1 Sep 2022 07:06:48 +0430 Subject: [PATCH 330/660] feat; update ode configuration with new soteria --- deployments/soteria/values.ode.yaml | 35 +++++++++++++++++------------ 1 file changed, 21 insertions(+), 14 deletions(-) diff --git a/deployments/soteria/values.ode.yaml b/deployments/soteria/values.ode.yaml index 451ee78d..141dda79 100644 --- a/deployments/soteria/values.ode.yaml +++ b/deployments/soteria/values.ode.yaml @@ -15,20 +15,23 @@ image: vendors: snapp: company: "snapp" - driver_salt: "secret" - passenger_salt: "secret" - driver_hash_length: 15 - passenger_hash_length: 15 + hashid_map: + 0: + salt: "secret" + length: 15 + 1: + salt: "secret" + length: 15 allowed_access_types: [ "pub", "sub" ] topics: - type: cab_event - template: ^{{IssToEntity .iss}}-event-{{HashID .hashType .sub (IssToSnappID .iss)}}$ + template: ^{{IssToEntity .iss}}-event-{{HashID .hashType .sub .iss}}$ hash_type: 1 accesses: 0: '1' 1: '1' - type: driver_location - template: ^{{.company}}/driver/{{HashID .hashType .sub (IssToSnappID .iss)}}/location$ + template: ^{{.company}}/driver/{{HashID .hashType .sub .iss}}/location$ hash_type: 0 accesses: 0: '2' @@ -40,7 +43,7 @@ vendors: 0: '2' 1: '2' - type: superapp_event - template: ^{{.company}}/{{IssToEntity .iss}}/{{HashID .hashType .sub (IssToSnappID .iss)}}/superapp$ + template: ^{{.company}}/{{IssToEntity .iss}}/{{HashID .hashType .sub .iss}}/superapp$ hash_type: 0 accesses: 0: '1' @@ -52,31 +55,31 @@ vendors: 0: '-1' 1: '-1' - type: shared_location - template: ^{{.company}}/{{IssToEntity .iss}}/{{HashID .hashType .sub (IssToSnappID .iss)}}/{{IssToPeer .iss}}-location$ + template: ^{{.company}}/{{IssToEntity .iss}}/{{HashID .hashType .sub .iss}}/{{IssToPeer .iss}}-location$ hash_type: 0 accesses: 0: '1' 1: '1' - type: chat - template: ^{{.company}}/{{IssToEntity .iss}}/{{HashID .hashType .sub (IssToSnappID .iss)}}/chat$ + template: ^{{.company}}/{{IssToEntity .iss}}/{{HashID .hashType .sub .iss}}/chat$ hash_type: 0 accesses: 0: '1' 1: '1' - type: general_call_entry - template: ^shared/{{.company}}/{{IssToEntity .iss}}/{{HashID .hashType .sub (IssToSnappID .iss)}}/call/send$ + template: ^shared/{{.company}}/{{IssToEntity .iss}}/{{HashID .hashType .sub .iss}}/call/send$ hash_type: 0 accesses: 0: '2' 1: '2' - type: node_call_entry - template: ^{{.company}}/{{IssToEntity .iss}}/{{HashID .hashType .sub (IssToSnappID .iss)}}/call/[a-zA-Z0-9-_]+/send$ + template: ^{{.company}}/{{IssToEntity .iss}}/{{HashID .hashType .sub .iss}}/call/[a-zA-Z0-9-_]+/send$ hash_type: 0 accesses: 0: '2' 1: '2' - type: call_outgoing - template: ^{{.company}}/{{IssToEntity .iss}}/{{HashID .hashType .sub (IssToSnappID .iss)}}/call/receive$ + template: ^{{.company}}/{{IssToEntity .iss}}/{{HashID .hashType .sub .iss}}/call/receive$ hash_type: 0 accesses: 0: '1' @@ -114,10 +117,14 @@ vendors: iss_name: "iss" sub_name: "sub" signing_method: "RS512" + snapp_pay: company: "snapp_pay" - passenger_hash_length: "20" - passenger_salt: "UKjqkklfurigkvoslxp7vi0vcm66w" + hashid_map: + snpay: + length: "20" + salt: "UKjqkklfurigkvoslxp7vi0vcm66w" + alphabet: "abcdefghijklmnopqrstuvwxyz1234567890" allowed_access_types: ["pub", "sub"] keys: snpay: "ZVFzRTBYT1pXYzk5Z2MzNkdjN2JJNzUwc2k4VUlp" From 1e73bb77d770657ffa5346ec44c80b19e22e9178 Mon Sep 17 00:00:00 2001 From: Parham Alvani Date: Thu, 1 Sep 2022 07:10:08 +0430 Subject: [PATCH 331/660] fix: remove unused import --- internal/authenticator/builder.go | 1 - 1 file changed, 1 deletion(-) diff --git a/internal/authenticator/builder.go b/internal/authenticator/builder.go index ca7f0771..591779ac 100644 --- a/internal/authenticator/builder.go +++ b/internal/authenticator/builder.go @@ -3,7 +3,6 @@ package authenticator import ( "fmt" - "github.com/speps/go-hashids/v2" "gitlab.snapp.ir/dispatching/soteria/internal/config" "gitlab.snapp.ir/dispatching/soteria/internal/topics" "gitlab.snapp.ir/dispatching/soteria/pkg/acl" From 06c56d0598183984f4034c284c11c6f93b5db134 Mon Sep 17 00:00:00 2001 From: Parham Alvani Date: Thu, 1 Sep 2022 07:34:39 +0430 Subject: [PATCH 332/660] fix: correct configuration --- deployments/soteria/values.ode.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/deployments/soteria/values.ode.yaml b/deployments/soteria/values.ode.yaml index 141dda79..7314bb16 100644 --- a/deployments/soteria/values.ode.yaml +++ b/deployments/soteria/values.ode.yaml @@ -37,7 +37,7 @@ vendors: 0: '2' 1: '-1' - type: passenger_location - template: ^{{.company}}/passenger/{{HashID .hashType .sub (IssToSnappID .iss)}}/location$ + template: ^{{.company}}/passenger/{{HashID .hashType .sub .iss}}/location$ hash_type: 0 accesses: 0: '2' From 0bb9d4f295538beada8dd8cd8b94adc47719ea56 Mon Sep 17 00:00:00 2001 From: Parham Alvani Date: Thu, 1 Sep 2022 07:50:45 +0430 Subject: [PATCH 333/660] fix: correct configuration --- deployments/soteria/values.ode.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/deployments/soteria/values.ode.yaml b/deployments/soteria/values.ode.yaml index 7314bb16..2d72f50e 100644 --- a/deployments/soteria/values.ode.yaml +++ b/deployments/soteria/values.ode.yaml @@ -139,12 +139,12 @@ vendors: signing_method: "HS512" topics: - type: test - template: snapp_pay/passenger/{{HashID .hashType .sub (IssToSnappID .iss)}}/pay + template: snapp_pay/passenger/{{HashID .hashType .sub .iss}}/pay hash_type: 0 accesses: snpay: '1' - type: cab_event - template: ^{{IssToEntity .iss}}-event-{{HashID .hashType .sub (IssToSnappID .iss)}}$ + template: ^{{IssToEntity .iss}}-event-{{HashID .hashType .sub .iss}}$ hash_type: 1 accesses: snpay: '1' From cf18ed0656dd27a4a297f197848952a66ab0f37a Mon Sep 17 00:00:00 2001 From: Parham Alvani Date: Sat, 3 Sep 2022 10:40:22 +0430 Subject: [PATCH 334/660] fix: correct keys --- deployments/soteria/values.ode.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/deployments/soteria/values.ode.yaml b/deployments/soteria/values.ode.yaml index 2d72f50e..16a8abef 100644 --- a/deployments/soteria/values.ode.yaml +++ b/deployments/soteria/values.ode.yaml @@ -85,7 +85,7 @@ vendors: 0: '1' 1: '1' keys: - 1: |- + 0: |- -----BEGIN PUBLIC KEY----- MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA1lNRwyNsDieWs6LvHOJ+ GyehhRC4Pn5yL5edKP3565F3LtRDMrkzwDRsQbqnUtTea9HCdTdBv+lI8vE17qRi @@ -95,7 +95,7 @@ vendors: 9L/zyDMi4jgFTZEWNXC2vIrxwZMFwFhBXEp0PcCbuHJgJIucbRrbwukQC16uHJwP zQIDAQAB -----END PUBLIC KEY----- - 0: |- + 1: |- -----BEGIN PUBLIC KEY----- MIIBITANBgkqhkiG9w0BAQEFAAOCAQ4AMIIBCQKCAQBk7O6M5p4eYNAwtVU2beGa W4mhFG94OtYUWDl1E7UUrhUNGf97Eb/45NjQszu0YPERnApJc2RUm2TrS7iq0mHz @@ -135,7 +135,7 @@ vendors: default: "none" jwt: iss_name: "iss" - sub_name: "ud" + sub_name: "sud" signing_method: "HS512" topics: - type: test From ba91acd8d943bf03f4921dac5e60aa8aa24a3c81 Mon Sep 17 00:00:00 2001 From: Parham Alvani Date: Sat, 3 Sep 2022 10:54:49 +0430 Subject: [PATCH 335/660] fix: correct ode values --- deployments/soteria/values.ode.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/deployments/soteria/values.ode.yaml b/deployments/soteria/values.ode.yaml index 16a8abef..4ceeec2a 100644 --- a/deployments/soteria/values.ode.yaml +++ b/deployments/soteria/values.ode.yaml @@ -135,7 +135,7 @@ vendors: default: "none" jwt: iss_name: "iss" - sub_name: "sud" + sub_name: "ud" signing_method: "HS512" topics: - type: test From af3738855e0d2ca5c1a9871c3eae50f5660679f2 Mon Sep 17 00:00:00 2001 From: Parham Alvani Date: Sat, 3 Sep 2022 11:01:55 +0430 Subject: [PATCH 336/660] feat: add debug logs for topic template --- internal/topics/manager.go | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/internal/topics/manager.go b/internal/topics/manager.go index 16e7a225..61ea1d5d 100644 --- a/internal/topics/manager.go +++ b/internal/topics/manager.go @@ -12,6 +12,7 @@ import ( "text/template" "github.com/speps/go-hashids/v2" + "go.uber.org/zap" ) const ( @@ -51,6 +52,7 @@ type Manager struct { IssEntityMap map[string]string IssPeerMap map[string]string Functions template.FuncMap + Logger *zap.Logger } // NewTopicManager returns a topic manager to validate topics. @@ -59,12 +61,14 @@ func NewTopicManager( hashIDManager map[string]*hashids.HashID, company string, issEntityMap, issPeerMap map[string]string, + logger *zap.Logger, ) *Manager { manager := &Manager{ //nolint: exhaustruct HashIDSManager: hashIDManager, Company: company, IssEntityMap: issEntityMap, IssPeerMap: issPeerMap, + Logger: logger, } manager.Functions = template.FuncMap{ @@ -102,11 +106,17 @@ func (t *Manager) ParseTopic(topic, iss, sub string) *Template { regex := new(strings.Builder) - err := topicTemplate.Template.Execute(regex, fields) - if err != nil { + if err := topicTemplate.Template.Execute(regex, fields); err != nil { return nil } + t.Logger.Debug("topic template generated", + zap.String("topic", regex.String()), + zap.String("iss", iss), + zap.String("sub", sub), + zap.String("company", t.Company), + ) + if regexp.MustCompile(regex.String()).MatchString(topic) { return &topicTemplate } From 3a7ed5f24ba3cede15f12c7da2dff39a2efd6cc5 Mon Sep 17 00:00:00 2001 From: Parham Alvani Date: Sat, 3 Sep 2022 11:06:59 +0430 Subject: [PATCH 337/660] fix: pass logger into topic manager --- internal/authenticator/builder.go | 1 + 1 file changed, 1 insertion(+) diff --git a/internal/authenticator/builder.go b/internal/authenticator/builder.go index 591779ac..59333d01 100644 --- a/internal/authenticator/builder.go +++ b/internal/authenticator/builder.go @@ -38,6 +38,7 @@ func (b Builder) Authenticators() map[string]*Authenticator { vendor.Company, vendor.IssEntityMap, vendor.IssPeerMap, + b.Logger.Named("topic-manager"), ), JwtConfig: vendor.Jwt, } From 0a5139edb81d15941fd5dd141984dc0b9f1be80a Mon Sep 17 00:00:00 2001 From: Parham Alvani Date: Sat, 3 Sep 2022 11:14:03 +0430 Subject: [PATCH 338/660] fix: correct authenticator tests --- internal/authenticator/authenticator_test.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/internal/authenticator/authenticator_test.go b/internal/authenticator/authenticator_test.go index f364e086..f2b492ee 100644 --- a/internal/authenticator/authenticator_test.go +++ b/internal/authenticator/authenticator_test.go @@ -14,6 +14,7 @@ import ( "gitlab.snapp.ir/dispatching/soteria/internal/config" "gitlab.snapp.ir/dispatching/soteria/internal/topics" "gitlab.snapp.ir/dispatching/soteria/pkg/acl" + "go.uber.org/zap" ) const ( @@ -108,7 +109,7 @@ func (suite *AuthenticatorTestSuite) SetupSuite() { }, AllowedAccessTypes: []acl.AccessType{acl.Pub, acl.Sub, acl.PubSub}, Company: "snapp", - TopicManager: topics.NewTopicManager(cfg.Topics, hid, "snapp", cfg.IssEntityMap, cfg.IssPeerMap), + TopicManager: topics.NewTopicManager(cfg.Topics, hid, "snapp", cfg.IssEntityMap, cfg.IssPeerMap, zap.NewNop()), } } @@ -338,7 +339,7 @@ func TestAuthenticator_ValidateTopicBySender(t *testing.T) { authenticator := authenticator.Authenticator{ AllowedAccessTypes: []acl.AccessType{acl.Pub, acl.Sub}, Company: "snapp", - TopicManager: topics.NewTopicManager(cfg.Topics, hid, "snapp", cfg.IssEntityMap, cfg.IssPeerMap), + TopicManager: topics.NewTopicManager(cfg.Topics, hid, "snapp", cfg.IssEntityMap, cfg.IssPeerMap, zap.NewNop()), } t.Run("testing valid driver cab event", func(t *testing.T) { From d4118ce52b037f7764c2fde458026f973e467e36 Mon Sep 17 00:00:00 2001 From: Parham Alvani Date: Sat, 3 Sep 2022 11:19:29 +0430 Subject: [PATCH 339/660] fix: pass logger into topic manager --- internal/topics/manager_test.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/internal/topics/manager_test.go b/internal/topics/manager_test.go index 04aa1e01..53467094 100644 --- a/internal/topics/manager_test.go +++ b/internal/topics/manager_test.go @@ -5,6 +5,7 @@ import ( "gitlab.snapp.ir/dispatching/soteria/internal/config" "gitlab.snapp.ir/dispatching/soteria/internal/topics" + "go.uber.org/zap" ) // nolint: funlen @@ -135,7 +136,7 @@ func TestTopic_GetType(t *testing.T) { } // nolint: exhaustruct - topicManager := topics.NewTopicManager(cfg.Topics, hid, "snapp", cfg.IssEntityMap, cfg.IssPeerMap) + topicManager := topics.NewTopicManager(cfg.Topics, hid, "snapp", cfg.IssEntityMap, cfg.IssPeerMap, zap.NewNop()) sub := "DXKgaNQa7N5Y7bo" From 2ad042e7ba06a2eec8aa3ecb98edb2aee7d0d180 Mon Sep 17 00:00:00 2001 From: Parham Alvani Date: Sat, 3 Sep 2022 13:13:30 +0430 Subject: [PATCH 340/660] feat: add hash-id decode type --- internal/topics/manager.go | 12 ++++++++++-- internal/topics/topic.go | 3 ++- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/internal/topics/manager.go b/internal/topics/manager.go index 61ea1d5d..5c6e7a42 100644 --- a/internal/topics/manager.go +++ b/internal/topics/manager.go @@ -129,15 +129,23 @@ func (t *Manager) ParseTopic(topic, iss, sub string) *Template { // most of the topics have hashID type for their hashIDs but some old topics have different hashTypes. // if hashType is equal to hashID, sub is returned without any changes. func (t *Manager) getHashID(hashType HashType, sub string, iss string) string { - if hashType == MD5 { + switch hashType { + case MD5: id, err := t.HashIDSManager[iss].DecodeWithError(sub) if err != nil { return "" } - hid := md5.Sum([]byte(fmt.Sprintf("%s-%s", EmqCabHashPrefix, strconv.Itoa(id[0])))) //nolint:gosec + hid := md5.Sum([]byte(fmt.Sprintf("%s-%d", EmqCabHashPrefix, id[0]))) //nolint:gosec return fmt.Sprintf("%x", hid) + case HashID: + id, err := t.HashIDSManager[iss].DecodeWithError(sub) + if err != nil { + return "" + } + + return fmt.Sprintf("%d", id[0]) } return sub diff --git a/internal/topics/topic.go b/internal/topics/topic.go index c0665562..cd4db9af 100644 --- a/internal/topics/topic.go +++ b/internal/topics/topic.go @@ -11,8 +11,9 @@ import ( type HashType int const ( - HashID HashType = iota + None HashType = iota MD5 + HashID ) type Topic struct { From ab69846eee4ca601a6d4b4b6a3d397e4efebab30 Mon Sep 17 00:00:00 2001 From: Parham Alvani Date: Sat, 3 Sep 2022 13:19:14 +0430 Subject: [PATCH 341/660] fix: remove unused import --- internal/topics/manager.go | 1 - 1 file changed, 1 deletion(-) diff --git a/internal/topics/manager.go b/internal/topics/manager.go index 5c6e7a42..24955bc2 100644 --- a/internal/topics/manager.go +++ b/internal/topics/manager.go @@ -7,7 +7,6 @@ import ( "crypto/md5" //nolint: gosec "fmt" "regexp" - "strconv" "strings" "text/template" From 9629a7734ad62f3a29af5c86312f1c4f8bf21a36 Mon Sep 17 00:00:00 2001 From: Parham Alvani Date: Sat, 3 Sep 2022 13:24:23 +0430 Subject: [PATCH 342/660] fix: correct switch cases --- internal/topics/manager.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/internal/topics/manager.go b/internal/topics/manager.go index 24955bc2..c204ded3 100644 --- a/internal/topics/manager.go +++ b/internal/topics/manager.go @@ -145,9 +145,11 @@ func (t *Manager) getHashID(hashType HashType, sub string, iss string) string { } return fmt.Sprintf("%d", id[0]) + case None: + fallthrough + default: + return sub } - - return sub } func (t *Manager) IssEntityMapper(iss string) string { From a0f4f514f5ea76ee4814675cd2bbaf7b63fb070a Mon Sep 17 00:00:00 2001 From: Parham Alvani Date: Sat, 3 Sep 2022 13:26:52 +0430 Subject: [PATCH 343/660] fix: correct default values --- internal/config/default.go | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/internal/config/default.go b/internal/config/default.go index bd6bc38c..ecef259f 100644 --- a/internal/config/default.go +++ b/internal/config/default.go @@ -69,7 +69,7 @@ func SnappVendor() Vendor { { Type: topics.DriverLocation, Template: "^{{.company}}/driver/{{HashID .hashType .sub .iss}}/location$", - HashType: topics.HashID, + HashType: topics.None, Accesses: map[string]acl.AccessType{ topics.DriverIss: acl.Pub, topics.PassengerIss: acl.None, @@ -78,7 +78,7 @@ func SnappVendor() Vendor { { Type: topics.PassengerLocation, Template: "^{{.company}}/passenger/{{HashID .hashType .sub .iss}}/location$", - HashType: topics.HashID, + HashType: topics.None, Accesses: map[string]acl.AccessType{ topics.DriverIss: acl.Pub, topics.PassengerIss: acl.Pub, @@ -87,7 +87,7 @@ func SnappVendor() Vendor { { Type: topics.SuperappEvent, Template: "^{{.company}}/{{IssToEntity .iss}}/{{HashID .hashType .sub .iss}}/superapp$", - HashType: topics.HashID, + HashType: topics.None, Accesses: map[string]acl.AccessType{ topics.DriverIss: acl.Sub, topics.PassengerIss: acl.Sub, @@ -96,7 +96,7 @@ func SnappVendor() Vendor { { Type: topics.BoxEvent, Template: "^bucks$", - HashType: topics.HashID, + HashType: topics.None, Accesses: map[string]acl.AccessType{ topics.DriverIss: acl.None, topics.PassengerIss: acl.None, @@ -105,7 +105,7 @@ func SnappVendor() Vendor { { Type: topics.SharedLocation, Template: "^{{.company}}/{{IssToEntity .iss}}/{{HashID .hashType .sub .iss}}/{{IssToPeer .iss}}-location$", //nolint:lll - HashType: topics.HashID, + HashType: topics.None, Accesses: map[string]acl.AccessType{ topics.DriverIss: acl.Sub, topics.PassengerIss: acl.Sub, @@ -114,7 +114,7 @@ func SnappVendor() Vendor { { Type: topics.Chat, Template: "^{{.company}}/{{IssToEntity .iss}}/{{HashID .hashType .sub .iss}}/chat$", - HashType: topics.HashID, + HashType: topics.None, Accesses: map[string]acl.AccessType{ topics.DriverIss: acl.Sub, topics.PassengerIss: acl.Sub, @@ -123,7 +123,7 @@ func SnappVendor() Vendor { { Type: topics.GeneralCallEntry, Template: "^shared/{{.company}}/{{IssToEntity .iss}}/{{HashID .hashType .sub .iss}}/call/send$", - HashType: topics.HashID, + HashType: topics.None, Accesses: map[string]acl.AccessType{ topics.DriverIss: acl.Pub, topics.PassengerIss: acl.Pub, @@ -132,7 +132,7 @@ func SnappVendor() Vendor { { Type: topics.NodeCallEntry, Template: "^{{.company}}/{{IssToEntity .iss}}/{{HashID .hashType .sub .iss}}/call/[a-zA-Z0-9-_]+/send$", //nolint: lll - HashType: topics.HashID, + HashType: topics.None, Accesses: map[string]acl.AccessType{ topics.DriverIss: acl.Pub, topics.PassengerIss: acl.Pub, @@ -141,7 +141,7 @@ func SnappVendor() Vendor { { Type: topics.CallOutgoing, Template: "^{{.company}}/{{IssToEntity .iss}}/{{HashID .hashType .sub .iss}}/call/receive$", - HashType: topics.HashID, + HashType: topics.None, Accesses: map[string]acl.AccessType{ topics.DriverIss: acl.Sub, topics.PassengerIss: acl.Sub, From a7dcef01d9012e2c0e8b2fe003f496a4c51e8152 Mon Sep 17 00:00:00 2001 From: Parham Alvani Date: Sat, 3 Sep 2022 14:23:21 +0430 Subject: [PATCH 344/660] feat: add logs on errors --- internal/topics/manager.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/internal/topics/manager.go b/internal/topics/manager.go index c204ded3..90016f28 100644 --- a/internal/topics/manager.go +++ b/internal/topics/manager.go @@ -106,6 +106,8 @@ func (t *Manager) ParseTopic(topic, iss, sub string) *Template { regex := new(strings.Builder) if err := topicTemplate.Template.Execute(regex, fields); err != nil { + t.Logger.Error("template execution failed", zap.Error(err), zap.String("template", topicTemplate.Type)) + return nil } @@ -132,6 +134,8 @@ func (t *Manager) getHashID(hashType HashType, sub string, iss string) string { case MD5: id, err := t.HashIDSManager[iss].DecodeWithError(sub) if err != nil { + t.Logger.Error("decoding sub failed", zap.Error(err), zap.String("sub", sub)) + return "" } @@ -141,6 +145,8 @@ func (t *Manager) getHashID(hashType HashType, sub string, iss string) string { case HashID: id, err := t.HashIDSManager[iss].DecodeWithError(sub) if err != nil { + t.Logger.Error("decoding sub failed", zap.Error(err), zap.String("sub", sub)) + return "" } From 224b8d53eb5f0ed2fb67f8fd9ee2bc3a86e75d19 Mon Sep 17 00:00:00 2001 From: Parham Alvani Date: Sat, 3 Sep 2022 15:04:51 +0430 Subject: [PATCH 345/660] feat: update values for ode --- deployments/soteria/values.ode.yaml | 32 ++++++++++------------------- 1 file changed, 11 insertions(+), 21 deletions(-) diff --git a/deployments/soteria/values.ode.yaml b/deployments/soteria/values.ode.yaml index 4ceeec2a..28221fe1 100644 --- a/deployments/soteria/values.ode.yaml +++ b/deployments/soteria/values.ode.yaml @@ -25,26 +25,23 @@ vendors: allowed_access_types: [ "pub", "sub" ] topics: - type: cab_event - template: ^{{IssToEntity .iss}}-event-{{HashID .hashType .sub .iss}}$ - hash_type: 1 + template: ^{{IssToEntity .iss}}-event-{{ EncodeMD5 (DecodeHashID .sub .iss) }}$ accesses: 0: '1' 1: '1' - type: driver_location - template: ^{{.company}}/driver/{{HashID .hashType .sub .iss}}/location$ - hash_type: 0 + template: ^{{.company}}/driver/{{.sub}}/location$ accesses: 0: '2' 1: '-1' - type: passenger_location - template: ^{{.company}}/passenger/{{HashID .hashType .sub .iss}}/location$ + template: ^{{.company}}/passenger/{{.sub}}/location$ hash_type: 0 accesses: 0: '2' 1: '2' - type: superapp_event - template: ^{{.company}}/{{IssToEntity .iss}}/{{HashID .hashType .sub .iss}}/superapp$ - hash_type: 0 + template: ^{{.company}}/{{IssToEntity .iss}}/{{.sub}}/superapp$ accesses: 0: '1' 1: '1' @@ -55,32 +52,27 @@ vendors: 0: '-1' 1: '-1' - type: shared_location - template: ^{{.company}}/{{IssToEntity .iss}}/{{HashID .hashType .sub .iss}}/{{IssToPeer .iss}}-location$ - hash_type: 0 + template: ^{{.company}}/{{IssToEntity .iss}}/{{.sub}}/{{IssToPeer .iss}}-location$ accesses: 0: '1' 1: '1' - type: chat - template: ^{{.company}}/{{IssToEntity .iss}}/{{HashID .hashType .sub .iss}}/chat$ - hash_type: 0 + template: ^{{.company}}/{{IssToEntity .iss}}/{{.sub}}/chat$ accesses: 0: '1' 1: '1' - type: general_call_entry - template: ^shared/{{.company}}/{{IssToEntity .iss}}/{{HashID .hashType .sub .iss}}/call/send$ - hash_type: 0 + template: ^shared/{{.company}}/{{IssToEntity .iss}}/{{.sub}}/call/send$ accesses: 0: '2' 1: '2' - type: node_call_entry - template: ^{{.company}}/{{IssToEntity .iss}}/{{HashID .hashType .sub .iss}}/call/[a-zA-Z0-9-_]+/send$ - hash_type: 0 + template: ^{{.company}}/{{IssToEntity .iss}}/{{.sub}}/call/[a-zA-Z0-9-_]+/send$ accesses: 0: '2' 1: '2' - type: call_outgoing - template: ^{{.company}}/{{IssToEntity .iss}}/{{HashID .hashType .sub .iss}}/call/receive$ - hash_type: 0 + template: ^{{.company}}/{{IssToEntity .iss}}/{{.sub}}/call/receive$ accesses: 0: '1' 1: '1' @@ -139,12 +131,10 @@ vendors: signing_method: "HS512" topics: - type: test - template: snapp_pay/passenger/{{HashID .hashType .sub .iss}}/pay - hash_type: 0 + template: snapp_pay/passenger/{{.sub}}/pay accesses: snpay: '1' - type: cab_event - template: ^{{IssToEntity .iss}}-event-{{HashID .hashType .sub .iss}}$ - hash_type: 1 + template: ^{{IssToEntity .iss}}-event-{{ EncodeMD5 (DecodeHashID .sub .iss) }}$ accesses: snpay: '1' From b175307602ec7a783bf882fcb99a96de6faa8e3c Mon Sep 17 00:00:00 2001 From: Parham Alvani Date: Sat, 3 Sep 2022 15:05:06 +0430 Subject: [PATCH 346/660] feat: improve template functions --- internal/config/default.go | 28 ++++++++--------------- internal/topics/manager.go | 47 ++++++++++++-------------------------- internal/topics/topic.go | 11 --------- 3 files changed, 24 insertions(+), 62 deletions(-) diff --git a/internal/config/default.go b/internal/config/default.go index ecef259f..766ea753 100644 --- a/internal/config/default.go +++ b/internal/config/default.go @@ -59,8 +59,7 @@ func SnappVendor() Vendor { Topics: []topics.Topic{ { Type: topics.CabEvent, - Template: "^{{IssToEntity .iss}}-event-{{HashID .hashType .sub .iss}}$", - HashType: topics.MD5, + Template: "^{{IssToEntity .iss}}-event-{{ EncodeMD5 (DecodeHashID .sub .iss) }}$", Accesses: map[string]acl.AccessType{ topics.DriverIss: acl.Sub, topics.PassengerIss: acl.Sub, @@ -68,8 +67,7 @@ func SnappVendor() Vendor { }, { Type: topics.DriverLocation, - Template: "^{{.company}}/driver/{{HashID .hashType .sub .iss}}/location$", - HashType: topics.None, + Template: "^{{.company}}/driver/{{.sub}}/location$", Accesses: map[string]acl.AccessType{ topics.DriverIss: acl.Pub, topics.PassengerIss: acl.None, @@ -77,8 +75,7 @@ func SnappVendor() Vendor { }, { Type: topics.PassengerLocation, - Template: "^{{.company}}/passenger/{{HashID .hashType .sub .iss}}/location$", - HashType: topics.None, + Template: "^{{.company}}/passenger/{{.sub}}/location$", Accesses: map[string]acl.AccessType{ topics.DriverIss: acl.Pub, topics.PassengerIss: acl.Pub, @@ -86,8 +83,7 @@ func SnappVendor() Vendor { }, { Type: topics.SuperappEvent, - Template: "^{{.company}}/{{IssToEntity .iss}}/{{HashID .hashType .sub .iss}}/superapp$", - HashType: topics.None, + Template: "^{{.company}}/{{IssToEntity .iss}}/{{.sub}}/superapp$", Accesses: map[string]acl.AccessType{ topics.DriverIss: acl.Sub, topics.PassengerIss: acl.Sub, @@ -96,7 +92,6 @@ func SnappVendor() Vendor { { Type: topics.BoxEvent, Template: "^bucks$", - HashType: topics.None, Accesses: map[string]acl.AccessType{ topics.DriverIss: acl.None, topics.PassengerIss: acl.None, @@ -104,8 +99,7 @@ func SnappVendor() Vendor { }, { Type: topics.SharedLocation, - Template: "^{{.company}}/{{IssToEntity .iss}}/{{HashID .hashType .sub .iss}}/{{IssToPeer .iss}}-location$", //nolint:lll - HashType: topics.None, + Template: "^{{.company}}/{{IssToEntity .iss}}/{{.sub}}/{{IssToPeer .iss}}-location$", //nolint:lll Accesses: map[string]acl.AccessType{ topics.DriverIss: acl.Sub, topics.PassengerIss: acl.Sub, @@ -113,8 +107,7 @@ func SnappVendor() Vendor { }, { Type: topics.Chat, - Template: "^{{.company}}/{{IssToEntity .iss}}/{{HashID .hashType .sub .iss}}/chat$", - HashType: topics.None, + Template: "^{{.company}}/{{IssToEntity .iss}}/{{.sub}}/chat$", Accesses: map[string]acl.AccessType{ topics.DriverIss: acl.Sub, topics.PassengerIss: acl.Sub, @@ -122,8 +115,7 @@ func SnappVendor() Vendor { }, { Type: topics.GeneralCallEntry, - Template: "^shared/{{.company}}/{{IssToEntity .iss}}/{{HashID .hashType .sub .iss}}/call/send$", - HashType: topics.None, + Template: "^shared/{{.company}}/{{IssToEntity .iss}}/{{.sub}}/call/send$", Accesses: map[string]acl.AccessType{ topics.DriverIss: acl.Pub, topics.PassengerIss: acl.Pub, @@ -131,8 +123,7 @@ func SnappVendor() Vendor { }, { Type: topics.NodeCallEntry, - Template: "^{{.company}}/{{IssToEntity .iss}}/{{HashID .hashType .sub .iss}}/call/[a-zA-Z0-9-_]+/send$", //nolint: lll - HashType: topics.None, + Template: "^{{.company}}/{{IssToEntity .iss}}/{{.sub}}/call/[a-zA-Z0-9-_]+/send$", //nolint: lll Accesses: map[string]acl.AccessType{ topics.DriverIss: acl.Pub, topics.PassengerIss: acl.Pub, @@ -140,8 +131,7 @@ func SnappVendor() Vendor { }, { Type: topics.CallOutgoing, - Template: "^{{.company}}/{{IssToEntity .iss}}/{{HashID .hashType .sub .iss}}/call/receive$", - HashType: topics.None, + Template: "^{{.company}}/{{IssToEntity .iss}}/{{.sub}}/call/receive$", Accesses: map[string]acl.AccessType{ topics.DriverIss: acl.Sub, topics.PassengerIss: acl.Sub, diff --git a/internal/topics/manager.go b/internal/topics/manager.go index 90016f28..446e063a 100644 --- a/internal/topics/manager.go +++ b/internal/topics/manager.go @@ -71,9 +71,10 @@ func NewTopicManager( } manager.Functions = template.FuncMap{ - "IssToEntity": manager.IssEntityMapper, - "HashID": manager.getHashID, - "IssToPeer": manager.IssPeerMapper, + "IssToEntity": manager.IssEntityMapper, + "DecodeHashID": manager.DecodeHashID, + "EncodeMD5": manager.EncodeMD5, + "IssToPeer": manager.IssPeerMapper, } templates := make([]Template, 0) @@ -82,7 +83,6 @@ func NewTopicManager( each := Template{ Type: topic.Type, Template: template.Must(template.New(topic.Type).Funcs(manager.Functions).Parse(topic.Template)), - HashType: topic.HashType, Accesses: topic.Accesses, } templates = append(templates, each) @@ -101,8 +101,6 @@ func (t *Manager) ParseTopic(topic, iss, sub string) *Template { fields["sub"] = sub for _, topicTemplate := range t.TopicTemplates { - fields["hashType"] = topicTemplate.HashType - regex := new(strings.Builder) if err := topicTemplate.Template.Execute(regex, fields); err != nil { @@ -126,36 +124,21 @@ func (t *Manager) ParseTopic(topic, iss, sub string) *Template { return nil } -// getHashID calculate hashID based on hashType. -// most of the topics have hashID type for their hashIDs but some old topics have different hashTypes. -// if hashType is equal to hashID, sub is returned without any changes. -func (t *Manager) getHashID(hashType HashType, sub string, iss string) string { - switch hashType { - case MD5: - id, err := t.HashIDSManager[iss].DecodeWithError(sub) - if err != nil { - t.Logger.Error("decoding sub failed", zap.Error(err), zap.String("sub", sub)) - - return "" - } - - hid := md5.Sum([]byte(fmt.Sprintf("%s-%d", EmqCabHashPrefix, id[0]))) //nolint:gosec +func (t *Manager) EncodeMD5(iss string) string { + hid := md5.Sum([]byte(fmt.Sprintf("%s-%s", EmqCabHashPrefix, iss))) //nolint:gosec - return fmt.Sprintf("%x", hid) - case HashID: - id, err := t.HashIDSManager[iss].DecodeWithError(sub) - if err != nil { - t.Logger.Error("decoding sub failed", zap.Error(err), zap.String("sub", sub)) + return fmt.Sprintf("%x", hid) +} - return "" - } +func (t *Manager) DecodeHashID(sub, iss string) string { + id, err := t.HashIDSManager[iss].DecodeWithError(sub) + if err != nil { + t.Logger.Error("decoding sub failed", zap.Error(err), zap.String("sub", sub)) - return fmt.Sprintf("%d", id[0]) - case None: - fallthrough - default: - return sub + return "" } + + return fmt.Sprintf("%d", id[0]) } func (t *Manager) IssEntityMapper(iss string) string { diff --git a/internal/topics/topic.go b/internal/topics/topic.go index cd4db9af..03ea0480 100644 --- a/internal/topics/topic.go +++ b/internal/topics/topic.go @@ -7,26 +7,15 @@ import ( "gitlab.snapp.ir/dispatching/soteria/pkg/acl" ) -// HashType topic hashID type. -type HashType int - -const ( - None HashType = iota - MD5 - HashID -) - type Topic struct { Type string `koanf:"type"` Template string `koanf:"template"` - HashType HashType `koanf:"hash_type"` Accesses map[string]acl.AccessType `koanf:"accesses"` } type Template struct { Type string Template *template.Template - HashType HashType Accesses map[string]acl.AccessType } From 501af178a36e2cc879399a44ded3668d89349ff6 Mon Sep 17 00:00:00 2001 From: Parham Alvani Date: Sat, 3 Sep 2022 15:05:26 +0430 Subject: [PATCH 347/660] feat: change log level to debug --- deployments/soteria/values.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/deployments/soteria/values.yaml b/deployments/soteria/values.yaml index 3bfdf44e..1700b3d2 100644 --- a/deployments/soteria/values.yaml +++ b/deployments/soteria/values.yaml @@ -47,7 +47,7 @@ config: default_vendor: "snapp" http_port: 9999 logger: - level: "warn" + level: "debug" tracer: enabled: false ratio: 0.1 From 5e577805c4d0fdac833548bc9fce91e5d21a784c Mon Sep 17 00:00:00 2001 From: Parham Alvani Date: Sat, 22 Oct 2022 18:46:59 +0330 Subject: [PATCH 348/660] fix: correct driver/passenger token --- deployments/soteria/values.ode.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/deployments/soteria/values.ode.yaml b/deployments/soteria/values.ode.yaml index 28221fe1..8dcb12af 100644 --- a/deployments/soteria/values.ode.yaml +++ b/deployments/soteria/values.ode.yaml @@ -77,7 +77,7 @@ vendors: 0: '1' 1: '1' keys: - 0: |- + 1: |- -----BEGIN PUBLIC KEY----- MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA1lNRwyNsDieWs6LvHOJ+ GyehhRC4Pn5yL5edKP3565F3LtRDMrkzwDRsQbqnUtTea9HCdTdBv+lI8vE17qRi @@ -87,7 +87,7 @@ vendors: 9L/zyDMi4jgFTZEWNXC2vIrxwZMFwFhBXEp0PcCbuHJgJIucbRrbwukQC16uHJwP zQIDAQAB -----END PUBLIC KEY----- - 1: |- + 0: |- -----BEGIN PUBLIC KEY----- MIIBITANBgkqhkiG9w0BAQEFAAOCAQ4AMIIBCQKCAQBk7O6M5p4eYNAwtVU2beGa W4mhFG94OtYUWDl1E7UUrhUNGf97Eb/45NjQszu0YPERnApJc2RUm2TrS7iq0mHz From 9711d1633b5d93dd9dd69d6980cfdf61a1615b50 Mon Sep 17 00:00:00 2001 From: Parham Alvani Date: Fri, 4 Nov 2022 00:54:41 +0330 Subject: [PATCH 349/660] feat: update chart version --- deployments/soteria/Chart.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/deployments/soteria/Chart.yaml b/deployments/soteria/Chart.yaml index b25559d0..e6d21d8f 100644 --- a/deployments/soteria/Chart.yaml +++ b/deployments/soteria/Chart.yaml @@ -5,6 +5,6 @@ description: Soteria Helm Chart type: application -version: 6.6.9 +version: 7.0.0 -appVersion: "v6-6-9" +appVersion: "v7-0-0" From 84ee4a82db73e489865dacd8cf49830b0d2a442b Mon Sep 17 00:00:00 2001 From: Ahmad Mohammadi Date: Sun, 15 Jan 2023 00:38:31 +0330 Subject: [PATCH 350/660] feat: update chart version --- deployments/soteria/Chart.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/deployments/soteria/Chart.yaml b/deployments/soteria/Chart.yaml index e6d21d8f..b72b43e8 100644 --- a/deployments/soteria/Chart.yaml +++ b/deployments/soteria/Chart.yaml @@ -5,6 +5,6 @@ description: Soteria Helm Chart type: application -version: 7.0.0 +version: 7.0.1 -appVersion: "v7-0-0" +appVersion: "v7-0-1" From 0bba23833c4ceac961139e13f66c8e63e7942e50 Mon Sep 17 00:00:00 2001 From: Ahmad Mohammadi Date: Sun, 15 Jan 2023 00:52:48 +0330 Subject: [PATCH 351/660] feat: update baly registry address --- .gitlab/ci/templates/release.gitlab-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitlab/ci/templates/release.gitlab-ci.yml b/.gitlab/ci/templates/release.gitlab-ci.yml index d0b1f26a..679ff391 100644 --- a/.gitlab/ci/templates/release.gitlab-ci.yml +++ b/.gitlab/ci/templates/release.gitlab-ci.yml @@ -74,7 +74,7 @@ release:production:teh-2: release:production:baly: extends: .easy_ci:release:docker variables: - BALY_REGISTRY: "registry.cloud.baly.app" + BALY_REGISTRY: "registry.apps.internal.okd.eu-central-1.cloud.baly.app" RELEASE_CONTAINER_REGISTRY_ADDRESS: "$BALY_REGISTRY" RELEASE_CONTAINER_REGISTRY_IMAGE: "$BALY_REGISTRY/baly-dispatching/$CI_PROJECT_NAME" RELEASE_CONTAINER_REGISTRY_USERNAME: "gitlab-ci" From fb9c8e5692332a7829b1449baeec6612349b84d4 Mon Sep 17 00:00:00 2001 From: Ahmad Mohammadi Date: Sun, 15 Jan 2023 00:53:22 +0330 Subject: [PATCH 352/660] feat: update chart version --- deployments/soteria/Chart.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/deployments/soteria/Chart.yaml b/deployments/soteria/Chart.yaml index b72b43e8..d297d29b 100644 --- a/deployments/soteria/Chart.yaml +++ b/deployments/soteria/Chart.yaml @@ -5,6 +5,6 @@ description: Soteria Helm Chart type: application -version: 7.0.1 +version: 7.0.2 -appVersion: "v7-0-1" +appVersion: "v7-0-2" From 7eb47be7093bdd1c67b19f643ce0c0288b416c18 Mon Sep 17 00:00:00 2001 From: Mohammad Khoddamastanehhosein Date: Sat, 25 Feb 2023 10:25:15 +0330 Subject: [PATCH 353/660] Update README.md --- README.md | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/README.md b/README.md index 96bc1687..d4371792 100644 --- a/README.md +++ b/README.md @@ -2,6 +2,14 @@ Soteria is responsible for Authentication and Authorization of every request sent to EMQ. +# Description Details + +We are using the http_auth plugin of EMQ for forwarding these requests to Soteria. + +EMQX has caching mechanism but it sends requests almost for each Publish message to Soteria. + +(PS: On Subscribe we have only one message from client that need authorization and other messages are coming from server. + # Deployment ## Staging @@ -35,6 +43,10 @@ Replace `driver` and `0` for issuer and ID respectively. curl -s -u 'admin:admin' -L https://doago-snapp-ode-020.apps.private.teh-1.snappcloud.io/api/snapp/driver/0 | jq '.Token' -r ``` +# Architecure + + + # Folder Structure - `.api`: API documentation like swagger files From 7c33d51cdbb665854a44f7e4525dd2e5dffb0386 Mon Sep 17 00:00:00 2001 From: Mohammad Khoddam Date: Sat, 25 Feb 2023 10:31:22 +0330 Subject: [PATCH 354/660] fix: architecture was added to README --- README.md | 2 +- docs/arch.png | Bin 0 -> 23283 bytes 2 files changed, 1 insertion(+), 1 deletion(-) create mode 100644 docs/arch.png diff --git a/README.md b/README.md index d4371792..80ba5119 100644 --- a/README.md +++ b/README.md @@ -44,7 +44,7 @@ curl -s -u 'admin:admin' -L https://doago-snapp-ode-020.apps.private.teh-1.snapp ``` # Architecure - +![architectureOfSoteria](docs/arch.png) # Folder Structure diff --git a/docs/arch.png b/docs/arch.png new file mode 100644 index 0000000000000000000000000000000000000000..1a5250ef8f37b46a087f4b82fed7efcadfad089b GIT binary patch literal 23283 zcmeFZi93{S_&0t_sDz4CLuiqdrLrqqlCtk>Or^5#TLv>C6j@3r`;tAzzJ@j=+4ptG zKC&-^Vdi(;^^~69_xZl>KkzyZ$8p~?_gwe2oY%R0&d+&0Ra23t+lSZ(K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7-n0-m>&EjHi~F?pmYvdE{^OMW ztG|a#PEJe{yHfgAYVDu5pe_WifWPao?514k%dTbr_r6><`_Fs%x*rSoU$X&DcGjzR2Wt)K`XVdmshE>`7PF%ZkWhrme>BM%~XU!9q zxnA3T8aSEy`+p`cr0oxB>thWq)6k#Y%LMG6%}D<9ewTD?>|U?sFBg@*wJZP*;O=5% zX8U1%6<9Ohxm3NLN@?w*gw{@s3pw2EVcByh1{eO^6qJ$D{3+P*qEmfbB4x4-&9 z8F+Tv)wbveNY@3@RlyRjcHHwo3ptoQ Date: Sat, 25 Feb 2023 10:42:34 +0330 Subject: [PATCH 355/660] fix: add further info for Entity & Peer maps to vendor.md --- docs/vendor.md | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/docs/vendor.md b/docs/vendor.md index 7574fb26..9b57f737 100644 --- a/docs/vendor.md +++ b/docs/vendor.md @@ -42,6 +42,31 @@ These two configuration map iss to entity and peer respectively. **Note**: default case is `required` +```yaml + +iss_entity_map: + 0: "driver" + 1: "passenger" + default: "none" +iss_peer_map: + 0: "passenger" + 1: "driver" + default: "none" + +- type: driver_location + template: ^{{.company}}/driver/{{.sub}}/location$ + accesses: + 0: '2' + 1: '-1' +``` + +In the example above, we have two maps for entity & peer maps. As it's clear for **entity** structure **0** and **1** is mapped to **driver** and **passenger**, respectively. Vice Versa, for peer structure it can be seen that **1** and **0** is mapped to **driver** and **passenger**. We have also the **default** key for both two cases. + +In the topic example, we have an accesses section in which **0** is mapped to **2** and **1** is mapped to **-1** which can be interpreted as a map from **IssEntity's Keys** to **Access Types**. In the other words this structure means: + +* **Driver** has a **Pub** access on topic +* **Passenger** has a **None** access on topic (No Access) + ## JWT This is the jwt configuration. `iss_name` and `sub_name` are the name of issuer and subject in the jwt token's payload respectively. From caada3cc4de4e934cacaf9f34ed95cc960ed397b Mon Sep 17 00:00:00 2001 From: Parham Alvani Date: Sat, 25 Feb 2023 16:22:26 +0330 Subject: [PATCH 356/660] feat: update packages and go version --- .gitlab/ci/templates/compile.gitlab-ci.yml | 2 +- .gitlab/ci/templates/test.gitlab-ci.yml | 2 +- go.mod | 69 +++++++------ go.sum | 110 +++++++++++++++++++++ 4 files changed, 153 insertions(+), 30 deletions(-) diff --git a/.gitlab/ci/templates/compile.gitlab-ci.yml b/.gitlab/ci/templates/compile.gitlab-ci.yml index 5cb6ef77..6ca8a814 100644 --- a/.gitlab/ci/templates/compile.gitlab-ci.yml +++ b/.gitlab/ci/templates/compile.gitlab-ci.yml @@ -1,7 +1,7 @@ --- compile: stage: compile - image: registry.snapp.tech/docker/golang:1.18-alpine + image: registry.snapp.tech/docker/golang:1.20-alpine variables: GOOS: "linux" GOARCH: "amd64" diff --git a/.gitlab/ci/templates/test.gitlab-ci.yml b/.gitlab/ci/templates/test.gitlab-ci.yml index 40fec0ca..fcd976e0 100644 --- a/.gitlab/ci/templates/test.gitlab-ci.yml +++ b/.gitlab/ci/templates/test.gitlab-ci.yml @@ -6,7 +6,7 @@ handolint: extends: .easy-ci:dockerfile:lint test: - image: registry.snapp.tech/docker/golang:1.18-alpine + image: registry.snapp.tech/docker/golang:1.20-alpine stage: test coverage: '/total:\s*\(statements\)\s*([\d.]+)%/' before_script: diff --git a/go.mod b/go.mod index 07d1354c..e5a110d5 100644 --- a/go.mod +++ b/go.mod @@ -1,55 +1,68 @@ module gitlab.snapp.ir/dispatching/soteria -go 1.18 +go 1.20 require ( - github.com/ansrivas/fiberprometheus/v2 v2.4.0 - github.com/gofiber/contrib/fiberzap v0.0.0-20220822164234-32bc232b53bd - github.com/gofiber/fiber/v2 v2.36.0 - github.com/golang-jwt/jwt/v4 v4.4.2 - github.com/knadh/koanf v1.4.3 - github.com/prometheus/client_golang v1.13.0 // indirect - github.com/spf13/cobra v1.5.0 - github.com/stretchr/testify v1.8.0 - github.com/tidwall/pretty v1.2.0 - go.opentelemetry.io/otel v1.9.0 - go.opentelemetry.io/otel/exporters/jaeger v1.9.0 - go.opentelemetry.io/otel/sdk v1.9.0 - go.opentelemetry.io/otel/trace v1.9.0 + github.com/ansrivas/fiberprometheus/v2 v2.6.0 + github.com/gofiber/contrib/fiberzap v1.0.2 + github.com/gofiber/fiber/v2 v2.42.0 + github.com/golang-jwt/jwt/v4 v4.5.0 + github.com/knadh/koanf v1.5.0 + github.com/prometheus/client_golang v1.14.0 // indirect + github.com/spf13/cobra v1.6.1 + github.com/stretchr/testify v1.8.1 + github.com/tidwall/pretty v1.2.1 + go.opentelemetry.io/otel v1.13.0 + go.opentelemetry.io/otel/exporters/jaeger v1.13.0 + go.opentelemetry.io/otel/sdk v1.13.0 + go.opentelemetry.io/otel/trace v1.13.0 go.uber.org/atomic v1.10.0 // indirect go.uber.org/automaxprocs v1.5.1 - go.uber.org/zap v1.23.0 + go.uber.org/zap v1.24.0 ) require github.com/speps/go-hashids/v2 v2.0.1 require ( - github.com/andybalholm/brotli v1.0.4 // indirect + github.com/andybalholm/brotli v1.0.5 // indirect github.com/beorn7/perks v1.0.1 // indirect - github.com/cespare/xxhash/v2 v2.1.2 // indirect + github.com/cespare/xxhash/v2 v2.2.0 // indirect github.com/davecgh/go-spew v1.1.1 // indirect github.com/fatih/structs v1.1.0 // indirect - github.com/fsnotify/fsnotify v1.5.4 // indirect + github.com/fsnotify/fsnotify v1.6.0 // indirect github.com/go-logr/logr v1.2.3 // indirect github.com/go-logr/stdr v1.2.2 // indirect - github.com/gofiber/adaptor/v2 v2.1.25 // indirect + github.com/gofiber/adaptor/v2 v2.1.32 // indirect github.com/golang/protobuf v1.5.2 // indirect - github.com/inconshreveable/mousetrap v1.0.1 // indirect - github.com/klauspost/compress v1.15.9 // indirect - github.com/matttproud/golang_protobuf_extensions v1.0.1 // indirect + github.com/google/uuid v1.3.0 // indirect + github.com/inconshreveable/mousetrap v1.1.0 // indirect + github.com/json-iterator/go v1.1.12 // indirect + github.com/klauspost/compress v1.15.15 // indirect + github.com/mattn/go-colorable v0.1.13 // indirect + github.com/mattn/go-isatty v0.0.17 // indirect + github.com/mattn/go-runewidth v0.0.14 // indirect + github.com/matttproud/golang_protobuf_extensions v1.0.4 // indirect github.com/mitchellh/copystructure v1.2.0 // indirect github.com/mitchellh/mapstructure v1.5.0 // indirect github.com/mitchellh/reflectwalk v1.0.2 // indirect + github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect + github.com/modern-go/reflect2 v1.0.2 // indirect + github.com/philhofer/fwd v1.1.2 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect - github.com/prometheus/client_model v0.2.0 // indirect - github.com/prometheus/common v0.37.0 // indirect - github.com/prometheus/procfs v0.8.0 // indirect + github.com/prometheus/client_model v0.3.0 // indirect + github.com/prometheus/common v0.40.0 // indirect + github.com/prometheus/procfs v0.9.0 // indirect + github.com/rivo/uniseg v0.4.4 // indirect + github.com/savsgio/dictpool v0.0.0-20221023140959-7bf2e61cea94 // indirect + github.com/savsgio/gotils v0.0.0-20230208104028-c358bd845dee // indirect github.com/spf13/pflag v1.0.5 // indirect + github.com/stretchr/objx v0.5.0 // indirect + github.com/tinylib/msgp v1.1.8 // indirect github.com/valyala/bytebufferpool v1.0.0 // indirect - github.com/valyala/fasthttp v1.39.0 // indirect + github.com/valyala/fasthttp v1.44.0 // indirect github.com/valyala/tcplisten v1.0.0 // indirect - go.uber.org/multierr v1.8.0 // indirect - golang.org/x/sys v0.0.0-20220825204002-c680a09ffe64 // indirect + go.uber.org/multierr v1.9.0 // indirect + golang.org/x/sys v0.5.0 // indirect google.golang.org/protobuf v1.28.1 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect ) diff --git a/go.sum b/go.sum index b1c96306..bec54592 100644 --- a/go.sum +++ b/go.sum @@ -40,8 +40,12 @@ github.com/alecthomas/units v0.0.0-20190717042225-c3de453c63f4/go.mod h1:ybxpYRF github.com/alecthomas/units v0.0.0-20190924025748-f65c72e2690d/go.mod h1:rBZYJk541a8SKzHPHnH3zbiI+7dagKZ0cgpgrD7Fyho= github.com/andybalholm/brotli v1.0.4 h1:V7DdXeJtZscaqfNuAdSRuRFzuiKlHSC/Zh3zl9qY3JY= github.com/andybalholm/brotli v1.0.4/go.mod h1:fO7iG3H7G2nSZ7m0zPUDn85XEX2GTukHGRSepvi9Eig= +github.com/andybalholm/brotli v1.0.5 h1:8uQZIdzKmjc/iuPu7O2ioW48L81FgatrcpfFmiq/cCs= +github.com/andybalholm/brotli v1.0.5/go.mod h1:fO7iG3H7G2nSZ7m0zPUDn85XEX2GTukHGRSepvi9Eig= github.com/ansrivas/fiberprometheus/v2 v2.4.0 h1:oUCcrLFaoXgbWOqdg7GoKESO9aDwbkdGBHVtGEhraTo= github.com/ansrivas/fiberprometheus/v2 v2.4.0/go.mod h1:lArdP4S+TlsxQw1vgO8ZkteUVQ9fYyKgXVdycuu0L3g= +github.com/ansrivas/fiberprometheus/v2 v2.6.0 h1:QUaaKxil/N5IM1R19k6jsmFEJMfa4O3qtnDkiF+zxUc= +github.com/ansrivas/fiberprometheus/v2 v2.6.0/go.mod h1:hivZjKkqX04PPbMZNi9iGB0AQ90iN6RmKERiX1TdgTA= github.com/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kdvxnR2qWY= github.com/armon/circbuf v0.0.0-20150827004946-bbbad097214e/go.mod h1:3U/XgcO3hCbHZ8TKRvWD2dDTCfh9M9ya+I9JpbB7O8o= github.com/armon/go-metrics v0.0.0-20180917152333-f0300d1749da/go.mod h1:Q73ZrmVTwzkszR9V5SSuryQ31EELlFMUz1kKyl939pY= @@ -69,6 +73,8 @@ github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= github.com/cespare/xxhash/v2 v2.1.2 h1:YRXhKfTDauu4ajMg1TPgFO5jnlC2HCbmLXMcTG5cbYE= github.com/cespare/xxhash/v2 v2.1.2/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= +github.com/cespare/xxhash/v2 v2.2.0 h1:DC2CZ1Ep5Y4k3ZQ899DldepgrayRUGE6BBZ/cd9Cj44= +github.com/cespare/xxhash/v2 v2.2.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI= github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI= github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU= @@ -95,6 +101,8 @@ github.com/fatih/structs v1.1.0/go.mod h1:9NiDSp5zOcgEDl+j00MP/WkGVPOlPRLejGD8Ga github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ= github.com/fsnotify/fsnotify v1.5.4 h1:jRbGcIw6P2Meqdwuo0H1p6JVLbL5DHKAKlYndzMwVZI= github.com/fsnotify/fsnotify v1.5.4/go.mod h1:OVB6XrOHzAwXMpEM7uPOzcehqUV2UqJxmVXmkdnm1bU= +github.com/fsnotify/fsnotify v1.6.0 h1:n+5WquG0fcWoWp6xPWfHdbskMCQaFnG6PfBrh1Ky4HY= +github.com/fsnotify/fsnotify v1.6.0/go.mod h1:sl3t1tCWJFWoRz9R8WJCbQihKKwmorjAbSClcnxKAGw= github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU= github.com/go-gl/glfw/v3.3/glfw v0.0.0-20191125211704-12ad95a8df72/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= @@ -119,17 +127,27 @@ github.com/godbus/dbus/v5 v5.0.4/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5x github.com/gofiber/adaptor/v2 v2.1.23/go.mod h1:hnYEQBPF2x1JaBHygutJJF5d0+J2eYnKKsUMCSsfxKk= github.com/gofiber/adaptor/v2 v2.1.25 h1:K2Ef2a7mUsCfL/oJdzbjyMXchGYuUUwIVXrYVm+P+xs= github.com/gofiber/adaptor/v2 v2.1.25/go.mod h1:gOxtwMVqUStB5goAYtKd+hSvGupdd+aRIafZHPLNaUk= +github.com/gofiber/adaptor/v2 v2.1.31/go.mod h1:vdSG9JhOhOLYjE4j14fx6sJvLJNFVf9o6rSyB5GkU4s= +github.com/gofiber/adaptor/v2 v2.1.32 h1:94cL79U4ekq78TmqfXPrulMWkpfPxqzHimUc/B+jmkY= +github.com/gofiber/adaptor/v2 v2.1.32/go.mod h1:aX4qfSo+1AJYIWnLL1Mx3EQ6znC6WW46MqFQruUQE6c= github.com/gofiber/contrib/fiberzap v0.0.0-20220822164234-32bc232b53bd h1:GOgvE+/XmCHmTV4s54l4Xons8jwbYkdluVy5Sng1sNU= github.com/gofiber/contrib/fiberzap v0.0.0-20220822164234-32bc232b53bd/go.mod h1:et6yk+/rccV7HhnGdJbU2spMOvfK+wXZUoaubUkL0nQ= +github.com/gofiber/contrib/fiberzap v1.0.2 h1:EQwhggtszVfIdBeXxN9Xrmld71es34Ufs+ef8VMqZxc= +github.com/gofiber/contrib/fiberzap v1.0.2/go.mod h1:jGO8BHU4gRI9U0JtM6zj2CIhYfgVmW5JxziN8NTgVwE= github.com/gofiber/fiber/v2 v2.32.0/go.mod h1:CMy5ZLiXkn6qwthrl03YMyW1NLfj0rhxz2LKl4t7ZTY= github.com/gofiber/fiber/v2 v2.33.0/go.mod h1:CMy5ZLiXkn6qwthrl03YMyW1NLfj0rhxz2LKl4t7ZTY= github.com/gofiber/fiber/v2 v2.36.0 h1:1qLMe5rhXFLPa2SjK10Wz7WFgLwYi4TYg7XrjztJHqA= github.com/gofiber/fiber/v2 v2.36.0/go.mod h1:tgCr+lierLwLoVHHO/jn3Niannv34WRkQETU8wiL9fQ= +github.com/gofiber/fiber/v2 v2.41.0/go.mod h1:RdebcCuCRFp4W6hr3968/XxwJVg0K+jr9/Ae0PFzZ0Q= +github.com/gofiber/fiber/v2 v2.42.0 h1:Fnp7ybWvS+sjNQsFvkhf4G8OhXswvB6Vee8hM/LyS+8= +github.com/gofiber/fiber/v2 v2.42.0/go.mod h1:3+SGNjqMh5VQH5Vz2Wdi43zTIV16ktlFd3x3R6O1Zlc= github.com/gofiber/utils v0.1.2/go.mod h1:pacRFtghAE3UoknMOUiXh2Io/nLWSUHtQCi/3QASsOc= github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q= github.com/golang-jwt/jwt/v4 v4.4.2 h1:rcc4lwaZgFMCZ5jxF9ABolDcIHdBytAFgqFPbSJQAYs= github.com/golang-jwt/jwt/v4 v4.4.2/go.mod h1:m21LjoU+eqJr34lmDMbreY2eSTRJ1cv77w39/MY0Ch0= +github.com/golang-jwt/jwt/v4 v4.5.0 h1:7cYmW1XlMY7h7ii7UhUyChSgS5wUJEnm9uZVTGqOWzg= +github.com/golang-jwt/jwt/v4 v4.5.0/go.mod h1:m21LjoU+eqJr34lmDMbreY2eSTRJ1cv77w39/MY0Ch0= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/groupcache v0.0.0-20191227052852-215e87163ea7/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= @@ -173,6 +191,7 @@ github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/ github.com/google/go-cmp v0.5.6/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.7/go.mod h1:n+brtR0CgQNWTVd5ZUFpTBC8YFBDLK/h/bpaJ8/DtOE= github.com/google/go-cmp v0.5.8 h1:e6P7q2lk1O+qJJb4BtCQXlK8vWEO8V1ZeuEdJNOqZyg= +github.com/google/go-cmp v0.5.8/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs= github.com/google/martian/v3 v3.0.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0= @@ -185,6 +204,8 @@ github.com/google/pprof v0.0.0-20200430221834-fc25d7d30c6d/go.mod h1:ZgVRPoUq/hf github.com/google/pprof v0.0.0-20200708004538-1a94d8640e99/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/google/uuid v1.3.0 h1:t6JiXgmwXMjEs8VusXIJk2BXHsn+wx8BZdTaoZ5fu7I= +github.com/google/uuid v1.3.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg= github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk= github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0/go.mod h1:8NvIoxWQoOIhqOTXgfV/d3M/q6VIi02HzZEHgUlZvzk= @@ -229,6 +250,8 @@ github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1: github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8= github.com/inconshreveable/mousetrap v1.0.1 h1:U3uMjPSQEBMNp1lFxmllqCPM6P5u/Xq7Pgzkat/bFNc= github.com/inconshreveable/mousetrap v1.0.1/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw= +github.com/inconshreveable/mousetrap v1.1.0 h1:wN+x4NVGpMsO7ErUn/mUI3vEoE6Jt13X2s0bqwp9tc8= +github.com/inconshreveable/mousetrap v1.1.0/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw= github.com/jmespath/go-jmespath v0.4.0/go.mod h1:T8mJZnbsbmF+m6zOOFylbeCJqk5+pHWvzYPziyZiYoo= github.com/jmespath/go-jmespath/internal/testify v1.5.1/go.mod h1:L3OGu8Wl2/fWfCI6z80xFu9LTZmf1ZRjMHUOPmWr69U= github.com/joho/godotenv v1.3.0 h1:Zjp+RcGpHhGlrMbJzXTrZZPrWj+1vfm90La1wgB6Bhc= @@ -237,6 +260,7 @@ github.com/jpillora/backoff v1.0.0/go.mod h1:J/6gKK9jxlEcS3zixgDgUAsiuZ7yrSoa/FX github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= github.com/json-iterator/go v1.1.10/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= github.com/json-iterator/go v1.1.11/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= +github.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnrnM= github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo= github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU= github.com/jstemmer/go-junit-report v0.9.1/go.mod h1:Brl9GWCQeLvo8nXZwPNNblvFj/XSXhF0NWZEnDohbsk= @@ -247,30 +271,45 @@ github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+o github.com/klauspost/compress v1.15.0/go.mod h1:/3/Vjq9QcHkK5uEr5lBEmyoZ1iFhe47etQ6QUkpK6sk= github.com/klauspost/compress v1.15.9 h1:wKRjX6JRtDdrE9qwa4b/Cip7ACOshUI4smpCQanqjSY= github.com/klauspost/compress v1.15.9/go.mod h1:PhcZ0MbTNciWF3rruxRgKxI5NkcHHrHUDtV4Yw2GlzU= +github.com/klauspost/compress v1.15.15 h1:EF27CXIuDsYJ6mmvtBRlEuB2UVOqHG1tAXgZ7yIO+lw= +github.com/klauspost/compress v1.15.15/go.mod h1:ZcK2JAFqKOpnBlxcLsJzYfrS9X1akm9fHZNnD9+Vo/4= github.com/knadh/koanf v1.4.3 h1:rSJcSH5LSFhvzBRsAYfT3k7eLP0I4UxeZqjtAatk+wc= github.com/knadh/koanf v1.4.3/go.mod h1:5FAkuykKXZvLqhAbP4peWgM5CTcZmn7L1d27k/a+kfg= +github.com/knadh/koanf v1.5.0 h1:q2TSd/3Pyc/5yP9ldIrSdIz26MCcyNQzW0pEAugLPNs= +github.com/knadh/koanf v1.5.0/go.mod h1:Hgyjp4y8v44hpZtPzs7JZfRAW5AhN7KfZcwv1RYggDs= github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/konsorten/go-windows-terminal-sequences v1.0.3/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc= github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= +github.com/kr/pretty v0.2.0 h1:s5hAObm+yFO5uHYt5dYjxi2rXrsnmRpJx4OYvIWUaQs= github.com/kr/pretty v0.2.0/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= github.com/kr/pretty v0.3.0 h1:WgNl7dwNpEZ6jJ9k1snq4pZsg7DOEN8hP9Xw0Tsjwk0= github.com/kr/pretty v0.3.0/go.mod h1:640gp4NfQd8pI5XOwp5fnNeVWj67G7CFk/SaSQn7NBk= github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= +github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU= github.com/mattn/go-colorable v0.1.4/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE= github.com/mattn/go-colorable v0.1.6/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= +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.3/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= github.com/mattn/go-isatty v0.0.8/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s= github.com/mattn/go-isatty v0.0.10/go.mod h1:qgIWMr58cqv1PHHyhnkY9lrL7etaEgOFcMEpPG5Rm84= github.com/mattn/go-isatty v0.0.11/go.mod h1:PhnuNfih5lzO57/f3n+odYbM4JtupLOxQOAqxQCu2WE= github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU= +github.com/mattn/go-isatty v0.0.16/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM= +github.com/mattn/go-isatty v0.0.17 h1:BTarxUcIeDqL27Mc+vyvdWYSL28zpIhv3RoTdsLMPng= +github.com/mattn/go-isatty v0.0.17/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM= +github.com/mattn/go-runewidth v0.0.14 h1:+xnbZSEeDbOIg5/mE6JF0w6n9duR1l3/WmbinWVwUuU= +github.com/mattn/go-runewidth v0.0.14/go.mod h1:Jdepj2loyihRzMpdS35Xk/zdY8IAYHsh153qUoGf23w= github.com/matttproud/golang_protobuf_extensions v1.0.1 h1:4hp9jkHxhMHkqkrB3Ix0jegS5sx/RkqARlsWZ6pIwiU= github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= +github.com/matttproud/golang_protobuf_extensions v1.0.4 h1:mmDVorXM7PCGKw94cs5zkfA9PSy5pEvNWRP0ET0TIVo= +github.com/matttproud/golang_protobuf_extensions v1.0.4/go.mod h1:BSXmuO+STAnVfrANrmjBb36TMTDstsz7MSK+HVaYKv4= github.com/miekg/dns v1.1.26/go.mod h1:bPDLeHnStXmXAq1m/Ch/hvfNHr14JKNPMBo3VZKjuso= github.com/miekg/dns v1.1.41/go.mod h1:p6aan82bvRIyn+zDIv9xYNUpwa73JcSh9BKwknJysuI= github.com/mitchellh/cli v1.0.0/go.mod h1:hNIlj7HEI86fIcpObd7a0FcrxTWetlwJDGcceTlRvqc= @@ -290,9 +329,11 @@ github.com/mitchellh/reflectwalk v1.0.0/go.mod h1:mSTlrgnPZtwu0c4WaC2kGObEpuNDbx github.com/mitchellh/reflectwalk v1.0.2 h1:G2LzWKi524PWgd3mLHV8Y5k7s6XUvT0Gef6zxSIeXaQ= github.com/mitchellh/reflectwalk v1.0.2/go.mod h1:mSTlrgnPZtwu0c4WaC2kGObEpuNDbx0jmZXqmk4esnw= github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= +github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w8PVh93nsPXa1VrQ6jlwL5oN8l14QlcNfg= github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= +github.com/modern-go/reflect2 v1.0.2 h1:xBagoLtFs94CBntxluKeaWgTMpvLxC4ur3nMaC9Gz0M= github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk= github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= @@ -302,6 +343,9 @@ github.com/pascaldekloe/goe v0.0.0-20180627143212-57f6aae5913c/go.mod h1:lzWF7FI github.com/pascaldekloe/goe v0.1.0/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc= github.com/pelletier/go-toml v1.7.0 h1:7utD74fnzVc/cpcyy8sjrlFr5vYpypUixARcHIMIGuI= github.com/pelletier/go-toml v1.7.0/go.mod h1:vwGMzjaWMwyfHwgIBhI2YUM4fB6nL6lVAvS1LBMMhTE= +github.com/philhofer/fwd v1.1.1/go.mod h1:gk3iGcWd9+svBvR0sR+KPcfE+RNWozjowpeBVG3ZVNU= +github.com/philhofer/fwd v1.1.2 h1:bnDivRJ1EWPjUIRXV5KfORO897HTbpFAQddBdE8t7Gw= +github.com/philhofer/fwd v1.1.2/go.mod h1:qkPdfjR2SIEbspLqpe1tO4n5yICnr2DY7mqEx2tUTP0= github.com/pierrec/lz4 v2.0.5+incompatible/go.mod h1:pdkljMzZIN41W+lC3N2tnIh5sFi+IEE17M5jbnwPHcY= github.com/pkg/diff v0.0.0-20210226163009-20ebb0f2a09e/go.mod h1:pJLUxLENpZxwdsKMEsNbx1VGcRFpLqf3715MtcvvzbA= github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= @@ -322,17 +366,23 @@ github.com/prometheus/client_golang v1.12.1/go.mod h1:3Z9XVyYiZYEO+YQWt3RD2R3jrb github.com/prometheus/client_golang v1.12.2/go.mod h1:3Z9XVyYiZYEO+YQWt3RD2R3jrbd179Rt297l4aS6nDY= github.com/prometheus/client_golang v1.13.0 h1:b71QUfeo5M8gq2+evJdTPfZhYMAU0uKPkyPJ7TPsloU= github.com/prometheus/client_golang v1.13.0/go.mod h1:vTeo+zgvILHsnnj/39Ou/1fPN5nJFOEMgftOUOmlvYQ= +github.com/prometheus/client_golang v1.14.0 h1:nJdhIvne2eSX/XRAFV9PcvFFRbrjbcTUj0VP62TMhnw= +github.com/prometheus/client_golang v1.14.0/go.mod h1:8vpkKitgIVNcqrRBWh1C4TIUQgYNtG/XQE4E/Zae36Y= github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/client_model v0.2.0 h1:uq5h0d+GuxiXLJLNABMgp2qUWDPiLvgCzz2dUR+/W/M= github.com/prometheus/client_model v0.2.0/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= +github.com/prometheus/client_model v0.3.0 h1:UBgGFHqYdG/TPFD1B1ogZywDqEkwp3fBMvqdiQ7Xew4= +github.com/prometheus/client_model v0.3.0/go.mod h1:LDGWKZIo7rky3hgvBe+caln+Dr3dPggB5dvjtD7w9+w= github.com/prometheus/common v0.4.1/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= github.com/prometheus/common v0.10.0/go.mod h1:Tlit/dnDKsSWFlCLTWaA1cyBgKHSMdTB80sz/V91rCo= github.com/prometheus/common v0.26.0/go.mod h1:M7rCNAaPfAosfx8veZJCuw84e35h3Cfd9VFqTh1DIvc= github.com/prometheus/common v0.32.1/go.mod h1:vu+V0TpY+O6vW9J44gczi3Ap/oXXR10b+M/gUGO4Hls= github.com/prometheus/common v0.37.0 h1:ccBbHCgIiT9uSoFY0vX8H3zsNR5eLt17/RQLUvn8pXE= github.com/prometheus/common v0.37.0/go.mod h1:phzohg0JFMnBEFGxTDbfu3QyL5GI8gTQJFhYO5B3mfA= +github.com/prometheus/common v0.40.0 h1:Afz7EVRqGg2Mqqf4JuF9vdvp1pi220m55Pi9T2JnO4Q= +github.com/prometheus/common v0.40.0/go.mod h1:L65ZJPSmfn/UBWLQIHV7dBrKFidB/wPlF1y5TlSt9OE= github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= github.com/prometheus/procfs v0.1.3/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU= @@ -340,8 +390,14 @@ github.com/prometheus/procfs v0.6.0/go.mod h1:cz+aTbrPOrUb4q7XlbU9ygM+/jj0fzG6c1 github.com/prometheus/procfs v0.7.3/go.mod h1:cz+aTbrPOrUb4q7XlbU9ygM+/jj0fzG6c1xBZuNvfVA= github.com/prometheus/procfs v0.8.0 h1:ODq8ZFEaYeCaZOJlZZdJA2AbQR98dSHSM1KW/You5mo= github.com/prometheus/procfs v0.8.0/go.mod h1:z7EfXMXOkbkqb9IINtpCn86r/to3BnA0uaxHdg830/4= +github.com/prometheus/procfs v0.9.0 h1:wzCHvIvM5SxWqYvwgVL7yJY8Lz3PKn49KQtpgMYJfhI= +github.com/prometheus/procfs v0.9.0/go.mod h1:+pB4zwohETzFnmlpe6yd2lSc+0/46IYZRB/chUwxUZY= github.com/rhnvrm/simples3 v0.6.1/go.mod h1:Y+3vYm2V7Y4VijFoJHHTrja6OgPrJ2cBti8dPGkC3sA= +github.com/rivo/uniseg v0.2.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc= +github.com/rivo/uniseg v0.4.4 h1:8TfxU8dW6PdqD27gjM8MVNuicgxIjxpm4K7x4jp8sis= +github.com/rivo/uniseg v0.4.4/go.mod h1:FN3SvrM+Zdj16jyLfmOkMNblXMcoc8DfTHruCPUcx88= github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6LYCDYWNEvQ= +github.com/rogpeppe/go-internal v1.3.0 h1:RR9dF3JtopPvtkroDZuVD7qquD0bnHlKSqaQhgwt8yk= github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= github.com/rogpeppe/go-internal v1.6.1/go.mod h1:xXDCJY+GAPziupqXw64V24skbSoqbTEfhy4qGm1nDQc= github.com/rogpeppe/go-internal v1.8.1 h1:geMPLpDpQOgVyCg5z5GoRwLHepNdb71NXb67XFkP+Eg= @@ -350,6 +406,11 @@ github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQD github.com/ryanuber/columnize v0.0.0-20160712163229-9b3edd62028f/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts= github.com/ryanuber/columnize v2.1.0+incompatible/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts= github.com/ryanuber/go-glob v1.0.0/go.mod h1:807d1WSdnB0XRJzKNil9Om6lcp/3a0v4qIHxIXzX/Yc= +github.com/savsgio/dictpool v0.0.0-20221023140959-7bf2e61cea94 h1:rmMl4fXJhKMNWl+K+r/fq4FbbKI+Ia2m9hYBLm2h4G4= +github.com/savsgio/dictpool v0.0.0-20221023140959-7bf2e61cea94/go.mod h1:90zrgN3D/WJsDd1iXHT96alCoN2KJo6/4x1DZC3wZs8= +github.com/savsgio/gotils v0.0.0-20220530130905-52f3993e8d6d/go.mod h1:Gy+0tqhJvgGlqnTF8CVGP0AaGRjwBtXs/a5PA0Y3+A4= +github.com/savsgio/gotils v0.0.0-20230208104028-c358bd845dee h1:8Iv5m6xEo1NR1AvpV+7XmhI4r39LGNzwUL4YpMuL5vk= +github.com/savsgio/gotils v0.0.0-20230208104028-c358bd845dee/go.mod h1:qwtSXrKuJh/zsFQ12yEE89xfCrGKK63Rr7ctU/uCo4g= github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529/go.mod h1:DxrIzT+xaE7yg65j358z/aeFdxmN0P9QXhEzd20vsDc= github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE= @@ -358,12 +419,16 @@ github.com/speps/go-hashids/v2 v2.0.1 h1:ViWOEqWES/pdOSq+C1SLVa8/Tnsd52XC34RY7lt github.com/speps/go-hashids/v2 v2.0.1/go.mod h1:47LKunwvDZki/uRVD6NImtyk712yFzIs3UF3KlHohGw= github.com/spf13/cobra v1.5.0 h1:X+jTBEBqF0bHN+9cSMgmfuvv2VHJ9ezmFNf9Y/XstYU= github.com/spf13/cobra v1.5.0/go.mod h1:dWXEIy2H428czQCjInthrTRUg7yKbok+2Qi/yBIJoUM= +github.com/spf13/cobra v1.6.1 h1:o94oiPyS4KD1mPy2fmcYYHHfCxLqYjJOhGsCHFZtEzA= +github.com/spf13/cobra v1.6.1/go.mod h1:IOw/AERYS7UzyrGinqmz6HLUo219MORXGxhbaJUqzrY= github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA= github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.4.0 h1:M2gUjqZET1qApGOWNSnZ49BAIMX4F/1plDv3+l31EJ4= github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw= +github.com/stretchr/objx v0.5.0 h1:1zr/of2m5FGMsad5YfcqgdqdWrIhu+EBEJRhR1U7z/c= +github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo= github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= @@ -372,14 +437,24 @@ github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/ github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.8.0 h1:pSgiaMZlXftHpm5L7V1+rVB+AZJydKsMxsQBIJw4PKk= github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= +github.com/stretchr/testify v1.8.1 h1:w7B6lhMri9wdJUVmEZPGGhZzrYTPvgJArz7wNPgYKsk= +github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= github.com/tidwall/pretty v1.2.0 h1:RWIZEg2iJ8/g6fDDYzMpobmaoGh5OLl4AXtGUGPcqCs= github.com/tidwall/pretty v1.2.0/go.mod h1:ITEVvHYasfjBbM0u2Pg8T2nJnzm8xPwvNhhsoaGGjNU= +github.com/tidwall/pretty v1.2.1 h1:qjsOFOWWQl+N3RsoF5/ssm1pHmJJwhjlSbZ51I6wMl4= +github.com/tidwall/pretty v1.2.1/go.mod h1:ITEVvHYasfjBbM0u2Pg8T2nJnzm8xPwvNhhsoaGGjNU= +github.com/tinylib/msgp v1.1.6/go.mod h1:75BAfg2hauQhs3qedfdDZmWAPcFMAvJE5b9rGOMufyw= +github.com/tinylib/msgp v1.1.8 h1:FCXC1xanKO4I8plpHGH2P7koL/RzZs12l/+r7vakfm0= +github.com/tinylib/msgp v1.1.8/go.mod h1:qkpG+2ldGg4xRFmx+jfTvZPxfGFhi64BcnL9vkCm/Tw= github.com/valyala/bytebufferpool v1.0.0 h1:GqA5TC/0021Y/b9FG4Oi9Mr3q7XYx6KllzawFIhcdPw= github.com/valyala/bytebufferpool v1.0.0/go.mod h1:6bBcMArwyJ5K/AmCkWv1jt77kVWyCJ6HpOuEn7z0Csc= github.com/valyala/fasthttp v1.35.0/go.mod h1:t/G+3rLek+CyY9bnIE+YlMRddxVAAGjhxndDB4i4C0I= github.com/valyala/fasthttp v1.38.0/go.mod h1:t/G+3rLek+CyY9bnIE+YlMRddxVAAGjhxndDB4i4C0I= github.com/valyala/fasthttp v1.39.0 h1:lW8mGeM7yydOqZKmwyMTaz/PH/A+CLgtmmcjv+OORfU= github.com/valyala/fasthttp v1.39.0/go.mod h1:t/G+3rLek+CyY9bnIE+YlMRddxVAAGjhxndDB4i4C0I= +github.com/valyala/fasthttp v1.43.0/go.mod h1:f6VbjjoI3z1NDOZOv17o6RvtRSWxC77seBFc2uWtgiY= +github.com/valyala/fasthttp v1.44.0 h1:R+gLUhldIsfg1HokMuQjdQ5bh9nuXHPIfvkYUu9eR5Q= +github.com/valyala/fasthttp v1.44.0/go.mod h1:f6VbjjoI3z1NDOZOv17o6RvtRSWxC77seBFc2uWtgiY= github.com/valyala/tcplisten v1.0.0 h1:rBHj/Xf+E1tRGZyWIWwJDiRY0zc1Js+CV5DqwacVSA8= github.com/valyala/tcplisten v1.0.0/go.mod h1:T0xQ8SeCZGxckz9qRXTfG43PvQ/mcWh7FwZEA7Ioqkc= github.com/yuin/goldmark v1.1.25/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= @@ -388,6 +463,7 @@ github.com/yuin/goldmark v1.1.32/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9de github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.3.5/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= github.com/yuin/goldmark v1.4.1/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= +github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY= go.etcd.io/etcd/api/v3 v3.5.4/go.mod h1:5GB2vv4A4AOn3yk7MftYGHkUfGtDHnEraIjym4dYz5A= go.etcd.io/etcd/client/pkg/v3 v3.5.4/go.mod h1:IJHfcCEKxYu1Os13ZdwCwIUTUVGYTSAM3YSwc9/Ac1g= go.etcd.io/etcd/client/v3 v3.5.4/go.mod h1:ZaRkVgBZC+L+dLCjTcF1hRXpgZXQPOvnA/Ak/gq3kiY= @@ -398,12 +474,20 @@ go.opencensus.io v0.22.3/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= go.opencensus.io v0.22.4/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= go.opentelemetry.io/otel v1.9.0 h1:8WZNQFIB2a71LnANS9JeyidJKKGOOremcUtb/OtHISw= go.opentelemetry.io/otel v1.9.0/go.mod h1:np4EoPGzoPs3O67xUVNoPPcmSvsfOxNlNA4F4AC+0Eo= +go.opentelemetry.io/otel v1.13.0 h1:1ZAKnNQKwBBxFtww/GwxNUyTf0AxkZzrukO8MeXqe4Y= +go.opentelemetry.io/otel v1.13.0/go.mod h1:FH3RtdZCzRkJYFTCsAKDy9l/XYjMdNv6QrkFFB8DvVg= go.opentelemetry.io/otel/exporters/jaeger v1.9.0 h1:gAEgEVGDWwFjcis9jJTOJqZNxDzoZfR12WNIxr7g9Ww= go.opentelemetry.io/otel/exporters/jaeger v1.9.0/go.mod h1:hquezOLVAybNW6vanIxkdLXTXvzlj2Vn3wevSP15RYs= +go.opentelemetry.io/otel/exporters/jaeger v1.13.0 h1:VAMoGujbVV8Q0JNM/cEbhzUIWWBxnEqH45HP9iBKN04= +go.opentelemetry.io/otel/exporters/jaeger v1.13.0/go.mod h1:fHwbmle6mBFJA1p2ZIhilvffCdq/dM5UTIiCOmEjS+w= go.opentelemetry.io/otel/sdk v1.9.0 h1:LNXp1vrr83fNXTHgU8eO89mhzxb/bbWAsHG6fNf3qWo= go.opentelemetry.io/otel/sdk v1.9.0/go.mod h1:AEZc8nt5bd2F7BC24J5R0mrjYnpEgYHyTcM/vrSple4= +go.opentelemetry.io/otel/sdk v1.13.0 h1:BHib5g8MvdqS65yo2vV1s6Le42Hm6rrw08qU6yz5JaM= +go.opentelemetry.io/otel/sdk v1.13.0/go.mod h1:YLKPx5+6Vx/o1TCUYYs+bpymtkmazOMT6zoRrC7AQ7I= go.opentelemetry.io/otel/trace v1.9.0 h1:oZaCNJUjWcg60VXWee8lJKlqhPbXAPB51URuR47pQYc= go.opentelemetry.io/otel/trace v1.9.0/go.mod h1:2737Q0MuG8q1uILYm2YYVkAyLtOofiTNGg6VODnOiPo= +go.opentelemetry.io/otel/trace v1.13.0 h1:CBgRZ6ntv+Amuj1jDsMhZtlAPT6gbyIRdaIzFhfBSdY= +go.opentelemetry.io/otel/trace v1.13.0/go.mod h1:muCvmmO9KKpvuXSf3KKAXXB2ygNYHQ+ZfI5X08d3tds= go.uber.org/atomic v1.7.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc= go.uber.org/atomic v1.9.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc= go.uber.org/atomic v1.10.0 h1:9qC72Qh0+3MqyJbAn8YU5xVq1frD8bn3JtD2oXtafVQ= @@ -417,10 +501,14 @@ go.uber.org/multierr v1.6.0/go.mod h1:cdWPpRnG4AhwMwsgIHip0KRBQjJy5kYEpYjJxpXp9i go.uber.org/multierr v1.7.0/go.mod h1:7EAYxJLBy9rStEaz58O2t4Uvip6FSURkq8/ppBp95ak= go.uber.org/multierr v1.8.0 h1:dg6GjLku4EH+249NNmoIciG9N/jURbDG+pFlTkhzIC8= go.uber.org/multierr v1.8.0/go.mod h1:7EAYxJLBy9rStEaz58O2t4Uvip6FSURkq8/ppBp95ak= +go.uber.org/multierr v1.9.0 h1:7fIwc/ZtS0q++VgcfqFDxSBZVv/Xo49/SYnDFupUwlI= +go.uber.org/multierr v1.9.0/go.mod h1:X2jQV1h+kxSjClGpnseKVIxpmcjrj7MNnI0bnlfKTVQ= go.uber.org/zap v1.17.0/go.mod h1:MXVU+bhUf/A7Xi2HNOnopQOrmycQ5Ih87HtOu4q5SSo= go.uber.org/zap v1.21.0/go.mod h1:wjWOCqI0f2ZZrJF/UufIOkiC8ii6tm1iqIsLo76RfJw= go.uber.org/zap v1.23.0 h1:OjGQ5KQDEUawVHxNwQgPpiypGHOxo2mNZsOqTak4fFY= go.uber.org/zap v1.23.0/go.mod h1:D+nX8jyLsMHMYrln8A0rJjFt/T/9/bGgIhAqxv5URuY= +go.uber.org/zap v1.24.0 h1:FiJd5l1UOLj0wCgbSE0rwwXHzEdAZS6hiiSnxJN/D60= +go.uber.org/zap v1.24.0/go.mod h1:2kMP+WWQ8aoFoedH3T2sq6iJ2yDWpHbP0f6MQbS9Gkg= golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= @@ -428,6 +516,7 @@ golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8U golang.org/x/crypto v0.0.0-20190923035154-9ee001bba392/go.mod h1:/lpIB1dKB+9EgE3H3cr1v9wB50oz8l4C4h62xy7jSTY= golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= +golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.0.0-20220214200702-86341886e292/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= @@ -462,6 +551,8 @@ golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.5.1/go.mod h1:5OXOZSfqPIIbmVBIIKWRFfZjPR0E5r58TLhUjH0a2Ro= +golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= +golang.org/x/mod v0.7.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20181114220301-adae6a3d119a/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= @@ -500,6 +591,9 @@ golang.org/x/net v0.0.0-20211015210444-4f30a5c0130f/go.mod h1:9nx3DQGgdP8bBQD5qx golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20220127200216-cd36cc0744dd/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= golang.org/x/net v0.0.0-20220225172249-27dd8689420f/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= +golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= +golang.org/x/net v0.0.0-20220906165146-f3363e06e74c/go.mod h1:YDH+HFinaLZZlnHAfSS6ZXJJ9M9t4Dl22yv3iI2vPwk= +golang.org/x/net v0.3.0/go.mod h1:MBQ8lrhLObU/6UmLb4fmbmk5OcyYmqtbGd/9yIeKjEE= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= @@ -518,6 +612,9 @@ golang.org/x/sync v0.0.0-20200625203802-6e8e738ad208/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201207232520-09787c993a3a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20220601150217-0de741cfad7f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sys v0.0.0-20180823144017-11551d06cbcc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= @@ -575,10 +672,19 @@ golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20220114195835-da31bd327af9/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220227234510-4e6760a101f9/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220412211240-33da011f77ad/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220728004956-3c1f35247d10/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220825204002-c680a09ffe64 h1:UiNENfZ8gDvpiWw7IpOMQ27spWmThO1RwwdQVbJahJM= golang.org/x/sys v0.0.0-20220825204002-c680a09ffe64/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220908164124-27713097b956/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.3.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.5.0 h1:MUK/U/4lj1t1oPg0HfuXDN/Z1wv31ZJ/YcPiGccS4DU= +golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= +golang.org/x/term v0.3.0/go.mod h1:q750SLmJuPmVoN1blW3UFBPREJfb1KmY3vwxfr+nFDA= golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= @@ -588,6 +694,7 @@ golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= +golang.org/x/text v0.5.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= @@ -633,10 +740,13 @@ golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roY golang.org/x/tools v0.0.0-20200729194436-6467de6f59a7/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= golang.org/x/tools v0.0.0-20200804011535-6c149bb5ef0d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= golang.org/x/tools v0.0.0-20200825202427-b303f430e36d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= +golang.org/x/tools v0.0.0-20201022035929-9cf592e881e9/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.1.2/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.5/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.8/go.mod h1:nABZi5QlRsZVlzPpHl034qft6wpY4eDcsTt5AaioBiU= +golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= +golang.org/x/tools v0.4.0/go.mod h1:UE5sM2OK9E/d67R0ANs2xJizIymRP5gJU295PvKXxjQ= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= From 90b8f7d023892db412d38d28637b12f71ea0c886 Mon Sep 17 00:00:00 2001 From: Parham Alvani Date: Sat, 25 Feb 2023 17:05:01 +0330 Subject: [PATCH 357/660] feat: disable musttag --- .golangci.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.golangci.yml b/.golangci.yml index 7b7a75e2..51b0838b 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -7,6 +7,7 @@ linters: # it should improve to support more known patterns - varnamelen - ireturn + - musttag # deprecated linters - maligned - scopelint @@ -16,4 +17,4 @@ linters: - nolintlint run: skip-files: - - ".*_test.go" \ No newline at end of file + - ".*_test.go" From f679f9a629ee8fe79316cb84849a519ddd78c42c Mon Sep 17 00:00:00 2001 From: Parham Alvani Date: Sat, 25 Feb 2023 19:50:07 +0330 Subject: [PATCH 358/660] feat: update chart version --- deployments/soteria/Chart.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/deployments/soteria/Chart.yaml b/deployments/soteria/Chart.yaml index d297d29b..55e067b9 100644 --- a/deployments/soteria/Chart.yaml +++ b/deployments/soteria/Chart.yaml @@ -5,6 +5,6 @@ description: Soteria Helm Chart type: application -version: 7.0.2 +version: 7.0.3 -appVersion: "v7-0-2" +appVersion: "v7-0-3" From b01a256d49904400a7b46fe35be5850e746a9287 Mon Sep 17 00:00:00 2001 From: Parham Alvani Date: Wed, 1 Mar 2023 21:26:08 +0330 Subject: [PATCH 359/660] fix: correct mozart url --- .gitlab/ci/templates/release.gitlab-ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.gitlab/ci/templates/release.gitlab-ci.yml b/.gitlab/ci/templates/release.gitlab-ci.yml index 679ff391..c05a8538 100644 --- a/.gitlab/ci/templates/release.gitlab-ci.yml +++ b/.gitlab/ci/templates/release.gitlab-ci.yml @@ -32,8 +32,8 @@ release:staging:teh-2: release:mozart: extends: .easy_ci:release:docker variables: - RELEASE_CONTAINER_REGISTRY_ADDRESS: "$OKD_TEH1_REGISTRY" - RELEASE_CONTAINER_REGISTRY_IMAGE: "$OKD_TEH1_REGISTRY/mozart/$CI_PROJECT_NAME" + OKD4_TEH1_REGISTRY: "image-registry.apps.private.okd4.teh-1.snappcloud.io" + RELEASE_CONTAINER_REGISTRY_IMAGE: "$OKD4_TEH1_REGISTRY/mozart/$CI_PROJECT_NAME" RELEASE_CONTAINER_REGISTRY_USERNAME: "gitlab-ci" RELEASE_CONTAINER_REGISTRY_PASSWORD: "$OKD_MOZART_TOKEN" dependencies: From a85f97bbc921cf734ecc5d5e55cd2f13559dc899 Mon Sep 17 00:00:00 2001 From: Parham Alvani Date: Tue, 7 Mar 2023 15:00:46 +0330 Subject: [PATCH 360/660] fix: correct mozart url --- .gitlab/ci/templates/release.gitlab-ci.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitlab/ci/templates/release.gitlab-ci.yml b/.gitlab/ci/templates/release.gitlab-ci.yml index c05a8538..deacaa2f 100644 --- a/.gitlab/ci/templates/release.gitlab-ci.yml +++ b/.gitlab/ci/templates/release.gitlab-ci.yml @@ -33,6 +33,7 @@ release:mozart: extends: .easy_ci:release:docker variables: OKD4_TEH1_REGISTRY: "image-registry.apps.private.okd4.teh-1.snappcloud.io" + RELEASE_CONTAINER_REGISTRY_ADDRESS: "$OKD4_TEH1_REGISTRY" RELEASE_CONTAINER_REGISTRY_IMAGE: "$OKD4_TEH1_REGISTRY/mozart/$CI_PROJECT_NAME" RELEASE_CONTAINER_REGISTRY_USERNAME: "gitlab-ci" RELEASE_CONTAINER_REGISTRY_PASSWORD: "$OKD_MOZART_TOKEN" From 122520315105b2c656f1a6745052fa047c224c39 Mon Sep 17 00:00:00 2001 From: Parham Alvani Date: Tue, 7 Mar 2023 15:16:50 +0330 Subject: [PATCH 361/660] feat: update token configuration --- .gitlab/ci/templates/release.gitlab-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitlab/ci/templates/release.gitlab-ci.yml b/.gitlab/ci/templates/release.gitlab-ci.yml index deacaa2f..81d0b0df 100644 --- a/.gitlab/ci/templates/release.gitlab-ci.yml +++ b/.gitlab/ci/templates/release.gitlab-ci.yml @@ -36,7 +36,7 @@ release:mozart: RELEASE_CONTAINER_REGISTRY_ADDRESS: "$OKD4_TEH1_REGISTRY" RELEASE_CONTAINER_REGISTRY_IMAGE: "$OKD4_TEH1_REGISTRY/mozart/$CI_PROJECT_NAME" RELEASE_CONTAINER_REGISTRY_USERNAME: "gitlab-ci" - RELEASE_CONTAINER_REGISTRY_PASSWORD: "$OKD_MOZART_TOKEN" + RELEASE_CONTAINER_REGISTRY_PASSWORD: ${OKD_MOZART_TOKEN} dependencies: - build only: From a0f0f177158bea56658b896d0ef1cbc4d10d81b0 Mon Sep 17 00:00:00 2001 From: Parham Alvani Date: Tue, 28 Mar 2023 10:50:04 +0330 Subject: [PATCH 362/660] feat: update packages --- go.mod | 34 +++++++++++++++++----------------- go.sum | 31 +++++++++++++++++++++++++++++++ 2 files changed, 48 insertions(+), 17 deletions(-) diff --git a/go.mod b/go.mod index e5a110d5..d050e0f5 100644 --- a/go.mod +++ b/go.mod @@ -5,24 +5,23 @@ go 1.20 require ( github.com/ansrivas/fiberprometheus/v2 v2.6.0 github.com/gofiber/contrib/fiberzap v1.0.2 - github.com/gofiber/fiber/v2 v2.42.0 + github.com/gofiber/fiber/v2 v2.43.0 github.com/golang-jwt/jwt/v4 v4.5.0 github.com/knadh/koanf v1.5.0 github.com/prometheus/client_golang v1.14.0 // indirect + github.com/speps/go-hashids/v2 v2.0.1 github.com/spf13/cobra v1.6.1 - github.com/stretchr/testify v1.8.1 + github.com/stretchr/testify v1.8.2 github.com/tidwall/pretty v1.2.1 - go.opentelemetry.io/otel v1.13.0 - go.opentelemetry.io/otel/exporters/jaeger v1.13.0 - go.opentelemetry.io/otel/sdk v1.13.0 - go.opentelemetry.io/otel/trace v1.13.0 + go.opentelemetry.io/otel v1.14.0 + go.opentelemetry.io/otel/exporters/jaeger v1.14.0 + go.opentelemetry.io/otel/sdk v1.14.0 + go.opentelemetry.io/otel/trace v1.14.0 go.uber.org/atomic v1.10.0 // indirect - go.uber.org/automaxprocs v1.5.1 + go.uber.org/automaxprocs v1.5.2 go.uber.org/zap v1.24.0 ) -require github.com/speps/go-hashids/v2 v2.0.1 - require ( github.com/andybalholm/brotli v1.0.5 // indirect github.com/beorn7/perks v1.0.1 // indirect @@ -33,13 +32,14 @@ require ( github.com/go-logr/logr v1.2.3 // indirect github.com/go-logr/stdr v1.2.2 // indirect github.com/gofiber/adaptor/v2 v2.1.32 // indirect - github.com/golang/protobuf v1.5.2 // indirect + github.com/golang-jwt/jwt/v5 v5.0.0-rc.1 // indirect + github.com/golang/protobuf v1.5.3 // indirect github.com/google/uuid v1.3.0 // indirect github.com/inconshreveable/mousetrap v1.1.0 // indirect github.com/json-iterator/go v1.1.12 // indirect - github.com/klauspost/compress v1.15.15 // indirect + github.com/klauspost/compress v1.16.3 // indirect github.com/mattn/go-colorable v0.1.13 // indirect - github.com/mattn/go-isatty v0.0.17 // indirect + github.com/mattn/go-isatty v0.0.18 // indirect github.com/mattn/go-runewidth v0.0.14 // indirect github.com/matttproud/golang_protobuf_extensions v1.0.4 // indirect github.com/mitchellh/copystructure v1.2.0 // indirect @@ -50,7 +50,7 @@ require ( github.com/philhofer/fwd v1.1.2 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect github.com/prometheus/client_model v0.3.0 // indirect - github.com/prometheus/common v0.40.0 // indirect + github.com/prometheus/common v0.42.0 // indirect github.com/prometheus/procfs v0.9.0 // indirect github.com/rivo/uniseg v0.4.4 // indirect github.com/savsgio/dictpool v0.0.0-20221023140959-7bf2e61cea94 // indirect @@ -59,10 +59,10 @@ require ( github.com/stretchr/objx v0.5.0 // indirect github.com/tinylib/msgp v1.1.8 // indirect github.com/valyala/bytebufferpool v1.0.0 // indirect - github.com/valyala/fasthttp v1.44.0 // indirect + github.com/valyala/fasthttp v1.45.0 // indirect github.com/valyala/tcplisten v1.0.0 // indirect - go.uber.org/multierr v1.9.0 // indirect - golang.org/x/sys v0.5.0 // indirect - google.golang.org/protobuf v1.28.1 // indirect + go.uber.org/multierr v1.10.0 // indirect + golang.org/x/sys v0.6.0 // indirect + google.golang.org/protobuf v1.30.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect ) diff --git a/go.sum b/go.sum index bec54592..3f8e946a 100644 --- a/go.sum +++ b/go.sum @@ -141,6 +141,8 @@ github.com/gofiber/fiber/v2 v2.36.0/go.mod h1:tgCr+lierLwLoVHHO/jn3Niannv34WRkQE github.com/gofiber/fiber/v2 v2.41.0/go.mod h1:RdebcCuCRFp4W6hr3968/XxwJVg0K+jr9/Ae0PFzZ0Q= github.com/gofiber/fiber/v2 v2.42.0 h1:Fnp7ybWvS+sjNQsFvkhf4G8OhXswvB6Vee8hM/LyS+8= github.com/gofiber/fiber/v2 v2.42.0/go.mod h1:3+SGNjqMh5VQH5Vz2Wdi43zTIV16ktlFd3x3R6O1Zlc= +github.com/gofiber/fiber/v2 v2.43.0 h1:yit3E4kHf178B60p5CQBa/3v+WVuziWMa/G2ZNyLJB0= +github.com/gofiber/fiber/v2 v2.43.0/go.mod h1:mpS1ZNE5jU+u+BA4FbM+KKnUzJ4wzTK+FT2tG3tU+6I= github.com/gofiber/utils v0.1.2/go.mod h1:pacRFtghAE3UoknMOUiXh2Io/nLWSUHtQCi/3QASsOc= github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q= @@ -148,6 +150,8 @@ github.com/golang-jwt/jwt/v4 v4.4.2 h1:rcc4lwaZgFMCZ5jxF9ABolDcIHdBytAFgqFPbSJQA github.com/golang-jwt/jwt/v4 v4.4.2/go.mod h1:m21LjoU+eqJr34lmDMbreY2eSTRJ1cv77w39/MY0Ch0= github.com/golang-jwt/jwt/v4 v4.5.0 h1:7cYmW1XlMY7h7ii7UhUyChSgS5wUJEnm9uZVTGqOWzg= github.com/golang-jwt/jwt/v4 v4.5.0/go.mod h1:m21LjoU+eqJr34lmDMbreY2eSTRJ1cv77w39/MY0Ch0= +github.com/golang-jwt/jwt/v5 v5.0.0-rc.1 h1:tDQ1LjKga657layZ4JLsRdxgvupebc0xuPwRNuTfUgs= +github.com/golang-jwt/jwt/v5 v5.0.0-rc.1/go.mod h1:pqrtFR0X4osieyHYxtmOUWsAWrfe1Q5UVIyoH402zdk= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/groupcache v0.0.0-20191227052852-215e87163ea7/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= @@ -176,6 +180,8 @@ github.com/golang/protobuf v1.4.3/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= github.com/golang/protobuf v1.5.2 h1:ROPKBNFfQgOUMifHyP+KYbvpjbdoFNs+aK7DXlji0Tw= github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= +github.com/golang/protobuf v1.5.3 h1:KhyjKVUg7Usr/dYsdSqoFveMYd5ko72D+zANwlG1mmg= +github.com/golang/protobuf v1.5.3/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= github.com/golang/snappy v0.0.1/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= @@ -273,6 +279,8 @@ github.com/klauspost/compress v1.15.9 h1:wKRjX6JRtDdrE9qwa4b/Cip7ACOshUI4smpCQan github.com/klauspost/compress v1.15.9/go.mod h1:PhcZ0MbTNciWF3rruxRgKxI5NkcHHrHUDtV4Yw2GlzU= github.com/klauspost/compress v1.15.15 h1:EF27CXIuDsYJ6mmvtBRlEuB2UVOqHG1tAXgZ7yIO+lw= github.com/klauspost/compress v1.15.15/go.mod h1:ZcK2JAFqKOpnBlxcLsJzYfrS9X1akm9fHZNnD9+Vo/4= +github.com/klauspost/compress v1.16.3 h1:XuJt9zzcnaz6a16/OU53ZjWp/v7/42WcR5t2a0PcNQY= +github.com/klauspost/compress v1.16.3/go.mod h1:ntbaceVETuRiXiv4DpjP66DpAtAGkEQskQzEyD//IeE= github.com/knadh/koanf v1.4.3 h1:rSJcSH5LSFhvzBRsAYfT3k7eLP0I4UxeZqjtAatk+wc= github.com/knadh/koanf v1.4.3/go.mod h1:5FAkuykKXZvLqhAbP4peWgM5CTcZmn7L1d27k/a+kfg= github.com/knadh/koanf v1.5.0 h1:q2TSd/3Pyc/5yP9ldIrSdIz26MCcyNQzW0pEAugLPNs= @@ -304,6 +312,8 @@ github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Ky github.com/mattn/go-isatty v0.0.16/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM= github.com/mattn/go-isatty v0.0.17 h1:BTarxUcIeDqL27Mc+vyvdWYSL28zpIhv3RoTdsLMPng= github.com/mattn/go-isatty v0.0.17/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM= +github.com/mattn/go-isatty v0.0.18 h1:DOKFKCQ7FNG2L1rbrmstDN4QVRdS89Nkh85u68Uwp98= +github.com/mattn/go-isatty v0.0.18/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y= github.com/mattn/go-runewidth v0.0.14 h1:+xnbZSEeDbOIg5/mE6JF0w6n9duR1l3/WmbinWVwUuU= github.com/mattn/go-runewidth v0.0.14/go.mod h1:Jdepj2loyihRzMpdS35Xk/zdY8IAYHsh153qUoGf23w= github.com/matttproud/golang_protobuf_extensions v1.0.1 h1:4hp9jkHxhMHkqkrB3Ix0jegS5sx/RkqARlsWZ6pIwiU= @@ -383,6 +393,8 @@ github.com/prometheus/common v0.37.0 h1:ccBbHCgIiT9uSoFY0vX8H3zsNR5eLt17/RQLUvn8 github.com/prometheus/common v0.37.0/go.mod h1:phzohg0JFMnBEFGxTDbfu3QyL5GI8gTQJFhYO5B3mfA= github.com/prometheus/common v0.40.0 h1:Afz7EVRqGg2Mqqf4JuF9vdvp1pi220m55Pi9T2JnO4Q= github.com/prometheus/common v0.40.0/go.mod h1:L65ZJPSmfn/UBWLQIHV7dBrKFidB/wPlF1y5TlSt9OE= +github.com/prometheus/common v0.42.0 h1:EKsfXEYo4JpWMHH5cg+KOUWeuJSov1Id8zGR8eeI1YM= +github.com/prometheus/common v0.42.0/go.mod h1:xBwqVerjNdUDjgODMpudtOMwlOwf2SaTr1yjz4b7Zbc= github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= github.com/prometheus/procfs v0.1.3/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU= @@ -439,6 +451,7 @@ github.com/stretchr/testify v1.8.0 h1:pSgiaMZlXftHpm5L7V1+rVB+AZJydKsMxsQBIJw4PK github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= github.com/stretchr/testify v1.8.1 h1:w7B6lhMri9wdJUVmEZPGGhZzrYTPvgJArz7wNPgYKsk= github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= +github.com/stretchr/testify v1.8.2/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= github.com/tidwall/pretty v1.2.0 h1:RWIZEg2iJ8/g6fDDYzMpobmaoGh5OLl4AXtGUGPcqCs= github.com/tidwall/pretty v1.2.0/go.mod h1:ITEVvHYasfjBbM0u2Pg8T2nJnzm8xPwvNhhsoaGGjNU= github.com/tidwall/pretty v1.2.1 h1:qjsOFOWWQl+N3RsoF5/ssm1pHmJJwhjlSbZ51I6wMl4= @@ -455,6 +468,8 @@ github.com/valyala/fasthttp v1.39.0/go.mod h1:t/G+3rLek+CyY9bnIE+YlMRddxVAAGjhxn github.com/valyala/fasthttp v1.43.0/go.mod h1:f6VbjjoI3z1NDOZOv17o6RvtRSWxC77seBFc2uWtgiY= github.com/valyala/fasthttp v1.44.0 h1:R+gLUhldIsfg1HokMuQjdQ5bh9nuXHPIfvkYUu9eR5Q= github.com/valyala/fasthttp v1.44.0/go.mod h1:f6VbjjoI3z1NDOZOv17o6RvtRSWxC77seBFc2uWtgiY= +github.com/valyala/fasthttp v1.45.0 h1:zPkkzpIn8tdHZUrVa6PzYd0i5verqiPSkgTd3bSUcpA= +github.com/valyala/fasthttp v1.45.0/go.mod h1:k2zXd82h/7UZc3VOdJ2WaUqt1uZ/XpXAfE9i+HBC3lA= github.com/valyala/tcplisten v1.0.0 h1:rBHj/Xf+E1tRGZyWIWwJDiRY0zc1Js+CV5DqwacVSA8= github.com/valyala/tcplisten v1.0.0/go.mod h1:T0xQ8SeCZGxckz9qRXTfG43PvQ/mcWh7FwZEA7Ioqkc= github.com/yuin/goldmark v1.1.25/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= @@ -476,24 +491,34 @@ go.opentelemetry.io/otel v1.9.0 h1:8WZNQFIB2a71LnANS9JeyidJKKGOOremcUtb/OtHISw= go.opentelemetry.io/otel v1.9.0/go.mod h1:np4EoPGzoPs3O67xUVNoPPcmSvsfOxNlNA4F4AC+0Eo= go.opentelemetry.io/otel v1.13.0 h1:1ZAKnNQKwBBxFtww/GwxNUyTf0AxkZzrukO8MeXqe4Y= go.opentelemetry.io/otel v1.13.0/go.mod h1:FH3RtdZCzRkJYFTCsAKDy9l/XYjMdNv6QrkFFB8DvVg= +go.opentelemetry.io/otel v1.14.0 h1:/79Huy8wbf5DnIPhemGB+zEPVwnN6fuQybr/SRXa6hM= +go.opentelemetry.io/otel v1.14.0/go.mod h1:o4buv+dJzx8rohcUeRmWUZhqupFvzWis188WlggnNeU= go.opentelemetry.io/otel/exporters/jaeger v1.9.0 h1:gAEgEVGDWwFjcis9jJTOJqZNxDzoZfR12WNIxr7g9Ww= go.opentelemetry.io/otel/exporters/jaeger v1.9.0/go.mod h1:hquezOLVAybNW6vanIxkdLXTXvzlj2Vn3wevSP15RYs= go.opentelemetry.io/otel/exporters/jaeger v1.13.0 h1:VAMoGujbVV8Q0JNM/cEbhzUIWWBxnEqH45HP9iBKN04= go.opentelemetry.io/otel/exporters/jaeger v1.13.0/go.mod h1:fHwbmle6mBFJA1p2ZIhilvffCdq/dM5UTIiCOmEjS+w= +go.opentelemetry.io/otel/exporters/jaeger v1.14.0 h1:CjbUNd4iN2hHmWekmOqZ+zSCU+dzZppG8XsV+A3oc8Q= +go.opentelemetry.io/otel/exporters/jaeger v1.14.0/go.mod h1:4Ay9kk5vELRrbg5z4cpP9EtmQRFap2Wb0woPG4lujZA= go.opentelemetry.io/otel/sdk v1.9.0 h1:LNXp1vrr83fNXTHgU8eO89mhzxb/bbWAsHG6fNf3qWo= go.opentelemetry.io/otel/sdk v1.9.0/go.mod h1:AEZc8nt5bd2F7BC24J5R0mrjYnpEgYHyTcM/vrSple4= go.opentelemetry.io/otel/sdk v1.13.0 h1:BHib5g8MvdqS65yo2vV1s6Le42Hm6rrw08qU6yz5JaM= go.opentelemetry.io/otel/sdk v1.13.0/go.mod h1:YLKPx5+6Vx/o1TCUYYs+bpymtkmazOMT6zoRrC7AQ7I= +go.opentelemetry.io/otel/sdk v1.14.0 h1:PDCppFRDq8A1jL9v6KMI6dYesaq+DFcDZvjsoGvxGzY= +go.opentelemetry.io/otel/sdk v1.14.0/go.mod h1:bwIC5TjrNG6QDCHNWvW4HLHtUQ4I+VQDsnjhvyZCALM= go.opentelemetry.io/otel/trace v1.9.0 h1:oZaCNJUjWcg60VXWee8lJKlqhPbXAPB51URuR47pQYc= go.opentelemetry.io/otel/trace v1.9.0/go.mod h1:2737Q0MuG8q1uILYm2YYVkAyLtOofiTNGg6VODnOiPo= go.opentelemetry.io/otel/trace v1.13.0 h1:CBgRZ6ntv+Amuj1jDsMhZtlAPT6gbyIRdaIzFhfBSdY= go.opentelemetry.io/otel/trace v1.13.0/go.mod h1:muCvmmO9KKpvuXSf3KKAXXB2ygNYHQ+ZfI5X08d3tds= +go.opentelemetry.io/otel/trace v1.14.0 h1:wp2Mmvj41tDsyAJXiWDWpfNsOiIyd38fy85pyKcFq/M= +go.opentelemetry.io/otel/trace v1.14.0/go.mod h1:8avnQLK+CG77yNLUae4ea2JDQ6iT+gozhnZjy/rw9G8= go.uber.org/atomic v1.7.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc= go.uber.org/atomic v1.9.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc= go.uber.org/atomic v1.10.0 h1:9qC72Qh0+3MqyJbAn8YU5xVq1frD8bn3JtD2oXtafVQ= go.uber.org/atomic v1.10.0/go.mod h1:LUxbIzbOniOlMKjJjyPfpl4v+PKK2cNJn91OQbhoJI0= go.uber.org/automaxprocs v1.5.1 h1:e1YG66Lrk73dn4qhg8WFSvhF0JuFQF0ERIp4rpuV8Qk= go.uber.org/automaxprocs v1.5.1/go.mod h1:BF4eumQw0P9GtnuxxovUd06vwm1o18oMzFtK66vU6XU= +go.uber.org/automaxprocs v1.5.2 h1:2LxUOGiR3O6tw8ui5sZa2LAaHnsviZdVOUZw4fvbnME= +go.uber.org/automaxprocs v1.5.2/go.mod h1:eRbA25aqJrxAbsLO0xy5jVwPt7FQnRgjW+efnwa1WM0= go.uber.org/goleak v1.1.11/go.mod h1:cwTWslyiVhfpKIDGSZEM2HlOvcqm+tG4zioyIeLoqMQ= go.uber.org/goleak v1.1.12 h1:gZAh5/EyT/HQwlpkCy6wTpqfH9H8Lz8zbm3dZh+OyzA= go.uber.org/goleak v1.1.12/go.mod h1:cwTWslyiVhfpKIDGSZEM2HlOvcqm+tG4zioyIeLoqMQ= @@ -503,6 +528,8 @@ go.uber.org/multierr v1.8.0 h1:dg6GjLku4EH+249NNmoIciG9N/jURbDG+pFlTkhzIC8= go.uber.org/multierr v1.8.0/go.mod h1:7EAYxJLBy9rStEaz58O2t4Uvip6FSURkq8/ppBp95ak= go.uber.org/multierr v1.9.0 h1:7fIwc/ZtS0q++VgcfqFDxSBZVv/Xo49/SYnDFupUwlI= go.uber.org/multierr v1.9.0/go.mod h1:X2jQV1h+kxSjClGpnseKVIxpmcjrj7MNnI0bnlfKTVQ= +go.uber.org/multierr v1.10.0 h1:S0h4aNzvfcFsC3dRF1jLoaov7oRaKqRGC/pUEJ2yvPQ= +go.uber.org/multierr v1.10.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y= go.uber.org/zap v1.17.0/go.mod h1:MXVU+bhUf/A7Xi2HNOnopQOrmycQ5Ih87HtOu4q5SSo= go.uber.org/zap v1.21.0/go.mod h1:wjWOCqI0f2ZZrJF/UufIOkiC8ii6tm1iqIsLo76RfJw= go.uber.org/zap v1.23.0 h1:OjGQ5KQDEUawVHxNwQgPpiypGHOxo2mNZsOqTak4fFY= @@ -682,6 +709,8 @@ golang.org/x/sys v0.0.0-20220908164124-27713097b956/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.3.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.5.0 h1:MUK/U/4lj1t1oPg0HfuXDN/Z1wv31ZJ/YcPiGccS4DU= golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.6.0 h1:MVltZSvRTcU2ljQOhs94SXPftV6DCNnZViHeQps87pQ= +golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/term v0.3.0/go.mod h1:q750SLmJuPmVoN1blW3UFBPREJfb1KmY3vwxfr+nFDA= @@ -835,6 +864,8 @@ google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp0 google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= google.golang.org/protobuf v1.28.1 h1:d0NfwRgPtno5B1Wa6L2DAG+KivqkdutMf1UhdNx175w= google.golang.org/protobuf v1.28.1/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= +google.golang.org/protobuf v1.30.0 h1:kPPoIgf3TsEvrm0PFe15JQ+570QVxYzEvvHqChK+cng= +google.golang.org/protobuf v1.30.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= gopkg.in/asn1-ber.v1 v1.0.0-20181015200546-f715ec2f112d/go.mod h1:cuepJuh7vyXfUyUwEgHQXw849cJrilpS5NeIjOWESAw= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= From bc71620071aa17a4c538830f68902d11521a1bc9 Mon Sep 17 00:00:00 2001 From: Parham Alvani Date: Tue, 28 Mar 2023 10:51:18 +0330 Subject: [PATCH 363/660] feat: migrate to v5 for jwt --- go.mod | 7 +- go.sum | 116 +------------------ internal/authenticator/authenticator.go | 2 +- internal/authenticator/authenticator_test.go | 2 +- internal/authenticator/key.go | 2 +- 5 files changed, 7 insertions(+), 122 deletions(-) diff --git a/go.mod b/go.mod index d050e0f5..cc703fa1 100644 --- a/go.mod +++ b/go.mod @@ -6,7 +6,6 @@ require ( github.com/ansrivas/fiberprometheus/v2 v2.6.0 github.com/gofiber/contrib/fiberzap v1.0.2 github.com/gofiber/fiber/v2 v2.43.0 - github.com/golang-jwt/jwt/v4 v4.5.0 github.com/knadh/koanf v1.5.0 github.com/prometheus/client_golang v1.14.0 // indirect github.com/speps/go-hashids/v2 v2.0.1 @@ -22,6 +21,8 @@ require ( go.uber.org/zap v1.24.0 ) +require github.com/golang-jwt/jwt/v5 v5.0.0-rc.1 + require ( github.com/andybalholm/brotli v1.0.5 // indirect github.com/beorn7/perks v1.0.1 // indirect @@ -32,11 +33,9 @@ require ( github.com/go-logr/logr v1.2.3 // indirect github.com/go-logr/stdr v1.2.2 // indirect github.com/gofiber/adaptor/v2 v2.1.32 // indirect - github.com/golang-jwt/jwt/v5 v5.0.0-rc.1 // indirect github.com/golang/protobuf v1.5.3 // indirect github.com/google/uuid v1.3.0 // indirect github.com/inconshreveable/mousetrap v1.1.0 // indirect - github.com/json-iterator/go v1.1.12 // indirect github.com/klauspost/compress v1.16.3 // indirect github.com/mattn/go-colorable v0.1.13 // indirect github.com/mattn/go-isatty v0.0.18 // indirect @@ -45,8 +44,6 @@ require ( github.com/mitchellh/copystructure v1.2.0 // indirect github.com/mitchellh/mapstructure v1.5.0 // indirect github.com/mitchellh/reflectwalk v1.0.2 // indirect - github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect - github.com/modern-go/reflect2 v1.0.2 // indirect github.com/philhofer/fwd v1.1.2 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect github.com/prometheus/client_model v0.3.0 // indirect diff --git a/go.sum b/go.sum index 3f8e946a..f2c8ad41 100644 --- a/go.sum +++ b/go.sum @@ -38,12 +38,9 @@ github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751/go.mod h1:LOuy github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= github.com/alecthomas/units v0.0.0-20190717042225-c3de453c63f4/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= github.com/alecthomas/units v0.0.0-20190924025748-f65c72e2690d/go.mod h1:rBZYJk541a8SKzHPHnH3zbiI+7dagKZ0cgpgrD7Fyho= -github.com/andybalholm/brotli v1.0.4 h1:V7DdXeJtZscaqfNuAdSRuRFzuiKlHSC/Zh3zl9qY3JY= github.com/andybalholm/brotli v1.0.4/go.mod h1:fO7iG3H7G2nSZ7m0zPUDn85XEX2GTukHGRSepvi9Eig= github.com/andybalholm/brotli v1.0.5 h1:8uQZIdzKmjc/iuPu7O2ioW48L81FgatrcpfFmiq/cCs= github.com/andybalholm/brotli v1.0.5/go.mod h1:fO7iG3H7G2nSZ7m0zPUDn85XEX2GTukHGRSepvi9Eig= -github.com/ansrivas/fiberprometheus/v2 v2.4.0 h1:oUCcrLFaoXgbWOqdg7GoKESO9aDwbkdGBHVtGEhraTo= -github.com/ansrivas/fiberprometheus/v2 v2.4.0/go.mod h1:lArdP4S+TlsxQw1vgO8ZkteUVQ9fYyKgXVdycuu0L3g= github.com/ansrivas/fiberprometheus/v2 v2.6.0 h1:QUaaKxil/N5IM1R19k6jsmFEJMfa4O3qtnDkiF+zxUc= github.com/ansrivas/fiberprometheus/v2 v2.6.0/go.mod h1:hivZjKkqX04PPbMZNi9iGB0AQ90iN6RmKERiX1TdgTA= github.com/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kdvxnR2qWY= @@ -61,9 +58,7 @@ github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.3.2/go.mod h1:72H github.com/aws/aws-sdk-go-v2/service/sso v1.4.2/go.mod h1:NBvT9R1MEF+Ud6ApJKM0G+IkPchKS7p7c2YPKwHmBOk= github.com/aws/aws-sdk-go-v2/service/sts v1.7.2/go.mod h1:8EzeIqfWt2wWT4rJVu3f21TfrhJ8AEMzVybRNSb/b4g= github.com/aws/smithy-go v1.8.0/go.mod h1:SObp3lf9smib00L/v3U2eAKG8FyQ7iLrJnQiAmR5n+E= -github.com/benbjohnson/clock v1.1.0/go.mod h1:J11/hYXuz8f4ySSvYwY0FKfm+ezbsZBKZxNJlLklBHA= github.com/benbjohnson/clock v1.3.0 h1:ip6w0uFQkncKQ979AypyG0ER7mqUSBdKLOgAle/AT8A= -github.com/benbjohnson/clock v1.3.0/go.mod h1:J11/hYXuz8f4ySSvYwY0FKfm+ezbsZBKZxNJlLklBHA= github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q= github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8= github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= @@ -71,7 +66,6 @@ github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6r github.com/bgentry/speakeasy v0.1.0/go.mod h1:+zsyZBPWlz7T6j88CTgSN5bM796AkVf0kBD4zp0CCIs= github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= -github.com/cespare/xxhash/v2 v2.1.2 h1:YRXhKfTDauu4ajMg1TPgFO5jnlC2HCbmLXMcTG5cbYE= github.com/cespare/xxhash/v2 v2.1.2/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= github.com/cespare/xxhash/v2 v2.2.0 h1:DC2CZ1Ep5Y4k3ZQ899DldepgrayRUGE6BBZ/cd9Cj44= github.com/cespare/xxhash/v2 v2.2.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= @@ -84,7 +78,6 @@ github.com/cncf/udpa/go v0.0.0-20201120205902-5459f2c99403/go.mod h1:WmhPx2Nbnht github.com/coreos/go-semver v0.3.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk= github.com/coreos/go-systemd/v22 v22.3.2/go.mod h1:Y58oyj3AT4RCenI/lSvhwexgC+NSVTIJ3seZv2GcEnc= github.com/cpuguy83/go-md2man/v2 v2.0.2/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= -github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= @@ -99,8 +92,6 @@ github.com/fatih/color v1.9.0/go.mod h1:eQcE1qtQxscV5RaZvpXrrb8Drkc3/DdQ+uUYCNjL github.com/fatih/structs v1.1.0 h1:Q7juDM0QtcnhCpeyLGQKyg4TOIghuNXrkL32pHAUMxo= github.com/fatih/structs v1.1.0/go.mod h1:9NiDSp5zOcgEDl+j00MP/WkGVPOlPRLejGD8Ga6PJ7M= github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ= -github.com/fsnotify/fsnotify v1.5.4 h1:jRbGcIw6P2Meqdwuo0H1p6JVLbL5DHKAKlYndzMwVZI= -github.com/fsnotify/fsnotify v1.5.4/go.mod h1:OVB6XrOHzAwXMpEM7uPOzcehqUV2UqJxmVXmkdnm1bU= github.com/fsnotify/fsnotify v1.6.0 h1:n+5WquG0fcWoWp6xPWfHdbskMCQaFnG6PfBrh1Ky4HY= github.com/fsnotify/fsnotify v1.6.0/go.mod h1:sl3t1tCWJFWoRz9R8WJCbQihKKwmorjAbSClcnxKAGw= github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= @@ -124,32 +115,17 @@ github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= github.com/go-test/deep v1.0.2-0.20181118220953-042da051cf31/go.mod h1:wGDj63lr65AM2AQyKZd/NYHGb0R+1RLqB8NKt3aSFNA= github.com/godbus/dbus/v5 v5.0.4/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA= -github.com/gofiber/adaptor/v2 v2.1.23/go.mod h1:hnYEQBPF2x1JaBHygutJJF5d0+J2eYnKKsUMCSsfxKk= -github.com/gofiber/adaptor/v2 v2.1.25 h1:K2Ef2a7mUsCfL/oJdzbjyMXchGYuUUwIVXrYVm+P+xs= -github.com/gofiber/adaptor/v2 v2.1.25/go.mod h1:gOxtwMVqUStB5goAYtKd+hSvGupdd+aRIafZHPLNaUk= github.com/gofiber/adaptor/v2 v2.1.31/go.mod h1:vdSG9JhOhOLYjE4j14fx6sJvLJNFVf9o6rSyB5GkU4s= github.com/gofiber/adaptor/v2 v2.1.32 h1:94cL79U4ekq78TmqfXPrulMWkpfPxqzHimUc/B+jmkY= github.com/gofiber/adaptor/v2 v2.1.32/go.mod h1:aX4qfSo+1AJYIWnLL1Mx3EQ6znC6WW46MqFQruUQE6c= -github.com/gofiber/contrib/fiberzap v0.0.0-20220822164234-32bc232b53bd h1:GOgvE+/XmCHmTV4s54l4Xons8jwbYkdluVy5Sng1sNU= -github.com/gofiber/contrib/fiberzap v0.0.0-20220822164234-32bc232b53bd/go.mod h1:et6yk+/rccV7HhnGdJbU2spMOvfK+wXZUoaubUkL0nQ= github.com/gofiber/contrib/fiberzap v1.0.2 h1:EQwhggtszVfIdBeXxN9Xrmld71es34Ufs+ef8VMqZxc= github.com/gofiber/contrib/fiberzap v1.0.2/go.mod h1:jGO8BHU4gRI9U0JtM6zj2CIhYfgVmW5JxziN8NTgVwE= -github.com/gofiber/fiber/v2 v2.32.0/go.mod h1:CMy5ZLiXkn6qwthrl03YMyW1NLfj0rhxz2LKl4t7ZTY= -github.com/gofiber/fiber/v2 v2.33.0/go.mod h1:CMy5ZLiXkn6qwthrl03YMyW1NLfj0rhxz2LKl4t7ZTY= -github.com/gofiber/fiber/v2 v2.36.0 h1:1qLMe5rhXFLPa2SjK10Wz7WFgLwYi4TYg7XrjztJHqA= -github.com/gofiber/fiber/v2 v2.36.0/go.mod h1:tgCr+lierLwLoVHHO/jn3Niannv34WRkQETU8wiL9fQ= github.com/gofiber/fiber/v2 v2.41.0/go.mod h1:RdebcCuCRFp4W6hr3968/XxwJVg0K+jr9/Ae0PFzZ0Q= -github.com/gofiber/fiber/v2 v2.42.0 h1:Fnp7ybWvS+sjNQsFvkhf4G8OhXswvB6Vee8hM/LyS+8= github.com/gofiber/fiber/v2 v2.42.0/go.mod h1:3+SGNjqMh5VQH5Vz2Wdi43zTIV16ktlFd3x3R6O1Zlc= github.com/gofiber/fiber/v2 v2.43.0 h1:yit3E4kHf178B60p5CQBa/3v+WVuziWMa/G2ZNyLJB0= github.com/gofiber/fiber/v2 v2.43.0/go.mod h1:mpS1ZNE5jU+u+BA4FbM+KKnUzJ4wzTK+FT2tG3tU+6I= -github.com/gofiber/utils v0.1.2/go.mod h1:pacRFtghAE3UoknMOUiXh2Io/nLWSUHtQCi/3QASsOc= github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q= -github.com/golang-jwt/jwt/v4 v4.4.2 h1:rcc4lwaZgFMCZ5jxF9ABolDcIHdBytAFgqFPbSJQAYs= -github.com/golang-jwt/jwt/v4 v4.4.2/go.mod h1:m21LjoU+eqJr34lmDMbreY2eSTRJ1cv77w39/MY0Ch0= -github.com/golang-jwt/jwt/v4 v4.5.0 h1:7cYmW1XlMY7h7ii7UhUyChSgS5wUJEnm9uZVTGqOWzg= -github.com/golang-jwt/jwt/v4 v4.5.0/go.mod h1:m21LjoU+eqJr34lmDMbreY2eSTRJ1cv77w39/MY0Ch0= github.com/golang-jwt/jwt/v5 v5.0.0-rc.1 h1:tDQ1LjKga657layZ4JLsRdxgvupebc0xuPwRNuTfUgs= github.com/golang-jwt/jwt/v5 v5.0.0-rc.1/go.mod h1:pqrtFR0X4osieyHYxtmOUWsAWrfe1Q5UVIyoH402zdk= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= @@ -178,7 +154,6 @@ github.com/golang/protobuf v1.4.1/go.mod h1:U8fpvMrcmy5pZrNK1lt4xCsGvpyWQ/VVv6QD github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= github.com/golang/protobuf v1.4.3/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= -github.com/golang/protobuf v1.5.2 h1:ROPKBNFfQgOUMifHyP+KYbvpjbdoFNs+aK7DXlji0Tw= github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= github.com/golang/protobuf v1.5.3 h1:KhyjKVUg7Usr/dYsdSqoFveMYd5ko72D+zANwlG1mmg= github.com/golang/protobuf v1.5.3/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= @@ -196,8 +171,8 @@ github.com/google/go-cmp v0.5.4/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/ github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.6/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.7/go.mod h1:n+brtR0CgQNWTVd5ZUFpTBC8YFBDLK/h/bpaJ8/DtOE= -github.com/google/go-cmp v0.5.8 h1:e6P7q2lk1O+qJJb4BtCQXlK8vWEO8V1ZeuEdJNOqZyg= github.com/google/go-cmp v0.5.8/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= +github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38= github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs= github.com/google/martian/v3 v3.0.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0= @@ -253,8 +228,6 @@ github.com/hashicorp/yamux v0.0.0-20181012175058-2f1d1f20f75d/go.mod h1:+NfK9FKe github.com/hjson/hjson-go/v4 v4.0.0 h1:wlm6IYYqHjOdXH1gHev4VoXCaW20HdQAGCxdOEEg2cs= github.com/hjson/hjson-go/v4 v4.0.0/go.mod h1:KaYt3bTw3zhBjYqnXkYywcYctk0A2nxeEFTse3rH13E= github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= -github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8= -github.com/inconshreveable/mousetrap v1.0.1 h1:U3uMjPSQEBMNp1lFxmllqCPM6P5u/Xq7Pgzkat/bFNc= github.com/inconshreveable/mousetrap v1.0.1/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw= github.com/inconshreveable/mousetrap v1.1.0 h1:wN+x4NVGpMsO7ErUn/mUI3vEoE6Jt13X2s0bqwp9tc8= github.com/inconshreveable/mousetrap v1.1.0/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw= @@ -266,7 +239,6 @@ github.com/jpillora/backoff v1.0.0/go.mod h1:J/6gKK9jxlEcS3zixgDgUAsiuZ7yrSoa/FX github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= github.com/json-iterator/go v1.1.10/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= github.com/json-iterator/go v1.1.11/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= -github.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnrnM= github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo= github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU= github.com/jstemmer/go-junit-report v0.9.1/go.mod h1:Brl9GWCQeLvo8nXZwPNNblvFj/XSXhF0NWZEnDohbsk= @@ -274,15 +246,9 @@ github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7V github.com/julienschmidt/httprouter v1.3.0/go.mod h1:JR6WtHb+2LUe8TCKY3cZOxFyyO8IZAc4RVcycCCAKdM= github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8= github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= -github.com/klauspost/compress v1.15.0/go.mod h1:/3/Vjq9QcHkK5uEr5lBEmyoZ1iFhe47etQ6QUkpK6sk= -github.com/klauspost/compress v1.15.9 h1:wKRjX6JRtDdrE9qwa4b/Cip7ACOshUI4smpCQanqjSY= github.com/klauspost/compress v1.15.9/go.mod h1:PhcZ0MbTNciWF3rruxRgKxI5NkcHHrHUDtV4Yw2GlzU= -github.com/klauspost/compress v1.15.15 h1:EF27CXIuDsYJ6mmvtBRlEuB2UVOqHG1tAXgZ7yIO+lw= -github.com/klauspost/compress v1.15.15/go.mod h1:ZcK2JAFqKOpnBlxcLsJzYfrS9X1akm9fHZNnD9+Vo/4= github.com/klauspost/compress v1.16.3 h1:XuJt9zzcnaz6a16/OU53ZjWp/v7/42WcR5t2a0PcNQY= github.com/klauspost/compress v1.16.3/go.mod h1:ntbaceVETuRiXiv4DpjP66DpAtAGkEQskQzEyD//IeE= -github.com/knadh/koanf v1.4.3 h1:rSJcSH5LSFhvzBRsAYfT3k7eLP0I4UxeZqjtAatk+wc= -github.com/knadh/koanf v1.4.3/go.mod h1:5FAkuykKXZvLqhAbP4peWgM5CTcZmn7L1d27k/a+kfg= github.com/knadh/koanf v1.5.0 h1:q2TSd/3Pyc/5yP9ldIrSdIz26MCcyNQzW0pEAugLPNs= github.com/knadh/koanf v1.5.0/go.mod h1:Hgyjp4y8v44hpZtPzs7JZfRAW5AhN7KfZcwv1RYggDs= github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= @@ -291,14 +257,9 @@ github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFB github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= github.com/kr/pretty v0.2.0 h1:s5hAObm+yFO5uHYt5dYjxi2rXrsnmRpJx4OYvIWUaQs= github.com/kr/pretty v0.2.0/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= -github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= -github.com/kr/pretty v0.3.0 h1:WgNl7dwNpEZ6jJ9k1snq4pZsg7DOEN8hP9Xw0Tsjwk0= -github.com/kr/pretty v0.3.0/go.mod h1:640gp4NfQd8pI5XOwp5fnNeVWj67G7CFk/SaSQn7NBk= github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= -github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= -github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU= github.com/mattn/go-colorable v0.1.4/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE= github.com/mattn/go-colorable v0.1.6/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= @@ -310,13 +271,11 @@ github.com/mattn/go-isatty v0.0.10/go.mod h1:qgIWMr58cqv1PHHyhnkY9lrL7etaEgOFcME github.com/mattn/go-isatty v0.0.11/go.mod h1:PhnuNfih5lzO57/f3n+odYbM4JtupLOxQOAqxQCu2WE= github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU= github.com/mattn/go-isatty v0.0.16/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM= -github.com/mattn/go-isatty v0.0.17 h1:BTarxUcIeDqL27Mc+vyvdWYSL28zpIhv3RoTdsLMPng= github.com/mattn/go-isatty v0.0.17/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM= github.com/mattn/go-isatty v0.0.18 h1:DOKFKCQ7FNG2L1rbrmstDN4QVRdS89Nkh85u68Uwp98= github.com/mattn/go-isatty v0.0.18/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y= github.com/mattn/go-runewidth v0.0.14 h1:+xnbZSEeDbOIg5/mE6JF0w6n9duR1l3/WmbinWVwUuU= github.com/mattn/go-runewidth v0.0.14/go.mod h1:Jdepj2loyihRzMpdS35Xk/zdY8IAYHsh153qUoGf23w= -github.com/matttproud/golang_protobuf_extensions v1.0.1 h1:4hp9jkHxhMHkqkrB3Ix0jegS5sx/RkqARlsWZ6pIwiU= github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= github.com/matttproud/golang_protobuf_extensions v1.0.4 h1:mmDVorXM7PCGKw94cs5zkfA9PSy5pEvNWRP0ET0TIVo= github.com/matttproud/golang_protobuf_extensions v1.0.4/go.mod h1:BSXmuO+STAnVfrANrmjBb36TMTDstsz7MSK+HVaYKv4= @@ -339,11 +298,9 @@ github.com/mitchellh/reflectwalk v1.0.0/go.mod h1:mSTlrgnPZtwu0c4WaC2kGObEpuNDbx github.com/mitchellh/reflectwalk v1.0.2 h1:G2LzWKi524PWgd3mLHV8Y5k7s6XUvT0Gef6zxSIeXaQ= github.com/mitchellh/reflectwalk v1.0.2/go.mod h1:mSTlrgnPZtwu0c4WaC2kGObEpuNDbx0jmZXqmk4esnw= github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= -github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w8PVh93nsPXa1VrQ6jlwL5oN8l14QlcNfg= github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= -github.com/modern-go/reflect2 v1.0.2 h1:xBagoLtFs94CBntxluKeaWgTMpvLxC4ur3nMaC9Gz0M= github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk= github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= @@ -357,7 +314,6 @@ github.com/philhofer/fwd v1.1.1/go.mod h1:gk3iGcWd9+svBvR0sR+KPcfE+RNWozjowpeBVG github.com/philhofer/fwd v1.1.2 h1:bnDivRJ1EWPjUIRXV5KfORO897HTbpFAQddBdE8t7Gw= github.com/philhofer/fwd v1.1.2/go.mod h1:qkPdfjR2SIEbspLqpe1tO4n5yICnr2DY7mqEx2tUTP0= github.com/pierrec/lz4 v2.0.5+incompatible/go.mod h1:pdkljMzZIN41W+lC3N2tnIh5sFi+IEE17M5jbnwPHcY= -github.com/pkg/diff v0.0.0-20210226163009-20ebb0f2a09e/go.mod h1:pJLUxLENpZxwdsKMEsNbx1VGcRFpLqf3715MtcvvzbA= github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= @@ -373,15 +329,11 @@ github.com/prometheus/client_golang v1.7.1/go.mod h1:PY5Wy2awLA44sXw4AOSfFBetzPP github.com/prometheus/client_golang v1.11.0/go.mod h1:Z6t4BnS23TR94PD6BsDNk8yVqroYurpAkEiz0P2BEV0= github.com/prometheus/client_golang v1.11.1/go.mod h1:Z6t4BnS23TR94PD6BsDNk8yVqroYurpAkEiz0P2BEV0= github.com/prometheus/client_golang v1.12.1/go.mod h1:3Z9XVyYiZYEO+YQWt3RD2R3jrbd179Rt297l4aS6nDY= -github.com/prometheus/client_golang v1.12.2/go.mod h1:3Z9XVyYiZYEO+YQWt3RD2R3jrbd179Rt297l4aS6nDY= -github.com/prometheus/client_golang v1.13.0 h1:b71QUfeo5M8gq2+evJdTPfZhYMAU0uKPkyPJ7TPsloU= -github.com/prometheus/client_golang v1.13.0/go.mod h1:vTeo+zgvILHsnnj/39Ou/1fPN5nJFOEMgftOUOmlvYQ= github.com/prometheus/client_golang v1.14.0 h1:nJdhIvne2eSX/XRAFV9PcvFFRbrjbcTUj0VP62TMhnw= github.com/prometheus/client_golang v1.14.0/go.mod h1:8vpkKitgIVNcqrRBWh1C4TIUQgYNtG/XQE4E/Zae36Y= github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= -github.com/prometheus/client_model v0.2.0 h1:uq5h0d+GuxiXLJLNABMgp2qUWDPiLvgCzz2dUR+/W/M= github.com/prometheus/client_model v0.2.0/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/client_model v0.3.0 h1:UBgGFHqYdG/TPFD1B1ogZywDqEkwp3fBMvqdiQ7Xew4= github.com/prometheus/client_model v0.3.0/go.mod h1:LDGWKZIo7rky3hgvBe+caln+Dr3dPggB5dvjtD7w9+w= @@ -389,10 +341,7 @@ github.com/prometheus/common v0.4.1/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y8 github.com/prometheus/common v0.10.0/go.mod h1:Tlit/dnDKsSWFlCLTWaA1cyBgKHSMdTB80sz/V91rCo= github.com/prometheus/common v0.26.0/go.mod h1:M7rCNAaPfAosfx8veZJCuw84e35h3Cfd9VFqTh1DIvc= github.com/prometheus/common v0.32.1/go.mod h1:vu+V0TpY+O6vW9J44gczi3Ap/oXXR10b+M/gUGO4Hls= -github.com/prometheus/common v0.37.0 h1:ccBbHCgIiT9uSoFY0vX8H3zsNR5eLt17/RQLUvn8pXE= github.com/prometheus/common v0.37.0/go.mod h1:phzohg0JFMnBEFGxTDbfu3QyL5GI8gTQJFhYO5B3mfA= -github.com/prometheus/common v0.40.0 h1:Afz7EVRqGg2Mqqf4JuF9vdvp1pi220m55Pi9T2JnO4Q= -github.com/prometheus/common v0.40.0/go.mod h1:L65ZJPSmfn/UBWLQIHV7dBrKFidB/wPlF1y5TlSt9OE= github.com/prometheus/common v0.42.0 h1:EKsfXEYo4JpWMHH5cg+KOUWeuJSov1Id8zGR8eeI1YM= github.com/prometheus/common v0.42.0/go.mod h1:xBwqVerjNdUDjgODMpudtOMwlOwf2SaTr1yjz4b7Zbc= github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= @@ -400,7 +349,6 @@ github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsT github.com/prometheus/procfs v0.1.3/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU= github.com/prometheus/procfs v0.6.0/go.mod h1:cz+aTbrPOrUb4q7XlbU9ygM+/jj0fzG6c1xBZuNvfVA= github.com/prometheus/procfs v0.7.3/go.mod h1:cz+aTbrPOrUb4q7XlbU9ygM+/jj0fzG6c1xBZuNvfVA= -github.com/prometheus/procfs v0.8.0 h1:ODq8ZFEaYeCaZOJlZZdJA2AbQR98dSHSM1KW/You5mo= github.com/prometheus/procfs v0.8.0/go.mod h1:z7EfXMXOkbkqb9IINtpCn86r/to3BnA0uaxHdg830/4= github.com/prometheus/procfs v0.9.0 h1:wzCHvIvM5SxWqYvwgVL7yJY8Lz3PKn49KQtpgMYJfhI= github.com/prometheus/procfs v0.9.0/go.mod h1:+pB4zwohETzFnmlpe6yd2lSc+0/46IYZRB/chUwxUZY= @@ -409,11 +357,7 @@ github.com/rivo/uniseg v0.2.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJ github.com/rivo/uniseg v0.4.4 h1:8TfxU8dW6PdqD27gjM8MVNuicgxIjxpm4K7x4jp8sis= github.com/rivo/uniseg v0.4.4/go.mod h1:FN3SvrM+Zdj16jyLfmOkMNblXMcoc8DfTHruCPUcx88= github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6LYCDYWNEvQ= -github.com/rogpeppe/go-internal v1.3.0 h1:RR9dF3JtopPvtkroDZuVD7qquD0bnHlKSqaQhgwt8yk= github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= -github.com/rogpeppe/go-internal v1.6.1/go.mod h1:xXDCJY+GAPziupqXw64V24skbSoqbTEfhy4qGm1nDQc= -github.com/rogpeppe/go-internal v1.8.1 h1:geMPLpDpQOgVyCg5z5GoRwLHepNdb71NXb67XFkP+Eg= -github.com/rogpeppe/go-internal v1.8.1/go.mod h1:JeRgkft04UBgHMgCIwADu4Pn6Mtm5d4nPKWu0nJ5d+o= github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= github.com/ryanuber/columnize v0.0.0-20160712163229-9b3edd62028f/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts= github.com/ryanuber/columnize v2.1.0+incompatible/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts= @@ -429,15 +373,12 @@ github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6Mwd github.com/sirupsen/logrus v1.6.0/go.mod h1:7uNnSEd1DgxDLC74fIahvMZmmYsHGZGEOFrfsX/uA88= github.com/speps/go-hashids/v2 v2.0.1 h1:ViWOEqWES/pdOSq+C1SLVa8/Tnsd52XC34RY7lt7m4g= github.com/speps/go-hashids/v2 v2.0.1/go.mod h1:47LKunwvDZki/uRVD6NImtyk712yFzIs3UF3KlHohGw= -github.com/spf13/cobra v1.5.0 h1:X+jTBEBqF0bHN+9cSMgmfuvv2VHJ9ezmFNf9Y/XstYU= -github.com/spf13/cobra v1.5.0/go.mod h1:dWXEIy2H428czQCjInthrTRUg7yKbok+2Qi/yBIJoUM= github.com/spf13/cobra v1.6.1 h1:o94oiPyS4KD1mPy2fmcYYHHfCxLqYjJOhGsCHFZtEzA= github.com/spf13/cobra v1.6.1/go.mod h1:IOw/AERYS7UzyrGinqmz6HLUo219MORXGxhbaJUqzrY= github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA= github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= -github.com/stretchr/objx v0.4.0 h1:M2gUjqZET1qApGOWNSnZ49BAIMX4F/1plDv3+l31EJ4= github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw= github.com/stretchr/objx v0.5.0 h1:1zr/of2m5FGMsad5YfcqgdqdWrIhu+EBEJRhR1U7z/c= github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo= @@ -447,13 +388,9 @@ github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81P github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA= 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= -github.com/stretchr/testify v1.8.0 h1:pSgiaMZlXftHpm5L7V1+rVB+AZJydKsMxsQBIJw4PKk= github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= -github.com/stretchr/testify v1.8.1 h1:w7B6lhMri9wdJUVmEZPGGhZzrYTPvgJArz7wNPgYKsk= -github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= +github.com/stretchr/testify v1.8.2 h1:+h33VjcLVPDHtOdpUCuF+7gSuG3yGIftsP1YvFihtJ8= github.com/stretchr/testify v1.8.2/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= -github.com/tidwall/pretty v1.2.0 h1:RWIZEg2iJ8/g6fDDYzMpobmaoGh5OLl4AXtGUGPcqCs= -github.com/tidwall/pretty v1.2.0/go.mod h1:ITEVvHYasfjBbM0u2Pg8T2nJnzm8xPwvNhhsoaGGjNU= github.com/tidwall/pretty v1.2.1 h1:qjsOFOWWQl+N3RsoF5/ssm1pHmJJwhjlSbZ51I6wMl4= github.com/tidwall/pretty v1.2.1/go.mod h1:ITEVvHYasfjBbM0u2Pg8T2nJnzm8xPwvNhhsoaGGjNU= github.com/tinylib/msgp v1.1.6/go.mod h1:75BAfg2hauQhs3qedfdDZmWAPcFMAvJE5b9rGOMufyw= @@ -461,12 +398,7 @@ github.com/tinylib/msgp v1.1.8 h1:FCXC1xanKO4I8plpHGH2P7koL/RzZs12l/+r7vakfm0= github.com/tinylib/msgp v1.1.8/go.mod h1:qkpG+2ldGg4xRFmx+jfTvZPxfGFhi64BcnL9vkCm/Tw= github.com/valyala/bytebufferpool v1.0.0 h1:GqA5TC/0021Y/b9FG4Oi9Mr3q7XYx6KllzawFIhcdPw= github.com/valyala/bytebufferpool v1.0.0/go.mod h1:6bBcMArwyJ5K/AmCkWv1jt77kVWyCJ6HpOuEn7z0Csc= -github.com/valyala/fasthttp v1.35.0/go.mod h1:t/G+3rLek+CyY9bnIE+YlMRddxVAAGjhxndDB4i4C0I= -github.com/valyala/fasthttp v1.38.0/go.mod h1:t/G+3rLek+CyY9bnIE+YlMRddxVAAGjhxndDB4i4C0I= -github.com/valyala/fasthttp v1.39.0 h1:lW8mGeM7yydOqZKmwyMTaz/PH/A+CLgtmmcjv+OORfU= -github.com/valyala/fasthttp v1.39.0/go.mod h1:t/G+3rLek+CyY9bnIE+YlMRddxVAAGjhxndDB4i4C0I= github.com/valyala/fasthttp v1.43.0/go.mod h1:f6VbjjoI3z1NDOZOv17o6RvtRSWxC77seBFc2uWtgiY= -github.com/valyala/fasthttp v1.44.0 h1:R+gLUhldIsfg1HokMuQjdQ5bh9nuXHPIfvkYUu9eR5Q= github.com/valyala/fasthttp v1.44.0/go.mod h1:f6VbjjoI3z1NDOZOv17o6RvtRSWxC77seBFc2uWtgiY= github.com/valyala/fasthttp v1.45.0 h1:zPkkzpIn8tdHZUrVa6PzYd0i5verqiPSkgTd3bSUcpA= github.com/valyala/fasthttp v1.45.0/go.mod h1:k2zXd82h/7UZc3VOdJ2WaUqt1uZ/XpXAfE9i+HBC3lA= @@ -477,7 +409,6 @@ github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9de github.com/yuin/goldmark v1.1.32/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.3.5/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= -github.com/yuin/goldmark v1.4.1/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY= go.etcd.io/etcd/api/v3 v3.5.4/go.mod h1:5GB2vv4A4AOn3yk7MftYGHkUfGtDHnEraIjym4dYz5A= go.etcd.io/etcd/client/pkg/v3 v3.5.4/go.mod h1:IJHfcCEKxYu1Os13ZdwCwIUTUVGYTSAM3YSwc9/Ac1g= @@ -487,53 +418,24 @@ go.opencensus.io v0.22.0/go.mod h1:+kGneAE2xo2IficOXnaByMWTGM9T73dGwxeWcUqIpI8= go.opencensus.io v0.22.2/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= go.opencensus.io v0.22.3/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= go.opencensus.io v0.22.4/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= -go.opentelemetry.io/otel v1.9.0 h1:8WZNQFIB2a71LnANS9JeyidJKKGOOremcUtb/OtHISw= -go.opentelemetry.io/otel v1.9.0/go.mod h1:np4EoPGzoPs3O67xUVNoPPcmSvsfOxNlNA4F4AC+0Eo= -go.opentelemetry.io/otel v1.13.0 h1:1ZAKnNQKwBBxFtww/GwxNUyTf0AxkZzrukO8MeXqe4Y= -go.opentelemetry.io/otel v1.13.0/go.mod h1:FH3RtdZCzRkJYFTCsAKDy9l/XYjMdNv6QrkFFB8DvVg= go.opentelemetry.io/otel v1.14.0 h1:/79Huy8wbf5DnIPhemGB+zEPVwnN6fuQybr/SRXa6hM= go.opentelemetry.io/otel v1.14.0/go.mod h1:o4buv+dJzx8rohcUeRmWUZhqupFvzWis188WlggnNeU= -go.opentelemetry.io/otel/exporters/jaeger v1.9.0 h1:gAEgEVGDWwFjcis9jJTOJqZNxDzoZfR12WNIxr7g9Ww= -go.opentelemetry.io/otel/exporters/jaeger v1.9.0/go.mod h1:hquezOLVAybNW6vanIxkdLXTXvzlj2Vn3wevSP15RYs= -go.opentelemetry.io/otel/exporters/jaeger v1.13.0 h1:VAMoGujbVV8Q0JNM/cEbhzUIWWBxnEqH45HP9iBKN04= -go.opentelemetry.io/otel/exporters/jaeger v1.13.0/go.mod h1:fHwbmle6mBFJA1p2ZIhilvffCdq/dM5UTIiCOmEjS+w= go.opentelemetry.io/otel/exporters/jaeger v1.14.0 h1:CjbUNd4iN2hHmWekmOqZ+zSCU+dzZppG8XsV+A3oc8Q= go.opentelemetry.io/otel/exporters/jaeger v1.14.0/go.mod h1:4Ay9kk5vELRrbg5z4cpP9EtmQRFap2Wb0woPG4lujZA= -go.opentelemetry.io/otel/sdk v1.9.0 h1:LNXp1vrr83fNXTHgU8eO89mhzxb/bbWAsHG6fNf3qWo= -go.opentelemetry.io/otel/sdk v1.9.0/go.mod h1:AEZc8nt5bd2F7BC24J5R0mrjYnpEgYHyTcM/vrSple4= -go.opentelemetry.io/otel/sdk v1.13.0 h1:BHib5g8MvdqS65yo2vV1s6Le42Hm6rrw08qU6yz5JaM= -go.opentelemetry.io/otel/sdk v1.13.0/go.mod h1:YLKPx5+6Vx/o1TCUYYs+bpymtkmazOMT6zoRrC7AQ7I= go.opentelemetry.io/otel/sdk v1.14.0 h1:PDCppFRDq8A1jL9v6KMI6dYesaq+DFcDZvjsoGvxGzY= go.opentelemetry.io/otel/sdk v1.14.0/go.mod h1:bwIC5TjrNG6QDCHNWvW4HLHtUQ4I+VQDsnjhvyZCALM= -go.opentelemetry.io/otel/trace v1.9.0 h1:oZaCNJUjWcg60VXWee8lJKlqhPbXAPB51URuR47pQYc= -go.opentelemetry.io/otel/trace v1.9.0/go.mod h1:2737Q0MuG8q1uILYm2YYVkAyLtOofiTNGg6VODnOiPo= -go.opentelemetry.io/otel/trace v1.13.0 h1:CBgRZ6ntv+Amuj1jDsMhZtlAPT6gbyIRdaIzFhfBSdY= -go.opentelemetry.io/otel/trace v1.13.0/go.mod h1:muCvmmO9KKpvuXSf3KKAXXB2ygNYHQ+ZfI5X08d3tds= go.opentelemetry.io/otel/trace v1.14.0 h1:wp2Mmvj41tDsyAJXiWDWpfNsOiIyd38fy85pyKcFq/M= go.opentelemetry.io/otel/trace v1.14.0/go.mod h1:8avnQLK+CG77yNLUae4ea2JDQ6iT+gozhnZjy/rw9G8= go.uber.org/atomic v1.7.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc= -go.uber.org/atomic v1.9.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc= go.uber.org/atomic v1.10.0 h1:9qC72Qh0+3MqyJbAn8YU5xVq1frD8bn3JtD2oXtafVQ= go.uber.org/atomic v1.10.0/go.mod h1:LUxbIzbOniOlMKjJjyPfpl4v+PKK2cNJn91OQbhoJI0= -go.uber.org/automaxprocs v1.5.1 h1:e1YG66Lrk73dn4qhg8WFSvhF0JuFQF0ERIp4rpuV8Qk= -go.uber.org/automaxprocs v1.5.1/go.mod h1:BF4eumQw0P9GtnuxxovUd06vwm1o18oMzFtK66vU6XU= go.uber.org/automaxprocs v1.5.2 h1:2LxUOGiR3O6tw8ui5sZa2LAaHnsviZdVOUZw4fvbnME= go.uber.org/automaxprocs v1.5.2/go.mod h1:eRbA25aqJrxAbsLO0xy5jVwPt7FQnRgjW+efnwa1WM0= -go.uber.org/goleak v1.1.11/go.mod h1:cwTWslyiVhfpKIDGSZEM2HlOvcqm+tG4zioyIeLoqMQ= go.uber.org/goleak v1.1.12 h1:gZAh5/EyT/HQwlpkCy6wTpqfH9H8Lz8zbm3dZh+OyzA= -go.uber.org/goleak v1.1.12/go.mod h1:cwTWslyiVhfpKIDGSZEM2HlOvcqm+tG4zioyIeLoqMQ= go.uber.org/multierr v1.6.0/go.mod h1:cdWPpRnG4AhwMwsgIHip0KRBQjJy5kYEpYjJxpXp9iU= -go.uber.org/multierr v1.7.0/go.mod h1:7EAYxJLBy9rStEaz58O2t4Uvip6FSURkq8/ppBp95ak= -go.uber.org/multierr v1.8.0 h1:dg6GjLku4EH+249NNmoIciG9N/jURbDG+pFlTkhzIC8= -go.uber.org/multierr v1.8.0/go.mod h1:7EAYxJLBy9rStEaz58O2t4Uvip6FSURkq8/ppBp95ak= -go.uber.org/multierr v1.9.0 h1:7fIwc/ZtS0q++VgcfqFDxSBZVv/Xo49/SYnDFupUwlI= -go.uber.org/multierr v1.9.0/go.mod h1:X2jQV1h+kxSjClGpnseKVIxpmcjrj7MNnI0bnlfKTVQ= go.uber.org/multierr v1.10.0 h1:S0h4aNzvfcFsC3dRF1jLoaov7oRaKqRGC/pUEJ2yvPQ= go.uber.org/multierr v1.10.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y= go.uber.org/zap v1.17.0/go.mod h1:MXVU+bhUf/A7Xi2HNOnopQOrmycQ5Ih87HtOu4q5SSo= -go.uber.org/zap v1.21.0/go.mod h1:wjWOCqI0f2ZZrJF/UufIOkiC8ii6tm1iqIsLo76RfJw= -go.uber.org/zap v1.23.0 h1:OjGQ5KQDEUawVHxNwQgPpiypGHOxo2mNZsOqTak4fFY= -go.uber.org/zap v1.23.0/go.mod h1:D+nX8jyLsMHMYrln8A0rJjFt/T/9/bGgIhAqxv5URuY= go.uber.org/zap v1.24.0 h1:FiJd5l1UOLj0wCgbSE0rwwXHzEdAZS6hiiSnxJN/D60= go.uber.org/zap v1.24.0/go.mod h1:2kMP+WWQ8aoFoedH3T2sq6iJ2yDWpHbP0f6MQbS9Gkg= golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= @@ -577,7 +479,6 @@ golang.org/x/mod v0.1.1-0.20191107180719-034126e5016b/go.mod h1:QqPTAvyqsEbceGzB golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= -golang.org/x/mod v0.5.1/go.mod h1:5OXOZSfqPIIbmVBIIKWRFfZjPR0E5r58TLhUjH0a2Ro= golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= golang.org/x/mod v0.7.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= @@ -614,7 +515,6 @@ golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM= golang.org/x/net v0.0.0-20210410081132-afb366fc7cd1/go.mod h1:9tjilg8BloeKEkVJvy7fQ90B1CfIiPueXVOjqfkSzI8= golang.org/x/net v0.0.0-20210525063256-abc453219eb5/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= -golang.org/x/net v0.0.0-20211015210444-4f30a5c0130f/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20220127200216-cd36cc0744dd/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= golang.org/x/net v0.0.0-20220225172249-27dd8689420f/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= @@ -694,21 +594,14 @@ golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210603081109-ebe580a85c40/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20211019181941-9d821ace8654/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220114195835-da31bd327af9/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220227234510-4e6760a101f9/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220412211240-33da011f77ad/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220728004956-3c1f35247d10/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220825204002-c680a09ffe64 h1:UiNENfZ8gDvpiWw7IpOMQ27spWmThO1RwwdQVbJahJM= -golang.org/x/sys v0.0.0-20220825204002-c680a09ffe64/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220908164124-27713097b956/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.3.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.5.0 h1:MUK/U/4lj1t1oPg0HfuXDN/Z1wv31ZJ/YcPiGccS4DU= -golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.6.0 h1:MVltZSvRTcU2ljQOhs94SXPftV6DCNnZViHeQps87pQ= golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= @@ -772,8 +665,6 @@ golang.org/x/tools v0.0.0-20200825202427-b303f430e36d/go.mod h1:njjCfa9FT2d7l9Bc golang.org/x/tools v0.0.0-20201022035929-9cf592e881e9/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.1.2/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= -golang.org/x/tools v0.1.5/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= -golang.org/x/tools v0.1.8/go.mod h1:nABZi5QlRsZVlzPpHl034qft6wpY4eDcsTt5AaioBiU= golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= golang.org/x/tools v0.4.0/go.mod h1:UE5sM2OK9E/d67R0ANs2xJizIymRP5gJU295PvKXxjQ= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= @@ -862,7 +753,6 @@ google.golang.org/protobuf v1.24.0/go.mod h1:r/3tXBNzIEhYS9I1OUVjXDlt8tc493IdKGj google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c= google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= -google.golang.org/protobuf v1.28.1 h1:d0NfwRgPtno5B1Wa6L2DAG+KivqkdutMf1UhdNx175w= google.golang.org/protobuf v1.28.1/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= google.golang.org/protobuf v1.30.0 h1:kPPoIgf3TsEvrm0PFe15JQ+570QVxYzEvvHqChK+cng= google.golang.org/protobuf v1.30.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= @@ -872,7 +762,6 @@ gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8 gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= -gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= gopkg.in/square/go-jose.v2 v2.3.1/go.mod h1:M9dMgbHiYLoDGQrXy7OpJDJWiKiU//h+vD76mk0e1AI= gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= @@ -885,7 +774,6 @@ gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -gopkg.in/yaml.v3 v3.0.0/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= diff --git a/internal/authenticator/authenticator.go b/internal/authenticator/authenticator.go index afd15458..aaf0fe66 100644 --- a/internal/authenticator/authenticator.go +++ b/internal/authenticator/authenticator.go @@ -3,7 +3,7 @@ package authenticator import ( "fmt" - "github.com/golang-jwt/jwt/v4" + "github.com/golang-jwt/jwt/v5" "gitlab.snapp.ir/dispatching/soteria/internal/config" "gitlab.snapp.ir/dispatching/soteria/internal/topics" "gitlab.snapp.ir/dispatching/soteria/pkg/acl" diff --git a/internal/authenticator/authenticator_test.go b/internal/authenticator/authenticator_test.go index f2b492ee..ced04faf 100644 --- a/internal/authenticator/authenticator_test.go +++ b/internal/authenticator/authenticator_test.go @@ -7,7 +7,7 @@ import ( "testing" "time" - "github.com/golang-jwt/jwt/v4" + "github.com/golang-jwt/jwt/v5" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/suite" "gitlab.snapp.ir/dispatching/soteria/internal/authenticator" diff --git a/internal/authenticator/key.go b/internal/authenticator/key.go index 4f2b6a78..8345ee5f 100644 --- a/internal/authenticator/key.go +++ b/internal/authenticator/key.go @@ -4,7 +4,7 @@ import ( "encoding/base64" "strings" - "github.com/golang-jwt/jwt/v4" + "github.com/golang-jwt/jwt/v5" "go.uber.org/zap" ) From 581ff6ce98f580754383a04ddcf091ab837367da Mon Sep 17 00:00:00 2001 From: Parham Alvani Date: Wed, 5 Apr 2023 19:24:52 +0330 Subject: [PATCH 364/660] feat: update keys for ode --- deployments/soteria/values.ode.yaml | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/deployments/soteria/values.ode.yaml b/deployments/soteria/values.ode.yaml index 8dcb12af..6f4cfeb2 100644 --- a/deployments/soteria/values.ode.yaml +++ b/deployments/soteria/values.ode.yaml @@ -79,23 +79,23 @@ vendors: keys: 1: |- -----BEGIN PUBLIC KEY----- - MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA1lNRwyNsDieWs6LvHOJ+ - GyehhRC4Pn5yL5edKP3565F3LtRDMrkzwDRsQbqnUtTea9HCdTdBv+lI8vE17qRi - RQn10IMaIH6e4Aa3OWNClFhuqNOag7VmffsjTOgxHgHpfGAKVF/4BwqOHrdHFbAD - VOiWB1hv9Uc0C5laffGAub7fj+EAI02zlrsNDxYW8vyF2H47N7VWcvgd3RhZpxlG - 8bq9phl7Ja55YmQiT2Ic3/K5tsazg5z9lz6OTrx+JvWbefHFlJpjCLz5yefEaRmX - 9L/zyDMi4jgFTZEWNXC2vIrxwZMFwFhBXEp0PcCbuHJgJIucbRrbwukQC16uHJwP - zQIDAQAB + MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA5SeRfOdTyvQZ7N9ahFHl + +J05r7e9fgOQ2cpOtnnsIjAjCt1dF7/NkqVifEaxABRBGG9iXIw//G4hi0TqoKqK + aoSHMGf6q9pSRLGyB8FatxZf2RBTgrXYqVvpasbnB1ZNv858yTpRjV9NzJXYHLp8 + 8Hbd/yYTR6Q7ajs11/SMLGO7KBELsI1pBz7UW/fngJ2pRmd+RkG+EcGrOIZ27TkI + Xjtog6bgfmtV9FWxSVdKACOY0OmW+g7jIMik2eZTYG3kgCmW2odu3zRoUa7l9VwN + YMuhTePaIWwOifzRQt8HDsAOpzqJuLCoYX7HmBfpGAnwu4BuTZgXVwpvPNb+KlgS + pQIDAQAB -----END PUBLIC KEY----- 0: |- -----BEGIN PUBLIC KEY----- - MIIBITANBgkqhkiG9w0BAQEFAAOCAQ4AMIIBCQKCAQBk7O6M5p4eYNAwtVU2beGa - W4mhFG94OtYUWDl1E7UUrhUNGf97Eb/45NjQszu0YPERnApJc2RUm2TrS7iq0mHz - Xbwf+CbNF54Q5mjuHcpBKgvFwUUSCCYBftmRc4xbFIH4Oh3nHC2GeukUS9TmJwjM - tJKyU0Ve8BK5BgjhagM7XSs+scE2mxemoWtcs6mJLtBuEgRGMgHW00mSdOcLp/+l - oHpSzRYN92/DomwmmjGVy8Ji0faeHx+r79ZzE0E8Rcc29Yhrg1ymrjfkXg98WjAb - TSv4UAN20lsBDejpnGEZKJrxHZ56gHgaJn6PKKCD6ItJA7y7iraCdBhCfAIUIz/z - AgMBAAE= + MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAyG4XpV9TpDfgWJF9TiIv + va4hNhDuqYMJO6iXLzr3y8oCvoB7zUK0EjtbLH+A3gr1kUvyZKDWT4qHTvU2Sshm + X+ttWGK34EhCvF3Lb18yxmVDSSK8JIcTaJjMqmyubxzamQnNoWazJ7ea9BIo2YGL + C9rgPbi1hihhdb07xPGUkJRqbWkI98xjDhKdMqiwW1hIRXm/apo++FjptvqvF84s + ynC5gWGFHiGNICRsLJBczLEAf2Atbafigq6/tovzMabnp2yRtr1ReEgioH1RO4gX + J7F4N5f6y/VWd8+sDOSxtS/HcnP/7g8/A54G2IbXxr+EiwOO/1F+pyMPKq7sGDSU + DwIDAQAB -----END PUBLIC KEY----- iss_entity_map: 0: "driver" From f524ee09a5edb8e4666480895b1aa8f76bc7d73c Mon Sep 17 00:00:00 2001 From: Parham Alvani Date: Wed, 26 Apr 2023 13:10:32 +0330 Subject: [PATCH 365/660] feat: update soteria values --- deployments/soteria/values.ode.baly.yaml | 162 ++++++++++++++++++ ...{values.ode.yaml => values.ode.snapp.yaml} | 0 2 files changed, 162 insertions(+) create mode 100644 deployments/soteria/values.ode.baly.yaml rename deployments/soteria/{values.ode.yaml => values.ode.snapp.yaml} (100%) diff --git a/deployments/soteria/values.ode.baly.yaml b/deployments/soteria/values.ode.baly.yaml new file mode 100644 index 00000000..34078062 --- /dev/null +++ b/deployments/soteria/values.ode.baly.yaml @@ -0,0 +1,162 @@ +replicaCount: 1 + +labels: + managedby: dispatching-team + createdby: mozart + +image: + registry: registry.apps.private.teh-1.snappcloud.io + repository: mozart/soteria + tag: main + pullPolicy: Always + +timezone: Asia/Tehran + +service: + type: ClusterIP + ports: + - name: http + port: 9999 + protocol: tcp + +resources: + limits: + memory: 128Mi + cpu: 200m + requests: + memory: 128Mi + cpu: 100m + +autoscaling: + enabled: false + minReplicas: 3 + maxReplicas: 20 + targetCPUUtilizationPercentage: 65 + +rollingParams: + maxSurge: 5 + maxUnavailable: 0 + +serviceMonitor: + enabled: false + +config: + http_port: 9999 + default_vendor: baly + logger: + level: "debug" + tracer: + enabled: true + ratio: 1 + agent: + host: 'jaeger-all-in-one-inmemory-agent' + port: 6831 + +vendors: + snapp: + company: "baly" + hashid_map: + 0: + salt: "secret" + length: 15 + 1: + salt: "secret" + length: 15 + allowed_access_types: [ "pub", "sub" ] + topics: + - type: cab_event + template: ^{{IssToEntity .iss}}-event-{{ EncodeMD5 (DecodeHashID .sub .iss) }}$ + hash_type: 1 + accesses: + 0: '1' + 1: '1' + - type: driver_location + template: ^{{.company}}/driver/{{.sub}}/location$ + hash_type: 0 + accesses: + 0: '2' + 1: '-1' + - type: passenger_location + template: ^{{.company}}/passenger/{{.sub}}/location$ + hash_type: 0 + accesses: + 0: '2' + 1: '2' + - type: superapp_event + template: ^{{.company}}/{{IssToEntity .iss}}/{{.sub}}/superapp$ + hash_type: 0 + accesses: + 0: '1' + 1: '1' + - type: box_event + template: ^bucks$ + hash_type: 0 + accesses: + 0: '-1' + 1: '-1' + - type: shared_location + template: ^{{.company}}/{{IssToEntity .iss}}/{{.sub}}/{{IssToPeer .iss}}-location$ + hash_type: 0 + accesses: + 0: '1' + 1: '1' + - type: chat + template: ^{{.company}}/{{IssToEntity .iss}}/{{.sub}}/chat$ + hash_type: 0 + accesses: + 0: '1' + 1: '1' + - type: general_call_entry + template: ^shared/{{.company}}/{{IssToEntity .iss}}/{{.sub}}/call/send$ + hash_type: 0 + accesses: + 0: '2' + 1: '2' + - type: node_call_entry + template: ^{{.company}}/{{IssToEntity .iss}}/{{.sub}}/call/[a-zA-Z0-9-_]+/send$ + hash_type: 0 + accesses: + 0: '2' + 1: '2' + - type: call_outgoing + template: ^{{.company}}/{{IssToEntity .iss}}/{{.sub}}/call/receive$ + hash_type: 0 + accesses: + 0: '1' + 1: '1' + keys: + 0: |- + -----BEGIN PUBLIC KEY----- + MIIBITANBgkqhkiG9w0BAQEFAAOCAQ4AMIIBCQKCAQBk7O6M5p4eYNAwtVU2beGa + W4mhFG94OtYUWDl1E7UUrhUNGf97Eb/45NjQszu0YPERnApJc2RUm2TrS7iq0mHz + Xbwf+CbNF54Q5mjuHcpBKgvFwUUSCCYBftmRc4xbFIH4Oh3nHC2GeukUS9TmJwjM + tJKyU0Ve8BK5BgjhagM7XSs+scE2mxemoWtcs6mJLtBuEgRGMgHW00mSdOcLp/+l + oHpSzRYN92/DomwmmjGVy8Ji0faeHx+r79ZzE0E8Rcc29Yhrg1ymrjfkXg98WjAb + TSv4UAN20lsBDejpnGEZKJrxHZ56gHgaJn6PKKCD6ItJA7y7iraCdBhCfAIUIz/z + AgMBAAE= + -----END PUBLIC KEY----- + 1: |- + -----BEGIN PUBLIC KEY----- + MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA1lNRwyNsDieWs6LvHOJ+ + GyehhRC4Pn5yL5edKP3565F3LtRDMrkzwDRsQbqnUtTea9HCdTdBv+lI8vE17qRi + RQn10IMaIH6e4Aa3OWNClFhuqNOag7VmffsjTOgxHgHpfGAKVF/4BwqOHrdHFbAD + VOiWB1hv9Uc0C5laffGAub7fj+EAI02zlrsNDxYW8vyF2H47N7VWcvgd3RhZpxlG + 8bq9phl7Ja55YmQiT2Ic3/K5tsazg5z9lz6OTrx+JvWbefHFlJpjCLz5yefEaRmX + 9L/zyDMi4jgFTZEWNXC2vIrxwZMFwFhBXEp0PcCbuHJgJIucbRrbwukQC16uHJwP + zQIDAQAB + -----END PUBLIC KEY----- + iss_entity_map: + 0: "driver" + 1: "passenger" + default: "none" + iss_peer_map: + 0: "passenger" + 1: "driver" + default: "none" + jwt: + iss_name: "iss" + sub_name: "sub" + signing_method: "RS512" + + + diff --git a/deployments/soteria/values.ode.yaml b/deployments/soteria/values.ode.snapp.yaml similarity index 100% rename from deployments/soteria/values.ode.yaml rename to deployments/soteria/values.ode.snapp.yaml From beba013d760fe7e21b516662d4f154d899bc2ff3 Mon Sep 17 00:00:00 2001 From: Parham Alvani Date: Wed, 26 Apr 2023 13:17:51 +0330 Subject: [PATCH 366/660] feat: update deploy script to support baly --- deployments/deploy.sh | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/deployments/deploy.sh b/deployments/deploy.sh index 1e02fe86..fdaf6eed 100755 --- a/deployments/deploy.sh +++ b/deployments/deploy.sh @@ -2,11 +2,14 @@ set -e -echo "Rolling out soteria..." +company="$(oc project -q | cut -d- -f1)" +ode="$(oc project -q | cut -d- -f3)" + +echo "Rolling out soteria on $company-ode-$ode" current_dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" path_to_k8s="$current_dir/soteria" helm upgrade --install soteria "$path_to_k8s" \ -f "$path_to_k8s/values.yaml" \ - -f "$path_to_k8s/values.ode.yaml" + -f "$path_to_k8s/values.ode.$company.yaml" From 6b6236bee90b4b42e451f0295ddd073f1b811187 Mon Sep 17 00:00:00 2001 From: davidcopperfield1991 Date: Wed, 26 Apr 2023 13:18:19 +0330 Subject: [PATCH 367/660] add array for pubkey config --- internal/authenticator/authenticator.go | 2 +- internal/authenticator/authenticator_test.go | 6 +- internal/authenticator/key.go | 40 +++++----- internal/config/config.go | 2 +- internal/config/default.go | 79 +++++++++++++++----- internal/topics/manager.go | 2 +- 6 files changed, 89 insertions(+), 42 deletions(-) diff --git a/internal/authenticator/authenticator.go b/internal/authenticator/authenticator.go index aaf0fe66..a579bdc6 100644 --- a/internal/authenticator/authenticator.go +++ b/internal/authenticator/authenticator.go @@ -11,7 +11,7 @@ import ( // Authenticator is responsible for Acl/Auth/Token of users. type Authenticator struct { - Keys map[string]any + Keys map[string][]any AllowedAccessTypes []acl.AccessType TopicManager *topics.Manager Company string diff --git a/internal/authenticator/authenticator_test.go b/internal/authenticator/authenticator_test.go index ced04faf..2eb89331 100644 --- a/internal/authenticator/authenticator_test.go +++ b/internal/authenticator/authenticator_test.go @@ -103,9 +103,9 @@ func (suite *AuthenticatorTestSuite) SetupSuite() { require.NoError(err) suite.Authenticator = authenticator.Authenticator{ - Keys: map[string]any{ - topics.DriverIss: pkey0, - topics.PassengerIss: pkey1, + Keys: map[string][]any{ + // topics.DriverIss: pkey0, + // topics.PassengerIss: pkey1, }, AllowedAccessTypes: []acl.AccessType{acl.Pub, acl.Sub, acl.PubSub}, Company: "snapp", diff --git a/internal/authenticator/key.go b/internal/authenticator/key.go index 8345ee5f..ad9f58b6 100644 --- a/internal/authenticator/key.go +++ b/internal/authenticator/key.go @@ -8,8 +8,8 @@ import ( "go.uber.org/zap" ) -func (b Builder) GenerateKeys(method string, keys map[string]string) map[string]any { - var keyList map[string]any +func (b Builder) GenerateKeys(method string, keys map[string][]string) map[string][]any { + var keyList map[string][]any // ES RS HS PS EdDSA switch { @@ -18,37 +18,43 @@ func (b Builder) GenerateKeys(method string, keys map[string]string) map[string] case strings.HasPrefix(method, "HS"): keyList = b.GenerateHMacKeys(keys) default: - keyList = make(map[string]any) + keyList = make(map[string][]any) } return keyList } -func (b Builder) GenerateRsaKeys(raw map[string]string) map[string]any { - rsaKeys := make(map[string]any) +func (b Builder) GenerateRsaKeys(raw map[string][]string) map[string][]any { + rsaKeys := make(map[string][]any) for iss, publicKey := range raw { - rsaKey, err := jwt.ParseRSAPublicKeyFromPEM([]byte(publicKey)) - if err != nil { - b.Logger.Fatal("could not read public key", zap.String("issuer", iss), zap.Error(err)) - } + for i, _ := range publicKey { + + rsaKey, err := jwt.ParseRSAPublicKeyFromPEM([]byte(publicKey[i])) + + if err != nil { + b.Logger.Fatal("could not read public key", zap.String("issuer", iss), zap.Error(err)) + } - rsaKeys[iss] = rsaKey + rsaKeys[iss] = append(rsaKeys[iss], rsaKey) + } } return rsaKeys } -func (b Builder) GenerateHMacKeys(raw map[string]string) map[string]any { - keys := make(map[string]any) +func (b Builder) GenerateHMacKeys(raw map[string][]string) map[string][]any { + keys := make(map[string][]any) for iss, key := range raw { - bytes, err := base64.StdEncoding.DecodeString(key) - if err != nil { - b.Logger.Fatal("failed to generate hmac key from base64", zap.Error(err)) - } + for i, _ := range key { + bytes, err := base64.StdEncoding.DecodeString(key[i]) + if err != nil { + b.Logger.Fatal("failed to generate hmac key from base64", zap.Error(err)) + } - keys[iss] = bytes + keys[iss] = append(keys[iss], bytes) + } } return keys diff --git a/internal/config/config.go b/internal/config/config.go index c95e525f..ee4f384a 100644 --- a/internal/config/config.go +++ b/internal/config/config.go @@ -35,7 +35,7 @@ type ( AllowedAccessTypes []string `koanf:"allowed_access_types"` Company string `koanf:"company"` Topics []topics.Topic `koanf:"topics"` - Keys map[string]string `koanf:"keys"` + Keys map[string][]string `koanf:"keys"` IssEntityMap map[string]string `koanf:"iss_entity_map"` IssPeerMap map[string]string `koanf:"iss_peer_map"` Jwt Jwt `koanf:"jwt"` diff --git a/internal/config/default.go b/internal/config/default.go index 766ea753..3fb316a1 100644 --- a/internal/config/default.go +++ b/internal/config/default.go @@ -138,26 +138,67 @@ func SnappVendor() Vendor { }, }, }, - Keys: map[string]string{ - "0": `-----BEGIN PUBLIC KEY----- -MIIBITANBgkqhkiG9w0BAQEFAAOCAQ4AMIIBCQKCAQBk7O6M5p4eYNAwtVU2beGa -W4mhFG94OtYUWDl1E7UUrhUNGf97Eb/45NjQszu0YPERnApJc2RUm2TrS7iq0mHz -Xbwf+CbNF54Q5mjuHcpBKgvFwUUSCCYBftmRc4xbFIH4Oh3nHC2GeukUS9TmJwjM -tJKyU0Ve8BK5BgjhagM7XSs+scE2mxemoWtcs6mJLtBuEgRGMgHW00mSdOcLp/+l -oHpSzRYN92/DomwmmjGVy8Ji0faeHx+r79ZzE0E8Rcc29Yhrg1ymrjfkXg98WjAb -TSv4UAN20lsBDejpnGEZKJrxHZ56gHgaJn6PKKCD6ItJA7y7iraCdBhCfAIUIz/z -AgMBAAE= ------END PUBLIC KEY-----`, + // Keys: map[string]string{ + // "0": `-----BEGIN PUBLIC KEY----- + // MIIBITANBgkqhkiG9w0BAQEFAAOCAQ4AMIIBCQKCAQBk7O6M5p4eYNAwtVU2beGa + // W4mhFG94OtYUWDl1E7UUrhUNGf97Eb/45NjQszu0YPERnApJc2RUm2TrS7iq0mHz + // Xbwf+CbNF54Q5mjuHcpBKgvFwUUSCCYBftmRc4xbFIH4Oh3nHC2GeukUS9TmJwjM + // tJKyU0Ve8BK5BgjhagM7XSs+scE2mxemoWtcs6mJLtBuEgRGMgHW00mSdOcLp/+l + // oHpSzRYN92/DomwmmjGVy8Ji0faeHx+r79ZzE0E8Rcc29Yhrg1ymrjfkXg98WjAb + // TSv4UAN20lsBDejpnGEZKJrxHZ56gHgaJn6PKKCD6ItJA7y7iraCdBhCfAIUIz/z + // AgMBAAE= + // -----END PUBLIC KEY-----`, - "1": `-----BEGIN PUBLIC KEY----- -MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA1lNRwyNsDieWs6LvHOJ+ -GyehhRC4Pn5yL5edKP3565F3LtRDMrkzwDRsQbqnUtTea9HCdTdBv+lI8vE17qRi -RQn10IMaIH6e4Aa3OWNClFhuqNOag7VmffsjTOgxHgHpfGAKVF/4BwqOHrdHFbAD -VOiWB1hv9Uc0C5laffGAub7fj+EAI02zlrsNDxYW8vyF2H47N7VWcvgd3RhZpxlG -8bq9phl7Ja55YmQiT2Ic3/K5tsazg5z9lz6OTrx+JvWbefHFlJpjCLz5yefEaRmX -9L/zyDMi4jgFTZEWNXC2vIrxwZMFwFhBXEp0PcCbuHJgJIucbRrbwukQC16uHJwP -zQIDAQAB ------END PUBLIC KEY-----`, + // "1": `-----BEGIN PUBLIC KEY----- + // MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA1lNRwyNsDieWs6LvHOJ+ + // GyehhRC4Pn5yL5edKP3565F3LtRDMrkzwDRsQbqnUtTea9HCdTdBv+lI8vE17qRi + // RQn10IMaIH6e4Aa3OWNClFhuqNOag7VmffsjTOgxHgHpfGAKVF/4BwqOHrdHFbAD + // VOiWB1hv9Uc0C5laffGAub7fj+EAI02zlrsNDxYW8vyF2H47N7VWcvgd3RhZpxlG + // 8bq9phl7Ja55YmQiT2Ic3/K5tsazg5z9lz6OTrx+JvWbefHFlJpjCLz5yefEaRmX + // 9L/zyDMi4jgFTZEWNXC2vIrxwZMFwFhBXEp0PcCbuHJgJIucbRrbwukQC16uHJwP + // zQIDAQAB + // -----END PUBLIC KEY-----`, + // }, + Keys: map[string][]string{ + "0": []string{`-----BEGIN PUBLIC KEY----- + MIICIjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEAuiAp6wih+q53HJQhcQed + 1ergtAP+keqrtRdtUMo3wPEupVZILd+JCMs3MV9yxLxLD55J9pESNhqiJjeXHaCi + w8d0y5aKmoa3cjHqG2vzKH7R8n8lWPy++oGvEhyYVtQyQmOOMgZ2jyRAdk5Co5iK + 2f5O0ydnTobenbo2u19d0DGJVULynYEsuOQJEHs+z+l7DoiaTba6hrxAWWncUVWd + emplkhWX7oyujgfIClaSr15hWxZK8jSPrsJE0vbMmWKGu3LbW3aVRfWKwnRVdJLM + zhpLNEZiK1CnG/OKhXqmT6/n/MuqTzf168I1J9ypPsWpLiU/jc7C1weeut3LhFTt + rwUrADTMRUD96F6pk5gIjDm9gvSPmkGRYkq+6og2MhYFAXNwF1t8c9Ht8V93JlrF + zmLNfQ1yTAvwVz1ba7PwzqkJk2U0nCMCQMfNxhCeS6uXBdtqQXHeevht7frOkSqa + tF/jU2wcesAX2XUv/Hg9X+eYvK8KN7iN2sQ+4WuwheqOuIsazTSAk93+YEZx+UkT + 00AlIUi8IbmHReBAhxOTPzodFVR7jzyLfNRB0n5dbStAYhjK2QxgbNF6tRcfyT25 + kYfTXFJg8TGMIjUJpA0/JVRSnewpSm2jFh8s2RaaAy27IAnHmN8G5tJrEJ05Vcp6 + KNke4qsRTcXvt397Z9a6fDECAwEAAQ== +-----END PUBLIC KEY-----`, `-----BEGIN PUBLIC KEY----- +MIICIjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEAuiAp6wih+q53HJQhcQed +1ergtAP+keqrtRdtUMo3wPEupVZILd+JCMs3MV9yxLxLD55J9pESNhqiJjeXHaCi +w8d0y5aKmoa3cjHqG2vzKH7R8n8lWPy++oGvEhyYVtQyQmOOMgZ2jyRAdk5Co5iK +2f5O0ydnTobenbo2u19d0DGJVULynYEsuOQJEHs+z+l7DoiaTba6hrxAWWncUVWd +emplkhWX7oyujgfIClaSr15hWxZK8jSPrsJE0vbMmWKGu3LbW3aVRfWKwnRVdJLM +zhpLNEZiK1CnG/OKhXqmT6/n/MuqTzf168I1J9ypPsWpLiU/jc7C1weeut3LhFTt +rwUrADTMRUD96F6pk5gIjDm9gvSPmkGRYkq+6og2MhYFAXNwF1t8c9Ht8V93JlrF +zmLNfQ1yTAvwVz1ba7PwzqkJk2U0nCMCQMfNxhCeS6uXBdtqQXHeevht7frOkSqa +tF/jU2wcesAX2XUv/Hg9X+eYvK8KN7iN2sQ+4WuwheqOuIsazTSAk93+YEZx+UkT +00AlIUi8IbmHReBAhxOTPzodFVR7jzyLfNRB0n5dbStAYhjK2QxgbNF6tRcfyT25 +kYfTXFJg8TGMIjUJpA0/JVRSnewpSm2jFh8s2RaaAy27IAnHmN8G5tJrEJ05Vcp6 +KNke4qsRTcXvt397Z9a6fDECAwEAAQ== +-----END PUBLIC KEY-----`}, + + "1": []string{`-----BEGIN PUBLIC KEY----- + MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCuxK5lFw6U/aHSSbxaCEsfxqLA + zqQeioXV8QxbectY95p7OoCPBMyxZ6FXipbzmNLEO41kjFCHthAZ4DHhx6q/bEF3 + 0sj9J2FwL3rO3mc31hbyUAGaIjTgR4302MXgnTmeX68dOqmgBZem70Si8gvbgXoc + qF+zAHZiEZ4hr24/KQIDAQAB + -----END PUBLIC KEY-----`, `-----BEGIN PUBLIC KEY----- +MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCuxK5lFw6U/aHSSbxaCEsfxqLA +zqQeioXV8QxbectY95p7OoCPBMyxZ6FXipbzmNLEO41kjFCHthAZ4DHhx6q/bEF3 +0sj9J2FwL3rO3mc31hbyUAGaIjTgR4302MXgnTmeX68dOqmgBZem70Si8gvbgXoc +qF+zAHZiEZ4hr24/KQIDAQAB +-----END PUBLIC KEY-----`}, }, IssEntityMap: map[string]string{ "0": "driver", diff --git a/internal/topics/manager.go b/internal/topics/manager.go index 446e063a..24aa7449 100644 --- a/internal/topics/manager.go +++ b/internal/topics/manager.go @@ -41,7 +41,7 @@ const ( // EmqCabHashPrefix is the default prefix for hashing part of cab topic, default value is 'emqch'. EmqCabHashPrefix = "emqch" - Default = "default" + Default = "0" ) type Manager struct { From 4e42ddc1a6dcf82e2bddcb13c59814ed2db94fdd Mon Sep 17 00:00:00 2001 From: Parham Alvani Date: Wed, 26 Apr 2023 16:12:12 +0330 Subject: [PATCH 368/660] feat: update baly keys --- deployments/soteria/values.ode.baly.yaml | 20 ++------------------ 1 file changed, 2 insertions(+), 18 deletions(-) diff --git a/deployments/soteria/values.ode.baly.yaml b/deployments/soteria/values.ode.baly.yaml index 34078062..b6166a49 100644 --- a/deployments/soteria/values.ode.baly.yaml +++ b/deployments/soteria/values.ode.baly.yaml @@ -126,25 +126,9 @@ vendors: 1: '1' keys: 0: |- - -----BEGIN PUBLIC KEY----- - MIIBITANBgkqhkiG9w0BAQEFAAOCAQ4AMIIBCQKCAQBk7O6M5p4eYNAwtVU2beGa - W4mhFG94OtYUWDl1E7UUrhUNGf97Eb/45NjQszu0YPERnApJc2RUm2TrS7iq0mHz - Xbwf+CbNF54Q5mjuHcpBKgvFwUUSCCYBftmRc4xbFIH4Oh3nHC2GeukUS9TmJwjM - tJKyU0Ve8BK5BgjhagM7XSs+scE2mxemoWtcs6mJLtBuEgRGMgHW00mSdOcLp/+l - oHpSzRYN92/DomwmmjGVy8Ji0faeHx+r79ZzE0E8Rcc29Yhrg1ymrjfkXg98WjAb - TSv4UAN20lsBDejpnGEZKJrxHZ56gHgaJn6PKKCD6ItJA7y7iraCdBhCfAIUIz/z - AgMBAAE= - -----END PUBLIC KEY----- + LS0tLS1CRUdJTiBQVUJMSUMgS0VZLS0tLS0KTUlJQklqQU5CZ2txaGtpRzl3MEJBUUVGQUFPQ0FROEFNSUlCQ2dLQ0FRRUF5RzRYcFY5VHBEZmdXSkY5VGlJdgp2YTRoTmhEdXFZTUpPNmlYTHpyM3k4b0N2b0I3elVLMEVqdGJMSCtBM2dyMWtVdnlaS0RXVDRxSFR2VTJTc2htClgrdHRXR0szNEVoQ3ZGM0xiMTh5eG1WRFNTSzhKSWNUYUpqTXFteXVieHphbVFuTm9XYXpKN2VhOUJJbzJZR0wKQzlyZ1BiaTFoaWhoZGIwN3hQR1VrSlJxYldrSTk4eGpEaEtkTXFpd1cxaElSWG0vYXBvKytGanB0dnF2Rj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iZ2ZtdFY5Rld4U1ZkS0FDT1kwT21XK2c3aklNaWsyZVpUWUcza2dDbVcyb2R1M3pSb1VhN2w5VndOCllNdWhUZVBhSVd3T2lmelJRdDhIRHNBT3B6cUp1TENvWVg3SG1CZnBHQW53dTRCdVRaZ1hWd3B2UE5iK0tsZ1MKcFFJREFRQUIKLS0tLS1FTkQgUFVCTElDIEtFWS0tLS0t iss_entity_map: 0: "driver" 1: "passenger" From 432759c0efb15eccd4afd6602636010c5a5c39d3 Mon Sep 17 00:00:00 2001 From: Parham Alvani Date: Wed, 26 Apr 2023 18:16:31 +0330 Subject: [PATCH 369/660] fix: correct mozart registry address --- deployments/soteria/values.ode.baly.yaml | 2 +- deployments/soteria/values.ode.snapp.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/deployments/soteria/values.ode.baly.yaml b/deployments/soteria/values.ode.baly.yaml index b6166a49..a004be17 100644 --- a/deployments/soteria/values.ode.baly.yaml +++ b/deployments/soteria/values.ode.baly.yaml @@ -5,7 +5,7 @@ labels: createdby: mozart image: - registry: registry.apps.private.teh-1.snappcloud.io + registry: image-registry.apps.private.okd4.teh-1.snappcloud.io repository: mozart/soteria tag: main pullPolicy: Always diff --git a/deployments/soteria/values.ode.snapp.yaml b/deployments/soteria/values.ode.snapp.yaml index 6f4cfeb2..4fbfa39f 100644 --- a/deployments/soteria/values.ode.snapp.yaml +++ b/deployments/soteria/values.ode.snapp.yaml @@ -7,7 +7,7 @@ labels: createdby: mozart image: - registry: registry.apps.private.teh-1.snappcloud.io + registry: image-registry.apps.private.okd4.teh-1.snappcloud.io repository: mozart/soteria tag: main pullPolicy: Always From 7bb723897ad01cfecc56dc05dfb266b47e6e3510 Mon Sep 17 00:00:00 2001 From: davidcopperfield1991 Date: Tue, 2 May 2023 12:13:47 +0330 Subject: [PATCH 370/660] update auth function --- internal/authenticator/authenticator.go | 47 +++++++++++++------------ 1 file changed, 24 insertions(+), 23 deletions(-) diff --git a/internal/authenticator/authenticator.go b/internal/authenticator/authenticator.go index a579bdc6..e344bbd9 100644 --- a/internal/authenticator/authenticator.go +++ b/internal/authenticator/authenticator.go @@ -21,33 +21,34 @@ type Authenticator struct { // Auth check user authentication by checking the user's token // isSuperuser is a flag that authenticator set it true when credentials is related to a superuser. func (a Authenticator) Auth(tokenString string) error { - _, err := jwt.Parse(tokenString, func(token *jwt.Token) (interface{}, error) { - if token.Method.Alg() != a.JwtConfig.SigningMethod { - return nil, ErrInvalidSigningMethod - } - - claims, ok := token.Claims.(jwt.MapClaims) - if !ok { - return nil, ErrInvalidClaims - } - if claims[a.JwtConfig.IssName] == nil { - return nil, ErrIssNotFound - } - - issuer := fmt.Sprintf("%v", claims[a.JwtConfig.IssName]) - key := a.Keys[issuer] - if key == nil { - return nil, KeyNotFoundError{Issuer: issuer} + for index := 0; index < len(a.TopicManager.IssEntityMapper(tokenString)); index++ { + fmt.Println(index) + _, err := jwt.Parse(tokenString, func(token *jwt.Token) (interface{}, error) { + if token.Method.Alg() != a.JwtConfig.SigningMethod { + return nil, ErrInvalidSigningMethod + } + + claims, ok := token.Claims.(jwt.MapClaims) + if !ok { + return nil, ErrInvalidClaims + } + if claims[a.JwtConfig.IssName] == nil { + return nil, ErrIssNotFound + } + + issuer := fmt.Sprintf("%v", claims[a.JwtConfig.IssName]) + + key := a.Keys[issuer][index] + + return key, nil + }) + if err == nil { + return nil } - - return key, nil - }) - if err != nil { - return fmt.Errorf("token is invalid: %w", err) } - return nil + return ErrInvalidSigningMethod } // ACL check a user access to a topic. From 99a1733e870ee24b23947dc5bbcb6120800088a7 Mon Sep 17 00:00:00 2001 From: Parham Alvani Date: Tue, 2 May 2023 14:54:23 +0330 Subject: [PATCH 371/660] fix: correct baly keys --- deployments/soteria/values.ode.baly.yaml | 24 ++++++++++++++++++++---- 1 file changed, 20 insertions(+), 4 deletions(-) diff --git a/deployments/soteria/values.ode.baly.yaml b/deployments/soteria/values.ode.baly.yaml index a004be17..e23b562d 100644 --- a/deployments/soteria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JuLCoYX7HmBfpGAnwu4BuTZgXVwpvPNb+KlgS + pQIDAQAB + -----END PUBLIC KEY----- iss_entity_map: 0: "driver" 1: "passenger" From 71c08a395b45e033f3dd94db2e07ec063361a322 Mon Sep 17 00:00:00 2001 From: Parham Alvani Date: Tue, 2 May 2023 14:54:57 +0330 Subject: [PATCH 372/660] fix: correct baly keys --- deployments/soteria/values.ode.baly.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/deployments/soteria/values.ode.baly.yaml b/deployments/soteria/values.ode.baly.yaml index e23b562d..93b37377 100644 --- a/deployments/soteria/values.ode.baly.yaml +++ b/deployments/soteria/values.ode.baly.yaml @@ -125,7 +125,7 @@ vendors: 0: '1' 1: '1' keys: - 0: | + 0: |- -----BEGIN PUBLIC KEY----- MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAyG4XpV9TpDfgWJF9TiIv va4hNhDuqYMJO6iXLzr3y8oCvoB7zUK0EjtbLH+A3gr1kUvyZKDWT4qHTvU2Sshm @@ -135,7 +135,7 @@ vendors: J7F4N5f6y/VWd8+sDOSxtS/HcnP/7g8/A54G2IbXxr+EiwOO/1F+pyMPKq7sGDSU DwIDAQAB -----END PUBLIC KEY----- - 1: + 1: |- -----BEGIN PUBLIC KEY----- MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA5SeRfOdTyvQZ7N9ahFHl +J05r7e9fgOQ2cpOtnnsIjAjCt1dF7/NkqVifEaxABRBGG9iXIw//G4hi0TqoKqK From 960cbcc88dec8ef8955278430078ded2f1c1d034 Mon Sep 17 00:00:00 2001 From: davidcopperfield1991 Date: Tue, 2 May 2023 16:41:15 +0330 Subject: [PATCH 373/660] update auth function & delete useless lines --- internal/authenticator/authenticator.go | 14 ++- internal/config/default.go | 117 +++++++++++++----------- internal/topics/manager.go | 2 +- 3 files changed, 74 insertions(+), 59 deletions(-) diff --git a/internal/authenticator/authenticator.go b/internal/authenticator/authenticator.go index e344bbd9..8f21fdfe 100644 --- a/internal/authenticator/authenticator.go +++ b/internal/authenticator/authenticator.go @@ -21,10 +21,12 @@ type Authenticator struct { // Auth check user authentication by checking the user's token // isSuperuser is a flag that authenticator set it true when credentials is related to a superuser. func (a Authenticator) Auth(tokenString string) error { + count := 1 + + for index := 0; index < count; index++ { - for index := 0; index < len(a.TopicManager.IssEntityMapper(tokenString)); index++ { - fmt.Println(index) _, err := jwt.Parse(tokenString, func(token *jwt.Token) (interface{}, error) { + if token.Method.Alg() != a.JwtConfig.SigningMethod { return nil, ErrInvalidSigningMethod } @@ -39,9 +41,15 @@ func (a Authenticator) Auth(tokenString string) error { issuer := fmt.Sprintf("%v", claims[a.JwtConfig.IssName]) - key := a.Keys[issuer][index] + kilidash := a.Keys[issuer] + + var key any + for i := range kilidash { + key = a.Keys[issuer][i] + } return key, nil + }) if err == nil { return nil diff --git a/internal/config/default.go b/internal/config/default.go index 3fb316a1..3aef20eb 100644 --- a/internal/config/default.go +++ b/internal/config/default.go @@ -138,66 +138,73 @@ func SnappVendor() Vendor { }, }, }, - // Keys: map[string]string{ - // "0": `-----BEGIN PUBLIC KEY----- - // MIIBITANBgkqhkiG9w0BAQEFAAOCAQ4AMIIBCQKCAQBk7O6M5p4eYNAwtVU2beGa - // W4mhFG94OtYUWDl1E7UUrhUNGf97Eb/45NjQszu0YPERnApJc2RUm2TrS7iq0mHz - // Xbwf+CbNF54Q5mjuHcpBKgvFwUUSCCYBftmRc4xbFIH4Oh3nHC2GeukUS9TmJwjM - // tJKyU0Ve8BK5BgjhagM7XSs+scE2mxemoWtcs6mJLtBuEgRGMgHW00mSdOcLp/+l - // oHpSzRYN92/DomwmmjGVy8Ji0faeHx+r79ZzE0E8Rcc29Yhrg1ymrjfkXg98WjAb - // TSv4UAN20lsBDejpnGEZKJrxHZ56gHgaJn6PKKCD6ItJA7y7iraCdBhCfAIUIz/z - // AgMBAAE= - // -----END PUBLIC KEY-----`, - - // "1": `-----BEGIN PUBLIC KEY----- - // MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA1lNRwyNsDieWs6LvHOJ+ - // GyehhRC4Pn5yL5edKP3565F3LtRDMrkzwDRsQbqnUtTea9HCdTdBv+lI8vE17qRi - // RQn10IMaIH6e4Aa3OWNClFhuqNOag7VmffsjTOgxHgHpfGAKVF/4BwqOHrdHFbAD - // VOiWB1hv9Uc0C5laffGAub7fj+EAI02zlrsNDxYW8vyF2H47N7VWcvgd3RhZpxlG - // 8bq9phl7Ja55YmQiT2Ic3/K5tsazg5z9lz6OTrx+JvWbefHFlJpjCLz5yefEaRmX - // 9L/zyDMi4jgFTZEWNXC2vIrxwZMFwFhBXEp0PcCbuHJgJIucbRrbwukQC16uHJwP - // zQIDAQAB - // -----END PUBLIC KEY-----`, - // }, Keys: map[string][]string{ "0": []string{`-----BEGIN PUBLIC KEY----- - MIICIjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEAuiAp6wih+q53HJQhcQed - 1ergtAP+keqrtRdtUMo3wPEupVZILd+JCMs3MV9yxLxLD55J9pESNhqiJjeXHaCi - w8d0y5aKmoa3cjHqG2vzKH7R8n8lWPy++oGvEhyYVtQyQmOOMgZ2jyRAdk5Co5iK - 2f5O0ydnTobenbo2u19d0DGJVULynYEsuOQJEHs+z+l7DoiaTba6hrxAWWncUVWd - emplkhWX7oyujgfIClaSr15hWxZK8jSPrsJE0vbMmWKGu3LbW3aVRfWKwnRVdJLM - zhpLNEZiK1CnG/OKhXqmT6/n/MuqTzf168I1J9ypPsWpLiU/jc7C1weeut3LhFTt - rwUrADTMRUD96F6pk5gIjDm9gvSPmkGRYkq+6og2MhYFAXNwF1t8c9Ht8V93JlrF - zmLNfQ1yTAvwVz1ba7PwzqkJk2U0nCMCQMfNxhCeS6uXBdtqQXHeevht7frOkSqa - tF/jU2wcesAX2XUv/Hg9X+eYvK8KN7iN2sQ+4WuwheqOuIsazTSAk93+YEZx+UkT - 00AlIUi8IbmHReBAhxOTPzodFVR7jzyLfNRB0n5dbStAYhjK2QxgbNF6tRcfyT25 - kYfTXFJg8TGMIjUJpA0/JVRSnewpSm2jFh8s2RaaAy27IAnHmN8G5tJrEJ05Vcp6 - KNke4qsRTcXvt397Z9a6fDECAwEAAQ== + MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAu1SU1LfVLPHCozMxH2Mo + 4lgOEePzNm0tRgeLezV6ffAt0gunVTLw7onLRnrq0/IzW7yWR7QkrmBL7jTKEn5u + +qKhbwKfBstIs+bMY2Zkp18gnTxKLxoS2tFczGkPLPgizskuemMghRniWaoLcyeh + kd3qqGElvW/VDL5AaWTg0nLVkjRo9z+40RQzuVaE8AkAFmxZzow3x+VJYKdjykkJ + 0iT9wCS0DRTXu269V264Vf/3jvredZiKRkgwlL9xNAwxXFg0x/XFw005UWVRIkdg + cKWTjpBP2dPwVZ4WWC+9aGVd+Gyn1o0CLelf4rEjGoXbAAEgAqeGUxrcIlbjXfbc + mwIDAQAB +-----END PUBLIC KEY-----`, `-----BEGIN PUBLIC KEY----- +MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAu1SU1LfVLPHCozMxH2Mo +4lgOEePzNm0tRgeLezV6ffAt0gunVTLw7onLRnrq0/IzW7yWR7QkrmBL7jTKEn5u ++qKhbwKfBstIs+bMY2Zkp18gnTxKLxoS2tFczGkPLPgizskuemMghRniWaoLcyeh +kd3qqGElvW/VDL5AaWTg0nLVkjRo9z+40RQzuVaE8AkAFmxZzow3x+VJYKdjykkJ +0iT9wCS0DRTXu269V264Vf/3jvredZiKRkgwlL9xNAwxXFg0x/XFw005UWVRIkdg +cKWTjpBP2dPwVZ4WWC+9aGVd+Gyn1o0CLelf4rEjGoXbAAEgAqeGUxrcIlbjXfbc +mwIDAQAB +-----END PUBLIC KEY-----`, `-----BEGIN PUBLIC KEY----- +MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAu1SU1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8G5tJrEJ05Vcp6 -KNke4qsRTcXvt397Z9a6fDECAwEAAQ== +MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAu1SU1LfVLPHCozMxH2Mo +4lgOEePzNm0tRgeLezV6ffAt0gunVTLw7onLRnrq0/IzW7yWR7QkrmBL7jTKEn5u ++qKhbwKfBstIs+bMY2Zkp18gnTxKLxoS2tFczGkPLPgizskuemMghRniWaoLcyeh +kd3qqGElvW/VDL5AaWTg0nLVkjRo9z+40RQzuVaE8AkAFmxZzow3x+VJYKdjykkJ +0iT9wCS0DRTXu269V264Vf/3jvredZiKRkgwlL9xNAwxXFg0x/XFw005UWVRIkdg +cKWTjpBP2dPwVZ4WWC+9aGVd+Gyn1o0CLelf4rEjGoXbAAEgAqeGUxrcIlbjXfbc +mwIDAQAB +-----END PUBLIC KEY-----`, `-----BEGIN PUBLIC KEY----- +MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAu1SU1LfVLPHCozMxH2Mo +4lgOEePzNm0tRgeLezV6ffAt0gunVTLw7onLRnrq0/IzW7yWR7QkrmBL7jTKEn5u ++qKhbwKfBstIs+bMY2Zkp18gnTxKLxoS2tFczGkPLPgizskuemMghRniWaoLcyeh +kd3qqGElvW/VDL5AaWTg0nLVkjRo9z+40RQzuVaE8AkAFmxZzow3x+VJYKdjykkJ +0iT9wCS0DRTXu269V264Vf/3jvredZiKRkgwlL9xNAwxXFg0x/XFw005UWVRIkdg +cKWTjpBP2dPwVZ4WWC+9aGVd+Gyn1o0CLelf4rEjGoXbAAEgAqeGUxrcIlbjXfbc +mwIDAQAB +-----END PUBLIC KEY-----`, `-----BEGIN PUBLIC KEY----- +MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAyG4XpV9TpDfgWJF9TiIv + va4hNhDuqYMJO6iXLzr3y8oCvoB7zUK0EjtbLH+A3gr1kUvyZKDWT4qHTvU2Sshm + X+ttWGK34EhCvF3Lb18yxmVDSSK8JIcTaJjMqmyubxzamQnNoWazJ7ea9BIo2YGL + C9rgPbi1hihhdb07xPGUkJRqbWkI98xjDhKdMqiwW1hIRXm/apo++FjptvqvF84s + ynC5gWGFHiGNICRsLJBczLEAf2Atbafigq6/tovzMabnp2yRtr1ReEgioH1RO4gX + J7F4N5f6y/VWd8+sDOSxtS/HcnP/7g8/A54G2IbXxr+EiwOO/1F+pyMPKq7sGDSU + DwIDAQAB -----END PUBLIC KEY-----`}, "1": []string{`-----BEGIN PUBLIC KEY----- - MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCuxK5lFw6U/aHSSbxaCEsfxqLA - zqQeioXV8QxbectY95p7OoCPBMyxZ6FXipbzmNLEO41kjFCHthAZ4DHhx6q/bEF3 - 0sj9J2FwL3rO3mc31hbyUAGaIjTgR4302MXgnTmeX68dOqmgBZem70Si8gvbgXoc - qF+zAHZiEZ4hr24/KQIDAQAB - -----END PUBLIC KEY-----`, `-----BEGIN PUBLIC KEY----- -MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCuxK5lFw6U/aHSSbxaCEsfxqLA -zqQeioXV8QxbectY95p7OoCPBMyxZ6FXipbzmNLEO41kjFCHthAZ4DHhx6q/bEF3 -0sj9J2FwL3rO3mc31hbyUAGaIjTgR4302MXgnTmeX68dOqmgBZem70Si8gvbgXoc -qF+zAHZiEZ4hr24/KQIDAQAB + MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA5SeRfOdTyvQZ7N9ahFHl + +J05r7e9fgOQ2cpOtnnsIjAjCt1dF7/NkqVifEaxABRBGG9iXIw//G4hi0TqoKqK + aoSHMGf6q9pSRLGyB8FatxZf2RBTgrXYqVvpasbnB1ZNv858yTpRjV9NzJXYHLp8 + 8Hbd/yYTR6Q7ajs11/SMLGO7KBELsI1pBz7UW/fngJ2pRmd+RkG+EcGrOIZ27TkI + Xjtog6bgfmtV9FWxSVdKACOY0OmW+g7jIMik2eZTYG3kgCmW2odu3zRoUa7l9VwN + YMuhTePaIWwOifzRQt8HDsAOpzqJuLCoYX7HmBfpGAnwu4BuTZgXVwpvPNb+KlgS + pQIDAQAB +-----END PUBLIC KEY-----`, `-----BEGIN PUBLIC KEY----- +MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA5SeRfOdTyvQZ7N9ahFHl + +J05r7e9fgOQ2cpOtnnsIjAjCt1dF7/NkqVifEaxABRBGG9iXIw//G4hi0TqoKqK + aoSHMGf6q9pSRLGyB8FatxZf2RBTgrXYqVvpasbnB1ZNv858yTpRjV9NzJXYHLp8 + 8Hbd/yYTR6Q7ajs11/SMLGO7KBELsI1pBz7UW/fngJ2pRmd+RkG+EcGrOIZ27TkI + Xjtog6bgfmtV9FWxSVdKACOY0OmW+g7jIMik2eZTYG3kgCmW2odu3zRoUa7l9VwN + YMuhTePaIWwOifzRQt8HDsAOpzqJuLCoYX7HmBfpGAnwu4BuTZgXVwpvPNb+KlgS + pQIDAQAB -----END PUBLIC KEY-----`}, }, IssEntityMap: map[string]string{ @@ -211,7 +218,7 @@ qF+zAHZiEZ4hr24/KQIDAQAB Jwt: Jwt{ IssName: "iss", SubName: "sub", - SigningMethod: "RSA512", + SigningMethod: "RS512", }, } } diff --git a/internal/topics/manager.go b/internal/topics/manager.go index 24aa7449..446e063a 100644 --- a/internal/topics/manager.go +++ b/internal/topics/manager.go @@ -41,7 +41,7 @@ const ( // EmqCabHashPrefix is the default prefix for hashing part of cab topic, default value is 'emqch'. EmqCabHashPrefix = "emqch" - Default = "0" + Default = "default" ) type Manager struct { From efd1576efea5a50e709781bf3e9130071e2be0e3 Mon Sep 17 00:00:00 2001 From: davidcopperfield1991 Date: Wed, 3 May 2023 13:10:00 +0330 Subject: [PATCH 374/660] fix auth key loop and update default config values --- internal/authenticator/authenticator.go | 13 ++---- internal/config/default.go | 62 +++---------------------- 2 files changed, 11 insertions(+), 64 deletions(-) diff --git a/internal/authenticator/authenticator.go b/internal/authenticator/authenticator.go index 8f21fdfe..67e230c7 100644 --- a/internal/authenticator/authenticator.go +++ b/internal/authenticator/authenticator.go @@ -21,9 +21,8 @@ type Authenticator struct { // Auth check user authentication by checking the user's token // isSuperuser is a flag that authenticator set it true when credentials is related to a superuser. func (a Authenticator) Auth(tokenString string) error { - count := 1 - for index := 0; index < count; index++ { + for index := 0; index < len(a.Keys["0"]); index++ { _, err := jwt.Parse(tokenString, func(token *jwt.Token) (interface{}, error) { @@ -41,12 +40,7 @@ func (a Authenticator) Auth(tokenString string) error { issuer := fmt.Sprintf("%v", claims[a.JwtConfig.IssName]) - kilidash := a.Keys[issuer] - - var key any - for i := range kilidash { - key = a.Keys[issuer][i] - } + key := a.Keys[issuer][index] return key, nil @@ -54,9 +48,10 @@ func (a Authenticator) Auth(tokenString string) error { if err == nil { return nil } + return fmt.Errorf("token is invalid: %w", err) } - return ErrInvalidSigningMethod + return nil } // ACL check a user access to a topic. diff --git a/internal/config/default.go b/internal/config/default.go index 3aef20eb..37c30b73 100644 --- a/internal/config/default.go +++ b/internal/config/default.go @@ -140,65 +140,17 @@ func SnappVendor() Vendor { }, Keys: map[string][]string{ "0": []string{`-----BEGIN PUBLIC KEY----- - MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAu1SU1LfVLPHCozMxH2Mo - 4lgOEePzNm0tRgeLezV6ffAt0gunVTLw7onLRnrq0/IzW7yWR7QkrmBL7jTKEn5u - +qKhbwKfBstIs+bMY2Zkp18gnTxKLxoS2tFczGkPLPgizskuemMghRniWaoLcyeh - kd3qqGElvW/VDL5AaWTg0nLVkjRo9z+40RQzuVaE8AkAFmxZzow3x+VJYKdjykkJ - 0iT9wCS0DRTXu269V264Vf/3jvredZiKRkgwlL9xNAwxXFg0x/XFw005UWVRIkdg - cKWTjpBP2dPwVZ4WWC+9aGVd+Gyn1o0CLelf4rEjGoXbAAEgAqeGUxrcIlbjXfbc - mwIDAQAB ------END PUBLIC KEY-----`, `-----BEGIN PUBLIC KEY----- -MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAu1SU1LfVLPHCozMxH2Mo -4lgOEePzNm0tRgeLezV6ffAt0gunVTLw7onLRnrq0/IzW7yWR7QkrmBL7jTKEn5u -+qKhbwKfBstIs+bMY2Zkp18gnTxKLxoS2tFczGkPLPgizskuemMghRniWaoLcyeh -kd3qqGElvW/VDL5AaWTg0nLVkjRo9z+40RQzuVaE8AkAFmxZzow3x+VJYKdjykkJ -0iT9wCS0DRTXu269V264Vf/3jvredZiKRkgwlL9xNAwxXFg0x/XFw005UWVRIkdg -cKWTjpBP2dPwVZ4WWC+9aGVd+Gyn1o0CLelf4rEjGoXbAAEgAqeGUxrcIlbjXfbc -mwIDAQAB ------END PUBLIC KEY-----`, `-----BEGIN PUBLIC KEY----- -MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAu1SU1LfVLPHCozMxH2Mo -4lgOEePzNm0tRgeLezV6ffAt0gunVTLw7onLRnrq0/IzW7yWR7QkrmBL7jTKEn5u -+qKhbwKfBstIs+bMY2Zkp18gnTxKLxoS2tFczGkPLPgizskuemMghRniWaoLcyeh -kd3qqGElvW/VDL5AaWTg0nLVkjRo9z+40RQzuVaE8AkAFmxZzow3x+VJYKdjykkJ -0iT9wCS0DRTXu269V264Vf/3jvredZiKRkgwlL9xNAwxXFg0x/XFw005UWVRIkdg -cKWTjpBP2dPwVZ4WWC+9aGVd+Gyn1o0CLelf4rEjGoXbAAEgAqeGUxrcIlbjXfbc -mwIDAQAB ------END PUBLIC KEY-----`, `-----BEGIN PUBLIC KEY----- -MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAu1SU1LfVLPHCozMxH2Mo -4lgOEePzNm0tRgeLezV6ffAt0gunVTLw7onLRnrq0/IzW7yWR7QkrmBL7jTKEn5u -+qKhbwKfBstIs+bMY2Zkp18gnTxKLxoS2tFczGkPLPgizskuemMghRniWaoLcyeh -kd3qqGElvW/VDL5AaWTg0nLVkjRo9z+40RQzuVaE8AkAFmxZzow3x+VJYKdjykkJ -0iT9wCS0DRTXu269V264Vf/3jvredZiKRkgwlL9xNAwxXFg0x/XFw005UWVRIkdg -cKWTjpBP2dPwVZ4WWC+9aGVd+Gyn1o0CLelf4rEjGoXbAAEgAqeGUxrcIlbjXfbc -mwIDAQAB ------END PUBLIC KEY-----`, `-----BEGIN PUBLIC KEY----- -MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAu1SU1LfVLPHCozMxH2Mo -4lgOEePzNm0tRgeLezV6ffAt0gunVTLw7onLRnrq0/IzW7yWR7QkrmBL7jTKEn5u -+qKhbwKfBstIs+bMY2Zkp18gnTxKLxoS2tFczGkPLPgizskuemMghRniWaoLcyeh -kd3qqGElvW/VDL5AaWTg0nLVkjRo9z+40RQzuVaE8AkAFmxZzow3x+VJYKdjykkJ -0iT9wCS0DRTXu269V264Vf/3jvredZiKRkgwlL9xNAwxXFg0x/XFw005UWVRIkdg -cKWTjpBP2dPwVZ4WWC+9aGVd+Gyn1o0CLelf4rEjGoXbAAEgAqeGUxrcIlbjXfbc -mwIDAQAB ------END PUBLIC KEY-----`, `-----BEGIN PUBLIC KEY----- -MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAyG4XpV9TpDfgWJF9TiIv - va4hNhDuqYMJO6iXLzr3y8oCvoB7zUK0EjtbLH+A3gr1kUvyZKDWT4qHTvU2Sshm - X+ttWGK34EhCvF3Lb18yxmVDSSK8JIcTaJjMqmyubxzamQnNoWazJ7ea9BIo2YGL - C9rgPbi1hihhdb07xPGUkJRqbWkI98xjDhKdMqiwW1hIRXm/apo++FjptvqvF84s - ynC5gWGFHiGNICRsLJBczLEAf2Atbafigq6/tovzMabnp2yRtr1ReEgioH1RO4gX - J7F4N5f6y/VWd8+sDOSxtS/HcnP/7g8/A54G2IbXxr+EiwOO/1F+pyMPKq7sGDSU - DwIDAQAB + MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAyG4XpV9TpDfgWJF9TiIv + va4hNhDuqYMJO6iXLzr3y8oCvoB7zUK0EjtbLH+A3gr1kUvyZKDWT4qHTvU2Sshm + X+ttWGK34EhCvF3Lb18yxmVDSSK8JIcTaJjMqmyubxzamQnNoWazJ7ea9BIo2YGL + C9rgPbi1hihhdb07xPGUkJRqbWkI98xjDhKdMqiwW1hIRXm/apo++FjptvqvF84s + ynC5gWGFHiGNICRsLJBczLEAf2Atbafigq6/tovzMabnp2yRtr1ReEgioH1RO4gX + J7F4N5f6y/VWd8+sDOSxtS/HcnP/7g8/A54G2IbXxr+EiwOO/1F+pyMPKq7sGDSU + DwIDAQAB -----END PUBLIC KEY-----`}, "1": []string{`-----BEGIN PUBLIC KEY----- MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA5SeRfOdTyvQZ7N9ahFHl - +J05r7e9fgOQ2cpOtnnsIjAjCt1dF7/NkqVifEaxABRBGG9iXIw//G4hi0TqoKqK - aoSHMGf6q9pSRLGyB8FatxZf2RBTgrXYqVvpasbnB1ZNv858yTpRjV9NzJXYHLp8 - 8Hbd/yYTR6Q7ajs11/SMLGO7KBELsI1pBz7UW/fngJ2pRmd+RkG+EcGrOIZ27TkI - Xjtog6bgfmtV9FWxSVdKACOY0OmW+g7jIMik2eZTYG3kgCmW2odu3zRoUa7l9VwN - YMuhTePaIWwOifzRQt8HDsAOpzqJuLCoYX7HmBfpGAnwu4BuTZgXVwpvPNb+KlgS - pQIDAQAB ------END PUBLIC KEY-----`, `-----BEGIN PUBLIC KEY----- -MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA5SeRfOdTyvQZ7N9ahFHl +J05r7e9fgOQ2cpOtnnsIjAjCt1dF7/NkqVifEaxABRBGG9iXIw//G4hi0TqoKqK aoSHMGf6q9pSRLGyB8FatxZf2RBTgrXYqVvpasbnB1ZNv858yTpRjV9NzJXYHLp8 8Hbd/yYTR6Q7ajs11/SMLGO7KBELsI1pBz7UW/fngJ2pRmd+RkG+EcGrOIZ27TkI From 5e579ec40fc204d0bd9669f9e80bb289427c18a7 Mon Sep 17 00:00:00 2001 From: davidcopperfield1991 Date: Wed, 3 May 2023 13:19:11 +0330 Subject: [PATCH 375/660] fix lint issues --- internal/authenticator/authenticator.go | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/internal/authenticator/authenticator.go b/internal/authenticator/authenticator.go index 67e230c7..16485290 100644 --- a/internal/authenticator/authenticator.go +++ b/internal/authenticator/authenticator.go @@ -21,11 +21,8 @@ type Authenticator struct { // Auth check user authentication by checking the user's token // isSuperuser is a flag that authenticator set it true when credentials is related to a superuser. func (a Authenticator) Auth(tokenString string) error { - - for index := 0; index < len(a.Keys["0"]); index++ { - + for index := 0; index < len(a.Keys["0"]); index++ { //nolint:staticcheck _, err := jwt.Parse(tokenString, func(token *jwt.Token) (interface{}, error) { - if token.Method.Alg() != a.JwtConfig.SigningMethod { return nil, ErrInvalidSigningMethod } @@ -48,7 +45,8 @@ func (a Authenticator) Auth(tokenString string) error { if err == nil { return nil } - return fmt.Errorf("token is invalid: %w", err) + + return fmt.Errorf("token is invalid: %w", err) //nolint:staticcheck } return nil From be4bfd1cef9cda40b404cf0ba702be51d91ec3ac Mon Sep 17 00:00:00 2001 From: "ahmad.mohammadi" Date: Wed, 3 May 2023 15:56:54 +0430 Subject: [PATCH 376/660] fix: fix error issue --- internal/authenticator/authenticator.go | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/internal/authenticator/authenticator.go b/internal/authenticator/authenticator.go index 16485290..51394d82 100644 --- a/internal/authenticator/authenticator.go +++ b/internal/authenticator/authenticator.go @@ -21,8 +21,9 @@ type Authenticator struct { // Auth check user authentication by checking the user's token // isSuperuser is a flag that authenticator set it true when credentials is related to a superuser. func (a Authenticator) Auth(tokenString string) error { + var err error for index := 0; index < len(a.Keys["0"]); index++ { //nolint:staticcheck - _, err := jwt.Parse(tokenString, func(token *jwt.Token) (interface{}, error) { + _, err = jwt.Parse(tokenString, func(token *jwt.Token) (interface{}, error) { if token.Method.Alg() != a.JwtConfig.SigningMethod { return nil, ErrInvalidSigningMethod } @@ -45,11 +46,9 @@ func (a Authenticator) Auth(tokenString string) error { if err == nil { return nil } - - return fmt.Errorf("token is invalid: %w", err) //nolint:staticcheck } - return nil + return fmt.Errorf("token is invalid: %w", err) //nolint:staticcheck } // ACL check a user access to a topic. From 555cbcb4671ebdbac1627bbb8d1977fa66869eda Mon Sep 17 00:00:00 2001 From: "ahmad.mohammadi" Date: Wed, 3 May 2023 16:08:35 +0430 Subject: [PATCH 377/660] fix: fix test issue --- internal/authenticator/authenticator_test.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/internal/authenticator/authenticator_test.go b/internal/authenticator/authenticator_test.go index 2eb89331..541fd47f 100644 --- a/internal/authenticator/authenticator_test.go +++ b/internal/authenticator/authenticator_test.go @@ -104,8 +104,8 @@ func (suite *AuthenticatorTestSuite) SetupSuite() { suite.Authenticator = authenticator.Authenticator{ Keys: map[string][]any{ - // topics.DriverIss: pkey0, - // topics.PassengerIss: pkey1, + topics.DriverIss: []any{pkey0}, + topics.PassengerIss: []any{pkey1}, }, AllowedAccessTypes: []acl.AccessType{acl.Pub, acl.Sub, acl.PubSub}, Company: "snapp", From 48ba5c5e576b4b92722fced03d02511f40108342 Mon Sep 17 00:00:00 2001 From: davidcopperfield1991 Date: Wed, 3 May 2023 15:31:50 +0330 Subject: [PATCH 378/660] fix lint issues --- internal/authenticator/authenticator.go | 1 - internal/authenticator/key.go | 6 ++---- internal/config/default.go | 4 ++-- 3 files changed, 4 insertions(+), 7 deletions(-) diff --git a/internal/authenticator/authenticator.go b/internal/authenticator/authenticator.go index 51394d82..d05191fb 100644 --- a/internal/authenticator/authenticator.go +++ b/internal/authenticator/authenticator.go @@ -41,7 +41,6 @@ func (a Authenticator) Auth(tokenString string) error { key := a.Keys[issuer][index] return key, nil - }) if err == nil { return nil diff --git a/internal/authenticator/key.go b/internal/authenticator/key.go index ad9f58b6..afaa2b8c 100644 --- a/internal/authenticator/key.go +++ b/internal/authenticator/key.go @@ -28,10 +28,8 @@ func (b Builder) GenerateRsaKeys(raw map[string][]string) map[string][]any { rsaKeys := make(map[string][]any) for iss, publicKey := range raw { - for i, _ := range publicKey { - + for i := range publicKey { rsaKey, err := jwt.ParseRSAPublicKeyFromPEM([]byte(publicKey[i])) - if err != nil { b.Logger.Fatal("could not read public key", zap.String("issuer", iss), zap.Error(err)) } @@ -47,7 +45,7 @@ func (b Builder) GenerateHMacKeys(raw map[string][]string) map[string][]any { keys := make(map[string][]any) for iss, key := range raw { - for i, _ := range key { + for i := range key { bytes, err := base64.StdEncoding.DecodeString(key[i]) if err != nil { b.Logger.Fatal("failed to generate hmac key from base64", zap.Error(err)) diff --git a/internal/config/default.go b/internal/config/default.go index 37c30b73..7430c679 100644 --- a/internal/config/default.go +++ b/internal/config/default.go @@ -139,7 +139,7 @@ func SnappVendor() Vendor { }, }, Keys: map[string][]string{ - "0": []string{`-----BEGIN PUBLIC KEY----- + "0": {`-----BEGIN PUBLIC KEY----- MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAyG4XpV9TpDfgWJF9TiIv va4hNhDuqYMJO6iXLzr3y8oCvoB7zUK0EjtbLH+A3gr1kUvyZKDWT4qHTvU2Sshm X+ttWGK34EhCvF3Lb18yxmVDSSK8JIcTaJjMqmyubxzamQnNoWazJ7ea9BIo2YGL @@ -149,7 +149,7 @@ func SnappVendor() Vendor { DwIDAQAB -----END PUBLIC KEY-----`}, - "1": []string{`-----BEGIN PUBLIC KEY----- + "1": {`-----BEGIN PUBLIC KEY----- MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA5SeRfOdTyvQZ7N9ahFHl +J05r7e9fgOQ2cpOtnnsIjAjCt1dF7/NkqVifEaxABRBGG9iXIw//G4hi0TqoKqK aoSHMGf6q9pSRLGyB8FatxZf2RBTgrXYqVvpasbnB1ZNv858yTpRjV9NzJXYHLp8 From 39603081e60837de83b8aba7d25a5c44109df1d5 Mon Sep 17 00:00:00 2001 From: Parham Alvani Date: Sat, 24 Jun 2023 21:52:05 +0330 Subject: [PATCH 379/660] feat: add dovalidate flag for using sdk-base authentication --- internal/config/config.go | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/internal/config/config.go b/internal/config/config.go index ee4f384a..4ca29075 100644 --- a/internal/config/config.go +++ b/internal/config/config.go @@ -32,14 +32,17 @@ type ( } Vendor struct { - AllowedAccessTypes []string `koanf:"allowed_access_types"` - Company string `koanf:"company"` - Topics []topics.Topic `koanf:"topics"` - Keys map[string][]string `koanf:"keys"` - IssEntityMap map[string]string `koanf:"iss_entity_map"` - IssPeerMap map[string]string `koanf:"iss_peer_map"` - Jwt Jwt `koanf:"jwt"` - HashIDMap map[string]topics.HashData `koanf:"hashid_map"` + AllowedAccessTypes []string `koanf:"allowed_access_types"` + Company string `koanf:"company"` + Topics []topics.Topic `koanf:"topics"` + Keys map[string][]string `koanf:"keys"` + IssEntityMap map[string]string `koanf:"iss_entity_map"` + IssPeerMap map[string]string `koanf:"iss_peer_map"` + Jwt Jwt `koanf:"jwt"` + // by setting do validate to false we don't validate the jwt token and deligate + // it into a function. + DoValidate bool `koanf:"do_validate"` + HashIDMap map[string]topics.HashData `koanf:"hashid_map"` } Jwt struct { From 7ffa173f6ded4f422b7629e36a00d112f6678aa7 Mon Sep 17 00:00:00 2001 From: Parham Alvani Date: Sat, 24 Jun 2023 21:53:29 +0330 Subject: [PATCH 380/660] feat: disable bad linter --- .golangci.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.golangci.yml b/.golangci.yml index 51b0838b..34fd1c91 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -8,6 +8,7 @@ linters: - varnamelen - ireturn - musttag + - depguard # deprecated linters - maligned - scopelint From 27addc13b899ef222b12da1f54a90fac5ba3a35f Mon Sep 17 00:00:00 2001 From: Mohammad Khoddam Date: Mon, 3 Jul 2023 10:42:46 +0330 Subject: [PATCH 381/660] feat: add validator logic and interface --- go.mod | 4 +- go.sum | 12 +- internal/api/acl.go | 8 +- internal/api/api.go | 4 +- internal/api/auth.go | 6 +- internal/authenticator/authenticator.go | 137 ++--------------- internal/authenticator/autoAuthenticator.go | 52 +++++++ internal/authenticator/builder.go | 42 ++++-- internal/authenticator/manualAuthenticator.go | 141 ++++++++++++++++++ ...or_test.go => manualAuthenticator_test.go} | 6 +- internal/config/config.go | 4 +- internal/config/default.go | 1 + 12 files changed, 253 insertions(+), 164 deletions(-) create mode 100644 internal/authenticator/autoAuthenticator.go create mode 100644 internal/authenticator/manualAuthenticator.go rename internal/authenticator/{authenticator_test.go => manualAuthenticator_test.go} (99%) diff --git a/go.mod b/go.mod index cc703fa1..b5825649 100644 --- a/go.mod +++ b/go.mod @@ -10,7 +10,7 @@ require ( github.com/prometheus/client_golang v1.14.0 // indirect github.com/speps/go-hashids/v2 v2.0.1 github.com/spf13/cobra v1.6.1 - github.com/stretchr/testify v1.8.2 + github.com/stretchr/testify v1.8.4 github.com/tidwall/pretty v1.2.1 go.opentelemetry.io/otel v1.14.0 go.opentelemetry.io/otel/exporters/jaeger v1.14.0 @@ -37,6 +37,7 @@ require ( github.com/google/uuid v1.3.0 // indirect github.com/inconshreveable/mousetrap v1.1.0 // indirect github.com/klauspost/compress v1.16.3 // indirect + github.com/kr/text v0.2.0 // indirect github.com/mattn/go-colorable v0.1.13 // indirect github.com/mattn/go-isatty v0.0.18 // indirect github.com/mattn/go-runewidth v0.0.14 // indirect @@ -53,7 +54,6 @@ require ( github.com/savsgio/dictpool v0.0.0-20221023140959-7bf2e61cea94 // indirect github.com/savsgio/gotils v0.0.0-20230208104028-c358bd845dee // indirect github.com/spf13/pflag v1.0.5 // indirect - github.com/stretchr/objx v0.5.0 // indirect github.com/tinylib/msgp v1.1.8 // indirect github.com/valyala/bytebufferpool v1.0.0 // indirect github.com/valyala/fasthttp v1.45.0 // indirect diff --git a/go.sum b/go.sum index f2c8ad41..ad7c56ba 100644 --- a/go.sum +++ b/go.sum @@ -78,6 +78,7 @@ github.com/cncf/udpa/go v0.0.0-20201120205902-5459f2c99403/go.mod h1:WmhPx2Nbnht github.com/coreos/go-semver v0.3.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk= github.com/coreos/go-systemd/v22 v22.3.2/go.mod h1:Y58oyj3AT4RCenI/lSvhwexgC+NSVTIJ3seZv2GcEnc= github.com/cpuguy83/go-md2man/v2 v2.0.2/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= +github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= @@ -258,8 +259,9 @@ github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORN github.com/kr/pretty v0.2.0 h1:s5hAObm+yFO5uHYt5dYjxi2rXrsnmRpJx4OYvIWUaQs= github.com/kr/pretty v0.2.0/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= -github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= +github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= +github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU= github.com/mattn/go-colorable v0.1.4/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE= github.com/mattn/go-colorable v0.1.6/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= @@ -379,18 +381,14 @@ github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA= github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= -github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw= github.com/stretchr/objx v0.5.0 h1:1zr/of2m5FGMsad5YfcqgdqdWrIhu+EBEJRhR1U7z/c= -github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo= github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA= 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= -github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= -github.com/stretchr/testify v1.8.2 h1:+h33VjcLVPDHtOdpUCuF+7gSuG3yGIftsP1YvFihtJ8= -github.com/stretchr/testify v1.8.2/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= +github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk= +github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= github.com/tidwall/pretty v1.2.1 h1:qjsOFOWWQl+N3RsoF5/ssm1pHmJJwhjlSbZ51I6wMl4= github.com/tidwall/pretty v1.2.1/go.mod h1:ITEVvHYasfjBbM0u2Pg8T2nJnzm8xPwvNhhsoaGGjNU= github.com/tinylib/msgp v1.1.6/go.mod h1:75BAfg2hauQhs3qedfdDZmWAPcFMAvJE5b9rGOMufyw= diff --git a/internal/api/acl.go b/internal/api/acl.go index 168f8273..5e943dc9 100644 --- a/internal/api/acl.go +++ b/internal/api/acl.go @@ -52,7 +52,7 @@ func (a API) ACL(c *fiber.Ctx) error { attribute.String("token", request.Token), attribute.String("username", request.Username), attribute.String("password", request.Password), - attribute.String("authenticator", auth.Company), + attribute.String("authenticator", auth.GetCompany()), ) ok, err := auth.ACL(request.Access, token, topic) @@ -72,7 +72,7 @@ func (a API) ACL(c *fiber.Ctx) error { zap.String("token", request.Token), zap.String("username", request.Username), zap.String("password", request.Password), - zap.String("authenticator", auth.Company)) + zap.String("authenticator", auth.GetCompany())) } else { a.Logger. Error("acl request is not authorized", @@ -82,7 +82,7 @@ func (a API) ACL(c *fiber.Ctx) error { zap.String("token", request.Token), zap.String("username", request.Username), zap.String("password", request.Password), - zap.String("authenticator", auth.Company)) + zap.String("authenticator", auth.GetCompany())) } return c.Status(http.StatusUnauthorized).SendString("request is not authorized") @@ -95,7 +95,7 @@ func (a API) ACL(c *fiber.Ctx) error { zap.String("token", request.Token), zap.String("username", request.Username), zap.String("password", request.Password), - zap.String("authenticator", auth.Company), + zap.String("authenticator", auth.GetCompany()), ) return c.Status(http.StatusOK).SendString("ok") diff --git a/internal/api/api.go b/internal/api/api.go index f58b0b79..d3cb2ae1 100644 --- a/internal/api/api.go +++ b/internal/api/api.go @@ -14,7 +14,7 @@ import ( const VendorTokenSeparator = ":" type API struct { - Authenticators map[string]*authenticator.Authenticator + Authenticators map[string]authenticator.Authenticator DefaultVendor string Tracer trace.Tracer Logger *zap.Logger @@ -47,7 +47,7 @@ func (a API) ReSTServer() *fiber.App { return app } -func (a API) Authenticator(vendor string) *authenticator.Authenticator { +func (a API) Authenticator(vendor string) authenticator.Authenticator { auth, ok := a.Authenticators[vendor] if ok { diff --git a/internal/api/auth.go b/internal/api/auth.go index 95526f97..61a0d418 100644 --- a/internal/api/auth.go +++ b/internal/api/auth.go @@ -42,7 +42,7 @@ func (a API) Auth(c *fiber.Ctx) error { attribute.String("token", request.Token), attribute.String("username", request.Username), attribute.String("password", request.Password), - attribute.String("authenticator", authenticator.Company), + attribute.String("authenticator", authenticator.GetCompany()), ) if err := authenticator.Auth(token); err != nil { @@ -54,7 +54,7 @@ func (a API) Auth(c *fiber.Ctx) error { zap.String("token", request.Token), zap.String("username", request.Username), zap.String("password", request.Password), - zap.String("authenticator", authenticator.Company), + zap.String("authenticator", authenticator.GetCompany()), ) return c.Status(http.StatusUnauthorized).SendString("request is not authorized") @@ -65,7 +65,7 @@ func (a API) Auth(c *fiber.Ctx) error { zap.String("token", request.Token), zap.String("username", request.Username), zap.String("password", request.Password), - zap.String("authenticator", authenticator.Company), + zap.String("authenticator", authenticator.GetCompany()), ) return c.Status(http.StatusOK).SendString("ok") diff --git a/internal/authenticator/authenticator.go b/internal/authenticator/authenticator.go index d05191fb..0a7e530d 100644 --- a/internal/authenticator/authenticator.go +++ b/internal/authenticator/authenticator.go @@ -1,135 +1,20 @@ package authenticator import ( - "fmt" - - "github.com/golang-jwt/jwt/v5" - "gitlab.snapp.ir/dispatching/soteria/internal/config" - "gitlab.snapp.ir/dispatching/soteria/internal/topics" "gitlab.snapp.ir/dispatching/soteria/pkg/acl" ) -// Authenticator is responsible for Acl/Auth/Token of users. -type Authenticator struct { - Keys map[string][]any - AllowedAccessTypes []acl.AccessType - TopicManager *topics.Manager - Company string - JwtConfig config.Jwt -} - -// Auth check user authentication by checking the user's token -// isSuperuser is a flag that authenticator set it true when credentials is related to a superuser. -func (a Authenticator) Auth(tokenString string) error { - var err error - for index := 0; index < len(a.Keys["0"]); index++ { //nolint:staticcheck - _, err = jwt.Parse(tokenString, func(token *jwt.Token) (interface{}, error) { - if token.Method.Alg() != a.JwtConfig.SigningMethod { - return nil, ErrInvalidSigningMethod - } - - claims, ok := token.Claims.(jwt.MapClaims) - if !ok { - return nil, ErrInvalidClaims - } - if claims[a.JwtConfig.IssName] == nil { - return nil, ErrIssNotFound - } - - issuer := fmt.Sprintf("%v", claims[a.JwtConfig.IssName]) - - key := a.Keys[issuer][index] - - return key, nil - }) - if err == nil { - return nil - } - } - - return fmt.Errorf("token is invalid: %w", err) //nolint:staticcheck -} - -// ACL check a user access to a topic. -// nolint: funlen, cyclop -func (a Authenticator) ACL( - accessType acl.AccessType, - tokenString string, - topic string, -) (bool, error) { - if !a.ValidateAccessType(accessType) { - return false, ErrInvalidAccessType - } - - token, err := jwt.Parse(tokenString, func(token *jwt.Token) (interface{}, error) { - if token.Method.Alg() != a.JwtConfig.SigningMethod { - return nil, ErrInvalidSigningMethod - } - - claims, ok := token.Claims.(jwt.MapClaims) - if !ok { - return nil, ErrInvalidClaims - } - if claims[a.JwtConfig.IssName] == nil { - return nil, ErrIssNotFound - } - if claims[a.JwtConfig.SubName] == nil { - return nil, ErrSubNotFound - } - - issuer := fmt.Sprintf("%v", claims[a.JwtConfig.IssName]) - key := a.Keys[issuer] - if key == nil { - return nil, KeyNotFoundError{Issuer: issuer} - } - - return key, nil - }) - if err != nil { - return false, fmt.Errorf("token is invalid %w", err) - } - - claims, ok := token.Claims.(jwt.MapClaims) - if !ok { - return false, ErrInvalidClaims - } - - if claims[a.JwtConfig.IssName] == nil { - return false, ErrIssNotFound - } - - issuer := fmt.Sprintf("%v", claims[a.JwtConfig.IssName]) - - if claims[a.JwtConfig.SubName] == nil { - return false, ErrSubNotFound - } - - sub, _ := claims[a.JwtConfig.SubName].(string) - - topicTemplate := a.TopicManager.ParseTopic(topic, issuer, sub) - if topicTemplate == nil { - return false, InvalidTopicError{Topic: topic} - } - - if !topicTemplate.HasAccess(issuer, accessType) { - return false, TopicNotAllowedError{ - issuer, - sub, - accessType, - topic, - topicTemplate.Type, - } - } - - return true, nil -} +type Authenticator interface { + // Auth check user authentication by checking the user's token + Auth(tokenString string) error -func (a Authenticator) ValidateAccessType(accessType acl.AccessType) bool { - for _, allowedAccessType := range a.AllowedAccessTypes { - if allowedAccessType == accessType { - return true - } - } + // ACL check a user access to a topic. + ACL( + accessType acl.AccessType, + tokenString string, + topic string, + ) (bool, error) - return false + // GetCompany Return the Company Field of The Inherited Objects + GetCompany() string } diff --git a/internal/authenticator/autoAuthenticator.go b/internal/authenticator/autoAuthenticator.go new file mode 100644 index 00000000..997c4876 --- /dev/null +++ b/internal/authenticator/autoAuthenticator.go @@ -0,0 +1,52 @@ +package authenticator + +import ( + "gitlab.snapp.ir/dispatching/soteria/internal/config" + "gitlab.snapp.ir/dispatching/soteria/internal/topics" + "gitlab.snapp.ir/dispatching/soteria/pkg/acl" +) + +// AutoAuthenticator is responsible for Acl/Auth/Token of users. +type AutoAuthenticator struct { + Keys map[string][]any + AllowedAccessTypes []acl.AccessType + TopicManager *topics.Manager + Company string + JwtConfig config.Jwt +} + +// Auth check user authentication by checking the user's token +// isSuperuser is a flag that authenticator set it true when credentials is related to a superuser. +func (a AutoAuthenticator) Auth(tokenString string) error { + _ = tokenString + + return nil +} + +// ACL check a user access to a topic. +// nolint: funlen, cyclop +func (a AutoAuthenticator) ACL( + accessType acl.AccessType, + tokenString string, + topic string, +) (bool, error) { + _ = accessType + _ = tokenString + _ = topic + + return false, nil +} + +func (a AutoAuthenticator) ValidateAccessType(accessType acl.AccessType) bool { + for _, allowedAccessType := range a.AllowedAccessTypes { + if allowedAccessType == accessType { + return true + } + } + + return false +} + +func (a AutoAuthenticator) GetCompany() string { + return a.Company +} diff --git a/internal/authenticator/builder.go b/internal/authenticator/builder.go index 59333d01..8efe2e46 100644 --- a/internal/authenticator/builder.go +++ b/internal/authenticator/builder.go @@ -14,8 +14,8 @@ type Builder struct { Logger zap.Logger } -func (b Builder) Authenticators() map[string]*Authenticator { - all := make(map[string]*Authenticator) +func (b Builder) Authenticators() map[string]Authenticator { + all := make(map[string]Authenticator) for _, vendor := range b.Vendors { b.ValidateMappers(vendor.IssEntityMap, vendor.IssPeerMap) @@ -28,19 +28,31 @@ func (b Builder) Authenticators() map[string]*Authenticator { b.Logger.Fatal("cannot create hash-id manager", zap.Error(err)) } - auth := &Authenticator{ - Keys: keys, - AllowedAccessTypes: allowedAccessTypes, - Company: vendor.Company, - TopicManager: topics.NewTopicManager( - vendor.Topics, - hid, - vendor.Company, - vendor.IssEntityMap, - vendor.IssPeerMap, - b.Logger.Named("topic-manager"), - ), - JwtConfig: vendor.Jwt, + var auth Authenticator + + if vendor.UseValidator { + auth = &AutoAuthenticator{ + Keys: nil, + AllowedAccessTypes: nil, + TopicManager: nil, + Company: "", + JwtConfig: config.Jwt{}, //nolint:exhaustruct + } + } else { + auth = &ManualAuthenticator{ + Keys: keys, + AllowedAccessTypes: allowedAccessTypes, + Company: vendor.Company, + TopicManager: topics.NewTopicManager( + vendor.Topics, + hid, + vendor.Company, + vendor.IssEntityMap, + vendor.IssPeerMap, + b.Logger.Named("topic-manager"), + ), + JwtConfig: vendor.Jwt, + } } all[vendor.Company] = auth diff --git a/internal/authenticator/manualAuthenticator.go b/internal/authenticator/manualAuthenticator.go new file mode 100644 index 00000000..34821f80 --- /dev/null +++ b/internal/authenticator/manualAuthenticator.go @@ -0,0 +1,141 @@ +package authenticator + +import ( + "fmt" + + "github.com/golang-jwt/jwt/v5" + "gitlab.snapp.ir/dispatching/soteria/internal/config" + "gitlab.snapp.ir/dispatching/soteria/internal/topics" + "gitlab.snapp.ir/dispatching/soteria/pkg/acl" +) + +// ManualAuthenticator is responsible for Acl/Auth/Token of users. +type ManualAuthenticator struct { + Keys map[string][]any + AllowedAccessTypes []acl.AccessType + TopicManager *topics.Manager + Company string + JwtConfig config.Jwt +} + +// Auth check user authentication by checking the user's token +// isSuperuser is a flag that authenticator set it true when credentials is related to a superuser. +func (a ManualAuthenticator) Auth(tokenString string) error { + var err error + for index := 0; index < len(a.Keys["0"]); index++ { //nolint:staticcheck + _, err = jwt.Parse(tokenString, func( + token *jwt.Token, + ) (interface{}, error) { + if token.Method.Alg() != a.JwtConfig.SigningMethod { + return nil, ErrInvalidSigningMethod + } + + claims, ok := token.Claims.(jwt.MapClaims) + if !ok { + return nil, ErrInvalidClaims + } + if claims[a.JwtConfig.IssName] == nil { + return nil, ErrIssNotFound + } + + issuer := fmt.Sprintf("%v", claims[a.JwtConfig.IssName]) + + key := a.Keys[issuer][index] + + return key, nil + }) + if err == nil { + return nil + } + } + + return fmt.Errorf("token is invalid: %w", err) //nolint:staticcheck +} + +// ACL check a user access to a topic. +// nolint: funlen, cyclop +func (a ManualAuthenticator) ACL( + accessType acl.AccessType, + tokenString string, + topic string, +) (bool, error) { + if !a.ValidateAccessType(accessType) { + return false, ErrInvalidAccessType + } + + token, err := jwt.Parse(tokenString, func(token *jwt.Token) (interface{}, error) { + if token.Method.Alg() != a.JwtConfig.SigningMethod { + return nil, ErrInvalidSigningMethod + } + + claims, ok := token.Claims.(jwt.MapClaims) + if !ok { + return nil, ErrInvalidClaims + } + if claims[a.JwtConfig.IssName] == nil { + return nil, ErrIssNotFound + } + if claims[a.JwtConfig.SubName] == nil { + return nil, ErrSubNotFound + } + + issuer := fmt.Sprintf("%v", claims[a.JwtConfig.IssName]) + key := a.Keys[issuer] + if key == nil { + return nil, KeyNotFoundError{Issuer: issuer} + } + + return key, nil + }) + if err != nil { + return false, fmt.Errorf("token is invalid %w", err) + } + + claims, ok := token.Claims.(jwt.MapClaims) + if !ok { + return false, ErrInvalidClaims + } + + if claims[a.JwtConfig.IssName] == nil { + return false, ErrIssNotFound + } + + issuer := fmt.Sprintf("%v", claims[a.JwtConfig.IssName]) + + if claims[a.JwtConfig.SubName] == nil { + return false, ErrSubNotFound + } + + sub, _ := claims[a.JwtConfig.SubName].(string) + + topicTemplate := a.TopicManager.ParseTopic(topic, issuer, sub) + if topicTemplate == nil { + return false, InvalidTopicError{Topic: topic} + } + + if !topicTemplate.HasAccess(issuer, accessType) { + return false, TopicNotAllowedError{ + issuer, + sub, + accessType, + topic, + topicTemplate.Type, + } + } + + return true, nil +} + +func (a ManualAuthenticator) ValidateAccessType(accessType acl.AccessType) bool { + for _, allowedAccessType := range a.AllowedAccessTypes { + if allowedAccessType == accessType { + return true + } + } + + return false +} + +func (a ManualAuthenticator) GetCompany() string { + return a.Company +} diff --git a/internal/authenticator/authenticator_test.go b/internal/authenticator/manualAuthenticator_test.go similarity index 99% rename from internal/authenticator/authenticator_test.go rename to internal/authenticator/manualAuthenticator_test.go index 541fd47f..3fc99d18 100644 --- a/internal/authenticator/authenticator_test.go +++ b/internal/authenticator/manualAuthenticator_test.go @@ -102,7 +102,7 @@ func (suite *AuthenticatorTestSuite) SetupSuite() { hid, err := topics.NewHashIDManager(cfg.HashIDMap) require.NoError(err) - suite.Authenticator = authenticator.Authenticator{ + suite.Authenticator = authenticator.ManualAuthenticator{ Keys: map[string][]any{ topics.DriverIss: []any{pkey0}, topics.PassengerIss: []any{pkey1}, @@ -336,7 +336,7 @@ func TestAuthenticator_ValidateTopicBySender(t *testing.T) { assert.NoError(t, err) // nolint: exhaustruct - authenticator := authenticator.Authenticator{ + authenticator := authenticator.ManualAuthenticator{ AllowedAccessTypes: []acl.AccessType{acl.Pub, acl.Sub}, Company: "snapp", TopicManager: topics.NewTopicManager(cfg.Topics, hid, "snapp", cfg.IssEntityMap, cfg.IssPeerMap, zap.NewNop()), @@ -428,7 +428,7 @@ func TestAuthenticator_validateAccessType(t *testing.T) { t.Parallel() // nolint: exhaustruct - a := authenticator.Authenticator{ + a := authenticator.ManualAuthenticator{ AllowedAccessTypes: tt.fields.AllowedAccessTypes, } if got := a.ValidateAccessType(tt.args.accessType); got != tt.want { diff --git a/internal/config/config.go b/internal/config/config.go index 4ca29075..a2c72e8b 100644 --- a/internal/config/config.go +++ b/internal/config/config.go @@ -41,8 +41,8 @@ type ( Jwt Jwt `koanf:"jwt"` // by setting do validate to false we don't validate the jwt token and deligate // it into a function. - DoValidate bool `koanf:"do_validate"` - HashIDMap map[string]topics.HashData `koanf:"hashid_map"` + UseValidator bool `koanf:"use_validator"` + HashIDMap map[string]topics.HashData `koanf:"hashid_map"` } Jwt struct { diff --git a/internal/config/default.go b/internal/config/default.go index 7430c679..474ee69e 100644 --- a/internal/config/default.go +++ b/internal/config/default.go @@ -39,6 +39,7 @@ func Default() Config { //nolint:funlen func SnappVendor() Vendor { return Vendor{ + UseValidator: false, AllowedAccessTypes: []string{ "pub", "sub", From 7eea50ff5cfae439b8fe50a5c831decb8211c493 Mon Sep 17 00:00:00 2001 From: Mohammad Khoddam Date: Mon, 3 Jul 2023 13:17:29 +0330 Subject: [PATCH 382/660] feat: auth validator logic was added --- go.mod | 6 +- go.sum | 5 +- internal/authenticator/authenticator.go | 3 + internal/authenticator/autoAuthenticator.go | 83 +++++++++++++++++-- internal/authenticator/builder.go | 26 ++++-- internal/authenticator/manualAuthenticator.go | 2 +- internal/cmd/serve/main.go | 11 ++- internal/config/config.go | 7 ++ internal/config/default.go | 6 ++ 9 files changed, 127 insertions(+), 22 deletions(-) diff --git a/go.mod b/go.mod index b5825649..2d316ba1 100644 --- a/go.mod +++ b/go.mod @@ -21,7 +21,10 @@ require ( go.uber.org/zap v1.24.0 ) -require github.com/golang-jwt/jwt/v5 v5.0.0-rc.1 +require ( + github.com/golang-jwt/jwt/v5 v5.0.0-rc.1 + gitlab.snapp.ir/security_regulatory/validator/pkg/sdk v0.2.1 +) require ( github.com/andybalholm/brotli v1.0.5 // indirect @@ -37,7 +40,6 @@ require ( github.com/google/uuid v1.3.0 // indirect github.com/inconshreveable/mousetrap v1.1.0 // indirect github.com/klauspost/compress v1.16.3 // indirect - github.com/kr/text v0.2.0 // indirect github.com/mattn/go-colorable v0.1.13 // indirect github.com/mattn/go-isatty v0.0.18 // indirect github.com/mattn/go-runewidth v0.0.14 // indirect diff --git a/go.sum b/go.sum index ad7c56ba..d105c4b1 100644 --- a/go.sum +++ b/go.sum @@ -33,6 +33,7 @@ cloud.google.com/go/storage v1.10.0/go.mod h1:FLPqc6j+Ki4BU591ie1oL6qBQGu2Bl/tZ9 dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= +github.com/agiledragon/gomonkey/v2 v2.10.1 h1:FPJJNykD1957cZlGhr9X0zjr291/lbazoZ/dmc4mS4c= github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= @@ -78,7 +79,6 @@ github.com/cncf/udpa/go v0.0.0-20201120205902-5459f2c99403/go.mod h1:WmhPx2Nbnht github.com/coreos/go-semver v0.3.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk= github.com/coreos/go-systemd/v22 v22.3.2/go.mod h1:Y58oyj3AT4RCenI/lSvhwexgC+NSVTIJ3seZv2GcEnc= github.com/cpuguy83/go-md2man/v2 v2.0.2/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= -github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= @@ -261,7 +261,6 @@ github.com/kr/pretty v0.2.0/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfn github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= -github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU= github.com/mattn/go-colorable v0.1.4/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE= github.com/mattn/go-colorable v0.1.6/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= @@ -408,6 +407,8 @@ github.com/yuin/goldmark v1.1.32/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9de github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.3.5/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY= +gitlab.snapp.ir/security_regulatory/validator/pkg/sdk v0.2.1 h1:5R+WK9NRRaKXItZZzOcPV1yJQflm/MbXGsN+7BXhpKQ= +gitlab.snapp.ir/security_regulatory/validator/pkg/sdk v0.2.1/go.mod h1:Y21ZWyfYMWKqotRn1i1BoI6ieZJs9qaoAppHNXFgnKs= go.etcd.io/etcd/api/v3 v3.5.4/go.mod h1:5GB2vv4A4AOn3yk7MftYGHkUfGtDHnEraIjym4dYz5A= go.etcd.io/etcd/client/pkg/v3 v3.5.4/go.mod h1:IJHfcCEKxYu1Os13ZdwCwIUTUVGYTSAM3YSwc9/Ac1g= go.etcd.io/etcd/client/v3 v3.5.4/go.mod h1:ZaRkVgBZC+L+dLCjTcF1hRXpgZXQPOvnA/Ak/gq3kiY= diff --git a/internal/authenticator/authenticator.go b/internal/authenticator/authenticator.go index 0a7e530d..64947037 100644 --- a/internal/authenticator/authenticator.go +++ b/internal/authenticator/authenticator.go @@ -15,6 +15,9 @@ type Authenticator interface { topic string, ) (bool, error) + // ValidateAccessType checks access type for specific topic + ValidateAccessType(accessType acl.AccessType) bool + // GetCompany Return the Company Field of The Inherited Objects GetCompany() string } diff --git a/internal/authenticator/autoAuthenticator.go b/internal/authenticator/autoAuthenticator.go index 997c4876..6624913b 100644 --- a/internal/authenticator/autoAuthenticator.go +++ b/internal/authenticator/autoAuthenticator.go @@ -1,9 +1,15 @@ package authenticator import ( + "context" + "fmt" + "net/http" + + "github.com/golang-jwt/jwt/v5" "gitlab.snapp.ir/dispatching/soteria/internal/config" "gitlab.snapp.ir/dispatching/soteria/internal/topics" "gitlab.snapp.ir/dispatching/soteria/pkg/acl" + validatorSDK "gitlab.snapp.ir/security_regulatory/validator/pkg/sdk" ) // AutoAuthenticator is responsible for Acl/Auth/Token of users. @@ -13,28 +19,93 @@ type AutoAuthenticator struct { TopicManager *topics.Manager Company string JwtConfig config.Jwt + Validator validatorSDK.Client } // Auth check user authentication by checking the user's token // isSuperuser is a flag that authenticator set it true when credentials is related to a superuser. func (a AutoAuthenticator) Auth(tokenString string) error { - _ = tokenString + if _, err := a.Validator.Validate(context.Background(), &http.Header{ + "X-Service-Name": []string{"Soteria"}, + }, tokenString); err != nil { + return fmt.Errorf("token is invalid: %w", err) //nolint:staticcheck + } return nil } // ACL check a user access to a topic. // nolint: funlen, cyclop -func (a AutoAuthenticator) ACL( +func (a AutoAuthenticator) ACL( //nolint:dupl accessType acl.AccessType, tokenString string, topic string, ) (bool, error) { - _ = accessType - _ = tokenString - _ = topic + if !a.ValidateAccessType(accessType) { + return false, ErrInvalidAccessType + } + + token, err := jwt.Parse(tokenString, func(token *jwt.Token) (interface{}, error) { + if token.Method.Alg() != a.JwtConfig.SigningMethod { + return nil, ErrInvalidSigningMethod + } + + claims, ok := token.Claims.(jwt.MapClaims) + if !ok { + return nil, ErrInvalidClaims + } + if claims[a.JwtConfig.IssName] == nil { + return nil, ErrIssNotFound + } + if claims[a.JwtConfig.SubName] == nil { + return nil, ErrSubNotFound + } + + issuer := fmt.Sprintf("%v", claims[a.JwtConfig.IssName]) + key := a.Keys[issuer] + if key == nil { + return nil, KeyNotFoundError{Issuer: issuer} + } + + return key, nil + }) + if err != nil { + return false, fmt.Errorf("token is invalid %w", err) + } + + claims, ok := token.Claims.(jwt.MapClaims) + if !ok { + return false, ErrInvalidClaims + } + + if claims[a.JwtConfig.IssName] == nil { + return false, ErrIssNotFound + } + + issuer := fmt.Sprintf("%v", claims[a.JwtConfig.IssName]) + + if claims[a.JwtConfig.SubName] == nil { + return false, ErrSubNotFound + } + + sub, _ := claims[a.JwtConfig.SubName].(string) + + topicTemplate := a.TopicManager.ParseTopic(topic, issuer, sub) + if topicTemplate == nil { + return false, InvalidTopicError{Topic: topic} + } + + if !topicTemplate.HasAccess(issuer, accessType) { + return false, TopicNotAllowedError{ + issuer, + sub, + accessType, + topic, + topicTemplate.Type, + } + } - return false, nil + return true, nil } func (a AutoAuthenticator) ValidateAccessType(accessType acl.AccessType) bool { diff --git a/internal/authenticator/builder.go b/internal/authenticator/builder.go index 8efe2e46..385595b4 100644 --- a/internal/authenticator/builder.go +++ b/internal/authenticator/builder.go @@ -6,12 +6,14 @@ import ( "gitlab.snapp.ir/dispatching/soteria/internal/config" "gitlab.snapp.ir/dispatching/soteria/internal/topics" "gitlab.snapp.ir/dispatching/soteria/pkg/acl" + validatorSDK "gitlab.snapp.ir/security_regulatory/validator/pkg/sdk" "go.uber.org/zap" ) type Builder struct { - Vendors []config.Vendor - Logger zap.Logger + Vendors []config.Vendor + Logger zap.Logger + ValidatorConfig config.Validator } func (b Builder) Authenticators() map[string]Authenticator { @@ -28,15 +30,25 @@ func (b Builder) Authenticators() map[string]Authenticator { b.Logger.Fatal("cannot create hash-id manager", zap.Error(err)) } + validatorClient := validatorSDK.New(b.ValidatorConfig.URL, b.ValidatorConfig.Timeout) + var auth Authenticator if vendor.UseValidator { auth = &AutoAuthenticator{ - Keys: nil, - AllowedAccessTypes: nil, - TopicManager: nil, - Company: "", - JwtConfig: config.Jwt{}, //nolint:exhaustruct + Keys: keys, + AllowedAccessTypes: allowedAccessTypes, + Company: vendor.Company, + TopicManager: topics.NewTopicManager( + vendor.Topics, + hid, + vendor.Company, + vendor.IssEntityMap, + vendor.IssPeerMap, + b.Logger.Named("topic-manager"), + ), + JwtConfig: vendor.Jwt, + Validator: validatorClient, } } else { auth = &ManualAuthenticator{ diff --git a/internal/authenticator/manualAuthenticator.go b/internal/authenticator/manualAuthenticator.go index 34821f80..903cfdc2 100644 --- a/internal/authenticator/manualAuthenticator.go +++ b/internal/authenticator/manualAuthenticator.go @@ -54,7 +54,7 @@ func (a ManualAuthenticator) Auth(tokenString string) error { // ACL check a user access to a topic. // nolint: funlen, cyclop -func (a ManualAuthenticator) ACL( +func (a ManualAuthenticator) ACL( //nolint:dupl accessType acl.AccessType, tokenString string, topic string, diff --git a/internal/cmd/serve/main.go b/internal/cmd/serve/main.go index a956b205..c01bc911 100644 --- a/internal/cmd/serve/main.go +++ b/internal/cmd/serve/main.go @@ -23,10 +23,13 @@ type Serve struct { func (s Serve) main() { api := api.API{ - DefaultVendor: s.Cfg.DefaultVendor, - Authenticators: authenticator.Builder{Vendors: s.Cfg.Vendors, Logger: s.Logger}.Authenticators(), - Tracer: s.Tracer, - Logger: s.Logger.Named("api"), + DefaultVendor: s.Cfg.DefaultVendor, + Authenticators: authenticator.Builder{ + Vendors: s.Cfg.Vendors, Logger: s.Logger, + ValidatorConfig: s.Cfg.Validator, + }.Authenticators(), + Tracer: s.Tracer, + Logger: s.Logger.Named("api"), } if _, ok := api.Authenticators[s.Cfg.DefaultVendor]; !ok { diff --git a/internal/config/config.go b/internal/config/config.go index a2c72e8b..fe88ca09 100644 --- a/internal/config/config.go +++ b/internal/config/config.go @@ -4,6 +4,7 @@ import ( "encoding/json" "log" "strings" + "time" "github.com/knadh/koanf" "github.com/knadh/koanf/parsers/yaml" @@ -29,6 +30,7 @@ type ( HTTPPort int `koanf:"http_port"` Tracer tracing.Config `koanf:"tracer"` DefaultVendor string `koanf:"default_vendor"` + Validator Validator `koanf:"validator"` } Vendor struct { @@ -50,6 +52,11 @@ type ( SubName string `koanf:"sub_name"` SigningMethod string `koanf:"signing_method"` } + + Validator struct { + URL string `koanf:"url"` + Timeout time.Duration `koanf:"timeout"` + } ) // New reads configuration with koanf. diff --git a/internal/config/default.go b/internal/config/default.go index 474ee69e..fb770fab 100644 --- a/internal/config/default.go +++ b/internal/config/default.go @@ -1,6 +1,8 @@ package config import ( + "time" + "gitlab.snapp.ir/dispatching/soteria/internal/logger" "gitlab.snapp.ir/dispatching/soteria/internal/topics" "gitlab.snapp.ir/dispatching/soteria/internal/tracing" @@ -33,6 +35,10 @@ func Default() Config { Port: "6831", }, }, + Validator: Validator{ + URL: "http://validator-lb", + Timeout: 5 * time.Second, + }, } } From bc93fdf375f0efd51f902a4b7b268a9bca3d93f0 Mon Sep 17 00:00:00 2001 From: Mohammad Khoddam Date: Mon, 3 Jul 2023 13:38:41 +0330 Subject: [PATCH 383/660] feat: add unit test for auto auth section --- internal/authenticator/authenticator_test.go | 42 ++ .../authenticator/autoAuthenticator_test.go | 482 ++++++++++++++++++ .../authenticator/manualAuthenticator_test.go | 63 +-- 3 files changed, 535 insertions(+), 52 deletions(-) create mode 100644 internal/authenticator/authenticator_test.go create mode 100644 internal/authenticator/autoAuthenticator_test.go diff --git a/internal/authenticator/authenticator_test.go b/internal/authenticator/authenticator_test.go new file mode 100644 index 00000000..7d777c73 --- /dev/null +++ b/internal/authenticator/authenticator_test.go @@ -0,0 +1,42 @@ +package authenticator_test + +const ( + // nolint: gosec, lll + invalidToken = "ey1JhbGciOiJSUzI1NiIsInR5cCI56kpXVCJ9.eyJzdWIiOiJCRzdScDFkcnpWRE5RcjYiLCJuYW1lIjoiSm9obiBEb2UiLCJhZG1pbiI6dHJ1ZSwiaXNzIjowLCJpYXQiOjE1MTYyMzkwMjJ9.1cYXFEhcewOYFjGJYhB8dsaFO9uKEXwlM8954rkt4Tsu0lWMITbRf_hHh1l9QD4MFqD-0LwRPUYaiaemy0OClMu00G2sujLCWaquYDEP37iIt8RoOQAh8Jb5vT8LX5C3PEKvbW_i98u8HHJoFUR9CXJmzrKi48sAcOYvXVYamN0S9KoY38H-Ze37Mdu3o6B58i73krk7QHecsc2_PkCJisvUVAzb0tiInIalBc8-zI3QZSxwNLr_hjlBg1sUxTUvH5SCcRR7hxI8TxJzkOHqAHWDRO84NC_DSAoO2p04vrHpqglN9XPJ8RC2YWpfefvD2ttH554RJWu_0RlR2kAYvQ" + + validPassengerCabEventTopic = "passenger-event-152384980615c2bd16143cff29038b67" + invalidPassengerCabEventTopic = "passenger-event-152384980615c2bd16156cff29038b67" + + validDriverCabEventTopic = "driver-event-152384980615c2bd16143cff29038b67" + invalidDriverCabEventTopic = "driver-event-152384980615c2bd16156cff29038b67" + + validDriverLocationTopic = "snapp/driver/DXKgaNQa7N5Y7bo/location" + invalidDriverLocationTopic = "snapp/driver/DXKgaNQa9Q5Y7bo/location" + + validPassengerSuperappEventTopic = "snapp/passenger/DXKgaNQa7N5Y7bo/superapp" + invalidPassengerSuperappEventTopic = "snapp/passenger/DXKgaNQa9Q5Y7bo/superapp" + + validDriverSuperappEventTopic = "snapp/driver/DXKgaNQa7N5Y7bo/superapp" + invalidDriverSuperappEventTopic = "snapp/driver/DXKgaNQa9Q5Y7bo/superapp" + + validDriverSharedTopic = "snapp/driver/DXKgaNQa7N5Y7bo/passenger-location" + validPassengerSharedTopic = "snapp/passenger/DXKgaNQa7N5Y7bo/driver-location" + invalidDriverSharedTopic = "snapp/driver/0596923be632d673560af9adadd2f78a/passenger-location" + invalidPassengerSharedTopic = "snapp/passenger/0596923be632d673560af9adadd2f78a/driver-location" + + validDriverChatTopic = "snapp/driver/DXKgaNQa7N5Y7bo/chat" + validPassengerChatTopic = "snapp/passenger/DXKgaNQa7N5Y7bo/chat" + invalidDriverChatTopic = "snapp/driver/0596923be632d673560af9adadd2f78a/chat" + invalidPassengerChatTopic = "snapp/passenger/0596923be632d673560af9adadd2f78a/chat" + + validDriverCallEntryTopic = "shared/snapp/driver/DXKgaNQa7N5Y7bo/call/send" + validPassengerCallEntryTopic = "shared/snapp/passenger/DXKgaNQa7N5Y7bo/call/send" + validDriverNodeCallEntryTopic = "snapp/driver/DXKgaNQa7N5Y7bo/call/heliograph-0/send" + validPassengerNodeCallEntryTopic = "snapp/passenger/DXKgaNQa7N5Y7bo/call/heliograph-0/send" + invalidDriverCallEntryTopic = "snapp/driver/0596923be632d673560af9adadd2f78a/call/send" + invalidPassengerCallEntryTopic = "snapp/passenger/0596923be632d673560af9adadd2f78a/call/send" + validDriverCallOutgoingTopic = "snapp/driver/DXKgaNQa7N5Y7bo/call/receive" + validPassengerCallOutgoingTopic = "snapp/passenger/DXKgaNQa7N5Y7bo/call/receive" + invalidDriverCallOutgoingTopic = "snapp/driver/0596923be632d673560af9adadd2f78a/call/receive" + invalidPassengerCallOutgoingTopic = "snapp/passenger/0596923be632d673560af9adadd2f78a/call/receive" +) diff --git a/internal/authenticator/autoAuthenticator_test.go b/internal/authenticator/autoAuthenticator_test.go new file mode 100644 index 00000000..f2cc13e1 --- /dev/null +++ b/internal/authenticator/autoAuthenticator_test.go @@ -0,0 +1,482 @@ +package authenticator_test + +import ( + "crypto/rsa" + "errors" + "io/ioutil" + "testing" + "time" + + "github.com/golang-jwt/jwt/v5" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/suite" + "gitlab.snapp.ir/dispatching/soteria/internal/authenticator" + "gitlab.snapp.ir/dispatching/soteria/internal/config" + "gitlab.snapp.ir/dispatching/soteria/internal/topics" + "gitlab.snapp.ir/dispatching/soteria/pkg/acl" + "go.uber.org/zap" +) + +type AutoAuthenticatorTestSuite struct { + suite.Suite + + Tokens struct { + Passenger string + Driver string + } + + PublicKeys struct { + Passenger *rsa.PublicKey + Driver *rsa.PublicKey + } + + Authenticator authenticator.Authenticator +} + +func (suite *AutoAuthenticatorTestSuite) SetupSuite() { + require := suite.Require() + + driverToken, err := suite.getSampleToken(topics.DriverIss, false) + require.NoError(err) + + suite.Tokens.Driver = driverToken + + passengerToken, err := suite.getSampleToken(topics.PassengerIss, false) + require.NoError(err) + + suite.Tokens.Passenger = passengerToken + + pkey0, err := suite.getPublicKey(topics.DriverIss) + require.NoError(err) + + suite.PublicKeys.Driver = pkey0 + + pkey1, err := suite.getPublicKey(topics.PassengerIss) + require.NoError(err) + + suite.PublicKeys.Passenger = pkey1 + + cfg := config.SnappVendor() + cfg.UseValidator = true + + hid, err := topics.NewHashIDManager(cfg.HashIDMap) + require.NoError(err) + // + //appCfg := config.New() + // + //validatorClient := validatorSDK.New(appCfg.Validator.URL, appCfg.Validator.Timeout) + + suite.Authenticator = authenticator.AutoAuthenticator{ + Keys: map[string][]any{ + topics.DriverIss: {pkey0}, + topics.PassengerIss: {pkey1}, + }, + AllowedAccessTypes: []acl.AccessType{acl.Pub, acl.Sub, acl.PubSub}, + Company: "snapp", + TopicManager: topics.NewTopicManager(cfg.Topics, hid, "snapp", cfg.IssEntityMap, cfg.IssPeerMap, zap.NewNop()), + //Validator: validatorClient, + } +} + +func (suite *AutoAuthenticatorTestSuite) TestAuth() { + require := suite.Require() + + suite.Run("testing driver token auth", func() { + require.NoError(suite.Authenticator.Auth(suite.Tokens.Driver)) + }) + + suite.Run("testing passenger token auth", func() { + require.NoError(suite.Authenticator.Auth(suite.Tokens.Passenger)) + }) + + suite.Run("testing invalid token auth", func() { + require.Error(suite.Authenticator.Auth(invalidToken)) + }) +} + +func (suite *AutoAuthenticatorTestSuite) TestACL_Basics() { + require := suite.Require() + + suite.Run("testing acl with invalid access type", func() { + ok, err := suite.Authenticator.ACL("invalid-access", suite.Tokens.Passenger, "test") + require.Error(err) + require.False(ok) + require.ErrorIs(err, authenticator.ErrInvalidAccessType) + }) + + suite.Run("testing acl with invalid token", func() { + ok, err := suite.Authenticator.ACL(acl.Pub, invalidToken, validDriverCabEventTopic) + require.False(ok) + require.Error(err) + require.Equal("token is invalid illegal base64 data at input byte 36", err.Error()) + }) + + suite.Run("testing acl with valid inputs", func() { + ok, err := suite.Authenticator.ACL(acl.Sub, suite.Tokens.Passenger, validPassengerCabEventTopic) + require.NoError(err) + require.True(ok) + }) + + suite.Run("testing acl with invalid topic", func() { + ok, err := suite.Authenticator.ACL(acl.Sub, suite.Tokens.Passenger, invalidPassengerCabEventTopic) + require.Error(err) + require.False(ok) + }) + + suite.Run("testing acl with invalid access type", func() { + ok, err := suite.Authenticator.ACL(acl.Pub, suite.Tokens.Passenger, validPassengerCabEventTopic) + require.Error(err) + require.False(ok) + }) +} + +// nolint: funlen +func (suite *AutoAuthenticatorTestSuite) TestACL_Passenger() { + require := suite.Require() + token := suite.Tokens.Passenger + + suite.Run("testing passenger subscribe on valid superapp event topic", func() { + ok, err := suite.Authenticator.ACL(acl.Sub, token, validPassengerSuperappEventTopic) + require.NoError(err) + require.True(ok) + }) + + suite.Run("testing passenger subscribe on invalid superapp event topic", func() { + ok, err := suite.Authenticator.ACL(acl.Sub, token, invalidPassengerSuperappEventTopic) + require.Error(err) + require.False(ok) + }) + + suite.Run("testing passenger subscribe on valid shared location topic", func() { + ok, err := suite.Authenticator.ACL(acl.Sub, token, validPassengerSharedTopic) + require.NoError(err) + require.True(ok) + }) + + suite.Run("testing passenger subscribe on invalid shared location topic", func() { + ok, err := suite.Authenticator.ACL(acl.Sub, token, invalidPassengerSharedTopic) + require.Error(err) + require.False(ok) + }) + + suite.Run("testing passenger subscribe on valid chat topic", func() { + ok, err := suite.Authenticator.ACL(acl.Sub, token, validPassengerChatTopic) + require.NoError(err) + require.True(ok) + }) + + suite.Run("testing passenger subscribe on invalid chat topic", func() { + ok, err := suite.Authenticator.ACL(acl.Sub, token, invalidPassengerChatTopic) + require.Error(err) + require.False(ok) + }) + + suite.Run("testing passenger subscribe on valid entry call topic", func() { + ok, err := suite.Authenticator.ACL(acl.Pub, token, validPassengerCallEntryTopic) + require.NoError(err) + require.True(ok) + }) + + suite.Run("testing passenger subscribe on invalid call entry topic", func() { + ok, err := suite.Authenticator.ACL(acl.Pub, token, invalidPassengerCallEntryTopic) + require.Error(err) + require.False(ok) + }) + + suite.Run("testing passenger subscribe on valid outgoing call topic", func() { + ok, err := suite.Authenticator.ACL(acl.Sub, token, validPassengerCallOutgoingTopic) + require.NoError(err) + require.True(ok) + }) + + suite.Run("testing passenger subscribe on valid outgoing call node topic", func() { + ok, err := suite.Authenticator.ACL(acl.Pub, token, validPassengerNodeCallEntryTopic) + require.NoError(err) + require.True(ok) + }) + + suite.Run("testing passenger subscribe on invalid call outgoing topic", func() { + ok, err := suite.Authenticator.ACL(acl.Sub, token, invalidPassengerCallOutgoingTopic) + require.Error(err) + require.False(ok) + }) +} + +// nolint: funlen +func (suite *AutoAuthenticatorTestSuite) TestACL_Driver() { + require := suite.Require() + token := suite.Tokens.Driver + + suite.Run("testing driver publish on its location topic", func() { + ok, err := suite.Authenticator.ACL(acl.Pub, token, validDriverLocationTopic) + require.NoError(err) + require.True(ok) + }) + + suite.Run("testing driver publish on invalid location topic", func() { + ok, err := suite.Authenticator.ACL(acl.Pub, token, invalidDriverLocationTopic) + require.Error(err) + require.False(ok) + }) + + suite.Run("testing driver subscribe on invalid cab event topic", func() { + ok, err := suite.Authenticator.ACL(acl.Sub, token, invalidDriverCabEventTopic) + require.Error(err) + require.False(ok) + }) + + suite.Run("testing driver subscribe on valid superapp event topic", func() { + ok, err := suite.Authenticator.ACL(acl.Sub, token, validDriverSuperappEventTopic) + suite.NoError(err) + suite.True(ok) + }) + + suite.Run("testing driver subscribe on invalid superapp event topic", func() { + ok, err := suite.Authenticator.ACL(acl.Sub, token, invalidDriverSuperappEventTopic) + suite.Error(err) + suite.False(ok) + }) + + suite.Run("testing driver subscribe on valid shared location topic", func() { + ok, err := suite.Authenticator.ACL(acl.Sub, token, validDriverSharedTopic) + require.NoError(err) + require.True(ok) + }) + + suite.Run("testing driver subscribe on invalid shared location topic", func() { + ok, err := suite.Authenticator.ACL(acl.Sub, token, invalidDriverSharedTopic) + require.Error(err) + require.False(ok) + }) + + suite.Run("testing driver subscribe on valid chat topic", func() { + ok, err := suite.Authenticator.ACL(acl.Sub, token, validDriverChatTopic) + require.NoError(err) + require.True(ok) + }) + + suite.Run("testing driver subscribe on invalid chat topic", func() { + ok, err := suite.Authenticator.ACL(acl.Sub, token, invalidDriverChatTopic) + require.Error(err) + require.False(ok) + }) + + suite.Run("testing driver subscribe on valid call entry topic", func() { + ok, err := suite.Authenticator.ACL(acl.Pub, token, validDriverCallEntryTopic) + require.NoError(err) + require.True(ok) + }) + + suite.Run("testing driver subscribe on invalid call entry topic", func() { + ok, err := suite.Authenticator.ACL(acl.Pub, token, invalidDriverCallEntryTopic) + require.Error(err) + require.False(ok) + }) + + suite.Run("testing driver subscribe on valid call outgoing topic", func() { + ok, err := suite.Authenticator.ACL(acl.Sub, token, validDriverCallOutgoingTopic) + require.NoError(err) + require.True(ok) + }) + + suite.Run("testing driver subscribe on valid call outgoing node topic", func() { + ok, err := suite.Authenticator.ACL(acl.Pub, token, validDriverNodeCallEntryTopic) + require.NoError(err) + require.True(ok) + }) + + suite.Run("testing driver subscribe on invalid call outgoing topic", func() { + ok, err := suite.Authenticator.ACL(acl.Sub, token, invalidDriverCallOutgoingTopic) + require.Error(err) + require.False(ok) + }) +} + +func TestAutoAuthenticator_ValidateTopicBySender(t *testing.T) { + t.Parallel() + + cfg := config.SnappVendor() + cfg.UseValidator = true + + hid, err := topics.NewHashIDManager(cfg.HashIDMap) + assert.NoError(t, err) + + // nolint: exhaustruct + authenticator := authenticator.AutoAuthenticator{ + AllowedAccessTypes: []acl.AccessType{acl.Pub, acl.Sub}, + Company: "snapp", + TopicManager: topics.NewTopicManager(cfg.Topics, hid, "snapp", cfg.IssEntityMap, cfg.IssPeerMap, zap.NewNop()), + } + + t.Run("testing valid driver cab event", func(t *testing.T) { + topicTemplate := authenticator.TopicManager.ParseTopic(validDriverCabEventTopic, topics.DriverIss, "DXKgaNQa7N5Y7bo") + assert.True(t, topicTemplate != nil) + }) +} + +// nolint: funlen +func TestAutoAuthenticator_validateAccessType(t *testing.T) { + t.Parallel() + + type fields struct { + AllowedAccessTypes []acl.AccessType + } + + type args struct { + accessType acl.AccessType + } + + tests := []struct { + name string + fields fields + args args + want bool + }{ + { + name: "#1 testing with no allowed access type", + fields: fields{AllowedAccessTypes: []acl.AccessType{}}, + args: args{accessType: acl.Sub}, + want: false, + }, + { + name: "#2 testing with no allowed access type", + fields: fields{AllowedAccessTypes: []acl.AccessType{}}, + args: args{accessType: acl.Pub}, + want: false, + }, + { + name: "#3 testing with no allowed access type", + fields: fields{AllowedAccessTypes: []acl.AccessType{}}, + args: args{accessType: acl.PubSub}, + want: false, + }, + { + name: "#4 testing with one allowed access type", + fields: fields{AllowedAccessTypes: []acl.AccessType{acl.Pub}}, + args: args{accessType: acl.Pub}, + want: true, + }, + { + name: "#5 testing with one allowed access type", + fields: fields{AllowedAccessTypes: []acl.AccessType{acl.Pub}}, + args: args{accessType: acl.Sub}, + want: false, + }, + { + name: "#6 testing with two allowed access type", + fields: fields{AllowedAccessTypes: []acl.AccessType{acl.Pub, acl.Sub}}, + args: args{accessType: acl.Sub}, + want: true, + }, + { + name: "#7 testing with two allowed access type", + fields: fields{AllowedAccessTypes: []acl.AccessType{acl.Pub, acl.Sub}}, + args: args{accessType: acl.Pub}, + want: true, + }, + { + name: "#8 testing with two allowed access type", + fields: fields{AllowedAccessTypes: []acl.AccessType{acl.Pub, acl.Sub}}, + args: args{accessType: acl.PubSub}, + want: false, + }, + { + name: "#9 testing with three allowed access type", + fields: fields{AllowedAccessTypes: []acl.AccessType{acl.Pub, acl.Sub, acl.PubSub}}, + args: args{accessType: acl.PubSub}, + want: true, + }, + } + + for _, tt := range tests { + tt := tt + t.Run(tt.name, func(t *testing.T) { + t.Parallel() + + // nolint: exhaustruct + a := authenticator.AutoAuthenticator{ + AllowedAccessTypes: tt.fields.AllowedAccessTypes, + } + if got := a.ValidateAccessType(tt.args.accessType); got != tt.want { + t.Errorf("validateAccessType() = %v, want %v", got, tt.want) + } + }) + } +} + +// nolint: goerr113, wrapcheck +func (suite *AutoAuthenticatorTestSuite) getPublicKey(u string) (*rsa.PublicKey, error) { + var fileName string + + switch u { + case topics.PassengerIss: + fileName = "../../test/1.pem" + case topics.DriverIss: + fileName = "../../test/0.pem" + default: + return nil, errors.New("invalid user, public key not found") + } + + pem, err := ioutil.ReadFile(fileName) + if err != nil { + return nil, err + } + + publicKey, err := jwt.ParseRSAPublicKeyFromPEM(pem) + if err != nil { + return nil, err + } + + return publicKey, nil +} + +// nolint: goerr113, wrapcheck +func (suite *AutoAuthenticatorTestSuite) getPrivateKey(u string) (*rsa.PrivateKey, error) { + var fileName string + + switch u { + case topics.DriverIss: + fileName = "../../test/0.private.pem" + case topics.PassengerIss: + fileName = "../../test/1.private.pem" + default: + return nil, errors.New("invalid user, private key not found") + } + + pem, err := ioutil.ReadFile(fileName) + if err != nil { + return nil, err + } + + privateKey, err := jwt.ParseRSAPrivateKeyFromPEM(pem) + if err != nil { + return nil, err + } + + return privateKey, nil +} + +func (suite *AutoAuthenticatorTestSuite) getSampleToken(issuer string, isSuperuser bool) (string, error) { + key, err := suite.getPrivateKey(issuer) + if err != nil { + suite.Require().NoError(err) + } + + exp := time.Now().Add(time.Hour * 24 * 365 * 10) + sub := "DXKgaNQa7N5Y7bo" + + // nolint: exhaustruct + claims := jwt.RegisteredClaims{ + ExpiresAt: jwt.NewNumericDate(exp), + Issuer: string(issuer), + Subject: sub, + } + token := jwt.NewWithClaims(jwt.SigningMethodRS256, claims) + + tokenString, err := token.SignedString(key) + if err != nil { + suite.Require().NoError(err) + } + + return tokenString, nil +} diff --git a/internal/authenticator/manualAuthenticator_test.go b/internal/authenticator/manualAuthenticator_test.go index 3fc99d18..3c857016 100644 --- a/internal/authenticator/manualAuthenticator_test.go +++ b/internal/authenticator/manualAuthenticator_test.go @@ -17,48 +17,7 @@ import ( "go.uber.org/zap" ) -const ( - // nolint: gosec, lll - invalidToken = "ey1JhbGciOiJSUzI1NiIsInR5cCI56kpXVCJ9.eyJzdWIiOiJCRzdScDFkcnpWRE5RcjYiLCJuYW1lIjoiSm9obiBEb2UiLCJhZG1pbiI6dHJ1ZSwiaXNzIjowLCJpYXQiOjE1MTYyMzkwMjJ9.1cYXFEhcewOYFjGJYhB8dsaFO9uKEXwlM8954rkt4Tsu0lWMITbRf_hHh1l9QD4MFqD-0LwRPUYaiaemy0OClMu00G2sujLCWaquYDEP37iIt8RoOQAh8Jb5vT8LX5C3PEKvbW_i98u8HHJoFUR9CXJmzrKi48sAcOYvXVYamN0S9KoY38H-Ze37Mdu3o6B58i73krk7QHecsc2_PkCJisvUVAzb0tiInIalBc8-zI3QZSxwNLr_hjlBg1sUxTUvH5SCcRR7hxI8TxJzkOHqAHWDRO84NC_DSAoO2p04vrHpqglN9XPJ8RC2YWpfefvD2ttH554RJWu_0RlR2kAYvQ" - - validPassengerCabEventTopic = "passenger-event-152384980615c2bd16143cff29038b67" - invalidPassengerCabEventTopic = "passenger-event-152384980615c2bd16156cff29038b67" - - validDriverCabEventTopic = "driver-event-152384980615c2bd16143cff29038b67" - invalidDriverCabEventTopic = "driver-event-152384980615c2bd16156cff29038b67" - - validDriverLocationTopic = "snapp/driver/DXKgaNQa7N5Y7bo/location" - invalidDriverLocationTopic = "snapp/driver/DXKgaNQa9Q5Y7bo/location" - - validPassengerSuperappEventTopic = "snapp/passenger/DXKgaNQa7N5Y7bo/superapp" - invalidPassengerSuperappEventTopic = "snapp/passenger/DXKgaNQa9Q5Y7bo/superapp" - - validDriverSuperappEventTopic = "snapp/driver/DXKgaNQa7N5Y7bo/superapp" - invalidDriverSuperappEventTopic = "snapp/driver/DXKgaNQa9Q5Y7bo/superapp" - - validDriverSharedTopic = "snapp/driver/DXKgaNQa7N5Y7bo/passenger-location" - validPassengerSharedTopic = "snapp/passenger/DXKgaNQa7N5Y7bo/driver-location" - invalidDriverSharedTopic = "snapp/driver/0596923be632d673560af9adadd2f78a/passenger-location" - invalidPassengerSharedTopic = "snapp/passenger/0596923be632d673560af9adadd2f78a/driver-location" - - validDriverChatTopic = "snapp/driver/DXKgaNQa7N5Y7bo/chat" - validPassengerChatTopic = "snapp/passenger/DXKgaNQa7N5Y7bo/chat" - invalidDriverChatTopic = "snapp/driver/0596923be632d673560af9adadd2f78a/chat" - invalidPassengerChatTopic = "snapp/passenger/0596923be632d673560af9adadd2f78a/chat" - - validDriverCallEntryTopic = "shared/snapp/driver/DXKgaNQa7N5Y7bo/call/send" - validPassengerCallEntryTopic = "shared/snapp/passenger/DXKgaNQa7N5Y7bo/call/send" - validDriverNodeCallEntryTopic = "snapp/driver/DXKgaNQa7N5Y7bo/call/heliograph-0/send" - validPassengerNodeCallEntryTopic = "snapp/passenger/DXKgaNQa7N5Y7bo/call/heliograph-0/send" - invalidDriverCallEntryTopic = "snapp/driver/0596923be632d673560af9adadd2f78a/call/send" - invalidPassengerCallEntryTopic = "snapp/passenger/0596923be632d673560af9adadd2f78a/call/send" - validDriverCallOutgoingTopic = "snapp/driver/DXKgaNQa7N5Y7bo/call/receive" - validPassengerCallOutgoingTopic = "snapp/passenger/DXKgaNQa7N5Y7bo/call/receive" - invalidDriverCallOutgoingTopic = "snapp/driver/0596923be632d673560af9adadd2f78a/call/receive" - invalidPassengerCallOutgoingTopic = "snapp/passenger/0596923be632d673560af9adadd2f78a/call/receive" -) - -type AuthenticatorTestSuite struct { +type ManualAuthenticatorTestSuite struct { suite.Suite Tokens struct { @@ -74,7 +33,7 @@ type AuthenticatorTestSuite struct { Authenticator authenticator.Authenticator } -func (suite *AuthenticatorTestSuite) SetupSuite() { +func (suite *ManualAuthenticatorTestSuite) SetupSuite() { require := suite.Require() driverToken, err := suite.getSampleToken(topics.DriverIss, false) @@ -113,7 +72,7 @@ func (suite *AuthenticatorTestSuite) SetupSuite() { } } -func (suite *AuthenticatorTestSuite) TestAuth() { +func (suite *ManualAuthenticatorTestSuite) TestAuth() { require := suite.Require() suite.Run("testing driver token auth", func() { @@ -129,7 +88,7 @@ func (suite *AuthenticatorTestSuite) TestAuth() { }) } -func (suite *AuthenticatorTestSuite) TestACL_Basics() { +func (suite *ManualAuthenticatorTestSuite) TestACL_Basics() { require := suite.Require() suite.Run("testing acl with invalid access type", func() { @@ -166,7 +125,7 @@ func (suite *AuthenticatorTestSuite) TestACL_Basics() { } // nolint: funlen -func (suite *AuthenticatorTestSuite) TestACL_Passenger() { +func (suite *ManualAuthenticatorTestSuite) TestACL_Passenger() { require := suite.Require() token := suite.Tokens.Passenger @@ -238,7 +197,7 @@ func (suite *AuthenticatorTestSuite) TestACL_Passenger() { } // nolint: funlen -func (suite *AuthenticatorTestSuite) TestACL_Driver() { +func (suite *ManualAuthenticatorTestSuite) TestACL_Driver() { require := suite.Require() token := suite.Tokens.Driver @@ -327,7 +286,7 @@ func (suite *AuthenticatorTestSuite) TestACL_Driver() { }) } -func TestAuthenticator_ValidateTopicBySender(t *testing.T) { +func TestManualAuthenticator_ValidateTopicBySender(t *testing.T) { t.Parallel() cfg := config.SnappVendor() @@ -349,7 +308,7 @@ func TestAuthenticator_ValidateTopicBySender(t *testing.T) { } // nolint: funlen -func TestAuthenticator_validateAccessType(t *testing.T) { +func TestManualAuthenticator_validateAccessType(t *testing.T) { t.Parallel() type fields struct { @@ -439,7 +398,7 @@ func TestAuthenticator_validateAccessType(t *testing.T) { } // nolint: goerr113, wrapcheck -func (suite *AuthenticatorTestSuite) getPublicKey(u string) (*rsa.PublicKey, error) { +func (suite *ManualAuthenticatorTestSuite) getPublicKey(u string) (*rsa.PublicKey, error) { var fileName string switch u { @@ -465,7 +424,7 @@ func (suite *AuthenticatorTestSuite) getPublicKey(u string) (*rsa.PublicKey, err } // nolint: goerr113, wrapcheck -func (suite *AuthenticatorTestSuite) getPrivateKey(u string) (*rsa.PrivateKey, error) { +func (suite *ManualAuthenticatorTestSuite) getPrivateKey(u string) (*rsa.PrivateKey, error) { var fileName string switch u { @@ -490,7 +449,7 @@ func (suite *AuthenticatorTestSuite) getPrivateKey(u string) (*rsa.PrivateKey, e return privateKey, nil } -func (suite *AuthenticatorTestSuite) getSampleToken(issuer string, isSuperuser bool) (string, error) { +func (suite *ManualAuthenticatorTestSuite) getSampleToken(issuer string, isSuperuser bool) (string, error) { key, err := suite.getPrivateKey(issuer) if err != nil { suite.Require().NoError(err) From 12f95c53a4374ea73f53ebd9e2d6f7df645b7a24 Mon Sep 17 00:00:00 2001 From: Parham Alvani Date: Tue, 4 Jul 2023 09:34:23 +0330 Subject: [PATCH 384/660] feat: add ode configuration for validator --- deployments/soteria/values.ode.snapp.yaml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/deployments/soteria/values.ode.snapp.yaml b/deployments/soteria/values.ode.snapp.yaml index 4fbfa39f..984b0b48 100644 --- a/deployments/soteria/values.ode.snapp.yaml +++ b/deployments/soteria/values.ode.snapp.yaml @@ -12,6 +12,11 @@ image: tag: main pullPolicy: Always +config: + validator: + url: "http://validator:80" + timeout: 10s + vendors: snapp: company: "snapp" From 0ac9d6b361d8d51cf0d6a4537d89b5f564181ab4 Mon Sep 17 00:00:00 2001 From: Parham Alvani Date: Tue, 4 Jul 2023 09:35:20 +0330 Subject: [PATCH 385/660] feat: add ode configuration for validator --- deployments/soteria/values.ode.snapp.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/deployments/soteria/values.ode.snapp.yaml b/deployments/soteria/values.ode.snapp.yaml index 984b0b48..7fc5ec85 100644 --- a/deployments/soteria/values.ode.snapp.yaml +++ b/deployments/soteria/values.ode.snapp.yaml @@ -19,6 +19,7 @@ config: vendors: snapp: + use_validator: true company: "snapp" hashid_map: 0: From 5d0cd41d4fb0bad5f48dcbfbada3c808d404f929 Mon Sep 17 00:00:00 2001 From: Parham Alvani Date: Wed, 19 Jul 2023 08:38:43 +0330 Subject: [PATCH 386/660] feat: format readme --- README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 80ba5119..230be076 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,7 @@ Soteria is responsible for Authentication and Authorization of every request sen We are using the http_auth plugin of EMQ for forwarding these requests to Soteria. -EMQX has caching mechanism but it sends requests almost for each Publish message to Soteria. +EMQX has caching mechanism but it sends requests almost for each Publish message to Soteria. (PS: On Subscribe we have only one message from client that need authorization and other messages are coming from server. @@ -43,9 +43,9 @@ Replace `driver` and `0` for issuer and ID respectively. curl -s -u 'admin:admin' -L https://doago-snapp-ode-020.apps.private.teh-1.snappcloud.io/api/snapp/driver/0 | jq '.Token' -r ``` -# Architecure -![architectureOfSoteria](docs/arch.png) +# Architecure +![architectureOfSoteria](docs/arch.png) # Folder Structure From 22d8eef96de16e4aecebbc83198ccf2e519c0986 Mon Sep 17 00:00:00 2001 From: Parham Alvani Date: Wed, 19 Jul 2023 08:55:03 +0330 Subject: [PATCH 387/660] chore: change file naming --- .../{autoAuthenticator.go => auto_authenticator.go} | 6 +++--- ...henticator_test.go => auto_authenticator_test.go} | 12 ++++++------ ...anualAuthenticator.go => manual_authenticator.go} | 0 ...nticator_test.go => manual_authenticator_test.go} | 4 ++-- 4 files changed, 11 insertions(+), 11 deletions(-) rename internal/authenticator/{autoAuthenticator.go => auto_authenticator.go} (95%) rename internal/authenticator/{autoAuthenticator_test.go => auto_authenticator_test.go} (98%) rename internal/authenticator/{manualAuthenticator.go => manual_authenticator.go} (100%) rename internal/authenticator/{manualAuthenticator_test.go => manual_authenticator_test.go} (99%) diff --git a/internal/authenticator/autoAuthenticator.go b/internal/authenticator/auto_authenticator.go similarity index 95% rename from internal/authenticator/autoAuthenticator.go rename to internal/authenticator/auto_authenticator.go index 6624913b..36c1679b 100644 --- a/internal/authenticator/autoAuthenticator.go +++ b/internal/authenticator/auto_authenticator.go @@ -28,15 +28,15 @@ func (a AutoAuthenticator) Auth(tokenString string) error { if _, err := a.Validator.Validate(context.Background(), &http.Header{ "X-Service-Name": []string{"Soteria"}, }, tokenString); err != nil { - return fmt.Errorf("token is invalid: %w", err) //nolint:staticcheck + return fmt.Errorf("token is invalid: %w", err) } return nil } // ACL check a user access to a topic. -// nolint: funlen, cyclop -func (a AutoAuthenticator) ACL( //nolint:dupl +// nolint: funlen, cyclop, dupl +func (a AutoAuthenticator) ACL( accessType acl.AccessType, tokenString string, topic string, diff --git a/internal/authenticator/autoAuthenticator_test.go b/internal/authenticator/auto_authenticator_test.go similarity index 98% rename from internal/authenticator/autoAuthenticator_test.go rename to internal/authenticator/auto_authenticator_test.go index f2cc13e1..ba3b6143 100644 --- a/internal/authenticator/autoAuthenticator_test.go +++ b/internal/authenticator/auto_authenticator_test.go @@ -3,7 +3,7 @@ package authenticator_test import ( "crypto/rsa" "errors" - "io/ioutil" + "os" "testing" "time" @@ -62,9 +62,9 @@ func (suite *AutoAuthenticatorTestSuite) SetupSuite() { hid, err := topics.NewHashIDManager(cfg.HashIDMap) require.NoError(err) // - //appCfg := config.New() + // appCfg := config.New() // - //validatorClient := validatorSDK.New(appCfg.Validator.URL, appCfg.Validator.Timeout) + // validatorClient := validatorSDK.New(appCfg.Validator.URL, appCfg.Validator.Timeout) suite.Authenticator = authenticator.AutoAuthenticator{ Keys: map[string][]any{ @@ -74,7 +74,7 @@ func (suite *AutoAuthenticatorTestSuite) SetupSuite() { AllowedAccessTypes: []acl.AccessType{acl.Pub, acl.Sub, acl.PubSub}, Company: "snapp", TopicManager: topics.NewTopicManager(cfg.Topics, hid, "snapp", cfg.IssEntityMap, cfg.IssPeerMap, zap.NewNop()), - //Validator: validatorClient, + // Validator: validatorClient, } } @@ -417,7 +417,7 @@ func (suite *AutoAuthenticatorTestSuite) getPublicKey(u string) (*rsa.PublicKey, return nil, errors.New("invalid user, public key not found") } - pem, err := ioutil.ReadFile(fileName) + pem, err := os.ReadFile(fileName) if err != nil { return nil, err } @@ -443,7 +443,7 @@ func (suite *AutoAuthenticatorTestSuite) getPrivateKey(u string) (*rsa.PrivateKe return nil, errors.New("invalid user, private key not found") } - pem, err := ioutil.ReadFile(fileName) + pem, err := os.ReadFile(fileName) if err != nil { return nil, err } diff --git a/internal/authenticator/manualAuthenticator.go b/internal/authenticator/manual_authenticator.go similarity index 100% rename from internal/authenticator/manualAuthenticator.go rename to internal/authenticator/manual_authenticator.go diff --git a/internal/authenticator/manualAuthenticator_test.go b/internal/authenticator/manual_authenticator_test.go similarity index 99% rename from internal/authenticator/manualAuthenticator_test.go rename to internal/authenticator/manual_authenticator_test.go index 3c857016..70615f36 100644 --- a/internal/authenticator/manualAuthenticator_test.go +++ b/internal/authenticator/manual_authenticator_test.go @@ -63,8 +63,8 @@ func (suite *ManualAuthenticatorTestSuite) SetupSuite() { suite.Authenticator = authenticator.ManualAuthenticator{ Keys: map[string][]any{ - topics.DriverIss: []any{pkey0}, - topics.PassengerIss: []any{pkey1}, + topics.DriverIss: {pkey0}, + topics.PassengerIss: {pkey1}, }, AllowedAccessTypes: []acl.AccessType{acl.Pub, acl.Sub, acl.PubSub}, Company: "snapp", From a675ebe3c0a930d384d07fdda30102a97329fe8c Mon Sep 17 00:00:00 2001 From: Parham Alvani Date: Wed, 19 Jul 2023 08:55:22 +0330 Subject: [PATCH 388/660] feat: enable golangci-lint over test --- .golangci.yml | 3 --- internal/api/api_test.go | 5 ++++- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.golangci.yml b/.golangci.yml index 34fd1c91..b289d4a7 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -16,6 +16,3 @@ linters: - interfacer - exhaustivestruct - nolintlint -run: - skip-files: - - ".*_test.go" diff --git a/internal/api/api_test.go b/internal/api/api_test.go index d9c21b01..95f1294e 100644 --- a/internal/api/api_test.go +++ b/internal/api/api_test.go @@ -1,8 +1,11 @@ package api_test import ( - "gitlab.snapp.ir/dispatching/soteria/internal/api" "testing" + + "testing" + + "gitlab.snapp.ir/dispatching/soteria/internal/api" ) func TestExtractVendorToken(t *testing.T) { From 8e10c2b22060624875b1683240bd964aa793e884 Mon Sep 17 00:00:00 2001 From: Parham Alvani Date: Wed, 19 Jul 2023 08:58:44 +0330 Subject: [PATCH 389/660] feat: update packages --- go.mod | 46 ++++++++++++++++++++++------------------------ go.sum | 43 +++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 65 insertions(+), 24 deletions(-) diff --git a/go.mod b/go.mod index 2d316ba1..345a2c3e 100644 --- a/go.mod +++ b/go.mod @@ -5,27 +5,24 @@ go 1.20 require ( github.com/ansrivas/fiberprometheus/v2 v2.6.0 github.com/gofiber/contrib/fiberzap v1.0.2 - github.com/gofiber/fiber/v2 v2.43.0 + github.com/gofiber/fiber/v2 v2.48.0 + github.com/golang-jwt/jwt/v5 v5.0.0 github.com/knadh/koanf v1.5.0 - github.com/prometheus/client_golang v1.14.0 // indirect + github.com/prometheus/client_golang v1.16.0 // indirect github.com/speps/go-hashids/v2 v2.0.1 - github.com/spf13/cobra v1.6.1 + github.com/spf13/cobra v1.7.0 github.com/stretchr/testify v1.8.4 github.com/tidwall/pretty v1.2.1 - go.opentelemetry.io/otel v1.14.0 - go.opentelemetry.io/otel/exporters/jaeger v1.14.0 - go.opentelemetry.io/otel/sdk v1.14.0 - go.opentelemetry.io/otel/trace v1.14.0 - go.uber.org/atomic v1.10.0 // indirect + gitlab.snapp.ir/security_regulatory/validator/pkg/sdk v0.2.1 + go.opentelemetry.io/otel v1.16.0 + go.opentelemetry.io/otel/exporters/jaeger v1.16.0 + go.opentelemetry.io/otel/sdk v1.16.0 + go.opentelemetry.io/otel/trace v1.16.0 + go.uber.org/atomic v1.11.0 // indirect go.uber.org/automaxprocs v1.5.2 go.uber.org/zap v1.24.0 ) -require ( - github.com/golang-jwt/jwt/v5 v5.0.0-rc.1 - gitlab.snapp.ir/security_regulatory/validator/pkg/sdk v0.2.1 -) - require ( github.com/andybalholm/brotli v1.0.5 // indirect github.com/beorn7/perks v1.0.1 // indirect @@ -33,15 +30,15 @@ require ( github.com/davecgh/go-spew v1.1.1 // indirect github.com/fatih/structs v1.1.0 // indirect github.com/fsnotify/fsnotify v1.6.0 // indirect - github.com/go-logr/logr v1.2.3 // indirect + github.com/go-logr/logr v1.2.4 // indirect github.com/go-logr/stdr v1.2.2 // indirect - github.com/gofiber/adaptor/v2 v2.1.32 // indirect + github.com/gofiber/adaptor/v2 v2.2.1 // indirect github.com/golang/protobuf v1.5.3 // indirect github.com/google/uuid v1.3.0 // indirect github.com/inconshreveable/mousetrap v1.1.0 // indirect - github.com/klauspost/compress v1.16.3 // indirect + github.com/klauspost/compress v1.16.7 // indirect github.com/mattn/go-colorable v0.1.13 // indirect - github.com/mattn/go-isatty v0.0.18 // indirect + github.com/mattn/go-isatty v0.0.19 // indirect github.com/mattn/go-runewidth v0.0.14 // indirect github.com/matttproud/golang_protobuf_extensions v1.0.4 // indirect github.com/mitchellh/copystructure v1.2.0 // indirect @@ -49,19 +46,20 @@ require ( github.com/mitchellh/reflectwalk v1.0.2 // indirect github.com/philhofer/fwd v1.1.2 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect - github.com/prometheus/client_model v0.3.0 // indirect - github.com/prometheus/common v0.42.0 // indirect - github.com/prometheus/procfs v0.9.0 // indirect + github.com/prometheus/client_model v0.4.0 // indirect + github.com/prometheus/common v0.44.0 // indirect + github.com/prometheus/procfs v0.11.0 // indirect github.com/rivo/uniseg v0.4.4 // indirect github.com/savsgio/dictpool v0.0.0-20221023140959-7bf2e61cea94 // indirect github.com/savsgio/gotils v0.0.0-20230208104028-c358bd845dee // indirect github.com/spf13/pflag v1.0.5 // indirect github.com/tinylib/msgp v1.1.8 // indirect github.com/valyala/bytebufferpool v1.0.0 // indirect - github.com/valyala/fasthttp v1.45.0 // indirect + github.com/valyala/fasthttp v1.48.0 // indirect github.com/valyala/tcplisten v1.0.0 // indirect - go.uber.org/multierr v1.10.0 // indirect - golang.org/x/sys v0.6.0 // indirect - google.golang.org/protobuf v1.30.0 // indirect + go.opentelemetry.io/otel/metric v1.16.0 // indirect + go.uber.org/multierr v1.11.0 // indirect + golang.org/x/sys v0.10.0 // indirect + google.golang.org/protobuf v1.31.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect ) diff --git a/go.sum b/go.sum index d105c4b1..5830a854 100644 --- a/go.sum +++ b/go.sum @@ -111,6 +111,8 @@ github.com/go-logfmt/logfmt v0.5.1/go.mod h1:WYhtIu8zTZfxdn5+rREduYbwxfcBr/Vr6KE github.com/go-logr/logr v1.2.2/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= github.com/go-logr/logr v1.2.3 h1:2DntVwHkVopvECVRSlL5PSo9eG+cAkDCuckLubN+rq0= github.com/go-logr/logr v1.2.3/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= +github.com/go-logr/logr v1.2.4 h1:g01GSCwiDw2xSZfjJ2/T9M+S6pFdcNtFYsp+Y43HYDQ= +github.com/go-logr/logr v1.2.4/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag= github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE= github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= @@ -119,16 +121,22 @@ github.com/godbus/dbus/v5 v5.0.4/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5x github.com/gofiber/adaptor/v2 v2.1.31/go.mod h1:vdSG9JhOhOLYjE4j14fx6sJvLJNFVf9o6rSyB5GkU4s= github.com/gofiber/adaptor/v2 v2.1.32 h1:94cL79U4ekq78TmqfXPrulMWkpfPxqzHimUc/B+jmkY= github.com/gofiber/adaptor/v2 v2.1.32/go.mod h1:aX4qfSo+1AJYIWnLL1Mx3EQ6znC6WW46MqFQruUQE6c= +github.com/gofiber/adaptor/v2 v2.2.1 h1:givE7iViQWlsTR4Jh7tB4iXzrlKBgiraB/yTdHs9Lv4= +github.com/gofiber/adaptor/v2 v2.2.1/go.mod h1:AhR16dEqs25W2FY/l8gSj1b51Azg5dtPDmm+pruNOrc= github.com/gofiber/contrib/fiberzap v1.0.2 h1:EQwhggtszVfIdBeXxN9Xrmld71es34Ufs+ef8VMqZxc= github.com/gofiber/contrib/fiberzap v1.0.2/go.mod h1:jGO8BHU4gRI9U0JtM6zj2CIhYfgVmW5JxziN8NTgVwE= github.com/gofiber/fiber/v2 v2.41.0/go.mod h1:RdebcCuCRFp4W6hr3968/XxwJVg0K+jr9/Ae0PFzZ0Q= github.com/gofiber/fiber/v2 v2.42.0/go.mod h1:3+SGNjqMh5VQH5Vz2Wdi43zTIV16ktlFd3x3R6O1Zlc= github.com/gofiber/fiber/v2 v2.43.0 h1:yit3E4kHf178B60p5CQBa/3v+WVuziWMa/G2ZNyLJB0= github.com/gofiber/fiber/v2 v2.43.0/go.mod h1:mpS1ZNE5jU+u+BA4FbM+KKnUzJ4wzTK+FT2tG3tU+6I= +github.com/gofiber/fiber/v2 v2.48.0 h1:cRVMCb9aUJDsyHxGFLwz/sGzDggdailZZyptU9F9cU0= +github.com/gofiber/fiber/v2 v2.48.0/go.mod h1:xqJgfqrc23FJuqGOW6DVgi3HyZEm2Mn9pRqUb2kHSX8= github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q= github.com/golang-jwt/jwt/v5 v5.0.0-rc.1 h1:tDQ1LjKga657layZ4JLsRdxgvupebc0xuPwRNuTfUgs= github.com/golang-jwt/jwt/v5 v5.0.0-rc.1/go.mod h1:pqrtFR0X4osieyHYxtmOUWsAWrfe1Q5UVIyoH402zdk= +github.com/golang-jwt/jwt/v5 v5.0.0 h1:1n1XNM9hk7O9mnQoNBGolZvzebBQ7p93ULHRc28XJUE= +github.com/golang-jwt/jwt/v5 v5.0.0/go.mod h1:pqrtFR0X4osieyHYxtmOUWsAWrfe1Q5UVIyoH402zdk= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/groupcache v0.0.0-20191227052852-215e87163ea7/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= @@ -250,6 +258,8 @@ github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+o github.com/klauspost/compress v1.15.9/go.mod h1:PhcZ0MbTNciWF3rruxRgKxI5NkcHHrHUDtV4Yw2GlzU= github.com/klauspost/compress v1.16.3 h1:XuJt9zzcnaz6a16/OU53ZjWp/v7/42WcR5t2a0PcNQY= github.com/klauspost/compress v1.16.3/go.mod h1:ntbaceVETuRiXiv4DpjP66DpAtAGkEQskQzEyD//IeE= +github.com/klauspost/compress v1.16.7 h1:2mk3MPGNzKyxErAw8YaohYh69+pa4sIQSC0fPGCFR9I= +github.com/klauspost/compress v1.16.7/go.mod h1:ntbaceVETuRiXiv4DpjP66DpAtAGkEQskQzEyD//IeE= github.com/knadh/koanf v1.5.0 h1:q2TSd/3Pyc/5yP9ldIrSdIz26MCcyNQzW0pEAugLPNs= github.com/knadh/koanf v1.5.0/go.mod h1:Hgyjp4y8v44hpZtPzs7JZfRAW5AhN7KfZcwv1RYggDs= github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= @@ -275,6 +285,8 @@ github.com/mattn/go-isatty v0.0.16/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/ github.com/mattn/go-isatty v0.0.17/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM= github.com/mattn/go-isatty v0.0.18 h1:DOKFKCQ7FNG2L1rbrmstDN4QVRdS89Nkh85u68Uwp98= github.com/mattn/go-isatty v0.0.18/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y= +github.com/mattn/go-isatty v0.0.19 h1:JITubQf0MOLdlGRuRq+jtsDlekdYPia9ZFsB8h/APPA= +github.com/mattn/go-isatty v0.0.19/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y= github.com/mattn/go-runewidth v0.0.14 h1:+xnbZSEeDbOIg5/mE6JF0w6n9duR1l3/WmbinWVwUuU= github.com/mattn/go-runewidth v0.0.14/go.mod h1:Jdepj2loyihRzMpdS35Xk/zdY8IAYHsh153qUoGf23w= github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= @@ -332,12 +344,16 @@ github.com/prometheus/client_golang v1.11.1/go.mod h1:Z6t4BnS23TR94PD6BsDNk8yVqr github.com/prometheus/client_golang v1.12.1/go.mod h1:3Z9XVyYiZYEO+YQWt3RD2R3jrbd179Rt297l4aS6nDY= github.com/prometheus/client_golang v1.14.0 h1:nJdhIvne2eSX/XRAFV9PcvFFRbrjbcTUj0VP62TMhnw= github.com/prometheus/client_golang v1.14.0/go.mod h1:8vpkKitgIVNcqrRBWh1C4TIUQgYNtG/XQE4E/Zae36Y= +github.com/prometheus/client_golang v1.16.0 h1:yk/hx9hDbrGHovbci4BY+pRMfSuuat626eFsHb7tmT8= +github.com/prometheus/client_golang v1.16.0/go.mod h1:Zsulrv/L9oM40tJ7T815tM89lFEugiJ9HzIqaAx4LKc= github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/client_model v0.2.0/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/client_model v0.3.0 h1:UBgGFHqYdG/TPFD1B1ogZywDqEkwp3fBMvqdiQ7Xew4= github.com/prometheus/client_model v0.3.0/go.mod h1:LDGWKZIo7rky3hgvBe+caln+Dr3dPggB5dvjtD7w9+w= +github.com/prometheus/client_model v0.4.0 h1:5lQXD3cAg1OXBf4Wq03gTrXHeaV0TQvGfUooCfx1yqY= +github.com/prometheus/client_model v0.4.0/go.mod h1:oMQmHW1/JoDwqLtg57MGgP/Fb1CJEYF2imWWhWtMkYU= github.com/prometheus/common v0.4.1/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= github.com/prometheus/common v0.10.0/go.mod h1:Tlit/dnDKsSWFlCLTWaA1cyBgKHSMdTB80sz/V91rCo= github.com/prometheus/common v0.26.0/go.mod h1:M7rCNAaPfAosfx8veZJCuw84e35h3Cfd9VFqTh1DIvc= @@ -345,6 +361,8 @@ github.com/prometheus/common v0.32.1/go.mod h1:vu+V0TpY+O6vW9J44gczi3Ap/oXXR10b+ github.com/prometheus/common v0.37.0/go.mod h1:phzohg0JFMnBEFGxTDbfu3QyL5GI8gTQJFhYO5B3mfA= github.com/prometheus/common v0.42.0 h1:EKsfXEYo4JpWMHH5cg+KOUWeuJSov1Id8zGR8eeI1YM= github.com/prometheus/common v0.42.0/go.mod h1:xBwqVerjNdUDjgODMpudtOMwlOwf2SaTr1yjz4b7Zbc= +github.com/prometheus/common v0.44.0 h1:+5BrQJwiBB9xsMygAB3TNvpQKOwlkc25LbISbrdOOfY= +github.com/prometheus/common v0.44.0/go.mod h1:ofAIvZbQ1e/nugmZGz4/qCb9Ap1VoSTIO7x0VV9VvuY= github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= github.com/prometheus/procfs v0.1.3/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU= @@ -353,6 +371,8 @@ github.com/prometheus/procfs v0.7.3/go.mod h1:cz+aTbrPOrUb4q7XlbU9ygM+/jj0fzG6c1 github.com/prometheus/procfs v0.8.0/go.mod h1:z7EfXMXOkbkqb9IINtpCn86r/to3BnA0uaxHdg830/4= github.com/prometheus/procfs v0.9.0 h1:wzCHvIvM5SxWqYvwgVL7yJY8Lz3PKn49KQtpgMYJfhI= github.com/prometheus/procfs v0.9.0/go.mod h1:+pB4zwohETzFnmlpe6yd2lSc+0/46IYZRB/chUwxUZY= +github.com/prometheus/procfs v0.11.0 h1:5EAgkfkMl659uZPbe9AS2N68a7Cc1TJbPEuGzFuRbyk= +github.com/prometheus/procfs v0.11.0/go.mod h1:nwNm2aOCAYw8uTR/9bWRREkZFxAUcWzPHWJq+XBB/FM= github.com/rhnvrm/simples3 v0.6.1/go.mod h1:Y+3vYm2V7Y4VijFoJHHTrja6OgPrJ2cBti8dPGkC3sA= github.com/rivo/uniseg v0.2.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc= github.com/rivo/uniseg v0.4.4 h1:8TfxU8dW6PdqD27gjM8MVNuicgxIjxpm4K7x4jp8sis= @@ -376,11 +396,14 @@ github.com/speps/go-hashids/v2 v2.0.1 h1:ViWOEqWES/pdOSq+C1SLVa8/Tnsd52XC34RY7lt github.com/speps/go-hashids/v2 v2.0.1/go.mod h1:47LKunwvDZki/uRVD6NImtyk712yFzIs3UF3KlHohGw= github.com/spf13/cobra v1.6.1 h1:o94oiPyS4KD1mPy2fmcYYHHfCxLqYjJOhGsCHFZtEzA= github.com/spf13/cobra v1.6.1/go.mod h1:IOw/AERYS7UzyrGinqmz6HLUo219MORXGxhbaJUqzrY= +github.com/spf13/cobra v1.7.0 h1:hyqWnYt1ZQShIddO5kBpj3vu05/++x6tJ6dg8EC572I= +github.com/spf13/cobra v1.7.0/go.mod h1:uLxZILRyS/50WlhOIKD7W6V5bgeIt+4sICxh6uRMrb0= github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA= github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.5.0 h1:1zr/of2m5FGMsad5YfcqgdqdWrIhu+EBEJRhR1U7z/c= +github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo= github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= @@ -399,6 +422,8 @@ github.com/valyala/fasthttp v1.43.0/go.mod h1:f6VbjjoI3z1NDOZOv17o6RvtRSWxC77seB github.com/valyala/fasthttp v1.44.0/go.mod h1:f6VbjjoI3z1NDOZOv17o6RvtRSWxC77seBFc2uWtgiY= github.com/valyala/fasthttp v1.45.0 h1:zPkkzpIn8tdHZUrVa6PzYd0i5verqiPSkgTd3bSUcpA= github.com/valyala/fasthttp v1.45.0/go.mod h1:k2zXd82h/7UZc3VOdJ2WaUqt1uZ/XpXAfE9i+HBC3lA= +github.com/valyala/fasthttp v1.48.0 h1:oJWvHb9BIZToTQS3MuQ2R3bJZiNSa2KiNdeI8A+79Tc= +github.com/valyala/fasthttp v1.48.0/go.mod h1:k2zXd82h/7UZc3VOdJ2WaUqt1uZ/XpXAfE9i+HBC3lA= github.com/valyala/tcplisten v1.0.0 h1:rBHj/Xf+E1tRGZyWIWwJDiRY0zc1Js+CV5DqwacVSA8= github.com/valyala/tcplisten v1.0.0/go.mod h1:T0xQ8SeCZGxckz9qRXTfG43PvQ/mcWh7FwZEA7Ioqkc= github.com/yuin/goldmark v1.1.25/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= @@ -419,21 +444,35 @@ go.opencensus.io v0.22.3/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= go.opencensus.io v0.22.4/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= go.opentelemetry.io/otel v1.14.0 h1:/79Huy8wbf5DnIPhemGB+zEPVwnN6fuQybr/SRXa6hM= go.opentelemetry.io/otel v1.14.0/go.mod h1:o4buv+dJzx8rohcUeRmWUZhqupFvzWis188WlggnNeU= +go.opentelemetry.io/otel v1.16.0 h1:Z7GVAX/UkAXPKsy94IU+i6thsQS4nb7LviLpnaNeW8s= +go.opentelemetry.io/otel v1.16.0/go.mod h1:vl0h9NUa1D5s1nv3A5vZOYWn8av4K8Ml6JDeHrT/bx4= go.opentelemetry.io/otel/exporters/jaeger v1.14.0 h1:CjbUNd4iN2hHmWekmOqZ+zSCU+dzZppG8XsV+A3oc8Q= go.opentelemetry.io/otel/exporters/jaeger v1.14.0/go.mod h1:4Ay9kk5vELRrbg5z4cpP9EtmQRFap2Wb0woPG4lujZA= +go.opentelemetry.io/otel/exporters/jaeger v1.16.0 h1:YhxxmXZ011C0aDZKoNw+juVWAmEfv/0W2XBOv9aHTaA= +go.opentelemetry.io/otel/exporters/jaeger v1.16.0/go.mod h1:grYbBo/5afWlPpdPZYhyn78Bk04hnvxn2+hvxQhKIQM= +go.opentelemetry.io/otel/metric v1.16.0 h1:RbrpwVG1Hfv85LgnZ7+txXioPDoh6EdbZHo26Q3hqOo= +go.opentelemetry.io/otel/metric v1.16.0/go.mod h1:QE47cpOmkwipPiefDwo2wDzwJrlfxxNYodqc4xnGCo4= go.opentelemetry.io/otel/sdk v1.14.0 h1:PDCppFRDq8A1jL9v6KMI6dYesaq+DFcDZvjsoGvxGzY= go.opentelemetry.io/otel/sdk v1.14.0/go.mod h1:bwIC5TjrNG6QDCHNWvW4HLHtUQ4I+VQDsnjhvyZCALM= +go.opentelemetry.io/otel/sdk v1.16.0 h1:Z1Ok1YsijYL0CSJpHt4cS3wDDh7p572grzNrBMiMWgE= +go.opentelemetry.io/otel/sdk v1.16.0/go.mod h1:tMsIuKXuuIWPBAOrH+eHtvhTL+SntFtXF9QD68aP6p4= go.opentelemetry.io/otel/trace v1.14.0 h1:wp2Mmvj41tDsyAJXiWDWpfNsOiIyd38fy85pyKcFq/M= go.opentelemetry.io/otel/trace v1.14.0/go.mod h1:8avnQLK+CG77yNLUae4ea2JDQ6iT+gozhnZjy/rw9G8= +go.opentelemetry.io/otel/trace v1.16.0 h1:8JRpaObFoW0pxuVPapkgH8UhHQj+bJW8jJsCZEu5MQs= +go.opentelemetry.io/otel/trace v1.16.0/go.mod h1:Yt9vYq1SdNz3xdjZZK7wcXv1qv2pwLkqr2QVwea0ef0= go.uber.org/atomic v1.7.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc= go.uber.org/atomic v1.10.0 h1:9qC72Qh0+3MqyJbAn8YU5xVq1frD8bn3JtD2oXtafVQ= go.uber.org/atomic v1.10.0/go.mod h1:LUxbIzbOniOlMKjJjyPfpl4v+PKK2cNJn91OQbhoJI0= +go.uber.org/atomic v1.11.0 h1:ZvwS0R+56ePWxUNi+Atn9dWONBPp/AUETXlHW0DxSjE= +go.uber.org/atomic v1.11.0/go.mod h1:LUxbIzbOniOlMKjJjyPfpl4v+PKK2cNJn91OQbhoJI0= go.uber.org/automaxprocs v1.5.2 h1:2LxUOGiR3O6tw8ui5sZa2LAaHnsviZdVOUZw4fvbnME= go.uber.org/automaxprocs v1.5.2/go.mod h1:eRbA25aqJrxAbsLO0xy5jVwPt7FQnRgjW+efnwa1WM0= go.uber.org/goleak v1.1.12 h1:gZAh5/EyT/HQwlpkCy6wTpqfH9H8Lz8zbm3dZh+OyzA= go.uber.org/multierr v1.6.0/go.mod h1:cdWPpRnG4AhwMwsgIHip0KRBQjJy5kYEpYjJxpXp9iU= go.uber.org/multierr v1.10.0 h1:S0h4aNzvfcFsC3dRF1jLoaov7oRaKqRGC/pUEJ2yvPQ= go.uber.org/multierr v1.10.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y= +go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0= +go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y= go.uber.org/zap v1.17.0/go.mod h1:MXVU+bhUf/A7Xi2HNOnopQOrmycQ5Ih87HtOu4q5SSo= go.uber.org/zap v1.24.0 h1:FiJd5l1UOLj0wCgbSE0rwwXHzEdAZS6hiiSnxJN/D60= go.uber.org/zap v1.24.0/go.mod h1:2kMP+WWQ8aoFoedH3T2sq6iJ2yDWpHbP0f6MQbS9Gkg= @@ -603,6 +642,8 @@ golang.org/x/sys v0.0.0-20220908164124-27713097b956/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.3.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.6.0 h1:MVltZSvRTcU2ljQOhs94SXPftV6DCNnZViHeQps87pQ= golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.10.0 h1:SqMFp9UcQJZa+pmYuAKjd9xq1f0j5rLcDIk0mj4qAsA= +golang.org/x/sys v0.10.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/term v0.3.0/go.mod h1:q750SLmJuPmVoN1blW3UFBPREJfb1KmY3vwxfr+nFDA= @@ -755,6 +796,8 @@ google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQ google.golang.org/protobuf v1.28.1/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= google.golang.org/protobuf v1.30.0 h1:kPPoIgf3TsEvrm0PFe15JQ+570QVxYzEvvHqChK+cng= google.golang.org/protobuf v1.30.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= +google.golang.org/protobuf v1.31.0 h1:g0LDEJHgrBl9N9r17Ru3sqWhkIx2NB67okBHPwC7hs8= +google.golang.org/protobuf v1.31.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= gopkg.in/asn1-ber.v1 v1.0.0-20181015200546-f715ec2f112d/go.mod h1:cuepJuh7vyXfUyUwEgHQXw849cJrilpS5NeIjOWESAw= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= From 2c7c714da556cd8490df2bfd212c1ae4cd3c2746 Mon Sep 17 00:00:00 2001 From: Parham Alvani Date: Wed, 19 Jul 2023 09:02:50 +0330 Subject: [PATCH 390/660] feat: add new headers --- internal/authenticator/auto_authenticator.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/internal/authenticator/auto_authenticator.go b/internal/authenticator/auto_authenticator.go index 36c1679b..6fb1f805 100644 --- a/internal/authenticator/auto_authenticator.go +++ b/internal/authenticator/auto_authenticator.go @@ -26,7 +26,12 @@ type AutoAuthenticator struct { // isSuperuser is a flag that authenticator set it true when credentials is related to a superuser. func (a AutoAuthenticator) Auth(tokenString string) error { if _, err := a.Validator.Validate(context.Background(), &http.Header{ - "X-Service-Name": []string{"Soteria"}, + "x-service-name": []string{"soteria"}, + "user-agent": []string{}, + "x-app-version-code": []string{""}, + "x-app-version": []string{""}, + "x-app-name": []string{"soteria"}, + "locale": []string{"en-US"}, }, tokenString); err != nil { return fmt.Errorf("token is invalid: %w", err) } From ba06333a61a5c38201e3b4cf11cc60ccf6288e7b Mon Sep 17 00:00:00 2001 From: Parham Alvani Date: Wed, 19 Jul 2023 09:50:18 +0330 Subject: [PATCH 391/660] fix: correct tests --- internal/api/api_test.go | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/internal/api/api_test.go b/internal/api/api_test.go index 95f1294e..f914aadd 100644 --- a/internal/api/api_test.go +++ b/internal/api/api_test.go @@ -3,17 +3,19 @@ package api_test import ( "testing" - "testing" - "gitlab.snapp.ir/dispatching/soteria/internal/api" ) +// nolint: funlen func TestExtractVendorToken(t *testing.T) { + t.Parallel() + type fields struct { Token string Username string Password string } + tests := []struct { name string fields fields @@ -62,7 +64,10 @@ func TestExtractVendorToken(t *testing.T) { }, } for _, tt := range tests { + tt := tt + t.Run(tt.name, func(t *testing.T) { + t.Parallel() vendor, token := api.ExtractVendorToken(tt.fields.Token, tt.fields.Username, tt.fields.Password) if vendor != tt.vendor { t.Errorf("ExtractVendorToken() vendor = %v, vendor %v", vendor, tt.vendor) From fe1f4b1cc42ae8a475d6e7f3c52a8de0c2dabf3e Mon Sep 17 00:00:00 2001 From: Parham Alvani Date: Wed, 19 Jul 2023 10:03:58 +0330 Subject: [PATCH 392/660] fix: correct lint issues --- .../authenticator/auto_authenticator_test.go | 30 +++++++----------- .../manual_authenticator_test.go | 31 +++++++++---------- 2 files changed, 26 insertions(+), 35 deletions(-) diff --git a/internal/authenticator/auto_authenticator_test.go b/internal/authenticator/auto_authenticator_test.go index ba3b6143..dbf9e496 100644 --- a/internal/authenticator/auto_authenticator_test.go +++ b/internal/authenticator/auto_authenticator_test.go @@ -36,13 +36,11 @@ type AutoAuthenticatorTestSuite struct { func (suite *AutoAuthenticatorTestSuite) SetupSuite() { require := suite.Require() - driverToken, err := suite.getSampleToken(topics.DriverIss, false) - require.NoError(err) + driverToken := suite.getSampleToken(topics.DriverIss) suite.Tokens.Driver = driverToken - passengerToken, err := suite.getSampleToken(topics.PassengerIss, false) - require.NoError(err) + passengerToken := suite.getSampleToken(topics.PassengerIss) suite.Tokens.Passenger = passengerToken @@ -61,11 +59,8 @@ func (suite *AutoAuthenticatorTestSuite) SetupSuite() { hid, err := topics.NewHashIDManager(cfg.HashIDMap) require.NoError(err) - // - // appCfg := config.New() - // - // validatorClient := validatorSDK.New(appCfg.Validator.URL, appCfg.Validator.Timeout) + // nolint: exhaustruct suite.Authenticator = authenticator.AutoAuthenticator{ Keys: map[string][]any{ topics.DriverIss: {pkey0}, @@ -94,6 +89,7 @@ func (suite *AutoAuthenticatorTestSuite) TestAuth() { }) } +// nolint: dupl func (suite *AutoAuthenticatorTestSuite) TestACL_Basics() { require := suite.Require() @@ -309,12 +305,14 @@ func TestAutoAuthenticator_ValidateTopicBySender(t *testing.T) { } t.Run("testing valid driver cab event", func(t *testing.T) { + t.Parallel() + topicTemplate := authenticator.TopicManager.ParseTopic(validDriverCabEventTopic, topics.DriverIss, "DXKgaNQa7N5Y7bo") assert.True(t, topicTemplate != nil) }) } -// nolint: funlen +// nolint: funlen, dupl func TestAutoAuthenticator_validateAccessType(t *testing.T) { t.Parallel() @@ -456,11 +454,9 @@ func (suite *AutoAuthenticatorTestSuite) getPrivateKey(u string) (*rsa.PrivateKe return privateKey, nil } -func (suite *AutoAuthenticatorTestSuite) getSampleToken(issuer string, isSuperuser bool) (string, error) { +func (suite *AutoAuthenticatorTestSuite) getSampleToken(issuer string) string { key, err := suite.getPrivateKey(issuer) - if err != nil { - suite.Require().NoError(err) - } + suite.Require().NoError(err) exp := time.Now().Add(time.Hour * 24 * 365 * 10) sub := "DXKgaNQa7N5Y7bo" @@ -468,15 +464,13 @@ func (suite *AutoAuthenticatorTestSuite) getSampleToken(issuer string, isSuperus // nolint: exhaustruct claims := jwt.RegisteredClaims{ ExpiresAt: jwt.NewNumericDate(exp), - Issuer: string(issuer), + Issuer: issuer, Subject: sub, } token := jwt.NewWithClaims(jwt.SigningMethodRS256, claims) tokenString, err := token.SignedString(key) - if err != nil { - suite.Require().NoError(err) - } + suite.Require().NoError(err) - return tokenString, nil + return tokenString } diff --git a/internal/authenticator/manual_authenticator_test.go b/internal/authenticator/manual_authenticator_test.go index 70615f36..3929b7dc 100644 --- a/internal/authenticator/manual_authenticator_test.go +++ b/internal/authenticator/manual_authenticator_test.go @@ -3,7 +3,7 @@ package authenticator_test import ( "crypto/rsa" "errors" - "io/ioutil" + "os" "testing" "time" @@ -36,13 +36,11 @@ type ManualAuthenticatorTestSuite struct { func (suite *ManualAuthenticatorTestSuite) SetupSuite() { require := suite.Require() - driverToken, err := suite.getSampleToken(topics.DriverIss, false) - require.NoError(err) + driverToken := suite.getSampleToken(topics.DriverIss) suite.Tokens.Driver = driverToken - passengerToken, err := suite.getSampleToken(topics.PassengerIss, false) - require.NoError(err) + passengerToken := suite.getSampleToken(topics.PassengerIss) suite.Tokens.Passenger = passengerToken @@ -61,6 +59,7 @@ func (suite *ManualAuthenticatorTestSuite) SetupSuite() { hid, err := topics.NewHashIDManager(cfg.HashIDMap) require.NoError(err) + // nolint: exhaustruct suite.Authenticator = authenticator.ManualAuthenticator{ Keys: map[string][]any{ topics.DriverIss: {pkey0}, @@ -88,6 +87,7 @@ func (suite *ManualAuthenticatorTestSuite) TestAuth() { }) } +// nolint: dupl func (suite *ManualAuthenticatorTestSuite) TestACL_Basics() { require := suite.Require() @@ -302,12 +302,13 @@ func TestManualAuthenticator_ValidateTopicBySender(t *testing.T) { } t.Run("testing valid driver cab event", func(t *testing.T) { + t.Parallel() topicTemplate := authenticator.TopicManager.ParseTopic(validDriverCabEventTopic, topics.DriverIss, "DXKgaNQa7N5Y7bo") assert.True(t, topicTemplate != nil) }) } -// nolint: funlen +// nolint: funlen, dupl func TestManualAuthenticator_validateAccessType(t *testing.T) { t.Parallel() @@ -410,7 +411,7 @@ func (suite *ManualAuthenticatorTestSuite) getPublicKey(u string) (*rsa.PublicKe return nil, errors.New("invalid user, public key not found") } - pem, err := ioutil.ReadFile(fileName) + pem, err := os.ReadFile(fileName) if err != nil { return nil, err } @@ -436,7 +437,7 @@ func (suite *ManualAuthenticatorTestSuite) getPrivateKey(u string) (*rsa.Private return nil, errors.New("invalid user, private key not found") } - pem, err := ioutil.ReadFile(fileName) + pem, err := os.ReadFile(fileName) if err != nil { return nil, err } @@ -449,11 +450,9 @@ func (suite *ManualAuthenticatorTestSuite) getPrivateKey(u string) (*rsa.Private return privateKey, nil } -func (suite *ManualAuthenticatorTestSuite) getSampleToken(issuer string, isSuperuser bool) (string, error) { +func (suite *ManualAuthenticatorTestSuite) getSampleToken(issuer string) string { key, err := suite.getPrivateKey(issuer) - if err != nil { - suite.Require().NoError(err) - } + suite.Require().NoError(err) exp := time.Now().Add(time.Hour * 24 * 365 * 10) sub := "DXKgaNQa7N5Y7bo" @@ -461,15 +460,13 @@ func (suite *ManualAuthenticatorTestSuite) getSampleToken(issuer string, isSuper // nolint: exhaustruct claims := jwt.RegisteredClaims{ ExpiresAt: jwt.NewNumericDate(exp), - Issuer: string(issuer), + Issuer: issuer, Subject: sub, } token := jwt.NewWithClaims(jwt.SigningMethodRS256, claims) tokenString, err := token.SignedString(key) - if err != nil { - suite.Require().NoError(err) - } + suite.Require().NoError(err) - return tokenString, nil + return tokenString } From 591e827d36e608bd6cdc709ced4bdf18e19f890a Mon Sep 17 00:00:00 2001 From: Mostafa Asgari Date: Sat, 22 Jul 2023 11:27:31 +0330 Subject: [PATCH 393/660] fix: fix validator client http headers --- internal/authenticator/auto_authenticator.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/internal/authenticator/auto_authenticator.go b/internal/authenticator/auto_authenticator.go index 6fb1f805..91c19b64 100644 --- a/internal/authenticator/auto_authenticator.go +++ b/internal/authenticator/auto_authenticator.go @@ -26,11 +26,11 @@ type AutoAuthenticator struct { // isSuperuser is a flag that authenticator set it true when credentials is related to a superuser. func (a AutoAuthenticator) Auth(tokenString string) error { if _, err := a.Validator.Validate(context.Background(), &http.Header{ - "x-service-name": []string{"soteria"}, + "X-Service-Name": []string{"soteria"}, "user-agent": []string{}, - "x-app-version-code": []string{""}, - "x-app-version": []string{""}, - "x-app-name": []string{"soteria"}, + "X-APP-Version-Code": []string{""}, + "X-APP-Version": []string{""}, + "X-APP-Name": []string{"soteria"}, "locale": []string{"en-US"}, }, tokenString); err != nil { return fmt.Errorf("token is invalid: %w", err) From 21b65bc87c7bcb172eab1a8342b58c14b1caab7f Mon Sep 17 00:00:00 2001 From: Mostafa Asgari Date: Sat, 22 Jul 2023 11:43:25 +0330 Subject: [PATCH 394/660] fix: add bearer keyword to auth token --- internal/authenticator/auto_authenticator.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/authenticator/auto_authenticator.go b/internal/authenticator/auto_authenticator.go index 91c19b64..4e6f5835 100644 --- a/internal/authenticator/auto_authenticator.go +++ b/internal/authenticator/auto_authenticator.go @@ -32,7 +32,7 @@ func (a AutoAuthenticator) Auth(tokenString string) error { "X-APP-Version": []string{""}, "X-APP-Name": []string{"soteria"}, "locale": []string{"en-US"}, - }, tokenString); err != nil { + }, fmt.Sprintf("bearer %s", tokenString)); err != nil { return fmt.Errorf("token is invalid: %w", err) } From 329a3bcb7f48c6d5b0e3b0c748f02c3eb88043cd Mon Sep 17 00:00:00 2001 From: Mohammad Khoddam Date: Mon, 24 Jul 2023 14:26:46 +0330 Subject: [PATCH 395/660] feat: update chart version --- deployments/soteria/Chart.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/deployments/soteria/Chart.yaml b/deployments/soteria/Chart.yaml index 55e067b9..e0cac471 100644 --- a/deployments/soteria/Chart.yaml +++ b/deployments/soteria/Chart.yaml @@ -5,6 +5,6 @@ description: Soteria Helm Chart type: application -version: 7.0.3 +version: 7.0.4 -appVersion: "v7-0-3" +appVersion: "v7-0-4" From 9b93e9cf47a5e68d359146074a4b1c0ee9472be3 Mon Sep 17 00:00:00 2001 From: "ahmad.mohammadi" Date: Tue, 25 Jul 2023 19:06:13 +0430 Subject: [PATCH 396/660] feat: disable validator --- deployments/soteria/values.ode.snapp.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/deployments/soteria/values.ode.snapp.yaml b/deployments/soteria/values.ode.snapp.yaml index 7fc5ec85..26d350d5 100644 --- a/deployments/soteria/values.ode.snapp.yaml +++ b/deployments/soteria/values.ode.snapp.yaml @@ -19,7 +19,7 @@ config: vendors: snapp: - use_validator: true + use_validator: false company: "snapp" hashid_map: 0: From 771fb18a8ff1b4e26c56368c5e43b2c86090ca5d Mon Sep 17 00:00:00 2001 From: "ahmad.mohammadi" Date: Tue, 25 Jul 2023 19:25:51 +0430 Subject: [PATCH 397/660] feat: change version --- deployments/soteria/values.ode.snapp.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/deployments/soteria/values.ode.snapp.yaml b/deployments/soteria/values.ode.snapp.yaml index 26d350d5..2fd5ae45 100644 --- a/deployments/soteria/values.ode.snapp.yaml +++ b/deployments/soteria/values.ode.snapp.yaml @@ -9,7 +9,7 @@ labels: image: registry: image-registry.apps.private.okd4.teh-1.snappcloud.io repository: mozart/soteria - tag: main + tag: v7.0.2 pullPolicy: Always config: From b32b85f41256d8ce2d704402d0d0bac11b8eef7d Mon Sep 17 00:00:00 2001 From: "ahmad.mohammadi" Date: Tue, 25 Jul 2023 19:27:14 +0430 Subject: [PATCH 398/660] feat: change version --- deployments/soteria/values.ode.snapp.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/deployments/soteria/values.ode.snapp.yaml b/deployments/soteria/values.ode.snapp.yaml index 2fd5ae45..26d350d5 100644 --- a/deployments/soteria/values.ode.snapp.yaml +++ b/deployments/soteria/values.ode.snapp.yaml @@ -9,7 +9,7 @@ labels: image: registry: image-registry.apps.private.okd4.teh-1.snappcloud.io repository: mozart/soteria - tag: v7.0.2 + tag: main pullPolicy: Always config: From 99a03ba8bc16fb829dcd45097801aa48d2df7ac9 Mon Sep 17 00:00:00 2001 From: Parham Alvani Date: Tue, 25 Jul 2023 20:56:20 +0330 Subject: [PATCH 399/660] fix: correct issue with acl in auto authenticator --- internal/authenticator/auto_authenticator.go | 31 ++------------------ 1 file changed, 2 insertions(+), 29 deletions(-) diff --git a/internal/authenticator/auto_authenticator.go b/internal/authenticator/auto_authenticator.go index 4e6f5835..3712dbf4 100644 --- a/internal/authenticator/auto_authenticator.go +++ b/internal/authenticator/auto_authenticator.go @@ -50,36 +50,9 @@ func (a AutoAuthenticator) ACL( return false, ErrInvalidAccessType } - token, err := jwt.Parse(tokenString, func(token *jwt.Token) (interface{}, error) { - if token.Method.Alg() != a.JwtConfig.SigningMethod { - return nil, ErrInvalidSigningMethod - } - - claims, ok := token.Claims.(jwt.MapClaims) - if !ok { - return nil, ErrInvalidClaims - } - if claims[a.JwtConfig.IssName] == nil { - return nil, ErrIssNotFound - } - if claims[a.JwtConfig.SubName] == nil { - return nil, ErrSubNotFound - } - - issuer := fmt.Sprintf("%v", claims[a.JwtConfig.IssName]) - key := a.Keys[issuer] - if key == nil { - return nil, KeyNotFoundError{Issuer: issuer} - } - - return key, nil - }) - if err != nil { - return false, fmt.Errorf("token is invalid %w", err) - } + var claims jwt.MapClaims - claims, ok := token.Claims.(jwt.MapClaims) - if !ok { + if _, _, err := jwt.NewParser().ParseUnverified(tokenString, &claims); err != nil { return false, ErrInvalidClaims } From 2d51dae7dfa3157aba9a48ab20fc62b9dcb75a69 Mon Sep 17 00:00:00 2001 From: Parham Alvani Date: Tue, 25 Jul 2023 21:24:36 +0330 Subject: [PATCH 400/660] fix: correct lint issues --- internal/cmd/serve/main.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/cmd/serve/main.go b/internal/cmd/serve/main.go index c01bc911..3f806717 100644 --- a/internal/cmd/serve/main.go +++ b/internal/cmd/serve/main.go @@ -61,7 +61,7 @@ func (s Serve) Register(root *cobra.Command) { Use: "serve", Short: "serve runs the application", Long: `serve will run Soteria ReST server and waits until user disrupts.`, - Run: func(cmd *cobra.Command, args []string) { + Run: func(_ *cobra.Command, _ []string) { s.main() }, }, From d154d1d7881fe6056b954eca608a56eac32f585a Mon Sep 17 00:00:00 2001 From: Parham Alvani Date: Tue, 25 Jul 2023 21:55:56 +0330 Subject: [PATCH 401/660] feat: update chart version --- deployments/soteria/Chart.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/deployments/soteria/Chart.yaml b/deployments/soteria/Chart.yaml index e0cac471..f3c06ab8 100644 --- a/deployments/soteria/Chart.yaml +++ b/deployments/soteria/Chart.yaml @@ -5,6 +5,6 @@ description: Soteria Helm Chart type: application -version: 7.0.4 +version: 7.1.0 -appVersion: "v7-0-4" +appVersion: "v7-1-0" From 5aa5f46283122152ad0af261677bb9d2546543e0 Mon Sep 17 00:00:00 2001 From: Parham Alvani Date: Mon, 7 Aug 2023 10:02:47 -0400 Subject: [PATCH 402/660] feat: update packages --- go.mod | 12 ++++++------ go.sum | 12 ++++++++++++ 2 files changed, 18 insertions(+), 6 deletions(-) diff --git a/go.mod b/go.mod index 345a2c3e..363c3968 100644 --- a/go.mod +++ b/go.mod @@ -13,14 +13,14 @@ require ( github.com/spf13/cobra v1.7.0 github.com/stretchr/testify v1.8.4 github.com/tidwall/pretty v1.2.1 - gitlab.snapp.ir/security_regulatory/validator/pkg/sdk v0.2.1 + gitlab.snapp.ir/security_regulatory/validator/pkg/sdk v0.2.2 go.opentelemetry.io/otel v1.16.0 go.opentelemetry.io/otel/exporters/jaeger v1.16.0 go.opentelemetry.io/otel/sdk v1.16.0 go.opentelemetry.io/otel/trace v1.16.0 go.uber.org/atomic v1.11.0 // indirect - go.uber.org/automaxprocs v1.5.2 - go.uber.org/zap v1.24.0 + go.uber.org/automaxprocs v1.5.3 + go.uber.org/zap v1.25.0 ) require ( @@ -39,7 +39,7 @@ require ( github.com/klauspost/compress v1.16.7 // indirect github.com/mattn/go-colorable v0.1.13 // indirect github.com/mattn/go-isatty v0.0.19 // indirect - github.com/mattn/go-runewidth v0.0.14 // indirect + github.com/mattn/go-runewidth v0.0.15 // indirect github.com/matttproud/golang_protobuf_extensions v1.0.4 // indirect github.com/mitchellh/copystructure v1.2.0 // indirect github.com/mitchellh/mapstructure v1.5.0 // indirect @@ -48,7 +48,7 @@ require ( github.com/pmezard/go-difflib v1.0.0 // indirect github.com/prometheus/client_model v0.4.0 // indirect github.com/prometheus/common v0.44.0 // indirect - github.com/prometheus/procfs v0.11.0 // indirect + github.com/prometheus/procfs v0.11.1 // indirect github.com/rivo/uniseg v0.4.4 // indirect github.com/savsgio/dictpool v0.0.0-20221023140959-7bf2e61cea94 // indirect github.com/savsgio/gotils v0.0.0-20230208104028-c358bd845dee // indirect @@ -59,7 +59,7 @@ require ( github.com/valyala/tcplisten v1.0.0 // indirect go.opentelemetry.io/otel/metric v1.16.0 // indirect go.uber.org/multierr v1.11.0 // indirect - golang.org/x/sys v0.10.0 // indirect + golang.org/x/sys v0.11.0 // indirect google.golang.org/protobuf v1.31.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect ) diff --git a/go.sum b/go.sum index 5830a854..8551a019 100644 --- a/go.sum +++ b/go.sum @@ -289,6 +289,8 @@ github.com/mattn/go-isatty v0.0.19 h1:JITubQf0MOLdlGRuRq+jtsDlekdYPia9ZFsB8h/APP github.com/mattn/go-isatty v0.0.19/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y= github.com/mattn/go-runewidth v0.0.14 h1:+xnbZSEeDbOIg5/mE6JF0w6n9duR1l3/WmbinWVwUuU= github.com/mattn/go-runewidth v0.0.14/go.mod h1:Jdepj2loyihRzMpdS35Xk/zdY8IAYHsh153qUoGf23w= +github.com/mattn/go-runewidth v0.0.15 h1:UNAjwbU9l54TA3KzvqLGxwWjHmMgBUVhBiTjelZgg3U= +github.com/mattn/go-runewidth v0.0.15/go.mod h1:Jdepj2loyihRzMpdS35Xk/zdY8IAYHsh153qUoGf23w= github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= github.com/matttproud/golang_protobuf_extensions v1.0.4 h1:mmDVorXM7PCGKw94cs5zkfA9PSy5pEvNWRP0ET0TIVo= github.com/matttproud/golang_protobuf_extensions v1.0.4/go.mod h1:BSXmuO+STAnVfrANrmjBb36TMTDstsz7MSK+HVaYKv4= @@ -373,6 +375,8 @@ github.com/prometheus/procfs v0.9.0 h1:wzCHvIvM5SxWqYvwgVL7yJY8Lz3PKn49KQtpgMYJf github.com/prometheus/procfs v0.9.0/go.mod h1:+pB4zwohETzFnmlpe6yd2lSc+0/46IYZRB/chUwxUZY= github.com/prometheus/procfs v0.11.0 h1:5EAgkfkMl659uZPbe9AS2N68a7Cc1TJbPEuGzFuRbyk= github.com/prometheus/procfs v0.11.0/go.mod h1:nwNm2aOCAYw8uTR/9bWRREkZFxAUcWzPHWJq+XBB/FM= +github.com/prometheus/procfs v0.11.1 h1:xRC8Iq1yyca5ypa9n1EZnWZkt7dwcoRPQwX/5gwaUuI= +github.com/prometheus/procfs v0.11.1/go.mod h1:eesXgaPo1q7lBpVMoMy0ZOFTth9hBn4W/y0/p/ScXhY= github.com/rhnvrm/simples3 v0.6.1/go.mod h1:Y+3vYm2V7Y4VijFoJHHTrja6OgPrJ2cBti8dPGkC3sA= github.com/rivo/uniseg v0.2.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc= github.com/rivo/uniseg v0.4.4 h1:8TfxU8dW6PdqD27gjM8MVNuicgxIjxpm4K7x4jp8sis= @@ -434,6 +438,8 @@ github.com/yuin/goldmark v1.3.5/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1 github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY= gitlab.snapp.ir/security_regulatory/validator/pkg/sdk v0.2.1 h1:5R+WK9NRRaKXItZZzOcPV1yJQflm/MbXGsN+7BXhpKQ= gitlab.snapp.ir/security_regulatory/validator/pkg/sdk v0.2.1/go.mod h1:Y21ZWyfYMWKqotRn1i1BoI6ieZJs9qaoAppHNXFgnKs= +gitlab.snapp.ir/security_regulatory/validator/pkg/sdk v0.2.2 h1:+JwjrfGwsdgojbfn26M4Af/ZzBHCsLyU9vNYWXe1HnM= +gitlab.snapp.ir/security_regulatory/validator/pkg/sdk v0.2.2/go.mod h1:+0JXkekQpl5kJvmIKyBH5EJLIj0u628fbk+GfaIS+3k= go.etcd.io/etcd/api/v3 v3.5.4/go.mod h1:5GB2vv4A4AOn3yk7MftYGHkUfGtDHnEraIjym4dYz5A= go.etcd.io/etcd/client/pkg/v3 v3.5.4/go.mod h1:IJHfcCEKxYu1Os13ZdwCwIUTUVGYTSAM3YSwc9/Ac1g= go.etcd.io/etcd/client/v3 v3.5.4/go.mod h1:ZaRkVgBZC+L+dLCjTcF1hRXpgZXQPOvnA/Ak/gq3kiY= @@ -467,6 +473,8 @@ go.uber.org/atomic v1.11.0 h1:ZvwS0R+56ePWxUNi+Atn9dWONBPp/AUETXlHW0DxSjE= go.uber.org/atomic v1.11.0/go.mod h1:LUxbIzbOniOlMKjJjyPfpl4v+PKK2cNJn91OQbhoJI0= go.uber.org/automaxprocs v1.5.2 h1:2LxUOGiR3O6tw8ui5sZa2LAaHnsviZdVOUZw4fvbnME= go.uber.org/automaxprocs v1.5.2/go.mod h1:eRbA25aqJrxAbsLO0xy5jVwPt7FQnRgjW+efnwa1WM0= +go.uber.org/automaxprocs v1.5.3 h1:kWazyxZUrS3Gs4qUpbwo5kEIMGe/DAvi5Z4tl2NW4j8= +go.uber.org/automaxprocs v1.5.3/go.mod h1:eRbA25aqJrxAbsLO0xy5jVwPt7FQnRgjW+efnwa1WM0= go.uber.org/goleak v1.1.12 h1:gZAh5/EyT/HQwlpkCy6wTpqfH9H8Lz8zbm3dZh+OyzA= go.uber.org/multierr v1.6.0/go.mod h1:cdWPpRnG4AhwMwsgIHip0KRBQjJy5kYEpYjJxpXp9iU= go.uber.org/multierr v1.10.0 h1:S0h4aNzvfcFsC3dRF1jLoaov7oRaKqRGC/pUEJ2yvPQ= @@ -476,6 +484,8 @@ go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN8 go.uber.org/zap v1.17.0/go.mod h1:MXVU+bhUf/A7Xi2HNOnopQOrmycQ5Ih87HtOu4q5SSo= go.uber.org/zap v1.24.0 h1:FiJd5l1UOLj0wCgbSE0rwwXHzEdAZS6hiiSnxJN/D60= go.uber.org/zap v1.24.0/go.mod h1:2kMP+WWQ8aoFoedH3T2sq6iJ2yDWpHbP0f6MQbS9Gkg= +go.uber.org/zap v1.25.0 h1:4Hvk6GtkucQ790dqmj7l1eEnRdKm3k3ZUrUMS2d5+5c= +go.uber.org/zap v1.25.0/go.mod h1:JIAUzQIH94IC4fOJQm7gMmBJP5k7wQfdcnYdPoEXJYk= golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= @@ -644,6 +654,8 @@ golang.org/x/sys v0.6.0 h1:MVltZSvRTcU2ljQOhs94SXPftV6DCNnZViHeQps87pQ= golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.10.0 h1:SqMFp9UcQJZa+pmYuAKjd9xq1f0j5rLcDIk0mj4qAsA= golang.org/x/sys v0.10.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.11.0 h1:eG7RXZHdqOJ1i+0lgLgCpSXAp6M3LYlAo6osgSi0xOM= +golang.org/x/sys v0.11.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/term v0.3.0/go.mod h1:q750SLmJuPmVoN1blW3UFBPREJfb1KmY3vwxfr+nFDA= From 8d65f64232bdf5351015562dae87ee87c21f8e04 Mon Sep 17 00:00:00 2001 From: Parham Alvani Date: Tue, 15 Aug 2023 03:18:34 -0400 Subject: [PATCH 403/660] feat: update go version and packages --- .gitlab-ci.yml | 4 ---- Dockerfile | 17 +++++------------ go.mod | 4 ++-- go.sum | 2 ++ 4 files changed, 9 insertions(+), 18 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 160e07a7..1e05cdde 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -6,10 +6,6 @@ stages: - build - release -variables: - BUILD_PATH: "./" - PROJECT_VERSION: "${CI_COMMIT_SHA}" - include: - local: .gitlab/ci/templates/compile.gitlab-ci.yml - local: .gitlab/ci/templates/test.gitlab-ci.yml diff --git a/Dockerfile b/Dockerfile index f0b3f13f..ce85503a 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,19 +1,12 @@ -FROM alpine:3.16 -ARG BUILD_DATE -ARG VCS_REF -ARG BUILD_VERSION +FROM alpine:3.18 # hadolint ignore=DL3018 -RUN echo "https://repo.snapp.tech/repository/alpine/v3.16/main" > /etc/apk/repositories && \ - echo "https://repo.snapp.tech/repository/alpine/v3.16/community" >> /etc/apk/repositories && \ - apk --no-cache --update add ca-certificates tzdata && \ - mkdir /app +RUN echo "https://repo.snapp.tech/repository/alpine/v3.18/main" > /etc/apk/repositories && \ + echo "https://repo.snapp.tech/repository/alpine/v3.18/community" >> /etc/apk/repositories && \ + apk --no-cache --update add ca-certificates tzdata && \ + mkdir /app COPY ./soteria /app WORKDIR /app -ENV SOTERIA_BUILD_DATE=${BUILD_DATE} -ENV SOTERIA_VCS_REF=${VCS_REF} -ENV SOTERIA_BUILD_VERSION=${BUILD_VERSION} - CMD ["/app/soteria", "serve"] diff --git a/go.mod b/go.mod index 363c3968..b9b91f30 100644 --- a/go.mod +++ b/go.mod @@ -1,9 +1,9 @@ module gitlab.snapp.ir/dispatching/soteria -go 1.20 +go 1.21 require ( - github.com/ansrivas/fiberprometheus/v2 v2.6.0 + github.com/ansrivas/fiberprometheus/v2 v2.6.1 github.com/gofiber/contrib/fiberzap v1.0.2 github.com/gofiber/fiber/v2 v2.48.0 github.com/golang-jwt/jwt/v5 v5.0.0 diff --git a/go.sum b/go.sum index 8551a019..ae30484e 100644 --- a/go.sum +++ b/go.sum @@ -44,6 +44,8 @@ github.com/andybalholm/brotli v1.0.5 h1:8uQZIdzKmjc/iuPu7O2ioW48L81FgatrcpfFmiq/ github.com/andybalholm/brotli v1.0.5/go.mod h1:fO7iG3H7G2nSZ7m0zPUDn85XEX2GTukHGRSepvi9Eig= github.com/ansrivas/fiberprometheus/v2 v2.6.0 h1:QUaaKxil/N5IM1R19k6jsmFEJMfa4O3qtnDkiF+zxUc= github.com/ansrivas/fiberprometheus/v2 v2.6.0/go.mod h1:hivZjKkqX04PPbMZNi9iGB0AQ90iN6RmKERiX1TdgTA= +github.com/ansrivas/fiberprometheus/v2 v2.6.1 h1:wac3pXaE6BYYTF04AC6K0ktk6vCD+MnDOJZ3SK66kXM= +github.com/ansrivas/fiberprometheus/v2 v2.6.1/go.mod h1:MloIKvy4yN6hVqlRpJ/jDiR244YnWJaQC0FIqS8A+MY= github.com/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kdvxnR2qWY= github.com/armon/circbuf v0.0.0-20150827004946-bbbad097214e/go.mod h1:3U/XgcO3hCbHZ8TKRvWD2dDTCfh9M9ya+I9JpbB7O8o= github.com/armon/go-metrics v0.0.0-20180917152333-f0300d1749da/go.mod h1:Q73ZrmVTwzkszR9V5SSuryQ31EELlFMUz1kKyl939pY= From 57f27a5c73a7f0aecabce7112a2670ee61733cd5 Mon Sep 17 00:00:00 2001 From: Parham Alvani Date: Tue, 15 Aug 2023 03:21:47 -0400 Subject: [PATCH 404/660] feat: update pipelines --- .gitlab/ci/templates/build.gitlab-ci.yml | 18 ++---------------- .gitlab/ci/templates/compile.gitlab-ci.yml | 13 ++++--------- .gitlab/ci/templates/test.gitlab-ci.yml | 5 ++--- 3 files changed, 8 insertions(+), 28 deletions(-) diff --git a/.gitlab/ci/templates/build.gitlab-ci.yml b/.gitlab/ci/templates/build.gitlab-ci.yml index 2cbd6fed..c1b83b2a 100644 --- a/.gitlab/ci/templates/build.gitlab-ci.yml +++ b/.gitlab/ci/templates/build.gitlab-ci.yml @@ -1,20 +1,6 @@ --- build: - image: docker:latest - stage: build - variables: - HTTP_PROXY: ${SNAPP_HTTP_PROXY} - HTTPS_PROXY: ${SNAPP_HTTPS_PROXY} - no_proxy: ${SNAPP_NOPROXY} - script: - - export CURRENT_DATETIME=$(TZ=Asia/Tehran date '+%FT%T') - - docker build --build-arg BUILD_DATE=$CURRENT_DATETIME --build-arg VCS_REF=${CI_COMMIT_SHA} --build-arg BUILD_VERSION=${CI_COMMIT_REF_SLUG} -t ${CI_PROJECT_NAME}:${CI_COMMIT_REF_SLUG} . - after_script: - - docker save -o ${CI_PROJECT_NAME}-${CI_COMMIT_REF_SLUG}.tar ${CI_PROJECT_NAME}:${CI_COMMIT_REF_SLUG} + extends: .easy_ci:docker:build dependencies: - compile - artifacts: - name: "docker-image-$CI_PROJECT_NAME-$CI_COMMIT_REF_SLUG" - paths: - - ${CI_PROJECT_NAME}-${CI_COMMIT_REF_SLUG}.tar - expire_in: 1 week + diff --git a/.gitlab/ci/templates/compile.gitlab-ci.yml b/.gitlab/ci/templates/compile.gitlab-ci.yml index 6ca8a814..c548540c 100644 --- a/.gitlab/ci/templates/compile.gitlab-ci.yml +++ b/.gitlab/ci/templates/compile.gitlab-ci.yml @@ -2,16 +2,11 @@ compile: stage: compile image: registry.snapp.tech/docker/golang:1.20-alpine - variables: - GOOS: "linux" - GOARCH: "amd64" - CGO_ENABLED: 0 - before_script: - - go env -w GOPROXY="https://repo.snapp.tech/repository/goproxy/" + extends: .easy_ci:go:cache script: - - go build -v -o ${BUILD_PATH}/${CI_PROJECT_NAME} cmd/soteria/soteria.go + - go build -v -o app cmd/soteria/soteria.go artifacts: - name: "$CI_PROJECT_NAME-$CI_COMMIT_REF_SLUG" + name: "${CI_PROJECT_NAME}-${CI_COMMIT_REF_SLUG}" paths: - - ${BUILD_PATH}/${CI_PROJECT_NAME} + - ./app expire_in: 1 week diff --git a/.gitlab/ci/templates/test.gitlab-ci.yml b/.gitlab/ci/templates/test.gitlab-ci.yml index fcd976e0..cebcf9d7 100644 --- a/.gitlab/ci/templates/test.gitlab-ci.yml +++ b/.gitlab/ci/templates/test.gitlab-ci.yml @@ -6,11 +6,10 @@ handolint: extends: .easy-ci:dockerfile:lint test: - image: registry.snapp.tech/docker/golang:1.20-alpine + image: registry.snapp.tech/docker/golang:1.21-alpine stage: test coverage: '/total:\s*\(statements\)\s*([\d.]+)%/' - before_script: - - go env -w GOPROXY="https://repo.snapp.tech/repository/goproxy/" + extends: .easy_ci:go:cache script: - go test -gcflags=-l -v -coverprofile .coverage.out ./... - go tool cover -func .coverage.out From aef601c973cf0b3f1b99c715d6ce7f2f3ad53b87 Mon Sep 17 00:00:00 2001 From: Parham Alvani Date: Tue, 15 Aug 2023 03:28:46 -0400 Subject: [PATCH 405/660] feat: update ode url to use shared validator --- deployments/soteria/values.ode.snapp.yaml | 37 ++--------------------- 1 file changed, 2 insertions(+), 35 deletions(-) diff --git a/deployments/soteria/values.ode.snapp.yaml b/deployments/soteria/values.ode.snapp.yaml index 26d350d5..4a125ee6 100644 --- a/deployments/soteria/values.ode.snapp.yaml +++ b/deployments/soteria/values.ode.snapp.yaml @@ -14,12 +14,12 @@ image: config: validator: - url: "http://validator:80" + url: "http://validator.snapp-ode-central.svc.cluster.local:80" timeout: 10s vendors: snapp: - use_validator: false + use_validator: true company: "snapp" hashid_map: 0: @@ -82,39 +82,6 @@ vendors: accesses: 0: '1' 1: '1' - keys: - 1: |- - -----BEGIN PUBLIC KEY----- - MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA5SeRfOdTyvQZ7N9ahFHl - +J05r7e9fgOQ2cpOtnnsIjAjCt1dF7/NkqVifEaxABRBGG9iXIw//G4hi0TqoKqK - aoSHMGf6q9pSRLGyB8FatxZf2RBTgrXYqVvpasbnB1ZNv858yTpRjV9NzJXYHLp8 - 8Hbd/yYTR6Q7ajs11/SMLGO7KBELsI1pBz7UW/fngJ2pRmd+RkG+EcGrOIZ27TkI - Xjtog6bgfmtV9FWxSVdKACOY0OmW+g7jIMik2eZTYG3kgCmW2odu3zRoUa7l9VwN - YMuhTePaIWwOifzRQt8HDsAOpzqJuLCoYX7HmBfpGAnwu4BuTZgXVwpvPNb+KlgS - pQIDAQAB - -----END PUBLIC KEY----- - 0: |- - -----BEGIN PUBLIC KEY----- - MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAyG4XpV9TpDfgWJF9TiIv - va4hNhDuqYMJO6iXLzr3y8oCvoB7zUK0EjtbLH+A3gr1kUvyZKDWT4qHTvU2Sshm - X+ttWGK34EhCvF3Lb18yxmVDSSK8JIcTaJjMqmyubxzamQnNoWazJ7ea9BIo2YGL - C9rgPbi1hihhdb07xPGUkJRqbWkI98xjDhKdMqiwW1hIRXm/apo++FjptvqvF84s - ynC5gWGFHiGNICRsLJBczLEAf2Atbafigq6/tovzMabnp2yRtr1ReEgioH1RO4gX - J7F4N5f6y/VWd8+sDOSxtS/HcnP/7g8/A54G2IbXxr+EiwOO/1F+pyMPKq7sGDSU - DwIDAQAB - -----END PUBLIC KEY----- - iss_entity_map: - 0: "driver" - 1: "passenger" - default: "none" - iss_peer_map: - 0: "passenger" - 1: "driver" - default: "none" - jwt: - iss_name: "iss" - sub_name: "sub" - signing_method: "RS512" snapp_pay: company: "snapp_pay" From bad72e708f7a5418122f94b42b170ebba15c4979 Mon Sep 17 00:00:00 2001 From: Parham Alvani Date: Tue, 15 Aug 2023 03:32:47 -0400 Subject: [PATCH 406/660] fix: correct binary name --- .gitlab/ci/templates/compile.gitlab-ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.gitlab/ci/templates/compile.gitlab-ci.yml b/.gitlab/ci/templates/compile.gitlab-ci.yml index c548540c..7d4ece41 100644 --- a/.gitlab/ci/templates/compile.gitlab-ci.yml +++ b/.gitlab/ci/templates/compile.gitlab-ci.yml @@ -4,9 +4,9 @@ compile: image: registry.snapp.tech/docker/golang:1.20-alpine extends: .easy_ci:go:cache script: - - go build -v -o app cmd/soteria/soteria.go + - go build -v -o soteria cmd/soteria/soteria.go artifacts: name: "${CI_PROJECT_NAME}-${CI_COMMIT_REF_SLUG}" paths: - - ./app + - ./soteria expire_in: 1 week From 109cde201fb880b097293d11ad1a75a7f13f6af6 Mon Sep 17 00:00:00 2001 From: Parham Alvani Date: Tue, 15 Aug 2023 06:01:53 -0400 Subject: [PATCH 407/660] feat: add entities maps --- deployments/soteria/values.ode.snapp.yaml | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/deployments/soteria/values.ode.snapp.yaml b/deployments/soteria/values.ode.snapp.yaml index 4a125ee6..1b023d9d 100644 --- a/deployments/soteria/values.ode.snapp.yaml +++ b/deployments/soteria/values.ode.snapp.yaml @@ -82,6 +82,18 @@ vendors: accesses: 0: '1' 1: '1' + iss_entity_map: + 0: "driver" + 1: "passenger" + default: "none" + iss_peer_map: + 0: "passenger" + 1: "driver" + default: "none" + jwt: + iss_name: "iss" + sub_name: "sub" + signing_method: "RS512" snapp_pay: company: "snapp_pay" From 48ed3ba18465d7bc6166e9174686c55bd1b0ea5b Mon Sep 17 00:00:00 2001 From: Parham Alvani Date: Sat, 19 Aug 2023 05:55:18 -0400 Subject: [PATCH 408/660] fix: correct issue with multiple token validation in soteria --- internal/authenticator/auto_authenticator.go | 1 - internal/authenticator/builder.go | 4 +- internal/authenticator/key.go | 36 ++++++------- .../authenticator/manual_authenticator.go | 53 +++++++++---------- 4 files changed, 43 insertions(+), 51 deletions(-) diff --git a/internal/authenticator/auto_authenticator.go b/internal/authenticator/auto_authenticator.go index 3712dbf4..9091dd3a 100644 --- a/internal/authenticator/auto_authenticator.go +++ b/internal/authenticator/auto_authenticator.go @@ -14,7 +14,6 @@ import ( // AutoAuthenticator is responsible for Acl/Auth/Token of users. type AutoAuthenticator struct { - Keys map[string][]any AllowedAccessTypes []acl.AccessType TopicManager *topics.Manager Company string diff --git a/internal/authenticator/builder.go b/internal/authenticator/builder.go index 385595b4..50c294ff 100644 --- a/internal/authenticator/builder.go +++ b/internal/authenticator/builder.go @@ -22,7 +22,6 @@ func (b Builder) Authenticators() map[string]Authenticator { for _, vendor := range b.Vendors { b.ValidateMappers(vendor.IssEntityMap, vendor.IssPeerMap) - keys := b.GenerateKeys(vendor.Jwt.SigningMethod, vendor.Keys) allowedAccessTypes := b.GetAllowedAccessTypes(vendor.AllowedAccessTypes) hid, err := topics.NewHashIDManager(vendor.HashIDMap) @@ -36,7 +35,6 @@ func (b Builder) Authenticators() map[string]Authenticator { if vendor.UseValidator { auth = &AutoAuthenticator{ - Keys: keys, AllowedAccessTypes: allowedAccessTypes, Company: vendor.Company, TopicManager: topics.NewTopicManager( @@ -51,6 +49,8 @@ func (b Builder) Authenticators() map[string]Authenticator { Validator: validatorClient, } } else { + keys := b.GenerateKeys(vendor.Jwt.SigningMethod, vendor.Keys) + auth = &ManualAuthenticator{ Keys: keys, AllowedAccessTypes: allowedAccessTypes, diff --git a/internal/authenticator/key.go b/internal/authenticator/key.go index afaa2b8c..fc73d366 100644 --- a/internal/authenticator/key.go +++ b/internal/authenticator/key.go @@ -8,8 +8,8 @@ import ( "go.uber.org/zap" ) -func (b Builder) GenerateKeys(method string, keys map[string][]string) map[string][]any { - var keyList map[string][]any +func (b Builder) GenerateKeys(method string, keys map[string]string) map[string]any { + var keyList map[string]any // ES RS HS PS EdDSA switch { @@ -18,41 +18,37 @@ func (b Builder) GenerateKeys(method string, keys map[string][]string) map[strin case strings.HasPrefix(method, "HS"): keyList = b.GenerateHMacKeys(keys) default: - keyList = make(map[string][]any) + keyList = make(map[string]any) } return keyList } -func (b Builder) GenerateRsaKeys(raw map[string][]string) map[string][]any { - rsaKeys := make(map[string][]any) +func (b Builder) GenerateRsaKeys(raw map[string]string) map[string]any { + rsaKeys := make(map[string]any) for iss, publicKey := range raw { - for i := range publicKey { - rsaKey, err := jwt.ParseRSAPublicKeyFromPEM([]byte(publicKey[i])) - if err != nil { - b.Logger.Fatal("could not read public key", zap.String("issuer", iss), zap.Error(err)) - } + bytes, err := jwt.ParseRSAPublicKeyFromPEM([]byte(publicKey)) + if err != nil { + b.Logger.Fatal("could not read public key", zap.String("issuer", iss), zap.Error(err)) - rsaKeys[iss] = append(rsaKeys[iss], rsaKey) + rsaKeys[iss] = bytes } } return rsaKeys } -func (b Builder) GenerateHMacKeys(raw map[string][]string) map[string][]any { - keys := make(map[string][]any) +func (b Builder) GenerateHMacKeys(raw map[string]string) map[string]any { + keys := make(map[string]any) for iss, key := range raw { - for i := range key { - bytes, err := base64.StdEncoding.DecodeString(key[i]) - if err != nil { - b.Logger.Fatal("failed to generate hmac key from base64", zap.Error(err)) - } - - keys[iss] = append(keys[iss], bytes) + bytes, err := base64.StdEncoding.DecodeString(key) + if err != nil { + b.Logger.Fatal("failed to generate hmac key from base64", zap.Error(err)) } + + keys[iss] = bytes } return keys diff --git a/internal/authenticator/manual_authenticator.go b/internal/authenticator/manual_authenticator.go index 903cfdc2..7de01b28 100644 --- a/internal/authenticator/manual_authenticator.go +++ b/internal/authenticator/manual_authenticator.go @@ -11,7 +11,7 @@ import ( // ManualAuthenticator is responsible for Acl/Auth/Token of users. type ManualAuthenticator struct { - Keys map[string][]any + Keys map[string]any AllowedAccessTypes []acl.AccessType TopicManager *topics.Manager Company string @@ -21,35 +21,32 @@ type ManualAuthenticator struct { // Auth check user authentication by checking the user's token // isSuperuser is a flag that authenticator set it true when credentials is related to a superuser. func (a ManualAuthenticator) Auth(tokenString string) error { - var err error - for index := 0; index < len(a.Keys["0"]); index++ { //nolint:staticcheck - _, err = jwt.Parse(tokenString, func( - token *jwt.Token, - ) (interface{}, error) { - if token.Method.Alg() != a.JwtConfig.SigningMethod { - return nil, ErrInvalidSigningMethod - } - - claims, ok := token.Claims.(jwt.MapClaims) - if !ok { - return nil, ErrInvalidClaims - } - if claims[a.JwtConfig.IssName] == nil { - return nil, ErrIssNotFound - } - - issuer := fmt.Sprintf("%v", claims[a.JwtConfig.IssName]) - - key := a.Keys[issuer][index] - - return key, nil - }) - if err == nil { - return nil + _, err := jwt.Parse(tokenString, func( + token *jwt.Token, + ) (interface{}, error) { + if token.Method.Alg() != a.JwtConfig.SigningMethod { + return nil, ErrInvalidSigningMethod } + + claims, ok := token.Claims.(jwt.MapClaims) + if !ok { + return nil, ErrInvalidClaims + } + if claims[a.JwtConfig.IssName] == nil { + return nil, ErrIssNotFound + } + + issuer := fmt.Sprintf("%v", claims[a.JwtConfig.IssName]) + + key := a.Keys[issuer] + + return key, nil + }) + if err == nil { + return nil } - return fmt.Errorf("token is invalid: %w", err) //nolint:staticcheck + return fmt.Errorf("token is invalid: %w", err) } // ACL check a user access to a topic. @@ -88,7 +85,7 @@ func (a ManualAuthenticator) ACL( //nolint:dupl return key, nil }) if err != nil { - return false, fmt.Errorf("token is invalid %w", err) + return false, fmt.Errorf("token is invalid: %w", err) } claims, ok := token.Claims.(jwt.MapClaims) From 89eeb690a34680a6e0d5086da712b9c0c71e0f94 Mon Sep 17 00:00:00 2001 From: Parham Alvani Date: Sat, 19 Aug 2023 06:23:49 -0400 Subject: [PATCH 409/660] fix: correct issue with multiple token validation in soteria --- internal/config/config.go | 14 +++++++------- internal/config/default.go | 10 +++++----- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/internal/config/config.go b/internal/config/config.go index fe88ca09..9a4c4eb4 100644 --- a/internal/config/config.go +++ b/internal/config/config.go @@ -34,13 +34,13 @@ type ( } Vendor struct { - AllowedAccessTypes []string `koanf:"allowed_access_types"` - Company string `koanf:"company"` - Topics []topics.Topic `koanf:"topics"` - Keys map[string][]string `koanf:"keys"` - IssEntityMap map[string]string `koanf:"iss_entity_map"` - IssPeerMap map[string]string `koanf:"iss_peer_map"` - Jwt Jwt `koanf:"jwt"` + AllowedAccessTypes []string `koanf:"allowed_access_types"` + Company string `koanf:"company"` + Topics []topics.Topic `koanf:"topics"` + Keys map[string]string `koanf:"keys"` + IssEntityMap map[string]string `koanf:"iss_entity_map"` + IssPeerMap map[string]string `koanf:"iss_peer_map"` + Jwt Jwt `koanf:"jwt"` // by setting do validate to false we don't validate the jwt token and deligate // it into a function. UseValidator bool `koanf:"use_validator"` diff --git a/internal/config/default.go b/internal/config/default.go index fb770fab..22191f7c 100644 --- a/internal/config/default.go +++ b/internal/config/default.go @@ -145,8 +145,8 @@ func SnappVendor() Vendor { }, }, }, - Keys: map[string][]string{ - "0": {`-----BEGIN PUBLIC KEY----- + Keys: map[string]string{ + "0": `-----BEGIN PUBLIC KEY----- MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAyG4XpV9TpDfgWJF9TiIv va4hNhDuqYMJO6iXLzr3y8oCvoB7zUK0EjtbLH+A3gr1kUvyZKDWT4qHTvU2Sshm X+ttWGK34EhCvF3Lb18yxmVDSSK8JIcTaJjMqmyubxzamQnNoWazJ7ea9BIo2YGL @@ -154,9 +154,9 @@ func SnappVendor() Vendor { ynC5gWGFHiGNICRsLJBczLEAf2Atbafigq6/tovzMabnp2yRtr1ReEgioH1RO4gX J7F4N5f6y/VWd8+sDOSxtS/HcnP/7g8/A54G2IbXxr+EiwOO/1F+pyMPKq7sGDSU DwIDAQAB ------END PUBLIC KEY-----`}, +-----END PUBLIC KEY-----`, - "1": {`-----BEGIN PUBLIC KEY----- + "1": `-----BEGIN PUBLIC KEY----- MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA5SeRfOdTyvQZ7N9ahFHl +J05r7e9fgOQ2cpOtnnsIjAjCt1dF7/NkqVifEaxABRBGG9iXIw//G4hi0TqoKqK aoSHMGf6q9pSRLGyB8FatxZf2RBTgrXYqVvpasbnB1ZNv858yTpRjV9NzJXYHLp8 @@ -164,7 +164,7 @@ func SnappVendor() Vendor { Xjtog6bgfmtV9FWxSVdKACOY0OmW+g7jIMik2eZTYG3kgCmW2odu3zRoUa7l9VwN YMuhTePaIWwOifzRQt8HDsAOpzqJuLCoYX7HmBfpGAnwu4BuTZgXVwpvPNb+KlgS pQIDAQAB ------END PUBLIC KEY-----`}, +-----END PUBLIC KEY-----`, }, IssEntityMap: map[string]string{ "0": "driver", From 549c8b023ee58647f5855ccbc289743c69e7b94d Mon Sep 17 00:00:00 2001 From: Parham Alvani Date: Sat, 19 Aug 2023 06:25:50 -0400 Subject: [PATCH 410/660] fix: correct tests with new changes --- internal/authenticator/auto_authenticator_test.go | 4 ---- internal/authenticator/manual_authenticator_test.go | 6 +++--- 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/internal/authenticator/auto_authenticator_test.go b/internal/authenticator/auto_authenticator_test.go index dbf9e496..23957231 100644 --- a/internal/authenticator/auto_authenticator_test.go +++ b/internal/authenticator/auto_authenticator_test.go @@ -62,10 +62,6 @@ func (suite *AutoAuthenticatorTestSuite) SetupSuite() { // nolint: exhaustruct suite.Authenticator = authenticator.AutoAuthenticator{ - Keys: map[string][]any{ - topics.DriverIss: {pkey0}, - topics.PassengerIss: {pkey1}, - }, AllowedAccessTypes: []acl.AccessType{acl.Pub, acl.Sub, acl.PubSub}, Company: "snapp", TopicManager: topics.NewTopicManager(cfg.Topics, hid, "snapp", cfg.IssEntityMap, cfg.IssPeerMap, zap.NewNop()), diff --git a/internal/authenticator/manual_authenticator_test.go b/internal/authenticator/manual_authenticator_test.go index 3929b7dc..69025883 100644 --- a/internal/authenticator/manual_authenticator_test.go +++ b/internal/authenticator/manual_authenticator_test.go @@ -61,9 +61,9 @@ func (suite *ManualAuthenticatorTestSuite) SetupSuite() { // nolint: exhaustruct suite.Authenticator = authenticator.ManualAuthenticator{ - Keys: map[string][]any{ - topics.DriverIss: {pkey0}, - topics.PassengerIss: {pkey1}, + Keys: map[string]any{ + topics.DriverIss: pkey0, + topics.PassengerIss: pkey1, }, AllowedAccessTypes: []acl.AccessType{acl.Pub, acl.Sub, acl.PubSub}, Company: "snapp", From 9833276a486b9de9d5dd3f7de9840ef3e9e49681 Mon Sep 17 00:00:00 2001 From: Parham Alvani Date: Sat, 19 Aug 2023 06:33:28 -0400 Subject: [PATCH 411/660] fix: correct loading keys --- internal/authenticator/key.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/internal/authenticator/key.go b/internal/authenticator/key.go index fc73d366..1b2de40f 100644 --- a/internal/authenticator/key.go +++ b/internal/authenticator/key.go @@ -31,9 +31,9 @@ func (b Builder) GenerateRsaKeys(raw map[string]string) map[string]any { bytes, err := jwt.ParseRSAPublicKeyFromPEM([]byte(publicKey)) if err != nil { b.Logger.Fatal("could not read public key", zap.String("issuer", iss), zap.Error(err)) - - rsaKeys[iss] = bytes } + + rsaKeys[iss] = bytes } return rsaKeys From 1339b47d04194aeca146d50b44dc333bdc2f3aea Mon Sep 17 00:00:00 2001 From: Parham Alvani Date: Sat, 19 Aug 2023 06:45:38 -0400 Subject: [PATCH 412/660] feat: update chart version --- deployments/soteria/Chart.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/deployments/soteria/Chart.yaml b/deployments/soteria/Chart.yaml index f3c06ab8..cc2cfcc0 100644 --- a/deployments/soteria/Chart.yaml +++ b/deployments/soteria/Chart.yaml @@ -5,6 +5,6 @@ description: Soteria Helm Chart type: application -version: 7.1.0 +version: 7.1.1 -appVersion: "v7-1-0" +appVersion: "v7-1-1" From c5d0d2c1a3a8342465831823f21efbefcb0c402d Mon Sep 17 00:00:00 2001 From: Parham Alvani Date: Sat, 19 Aug 2023 15:25:05 -0400 Subject: [PATCH 413/660] chore: remove change log --- CHANGELOG.md | 46 ---------------------------------------------- 1 file changed, 46 deletions(-) delete mode 100644 CHANGELOG.md diff --git a/CHANGELOG.md b/CHANGELOG.md deleted file mode 100644 index 5a843f7c..00000000 --- a/CHANGELOG.md +++ /dev/null @@ -1,46 +0,0 @@ -# Change log - -# Unreleased - (yyyy-mm-dd) - ---- - -## July 17, 2021 - -### Added - -- Add superuser token support - -### Changed - -- Refactor internal packages - -### Fixed - -## May 31, 2021 - -### Added - -- Add chat topic in acl logics - -### Changed - -### Fixed - -## May 29, 2021 - -### Added - -- Add location sharing topics acl logic. -- Ignore tokens which contain `is_superuser` flag in their claims. -- Tracing with jeager. jeager configuration is added - -| **Variable Name** | **Type** | **Description** | -| ------------------------------ | -------- | --------------------------------------------- | -| `SOTERIA_TRACER_SAMPLER_TYPE` | string | client sampler type e.g. const, probabilistic | -| `SOTERIA_TRACER_SAMPLER_PARAM` | float | client sampler paramer e.g. 1, 0 | - -For more on sampler please refer to [this](https://www.jaegertracing.io/docs/1.22/sampling/). - -### Changed - -### Fixed From 31a5bb9a5307a030481ce3f5de571943c8ac0e96 Mon Sep 17 00:00:00 2001 From: Parham Alvani Date: Sat, 19 Aug 2023 15:44:42 -0400 Subject: [PATCH 414/660] fix: improve logging --- internal/api/auth.go | 20 ++++++++----- .../authenticator/manual_authenticator.go | 29 ++++++++++--------- 2 files changed, 27 insertions(+), 22 deletions(-) diff --git a/internal/api/auth.go b/internal/api/auth.go index 61a0d418..2f4cef84 100644 --- a/internal/api/auth.go +++ b/internal/api/auth.go @@ -1,9 +1,11 @@ package api import ( + "errors" "net/http" "github.com/gofiber/fiber/v2" + "github.com/golang-jwt/jwt/v5" "go.opentelemetry.io/otel/attribute" "go.uber.org/zap" ) @@ -48,14 +50,16 @@ func (a API) Auth(c *fiber.Ctx) error { if err := authenticator.Auth(token); err != nil { span.RecordError(err) - a.Logger. - Error("auth request is not authorized", - zap.Error(err), - zap.String("token", request.Token), - zap.String("username", request.Username), - zap.String("password", request.Password), - zap.String("authenticator", authenticator.GetCompany()), - ) + if !errors.Is(err, jwt.ErrTokenExpired) { + a.Logger. + Error("auth request is not authorized", + zap.Error(err), + zap.String("token", request.Token), + zap.String("username", request.Username), + zap.String("password", request.Password), + zap.String("authenticator", authenticator.GetCompany()), + ) + } return c.Status(http.StatusUnauthorized).SendString("request is not authorized") } diff --git a/internal/authenticator/manual_authenticator.go b/internal/authenticator/manual_authenticator.go index 7de01b28..38ff3c96 100644 --- a/internal/authenticator/manual_authenticator.go +++ b/internal/authenticator/manual_authenticator.go @@ -1,6 +1,7 @@ package authenticator import ( + "errors" "fmt" "github.com/golang-jwt/jwt/v5" @@ -21,13 +22,13 @@ type ManualAuthenticator struct { // Auth check user authentication by checking the user's token // isSuperuser is a flag that authenticator set it true when credentials is related to a superuser. func (a ManualAuthenticator) Auth(tokenString string) error { - _, err := jwt.Parse(tokenString, func( + parser := jwt.NewParser( + jwt.WithValidMethods([]string{a.JwtConfig.SigningMethod}), + ) + + _, err := parser.Parse(tokenString, func( token *jwt.Token, ) (interface{}, error) { - if token.Method.Alg() != a.JwtConfig.SigningMethod { - return nil, ErrInvalidSigningMethod - } - claims, ok := token.Claims.(jwt.MapClaims) if !ok { return nil, ErrInvalidClaims @@ -42,16 +43,16 @@ func (a ManualAuthenticator) Auth(tokenString string) error { return key, nil }) - if err == nil { - return nil + if err != nil { + return fmt.Errorf("token is invalid: %w", err) } - return fmt.Errorf("token is invalid: %w", err) + return nil } // ACL check a user access to a topic. -// nolint: funlen, cyclop -func (a ManualAuthenticator) ACL( //nolint:dupl +// nolint: funlen, cyclop, dupl +func (a ManualAuthenticator) ACL( accessType acl.AccessType, tokenString string, topic string, @@ -60,11 +61,11 @@ func (a ManualAuthenticator) ACL( //nolint:dupl return false, ErrInvalidAccessType } - token, err := jwt.Parse(tokenString, func(token *jwt.Token) (interface{}, error) { - if token.Method.Alg() != a.JwtConfig.SigningMethod { - return nil, ErrInvalidSigningMethod - } + parser := jwt.NewParser( + jwt.WithValidMethods([]string{a.JwtConfig.SigningMethod}), + ) + token, err := parser.Parse(tokenString, func(token *jwt.Token) (interface{}, error) { claims, ok := token.Claims.(jwt.MapClaims) if !ok { return nil, ErrInvalidClaims From 13b37ec4acdaf26b99dfcc240786277f2483e976 Mon Sep 17 00:00:00 2001 From: Parham Alvani Date: Sat, 19 Aug 2023 15:45:10 -0400 Subject: [PATCH 415/660] feat: update chart version --- deployments/soteria/Chart.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/deployments/soteria/Chart.yaml b/deployments/soteria/Chart.yaml index cc2cfcc0..9f03d6c3 100644 --- a/deployments/soteria/Chart.yaml +++ b/deployments/soteria/Chart.yaml @@ -5,6 +5,6 @@ description: Soteria Helm Chart type: application -version: 7.1.1 +version: 7.1.2 -appVersion: "v7-1-1" +appVersion: "v7-1-2" From a3ca99d86ac03b3758a9c997dda840e5d01fe40a Mon Sep 17 00:00:00 2001 From: Parham Alvani Date: Sat, 19 Aug 2023 15:46:56 -0400 Subject: [PATCH 416/660] fix: correct unused import --- internal/authenticator/manual_authenticator.go | 1 - 1 file changed, 1 deletion(-) diff --git a/internal/authenticator/manual_authenticator.go b/internal/authenticator/manual_authenticator.go index 38ff3c96..43457685 100644 --- a/internal/authenticator/manual_authenticator.go +++ b/internal/authenticator/manual_authenticator.go @@ -1,7 +1,6 @@ package authenticator import ( - "errors" "fmt" "github.com/golang-jwt/jwt/v5" From 96828e99ad642654a90b9f0912850d014d039f25 Mon Sep 17 00:00:00 2001 From: Parham Alvani Date: Sat, 19 Aug 2023 17:05:01 -0400 Subject: [PATCH 417/660] fix: change build image --- .gitlab/ci/templates/compile.gitlab-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitlab/ci/templates/compile.gitlab-ci.yml b/.gitlab/ci/templates/compile.gitlab-ci.yml index 7d4ece41..52c51388 100644 --- a/.gitlab/ci/templates/compile.gitlab-ci.yml +++ b/.gitlab/ci/templates/compile.gitlab-ci.yml @@ -1,7 +1,7 @@ --- compile: stage: compile - image: registry.snapp.tech/docker/golang:1.20-alpine + image: registry.snapp.tech/docker/golang:1.21-alpine extends: .easy_ci:go:cache script: - go build -v -o soteria cmd/soteria/soteria.go From 0389b306d71b1a7f1e90112212f1ccf51d2be352 Mon Sep 17 00:00:00 2001 From: Parham Alvani Date: Sat, 19 Aug 2023 17:05:11 -0400 Subject: [PATCH 418/660] fix: correct default values --- internal/config/default.go | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/internal/config/default.go b/internal/config/default.go index 22191f7c..44087265 100644 --- a/internal/config/default.go +++ b/internal/config/default.go @@ -167,12 +167,14 @@ func SnappVendor() Vendor { -----END PUBLIC KEY-----`, }, IssEntityMap: map[string]string{ - "0": "driver", - "1": "passenger", + "0": "driver", + "1": "passenger", + "default": "", }, IssPeerMap: map[string]string{ - "0": "passenger", - "1": "driver", + "0": "passenger", + "1": "driver", + "default": "", }, Jwt: Jwt{ IssName: "iss", From 8c6261f53f7aca526fcee9cc766403bf90ed8011 Mon Sep 17 00:00:00 2001 From: Parham Alvani Date: Sat, 19 Aug 2023 17:06:25 -0400 Subject: [PATCH 419/660] feat: update chart version --- deployments/soteria/Chart.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/deployments/soteria/Chart.yaml b/deployments/soteria/Chart.yaml index 9f03d6c3..d44dd025 100644 --- a/deployments/soteria/Chart.yaml +++ b/deployments/soteria/Chart.yaml @@ -5,6 +5,6 @@ description: Soteria Helm Chart type: application -version: 7.1.2 +version: 7.1.3 -appVersion: "v7-1-2" +appVersion: "v7-1-3" From 185a06283c291515f64feaf1a0184f8f115e7b7b Mon Sep 17 00:00:00 2001 From: Parham Alvani Date: Sat, 19 Aug 2023 17:30:45 -0400 Subject: [PATCH 420/660] feat: update go packages --- go.mod | 7 +- go.sum | 377 ++------------------------------------------------------- 2 files changed, 13 insertions(+), 371 deletions(-) diff --git a/go.mod b/go.mod index b9b91f30..6e15a049 100644 --- a/go.mod +++ b/go.mod @@ -8,7 +8,6 @@ require ( github.com/gofiber/fiber/v2 v2.48.0 github.com/golang-jwt/jwt/v5 v5.0.0 github.com/knadh/koanf v1.5.0 - github.com/prometheus/client_golang v1.16.0 // indirect github.com/speps/go-hashids/v2 v2.0.1 github.com/spf13/cobra v1.7.0 github.com/stretchr/testify v1.8.4 @@ -18,7 +17,6 @@ require ( go.opentelemetry.io/otel/exporters/jaeger v1.16.0 go.opentelemetry.io/otel/sdk v1.16.0 go.opentelemetry.io/otel/trace v1.16.0 - go.uber.org/atomic v1.11.0 // indirect go.uber.org/automaxprocs v1.5.3 go.uber.org/zap v1.25.0 ) @@ -44,16 +42,13 @@ require ( github.com/mitchellh/copystructure v1.2.0 // indirect github.com/mitchellh/mapstructure v1.5.0 // indirect github.com/mitchellh/reflectwalk v1.0.2 // indirect - github.com/philhofer/fwd v1.1.2 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect + github.com/prometheus/client_golang v1.16.0 // indirect github.com/prometheus/client_model v0.4.0 // indirect github.com/prometheus/common v0.44.0 // indirect github.com/prometheus/procfs v0.11.1 // indirect github.com/rivo/uniseg v0.4.4 // indirect - github.com/savsgio/dictpool v0.0.0-20221023140959-7bf2e61cea94 // indirect - github.com/savsgio/gotils v0.0.0-20230208104028-c358bd845dee // indirect github.com/spf13/pflag v1.0.5 // indirect - github.com/tinylib/msgp v1.1.8 // indirect github.com/valyala/bytebufferpool v1.0.0 // indirect github.com/valyala/fasthttp v1.48.0 // indirect github.com/valyala/tcplisten v1.0.0 // indirect diff --git a/go.sum b/go.sum index ae30484e..45e6ba50 100644 --- a/go.sum +++ b/go.sum @@ -1,49 +1,15 @@ cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= -cloud.google.com/go v0.38.0/go.mod h1:990N+gfupTy94rShfmMCWGDn0LpTmnzTp2qbd1dvSRU= -cloud.google.com/go v0.44.1/go.mod h1:iSa0KzasP4Uvy3f1mN/7PiObzGgflwredwwASm/v6AU= -cloud.google.com/go v0.44.2/go.mod h1:60680Gw3Yr4ikxnPRS/oxxkBccT6SA1yMk63TGekxKY= -cloud.google.com/go v0.45.1/go.mod h1:RpBamKRgapWJb87xiFSdk4g1CME7QZg3uwTez+TSTjc= -cloud.google.com/go v0.46.3/go.mod h1:a6bKKbmY7er1mI7TEI4lsAkts/mkhTSZK8w33B4RAg0= -cloud.google.com/go v0.50.0/go.mod h1:r9sluTvynVuxRIOHXQEHMFffphuXHOMZMycpNR5e6To= -cloud.google.com/go v0.52.0/go.mod h1:pXajvRH/6o3+F9jDHZWQ5PbGhn+o8w9qiu/CffaVdO4= -cloud.google.com/go v0.53.0/go.mod h1:fp/UouUEsRkN6ryDKNW/Upv/JBKnv6WDthjR6+vze6M= -cloud.google.com/go v0.54.0/go.mod h1:1rq2OEkV3YMf6n/9ZvGWI3GWw0VoqH/1x2nd8Is/bPc= -cloud.google.com/go v0.56.0/go.mod h1:jr7tqZxxKOVYizybht9+26Z/gUq7tiRzu+ACVAMbKVk= -cloud.google.com/go v0.57.0/go.mod h1:oXiQ6Rzq3RAkkY7N6t3TcE6jE+CIBBbA36lwQ1JyzZs= -cloud.google.com/go v0.62.0/go.mod h1:jmCYTdRCQuc1PHIIJ/maLInMho30T/Y0M4hTdTShOYc= -cloud.google.com/go v0.65.0/go.mod h1:O5N8zS7uWy9vkA9vayVHs65eM1ubvY4h553ofrNHObY= -cloud.google.com/go/bigquery v1.0.1/go.mod h1:i/xbL2UlR5RvWAURpBYZTtm/cXjCha9lbfbpx4poX+o= -cloud.google.com/go/bigquery v1.3.0/go.mod h1:PjpwJnslEMmckchkHFfq+HTD2DmtT67aNFKH1/VBDHE= -cloud.google.com/go/bigquery v1.4.0/go.mod h1:S8dzgnTigyfTmLBfrtrhyYhwRxG72rYxvftPBK2Dvzc= -cloud.google.com/go/bigquery v1.5.0/go.mod h1:snEHRnqQbz117VIFhE8bmtwIDY80NLUZUMb4Nv6dBIg= -cloud.google.com/go/bigquery v1.7.0/go.mod h1://okPTzCYNXSlb24MZs83e2Do+h+VXtc4gLoIoXIAPc= -cloud.google.com/go/bigquery v1.8.0/go.mod h1:J5hqkt3O0uAFnINi6JXValWIb1v0goeZM77hZzJN/fQ= -cloud.google.com/go/datastore v1.0.0/go.mod h1:LXYbyblFSglQ5pkeyhO+Qmw7ukd3C+pD7TKLgZqpHYE= -cloud.google.com/go/datastore v1.1.0/go.mod h1:umbIZjpQpHh4hmRpGhH4tLFup+FVzqBi1b3c64qFpCk= -cloud.google.com/go/pubsub v1.0.1/go.mod h1:R0Gpsv3s54REJCy4fxDixWD93lHJMoZTyQ2kNxGRt3I= -cloud.google.com/go/pubsub v1.1.0/go.mod h1:EwwdRX2sKPjnvnqCa270oGRyludottCI76h+R3AArQw= -cloud.google.com/go/pubsub v1.2.0/go.mod h1:jhfEVHT8odbXTkndysNHCcx0awwzvfOlguIAii9o8iA= -cloud.google.com/go/pubsub v1.3.1/go.mod h1:i+ucay31+CNRpDW4Lu78I4xXG+O1r/MAHgjpRVR+TSU= -cloud.google.com/go/storage v1.0.0/go.mod h1:IhtSnM/ZTZV8YYJWCY8RULGVqBDmpoyjwiyrjsg+URw= -cloud.google.com/go/storage v1.5.0/go.mod h1:tpKbwo567HUNpVclU5sGELwQWBDZ8gh0ZeosJ0Rtdos= -cloud.google.com/go/storage v1.6.0/go.mod h1:N7U0C8pVQ/+NIKOBQyamJIeKQKkZ+mxpohlUTyfDhBk= -cloud.google.com/go/storage v1.8.0/go.mod h1:Wv1Oy7z6Yz3DshWRJFhqM/UCfaWIRTdp0RXyy7KQOVs= -cloud.google.com/go/storage v1.10.0/go.mod h1:FLPqc6j+Ki4BU591ie1oL6qBQGu2Bl/tZ9ullr3+Kg0= -dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= -github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= github.com/agiledragon/gomonkey/v2 v2.10.1 h1:FPJJNykD1957cZlGhr9X0zjr291/lbazoZ/dmc4mS4c= +github.com/agiledragon/gomonkey/v2 v2.10.1/go.mod h1:ap1AmDzcVOAz1YpeJ3TCzIgstoaWLA6jbbgxfB4w2iY= github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= github.com/alecthomas/units v0.0.0-20190717042225-c3de453c63f4/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= github.com/alecthomas/units v0.0.0-20190924025748-f65c72e2690d/go.mod h1:rBZYJk541a8SKzHPHnH3zbiI+7dagKZ0cgpgrD7Fyho= -github.com/andybalholm/brotli v1.0.4/go.mod h1:fO7iG3H7G2nSZ7m0zPUDn85XEX2GTukHGRSepvi9Eig= github.com/andybalholm/brotli v1.0.5 h1:8uQZIdzKmjc/iuPu7O2ioW48L81FgatrcpfFmiq/cCs= github.com/andybalholm/brotli v1.0.5/go.mod h1:fO7iG3H7G2nSZ7m0zPUDn85XEX2GTukHGRSepvi9Eig= -github.com/ansrivas/fiberprometheus/v2 v2.6.0 h1:QUaaKxil/N5IM1R19k6jsmFEJMfa4O3qtnDkiF+zxUc= -github.com/ansrivas/fiberprometheus/v2 v2.6.0/go.mod h1:hivZjKkqX04PPbMZNi9iGB0AQ90iN6RmKERiX1TdgTA= github.com/ansrivas/fiberprometheus/v2 v2.6.1 h1:wac3pXaE6BYYTF04AC6K0ktk6vCD+MnDOJZ3SK66kXM= github.com/ansrivas/fiberprometheus/v2 v2.6.1/go.mod h1:MloIKvy4yN6hVqlRpJ/jDiR244YnWJaQC0FIqS8A+MY= github.com/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kdvxnR2qWY= @@ -62,6 +28,7 @@ github.com/aws/aws-sdk-go-v2/service/sso v1.4.2/go.mod h1:NBvT9R1MEF+Ud6ApJKM0G+ github.com/aws/aws-sdk-go-v2/service/sts v1.7.2/go.mod h1:8EzeIqfWt2wWT4rJVu3f21TfrhJ8AEMzVybRNSb/b4g= github.com/aws/smithy-go v1.8.0/go.mod h1:SObp3lf9smib00L/v3U2eAKG8FyQ7iLrJnQiAmR5n+E= github.com/benbjohnson/clock v1.3.0 h1:ip6w0uFQkncKQ979AypyG0ER7mqUSBdKLOgAle/AT8A= +github.com/benbjohnson/clock v1.3.0/go.mod h1:J11/hYXuz8f4ySSvYwY0FKfm+ezbsZBKZxNJlLklBHA= github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q= github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8= github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= @@ -69,12 +36,8 @@ github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6r github.com/bgentry/speakeasy v0.1.0/go.mod h1:+zsyZBPWlz7T6j88CTgSN5bM796AkVf0kBD4zp0CCIs= github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= -github.com/cespare/xxhash/v2 v2.1.2/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= github.com/cespare/xxhash/v2 v2.2.0 h1:DC2CZ1Ep5Y4k3ZQ899DldepgrayRUGE6BBZ/cd9Cj44= github.com/cespare/xxhash/v2 v2.2.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= -github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI= -github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI= -github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU= github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc= github.com/cncf/udpa/go v0.0.0-20201120205902-5459f2c99403/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= @@ -98,21 +61,14 @@ github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4 github.com/fsnotify/fsnotify v1.6.0 h1:n+5WquG0fcWoWp6xPWfHdbskMCQaFnG6PfBrh1Ky4HY= github.com/fsnotify/fsnotify v1.6.0/go.mod h1:sl3t1tCWJFWoRz9R8WJCbQihKKwmorjAbSClcnxKAGw= github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= -github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU= -github.com/go-gl/glfw/v3.3/glfw v0.0.0-20191125211704-12ad95a8df72/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= -github.com/go-gl/glfw/v3.3/glfw v0.0.0-20200222043503-6f7a984d4dc4/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= github.com/go-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= github.com/go-kit/kit v0.9.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= github.com/go-kit/log v0.1.0/go.mod h1:zbhenjAZHb184qTLMA9ZjW7ThYL0H2mk7Q6pNt4vbaY= -github.com/go-kit/log v0.2.0/go.mod h1:NwTd00d/i8cPZ3xOwwiv2PO5MOcx78fFErGNcVmBjv0= github.com/go-ldap/ldap v3.0.2+incompatible/go.mod h1:qfd9rJvER9Q0/D/Sqn1DfHRoBp40uXYvFoEVrNEPqRc= github.com/go-logfmt/logfmt v0.3.0/go.mod h1:Qt1PoO58o5twSAckw1HlFXLmHsOX5/0LbT9GBnD5lWE= github.com/go-logfmt/logfmt v0.4.0/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V4qmtdjCk= github.com/go-logfmt/logfmt v0.5.0/go.mod h1:wCYkCAKZfumFQihp8CzCvQ3paCTfi41vtzG1KdI/P7A= -github.com/go-logfmt/logfmt v0.5.1/go.mod h1:WYhtIu8zTZfxdn5+rREduYbwxfcBr/Vr6KEVveWlfTs= github.com/go-logr/logr v1.2.2/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= -github.com/go-logr/logr v1.2.3 h1:2DntVwHkVopvECVRSlL5PSo9eG+cAkDCuckLubN+rq0= -github.com/go-logr/logr v1.2.3/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= github.com/go-logr/logr v1.2.4 h1:g01GSCwiDw2xSZfjJ2/T9M+S6pFdcNtFYsp+Y43HYDQ= github.com/go-logr/logr v1.2.4/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag= @@ -120,42 +76,22 @@ github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= github.com/go-test/deep v1.0.2-0.20181118220953-042da051cf31/go.mod h1:wGDj63lr65AM2AQyKZd/NYHGb0R+1RLqB8NKt3aSFNA= github.com/godbus/dbus/v5 v5.0.4/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA= -github.com/gofiber/adaptor/v2 v2.1.31/go.mod h1:vdSG9JhOhOLYjE4j14fx6sJvLJNFVf9o6rSyB5GkU4s= -github.com/gofiber/adaptor/v2 v2.1.32 h1:94cL79U4ekq78TmqfXPrulMWkpfPxqzHimUc/B+jmkY= -github.com/gofiber/adaptor/v2 v2.1.32/go.mod h1:aX4qfSo+1AJYIWnLL1Mx3EQ6znC6WW46MqFQruUQE6c= github.com/gofiber/adaptor/v2 v2.2.1 h1:givE7iViQWlsTR4Jh7tB4iXzrlKBgiraB/yTdHs9Lv4= github.com/gofiber/adaptor/v2 v2.2.1/go.mod h1:AhR16dEqs25W2FY/l8gSj1b51Azg5dtPDmm+pruNOrc= github.com/gofiber/contrib/fiberzap v1.0.2 h1:EQwhggtszVfIdBeXxN9Xrmld71es34Ufs+ef8VMqZxc= github.com/gofiber/contrib/fiberzap v1.0.2/go.mod h1:jGO8BHU4gRI9U0JtM6zj2CIhYfgVmW5JxziN8NTgVwE= -github.com/gofiber/fiber/v2 v2.41.0/go.mod h1:RdebcCuCRFp4W6hr3968/XxwJVg0K+jr9/Ae0PFzZ0Q= -github.com/gofiber/fiber/v2 v2.42.0/go.mod h1:3+SGNjqMh5VQH5Vz2Wdi43zTIV16ktlFd3x3R6O1Zlc= -github.com/gofiber/fiber/v2 v2.43.0 h1:yit3E4kHf178B60p5CQBa/3v+WVuziWMa/G2ZNyLJB0= -github.com/gofiber/fiber/v2 v2.43.0/go.mod h1:mpS1ZNE5jU+u+BA4FbM+KKnUzJ4wzTK+FT2tG3tU+6I= github.com/gofiber/fiber/v2 v2.48.0 h1:cRVMCb9aUJDsyHxGFLwz/sGzDggdailZZyptU9F9cU0= github.com/gofiber/fiber/v2 v2.48.0/go.mod h1:xqJgfqrc23FJuqGOW6DVgi3HyZEm2Mn9pRqUb2kHSX8= github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q= -github.com/golang-jwt/jwt/v5 v5.0.0-rc.1 h1:tDQ1LjKga657layZ4JLsRdxgvupebc0xuPwRNuTfUgs= -github.com/golang-jwt/jwt/v5 v5.0.0-rc.1/go.mod h1:pqrtFR0X4osieyHYxtmOUWsAWrfe1Q5UVIyoH402zdk= github.com/golang-jwt/jwt/v5 v5.0.0 h1:1n1XNM9hk7O9mnQoNBGolZvzebBQ7p93ULHRc28XJUE= github.com/golang-jwt/jwt/v5 v5.0.0/go.mod h1:pqrtFR0X4osieyHYxtmOUWsAWrfe1Q5UVIyoH402zdk= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= -github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= -github.com/golang/groupcache v0.0.0-20191227052852-215e87163ea7/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= -github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= -github.com/golang/mock v1.2.0/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= -github.com/golang/mock v1.3.1/go.mod h1:sBzyDLLjw3U8JLTeZvSv8jJB+tU5PVekmnlKIyFUx0Y= -github.com/golang/mock v1.4.0/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= -github.com/golang/mock v1.4.1/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= -github.com/golang/mock v1.4.3/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= -github.com/golang/mock v1.4.4/go.mod h1:l3mdAwkq5BuhzHwde/uurv3sEJeZMXNpwsxVWU71h+4= github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.3.3/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw= -github.com/golang/protobuf v1.3.4/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw= -github.com/golang/protobuf v1.3.5/go.mod h1:6O5/vntMXwX2lRkT1hjjk0nAC1IDOTvTlVgjlRvqsdk= github.com/golang/protobuf v1.4.0-rc.1/go.mod h1:ceaxUfeHdC40wWswd/P6IGgMaK3YpKi5j83Wpe3EHw8= github.com/golang/protobuf v1.4.0-rc.1.0.20200221234624-67d41d38c208/go.mod h1:xKAWHe0F5eneWXFV3EuXVDTCmh+JuBKY0li0aMyXATA= github.com/golang/protobuf v1.4.0-rc.2/go.mod h1:LlEzMj4AhA7rCAGe4KMBDvJI+AwstrUpVNzEA03Pprs= @@ -170,36 +106,21 @@ github.com/golang/protobuf v1.5.3 h1:KhyjKVUg7Usr/dYsdSqoFveMYd5ko72D+zANwlG1mmg github.com/golang/protobuf v1.5.3/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= github.com/golang/snappy v0.0.1/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= -github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= 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.4.1/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.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.4/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.6/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.7/go.mod h1:n+brtR0CgQNWTVd5ZUFpTBC8YFBDLK/h/bpaJ8/DtOE= -github.com/google/go-cmp v0.5.8/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38= +github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= -github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs= -github.com/google/martian/v3 v3.0.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0= -github.com/google/pprof v0.0.0-20181206194817-3ea8567a2e57/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= -github.com/google/pprof v0.0.0-20190515194954-54271f7e092f/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= -github.com/google/pprof v0.0.0-20191218002539-d4f498aebedc/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= -github.com/google/pprof v0.0.0-20200212024743-f11f1df84d12/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= -github.com/google/pprof v0.0.0-20200229191704-1ebb73c60ed3/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= -github.com/google/pprof v0.0.0-20200430221834-fc25d7d30c6d/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= -github.com/google/pprof v0.0.0-20200708004538-1a94d8640e99/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= -github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.3.0 h1:t6JiXgmwXMjEs8VusXIJk2BXHsn+wx8BZdTaoZ5fu7I= github.com/google/uuid v1.3.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg= -github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk= github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0/go.mod h1:8NvIoxWQoOIhqOTXgfV/d3M/q6VIi02HzZEHgUlZvzk= github.com/grpc-ecosystem/grpc-gateway v1.16.0/go.mod h1:BDjrQk3hbvj6Nolgz8mAMFbcEtjT1g+wF4CSlocrBnw= github.com/hashicorp/consul/api v1.13.0/go.mod h1:ZlVrynguJKcYr54zGaDbaL3fOvKC9m72FhPvA8T35KQ= @@ -238,8 +159,6 @@ github.com/hashicorp/yamux v0.0.0-20180604194846-3520598351bb/go.mod h1:+NfK9FKe github.com/hashicorp/yamux v0.0.0-20181012175058-2f1d1f20f75d/go.mod h1:+NfK9FKeTrX5uv1uIXGdwYDTeHna2qgaIlx54MXqjAM= github.com/hjson/hjson-go/v4 v4.0.0 h1:wlm6IYYqHjOdXH1gHev4VoXCaW20HdQAGCxdOEEg2cs= github.com/hjson/hjson-go/v4 v4.0.0/go.mod h1:KaYt3bTw3zhBjYqnXkYywcYctk0A2nxeEFTse3rH13E= -github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= -github.com/inconshreveable/mousetrap v1.0.1/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw= github.com/inconshreveable/mousetrap v1.1.0 h1:wN+x4NVGpMsO7ErUn/mUI3vEoE6Jt13X2s0bqwp9tc8= github.com/inconshreveable/mousetrap v1.1.0/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw= github.com/jmespath/go-jmespath v0.4.0/go.mod h1:T8mJZnbsbmF+m6zOOFylbeCJqk5+pHWvzYPziyZiYoo= @@ -250,16 +169,10 @@ github.com/jpillora/backoff v1.0.0/go.mod h1:J/6gKK9jxlEcS3zixgDgUAsiuZ7yrSoa/FX github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= github.com/json-iterator/go v1.1.10/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= github.com/json-iterator/go v1.1.11/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= -github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo= -github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU= -github.com/jstemmer/go-junit-report v0.9.1/go.mod h1:Brl9GWCQeLvo8nXZwPNNblvFj/XSXhF0NWZEnDohbsk= github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w= github.com/julienschmidt/httprouter v1.3.0/go.mod h1:JR6WtHb+2LUe8TCKY3cZOxFyyO8IZAc4RVcycCCAKdM= github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8= github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= -github.com/klauspost/compress v1.15.9/go.mod h1:PhcZ0MbTNciWF3rruxRgKxI5NkcHHrHUDtV4Yw2GlzU= -github.com/klauspost/compress v1.16.3 h1:XuJt9zzcnaz6a16/OU53ZjWp/v7/42WcR5t2a0PcNQY= -github.com/klauspost/compress v1.16.3/go.mod h1:ntbaceVETuRiXiv4DpjP66DpAtAGkEQskQzEyD//IeE= github.com/klauspost/compress v1.16.7 h1:2mk3MPGNzKyxErAw8YaohYh69+pa4sIQSC0fPGCFR9I= github.com/klauspost/compress v1.16.7/go.mod h1:ntbaceVETuRiXiv4DpjP66DpAtAGkEQskQzEyD//IeE= github.com/knadh/koanf v1.5.0 h1:q2TSd/3Pyc/5yP9ldIrSdIz26MCcyNQzW0pEAugLPNs= @@ -268,11 +181,13 @@ github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxv github.com/konsorten/go-windows-terminal-sequences v1.0.3/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc= github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= -github.com/kr/pretty v0.2.0 h1:s5hAObm+yFO5uHYt5dYjxi2rXrsnmRpJx4OYvIWUaQs= github.com/kr/pretty v0.2.0/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= +github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= +github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk= github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= +github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU= github.com/mattn/go-colorable v0.1.4/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE= github.com/mattn/go-colorable v0.1.6/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= @@ -284,13 +199,8 @@ github.com/mattn/go-isatty v0.0.10/go.mod h1:qgIWMr58cqv1PHHyhnkY9lrL7etaEgOFcME github.com/mattn/go-isatty v0.0.11/go.mod h1:PhnuNfih5lzO57/f3n+odYbM4JtupLOxQOAqxQCu2WE= github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU= github.com/mattn/go-isatty v0.0.16/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM= -github.com/mattn/go-isatty v0.0.17/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM= -github.com/mattn/go-isatty v0.0.18 h1:DOKFKCQ7FNG2L1rbrmstDN4QVRdS89Nkh85u68Uwp98= -github.com/mattn/go-isatty v0.0.18/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y= github.com/mattn/go-isatty v0.0.19 h1:JITubQf0MOLdlGRuRq+jtsDlekdYPia9ZFsB8h/APPA= github.com/mattn/go-isatty v0.0.19/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y= -github.com/mattn/go-runewidth v0.0.14 h1:+xnbZSEeDbOIg5/mE6JF0w6n9duR1l3/WmbinWVwUuU= -github.com/mattn/go-runewidth v0.0.14/go.mod h1:Jdepj2loyihRzMpdS35Xk/zdY8IAYHsh153qUoGf23w= github.com/mattn/go-runewidth v0.0.15 h1:UNAjwbU9l54TA3KzvqLGxwWjHmMgBUVhBiTjelZgg3U= github.com/mattn/go-runewidth v0.0.15/go.mod h1:Jdepj2loyihRzMpdS35Xk/zdY8IAYHsh153qUoGf23w= github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= @@ -318,7 +228,6 @@ github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJ github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= -github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk= github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= github.com/npillmayer/nestext v0.1.3/go.mod h1:h2lrijH8jpicr25dFY+oAJLyzlya6jhnuG+zWp9L0Uk= @@ -327,56 +236,37 @@ github.com/pascaldekloe/goe v0.0.0-20180627143212-57f6aae5913c/go.mod h1:lzWF7FI github.com/pascaldekloe/goe v0.1.0/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc= github.com/pelletier/go-toml v1.7.0 h1:7utD74fnzVc/cpcyy8sjrlFr5vYpypUixARcHIMIGuI= github.com/pelletier/go-toml v1.7.0/go.mod h1:vwGMzjaWMwyfHwgIBhI2YUM4fB6nL6lVAvS1LBMMhTE= -github.com/philhofer/fwd v1.1.1/go.mod h1:gk3iGcWd9+svBvR0sR+KPcfE+RNWozjowpeBVG3ZVNU= -github.com/philhofer/fwd v1.1.2 h1:bnDivRJ1EWPjUIRXV5KfORO897HTbpFAQddBdE8t7Gw= -github.com/philhofer/fwd v1.1.2/go.mod h1:qkPdfjR2SIEbspLqpe1tO4n5yICnr2DY7mqEx2tUTP0= github.com/pierrec/lz4 v2.0.5+incompatible/go.mod h1:pdkljMzZIN41W+lC3N2tnIh5sFi+IEE17M5jbnwPHcY= github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= -github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/posener/complete v1.1.1/go.mod h1:em0nMJCgc9GFtwrmVmEMR/ZL6WyhyjMBndrE9hABlRI= github.com/posener/complete v1.2.3/go.mod h1:WZIdtGGp+qx0sLrYKtIRAruyNpv6hFCicSgv7Sy7s/s= github.com/prashantv/gostub v1.1.0 h1:BTyx3RfQjRHnUWaGF9oQos79AlQ5k8WNktv7VGvVH4g= +github.com/prashantv/gostub v1.1.0/go.mod h1:A5zLQHz7ieHGG7is6LLXLz7I8+3LZzsrV0P1IAHhP5U= github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw= github.com/prometheus/client_golang v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5FsnadC4Ky3P0J6CfImo= github.com/prometheus/client_golang v1.7.1/go.mod h1:PY5Wy2awLA44sXw4AOSfFBetzPP4j5+D6mVACh+pe2M= -github.com/prometheus/client_golang v1.11.0/go.mod h1:Z6t4BnS23TR94PD6BsDNk8yVqroYurpAkEiz0P2BEV0= github.com/prometheus/client_golang v1.11.1/go.mod h1:Z6t4BnS23TR94PD6BsDNk8yVqroYurpAkEiz0P2BEV0= -github.com/prometheus/client_golang v1.12.1/go.mod h1:3Z9XVyYiZYEO+YQWt3RD2R3jrbd179Rt297l4aS6nDY= -github.com/prometheus/client_golang v1.14.0 h1:nJdhIvne2eSX/XRAFV9PcvFFRbrjbcTUj0VP62TMhnw= -github.com/prometheus/client_golang v1.14.0/go.mod h1:8vpkKitgIVNcqrRBWh1C4TIUQgYNtG/XQE4E/Zae36Y= github.com/prometheus/client_golang v1.16.0 h1:yk/hx9hDbrGHovbci4BY+pRMfSuuat626eFsHb7tmT8= github.com/prometheus/client_golang v1.16.0/go.mod h1:Zsulrv/L9oM40tJ7T815tM89lFEugiJ9HzIqaAx4LKc= github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/client_model v0.2.0/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= -github.com/prometheus/client_model v0.3.0 h1:UBgGFHqYdG/TPFD1B1ogZywDqEkwp3fBMvqdiQ7Xew4= -github.com/prometheus/client_model v0.3.0/go.mod h1:LDGWKZIo7rky3hgvBe+caln+Dr3dPggB5dvjtD7w9+w= github.com/prometheus/client_model v0.4.0 h1:5lQXD3cAg1OXBf4Wq03gTrXHeaV0TQvGfUooCfx1yqY= github.com/prometheus/client_model v0.4.0/go.mod h1:oMQmHW1/JoDwqLtg57MGgP/Fb1CJEYF2imWWhWtMkYU= github.com/prometheus/common v0.4.1/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= github.com/prometheus/common v0.10.0/go.mod h1:Tlit/dnDKsSWFlCLTWaA1cyBgKHSMdTB80sz/V91rCo= github.com/prometheus/common v0.26.0/go.mod h1:M7rCNAaPfAosfx8veZJCuw84e35h3Cfd9VFqTh1DIvc= -github.com/prometheus/common v0.32.1/go.mod h1:vu+V0TpY+O6vW9J44gczi3Ap/oXXR10b+M/gUGO4Hls= -github.com/prometheus/common v0.37.0/go.mod h1:phzohg0JFMnBEFGxTDbfu3QyL5GI8gTQJFhYO5B3mfA= -github.com/prometheus/common v0.42.0 h1:EKsfXEYo4JpWMHH5cg+KOUWeuJSov1Id8zGR8eeI1YM= -github.com/prometheus/common v0.42.0/go.mod h1:xBwqVerjNdUDjgODMpudtOMwlOwf2SaTr1yjz4b7Zbc= github.com/prometheus/common v0.44.0 h1:+5BrQJwiBB9xsMygAB3TNvpQKOwlkc25LbISbrdOOfY= github.com/prometheus/common v0.44.0/go.mod h1:ofAIvZbQ1e/nugmZGz4/qCb9Ap1VoSTIO7x0VV9VvuY= github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= github.com/prometheus/procfs v0.1.3/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU= github.com/prometheus/procfs v0.6.0/go.mod h1:cz+aTbrPOrUb4q7XlbU9ygM+/jj0fzG6c1xBZuNvfVA= -github.com/prometheus/procfs v0.7.3/go.mod h1:cz+aTbrPOrUb4q7XlbU9ygM+/jj0fzG6c1xBZuNvfVA= -github.com/prometheus/procfs v0.8.0/go.mod h1:z7EfXMXOkbkqb9IINtpCn86r/to3BnA0uaxHdg830/4= -github.com/prometheus/procfs v0.9.0 h1:wzCHvIvM5SxWqYvwgVL7yJY8Lz3PKn49KQtpgMYJfhI= -github.com/prometheus/procfs v0.9.0/go.mod h1:+pB4zwohETzFnmlpe6yd2lSc+0/46IYZRB/chUwxUZY= -github.com/prometheus/procfs v0.11.0 h1:5EAgkfkMl659uZPbe9AS2N68a7Cc1TJbPEuGzFuRbyk= -github.com/prometheus/procfs v0.11.0/go.mod h1:nwNm2aOCAYw8uTR/9bWRREkZFxAUcWzPHWJq+XBB/FM= github.com/prometheus/procfs v0.11.1 h1:xRC8Iq1yyca5ypa9n1EZnWZkt7dwcoRPQwX/5gwaUuI= github.com/prometheus/procfs v0.11.1/go.mod h1:eesXgaPo1q7lBpVMoMy0ZOFTth9hBn4W/y0/p/ScXhY= github.com/rhnvrm/simples3 v0.6.1/go.mod h1:Y+3vYm2V7Y4VijFoJHHTrja6OgPrJ2cBti8dPGkC3sA= @@ -384,24 +274,18 @@ github.com/rivo/uniseg v0.2.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJ github.com/rivo/uniseg v0.4.4 h1:8TfxU8dW6PdqD27gjM8MVNuicgxIjxpm4K7x4jp8sis= github.com/rivo/uniseg v0.4.4/go.mod h1:FN3SvrM+Zdj16jyLfmOkMNblXMcoc8DfTHruCPUcx88= github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6LYCDYWNEvQ= -github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= +github.com/rogpeppe/go-internal v1.10.0 h1:TMyTOH3F/DB16zRVcYyreMH6GnZZrwQVAoYjRBZyWFQ= +github.com/rogpeppe/go-internal v1.10.0/go.mod h1:UQnix2H7Ngw/k4C5ijL5+65zddjncjaFoBhdsK/akog= github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= github.com/ryanuber/columnize v0.0.0-20160712163229-9b3edd62028f/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts= github.com/ryanuber/columnize v2.1.0+incompatible/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts= github.com/ryanuber/go-glob v1.0.0/go.mod h1:807d1WSdnB0XRJzKNil9Om6lcp/3a0v4qIHxIXzX/Yc= -github.com/savsgio/dictpool v0.0.0-20221023140959-7bf2e61cea94 h1:rmMl4fXJhKMNWl+K+r/fq4FbbKI+Ia2m9hYBLm2h4G4= -github.com/savsgio/dictpool v0.0.0-20221023140959-7bf2e61cea94/go.mod h1:90zrgN3D/WJsDd1iXHT96alCoN2KJo6/4x1DZC3wZs8= -github.com/savsgio/gotils v0.0.0-20220530130905-52f3993e8d6d/go.mod h1:Gy+0tqhJvgGlqnTF8CVGP0AaGRjwBtXs/a5PA0Y3+A4= -github.com/savsgio/gotils v0.0.0-20230208104028-c358bd845dee h1:8Iv5m6xEo1NR1AvpV+7XmhI4r39LGNzwUL4YpMuL5vk= -github.com/savsgio/gotils v0.0.0-20230208104028-c358bd845dee/go.mod h1:qwtSXrKuJh/zsFQ12yEE89xfCrGKK63Rr7ctU/uCo4g= github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529/go.mod h1:DxrIzT+xaE7yg65j358z/aeFdxmN0P9QXhEzd20vsDc= github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE= github.com/sirupsen/logrus v1.6.0/go.mod h1:7uNnSEd1DgxDLC74fIahvMZmmYsHGZGEOFrfsX/uA88= github.com/speps/go-hashids/v2 v2.0.1 h1:ViWOEqWES/pdOSq+C1SLVa8/Tnsd52XC34RY7lt7m4g= github.com/speps/go-hashids/v2 v2.0.1/go.mod h1:47LKunwvDZki/uRVD6NImtyk712yFzIs3UF3KlHohGw= -github.com/spf13/cobra v1.6.1 h1:o94oiPyS4KD1mPy2fmcYYHHfCxLqYjJOhGsCHFZtEzA= -github.com/spf13/cobra v1.6.1/go.mod h1:IOw/AERYS7UzyrGinqmz6HLUo219MORXGxhbaJUqzrY= github.com/spf13/cobra v1.7.0 h1:hyqWnYt1ZQShIddO5kBpj3vu05/++x6tJ6dg8EC572I= github.com/spf13/cobra v1.7.0/go.mod h1:uLxZILRyS/50WlhOIKD7W6V5bgeIt+4sICxh6uRMrb0= github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA= @@ -419,118 +303,55 @@ github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcU github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= github.com/tidwall/pretty v1.2.1 h1:qjsOFOWWQl+N3RsoF5/ssm1pHmJJwhjlSbZ51I6wMl4= github.com/tidwall/pretty v1.2.1/go.mod h1:ITEVvHYasfjBbM0u2Pg8T2nJnzm8xPwvNhhsoaGGjNU= -github.com/tinylib/msgp v1.1.6/go.mod h1:75BAfg2hauQhs3qedfdDZmWAPcFMAvJE5b9rGOMufyw= -github.com/tinylib/msgp v1.1.8 h1:FCXC1xanKO4I8plpHGH2P7koL/RzZs12l/+r7vakfm0= -github.com/tinylib/msgp v1.1.8/go.mod h1:qkpG+2ldGg4xRFmx+jfTvZPxfGFhi64BcnL9vkCm/Tw= github.com/valyala/bytebufferpool v1.0.0 h1:GqA5TC/0021Y/b9FG4Oi9Mr3q7XYx6KllzawFIhcdPw= github.com/valyala/bytebufferpool v1.0.0/go.mod h1:6bBcMArwyJ5K/AmCkWv1jt77kVWyCJ6HpOuEn7z0Csc= -github.com/valyala/fasthttp v1.43.0/go.mod h1:f6VbjjoI3z1NDOZOv17o6RvtRSWxC77seBFc2uWtgiY= -github.com/valyala/fasthttp v1.44.0/go.mod h1:f6VbjjoI3z1NDOZOv17o6RvtRSWxC77seBFc2uWtgiY= -github.com/valyala/fasthttp v1.45.0 h1:zPkkzpIn8tdHZUrVa6PzYd0i5verqiPSkgTd3bSUcpA= -github.com/valyala/fasthttp v1.45.0/go.mod h1:k2zXd82h/7UZc3VOdJ2WaUqt1uZ/XpXAfE9i+HBC3lA= github.com/valyala/fasthttp v1.48.0 h1:oJWvHb9BIZToTQS3MuQ2R3bJZiNSa2KiNdeI8A+79Tc= github.com/valyala/fasthttp v1.48.0/go.mod h1:k2zXd82h/7UZc3VOdJ2WaUqt1uZ/XpXAfE9i+HBC3lA= github.com/valyala/tcplisten v1.0.0 h1:rBHj/Xf+E1tRGZyWIWwJDiRY0zc1Js+CV5DqwacVSA8= github.com/valyala/tcplisten v1.0.0/go.mod h1:T0xQ8SeCZGxckz9qRXTfG43PvQ/mcWh7FwZEA7Ioqkc= -github.com/yuin/goldmark v1.1.25/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= -github.com/yuin/goldmark v1.1.32/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.3.5/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= -github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY= -gitlab.snapp.ir/security_regulatory/validator/pkg/sdk v0.2.1 h1:5R+WK9NRRaKXItZZzOcPV1yJQflm/MbXGsN+7BXhpKQ= -gitlab.snapp.ir/security_regulatory/validator/pkg/sdk v0.2.1/go.mod h1:Y21ZWyfYMWKqotRn1i1BoI6ieZJs9qaoAppHNXFgnKs= gitlab.snapp.ir/security_regulatory/validator/pkg/sdk v0.2.2 h1:+JwjrfGwsdgojbfn26M4Af/ZzBHCsLyU9vNYWXe1HnM= gitlab.snapp.ir/security_regulatory/validator/pkg/sdk v0.2.2/go.mod h1:+0JXkekQpl5kJvmIKyBH5EJLIj0u628fbk+GfaIS+3k= go.etcd.io/etcd/api/v3 v3.5.4/go.mod h1:5GB2vv4A4AOn3yk7MftYGHkUfGtDHnEraIjym4dYz5A= go.etcd.io/etcd/client/pkg/v3 v3.5.4/go.mod h1:IJHfcCEKxYu1Os13ZdwCwIUTUVGYTSAM3YSwc9/Ac1g= go.etcd.io/etcd/client/v3 v3.5.4/go.mod h1:ZaRkVgBZC+L+dLCjTcF1hRXpgZXQPOvnA/Ak/gq3kiY= -go.opencensus.io v0.21.0/go.mod h1:mSImk1erAIZhrmZN+AvHh14ztQfjbGwt4TtuofqLduU= -go.opencensus.io v0.22.0/go.mod h1:+kGneAE2xo2IficOXnaByMWTGM9T73dGwxeWcUqIpI8= -go.opencensus.io v0.22.2/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= -go.opencensus.io v0.22.3/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= -go.opencensus.io v0.22.4/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= -go.opentelemetry.io/otel v1.14.0 h1:/79Huy8wbf5DnIPhemGB+zEPVwnN6fuQybr/SRXa6hM= -go.opentelemetry.io/otel v1.14.0/go.mod h1:o4buv+dJzx8rohcUeRmWUZhqupFvzWis188WlggnNeU= go.opentelemetry.io/otel v1.16.0 h1:Z7GVAX/UkAXPKsy94IU+i6thsQS4nb7LviLpnaNeW8s= go.opentelemetry.io/otel v1.16.0/go.mod h1:vl0h9NUa1D5s1nv3A5vZOYWn8av4K8Ml6JDeHrT/bx4= -go.opentelemetry.io/otel/exporters/jaeger v1.14.0 h1:CjbUNd4iN2hHmWekmOqZ+zSCU+dzZppG8XsV+A3oc8Q= -go.opentelemetry.io/otel/exporters/jaeger v1.14.0/go.mod h1:4Ay9kk5vELRrbg5z4cpP9EtmQRFap2Wb0woPG4lujZA= go.opentelemetry.io/otel/exporters/jaeger v1.16.0 h1:YhxxmXZ011C0aDZKoNw+juVWAmEfv/0W2XBOv9aHTaA= go.opentelemetry.io/otel/exporters/jaeger v1.16.0/go.mod h1:grYbBo/5afWlPpdPZYhyn78Bk04hnvxn2+hvxQhKIQM= go.opentelemetry.io/otel/metric v1.16.0 h1:RbrpwVG1Hfv85LgnZ7+txXioPDoh6EdbZHo26Q3hqOo= go.opentelemetry.io/otel/metric v1.16.0/go.mod h1:QE47cpOmkwipPiefDwo2wDzwJrlfxxNYodqc4xnGCo4= -go.opentelemetry.io/otel/sdk v1.14.0 h1:PDCppFRDq8A1jL9v6KMI6dYesaq+DFcDZvjsoGvxGzY= -go.opentelemetry.io/otel/sdk v1.14.0/go.mod h1:bwIC5TjrNG6QDCHNWvW4HLHtUQ4I+VQDsnjhvyZCALM= go.opentelemetry.io/otel/sdk v1.16.0 h1:Z1Ok1YsijYL0CSJpHt4cS3wDDh7p572grzNrBMiMWgE= go.opentelemetry.io/otel/sdk v1.16.0/go.mod h1:tMsIuKXuuIWPBAOrH+eHtvhTL+SntFtXF9QD68aP6p4= -go.opentelemetry.io/otel/trace v1.14.0 h1:wp2Mmvj41tDsyAJXiWDWpfNsOiIyd38fy85pyKcFq/M= -go.opentelemetry.io/otel/trace v1.14.0/go.mod h1:8avnQLK+CG77yNLUae4ea2JDQ6iT+gozhnZjy/rw9G8= go.opentelemetry.io/otel/trace v1.16.0 h1:8JRpaObFoW0pxuVPapkgH8UhHQj+bJW8jJsCZEu5MQs= go.opentelemetry.io/otel/trace v1.16.0/go.mod h1:Yt9vYq1SdNz3xdjZZK7wcXv1qv2pwLkqr2QVwea0ef0= go.uber.org/atomic v1.7.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc= -go.uber.org/atomic v1.10.0 h1:9qC72Qh0+3MqyJbAn8YU5xVq1frD8bn3JtD2oXtafVQ= -go.uber.org/atomic v1.10.0/go.mod h1:LUxbIzbOniOlMKjJjyPfpl4v+PKK2cNJn91OQbhoJI0= -go.uber.org/atomic v1.11.0 h1:ZvwS0R+56ePWxUNi+Atn9dWONBPp/AUETXlHW0DxSjE= -go.uber.org/atomic v1.11.0/go.mod h1:LUxbIzbOniOlMKjJjyPfpl4v+PKK2cNJn91OQbhoJI0= -go.uber.org/automaxprocs v1.5.2 h1:2LxUOGiR3O6tw8ui5sZa2LAaHnsviZdVOUZw4fvbnME= -go.uber.org/automaxprocs v1.5.2/go.mod h1:eRbA25aqJrxAbsLO0xy5jVwPt7FQnRgjW+efnwa1WM0= go.uber.org/automaxprocs v1.5.3 h1:kWazyxZUrS3Gs4qUpbwo5kEIMGe/DAvi5Z4tl2NW4j8= go.uber.org/automaxprocs v1.5.3/go.mod h1:eRbA25aqJrxAbsLO0xy5jVwPt7FQnRgjW+efnwa1WM0= -go.uber.org/goleak v1.1.12 h1:gZAh5/EyT/HQwlpkCy6wTpqfH9H8Lz8zbm3dZh+OyzA= +go.uber.org/goleak v1.2.0 h1:xqgm/S+aQvhWFTtR0XK3Jvg7z8kGV8P4X14IzwN3Eqk= +go.uber.org/goleak v1.2.0/go.mod h1:XJYK+MuIchqpmGmUSAzotztawfKvYLUIgg7guXrwVUo= go.uber.org/multierr v1.6.0/go.mod h1:cdWPpRnG4AhwMwsgIHip0KRBQjJy5kYEpYjJxpXp9iU= -go.uber.org/multierr v1.10.0 h1:S0h4aNzvfcFsC3dRF1jLoaov7oRaKqRGC/pUEJ2yvPQ= -go.uber.org/multierr v1.10.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y= go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0= go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y= go.uber.org/zap v1.17.0/go.mod h1:MXVU+bhUf/A7Xi2HNOnopQOrmycQ5Ih87HtOu4q5SSo= -go.uber.org/zap v1.24.0 h1:FiJd5l1UOLj0wCgbSE0rwwXHzEdAZS6hiiSnxJN/D60= -go.uber.org/zap v1.24.0/go.mod h1:2kMP+WWQ8aoFoedH3T2sq6iJ2yDWpHbP0f6MQbS9Gkg= go.uber.org/zap v1.25.0 h1:4Hvk6GtkucQ790dqmj7l1eEnRdKm3k3ZUrUMS2d5+5c= go.uber.org/zap v1.25.0/go.mod h1:JIAUzQIH94IC4fOJQm7gMmBJP5k7wQfdcnYdPoEXJYk= golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= -golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20190923035154-9ee001bba392/go.mod h1:/lpIB1dKB+9EgE3H3cr1v9wB50oz8l4C4h62xy7jSTY= golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= -golang.org/x/crypto v0.0.0-20220214200702-86341886e292/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= -golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= -golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= -golang.org/x/exp v0.0.0-20190829153037-c13cbed26979/go.mod h1:86+5VVa7VpoJ4kLfm080zCjGlMRFzhUhsZKEZO7MGek= -golang.org/x/exp v0.0.0-20191030013958-a1ab85dbe136/go.mod h1:JXzH8nQsPlswgeRAPE3MuO9GYsAcnJvJ4vnMwN/5qkY= -golang.org/x/exp v0.0.0-20191129062945-2f5052295587/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= -golang.org/x/exp v0.0.0-20191227195350-da58074b4299/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= -golang.org/x/exp v0.0.0-20200119233911-0405dc783f0a/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= -golang.org/x/exp v0.0.0-20200207192155-f17229e696bd/go.mod h1:J/WKrq2StrnmMY6+EHIKF9dgMWnmCNThgcyBT1FY9mM= -golang.org/x/exp v0.0.0-20200224162631-6cc2880d07d6/go.mod h1:3jZMyOhIsHpP37uCMkUooju7aAi5cS1Q23tOzKc+0MU= -golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js= -golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= 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-20190301231843-5614ed5bae6f/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= -golang.org/x/lint v0.0.0-20190409202823-959b441ac422/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= -golang.org/x/lint v0.0.0-20190909230951-414d861bb4ac/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= -golang.org/x/lint v0.0.0-20190930215403-16217165b5de/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= -golang.org/x/lint v0.0.0-20191125180803-fdd1cda4f05f/go.mod h1:5qLYkcX4OjUUV8bRuDixDT3tpyyb+LUpUlRWLxfhWrs= -golang.org/x/lint v0.0.0-20200130185559-910be7a94367/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= -golang.org/x/lint v0.0.0-20200302205851-738671d3881b/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= golang.org/x/lint v0.0.0-20210508222113-6edffad5e616/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= -golang.org/x/mobile v0.0.0-20190312151609-d3739f865fa6/go.mod h1:z+o9i4GpDbdi3rU15maQ/Ox0txvL9dWGYEHz965HBQE= -golang.org/x/mobile v0.0.0-20190719004257-d2bd2a29d028/go.mod h1:E/iHnbuqvinMTCcRqshq8CkpyQDoeVncDDYHnLhea+o= -golang.org/x/mod v0.0.0-20190513183733-4bf6d317e70e/go.mod h1:mXi4GBBbnImb6dmsKGUJ2LatrhH/nqhxcFungHvyanc= -golang.org/x/mod v0.1.0/go.mod h1:0QHyrYULN0/3qlju5TqG8bIK38QM8yzMo5ekMj3DlcY= golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= -golang.org/x/mod v0.1.1-0.20191107180719-034126e5016b/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= -golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= -golang.org/x/mod v0.7.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20181114220301-adae6a3d119a/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= @@ -538,60 +359,28 @@ golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73r golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= -golang.org/x/net v0.0.0-20190501004415-9ce7a6920f09/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= -golang.org/x/net v0.0.0-20190503192946-f4e77d36d62c/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= -golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks= golang.org/x/net v0.0.0-20190613194153-d28f0bde5980/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20190628185345-da137c7871d7/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20190724013045-ca1201d0de80/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20190923162816-aa69164e4478/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20191209160850-c0dbc17a3553/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20200114155413-6afb5195e5aa/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20200202094626-16171245cfb2/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20200222125558-5a598a2470a0/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20200301022130-244492dfa37a/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20200324143707-d3edc9973b7e/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= -golang.org/x/net v0.0.0-20200501053045-e0ff5e5a1de5/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= -golang.org/x/net v0.0.0-20200506145744-7e3656a0809f/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= -golang.org/x/net v0.0.0-20200513185701-a91f0712d120/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= -golang.org/x/net v0.0.0-20200520182314-0ba52f642ac2/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= golang.org/x/net v0.0.0-20200625001655-4c5254603344/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= -golang.org/x/net v0.0.0-20200707034311-ab3426394381/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= golang.org/x/net v0.0.0-20200822124328-c89045814202/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM= golang.org/x/net v0.0.0-20210410081132-afb366fc7cd1/go.mod h1:9tjilg8BloeKEkVJvy7fQ90B1CfIiPueXVOjqfkSzI8= -golang.org/x/net v0.0.0-20210525063256-abc453219eb5/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= -golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= -golang.org/x/net v0.0.0-20220127200216-cd36cc0744dd/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= -golang.org/x/net v0.0.0-20220225172249-27dd8689420f/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= -golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= -golang.org/x/net v0.0.0-20220906165146-f3363e06e74c/go.mod h1:YDH+HFinaLZZlnHAfSS6ZXJJ9M9t4Dl22yv3iI2vPwk= -golang.org/x/net v0.3.0/go.mod h1:MBQ8lrhLObU/6UmLb4fmbmk5OcyYmqtbGd/9yIeKjEE= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= -golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= -golang.org/x/oauth2 v0.0.0-20191202225959-858c2ad4c8b6/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= -golang.org/x/oauth2 v0.0.0-20210514164344-f6687ab2804c/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= -golang.org/x/oauth2 v0.0.0-20220223155221-ee480838109b/go.mod h1:DAh4E804XQdzx2j+YRIaUnCqCV2RuMz24cGBJ5QYIrc= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190227155943-e225da77a7e6/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20200317015054-43a5402ce75a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20200625203802-6e8e738ad208/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201207232520-09787c993a3a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20220601150217-0de741cfad7f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sys v0.0.0-20180823144017-11551d06cbcc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= @@ -599,200 +388,71 @@ golang.org/x/sys v0.0.0-20181116152217-5ac8a444bdc5/go.mod h1:STP8DvDyc/dI5b8T5h golang.org/x/sys v0.0.0-20190129075346-302c3dd5f1cc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190222072716-a9d3bda3a223/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20190312061237-fead79001313/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190403152447-81d4e9dc473e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190422165155-953cdadca894/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190502145724-3ef323f4f1fd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190507160741-ecd444e8653b/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190606165138-5da285871e9c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190624142023-c5567b49c5d0/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190726091711-fc99dfbffb4e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190922100055-0a153f010e69/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190924154521-2837fb4f24fe/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20191001151750-bb3f8db39f24/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191005200804-aed5e4c7ecf9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191008105621-543471e840be/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191026070338-33540a1f6037/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20191204072324-ce4227a45e2e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20191228213918-04cbcbbfeed8/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200106162015-b016eb3dc98e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200113162924-86b910548bc1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200116001909-b77594299b42/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200122134326-e047566fdf82/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200124204421-9fbb57f87de9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200202164722-d101bd2416d5/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200212091648-12a6c2dcc1e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200302150141-5c8b2ff67527/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200331124033-c3d80250170d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200501052902-10377860bb8e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200511232937-7e40ca221e25/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200515095857-1151b9dac4a9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200523222454-059865788121/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200615200032-f1bc736245b1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200625212154-ddb9806d33ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200803210538-64077c9b5642/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210303074136-134d130e1a04/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210330210617-4fbd30eecc44/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210403161142-5e06dd20ab57/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210603081109-ebe580a85c40/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220114195835-da31bd327af9/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220728004956-3c1f35247d10/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220908164124-27713097b956/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.3.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.6.0 h1:MVltZSvRTcU2ljQOhs94SXPftV6DCNnZViHeQps87pQ= golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.10.0 h1:SqMFp9UcQJZa+pmYuAKjd9xq1f0j5rLcDIk0mj4qAsA= -golang.org/x/sys v0.10.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.11.0 h1:eG7RXZHdqOJ1i+0lgLgCpSXAp6M3LYlAo6osgSi0xOM= golang.org/x/sys v0.11.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= -golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= -golang.org/x/term v0.3.0/go.mod h1:q750SLmJuPmVoN1blW3UFBPREJfb1KmY3vwxfr+nFDA= -golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= -golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.1-0.20181227161524-e6919f6577db/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= -golang.org/x/text v0.5.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= -golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= -golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= -golang.org/x/tools v0.0.0-20190312151545-0bb0c0a6e846/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= -golang.org/x/tools v0.0.0-20190312170243-e65039ee4138/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= -golang.org/x/tools v0.0.0-20190425150028-36563e24a262/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= -golang.org/x/tools v0.0.0-20190506145303-2d16b83fe98c/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= -golang.org/x/tools v0.0.0-20190606124116-d0a3d012864b/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= -golang.org/x/tools v0.0.0-20190621195816-6e04913cbbac/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= -golang.org/x/tools v0.0.0-20190628153133-6cdbf07be9d0/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= -golang.org/x/tools v0.0.0-20190816200558-6889da9d5479/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20190907020128-2ca718005c18/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20190911174233-4f2ddba30aff/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191012152004-8de300cfc20a/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191113191852-77e3bb0ad9e7/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191115202509-3a792d9c32b2/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191125144606-a911d9008d1f/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191130070609-6e064ea0cf2d/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191216173652-a0e659d51361/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20191227053925-7b8e75db28f4/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200117161641-43d50277825c/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200122220014-bf1340f18c4a/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20200130002326-2f3ba24bd6e7/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200204074204-1cc6d1ef6c74/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200207183749-b753a1ba74fa/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200212150539-ea181f53ac56/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200224181240-023911ca70b2/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200227222343-706bc42d1f0d/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200304193943-95d2e580d8eb/go.mod h1:o4KQGtdN14AW+yjsvvwRTJJuXz8XRtIHtEnmAXLyFUw= -golang.org/x/tools v0.0.0-20200312045724-11d5b4c81c7d/go.mod h1:o4KQGtdN14AW+yjsvvwRTJJuXz8XRtIHtEnmAXLyFUw= -golang.org/x/tools v0.0.0-20200331025713-a30bf2db82d4/go.mod h1:Sl4aGygMT6LrqrWclx+PTx3U+LnKx/seiNR+3G19Ar8= -golang.org/x/tools v0.0.0-20200501065659-ab2804fb9c9d/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= -golang.org/x/tools v0.0.0-20200512131952-2bc93b1c0c88/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= -golang.org/x/tools v0.0.0-20200515010526-7d3b6ebf133d/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= -golang.org/x/tools v0.0.0-20200618134242-20370b0cb4b2/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= -golang.org/x/tools v0.0.0-20200729194436-6467de6f59a7/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= -golang.org/x/tools v0.0.0-20200804011535-6c149bb5ef0d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= -golang.org/x/tools v0.0.0-20200825202427-b303f430e36d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= -golang.org/x/tools v0.0.0-20201022035929-9cf592e881e9/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.1.2/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= -golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= -golang.org/x/tools v0.4.0/go.mod h1:UE5sM2OK9E/d67R0ANs2xJizIymRP5gJU295PvKXxjQ= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -google.golang.org/api v0.4.0/go.mod h1:8k5glujaEP+g9n7WNsDg8QP6cUVNI86fCNMcbazEtwE= -google.golang.org/api v0.7.0/go.mod h1:WtwebWUNSVBH/HAw79HIFXZNqEvBhG+Ra+ax0hx3E3M= -google.golang.org/api v0.8.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg= -google.golang.org/api v0.9.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg= -google.golang.org/api v0.13.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI= -google.golang.org/api v0.14.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI= -google.golang.org/api v0.15.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI= -google.golang.org/api v0.17.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= -google.golang.org/api v0.18.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= -google.golang.org/api v0.19.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= -google.golang.org/api v0.20.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= -google.golang.org/api v0.22.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= -google.golang.org/api v0.24.0/go.mod h1:lIXQywCXRcnZPGlsd8NbLnOjtAoL6em04bJ9+z0MncE= -google.golang.org/api v0.28.0/go.mod h1:lIXQywCXRcnZPGlsd8NbLnOjtAoL6em04bJ9+z0MncE= -google.golang.org/api v0.29.0/go.mod h1:Lcubydp8VUV7KeIHD9z2Bys/sm/vGKnG1UHuDBSrHWM= -google.golang.org/api v0.30.0/go.mod h1:QGmEvQ87FHZNiUVJkT14jQNYJ4ZJjdRF23ZXz5138Fc= 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/appengine v1.5.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= -google.golang.org/appengine v1.6.1/go.mod h1:i06prIuMbXzDqacNJfV5OdTW448YApPu5ww/cMBSeb0= -google.golang.org/appengine v1.6.5/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= -google.golang.org/appengine v1.6.6/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= -google.golang.org/genproto v0.0.0-20190307195333-5fe7a883aa19/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= google.golang.org/genproto v0.0.0-20190404172233-64821d5d2107/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= -google.golang.org/genproto v0.0.0-20190418145605-e7d98fc518a7/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= -google.golang.org/genproto v0.0.0-20190425155659-357c62f0e4bb/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= -google.golang.org/genproto v0.0.0-20190502173448-54afdca5d873/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= -google.golang.org/genproto v0.0.0-20190801165951-fa694d86fc64/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= -google.golang.org/genproto v0.0.0-20190911173649-1774047e7e51/go.mod h1:IbNlFCBrqXvoKpeg0TB2l7cyZUmoaFKYIwrEpbDKLA8= -google.golang.org/genproto v0.0.0-20191108220845-16a3f7862a1a/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= -google.golang.org/genproto v0.0.0-20191115194625-c23dd37a84c9/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= -google.golang.org/genproto v0.0.0-20191216164720-4f79533eabd1/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= -google.golang.org/genproto v0.0.0-20191230161307-f3c370f40bfb/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= -google.golang.org/genproto v0.0.0-20200115191322-ca5a22157cba/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= -google.golang.org/genproto v0.0.0-20200122232147-0452cf42e150/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= -google.golang.org/genproto v0.0.0-20200204135345-fa8e72b47b90/go.mod h1:GmwEX6Z4W5gMy59cAlVYjN9JhxgbQH6Gn+gFDQe2lzA= -google.golang.org/genproto v0.0.0-20200212174721-66ed5ce911ce/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= -google.golang.org/genproto v0.0.0-20200224152610-e50cd9704f63/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= -google.golang.org/genproto v0.0.0-20200228133532-8c2c7df3a383/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= -google.golang.org/genproto v0.0.0-20200305110556-506484158171/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= -google.golang.org/genproto v0.0.0-20200312145019-da6875a35672/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= -google.golang.org/genproto v0.0.0-20200331122359-1ee6d9798940/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= -google.golang.org/genproto v0.0.0-20200430143042-b979b6f78d84/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= -google.golang.org/genproto v0.0.0-20200511104702-f5ebc3bea380/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= google.golang.org/genproto v0.0.0-20200513103714-09dca8ec2884/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= -google.golang.org/genproto v0.0.0-20200515170657-fc4c6c6a6587/go.mod h1:YsZOwe1myG/8QRHRsmBRE1LrgQY60beZKjly0O1fX9U= google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo= -google.golang.org/genproto v0.0.0-20200618031413-b414f8b61790/go.mod h1:jDfRM7FcilCzHH/e9qn6dsT145K34l5v+OpcnNgKAAA= -google.golang.org/genproto v0.0.0-20200729003335-053ba62fc06f/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20200804131852-c06518451d9c/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20200825200019-8632dd797987/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20210602131652-f16073e35f0c/go.mod h1:UODoCrxHCcBojKKwX1terBiRUaqAsFqJiF615XL43r0= google.golang.org/grpc v1.14.0/go.mod h1:yo6s7OP7yaDglbqo1J04qKzAhqBH6lvTonzMVmEdcZw= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= -google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38= -google.golang.org/grpc v1.21.1/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= google.golang.org/grpc v1.22.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= 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.26.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= -google.golang.org/grpc v1.27.1/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= -google.golang.org/grpc v1.28.0/go.mod h1:rpkK4SK4GF4Ach/+MFLZUBavHOvF2JJB5uozKKal+60= -google.golang.org/grpc v1.29.1/go.mod h1:itym6AZVZYACWQqET3MqgPpjcuV5QH3BxFS3IjizoKk= -google.golang.org/grpc v1.30.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= -google.golang.org/grpc v1.31.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= google.golang.org/grpc v1.33.1/go.mod h1:fr5YgcSWrqhRRxogOsw7RzIpsmvOZ6IcH4kBYTpR3n0= google.golang.org/grpc v1.38.0/go.mod h1:NREThFqKR1f3iQ6oBuvc5LadQuXVGo9rkm5ZGrQdJfM= google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= @@ -803,22 +463,17 @@ google.golang.org/protobuf v1.21.0/go.mod h1:47Nbq4nVaFHyn7ilMalzfO3qCViNmqZ2kzi google.golang.org/protobuf v1.22.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= google.golang.org/protobuf v1.23.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= google.golang.org/protobuf v1.23.1-0.20200526195155-81db48ad09cc/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= -google.golang.org/protobuf v1.24.0/go.mod h1:r/3tXBNzIEhYS9I1OUVjXDlt8tc493IdKGjtUeSXeh4= google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c= google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= -google.golang.org/protobuf v1.28.1/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= -google.golang.org/protobuf v1.30.0 h1:kPPoIgf3TsEvrm0PFe15JQ+570QVxYzEvvHqChK+cng= -google.golang.org/protobuf v1.30.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= google.golang.org/protobuf v1.31.0 h1:g0LDEJHgrBl9N9r17Ru3sqWhkIx2NB67okBHPwC7hs8= google.golang.org/protobuf v1.31.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= gopkg.in/asn1-ber.v1 v1.0.0-20181015200546-f715ec2f112d/go.mod h1:cuepJuh7vyXfUyUwEgHQXw849cJrilpS5NeIjOWESAw= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= -gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= +gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= gopkg.in/square/go-jose.v2 v2.3.1/go.mod h1:M9dMgbHiYLoDGQrXy7OpJDJWiKiU//h+vD76mk0e1AI= gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= @@ -833,13 +488,5 @@ gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= -honnef.co/go/tools v0.0.0-20190106161140-3f1c8253044a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= -honnef.co/go/tools v0.0.0-20190418001031-e561f6794a2a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= -honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg= -honnef.co/go/tools v0.0.1-2020.1.3/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= -honnef.co/go/tools v0.0.1-2020.1.4/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= -rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8= -rsc.io/quote/v3 v3.1.0/go.mod h1:yEA65RcK8LyAZtP9Kv3t0HmxON59tX3rD+tICJqUlj0= -rsc.io/sampler v1.3.0/go.mod h1:T1hPZKmBbMNahiBKFy5HrXp6adAjACjK9JXDnKaTXpA= sigs.k8s.io/yaml v1.2.0/go.mod h1:yfXDCHCao9+ENCvLSE62v9VSji2MKu5jeNfTrofGhJc= From aba9487035952204c45987b40416f4b2b84698a2 Mon Sep 17 00:00:00 2001 From: Parham Alvani Date: Sun, 20 Aug 2023 00:12:47 -0400 Subject: [PATCH 421/660] feat: update structure and fallback to jwt v4 --- go.mod | 2 +- go.sum | 4 ++-- internal/api/acl.go | 3 ++- internal/api/auth.go | 2 +- internal/authenticator/auto_authenticator.go | 5 +++-- internal/authenticator/auto_authenticator_test.go | 2 +- internal/authenticator/builder.go | 3 +++ internal/authenticator/key.go | 2 +- internal/authenticator/manual_authenticator.go | 15 ++++----------- .../authenticator/manual_authenticator_test.go | 2 +- 10 files changed, 19 insertions(+), 21 deletions(-) diff --git a/go.mod b/go.mod index 6e15a049..ddfcbd5b 100644 --- a/go.mod +++ b/go.mod @@ -6,7 +6,7 @@ require ( github.com/ansrivas/fiberprometheus/v2 v2.6.1 github.com/gofiber/contrib/fiberzap v1.0.2 github.com/gofiber/fiber/v2 v2.48.0 - github.com/golang-jwt/jwt/v5 v5.0.0 + github.com/golang-jwt/jwt/v4 v4.5.0 github.com/knadh/koanf v1.5.0 github.com/speps/go-hashids/v2 v2.0.1 github.com/spf13/cobra v1.7.0 diff --git a/go.sum b/go.sum index 45e6ba50..ab766cb5 100644 --- a/go.sum +++ b/go.sum @@ -84,8 +84,8 @@ github.com/gofiber/fiber/v2 v2.48.0 h1:cRVMCb9aUJDsyHxGFLwz/sGzDggdailZZyptU9F9c github.com/gofiber/fiber/v2 v2.48.0/go.mod h1:xqJgfqrc23FJuqGOW6DVgi3HyZEm2Mn9pRqUb2kHSX8= github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q= -github.com/golang-jwt/jwt/v5 v5.0.0 h1:1n1XNM9hk7O9mnQoNBGolZvzebBQ7p93ULHRc28XJUE= -github.com/golang-jwt/jwt/v5 v5.0.0/go.mod h1:pqrtFR0X4osieyHYxtmOUWsAWrfe1Q5UVIyoH402zdk= +github.com/golang-jwt/jwt/v4 v4.5.0 h1:7cYmW1XlMY7h7ii7UhUyChSgS5wUJEnm9uZVTGqOWzg= +github.com/golang-jwt/jwt/v4 v4.5.0/go.mod h1:m21LjoU+eqJr34lmDMbreY2eSTRJ1cv77w39/MY0Ch0= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= diff --git a/internal/api/acl.go b/internal/api/acl.go index 5e943dc9..404c26ef 100644 --- a/internal/api/acl.go +++ b/internal/api/acl.go @@ -5,6 +5,7 @@ import ( "net/http" "github.com/gofiber/fiber/v2" + "github.com/golang-jwt/jwt/v4" "gitlab.snapp.ir/dispatching/soteria/internal/authenticator" "gitlab.snapp.ir/dispatching/soteria/pkg/acl" "go.opentelemetry.io/otel/attribute" @@ -73,7 +74,7 @@ func (a API) ACL(c *fiber.Ctx) error { zap.String("username", request.Username), zap.String("password", request.Password), zap.String("authenticator", auth.GetCompany())) - } else { + } else if !errors.Is(err, jwt.ErrTokenExpired) { a.Logger. Error("acl request is not authorized", zap.Error(err), diff --git a/internal/api/auth.go b/internal/api/auth.go index 2f4cef84..051ac454 100644 --- a/internal/api/auth.go +++ b/internal/api/auth.go @@ -5,7 +5,7 @@ import ( "net/http" "github.com/gofiber/fiber/v2" - "github.com/golang-jwt/jwt/v5" + "github.com/golang-jwt/jwt/v4" "go.opentelemetry.io/otel/attribute" "go.uber.org/zap" ) diff --git a/internal/authenticator/auto_authenticator.go b/internal/authenticator/auto_authenticator.go index 9091dd3a..e7a64684 100644 --- a/internal/authenticator/auto_authenticator.go +++ b/internal/authenticator/auto_authenticator.go @@ -5,7 +5,7 @@ import ( "fmt" "net/http" - "github.com/golang-jwt/jwt/v5" + "github.com/golang-jwt/jwt/v4" "gitlab.snapp.ir/dispatching/soteria/internal/config" "gitlab.snapp.ir/dispatching/soteria/internal/topics" "gitlab.snapp.ir/dispatching/soteria/pkg/acl" @@ -19,6 +19,7 @@ type AutoAuthenticator struct { Company string JwtConfig config.Jwt Validator validatorSDK.Client + Parser *jwt.Parser } // Auth check user authentication by checking the user's token @@ -51,7 +52,7 @@ func (a AutoAuthenticator) ACL( var claims jwt.MapClaims - if _, _, err := jwt.NewParser().ParseUnverified(tokenString, &claims); err != nil { + if _, _, err := a.Parser.ParseUnverified(tokenString, &claims); err != nil { return false, ErrInvalidClaims } diff --git a/internal/authenticator/auto_authenticator_test.go b/internal/authenticator/auto_authenticator_test.go index 23957231..4ec6ef44 100644 --- a/internal/authenticator/auto_authenticator_test.go +++ b/internal/authenticator/auto_authenticator_test.go @@ -7,7 +7,7 @@ import ( "testing" "time" - "github.com/golang-jwt/jwt/v5" + "github.com/golang-jwt/jwt/v4" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/suite" "gitlab.snapp.ir/dispatching/soteria/internal/authenticator" diff --git a/internal/authenticator/builder.go b/internal/authenticator/builder.go index 50c294ff..775b916e 100644 --- a/internal/authenticator/builder.go +++ b/internal/authenticator/builder.go @@ -3,6 +3,7 @@ package authenticator import ( "fmt" + "github.com/golang-jwt/jwt/v4" "gitlab.snapp.ir/dispatching/soteria/internal/config" "gitlab.snapp.ir/dispatching/soteria/internal/topics" "gitlab.snapp.ir/dispatching/soteria/pkg/acl" @@ -47,6 +48,7 @@ func (b Builder) Authenticators() map[string]Authenticator { ), JwtConfig: vendor.Jwt, Validator: validatorClient, + Parser: jwt.NewParser(), } } else { keys := b.GenerateKeys(vendor.Jwt.SigningMethod, vendor.Keys) @@ -64,6 +66,7 @@ func (b Builder) Authenticators() map[string]Authenticator { b.Logger.Named("topic-manager"), ), JwtConfig: vendor.Jwt, + Parser: jwt.NewParser(jwt.WithValidMethods([]string{vendor.Jwt.SigningMethod})), } } diff --git a/internal/authenticator/key.go b/internal/authenticator/key.go index 1b2de40f..2c920d67 100644 --- a/internal/authenticator/key.go +++ b/internal/authenticator/key.go @@ -4,7 +4,7 @@ import ( "encoding/base64" "strings" - "github.com/golang-jwt/jwt/v5" + "github.com/golang-jwt/jwt/v4" "go.uber.org/zap" ) diff --git a/internal/authenticator/manual_authenticator.go b/internal/authenticator/manual_authenticator.go index 43457685..acfc2401 100644 --- a/internal/authenticator/manual_authenticator.go +++ b/internal/authenticator/manual_authenticator.go @@ -3,7 +3,7 @@ package authenticator import ( "fmt" - "github.com/golang-jwt/jwt/v5" + "github.com/golang-jwt/jwt/v4" "gitlab.snapp.ir/dispatching/soteria/internal/config" "gitlab.snapp.ir/dispatching/soteria/internal/topics" "gitlab.snapp.ir/dispatching/soteria/pkg/acl" @@ -16,16 +16,13 @@ type ManualAuthenticator struct { TopicManager *topics.Manager Company string JwtConfig config.Jwt + Parser *jwt.Parser } // Auth check user authentication by checking the user's token // isSuperuser is a flag that authenticator set it true when credentials is related to a superuser. func (a ManualAuthenticator) Auth(tokenString string) error { - parser := jwt.NewParser( - jwt.WithValidMethods([]string{a.JwtConfig.SigningMethod}), - ) - - _, err := parser.Parse(tokenString, func( + _, err := a.Parser.Parse(tokenString, func( token *jwt.Token, ) (interface{}, error) { claims, ok := token.Claims.(jwt.MapClaims) @@ -60,11 +57,7 @@ func (a ManualAuthenticator) ACL( return false, ErrInvalidAccessType } - parser := jwt.NewParser( - jwt.WithValidMethods([]string{a.JwtConfig.SigningMethod}), - ) - - token, err := parser.Parse(tokenString, func(token *jwt.Token) (interface{}, error) { + token, err := a.Parser.Parse(tokenString, func(token *jwt.Token) (interface{}, error) { claims, ok := token.Claims.(jwt.MapClaims) if !ok { return nil, ErrInvalidClaims diff --git a/internal/authenticator/manual_authenticator_test.go b/internal/authenticator/manual_authenticator_test.go index 69025883..3e22d368 100644 --- a/internal/authenticator/manual_authenticator_test.go +++ b/internal/authenticator/manual_authenticator_test.go @@ -7,7 +7,7 @@ import ( "testing" "time" - "github.com/golang-jwt/jwt/v5" + "github.com/golang-jwt/jwt/v4" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/suite" "gitlab.snapp.ir/dispatching/soteria/internal/authenticator" From 719a1fa39c5bae49b512b6221a0ee5c0eeca41f6 Mon Sep 17 00:00:00 2001 From: Parham Alvani Date: Sun, 20 Aug 2023 00:17:35 -0400 Subject: [PATCH 422/660] feat: update again to v5 but using a shared parser --- go.mod | 2 +- go.sum | 4 ++-- internal/api/acl.go | 2 +- internal/api/auth.go | 2 +- internal/authenticator/auto_authenticator.go | 2 +- internal/authenticator/auto_authenticator_test.go | 2 +- internal/authenticator/builder.go | 2 +- internal/authenticator/key.go | 2 +- internal/authenticator/manual_authenticator.go | 2 +- internal/authenticator/manual_authenticator_test.go | 2 +- 10 files changed, 11 insertions(+), 11 deletions(-) diff --git a/go.mod b/go.mod index ddfcbd5b..6e15a049 100644 --- a/go.mod +++ b/go.mod @@ -6,7 +6,7 @@ require ( github.com/ansrivas/fiberprometheus/v2 v2.6.1 github.com/gofiber/contrib/fiberzap v1.0.2 github.com/gofiber/fiber/v2 v2.48.0 - github.com/golang-jwt/jwt/v4 v4.5.0 + github.com/golang-jwt/jwt/v5 v5.0.0 github.com/knadh/koanf v1.5.0 github.com/speps/go-hashids/v2 v2.0.1 github.com/spf13/cobra v1.7.0 diff --git a/go.sum b/go.sum index ab766cb5..45e6ba50 100644 --- a/go.sum +++ b/go.sum @@ -84,8 +84,8 @@ github.com/gofiber/fiber/v2 v2.48.0 h1:cRVMCb9aUJDsyHxGFLwz/sGzDggdailZZyptU9F9c github.com/gofiber/fiber/v2 v2.48.0/go.mod h1:xqJgfqrc23FJuqGOW6DVgi3HyZEm2Mn9pRqUb2kHSX8= github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q= -github.com/golang-jwt/jwt/v4 v4.5.0 h1:7cYmW1XlMY7h7ii7UhUyChSgS5wUJEnm9uZVTGqOWzg= -github.com/golang-jwt/jwt/v4 v4.5.0/go.mod h1:m21LjoU+eqJr34lmDMbreY2eSTRJ1cv77w39/MY0Ch0= +github.com/golang-jwt/jwt/v5 v5.0.0 h1:1n1XNM9hk7O9mnQoNBGolZvzebBQ7p93ULHRc28XJUE= +github.com/golang-jwt/jwt/v5 v5.0.0/go.mod h1:pqrtFR0X4osieyHYxtmOUWsAWrfe1Q5UVIyoH402zdk= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= diff --git a/internal/api/acl.go b/internal/api/acl.go index 404c26ef..00f51816 100644 --- a/internal/api/acl.go +++ b/internal/api/acl.go @@ -5,7 +5,7 @@ import ( "net/http" "github.com/gofiber/fiber/v2" - "github.com/golang-jwt/jwt/v4" + "github.com/golang-jwt/jwt/v5" "gitlab.snapp.ir/dispatching/soteria/internal/authenticator" "gitlab.snapp.ir/dispatching/soteria/pkg/acl" "go.opentelemetry.io/otel/attribute" diff --git a/internal/api/auth.go b/internal/api/auth.go index 051ac454..2f4cef84 100644 --- a/internal/api/auth.go +++ b/internal/api/auth.go @@ -5,7 +5,7 @@ import ( "net/http" "github.com/gofiber/fiber/v2" - "github.com/golang-jwt/jwt/v4" + "github.com/golang-jwt/jwt/v5" "go.opentelemetry.io/otel/attribute" "go.uber.org/zap" ) diff --git a/internal/authenticator/auto_authenticator.go b/internal/authenticator/auto_authenticator.go index e7a64684..d331b574 100644 --- a/internal/authenticator/auto_authenticator.go +++ b/internal/authenticator/auto_authenticator.go @@ -5,7 +5,7 @@ import ( "fmt" "net/http" - "github.com/golang-jwt/jwt/v4" + "github.com/golang-jwt/jwt/v5" "gitlab.snapp.ir/dispatching/soteria/internal/config" "gitlab.snapp.ir/dispatching/soteria/internal/topics" "gitlab.snapp.ir/dispatching/soteria/pkg/acl" diff --git a/internal/authenticator/auto_authenticator_test.go b/internal/authenticator/auto_authenticator_test.go index 4ec6ef44..23957231 100644 --- a/internal/authenticator/auto_authenticator_test.go +++ b/internal/authenticator/auto_authenticator_test.go @@ -7,7 +7,7 @@ import ( "testing" "time" - "github.com/golang-jwt/jwt/v4" + "github.com/golang-jwt/jwt/v5" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/suite" "gitlab.snapp.ir/dispatching/soteria/internal/authenticator" diff --git a/internal/authenticator/builder.go b/internal/authenticator/builder.go index 775b916e..95c6028d 100644 --- a/internal/authenticator/builder.go +++ b/internal/authenticator/builder.go @@ -3,7 +3,7 @@ package authenticator import ( "fmt" - "github.com/golang-jwt/jwt/v4" + "github.com/golang-jwt/jwt/v5" "gitlab.snapp.ir/dispatching/soteria/internal/config" "gitlab.snapp.ir/dispatching/soteria/internal/topics" "gitlab.snapp.ir/dispatching/soteria/pkg/acl" diff --git a/internal/authenticator/key.go b/internal/authenticator/key.go index 2c920d67..1b2de40f 100644 --- a/internal/authenticator/key.go +++ b/internal/authenticator/key.go @@ -4,7 +4,7 @@ import ( "encoding/base64" "strings" - "github.com/golang-jwt/jwt/v4" + "github.com/golang-jwt/jwt/v5" "go.uber.org/zap" ) diff --git a/internal/authenticator/manual_authenticator.go b/internal/authenticator/manual_authenticator.go index acfc2401..2764da0d 100644 --- a/internal/authenticator/manual_authenticator.go +++ b/internal/authenticator/manual_authenticator.go @@ -3,7 +3,7 @@ package authenticator import ( "fmt" - "github.com/golang-jwt/jwt/v4" + "github.com/golang-jwt/jwt/v5" "gitlab.snapp.ir/dispatching/soteria/internal/config" "gitlab.snapp.ir/dispatching/soteria/internal/topics" "gitlab.snapp.ir/dispatching/soteria/pkg/acl" diff --git a/internal/authenticator/manual_authenticator_test.go b/internal/authenticator/manual_authenticator_test.go index 3e22d368..69025883 100644 --- a/internal/authenticator/manual_authenticator_test.go +++ b/internal/authenticator/manual_authenticator_test.go @@ -7,7 +7,7 @@ import ( "testing" "time" - "github.com/golang-jwt/jwt/v4" + "github.com/golang-jwt/jwt/v5" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/suite" "gitlab.snapp.ir/dispatching/soteria/internal/authenticator" From d5344e98dbbdbbd525f3088fb86e943c365ef904 Mon Sep 17 00:00:00 2001 From: Parham Alvani Date: Sun, 20 Aug 2023 00:17:58 -0400 Subject: [PATCH 423/660] feat: update chart version --- deployments/soteria/Chart.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/deployments/soteria/Chart.yaml b/deployments/soteria/Chart.yaml index d44dd025..0c7fb635 100644 --- a/deployments/soteria/Chart.yaml +++ b/deployments/soteria/Chart.yaml @@ -5,6 +5,6 @@ description: Soteria Helm Chart type: application -version: 7.1.3 +version: 7.1.4 -appVersion: "v7-1-3" +appVersion: "v7-1-4" From a6a31d597696cbf796d1690aecc5bb9c978ea3d0 Mon Sep 17 00:00:00 2001 From: Parham Alvani Date: Sun, 20 Aug 2023 03:00:09 -0400 Subject: [PATCH 424/660] chore: downgrade jwt package --- deployments/soteria/Chart.yaml | 4 ++-- go.mod | 2 +- go.sum | 4 ++-- internal/api/acl.go | 2 +- internal/api/auth.go | 2 +- internal/authenticator/auto_authenticator.go | 2 +- internal/authenticator/auto_authenticator_test.go | 2 +- internal/authenticator/builder.go | 2 +- internal/authenticator/key.go | 2 +- internal/authenticator/manual_authenticator.go | 2 +- internal/authenticator/manual_authenticator_test.go | 2 +- 11 files changed, 13 insertions(+), 13 deletions(-) diff --git a/deployments/soteria/Chart.yaml b/deployments/soteria/Chart.yaml index 0c7fb635..b880cf45 100644 --- a/deployments/soteria/Chart.yaml +++ b/deployments/soteria/Chart.yaml @@ -5,6 +5,6 @@ description: Soteria Helm Chart type: application -version: 7.1.4 +version: 7.1.5 -appVersion: "v7-1-4" +appVersion: "v7-1-5" diff --git a/go.mod b/go.mod index 6e15a049..ddfcbd5b 100644 --- a/go.mod +++ b/go.mod @@ -6,7 +6,7 @@ require ( github.com/ansrivas/fiberprometheus/v2 v2.6.1 github.com/gofiber/contrib/fiberzap v1.0.2 github.com/gofiber/fiber/v2 v2.48.0 - github.com/golang-jwt/jwt/v5 v5.0.0 + github.com/golang-jwt/jwt/v4 v4.5.0 github.com/knadh/koanf v1.5.0 github.com/speps/go-hashids/v2 v2.0.1 github.com/spf13/cobra v1.7.0 diff --git a/go.sum b/go.sum index 45e6ba50..ab766cb5 100644 --- a/go.sum +++ b/go.sum @@ -84,8 +84,8 @@ github.com/gofiber/fiber/v2 v2.48.0 h1:cRVMCb9aUJDsyHxGFLwz/sGzDggdailZZyptU9F9c github.com/gofiber/fiber/v2 v2.48.0/go.mod h1:xqJgfqrc23FJuqGOW6DVgi3HyZEm2Mn9pRqUb2kHSX8= github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q= -github.com/golang-jwt/jwt/v5 v5.0.0 h1:1n1XNM9hk7O9mnQoNBGolZvzebBQ7p93ULHRc28XJUE= -github.com/golang-jwt/jwt/v5 v5.0.0/go.mod h1:pqrtFR0X4osieyHYxtmOUWsAWrfe1Q5UVIyoH402zdk= +github.com/golang-jwt/jwt/v4 v4.5.0 h1:7cYmW1XlMY7h7ii7UhUyChSgS5wUJEnm9uZVTGqOWzg= +github.com/golang-jwt/jwt/v4 v4.5.0/go.mod h1:m21LjoU+eqJr34lmDMbreY2eSTRJ1cv77w39/MY0Ch0= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= diff --git a/internal/api/acl.go b/internal/api/acl.go index 00f51816..404c26ef 100644 --- a/internal/api/acl.go +++ b/internal/api/acl.go @@ -5,7 +5,7 @@ import ( "net/http" "github.com/gofiber/fiber/v2" - "github.com/golang-jwt/jwt/v5" + "github.com/golang-jwt/jwt/v4" "gitlab.snapp.ir/dispatching/soteria/internal/authenticator" "gitlab.snapp.ir/dispatching/soteria/pkg/acl" "go.opentelemetry.io/otel/attribute" diff --git a/internal/api/auth.go b/internal/api/auth.go index 2f4cef84..051ac454 100644 --- a/internal/api/auth.go +++ b/internal/api/auth.go @@ -5,7 +5,7 @@ import ( "net/http" "github.com/gofiber/fiber/v2" - "github.com/golang-jwt/jwt/v5" + "github.com/golang-jwt/jwt/v4" "go.opentelemetry.io/otel/attribute" "go.uber.org/zap" ) diff --git a/internal/authenticator/auto_authenticator.go b/internal/authenticator/auto_authenticator.go index d331b574..e7a64684 100644 --- a/internal/authenticator/auto_authenticator.go +++ b/internal/authenticator/auto_authenticator.go @@ -5,7 +5,7 @@ import ( "fmt" "net/http" - "github.com/golang-jwt/jwt/v5" + "github.com/golang-jwt/jwt/v4" "gitlab.snapp.ir/dispatching/soteria/internal/config" "gitlab.snapp.ir/dispatching/soteria/internal/topics" "gitlab.snapp.ir/dispatching/soteria/pkg/acl" diff --git a/internal/authenticator/auto_authenticator_test.go b/internal/authenticator/auto_authenticator_test.go index 23957231..4ec6ef44 100644 --- a/internal/authenticator/auto_authenticator_test.go +++ b/internal/authenticator/auto_authenticator_test.go @@ -7,7 +7,7 @@ import ( "testing" "time" - "github.com/golang-jwt/jwt/v5" + "github.com/golang-jwt/jwt/v4" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/suite" "gitlab.snapp.ir/dispatching/soteria/internal/authenticator" diff --git a/internal/authenticator/builder.go b/internal/authenticator/builder.go index 95c6028d..775b916e 100644 --- a/internal/authenticator/builder.go +++ b/internal/authenticator/builder.go @@ -3,7 +3,7 @@ package authenticator import ( "fmt" - "github.com/golang-jwt/jwt/v5" + "github.com/golang-jwt/jwt/v4" "gitlab.snapp.ir/dispatching/soteria/internal/config" "gitlab.snapp.ir/dispatching/soteria/internal/topics" "gitlab.snapp.ir/dispatching/soteria/pkg/acl" diff --git a/internal/authenticator/key.go b/internal/authenticator/key.go index 1b2de40f..2c920d67 100644 --- a/internal/authenticator/key.go +++ b/internal/authenticator/key.go @@ -4,7 +4,7 @@ import ( "encoding/base64" "strings" - "github.com/golang-jwt/jwt/v5" + "github.com/golang-jwt/jwt/v4" "go.uber.org/zap" ) diff --git a/internal/authenticator/manual_authenticator.go b/internal/authenticator/manual_authenticator.go index 2764da0d..acfc2401 100644 --- a/internal/authenticator/manual_authenticator.go +++ b/internal/authenticator/manual_authenticator.go @@ -3,7 +3,7 @@ package authenticator import ( "fmt" - "github.com/golang-jwt/jwt/v5" + "github.com/golang-jwt/jwt/v4" "gitlab.snapp.ir/dispatching/soteria/internal/config" "gitlab.snapp.ir/dispatching/soteria/internal/topics" "gitlab.snapp.ir/dispatching/soteria/pkg/acl" diff --git a/internal/authenticator/manual_authenticator_test.go b/internal/authenticator/manual_authenticator_test.go index 69025883..3e22d368 100644 --- a/internal/authenticator/manual_authenticator_test.go +++ b/internal/authenticator/manual_authenticator_test.go @@ -7,7 +7,7 @@ import ( "testing" "time" - "github.com/golang-jwt/jwt/v5" + "github.com/golang-jwt/jwt/v4" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/suite" "gitlab.snapp.ir/dispatching/soteria/internal/authenticator" From 74d6ea958d8d4abfd440802b87a223d55a3c2461 Mon Sep 17 00:00:00 2001 From: Parham Alvani Date: Sun, 20 Aug 2023 04:46:54 -0400 Subject: [PATCH 425/660] chore: revert go version to 1.20 --- .gitlab/ci/templates/compile.gitlab-ci.yml | 2 +- .gitlab/ci/templates/test.gitlab-ci.yml | 2 +- Dockerfile | 6 +++--- go.mod | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.gitlab/ci/templates/compile.gitlab-ci.yml b/.gitlab/ci/templates/compile.gitlab-ci.yml index 52c51388..7d4ece41 100644 --- a/.gitlab/ci/templates/compile.gitlab-ci.yml +++ b/.gitlab/ci/templates/compile.gitlab-ci.yml @@ -1,7 +1,7 @@ --- compile: stage: compile - image: registry.snapp.tech/docker/golang:1.21-alpine + image: registry.snapp.tech/docker/golang:1.20-alpine extends: .easy_ci:go:cache script: - go build -v -o soteria cmd/soteria/soteria.go diff --git a/.gitlab/ci/templates/test.gitlab-ci.yml b/.gitlab/ci/templates/test.gitlab-ci.yml index cebcf9d7..4375eecf 100644 --- a/.gitlab/ci/templates/test.gitlab-ci.yml +++ b/.gitlab/ci/templates/test.gitlab-ci.yml @@ -6,7 +6,7 @@ handolint: extends: .easy-ci:dockerfile:lint test: - image: registry.snapp.tech/docker/golang:1.21-alpine + image: registry.snapp.tech/docker/golang:1.20-alpine stage: test coverage: '/total:\s*\(statements\)\s*([\d.]+)%/' extends: .easy_ci:go:cache diff --git a/Dockerfile b/Dockerfile index ce85503a..ccd0b476 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,8 +1,8 @@ -FROM alpine:3.18 +FROM alpine:3.17 # hadolint ignore=DL3018 -RUN echo "https://repo.snapp.tech/repository/alpine/v3.18/main" > /etc/apk/repositories && \ - echo "https://repo.snapp.tech/repository/alpine/v3.18/community" >> /etc/apk/repositories && \ +RUN echo "https://repo.snapp.tech/repository/alpine/v3.17/main" > /etc/apk/repositories && \ + echo "https://repo.snapp.tech/repository/alpine/v3.17/community" >> /etc/apk/repositories && \ apk --no-cache --update add ca-certificates tzdata && \ mkdir /app diff --git a/go.mod b/go.mod index ddfcbd5b..f0545846 100644 --- a/go.mod +++ b/go.mod @@ -1,6 +1,6 @@ module gitlab.snapp.ir/dispatching/soteria -go 1.21 +go 1.20 require ( github.com/ansrivas/fiberprometheus/v2 v2.6.1 From b0d395e2f44457695cd84ba8153a8203073a4dc3 Mon Sep 17 00:00:00 2001 From: Parham Alvani Date: Sun, 20 Aug 2023 04:47:49 -0400 Subject: [PATCH 426/660] feat: update chart version --- deployments/soteria/Chart.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/deployments/soteria/Chart.yaml b/deployments/soteria/Chart.yaml index b880cf45..34cbd720 100644 --- a/deployments/soteria/Chart.yaml +++ b/deployments/soteria/Chart.yaml @@ -5,6 +5,6 @@ description: Soteria Helm Chart type: application -version: 7.1.5 +version: 7.1.6 -appVersion: "v7-1-5" +appVersion: "v7-1-6" From 45413e1fdfe37d14bf5894ac00efba7035d324d9 Mon Sep 17 00:00:00 2001 From: Parham Alvani Date: Sun, 20 Aug 2023 04:52:08 -0400 Subject: [PATCH 427/660] fix: correct stage name --- .gitlab/ci/templates/chart.gitlab-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitlab/ci/templates/chart.gitlab-ci.yml b/.gitlab/ci/templates/chart.gitlab-ci.yml index 97f02e40..d660bf3c 100644 --- a/.gitlab/ci/templates/chart.gitlab-ci.yml +++ b/.gitlab/ci/templates/chart.gitlab-ci.yml @@ -8,7 +8,7 @@ lint:helm:soteria: - tags when: manual -chart:helm::soteria: +chart:helm:soteria: stage: release extends: .easy_ci:helm:push variables: From ede633ae18181bce854d12c3e401551404a4ce3e Mon Sep 17 00:00:00 2001 From: Parham Alvani Date: Sun, 20 Aug 2023 05:01:48 -0400 Subject: [PATCH 428/660] Revert "chore: revert go version to 1.20" This reverts commit 032d833333c858c8f918dad6e75949b38b6c730a. --- .gitlab/ci/templates/compile.gitlab-ci.yml | 2 +- .gitlab/ci/templates/test.gitlab-ci.yml | 2 +- Dockerfile | 6 +++--- go.mod | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.gitlab/ci/templates/compile.gitlab-ci.yml b/.gitlab/ci/templates/compile.gitlab-ci.yml index 7d4ece41..52c51388 100644 --- a/.gitlab/ci/templates/compile.gitlab-ci.yml +++ b/.gitlab/ci/templates/compile.gitlab-ci.yml @@ -1,7 +1,7 @@ --- compile: stage: compile - image: registry.snapp.tech/docker/golang:1.20-alpine + image: registry.snapp.tech/docker/golang:1.21-alpine extends: .easy_ci:go:cache script: - go build -v -o soteria cmd/soteria/soteria.go diff --git a/.gitlab/ci/templates/test.gitlab-ci.yml b/.gitlab/ci/templates/test.gitlab-ci.yml index 4375eecf..cebcf9d7 100644 --- a/.gitlab/ci/templates/test.gitlab-ci.yml +++ b/.gitlab/ci/templates/test.gitlab-ci.yml @@ -6,7 +6,7 @@ handolint: extends: .easy-ci:dockerfile:lint test: - image: registry.snapp.tech/docker/golang:1.20-alpine + image: registry.snapp.tech/docker/golang:1.21-alpine stage: test coverage: '/total:\s*\(statements\)\s*([\d.]+)%/' extends: .easy_ci:go:cache diff --git a/Dockerfile b/Dockerfile index ccd0b476..ce85503a 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,8 +1,8 @@ -FROM alpine:3.17 +FROM alpine:3.18 # hadolint ignore=DL3018 -RUN echo "https://repo.snapp.tech/repository/alpine/v3.17/main" > /etc/apk/repositories && \ - echo "https://repo.snapp.tech/repository/alpine/v3.17/community" >> /etc/apk/repositories && \ +RUN echo "https://repo.snapp.tech/repository/alpine/v3.18/main" > /etc/apk/repositories && \ + echo "https://repo.snapp.tech/repository/alpine/v3.18/community" >> /etc/apk/repositories && \ apk --no-cache --update add ca-certificates tzdata && \ mkdir /app diff --git a/go.mod b/go.mod index f0545846..ddfcbd5b 100644 --- a/go.mod +++ b/go.mod @@ -1,6 +1,6 @@ module gitlab.snapp.ir/dispatching/soteria -go 1.20 +go 1.21 require ( github.com/ansrivas/fiberprometheus/v2 v2.6.1 From d9921c56e7b5efe2b704c9a72cc6c7fe0c3cb0f8 Mon Sep 17 00:00:00 2001 From: Parham Alvani Date: Sun, 20 Aug 2023 05:02:19 -0400 Subject: [PATCH 429/660] Revert "chore: downgrade jwt package" This reverts commit 981c87c82772377e73686d1cdf3a5d078f3ab067. --- go.mod | 2 +- go.sum | 4 ++-- internal/api/acl.go | 2 +- internal/api/auth.go | 2 +- internal/authenticator/auto_authenticator.go | 2 +- internal/authenticator/auto_authenticator_test.go | 2 +- internal/authenticator/builder.go | 2 +- internal/authenticator/key.go | 2 +- internal/authenticator/manual_authenticator.go | 2 +- internal/authenticator/manual_authenticator_test.go | 2 +- 10 files changed, 11 insertions(+), 11 deletions(-) diff --git a/go.mod b/go.mod index ddfcbd5b..6e15a049 100644 --- a/go.mod +++ b/go.mod @@ -6,7 +6,7 @@ require ( github.com/ansrivas/fiberprometheus/v2 v2.6.1 github.com/gofiber/contrib/fiberzap v1.0.2 github.com/gofiber/fiber/v2 v2.48.0 - github.com/golang-jwt/jwt/v4 v4.5.0 + github.com/golang-jwt/jwt/v5 v5.0.0 github.com/knadh/koanf v1.5.0 github.com/speps/go-hashids/v2 v2.0.1 github.com/spf13/cobra v1.7.0 diff --git a/go.sum b/go.sum index ab766cb5..45e6ba50 100644 --- a/go.sum +++ b/go.sum @@ -84,8 +84,8 @@ github.com/gofiber/fiber/v2 v2.48.0 h1:cRVMCb9aUJDsyHxGFLwz/sGzDggdailZZyptU9F9c github.com/gofiber/fiber/v2 v2.48.0/go.mod h1:xqJgfqrc23FJuqGOW6DVgi3HyZEm2Mn9pRqUb2kHSX8= github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q= -github.com/golang-jwt/jwt/v4 v4.5.0 h1:7cYmW1XlMY7h7ii7UhUyChSgS5wUJEnm9uZVTGqOWzg= -github.com/golang-jwt/jwt/v4 v4.5.0/go.mod h1:m21LjoU+eqJr34lmDMbreY2eSTRJ1cv77w39/MY0Ch0= +github.com/golang-jwt/jwt/v5 v5.0.0 h1:1n1XNM9hk7O9mnQoNBGolZvzebBQ7p93ULHRc28XJUE= +github.com/golang-jwt/jwt/v5 v5.0.0/go.mod h1:pqrtFR0X4osieyHYxtmOUWsAWrfe1Q5UVIyoH402zdk= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= diff --git a/internal/api/acl.go b/internal/api/acl.go index 404c26ef..00f51816 100644 --- a/internal/api/acl.go +++ b/internal/api/acl.go @@ -5,7 +5,7 @@ import ( "net/http" "github.com/gofiber/fiber/v2" - "github.com/golang-jwt/jwt/v4" + "github.com/golang-jwt/jwt/v5" "gitlab.snapp.ir/dispatching/soteria/internal/authenticator" "gitlab.snapp.ir/dispatching/soteria/pkg/acl" "go.opentelemetry.io/otel/attribute" diff --git a/internal/api/auth.go b/internal/api/auth.go index 051ac454..2f4cef84 100644 --- a/internal/api/auth.go +++ b/internal/api/auth.go @@ -5,7 +5,7 @@ import ( "net/http" "github.com/gofiber/fiber/v2" - "github.com/golang-jwt/jwt/v4" + "github.com/golang-jwt/jwt/v5" "go.opentelemetry.io/otel/attribute" "go.uber.org/zap" ) diff --git a/internal/authenticator/auto_authenticator.go b/internal/authenticator/auto_authenticator.go index e7a64684..d331b574 100644 --- a/internal/authenticator/auto_authenticator.go +++ b/internal/authenticator/auto_authenticator.go @@ -5,7 +5,7 @@ import ( "fmt" "net/http" - "github.com/golang-jwt/jwt/v4" + "github.com/golang-jwt/jwt/v5" "gitlab.snapp.ir/dispatching/soteria/internal/config" "gitlab.snapp.ir/dispatching/soteria/internal/topics" "gitlab.snapp.ir/dispatching/soteria/pkg/acl" diff --git a/internal/authenticator/auto_authenticator_test.go b/internal/authenticator/auto_authenticator_test.go index 4ec6ef44..23957231 100644 --- a/internal/authenticator/auto_authenticator_test.go +++ b/internal/authenticator/auto_authenticator_test.go @@ -7,7 +7,7 @@ import ( "testing" "time" - "github.com/golang-jwt/jwt/v4" + "github.com/golang-jwt/jwt/v5" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/suite" "gitlab.snapp.ir/dispatching/soteria/internal/authenticator" diff --git a/internal/authenticator/builder.go b/internal/authenticator/builder.go index 775b916e..95c6028d 100644 --- a/internal/authenticator/builder.go +++ b/internal/authenticator/builder.go @@ -3,7 +3,7 @@ package authenticator import ( "fmt" - "github.com/golang-jwt/jwt/v4" + "github.com/golang-jwt/jwt/v5" "gitlab.snapp.ir/dispatching/soteria/internal/config" "gitlab.snapp.ir/dispatching/soteria/internal/topics" "gitlab.snapp.ir/dispatching/soteria/pkg/acl" diff --git a/internal/authenticator/key.go b/internal/authenticator/key.go index 2c920d67..1b2de40f 100644 --- a/internal/authenticator/key.go +++ b/internal/authenticator/key.go @@ -4,7 +4,7 @@ import ( "encoding/base64" "strings" - "github.com/golang-jwt/jwt/v4" + "github.com/golang-jwt/jwt/v5" "go.uber.org/zap" ) diff --git a/internal/authenticator/manual_authenticator.go b/internal/authenticator/manual_authenticator.go index acfc2401..2764da0d 100644 --- a/internal/authenticator/manual_authenticator.go +++ b/internal/authenticator/manual_authenticator.go @@ -3,7 +3,7 @@ package authenticator import ( "fmt" - "github.com/golang-jwt/jwt/v4" + "github.com/golang-jwt/jwt/v5" "gitlab.snapp.ir/dispatching/soteria/internal/config" "gitlab.snapp.ir/dispatching/soteria/internal/topics" "gitlab.snapp.ir/dispatching/soteria/pkg/acl" diff --git a/internal/authenticator/manual_authenticator_test.go b/internal/authenticator/manual_authenticator_test.go index 3e22d368..69025883 100644 --- a/internal/authenticator/manual_authenticator_test.go +++ b/internal/authenticator/manual_authenticator_test.go @@ -7,7 +7,7 @@ import ( "testing" "time" - "github.com/golang-jwt/jwt/v4" + "github.com/golang-jwt/jwt/v5" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/suite" "gitlab.snapp.ir/dispatching/soteria/internal/authenticator" From 5f1f1df201868bc475a8237534ac2484f53259f2 Mon Sep 17 00:00:00 2001 From: Parham Alvani Date: Sun, 20 Aug 2023 05:10:03 -0400 Subject: [PATCH 430/660] chore: fallback to go 1.19 --- .gitlab/ci/templates/compile.gitlab-ci.yml | 2 +- .gitlab/ci/templates/test.gitlab-ci.yml | 2 +- Dockerfile | 6 +++--- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.gitlab/ci/templates/compile.gitlab-ci.yml b/.gitlab/ci/templates/compile.gitlab-ci.yml index 52c51388..7376e691 100644 --- a/.gitlab/ci/templates/compile.gitlab-ci.yml +++ b/.gitlab/ci/templates/compile.gitlab-ci.yml @@ -1,7 +1,7 @@ --- compile: stage: compile - image: registry.snapp.tech/docker/golang:1.21-alpine + image: registry.snapp.tech/docker/golang:1.19-alpine extends: .easy_ci:go:cache script: - go build -v -o soteria cmd/soteria/soteria.go diff --git a/.gitlab/ci/templates/test.gitlab-ci.yml b/.gitlab/ci/templates/test.gitlab-ci.yml index cebcf9d7..34dafe0e 100644 --- a/.gitlab/ci/templates/test.gitlab-ci.yml +++ b/.gitlab/ci/templates/test.gitlab-ci.yml @@ -6,7 +6,7 @@ handolint: extends: .easy-ci:dockerfile:lint test: - image: registry.snapp.tech/docker/golang:1.21-alpine + image: registry.snapp.tech/docker/golang:1.19-alpine stage: test coverage: '/total:\s*\(statements\)\s*([\d.]+)%/' extends: .easy_ci:go:cache diff --git a/Dockerfile b/Dockerfile index ce85503a..ccd0b476 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,8 +1,8 @@ -FROM alpine:3.18 +FROM alpine:3.17 # hadolint ignore=DL3018 -RUN echo "https://repo.snapp.tech/repository/alpine/v3.18/main" > /etc/apk/repositories && \ - echo "https://repo.snapp.tech/repository/alpine/v3.18/community" >> /etc/apk/repositories && \ +RUN echo "https://repo.snapp.tech/repository/alpine/v3.17/main" > /etc/apk/repositories && \ + echo "https://repo.snapp.tech/repository/alpine/v3.17/community" >> /etc/apk/repositories && \ apk --no-cache --update add ca-certificates tzdata && \ mkdir /app From b0d2310fe81802e067f3d336bfb83d4018c1a715 Mon Sep 17 00:00:00 2001 From: Parham Alvani Date: Sun, 20 Aug 2023 05:10:51 -0400 Subject: [PATCH 431/660] feat: update chart version --- deployments/soteria/Chart.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/deployments/soteria/Chart.yaml b/deployments/soteria/Chart.yaml index 34cbd720..842ce66b 100644 --- a/deployments/soteria/Chart.yaml +++ b/deployments/soteria/Chart.yaml @@ -5,6 +5,6 @@ description: Soteria Helm Chart type: application -version: 7.1.6 +version: 7.1.7 -appVersion: "v7-1-6" +appVersion: "v7-1-7" From fc8a237a9c1059c515e6e2e0ae0901d8b9bef61c Mon Sep 17 00:00:00 2001 From: Parham Alvani Date: Wed, 30 Aug 2023 04:23:27 -0400 Subject: [PATCH 432/660] feat: update soteria sdk --- go.mod | 16 ++++++++-------- go.sum | 16 ++++++++++++++++ 2 files changed, 24 insertions(+), 8 deletions(-) diff --git a/go.mod b/go.mod index 6e15a049..a6ecb33f 100644 --- a/go.mod +++ b/go.mod @@ -5,7 +5,7 @@ go 1.21 require ( github.com/ansrivas/fiberprometheus/v2 v2.6.1 github.com/gofiber/contrib/fiberzap v1.0.2 - github.com/gofiber/fiber/v2 v2.48.0 + github.com/gofiber/fiber/v2 v2.49.0 github.com/golang-jwt/jwt/v5 v5.0.0 github.com/knadh/koanf v1.5.0 github.com/speps/go-hashids/v2 v2.0.1 @@ -13,10 +13,10 @@ require ( github.com/stretchr/testify v1.8.4 github.com/tidwall/pretty v1.2.1 gitlab.snapp.ir/security_regulatory/validator/pkg/sdk v0.2.2 - go.opentelemetry.io/otel v1.16.0 - go.opentelemetry.io/otel/exporters/jaeger v1.16.0 - go.opentelemetry.io/otel/sdk v1.16.0 - go.opentelemetry.io/otel/trace v1.16.0 + go.opentelemetry.io/otel v1.17.0 + go.opentelemetry.io/otel/exporters/jaeger v1.17.0 + go.opentelemetry.io/otel/sdk v1.17.0 + go.opentelemetry.io/otel/trace v1.17.0 go.uber.org/automaxprocs v1.5.3 go.uber.org/zap v1.25.0 ) @@ -32,7 +32,7 @@ require ( github.com/go-logr/stdr v1.2.2 // indirect github.com/gofiber/adaptor/v2 v2.2.1 // indirect github.com/golang/protobuf v1.5.3 // indirect - github.com/google/uuid v1.3.0 // indirect + github.com/google/uuid v1.3.1 // indirect github.com/inconshreveable/mousetrap v1.1.0 // indirect github.com/klauspost/compress v1.16.7 // indirect github.com/mattn/go-colorable v0.1.13 // indirect @@ -50,9 +50,9 @@ require ( github.com/rivo/uniseg v0.4.4 // indirect github.com/spf13/pflag v1.0.5 // indirect github.com/valyala/bytebufferpool v1.0.0 // indirect - github.com/valyala/fasthttp v1.48.0 // indirect + github.com/valyala/fasthttp v1.49.0 // indirect github.com/valyala/tcplisten v1.0.0 // indirect - go.opentelemetry.io/otel/metric v1.16.0 // indirect + go.opentelemetry.io/otel/metric v1.17.0 // indirect go.uber.org/multierr v1.11.0 // indirect golang.org/x/sys v0.11.0 // indirect google.golang.org/protobuf v1.31.0 // indirect diff --git a/go.sum b/go.sum index 45e6ba50..cc543a5d 100644 --- a/go.sum +++ b/go.sum @@ -82,6 +82,8 @@ github.com/gofiber/contrib/fiberzap v1.0.2 h1:EQwhggtszVfIdBeXxN9Xrmld71es34Ufs+ github.com/gofiber/contrib/fiberzap v1.0.2/go.mod h1:jGO8BHU4gRI9U0JtM6zj2CIhYfgVmW5JxziN8NTgVwE= github.com/gofiber/fiber/v2 v2.48.0 h1:cRVMCb9aUJDsyHxGFLwz/sGzDggdailZZyptU9F9cU0= github.com/gofiber/fiber/v2 v2.48.0/go.mod h1:xqJgfqrc23FJuqGOW6DVgi3HyZEm2Mn9pRqUb2kHSX8= +github.com/gofiber/fiber/v2 v2.49.0 h1:xBVG2c66GDcWfww56xHvMn52Q0XX7UrSvjj6MD8/5EE= +github.com/gofiber/fiber/v2 v2.49.0/go.mod h1:oxpt7wQaEYgdDmq7nMxCGhilYicBLFnZ+jQSJcQDlSE= github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q= github.com/golang-jwt/jwt/v5 v5.0.0 h1:1n1XNM9hk7O9mnQoNBGolZvzebBQ7p93ULHRc28XJUE= @@ -121,6 +123,8 @@ github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/ github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.3.0 h1:t6JiXgmwXMjEs8VusXIJk2BXHsn+wx8BZdTaoZ5fu7I= github.com/google/uuid v1.3.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/google/uuid v1.3.1 h1:KjJaJ9iWZ3jOFZIf1Lqf4laDRCasjl0BCmnEGxkdLb4= +github.com/google/uuid v1.3.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0/go.mod h1:8NvIoxWQoOIhqOTXgfV/d3M/q6VIi02HzZEHgUlZvzk= github.com/grpc-ecosystem/grpc-gateway v1.16.0/go.mod h1:BDjrQk3hbvj6Nolgz8mAMFbcEtjT1g+wF4CSlocrBnw= github.com/hashicorp/consul/api v1.13.0/go.mod h1:ZlVrynguJKcYr54zGaDbaL3fOvKC9m72FhPvA8T35KQ= @@ -307,6 +311,8 @@ github.com/valyala/bytebufferpool v1.0.0 h1:GqA5TC/0021Y/b9FG4Oi9Mr3q7XYx6Kllzaw github.com/valyala/bytebufferpool v1.0.0/go.mod h1:6bBcMArwyJ5K/AmCkWv1jt77kVWyCJ6HpOuEn7z0Csc= github.com/valyala/fasthttp v1.48.0 h1:oJWvHb9BIZToTQS3MuQ2R3bJZiNSa2KiNdeI8A+79Tc= github.com/valyala/fasthttp v1.48.0/go.mod h1:k2zXd82h/7UZc3VOdJ2WaUqt1uZ/XpXAfE9i+HBC3lA= +github.com/valyala/fasthttp v1.49.0 h1:9FdvCpmxB74LH4dPb7IJ1cOSsluR07XG3I1txXWwJpE= +github.com/valyala/fasthttp v1.49.0/go.mod h1:k2zXd82h/7UZc3VOdJ2WaUqt1uZ/XpXAfE9i+HBC3lA= github.com/valyala/tcplisten v1.0.0 h1:rBHj/Xf+E1tRGZyWIWwJDiRY0zc1Js+CV5DqwacVSA8= github.com/valyala/tcplisten v1.0.0/go.mod h1:T0xQ8SeCZGxckz9qRXTfG43PvQ/mcWh7FwZEA7Ioqkc= github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= @@ -319,14 +325,24 @@ go.etcd.io/etcd/client/pkg/v3 v3.5.4/go.mod h1:IJHfcCEKxYu1Os13ZdwCwIUTUVGYTSAM3 go.etcd.io/etcd/client/v3 v3.5.4/go.mod h1:ZaRkVgBZC+L+dLCjTcF1hRXpgZXQPOvnA/Ak/gq3kiY= go.opentelemetry.io/otel v1.16.0 h1:Z7GVAX/UkAXPKsy94IU+i6thsQS4nb7LviLpnaNeW8s= go.opentelemetry.io/otel v1.16.0/go.mod h1:vl0h9NUa1D5s1nv3A5vZOYWn8av4K8Ml6JDeHrT/bx4= +go.opentelemetry.io/otel v1.17.0 h1:MW+phZ6WZ5/uk2nd93ANk/6yJ+dVrvNWUjGhnnFU5jM= +go.opentelemetry.io/otel v1.17.0/go.mod h1:I2vmBGtFaODIVMBSTPVDlJSzBDNf93k60E6Ft0nyjo0= go.opentelemetry.io/otel/exporters/jaeger v1.16.0 h1:YhxxmXZ011C0aDZKoNw+juVWAmEfv/0W2XBOv9aHTaA= go.opentelemetry.io/otel/exporters/jaeger v1.16.0/go.mod h1:grYbBo/5afWlPpdPZYhyn78Bk04hnvxn2+hvxQhKIQM= +go.opentelemetry.io/otel/exporters/jaeger v1.17.0 h1:D7UpUy2Xc2wsi1Ras6V40q806WM07rqoCWzXu7Sqy+4= +go.opentelemetry.io/otel/exporters/jaeger v1.17.0/go.mod h1:nPCqOnEH9rNLKqH/+rrUjiMzHJdV1BlpKcTwRTyKkKI= go.opentelemetry.io/otel/metric v1.16.0 h1:RbrpwVG1Hfv85LgnZ7+txXioPDoh6EdbZHo26Q3hqOo= go.opentelemetry.io/otel/metric v1.16.0/go.mod h1:QE47cpOmkwipPiefDwo2wDzwJrlfxxNYodqc4xnGCo4= +go.opentelemetry.io/otel/metric v1.17.0 h1:iG6LGVz5Gh+IuO0jmgvpTB6YVrCGngi8QGm+pMd8Pdc= +go.opentelemetry.io/otel/metric v1.17.0/go.mod h1:h4skoxdZI17AxwITdmdZjjYJQH5nzijUUjm+wtPph5o= go.opentelemetry.io/otel/sdk v1.16.0 h1:Z1Ok1YsijYL0CSJpHt4cS3wDDh7p572grzNrBMiMWgE= go.opentelemetry.io/otel/sdk v1.16.0/go.mod h1:tMsIuKXuuIWPBAOrH+eHtvhTL+SntFtXF9QD68aP6p4= +go.opentelemetry.io/otel/sdk v1.17.0 h1:FLN2X66Ke/k5Sg3V623Q7h7nt3cHXaW1FOvKKrW0IpE= +go.opentelemetry.io/otel/sdk v1.17.0/go.mod h1:U87sE0f5vQB7hwUoW98pW5Rz4ZDuCFBZFNUBlSgmDFQ= go.opentelemetry.io/otel/trace v1.16.0 h1:8JRpaObFoW0pxuVPapkgH8UhHQj+bJW8jJsCZEu5MQs= go.opentelemetry.io/otel/trace v1.16.0/go.mod h1:Yt9vYq1SdNz3xdjZZK7wcXv1qv2pwLkqr2QVwea0ef0= +go.opentelemetry.io/otel/trace v1.17.0 h1:/SWhSRHmDPOImIAetP1QAeMnZYiQXrTy4fMMYOdSKWQ= +go.opentelemetry.io/otel/trace v1.17.0/go.mod h1:I/4vKTgFclIsXRVucpH25X0mpFSczM7aHeaz0ZBLWjY= go.uber.org/atomic v1.7.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc= go.uber.org/automaxprocs v1.5.3 h1:kWazyxZUrS3Gs4qUpbwo5kEIMGe/DAvi5Z4tl2NW4j8= go.uber.org/automaxprocs v1.5.3/go.mod h1:eRbA25aqJrxAbsLO0xy5jVwPt7FQnRgjW+efnwa1WM0= From 517faf4b7e3b231522997a8df655a6bc8ca7ffa1 Mon Sep 17 00:00:00 2001 From: Parham Alvani Date: Wed, 30 Aug 2023 05:07:05 -0400 Subject: [PATCH 433/660] feat: update chart version --- deployments/soteria/Chart.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/deployments/soteria/Chart.yaml b/deployments/soteria/Chart.yaml index 842ce66b..45648a57 100644 --- a/deployments/soteria/Chart.yaml +++ b/deployments/soteria/Chart.yaml @@ -5,6 +5,6 @@ description: Soteria Helm Chart type: application -version: 7.1.7 +version: 7.1.8 -appVersion: "v7-1-7" +appVersion: "v7-1-8" From 18e20c28d9837447dcddc779b6c1505bd96a30d2 Mon Sep 17 00:00:00 2001 From: Parham Alvani Date: Sat, 2 Sep 2023 10:26:20 +0000 Subject: [PATCH 434/660] chore: ignore deprecation warning until cloud supports it. --- internal/tracing/tracer.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/tracing/tracer.go b/internal/tracing/tracer.go index d1058ed3..221a6159 100644 --- a/internal/tracing/tracer.go +++ b/internal/tracing/tracer.go @@ -2,7 +2,7 @@ package tracing import ( "go.opentelemetry.io/otel" - "go.opentelemetry.io/otel/exporters/jaeger" + "go.opentelemetry.io/otel/exporters/jaeger" // nolint: staticcheck "go.opentelemetry.io/otel/propagation" "go.opentelemetry.io/otel/sdk/resource" sdktrace "go.opentelemetry.io/otel/sdk/trace" From 8ffc0c9d61e7f425ddc845ec598209784b31976c Mon Sep 17 00:00:00 2001 From: Parham Alvani Date: Sat, 23 Sep 2023 20:11:31 +0000 Subject: [PATCH 435/660] feat: add new handler for new version of emqx --- README.md | 90 +++++++++++++++++++--------------- internal/api/acl.go | 113 ++++++++++++++++++++++++++++++++++++++++++- internal/api/api.go | 7 ++- internal/api/auth.go | 83 +++++++++++++++++++++++++++++-- 4 files changed, 246 insertions(+), 47 deletions(-) diff --git a/README.md b/README.md index 230be076..c8dddd6a 100644 --- a/README.md +++ b/README.md @@ -1,58 +1,72 @@ # Soteria -Soteria is responsible for Authentication and Authorization of every request sent to EMQ. - -# Description Details - -We are using the http_auth plugin of EMQ for forwarding these requests to Soteria. - -EMQX has caching mechanism but it sends requests almost for each Publish message to Soteria. - -(PS: On Subscribe we have only one message from client that need authorization and other messages are coming from server. - -# Deployment +## Introduction -## Staging - -You can deploy `soteria` to the staging environments using -helm charts. +Soteria is responsible for Authentication and Authorization of every request sent to EMQ. -```bash -cd deployments/soteria -helm install soteria . +```hocon +{ + mechanism = password_based + backend = http + enable = true + + method = post + url = "http://127.0.0.1:8080/v2/auth" + body { + username = "${username}" + password = "${password}" + token = "${username}" + clientid = "${clientid}" + } + headers { + "Content-Type" = "application/json" + "X-Request-Source" = "EMQX" + } +} ``` -## Production +```hocon +{ + type = http + enable = true + + method = post + url = "http://127.0.0.1:32333/v2/acl" + body { + username = "${username}" + topic = "${topic}" + action = "${action}" + } + headers { + "Content-Type" = "application/json" + "X-Request-Source" = "EMQX" + } +} -We deploy `soteria` on `Cloud (okd)` infrastructures. +``` -### Cloud (okd) +We are using the [Authentication HTTP Service](https://www.emqx.io/docs/en/v5.2/access-control/authn/http.html) +and [Authorization HTTP Service](https://www.emqx.io/docs/en/v5.2/access-control/authn/http.html) +plugins of EMQ for forwarding these requests to Soteria and doing Authentication and Authorization. +EMQX has caching mechanism, but it sends requests almost for each Publish message to Soteria. +PS: On Subscribe we have only one message from client that need authorization and other messages are coming from server. -[dispatching/ignite](https://gitlab.snapp.ir/dispatching/ignite) is responsible -for production deployments on Cloud (okd). +## Deployment -# Add Vendor +### Add Vendor -Soteria is a multivendor authenticator for EMQX. Follow instruction from [here](docs/vendor.md) +Soteria is a multivendor authenticator for EMQX. +Follow instruction from [here](docs/vendor.md) -# Generate JWT Token +### Generate JWT Token -Replace `driver` and `0` for issuer and ID respectively. +For testing Soteria on staging (I mean ODE) you can use the following +`curl`, just replace `driver` and `0` for issuer and ID respectively. ```bash curl -s -u 'admin:admin' -L https://doago-snapp-ode-020.apps.private.teh-1.snappcloud.io/api/snapp/driver/0 | jq '.Token' -r ``` -# Architecure +### Architecure ![architectureOfSoteria](docs/arch.png) - -# Folder Structure - -- `.api`: API documentation like swagger files -- `.gitlab`: Gitlab CI templates -- `.okd`: OpenShift deployment configs (no longer is use. please use Helm charts) -- `deployments`: Helm Charts -- `internal`: Main application directory for codes -- `pkg`: Go packages that their logic is independent of this project and can become handy in other projects as well. -- `test`: test data like jwt keys diff --git a/internal/api/acl.go b/internal/api/acl.go index 00f51816..a2b4826e 100644 --- a/internal/api/acl.go +++ b/internal/api/acl.go @@ -12,6 +12,10 @@ import ( "go.uber.org/zap" ) +type aclResponse struct { + Result string `json:"result,omitempty"` +} + // aclRequest is the body payload structure of the ACL endpoint. type aclRequest struct { Access acl.AccessType `form:"access"` @@ -23,8 +27,8 @@ type aclRequest struct { // ACL is the handler responsible for ACL requests. // nolint: wrapcheck, funlen -func (a API) ACL(c *fiber.Ctx) error { - _, span := a.Tracer.Start(c.Context(), "api.acl") +func (a API) ACLv1(c *fiber.Ctx) error { + _, span := a.Tracer.Start(c.Context(), "api.v1.acl") defer span.End() request := new(aclRequest) @@ -101,3 +105,108 @@ func (a API) ACL(c *fiber.Ctx) error { return c.Status(http.StatusOK).SendString("ok") } + +// aclRequest is the body payload structure of the ACL endpoint. +type aclv2Request struct { + Token string `json:"token"` + Username string `json:"username"` + Password string `json:"password"` + Topic string `json:"topic"` + Action string `json:"action"` +} + +// ACL is the handler responsible for ACL requests. +// nolint: wrapcheck, funlen +func (a API) ACLv2(c *fiber.Ctx) error { + _, span := a.Tracer.Start(c.Context(), "api.v2.acl") + defer span.End() + + request := new(aclv2Request) + if err := c.BodyParser(request); err != nil { + a.Logger. + Warn("acl bad request", + zap.Error(err), + zap.String("access", request.Action), + zap.String("topic", request.Topic), + zap.String("token", request.Token), + zap.String("username", request.Username), + zap.String("password", request.Password), + ) + + return c.Status(http.StatusBadRequest).JSON(aclResponse{ + Result: "deny", + }) + } + + vendor, token := ExtractVendorToken(request.Token, request.Username, request.Password) + + topic := request.Topic + auth := a.Authenticator(vendor) + + span.SetAttributes( + attribute.String("access", request.Action), + attribute.String("topic", request.Topic), + attribute.String("token", request.Token), + attribute.String("username", request.Username), + attribute.String("password", request.Password), + attribute.String("authenticator", auth.GetCompany()), + ) + + var access acl.AccessType + + switch request.Action { + case "publish": + access = acl.Pub + case "subscribe": + access = acl.Sub + } + + ok, err := auth.ACL(access, token, topic) + if err != nil || !ok { + if err != nil { + span.RecordError(err) + } + + var tnaErr authenticator.TopicNotAllowedError + + if errors.As(err, &tnaErr) { + a.Logger. + Warn("acl request is not authorized", + zap.Error(tnaErr), + zap.String("access", request.Action), + zap.String("topic", request.Topic), + zap.String("token", request.Token), + zap.String("username", request.Username), + zap.String("password", request.Password), + zap.String("authenticator", auth.GetCompany())) + } else if !errors.Is(err, jwt.ErrTokenExpired) { + a.Logger. + Error("acl request is not authorized", + zap.Error(err), + zap.String("access", request.Action), + zap.String("topic", request.Topic), + zap.String("token", request.Token), + zap.String("username", request.Username), + zap.String("password", request.Password), + zap.String("authenticator", auth.GetCompany())) + } + + return c.Status(http.StatusUnauthorized).JSON(aclResponse{ + Result: "deny", + }) + } + + a.Logger. + Info("acl ok", + zap.String("access", request.Action), + zap.String("topic", request.Topic), + zap.String("token", request.Token), + zap.String("username", request.Username), + zap.String("password", request.Password), + zap.String("authenticator", auth.GetCompany()), + ) + + return c.Status(http.StatusOK).JSON(aclResponse{ + Result: "allow", + }) +} diff --git a/internal/api/api.go b/internal/api/api.go index d3cb2ae1..f5c5b621 100644 --- a/internal/api/api.go +++ b/internal/api/api.go @@ -41,8 +41,11 @@ func (a API) ReSTServer() *fiber.App { prometheus.RegisterAt(app, "/metrics") app.Use(prometheus.Middleware) - app.Post("/auth", a.Auth) - app.Post("/acl", a.ACL) + app.Post("/auth", a.Authv1) + app.Post("/acl", a.ACLv1) + + app.Post("/v2/auth", a.Authv2) + app.Post("/v2/acl", a.ACLv2) return app } diff --git a/internal/api/auth.go b/internal/api/auth.go index 2f4cef84..bee6da01 100644 --- a/internal/api/auth.go +++ b/internal/api/auth.go @@ -12,15 +12,20 @@ import ( // authRequest is the body payload structure of the auth endpoint. type authRequest struct { - Token string `form:"token"` - Username string `from:"username"` - Password string `form:"password"` + Token string `form:"token" json:"token,omitempty"` + Username string `from:"username" json:"username,omitempty"` + Password string `form:"password" json:"password,omitempty"` +} + +type authResponse struct { + Result string `json:"result,omitempty"` + IsSuperuser bool `json:"is_superuser,omitempty"` } // Auth is the handler responsible for authentication. // nolint: wrapcheck -func (a API) Auth(c *fiber.Ctx) error { - _, span := a.Tracer.Start(c.Context(), "api.auth") +func (a API) Authv1(c *fiber.Ctx) error { + _, span := a.Tracer.Start(c.Context(), "api.v1.auth") defer span.End() request := new(authRequest) @@ -74,3 +79,71 @@ func (a API) Auth(c *fiber.Ctx) error { return c.Status(http.StatusOK).SendString("ok") } + +// Auth is the handler responsible for authentication. +// Endpoint will be used by EMQ version 5 which supports JSON on both request and response. +// nolint: wrapcheck, funlen +func (a API) Authv2(c *fiber.Ctx) error { + _, span := a.Tracer.Start(c.Context(), "api.v2.auth") + defer span.End() + + request := new(authRequest) + + if err := c.BodyParser(request); err != nil { + span.RecordError(err) + + a.Logger. + Warn("bad request", + zap.Error(err), + ) + + return c.Status(http.StatusBadRequest).JSON(authResponse{ + Result: "deny", + IsSuperuser: false, + }) + } + + vendor, token := ExtractVendorToken(request.Token, request.Username, request.Password) + + authenticator := a.Authenticator(vendor) + + span.SetAttributes( + attribute.String("token", request.Token), + attribute.String("username", request.Username), + attribute.String("password", request.Password), + attribute.String("authenticator", authenticator.GetCompany()), + ) + + if err := authenticator.Auth(token); err != nil { + span.RecordError(err) + + if !errors.Is(err, jwt.ErrTokenExpired) { + a.Logger. + Error("auth request is not authorized", + zap.Error(err), + zap.String("token", request.Token), + zap.String("username", request.Username), + zap.String("password", request.Password), + zap.String("authenticator", authenticator.GetCompany()), + ) + } + + return c.Status(http.StatusUnauthorized).JSON(authResponse{ + Result: "deny", + IsSuperuser: false, + }) + } + + a.Logger. + Info("auth ok", + zap.String("token", request.Token), + zap.String("username", request.Username), + zap.String("password", request.Password), + zap.String("authenticator", authenticator.GetCompany()), + ) + + return c.Status(http.StatusOK).JSON(authResponse{ + Result: "allow", + IsSuperuser: false, + }) +} From 4b2e5879f5543fda51d78d984bbfba22f74ac6f7 Mon Sep 17 00:00:00 2001 From: Parham Alvani Date: Sat, 23 Sep 2023 20:15:14 +0000 Subject: [PATCH 436/660] feat: update readme --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index c8dddd6a..d385bef2 100644 --- a/README.md +++ b/README.md @@ -3,6 +3,8 @@ ## Introduction Soteria is responsible for Authentication and Authorization of every request sent to EMQ. +The following configuration in [HOCON](https://github.com/lightbend/config/blob/master/HOCON.md) +format, configure EMQX to use HTTP Service for Authentication and Authorization. ```hocon { From 445f1946d9dc301b1dc6ff371133ea0a16fa6312 Mon Sep 17 00:00:00 2001 From: Parham Alvani Date: Sat, 23 Sep 2023 20:29:13 +0000 Subject: [PATCH 437/660] feat: update golangci configuration --- .golangci.yml | 26 +++++++++++++++++++++++--- 1 file changed, 23 insertions(+), 3 deletions(-) diff --git a/.golangci.yml b/.golangci.yml index b289d4a7..bead5895 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -2,17 +2,37 @@ linters: enable-all: true disable: + - depguard # we don't use json with camel-case - tagliatelle + - nolintlint # it should improve to support more known patterns - varnamelen - ireturn - - musttag - - depguard # deprecated linters - maligned - scopelint - golint + - ifshort - interfacer - exhaustivestruct - - nolintlint + - nosnakecase + - varcheck + - deadcode + - structcheck + +linters-settings: + wrapcheck: + ignoreSigs: + - .JSON + - .NewHTTPError + - .Redirect + - .NoContent + - .Errorf( + - errors.New( + - errors.Unwrap( + - .Wrap( + - .Wrapf( + - .WithMessage( + - .WithMessagef( + - .WithStack( From 298c7accbce5895b8d52e5e6d385db18f83d7ccd Mon Sep 17 00:00:00 2001 From: Parham Alvani Date: Sat, 23 Sep 2023 20:36:18 +0000 Subject: [PATCH 438/660] fix: correct lint issues --- internal/config/config.go | 40 +++++++++++++++++++------------------- internal/logger/logger.go | 2 +- internal/tracing/config.go | 10 +++++----- 3 files changed, 26 insertions(+), 26 deletions(-) diff --git a/internal/config/config.go b/internal/config/config.go index 9a4c4eb4..e3e8772a 100644 --- a/internal/config/config.go +++ b/internal/config/config.go @@ -25,37 +25,37 @@ const ( type ( // Config is the main container of Soteria's config. Config struct { - Vendors []Vendor `koanf:"vendors"` - Logger logger.Config `koanf:"logger"` - HTTPPort int `koanf:"http_port"` - Tracer tracing.Config `koanf:"tracer"` - DefaultVendor string `koanf:"default_vendor"` - Validator Validator `koanf:"validator"` + Vendors []Vendor `json:"vendors,omitempty" koanf:"vendors"` + Logger logger.Config `json:"logger,omitempty" koanf:"logger"` + HTTPPort int `json:"http_port,omitempty" koanf:"http_port"` + Tracer tracing.Config `json:"tracer,omitempty" koanf:"tracer"` + DefaultVendor string `json:"default_vendor,omitempty" koanf:"default_vendor"` + Validator Validator `json:"validator,omitempty" koanf:"validator"` } Vendor struct { - AllowedAccessTypes []string `koanf:"allowed_access_types"` - Company string `koanf:"company"` - Topics []topics.Topic `koanf:"topics"` - Keys map[string]string `koanf:"keys"` - IssEntityMap map[string]string `koanf:"iss_entity_map"` - IssPeerMap map[string]string `koanf:"iss_peer_map"` - Jwt Jwt `koanf:"jwt"` + AllowedAccessTypes []string `json:"allowed_access_types,omitempty" koanf:"allowed_access_types"` + Company string `json:"company,omitempty" koanf:"company"` + Topics []topics.Topic `json:"topics,omitempty" koanf:"topics"` + Keys map[string]string `json:"keys,omitempty" koanf:"keys"` + IssEntityMap map[string]string `json:"iss_entity_map,omitempty" koanf:"iss_entity_map"` + IssPeerMap map[string]string `json:"iss_peer_map,omitempty" koanf:"iss_peer_map"` + Jwt Jwt `json:"jwt,omitempty" koanf:"jwt"` // by setting do validate to false we don't validate the jwt token and deligate // it into a function. - UseValidator bool `koanf:"use_validator"` - HashIDMap map[string]topics.HashData `koanf:"hashid_map"` + UseValidator bool `json:"use_validator,omitempty" koanf:"use_validator"` + HashIDMap map[string]topics.HashData `json:"hash_id_map,omitempty" koanf:"hashid_map"` } Jwt struct { - IssName string `koanf:"iss_name"` - SubName string `koanf:"sub_name"` - SigningMethod string `koanf:"signing_method"` + IssName string `json:"iss_name,omitempty" koanf:"iss_name"` + SubName string `json:"sub_name,omitempty" koanf:"sub_name"` + SigningMethod string `json:"signing_method,omitempty" koanf:"signing_method"` } Validator struct { - URL string `koanf:"url"` - Timeout time.Duration `koanf:"timeout"` + URL string `json:"url,omitempty" koanf:"url"` + Timeout time.Duration `json:"timeout,omitempty" koanf:"timeout"` } ) diff --git a/internal/logger/logger.go b/internal/logger/logger.go index 9dbe6195..adca4007 100644 --- a/internal/logger/logger.go +++ b/internal/logger/logger.go @@ -9,7 +9,7 @@ import ( ) type Config struct { - Level string `koanf:"level"` + Level string `json:"level,omitempty" koanf:"level"` } // New creates a zap logger for console. diff --git a/internal/tracing/config.go b/internal/tracing/config.go index a6f1a472..041ebcb2 100644 --- a/internal/tracing/config.go +++ b/internal/tracing/config.go @@ -1,12 +1,12 @@ package tracing type Config struct { - Enabled bool `koanf:"enabled"` - Agent `koanf:"agent"` - Ratio float64 `koanf:"ratio"` + Enabled bool `json:"enabled,omitempty" koanf:"enabled"` + Agent `json:"agent,omitempty" koanf:"agent"` + Ratio float64 `json:"ratio,omitempty" koanf:"ratio"` } type Agent struct { - Host string `koanf:"host"` - Port string `koanf:"port"` + Host string `json:"host,omitempty" koanf:"host"` + Port string `json:"port,omitempty" koanf:"port"` } From 730eec0e7b12b226f4b11fa4217d38bd928054a1 Mon Sep 17 00:00:00 2001 From: Parham Alvani Date: Mon, 16 Oct 2023 09:53:05 +0000 Subject: [PATCH 439/660] feat: update default helm configuration --- deployments/soteria/values.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/deployments/soteria/values.yaml b/deployments/soteria/values.yaml index 1700b3d2..ad1bbd91 100644 --- a/deployments/soteria/values.yaml +++ b/deployments/soteria/values.yaml @@ -9,8 +9,8 @@ labels: createdby: dispatching-team image: - registry: docker-registry.default.svc:5000 - repository: realtime-staging/soteria + registry: image-registry.apps.private.okd4.teh-1.snappcloud.io + repository: mozart/soteria pullPolicy: Always timezone: Asia/Tehran From fd76e152be1a8912d77c9ef30c28cdc5d83c28e3 Mon Sep 17 00:00:00 2001 From: Parham Alvani Date: Mon, 16 Oct 2023 10:45:40 +0000 Subject: [PATCH 440/660] chore: update registries --- deployments/soteria/values.ode.baly.yaml | 2 +- deployments/soteria/values.ode.snapp.yaml | 2 +- deployments/soteria/values.yaml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/deployments/soteria/values.ode.baly.yaml b/deployments/soteria/values.ode.baly.yaml index 93b37377..072461d8 100644 --- a/deployments/soteria/values.ode.baly.yaml +++ b/deployments/soteria/values.ode.baly.yaml @@ -5,7 +5,7 @@ labels: createdby: mozart image: - registry: image-registry.apps.private.okd4.teh-1.snappcloud.io + registry: image-registry.openshift-image-registry.svc:5000 repository: mozart/soteria tag: main pullPolicy: Always diff --git a/deployments/soteria/values.ode.snapp.yaml b/deployments/soteria/values.ode.snapp.yaml index 1b023d9d..585597a8 100644 --- a/deployments/soteria/values.ode.snapp.yaml +++ b/deployments/soteria/values.ode.snapp.yaml @@ -7,7 +7,7 @@ labels: createdby: mozart image: - registry: image-registry.apps.private.okd4.teh-1.snappcloud.io + registry: image-registry.openshift-image-registry.svc:5000 repository: mozart/soteria tag: main pullPolicy: Always diff --git a/deployments/soteria/values.yaml b/deployments/soteria/values.yaml index ad1bbd91..afd70c4e 100644 --- a/deployments/soteria/values.yaml +++ b/deployments/soteria/values.yaml @@ -9,7 +9,7 @@ labels: createdby: dispatching-team image: - registry: image-registry.apps.private.okd4.teh-1.snappcloud.io + registry: image-registry.openshift-image-registry.svc:5000 repository: mozart/soteria pullPolicy: Always From ca909ce08f34afa9e0d4c312f6ab54acdfb6851e Mon Sep 17 00:00:00 2001 From: Parham Alvani Date: Thu, 19 Oct 2023 10:53:30 +0000 Subject: [PATCH 441/660] Initial commit --- LICENSE | 674 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 674 insertions(+) create mode 100644 LICENSE diff --git a/LICENSE b/LICENSE new file mode 100644 index 00000000..f288702d --- /dev/null +++ b/LICENSE @@ -0,0 +1,674 @@ + GNU GENERAL PUBLIC LICENSE + Version 3, 29 June 2007 + + Copyright (C) 2007 Free Software Foundation, Inc. + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The GNU General Public License is a free, copyleft license for +software and other kinds of works. + + The licenses for most software and other practical works are designed +to take away your freedom to share and change the works. By contrast, +the GNU General Public License is intended to guarantee your freedom to +share and change all versions of a program--to make sure it remains free +software for all its users. We, the Free Software Foundation, use the +GNU General Public License for most of our software; it applies also to +any other work released this way by its authors. You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +them if you wish), that you receive source code or can get it if you +want it, that you can change the software or use pieces of it in new +free programs, and that you know you can do these things. + + To protect your rights, we need to prevent others from denying you +these rights or asking you to surrender the rights. Therefore, you have +certain responsibilities if you distribute copies of the software, or if +you modify it: responsibilities to respect the freedom of others. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must pass on to the recipients the same +freedoms that you received. You must make sure that they, too, receive +or can get the source code. And you must show them these terms so they +know their rights. + + Developers that use the GNU GPL protect your rights with two steps: +(1) assert copyright on the software, and (2) offer you this License +giving you legal permission to copy, distribute and/or modify it. + + For the developers' and authors' protection, the GPL clearly explains +that there is no warranty for this free software. For both users' and +authors' sake, the GPL requires that modified versions be marked as +changed, so that their problems will not be attributed erroneously to +authors of previous versions. + + Some devices are designed to deny users access to install or run +modified versions of the software inside them, although the manufacturer +can do so. This is fundamentally incompatible with the aim of +protecting users' freedom to change the software. The systematic +pattern of such abuse occurs in the area of products for individuals to +use, which is precisely where it is most unacceptable. Therefore, we +have designed this version of the GPL to prohibit the practice for those +products. If such problems arise substantially in other domains, we +stand ready to extend this provision to those domains in future versions +of the GPL, as needed to protect the freedom of users. + + Finally, every program is threatened constantly by software patents. +States should not allow patents to restrict development and use of +software on general-purpose computers, but in those that do, we wish to +avoid the special danger that patents applied to a free program could +make it effectively proprietary. To prevent this, the GPL assures that +patents cannot be used to render the program non-free. + + The precise terms and conditions for copying, distribution and +modification follow. + + TERMS AND CONDITIONS + + 0. Definitions. + + "This License" refers to version 3 of the GNU General Public License. + + "Copyright" also means copyright-like laws that apply to other kinds of +works, such as semiconductor masks. + + "The Program" refers to any copyrightable work licensed under this +License. Each licensee is addressed as "you". "Licensees" and +"recipients" may be individuals or organizations. + + To "modify" a work means to copy from or adapt all or part of the work +in a fashion requiring copyright permission, other than the making of an +exact copy. The resulting work is called a "modified version" of the +earlier work or a work "based on" the earlier work. + + A "covered work" means either the unmodified Program or a work based +on the Program. + + To "propagate" a work means to do anything with it that, without +permission, would make you directly or secondarily liable for +infringement under applicable copyright law, except executing it on a +computer or modifying a private copy. Propagation includes copying, +distribution (with or without modification), making available to the +public, and in some countries other activities as well. + + To "convey" a work means any kind of propagation that enables other +parties to make or receive copies. Mere interaction with a user through +a computer network, with no transfer of a copy, is not conveying. + + An interactive user interface displays "Appropriate Legal Notices" +to the extent that it includes a convenient and prominently visible +feature that (1) displays an appropriate copyright notice, and (2) +tells the user that there is no warranty for the work (except to the +extent that warranties are provided), that licensees may convey the +work under this License, and how to view a copy of this License. If +the interface presents a list of user commands or options, such as a +menu, a prominent item in the list meets this criterion. + + 1. Source Code. + + The "source code" for a work means the preferred form of the work +for making modifications to it. "Object code" means any non-source +form of a work. + + A "Standard Interface" means an interface that either is an official +standard defined by a recognized standards body, or, in the case of +interfaces specified for a particular programming language, one that +is widely used among developers working in that language. + + The "System Libraries" of an executable work include anything, other +than the work as a whole, that (a) is included in the normal form of +packaging a Major Component, but which is not part of that Major +Component, and (b) serves only to enable use of the work with that +Major Component, or to implement a Standard Interface for which an +implementation is available to the public in source code form. A +"Major Component", in this context, means a major essential component +(kernel, window system, and so on) of the specific operating system +(if any) on which the executable work runs, or a compiler used to +produce the work, or an object code interpreter used to run it. + + The "Corresponding Source" for a work in object code form means all +the source code needed to generate, install, and (for an executable +work) run the object code and to modify the work, including scripts to +control those activities. However, it does not include the work's +System Libraries, or general-purpose tools or generally available free +programs which are used unmodified in performing those activities but +which are not part of the work. For example, Corresponding Source +includes interface definition files associated with source files for +the work, and the source code for shared libraries and dynamically +linked subprograms that the work is specifically designed to require, +such as by intimate data communication or control flow between those +subprograms and other parts of the work. + + The Corresponding Source need not include anything that users +can regenerate automatically from other parts of the Corresponding +Source. + + The Corresponding Source for a work in source code form is that +same work. + + 2. Basic Permissions. + + All rights granted under this License are granted for the term of +copyright on the Program, and are irrevocable provided the stated +conditions are met. This License explicitly affirms your unlimited +permission to run the unmodified Program. The output from running a +covered work is covered by this License only if the output, given its +content, constitutes a covered work. This License acknowledges your +rights of fair use or other equivalent, as provided by copyright law. + + You may make, run and propagate covered works that you do not +convey, without conditions so long as your license otherwise remains +in force. You may convey covered works to others for the sole purpose +of having them make modifications exclusively for you, or provide you +with facilities for running those works, provided that you comply with +the terms of this License in conveying all material for which you do +not control copyright. Those thus making or running the covered works +for you must do so exclusively on your behalf, under your direction +and control, on terms that prohibit them from making any copies of +your copyrighted material outside their relationship with you. + + Conveying under any other circumstances is permitted solely under +the conditions stated below. Sublicensing is not allowed; section 10 +makes it unnecessary. + + 3. Protecting Users' Legal Rights From Anti-Circumvention Law. + + No covered work shall be deemed part of an effective technological +measure under any applicable law fulfilling obligations under article +11 of the WIPO copyright treaty adopted on 20 December 1996, or +similar laws prohibiting or restricting circumvention of such +measures. + + When you convey a covered work, you waive any legal power to forbid +circumvention of technological measures to the extent such circumvention +is effected by exercising rights under this License with respect to +the covered work, and you disclaim any intention to limit operation or +modification of the work as a means of enforcing, against the work's +users, your or third parties' legal rights to forbid circumvention of +technological measures. + + 4. Conveying Verbatim Copies. + + You may convey verbatim copies of the Program's source code as you +receive it, in any medium, provided that you conspicuously and +appropriately publish on each copy an appropriate copyright notice; +keep intact all notices stating that this License and any +non-permissive terms added in accord with section 7 apply to the code; +keep intact all notices of the absence of any warranty; and give all +recipients a copy of this License along with the Program. + + You may charge any price or no price for each copy that you convey, +and you may offer support or warranty protection for a fee. + + 5. Conveying Modified Source Versions. + + You may convey a work based on the Program, or the modifications to +produce it from the Program, in the form of source code under the +terms of section 4, provided that you also meet all of these conditions: + + a) The work must carry prominent notices stating that you modified + it, and giving a relevant date. + + b) The work must carry prominent notices stating that it is + released under this License and any conditions added under section + 7. This requirement modifies the requirement in section 4 to + "keep intact all notices". + + c) You must license the entire work, as a whole, under this + License to anyone who comes into possession of a copy. This + License will therefore apply, along with any applicable section 7 + additional terms, to the whole of the work, and all its parts, + regardless of how they are packaged. This License gives no + permission to license the work in any other way, but it does not + invalidate such permission if you have separately received it. + + d) If the work has interactive user interfaces, each must display + Appropriate Legal Notices; however, if the Program has interactive + interfaces that do not display Appropriate Legal Notices, your + work need not make them do so. + + A compilation of a covered work with other separate and independent +works, which are not by their nature extensions of the covered work, +and which are not combined with it such as to form a larger program, +in or on a volume of a storage or distribution medium, is called an +"aggregate" if the compilation and its resulting copyright are not +used to limit the access or legal rights of the compilation's users +beyond what the individual works permit. Inclusion of a covered work +in an aggregate does not cause this License to apply to the other +parts of the aggregate. + + 6. Conveying Non-Source Forms. + + You may convey a covered work in object code form under the terms +of sections 4 and 5, provided that you also convey the +machine-readable Corresponding Source under the terms of this License, +in one of these ways: + + a) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by the + Corresponding Source fixed on a durable physical medium + customarily used for software interchange. + + b) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by a + written offer, valid for at least three years and valid for as + long as you offer spare parts or customer support for that product + model, to give anyone who possesses the object code either (1) a + copy of the Corresponding Source for all the software in the + product that is covered by this License, on a durable physical + medium customarily used for software interchange, for a price no + more than your reasonable cost of physically performing this + conveying of source, or (2) access to copy the + Corresponding Source from a network server at no charge. + + c) Convey individual copies of the object code with a copy of the + written offer to provide the Corresponding Source. This + alternative is allowed only occasionally and noncommercially, and + only if you received the object code with such an offer, in accord + with subsection 6b. + + d) Convey the object code by offering access from a designated + place (gratis or for a charge), and offer equivalent access to the + Corresponding Source in the same way through the same place at no + further charge. You need not require recipients to copy the + Corresponding Source along with the object code. If the place to + copy the object code is a network server, the Corresponding Source + may be on a different server (operated by you or a third party) + that supports equivalent copying facilities, provided you maintain + clear directions next to the object code saying where to find the + Corresponding Source. Regardless of what server hosts the + Corresponding Source, you remain obligated to ensure that it is + available for as long as needed to satisfy these requirements. + + e) Convey the object code using peer-to-peer transmission, provided + you inform other peers where the object code and Corresponding + Source of the work are being offered to the general public at no + charge under subsection 6d. + + A separable portion of the object code, whose source code is excluded +from the Corresponding Source as a System Library, need not be +included in conveying the object code work. + + A "User Product" is either (1) a "consumer product", which means any +tangible personal property which is normally used for personal, family, +or household purposes, or (2) anything designed or sold for incorporation +into a dwelling. In determining whether a product is a consumer product, +doubtful cases shall be resolved in favor of coverage. For a particular +product received by a particular user, "normally used" refers to a +typical or common use of that class of product, regardless of the status +of the particular user or of the way in which the particular user +actually uses, or expects or is expected to use, the product. A product +is a consumer product regardless of whether the product has substantial +commercial, industrial or non-consumer uses, unless such uses represent +the only significant mode of use of the product. + + "Installation Information" for a User Product means any methods, +procedures, authorization keys, or other information required to install +and execute modified versions of a covered work in that User Product from +a modified version of its Corresponding Source. The information must +suffice to ensure that the continued functioning of the modified object +code is in no case prevented or interfered with solely because +modification has been made. + + If you convey an object code work under this section in, or with, or +specifically for use in, a User Product, and the conveying occurs as +part of a transaction in which the right of possession and use of the +User Product is transferred to the recipient in perpetuity or for a +fixed term (regardless of how the transaction is characterized), the +Corresponding Source conveyed under this section must be accompanied +by the Installation Information. But this requirement does not apply +if neither you nor any third party retains the ability to install +modified object code on the User Product (for example, the work has +been installed in ROM). + + The requirement to provide Installation Information does not include a +requirement to continue to provide support service, warranty, or updates +for a work that has been modified or installed by the recipient, or for +the User Product in which it has been modified or installed. Access to a +network may be denied when the modification itself materially and +adversely affects the operation of the network or violates the rules and +protocols for communication across the network. + + Corresponding Source conveyed, and Installation Information provided, +in accord with this section must be in a format that is publicly +documented (and with an implementation available to the public in +source code form), and must require no special password or key for +unpacking, reading or copying. + + 7. Additional Terms. + + "Additional permissions" are terms that supplement the terms of this +License by making exceptions from one or more of its conditions. +Additional permissions that are applicable to the entire Program shall +be treated as though they were included in this License, to the extent +that they are valid under applicable law. If additional permissions +apply only to part of the Program, that part may be used separately +under those permissions, but the entire Program remains governed by +this License without regard to the additional permissions. + + When you convey a copy of a covered work, you may at your option +remove any additional permissions from that copy, or from any part of +it. (Additional permissions may be written to require their own +removal in certain cases when you modify the work.) You may place +additional permissions on material, added by you to a covered work, +for which you have or can give appropriate copyright permission. + + Notwithstanding any other provision of this License, for material you +add to a covered work, you may (if authorized by the copyright holders of +that material) supplement the terms of this License with terms: + + a) Disclaiming warranty or limiting liability differently from the + terms of sections 15 and 16 of this License; or + + b) Requiring preservation of specified reasonable legal notices or + author attributions in that material or in the Appropriate Legal + Notices displayed by works containing it; or + + c) Prohibiting misrepresentation of the origin of that material, or + requiring that modified versions of such material be marked in + reasonable ways as different from the original version; or + + d) Limiting the use for publicity purposes of names of licensors or + authors of the material; or + + e) Declining to grant rights under trademark law for use of some + trade names, trademarks, or service marks; or + + f) Requiring indemnification of licensors and authors of that + material by anyone who conveys the material (or modified versions of + it) with contractual assumptions of liability to the recipient, for + any liability that these contractual assumptions directly impose on + those licensors and authors. + + All other non-permissive additional terms are considered "further +restrictions" within the meaning of section 10. If the Program as you +received it, or any part of it, contains a notice stating that it is +governed by this License along with a term that is a further +restriction, you may remove that term. If a license document contains +a further restriction but permits relicensing or conveying under this +License, you may add to a covered work material governed by the terms +of that license document, provided that the further restriction does +not survive such relicensing or conveying. + + If you add terms to a covered work in accord with this section, you +must place, in the relevant source files, a statement of the +additional terms that apply to those files, or a notice indicating +where to find the applicable terms. + + Additional terms, permissive or non-permissive, may be stated in the +form of a separately written license, or stated as exceptions; +the above requirements apply either way. + + 8. Termination. + + You may not propagate or modify a covered work except as expressly +provided under this License. Any attempt otherwise to propagate or +modify it is void, and will automatically terminate your rights under +this License (including any patent licenses granted under the third +paragraph of section 11). + + However, if you cease all violation of this License, then your +license from a particular copyright holder is reinstated (a) +provisionally, unless and until the copyright holder explicitly and +finally terminates your license, and (b) permanently, if the copyright +holder fails to notify you of the violation by some reasonable means +prior to 60 days after the cessation. + + Moreover, your license from a particular copyright holder is +reinstated permanently if the copyright holder notifies you of the +violation by some reasonable means, this is the first time you have +received notice of violation of this License (for any work) from that +copyright holder, and you cure the violation prior to 30 days after +your receipt of the notice. + + Termination of your rights under this section does not terminate the +licenses of parties who have received copies or rights from you under +this License. If your rights have been terminated and not permanently +reinstated, you do not qualify to receive new licenses for the same +material under section 10. + + 9. Acceptance Not Required for Having Copies. + + You are not required to accept this License in order to receive or +run a copy of the Program. Ancillary propagation of a covered work +occurring solely as a consequence of using peer-to-peer transmission +to receive a copy likewise does not require acceptance. However, +nothing other than this License grants you permission to propagate or +modify any covered work. These actions infringe copyright if you do +not accept this License. Therefore, by modifying or propagating a +covered work, you indicate your acceptance of this License to do so. + + 10. Automatic Licensing of Downstream Recipients. + + Each time you convey a covered work, the recipient automatically +receives a license from the original licensors, to run, modify and +propagate that work, subject to this License. You are not responsible +for enforcing compliance by third parties with this License. + + An "entity transaction" is a transaction transferring control of an +organization, or substantially all assets of one, or subdividing an +organization, or merging organizations. If propagation of a covered +work results from an entity transaction, each party to that +transaction who receives a copy of the work also receives whatever +licenses to the work the party's predecessor in interest had or could +give under the previous paragraph, plus a right to possession of the +Corresponding Source of the work from the predecessor in interest, if +the predecessor has it or can get it with reasonable efforts. + + You may not impose any further restrictions on the exercise of the +rights granted or affirmed under this License. For example, you may +not impose a license fee, royalty, or other charge for exercise of +rights granted under this License, and you may not initiate litigation +(including a cross-claim or counterclaim in a lawsuit) alleging that +any patent claim is infringed by making, using, selling, offering for +sale, or importing the Program or any portion of it. + + 11. Patents. + + A "contributor" is a copyright holder who authorizes use under this +License of the Program or a work on which the Program is based. The +work thus licensed is called the contributor's "contributor version". + + A contributor's "essential patent claims" are all patent claims +owned or controlled by the contributor, whether already acquired or +hereafter acquired, that would be infringed by some manner, permitted +by this License, of making, using, or selling its contributor version, +but do not include claims that would be infringed only as a +consequence of further modification of the contributor version. For +purposes of this definition, "control" includes the right to grant +patent sublicenses in a manner consistent with the requirements of +this License. + + Each contributor grants you a non-exclusive, worldwide, royalty-free +patent license under the contributor's essential patent claims, to +make, use, sell, offer for sale, import and otherwise run, modify and +propagate the contents of its contributor version. + + In the following three paragraphs, a "patent license" is any express +agreement or commitment, however denominated, not to enforce a patent +(such as an express permission to practice a patent or covenant not to +sue for patent infringement). To "grant" such a patent license to a +party means to make such an agreement or commitment not to enforce a +patent against the party. + + If you convey a covered work, knowingly relying on a patent license, +and the Corresponding Source of the work is not available for anyone +to copy, free of charge and under the terms of this License, through a +publicly available network server or other readily accessible means, +then you must either (1) cause the Corresponding Source to be so +available, or (2) arrange to deprive yourself of the benefit of the +patent license for this particular work, or (3) arrange, in a manner +consistent with the requirements of this License, to extend the patent +license to downstream recipients. "Knowingly relying" means you have +actual knowledge that, but for the patent license, your conveying the +covered work in a country, or your recipient's use of the covered work +in a country, would infringe one or more identifiable patents in that +country that you have reason to believe are valid. + + If, pursuant to or in connection with a single transaction or +arrangement, you convey, or propagate by procuring conveyance of, a +covered work, and grant a patent license to some of the parties +receiving the covered work authorizing them to use, propagate, modify +or convey a specific copy of the covered work, then the patent license +you grant is automatically extended to all recipients of the covered +work and works based on it. + + A patent license is "discriminatory" if it does not include within +the scope of its coverage, prohibits the exercise of, or is +conditioned on the non-exercise of one or more of the rights that are +specifically granted under this License. You may not convey a covered +work if you are a party to an arrangement with a third party that is +in the business of distributing software, under which you make payment +to the third party based on the extent of your activity of conveying +the work, and under which the third party grants, to any of the +parties who would receive the covered work from you, a discriminatory +patent license (a) in connection with copies of the covered work +conveyed by you (or copies made from those copies), or (b) primarily +for and in connection with specific products or compilations that +contain the covered work, unless you entered into that arrangement, +or that patent license was granted, prior to 28 March 2007. + + Nothing in this License shall be construed as excluding or limiting +any implied license or other defenses to infringement that may +otherwise be available to you under applicable patent law. + + 12. No Surrender of Others' Freedom. + + If conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot convey a +covered work so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you may +not convey it at all. For example, if you agree to terms that obligate you +to collect a royalty for further conveying from those to whom you convey +the Program, the only way you could satisfy both those terms and this +License would be to refrain entirely from conveying the Program. + + 13. Use with the GNU Affero General Public License. + + Notwithstanding any other provision of this License, you have +permission to link or combine any covered work with a work licensed +under version 3 of the GNU Affero General Public License into a single +combined work, and to convey the resulting work. The terms of this +License will continue to apply to the part which is the covered work, +but the special requirements of the GNU Affero General Public License, +section 13, concerning interaction through a network will apply to the +combination as such. + + 14. Revised Versions of this License. + + The Free Software Foundation may publish revised and/or new versions of +the GNU General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + + Each version is given a distinguishing version number. If the +Program specifies that a certain numbered version of the GNU General +Public License "or any later version" applies to it, you have the +option of following the terms and conditions either of that numbered +version or of any later version published by the Free Software +Foundation. If the Program does not specify a version number of the +GNU General Public License, you may choose any version ever published +by the Free Software Foundation. + + If the Program specifies that a proxy can decide which future +versions of the GNU General Public License can be used, that proxy's +public statement of acceptance of a version permanently authorizes you +to choose that version for the Program. + + Later license versions may give you additional or different +permissions. However, no additional obligations are imposed on any +author or copyright holder as a result of your choosing to follow a +later version. + + 15. Disclaimer of Warranty. + + THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY +APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT +HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY +OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, +THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM +IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF +ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + 16. Limitation of Liability. + + IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS +THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY +GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE +USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF +DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD +PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), +EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF +SUCH DAMAGES. + + 17. Interpretation of Sections 15 and 16. + + If the disclaimer of warranty and limitation of liability provided +above cannot be given local legal effect according to their terms, +reviewing courts shall apply local law that most closely approximates +an absolute waiver of all civil liability in connection with the +Program, unless a warranty or assumption of liability accompanies a +copy of the Program in return for a fee. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +state the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . + +Also add information on how to contact you by electronic and paper mail. + + If the program does terminal interaction, make it output a short +notice like this when it starts in an interactive mode: + + Copyright (C) + This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, your program's commands +might be different; for a GUI interface, you would use an "about box". + + You should also get your employer (if you work as a programmer) or school, +if any, to sign a "copyright disclaimer" for the program, if necessary. +For more information on this, and how to apply and follow the GNU GPL, see +. + + The GNU General Public License does not permit incorporating your program +into proprietary programs. If your program is a subroutine library, you +may consider it more useful to permit linking proprietary applications with +the library. If this is what you want to do, use the GNU Lesser General +Public License instead of this License. But first, please read +. From 03ae7c064a87e3c4da21634faad9f2af8bba7209 Mon Sep 17 00:00:00 2001 From: Parham Alvani Date: Thu, 19 Oct 2023 10:58:18 +0000 Subject: [PATCH 442/660] feat: remove gitlab ci/cd --- .gitlab-ci.yml | 21 ------ .gitlab/ci/templates/build.gitlab-ci.yml | 6 -- .gitlab/ci/templates/chart.gitlab-ci.yml | 21 ------ .gitlab/ci/templates/compile.gitlab-ci.yml | 12 --- .gitlab/ci/templates/release.gitlab-ci.yml | 87 ---------------------- .gitlab/ci/templates/test.gitlab-ci.yml | 17 ----- 6 files changed, 164 deletions(-) delete mode 100644 .gitlab-ci.yml delete mode 100644 .gitlab/ci/templates/build.gitlab-ci.yml delete mode 100644 .gitlab/ci/templates/chart.gitlab-ci.yml delete mode 100644 .gitlab/ci/templates/compile.gitlab-ci.yml delete mode 100644 .gitlab/ci/templates/release.gitlab-ci.yml delete mode 100644 .gitlab/ci/templates/test.gitlab-ci.yml diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml deleted file mode 100644 index 1e05cdde..00000000 --- a/.gitlab-ci.yml +++ /dev/null @@ -1,21 +0,0 @@ ---- -stages: - - lint - - compile - - test - - build - - release - -include: - - local: .gitlab/ci/templates/compile.gitlab-ci.yml - - local: .gitlab/ci/templates/test.gitlab-ci.yml - - local: .gitlab/ci/templates/build.gitlab-ci.yml - - local: .gitlab/ci/templates/release.gitlab-ci.yml - - local: .gitlab/ci/templates/chart.gitlab-ci.yml - - - project: dispatching/igniteg/easy-ci - ref: main - file: "easy-ci.yml" - - - project: templates/gitlab-templates - file: sorush.gitlab-ci.yml diff --git a/.gitlab/ci/templates/build.gitlab-ci.yml b/.gitlab/ci/templates/build.gitlab-ci.yml deleted file mode 100644 index c1b83b2a..00000000 --- a/.gitlab/ci/templates/build.gitlab-ci.yml +++ /dev/null @@ -1,6 +0,0 @@ ---- -build: - extends: .easy_ci:docker:build - dependencies: - - compile - diff --git a/.gitlab/ci/templates/chart.gitlab-ci.yml b/.gitlab/ci/templates/chart.gitlab-ci.yml deleted file mode 100644 index d660bf3c..00000000 --- a/.gitlab/ci/templates/chart.gitlab-ci.yml +++ /dev/null @@ -1,21 +0,0 @@ ---- -lint:helm:soteria: - stage: lint - extends: .easy_ci:helm:lint - variables: - HELM_CHARTS_DIR: "deployments" - only: - - tags - when: manual - -chart:helm:soteria: - stage: release - extends: .easy_ci:helm:push - variables: - HELM_CHARTS_DIR: "deployments" - HELM_REPO_USER: "$DISPATCHING_HELM_REPO_USER" - HELM_REPO_PASS: "$DISPATCHING_HELM_REPO_PASS" - needs: ["lint:helm:soteria"] - only: - - tags - when: manual diff --git a/.gitlab/ci/templates/compile.gitlab-ci.yml b/.gitlab/ci/templates/compile.gitlab-ci.yml deleted file mode 100644 index 7376e691..00000000 --- a/.gitlab/ci/templates/compile.gitlab-ci.yml +++ /dev/null @@ -1,12 +0,0 @@ ---- -compile: - stage: compile - image: registry.snapp.tech/docker/golang:1.19-alpine - extends: .easy_ci:go:cache - script: - - go build -v -o soteria cmd/soteria/soteria.go - artifacts: - name: "${CI_PROJECT_NAME}-${CI_COMMIT_REF_SLUG}" - paths: - - ./soteria - expire_in: 1 week diff --git a/.gitlab/ci/templates/release.gitlab-ci.yml b/.gitlab/ci/templates/release.gitlab-ci.yml deleted file mode 100644 index 81d0b0df..00000000 --- a/.gitlab/ci/templates/release.gitlab-ci.yml +++ /dev/null @@ -1,87 +0,0 @@ ---- -release:staging:teh-1: - extends: .easy_ci:release:docker - variables: - OKD4_TEH1_REGISTRY: "image-registry.apps.private.okd4.teh-1.snappcloud.io" - RELEASE_CONTAINER_REGISTRY_ADDRESS: "$OKD4_TEH1_REGISTRY" - RELEASE_CONTAINER_REGISTRY_IMAGE: "$OKD4_TEH1_REGISTRY/realtime-staging/$CI_PROJECT_NAME" - RELEASE_CONTAINER_REGISTRY_USERNAME: "gitlab-ci" - RELEASE_CONTAINER_REGISTRY_PASSWORD: ${OKD4_TEH1_REALTIME_STAGING_TOKEN} - dependencies: - - build - only: - - tags - - branches - when: manual - -release:staging:teh-2: - extends: .easy_ci:release:docker - variables: - OKD4_TEH2_REGISTRY: "image-registry.apps.private.okd4.teh-2.snappcloud.io" - RELEASE_CONTAINER_REGISTRY_ADDRESS: "$OKD4_TEH2_REGISTRY" - RELEASE_CONTAINER_REGISTRY_IMAGE: "$OKD4_TEH2_REGISTRY/realtime-staging/$CI_PROJECT_NAME" - RELEASE_CONTAINER_REGISTRY_USERNAME: "gitlab-ci" - RELEASE_CONTAINER_REGISTRY_PASSWORD: ${OKD4_TEH2_REALTIME_STAGING_TOKEN} - dependencies: - - build - only: - - tags - - branches - when: manual - -release:mozart: - extends: .easy_ci:release:docker - variables: - OKD4_TEH1_REGISTRY: "image-registry.apps.private.okd4.teh-1.snappcloud.io" - RELEASE_CONTAINER_REGISTRY_ADDRESS: "$OKD4_TEH1_REGISTRY" - RELEASE_CONTAINER_REGISTRY_IMAGE: "$OKD4_TEH1_REGISTRY/mozart/$CI_PROJECT_NAME" - RELEASE_CONTAINER_REGISTRY_USERNAME: "gitlab-ci" - RELEASE_CONTAINER_REGISTRY_PASSWORD: ${OKD_MOZART_TOKEN} - dependencies: - - build - only: - - tags - - branches - when: manual - -release:production:teh-1: - extends: .easy_ci:release:docker - variables: - OKD4_TEH1_REGISTRY: "image-registry.apps.private.okd4.teh-1.snappcloud.io" - RELEASE_CONTAINER_REGISTRY_ADDRESS: "$OKD4_TEH1_REGISTRY" - RELEASE_CONTAINER_REGISTRY_IMAGE: "$OKD4_TEH1_REGISTRY/realtime-production/$CI_PROJECT_NAME" - RELEASE_CONTAINER_REGISTRY_USERNAME: "gitlab-ci" - RELEASE_CONTAINER_REGISTRY_PASSWORD: ${OKD4_TEH1_REALTIME_PRODUCTION_TOKEN} - dependencies: - - build - only: - - tags - when: manual - -release:production:teh-2: - extends: .easy_ci:release:docker - variables: - OKD4_TEH2_REGISTRY: "image-registry.apps.private.okd4.teh-2.snappcloud.io" - RELEASE_CONTAINER_REGISTRY_ADDRESS: "$OKD4_TEH2_REGISTRY" - RELEASE_CONTAINER_REGISTRY_IMAGE: "$OKD4_TEH2_REGISTRY/realtime-production/$CI_PROJECT_NAME" - RELEASE_CONTAINER_REGISTRY_USERNAME: "gitlab-ci" - RELEASE_CONTAINER_REGISTRY_PASSWORD: ${OKD4_TEH2_REALTIME_PRODUCTION_TOKEN} - dependencies: - - build - only: - - tags - when: manual - -release:production:baly: - extends: .easy_ci:release:docker - variables: - BALY_REGISTRY: "registry.apps.internal.okd.eu-central-1.cloud.baly.app" - RELEASE_CONTAINER_REGISTRY_ADDRESS: "$BALY_REGISTRY" - RELEASE_CONTAINER_REGISTRY_IMAGE: "$BALY_REGISTRY/baly-dispatching/$CI_PROJECT_NAME" - RELEASE_CONTAINER_REGISTRY_USERNAME: "gitlab-ci" - RELEASE_CONTAINER_REGISTRY_PASSWORD: ${BALY_DISPATCHING_PRODUCTION_TOKEN} - dependencies: - - build - only: - - tags - when: manual diff --git a/.gitlab/ci/templates/test.gitlab-ci.yml b/.gitlab/ci/templates/test.gitlab-ci.yml deleted file mode 100644 index 34dafe0e..00000000 --- a/.gitlab/ci/templates/test.gitlab-ci.yml +++ /dev/null @@ -1,17 +0,0 @@ ---- -lint: - extends: .easy_ci:lint - -handolint: - extends: .easy-ci:dockerfile:lint - -test: - image: registry.snapp.tech/docker/golang:1.19-alpine - stage: test - coverage: '/total:\s*\(statements\)\s*([\d.]+)%/' - extends: .easy_ci:go:cache - script: - - go test -gcflags=-l -v -coverprofile .coverage.out ./... - - go tool cover -func .coverage.out - dependencies: - - compile From 2592ed0cc805df26cd865ea0fbef937e58a6b688 Mon Sep 17 00:00:00 2001 From: Parham Alvani Date: Thu, 19 Oct 2023 11:04:52 +0000 Subject: [PATCH 443/660] feat: use two stages docker build --- Dockerfile | 25 ++++++++++++++++++++----- 1 file changed, 20 insertions(+), 5 deletions(-) diff --git a/Dockerfile b/Dockerfile index ccd0b476..e3cff4e6 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,12 +1,27 @@ +FROM golang:1.19-alpine3.17 as builder + +# hadolint ignore=DL3018 +RUN apk --no-cache add git + +WORKDIR /app + +COPY go.mod go.sum ./ + +RUN go mod download + +COPY . . + +WORKDIR /app/cmd/soteria +RUN go build -o /soteria + FROM alpine:3.17 # hadolint ignore=DL3018 -RUN echo "https://repo.snapp.tech/repository/alpine/v3.17/main" > /etc/apk/repositories && \ - echo "https://repo.snapp.tech/repository/alpine/v3.17/community" >> /etc/apk/repositories && \ - apk --no-cache --update add ca-certificates tzdata && \ +RUN apk --no-cache add ca-certificates tzdata && \ mkdir /app -COPY ./soteria /app +COPY --from=builder /soteria /app WORKDIR /app -CMD ["/app/soteria", "serve"] +ENTRYPOINT ["/app/soteria" ] +CMD ["serve"] From e3aa74980dfd19eb60458bb9a795a076a363d566 Mon Sep 17 00:00:00 2001 From: Parham Alvani Date: Thu, 19 Oct 2023 11:06:12 +0000 Subject: [PATCH 444/660] feat: remove deployment scripts --- deployments/deploy.sh | 15 --------------- deployments/teardown.sh | 3 --- 2 files changed, 18 deletions(-) delete mode 100755 deployments/deploy.sh delete mode 100755 deployments/teardown.sh diff --git a/deployments/deploy.sh b/deployments/deploy.sh deleted file mode 100755 index fdaf6eed..00000000 --- a/deployments/deploy.sh +++ /dev/null @@ -1,15 +0,0 @@ -#!/usr/bin/env bash - -set -e - -company="$(oc project -q | cut -d- -f1)" -ode="$(oc project -q | cut -d- -f3)" - -echo "Rolling out soteria on $company-ode-$ode" - -current_dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" -path_to_k8s="$current_dir/soteria" - -helm upgrade --install soteria "$path_to_k8s" \ - -f "$path_to_k8s/values.yaml" \ - -f "$path_to_k8s/values.ode.$company.yaml" diff --git a/deployments/teardown.sh b/deployments/teardown.sh deleted file mode 100755 index cf50c30c..00000000 --- a/deployments/teardown.sh +++ /dev/null @@ -1,3 +0,0 @@ -#!/usr/bin/env bash - -helm uninstall soteria From f5a05023f078ec7f6d446a8026d1d1e14ebf7b9c Mon Sep 17 00:00:00 2001 From: Parham Alvani Date: Thu, 19 Oct 2023 11:11:57 +0000 Subject: [PATCH 445/660] feat: change project package --- cmd/soteria/soteria.go | 2 +- go.mod | 35 +++++++------- go.sum | 48 ++++++++++++------- internal/api/acl.go | 4 +- internal/api/api.go | 2 +- internal/api/api_test.go | 2 +- internal/authenticator/authenticator.go | 2 +- internal/authenticator/auto_authenticator.go | 6 +-- .../authenticator/auto_authenticator_test.go | 8 ++-- internal/authenticator/builder.go | 6 +-- internal/authenticator/errors.go | 2 +- .../authenticator/manual_authenticator.go | 6 +-- .../manual_authenticator_test.go | 8 ++-- internal/cmd/root.go | 8 ++-- internal/cmd/serve/main.go | 6 +-- internal/config/config.go | 6 +-- internal/config/default.go | 8 ++-- internal/topics/manager_test.go | 4 +- internal/topics/topic.go | 2 +- 19 files changed, 92 insertions(+), 73 deletions(-) diff --git a/cmd/soteria/soteria.go b/cmd/soteria/soteria.go index 233a74c8..2608c189 100644 --- a/cmd/soteria/soteria.go +++ b/cmd/soteria/soteria.go @@ -1,7 +1,7 @@ package main import ( - "gitlab.snapp.ir/dispatching/soteria/internal/cmd" + "github.com/snapp-incubator/soteria/internal/cmd" _ "go.uber.org/automaxprocs" ) diff --git a/go.mod b/go.mod index a6ecb33f..00734ec1 100644 --- a/go.mod +++ b/go.mod @@ -1,11 +1,13 @@ -module gitlab.snapp.ir/dispatching/soteria +module github.com/snapp-incubator/soteria go 1.21 +toolchain go1.21.3 + require ( github.com/ansrivas/fiberprometheus/v2 v2.6.1 github.com/gofiber/contrib/fiberzap v1.0.2 - github.com/gofiber/fiber/v2 v2.49.0 + github.com/gofiber/fiber/v2 v2.50.0 github.com/golang-jwt/jwt/v5 v5.0.0 github.com/knadh/koanf v1.5.0 github.com/speps/go-hashids/v2 v2.0.1 @@ -13,16 +15,16 @@ require ( github.com/stretchr/testify v1.8.4 github.com/tidwall/pretty v1.2.1 gitlab.snapp.ir/security_regulatory/validator/pkg/sdk v0.2.2 - go.opentelemetry.io/otel v1.17.0 + go.opentelemetry.io/otel v1.19.0 go.opentelemetry.io/otel/exporters/jaeger v1.17.0 - go.opentelemetry.io/otel/sdk v1.17.0 - go.opentelemetry.io/otel/trace v1.17.0 + go.opentelemetry.io/otel/sdk v1.19.0 + go.opentelemetry.io/otel/trace v1.19.0 go.uber.org/automaxprocs v1.5.3 - go.uber.org/zap v1.25.0 + go.uber.org/zap v1.26.0 ) require ( - github.com/andybalholm/brotli v1.0.5 // indirect + github.com/andybalholm/brotli v1.0.6 // indirect github.com/beorn7/perks v1.0.1 // indirect github.com/cespare/xxhash/v2 v2.2.0 // indirect github.com/davecgh/go-spew v1.1.1 // indirect @@ -34,27 +36,28 @@ require ( github.com/golang/protobuf v1.5.3 // indirect github.com/google/uuid v1.3.1 // indirect github.com/inconshreveable/mousetrap v1.1.0 // indirect - github.com/klauspost/compress v1.16.7 // indirect + github.com/klauspost/compress v1.17.1 // indirect github.com/mattn/go-colorable v0.1.13 // indirect - github.com/mattn/go-isatty v0.0.19 // indirect + github.com/mattn/go-isatty v0.0.20 // indirect github.com/mattn/go-runewidth v0.0.15 // indirect github.com/matttproud/golang_protobuf_extensions v1.0.4 // indirect + github.com/matttproud/golang_protobuf_extensions/v2 v2.0.0 // indirect github.com/mitchellh/copystructure v1.2.0 // indirect github.com/mitchellh/mapstructure v1.5.0 // indirect github.com/mitchellh/reflectwalk v1.0.2 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect - github.com/prometheus/client_golang v1.16.0 // indirect - github.com/prometheus/client_model v0.4.0 // indirect - github.com/prometheus/common v0.44.0 // indirect - github.com/prometheus/procfs v0.11.1 // indirect + github.com/prometheus/client_golang v1.17.0 // indirect + github.com/prometheus/client_model v0.5.0 // indirect + github.com/prometheus/common v0.45.0 // indirect + github.com/prometheus/procfs v0.12.0 // indirect github.com/rivo/uniseg v0.4.4 // indirect github.com/spf13/pflag v1.0.5 // indirect github.com/valyala/bytebufferpool v1.0.0 // indirect - github.com/valyala/fasthttp v1.49.0 // indirect + github.com/valyala/fasthttp v1.50.0 // indirect github.com/valyala/tcplisten v1.0.0 // indirect - go.opentelemetry.io/otel/metric v1.17.0 // indirect + go.opentelemetry.io/otel/metric v1.19.0 // indirect go.uber.org/multierr v1.11.0 // indirect - golang.org/x/sys v0.11.0 // indirect + golang.org/x/sys v0.13.0 // indirect google.golang.org/protobuf v1.31.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect ) diff --git a/go.sum b/go.sum index cc543a5d..2080e23f 100644 --- a/go.sum +++ b/go.sum @@ -10,6 +10,8 @@ github.com/alecthomas/units v0.0.0-20190717042225-c3de453c63f4/go.mod h1:ybxpYRF github.com/alecthomas/units v0.0.0-20190924025748-f65c72e2690d/go.mod h1:rBZYJk541a8SKzHPHnH3zbiI+7dagKZ0cgpgrD7Fyho= github.com/andybalholm/brotli v1.0.5 h1:8uQZIdzKmjc/iuPu7O2ioW48L81FgatrcpfFmiq/cCs= github.com/andybalholm/brotli v1.0.5/go.mod h1:fO7iG3H7G2nSZ7m0zPUDn85XEX2GTukHGRSepvi9Eig= +github.com/andybalholm/brotli v1.0.6 h1:Yf9fFpf49Zrxb9NlQaluyE92/+X7UVHlhMNJN2sxfOI= +github.com/andybalholm/brotli v1.0.6/go.mod h1:fO7iG3H7G2nSZ7m0zPUDn85XEX2GTukHGRSepvi9Eig= github.com/ansrivas/fiberprometheus/v2 v2.6.1 h1:wac3pXaE6BYYTF04AC6K0ktk6vCD+MnDOJZ3SK66kXM= github.com/ansrivas/fiberprometheus/v2 v2.6.1/go.mod h1:MloIKvy4yN6hVqlRpJ/jDiR244YnWJaQC0FIqS8A+MY= github.com/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kdvxnR2qWY= @@ -80,10 +82,10 @@ github.com/gofiber/adaptor/v2 v2.2.1 h1:givE7iViQWlsTR4Jh7tB4iXzrlKBgiraB/yTdHs9 github.com/gofiber/adaptor/v2 v2.2.1/go.mod h1:AhR16dEqs25W2FY/l8gSj1b51Azg5dtPDmm+pruNOrc= github.com/gofiber/contrib/fiberzap v1.0.2 h1:EQwhggtszVfIdBeXxN9Xrmld71es34Ufs+ef8VMqZxc= github.com/gofiber/contrib/fiberzap v1.0.2/go.mod h1:jGO8BHU4gRI9U0JtM6zj2CIhYfgVmW5JxziN8NTgVwE= -github.com/gofiber/fiber/v2 v2.48.0 h1:cRVMCb9aUJDsyHxGFLwz/sGzDggdailZZyptU9F9cU0= -github.com/gofiber/fiber/v2 v2.48.0/go.mod h1:xqJgfqrc23FJuqGOW6DVgi3HyZEm2Mn9pRqUb2kHSX8= github.com/gofiber/fiber/v2 v2.49.0 h1:xBVG2c66GDcWfww56xHvMn52Q0XX7UrSvjj6MD8/5EE= github.com/gofiber/fiber/v2 v2.49.0/go.mod h1:oxpt7wQaEYgdDmq7nMxCGhilYicBLFnZ+jQSJcQDlSE= +github.com/gofiber/fiber/v2 v2.50.0 h1:ia0JaB+uw3GpNSCR5nvC5dsaxXjRU5OEu36aytx+zGw= +github.com/gofiber/fiber/v2 v2.50.0/go.mod h1:21eytvay9Is7S6z+OgPi7c7n4++tnClWmhpimVHMimw= github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q= github.com/golang-jwt/jwt/v5 v5.0.0 h1:1n1XNM9hk7O9mnQoNBGolZvzebBQ7p93ULHRc28XJUE= @@ -121,8 +123,6 @@ github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38= github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/google/uuid v1.3.0 h1:t6JiXgmwXMjEs8VusXIJk2BXHsn+wx8BZdTaoZ5fu7I= -github.com/google/uuid v1.3.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.3.1 h1:KjJaJ9iWZ3jOFZIf1Lqf4laDRCasjl0BCmnEGxkdLb4= github.com/google/uuid v1.3.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0/go.mod h1:8NvIoxWQoOIhqOTXgfV/d3M/q6VIi02HzZEHgUlZvzk= @@ -179,6 +179,8 @@ github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= github.com/klauspost/compress v1.16.7 h1:2mk3MPGNzKyxErAw8YaohYh69+pa4sIQSC0fPGCFR9I= github.com/klauspost/compress v1.16.7/go.mod h1:ntbaceVETuRiXiv4DpjP66DpAtAGkEQskQzEyD//IeE= +github.com/klauspost/compress v1.17.1 h1:NE3C767s2ak2bweCZo3+rdP4U/HoyVXLv/X9f2gPS5g= +github.com/klauspost/compress v1.17.1/go.mod h1:ntbaceVETuRiXiv4DpjP66DpAtAGkEQskQzEyD//IeE= github.com/knadh/koanf v1.5.0 h1:q2TSd/3Pyc/5yP9ldIrSdIz26MCcyNQzW0pEAugLPNs= github.com/knadh/koanf v1.5.0/go.mod h1:Hgyjp4y8v44hpZtPzs7JZfRAW5AhN7KfZcwv1RYggDs= github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= @@ -205,11 +207,15 @@ github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Ky github.com/mattn/go-isatty v0.0.16/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM= github.com/mattn/go-isatty v0.0.19 h1:JITubQf0MOLdlGRuRq+jtsDlekdYPia9ZFsB8h/APPA= 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-runewidth v0.0.15 h1:UNAjwbU9l54TA3KzvqLGxwWjHmMgBUVhBiTjelZgg3U= github.com/mattn/go-runewidth v0.0.15/go.mod h1:Jdepj2loyihRzMpdS35Xk/zdY8IAYHsh153qUoGf23w= github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= github.com/matttproud/golang_protobuf_extensions v1.0.4 h1:mmDVorXM7PCGKw94cs5zkfA9PSy5pEvNWRP0ET0TIVo= github.com/matttproud/golang_protobuf_extensions v1.0.4/go.mod h1:BSXmuO+STAnVfrANrmjBb36TMTDstsz7MSK+HVaYKv4= +github.com/matttproud/golang_protobuf_extensions/v2 v2.0.0 h1:jWpvCLoY8Z/e3VKvlsiIGKtc+UG6U5vzxaoagmhXfyg= +github.com/matttproud/golang_protobuf_extensions/v2 v2.0.0/go.mod h1:QUyp042oQthUoa9bqDv0ER0wrtXnBruoNd7aNjkbP+k= github.com/miekg/dns v1.1.26/go.mod h1:bPDLeHnStXmXAq1m/Ch/hvfNHr14JKNPMBo3VZKjuso= github.com/miekg/dns v1.1.41/go.mod h1:p6aan82bvRIyn+zDIv9xYNUpwa73JcSh9BKwknJysuI= github.com/mitchellh/cli v1.0.0/go.mod h1:hNIlj7HEI86fIcpObd7a0FcrxTWetlwJDGcceTlRvqc= @@ -256,23 +262,31 @@ github.com/prometheus/client_golang v1.7.1/go.mod h1:PY5Wy2awLA44sXw4AOSfFBetzPP github.com/prometheus/client_golang v1.11.1/go.mod h1:Z6t4BnS23TR94PD6BsDNk8yVqroYurpAkEiz0P2BEV0= github.com/prometheus/client_golang v1.16.0 h1:yk/hx9hDbrGHovbci4BY+pRMfSuuat626eFsHb7tmT8= github.com/prometheus/client_golang v1.16.0/go.mod h1:Zsulrv/L9oM40tJ7T815tM89lFEugiJ9HzIqaAx4LKc= +github.com/prometheus/client_golang v1.17.0 h1:rl2sfwZMtSthVU752MqfjQozy7blglC+1SOtjMAMh+Q= +github.com/prometheus/client_golang v1.17.0/go.mod h1:VeL+gMmOAxkS2IqfCq0ZmHSL+LjWfWDUmp1mBz9JgUY= github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/client_model v0.2.0/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/client_model v0.4.0 h1:5lQXD3cAg1OXBf4Wq03gTrXHeaV0TQvGfUooCfx1yqY= github.com/prometheus/client_model v0.4.0/go.mod h1:oMQmHW1/JoDwqLtg57MGgP/Fb1CJEYF2imWWhWtMkYU= +github.com/prometheus/client_model v0.5.0 h1:VQw1hfvPvk3Uv6Qf29VrPF32JB6rtbgI6cYPYQjL0Qw= +github.com/prometheus/client_model v0.5.0/go.mod h1:dTiFglRmd66nLR9Pv9f0mZi7B7fk5Pm3gvsjB5tr+kI= github.com/prometheus/common v0.4.1/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= github.com/prometheus/common v0.10.0/go.mod h1:Tlit/dnDKsSWFlCLTWaA1cyBgKHSMdTB80sz/V91rCo= github.com/prometheus/common v0.26.0/go.mod h1:M7rCNAaPfAosfx8veZJCuw84e35h3Cfd9VFqTh1DIvc= github.com/prometheus/common v0.44.0 h1:+5BrQJwiBB9xsMygAB3TNvpQKOwlkc25LbISbrdOOfY= github.com/prometheus/common v0.44.0/go.mod h1:ofAIvZbQ1e/nugmZGz4/qCb9Ap1VoSTIO7x0VV9VvuY= +github.com/prometheus/common v0.45.0 h1:2BGz0eBc2hdMDLnO/8n0jeB3oPrt2D08CekT0lneoxM= +github.com/prometheus/common v0.45.0/go.mod h1:YJmSTw9BoKxJplESWWxlbyttQR4uaEcGyv9MZjVOJsY= github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= github.com/prometheus/procfs v0.1.3/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU= github.com/prometheus/procfs v0.6.0/go.mod h1:cz+aTbrPOrUb4q7XlbU9ygM+/jj0fzG6c1xBZuNvfVA= github.com/prometheus/procfs v0.11.1 h1:xRC8Iq1yyca5ypa9n1EZnWZkt7dwcoRPQwX/5gwaUuI= github.com/prometheus/procfs v0.11.1/go.mod h1:eesXgaPo1q7lBpVMoMy0ZOFTth9hBn4W/y0/p/ScXhY= +github.com/prometheus/procfs v0.12.0 h1:jluTpSng7V9hY0O2R9DzzJHYb2xULk9VTR1V1R/k6Bo= +github.com/prometheus/procfs v0.12.0/go.mod h1:pcuDEFsWDnvcgNzo4EEweacyhjeA9Zk3cnaOZAZEfOo= github.com/rhnvrm/simples3 v0.6.1/go.mod h1:Y+3vYm2V7Y4VijFoJHHTrja6OgPrJ2cBti8dPGkC3sA= github.com/rivo/uniseg v0.2.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc= github.com/rivo/uniseg v0.4.4 h1:8TfxU8dW6PdqD27gjM8MVNuicgxIjxpm4K7x4jp8sis= @@ -309,10 +323,10 @@ github.com/tidwall/pretty v1.2.1 h1:qjsOFOWWQl+N3RsoF5/ssm1pHmJJwhjlSbZ51I6wMl4= github.com/tidwall/pretty v1.2.1/go.mod h1:ITEVvHYasfjBbM0u2Pg8T2nJnzm8xPwvNhhsoaGGjNU= github.com/valyala/bytebufferpool v1.0.0 h1:GqA5TC/0021Y/b9FG4Oi9Mr3q7XYx6KllzawFIhcdPw= github.com/valyala/bytebufferpool v1.0.0/go.mod h1:6bBcMArwyJ5K/AmCkWv1jt77kVWyCJ6HpOuEn7z0Csc= -github.com/valyala/fasthttp v1.48.0 h1:oJWvHb9BIZToTQS3MuQ2R3bJZiNSa2KiNdeI8A+79Tc= -github.com/valyala/fasthttp v1.48.0/go.mod h1:k2zXd82h/7UZc3VOdJ2WaUqt1uZ/XpXAfE9i+HBC3lA= github.com/valyala/fasthttp v1.49.0 h1:9FdvCpmxB74LH4dPb7IJ1cOSsluR07XG3I1txXWwJpE= github.com/valyala/fasthttp v1.49.0/go.mod h1:k2zXd82h/7UZc3VOdJ2WaUqt1uZ/XpXAfE9i+HBC3lA= +github.com/valyala/fasthttp v1.50.0 h1:H7fweIlBm0rXLs2q0XbalvJ6r0CUPFWK3/bB4N13e9M= +github.com/valyala/fasthttp v1.50.0/go.mod h1:k2zXd82h/7UZc3VOdJ2WaUqt1uZ/XpXAfE9i+HBC3lA= github.com/valyala/tcplisten v1.0.0 h1:rBHj/Xf+E1tRGZyWIWwJDiRY0zc1Js+CV5DqwacVSA8= github.com/valyala/tcplisten v1.0.0/go.mod h1:T0xQ8SeCZGxckz9qRXTfG43PvQ/mcWh7FwZEA7Ioqkc= github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= @@ -323,26 +337,24 @@ gitlab.snapp.ir/security_regulatory/validator/pkg/sdk v0.2.2/go.mod h1:+0JXkekQp go.etcd.io/etcd/api/v3 v3.5.4/go.mod h1:5GB2vv4A4AOn3yk7MftYGHkUfGtDHnEraIjym4dYz5A= go.etcd.io/etcd/client/pkg/v3 v3.5.4/go.mod h1:IJHfcCEKxYu1Os13ZdwCwIUTUVGYTSAM3YSwc9/Ac1g= go.etcd.io/etcd/client/v3 v3.5.4/go.mod h1:ZaRkVgBZC+L+dLCjTcF1hRXpgZXQPOvnA/Ak/gq3kiY= -go.opentelemetry.io/otel v1.16.0 h1:Z7GVAX/UkAXPKsy94IU+i6thsQS4nb7LviLpnaNeW8s= -go.opentelemetry.io/otel v1.16.0/go.mod h1:vl0h9NUa1D5s1nv3A5vZOYWn8av4K8Ml6JDeHrT/bx4= go.opentelemetry.io/otel v1.17.0 h1:MW+phZ6WZ5/uk2nd93ANk/6yJ+dVrvNWUjGhnnFU5jM= go.opentelemetry.io/otel v1.17.0/go.mod h1:I2vmBGtFaODIVMBSTPVDlJSzBDNf93k60E6Ft0nyjo0= -go.opentelemetry.io/otel/exporters/jaeger v1.16.0 h1:YhxxmXZ011C0aDZKoNw+juVWAmEfv/0W2XBOv9aHTaA= -go.opentelemetry.io/otel/exporters/jaeger v1.16.0/go.mod h1:grYbBo/5afWlPpdPZYhyn78Bk04hnvxn2+hvxQhKIQM= +go.opentelemetry.io/otel v1.19.0 h1:MuS/TNf4/j4IXsZuJegVzI1cwut7Qc00344rgH7p8bs= +go.opentelemetry.io/otel v1.19.0/go.mod h1:i0QyjOq3UPoTzff0PJB2N66fb4S0+rSbSB15/oyH9fY= go.opentelemetry.io/otel/exporters/jaeger v1.17.0 h1:D7UpUy2Xc2wsi1Ras6V40q806WM07rqoCWzXu7Sqy+4= go.opentelemetry.io/otel/exporters/jaeger v1.17.0/go.mod h1:nPCqOnEH9rNLKqH/+rrUjiMzHJdV1BlpKcTwRTyKkKI= -go.opentelemetry.io/otel/metric v1.16.0 h1:RbrpwVG1Hfv85LgnZ7+txXioPDoh6EdbZHo26Q3hqOo= -go.opentelemetry.io/otel/metric v1.16.0/go.mod h1:QE47cpOmkwipPiefDwo2wDzwJrlfxxNYodqc4xnGCo4= go.opentelemetry.io/otel/metric v1.17.0 h1:iG6LGVz5Gh+IuO0jmgvpTB6YVrCGngi8QGm+pMd8Pdc= go.opentelemetry.io/otel/metric v1.17.0/go.mod h1:h4skoxdZI17AxwITdmdZjjYJQH5nzijUUjm+wtPph5o= -go.opentelemetry.io/otel/sdk v1.16.0 h1:Z1Ok1YsijYL0CSJpHt4cS3wDDh7p572grzNrBMiMWgE= -go.opentelemetry.io/otel/sdk v1.16.0/go.mod h1:tMsIuKXuuIWPBAOrH+eHtvhTL+SntFtXF9QD68aP6p4= +go.opentelemetry.io/otel/metric v1.19.0 h1:aTzpGtV0ar9wlV4Sna9sdJyII5jTVJEvKETPiOKwvpE= +go.opentelemetry.io/otel/metric v1.19.0/go.mod h1:L5rUsV9kM1IxCj1MmSdS+JQAcVm319EUrDVLrt7jqt8= go.opentelemetry.io/otel/sdk v1.17.0 h1:FLN2X66Ke/k5Sg3V623Q7h7nt3cHXaW1FOvKKrW0IpE= go.opentelemetry.io/otel/sdk v1.17.0/go.mod h1:U87sE0f5vQB7hwUoW98pW5Rz4ZDuCFBZFNUBlSgmDFQ= -go.opentelemetry.io/otel/trace v1.16.0 h1:8JRpaObFoW0pxuVPapkgH8UhHQj+bJW8jJsCZEu5MQs= -go.opentelemetry.io/otel/trace v1.16.0/go.mod h1:Yt9vYq1SdNz3xdjZZK7wcXv1qv2pwLkqr2QVwea0ef0= +go.opentelemetry.io/otel/sdk v1.19.0 h1:6USY6zH+L8uMH8L3t1enZPR3WFEmSTADlqldyHtJi3o= +go.opentelemetry.io/otel/sdk v1.19.0/go.mod h1:NedEbbS4w3C6zElbLdPJKOpJQOrGUJ+GfzpjUvI0v1A= go.opentelemetry.io/otel/trace v1.17.0 h1:/SWhSRHmDPOImIAetP1QAeMnZYiQXrTy4fMMYOdSKWQ= go.opentelemetry.io/otel/trace v1.17.0/go.mod h1:I/4vKTgFclIsXRVucpH25X0mpFSczM7aHeaz0ZBLWjY= +go.opentelemetry.io/otel/trace v1.19.0 h1:DFVQmlVbfVeOuBRrwdtaehRrWiL1JoVs9CPIQ1Dzxpg= +go.opentelemetry.io/otel/trace v1.19.0/go.mod h1:mfaSyvGyEJEI0nyV2I4qhNQnbBOUUmYZpYojqMnX2vo= go.uber.org/atomic v1.7.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc= go.uber.org/automaxprocs v1.5.3 h1:kWazyxZUrS3Gs4qUpbwo5kEIMGe/DAvi5Z4tl2NW4j8= go.uber.org/automaxprocs v1.5.3/go.mod h1:eRbA25aqJrxAbsLO0xy5jVwPt7FQnRgjW+efnwa1WM0= @@ -354,6 +366,8 @@ go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN8 go.uber.org/zap v1.17.0/go.mod h1:MXVU+bhUf/A7Xi2HNOnopQOrmycQ5Ih87HtOu4q5SSo= go.uber.org/zap v1.25.0 h1:4Hvk6GtkucQ790dqmj7l1eEnRdKm3k3ZUrUMS2d5+5c= go.uber.org/zap v1.25.0/go.mod h1:JIAUzQIH94IC4fOJQm7gMmBJP5k7wQfdcnYdPoEXJYk= +go.uber.org/zap v1.26.0 h1:sI7k6L95XOKS281NhVKOFCUNIvv9e0w4BF8N3u+tCRo= +go.uber.org/zap v1.26.0/go.mod h1:dtElttAiwGvoJ/vj4IwHBS/gXsEu/pZ50mUIRWuG0so= golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20190923035154-9ee001bba392/go.mod h1:/lpIB1dKB+9EgE3H3cr1v9wB50oz8l4C4h62xy7jSTY= @@ -432,6 +446,8 @@ golang.org/x/sys v0.0.0-20220908164124-27713097b956/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.11.0 h1:eG7RXZHdqOJ1i+0lgLgCpSXAp6M3LYlAo6osgSi0xOM= golang.org/x/sys v0.11.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.13.0 h1:Af8nKPmuFypiUBjVoU9V20FiaFXOcuZI21p0ycVYYGE= +golang.org/x/sys v0.13.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.1-0.20181227161524-e6919f6577db/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= diff --git a/internal/api/acl.go b/internal/api/acl.go index a2b4826e..dad2d281 100644 --- a/internal/api/acl.go +++ b/internal/api/acl.go @@ -6,8 +6,8 @@ import ( "github.com/gofiber/fiber/v2" "github.com/golang-jwt/jwt/v5" - "gitlab.snapp.ir/dispatching/soteria/internal/authenticator" - "gitlab.snapp.ir/dispatching/soteria/pkg/acl" + "github.com/snapp-incubator/soteria/internal/authenticator" + "github.com/snapp-incubator/soteria/pkg/acl" "go.opentelemetry.io/otel/attribute" "go.uber.org/zap" ) diff --git a/internal/api/api.go b/internal/api/api.go index f5c5b621..d6a36b84 100644 --- a/internal/api/api.go +++ b/internal/api/api.go @@ -6,7 +6,7 @@ import ( "github.com/ansrivas/fiberprometheus/v2" "github.com/gofiber/contrib/fiberzap" "github.com/gofiber/fiber/v2" - "gitlab.snapp.ir/dispatching/soteria/internal/authenticator" + "github.com/snapp-incubator/soteria/internal/authenticator" "go.opentelemetry.io/otel/trace" "go.uber.org/zap" ) diff --git a/internal/api/api_test.go b/internal/api/api_test.go index f914aadd..1eccbd26 100644 --- a/internal/api/api_test.go +++ b/internal/api/api_test.go @@ -3,7 +3,7 @@ package api_test import ( "testing" - "gitlab.snapp.ir/dispatching/soteria/internal/api" + "github.com/snapp-incubator/soteria/internal/api" ) // nolint: funlen diff --git a/internal/authenticator/authenticator.go b/internal/authenticator/authenticator.go index 64947037..27b990bf 100644 --- a/internal/authenticator/authenticator.go +++ b/internal/authenticator/authenticator.go @@ -1,7 +1,7 @@ package authenticator import ( - "gitlab.snapp.ir/dispatching/soteria/pkg/acl" + "github.com/snapp-incubator/soteria/pkg/acl" ) type Authenticator interface { diff --git a/internal/authenticator/auto_authenticator.go b/internal/authenticator/auto_authenticator.go index d331b574..d41d7291 100644 --- a/internal/authenticator/auto_authenticator.go +++ b/internal/authenticator/auto_authenticator.go @@ -6,9 +6,9 @@ import ( "net/http" "github.com/golang-jwt/jwt/v5" - "gitlab.snapp.ir/dispatching/soteria/internal/config" - "gitlab.snapp.ir/dispatching/soteria/internal/topics" - "gitlab.snapp.ir/dispatching/soteria/pkg/acl" + "github.com/snapp-incubator/soteria/internal/config" + "github.com/snapp-incubator/soteria/internal/topics" + "github.com/snapp-incubator/soteria/pkg/acl" validatorSDK "gitlab.snapp.ir/security_regulatory/validator/pkg/sdk" ) diff --git a/internal/authenticator/auto_authenticator_test.go b/internal/authenticator/auto_authenticator_test.go index 23957231..f35a176b 100644 --- a/internal/authenticator/auto_authenticator_test.go +++ b/internal/authenticator/auto_authenticator_test.go @@ -10,10 +10,10 @@ import ( "github.com/golang-jwt/jwt/v5" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/suite" - "gitlab.snapp.ir/dispatching/soteria/internal/authenticator" - "gitlab.snapp.ir/dispatching/soteria/internal/config" - "gitlab.snapp.ir/dispatching/soteria/internal/topics" - "gitlab.snapp.ir/dispatching/soteria/pkg/acl" + "github.com/snapp-incubator/soteria/internal/authenticator" + "github.com/snapp-incubator/soteria/internal/config" + "github.com/snapp-incubator/soteria/internal/topics" + "github.com/snapp-incubator/soteria/pkg/acl" "go.uber.org/zap" ) diff --git a/internal/authenticator/builder.go b/internal/authenticator/builder.go index 95c6028d..314fdb49 100644 --- a/internal/authenticator/builder.go +++ b/internal/authenticator/builder.go @@ -4,9 +4,9 @@ import ( "fmt" "github.com/golang-jwt/jwt/v5" - "gitlab.snapp.ir/dispatching/soteria/internal/config" - "gitlab.snapp.ir/dispatching/soteria/internal/topics" - "gitlab.snapp.ir/dispatching/soteria/pkg/acl" + "github.com/snapp-incubator/soteria/internal/config" + "github.com/snapp-incubator/soteria/internal/topics" + "github.com/snapp-incubator/soteria/pkg/acl" validatorSDK "gitlab.snapp.ir/security_regulatory/validator/pkg/sdk" "go.uber.org/zap" ) diff --git a/internal/authenticator/errors.go b/internal/authenticator/errors.go index abdc868c..b5118266 100644 --- a/internal/authenticator/errors.go +++ b/internal/authenticator/errors.go @@ -4,7 +4,7 @@ import ( "errors" "fmt" - "gitlab.snapp.ir/dispatching/soteria/pkg/acl" + "github.com/snapp-incubator/soteria/pkg/acl" ) var ( diff --git a/internal/authenticator/manual_authenticator.go b/internal/authenticator/manual_authenticator.go index 2764da0d..7c712111 100644 --- a/internal/authenticator/manual_authenticator.go +++ b/internal/authenticator/manual_authenticator.go @@ -4,9 +4,9 @@ import ( "fmt" "github.com/golang-jwt/jwt/v5" - "gitlab.snapp.ir/dispatching/soteria/internal/config" - "gitlab.snapp.ir/dispatching/soteria/internal/topics" - "gitlab.snapp.ir/dispatching/soteria/pkg/acl" + "github.com/snapp-incubator/soteria/internal/config" + "github.com/snapp-incubator/soteria/internal/topics" + "github.com/snapp-incubator/soteria/pkg/acl" ) // ManualAuthenticator is responsible for Acl/Auth/Token of users. diff --git a/internal/authenticator/manual_authenticator_test.go b/internal/authenticator/manual_authenticator_test.go index 69025883..bea1f384 100644 --- a/internal/authenticator/manual_authenticator_test.go +++ b/internal/authenticator/manual_authenticator_test.go @@ -10,10 +10,10 @@ import ( "github.com/golang-jwt/jwt/v5" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/suite" - "gitlab.snapp.ir/dispatching/soteria/internal/authenticator" - "gitlab.snapp.ir/dispatching/soteria/internal/config" - "gitlab.snapp.ir/dispatching/soteria/internal/topics" - "gitlab.snapp.ir/dispatching/soteria/pkg/acl" + "github.com/snapp-incubator/soteria/internal/authenticator" + "github.com/snapp-incubator/soteria/internal/config" + "github.com/snapp-incubator/soteria/internal/topics" + "github.com/snapp-incubator/soteria/pkg/acl" "go.uber.org/zap" ) diff --git a/internal/cmd/root.go b/internal/cmd/root.go index 0783efc1..e9d1b119 100644 --- a/internal/cmd/root.go +++ b/internal/cmd/root.go @@ -4,10 +4,10 @@ import ( "os" "github.com/spf13/cobra" - "gitlab.snapp.ir/dispatching/soteria/internal/cmd/serve" - "gitlab.snapp.ir/dispatching/soteria/internal/config" - "gitlab.snapp.ir/dispatching/soteria/internal/logger" - "gitlab.snapp.ir/dispatching/soteria/internal/tracing" + "github.com/snapp-incubator/soteria/internal/cmd/serve" + "github.com/snapp-incubator/soteria/internal/config" + "github.com/snapp-incubator/soteria/internal/logger" + "github.com/snapp-incubator/soteria/internal/tracing" "go.uber.org/zap" ) diff --git a/internal/cmd/serve/main.go b/internal/cmd/serve/main.go index 3f806717..897978cb 100644 --- a/internal/cmd/serve/main.go +++ b/internal/cmd/serve/main.go @@ -8,9 +8,9 @@ import ( "os/signal" "github.com/spf13/cobra" - "gitlab.snapp.ir/dispatching/soteria/internal/api" - "gitlab.snapp.ir/dispatching/soteria/internal/authenticator" - "gitlab.snapp.ir/dispatching/soteria/internal/config" + "github.com/snapp-incubator/soteria/internal/api" + "github.com/snapp-incubator/soteria/internal/authenticator" + "github.com/snapp-incubator/soteria/internal/config" "go.opentelemetry.io/otel/trace" "go.uber.org/zap" ) diff --git a/internal/config/config.go b/internal/config/config.go index e3e8772a..cb34c13d 100644 --- a/internal/config/config.go +++ b/internal/config/config.go @@ -12,9 +12,9 @@ import ( "github.com/knadh/koanf/providers/file" "github.com/knadh/koanf/providers/structs" "github.com/tidwall/pretty" - "gitlab.snapp.ir/dispatching/soteria/internal/logger" - "gitlab.snapp.ir/dispatching/soteria/internal/topics" - "gitlab.snapp.ir/dispatching/soteria/internal/tracing" + "github.com/snapp-incubator/soteria/internal/logger" + "github.com/snapp-incubator/soteria/internal/topics" + "github.com/snapp-incubator/soteria/internal/tracing" ) const ( diff --git a/internal/config/default.go b/internal/config/default.go index 44087265..d3ae319d 100644 --- a/internal/config/default.go +++ b/internal/config/default.go @@ -3,10 +3,10 @@ package config import ( "time" - "gitlab.snapp.ir/dispatching/soteria/internal/logger" - "gitlab.snapp.ir/dispatching/soteria/internal/topics" - "gitlab.snapp.ir/dispatching/soteria/internal/tracing" - "gitlab.snapp.ir/dispatching/soteria/pkg/acl" + "github.com/snapp-incubator/soteria/internal/logger" + "github.com/snapp-incubator/soteria/internal/topics" + "github.com/snapp-incubator/soteria/internal/tracing" + "github.com/snapp-incubator/soteria/pkg/acl" ) const ( diff --git a/internal/topics/manager_test.go b/internal/topics/manager_test.go index 53467094..d235a255 100644 --- a/internal/topics/manager_test.go +++ b/internal/topics/manager_test.go @@ -3,8 +3,8 @@ package topics_test import ( "testing" - "gitlab.snapp.ir/dispatching/soteria/internal/config" - "gitlab.snapp.ir/dispatching/soteria/internal/topics" + "github.com/snapp-incubator/soteria/internal/config" + "github.com/snapp-incubator/soteria/internal/topics" "go.uber.org/zap" ) diff --git a/internal/topics/topic.go b/internal/topics/topic.go index 03ea0480..136ff263 100644 --- a/internal/topics/topic.go +++ b/internal/topics/topic.go @@ -4,7 +4,7 @@ import ( "strings" "text/template" - "gitlab.snapp.ir/dispatching/soteria/pkg/acl" + "github.com/snapp-incubator/soteria/pkg/acl" ) type Topic struct { From a954db6c43050949a4bb6dc2db20dbee884e1656 Mon Sep 17 00:00:00 2001 From: Parham Alvani Date: Thu, 19 Oct 2023 11:27:37 +0000 Subject: [PATCH 446/660] feat: add docker build and github workflow --- .github/dependabot.yml | 15 ++++++++ .github/workflows/test.yaml | 52 ++++++++++++++++++++++++++ Dockerfile => build/package/Dockerfile | 0 build/package/docker-bake.json | 17 +++++++++ 4 files changed, 84 insertions(+) create mode 100644 .github/dependabot.yml create mode 100644 .github/workflows/test.yaml rename Dockerfile => build/package/Dockerfile (100%) create mode 100644 build/package/docker-bake.json diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 00000000..3198c0f1 --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,15 @@ +# To get started with Dependabot version updates, you'll need to specify which +# package ecosystems to update and where the package manifests are located. +# Please see the documentation for all configuration options: +# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates + +version: 2 +updates: + - package-ecosystem: "github-actions" # See documentation for possible values + directory: "/" # Location of package manifests + schedule: + interval: "weekly" + - package-ecosystem: "gomod" # See documentation for possible values + directory: "/" # Location of package manifests + schedule: + interval: "weekly" diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml new file mode 100644 index 00000000..24104b2e --- /dev/null +++ b/.github/workflows/test.yaml @@ -0,0 +1,52 @@ +--- +name: test +on: + - push +jobs: + lint: + name: lint + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-go@v4 + with: + go-version: "1.19" + - name: golangci-lint + uses: golangci/golangci-lint-action@v3 + with: + version: latest + args: --enable-all --timeout=30m + + test: + name: test + runs-on: ubuntu-latest + steps: + - uses: extractions/setup-just@v1 + - uses: actions/checkout@v4 + - uses: actions/setup-go@v4 + with: + go-version: "1.19" + - run: go test -v ./... -covermode=atomic -coverprofile=coverage.out + - uses: codecov/codecov-action@v3.1.4 + with: + files: coverage.out + + docker: + name: docker + runs-on: ubuntu-latest + needs: + - lint + - test + steps: + - uses: actions/checkout@v4 + - uses: docker/setup-buildx-action@v3 + - uses: docker/setup-qemu-action@v3 + - uses: docker/login-action@v3 + with: + registry: ghcr.io + username: ${{ github.repository_owner }} + password: ${{ secrets.GITHUB_TOKEN }} + - uses: docker/bake-action@v4 + with: + files: "build/package/docker-bake.json" + push: true diff --git a/Dockerfile b/build/package/Dockerfile similarity index 100% rename from Dockerfile rename to build/package/Dockerfile diff --git a/build/package/docker-bake.json b/build/package/docker-bake.json new file mode 100644 index 00000000..50c9d46a --- /dev/null +++ b/build/package/docker-bake.json @@ -0,0 +1,17 @@ +{ + "group": { + "default": { + "targets": [ + "soteria" + ] + } + }, + "target": { + "koochooloo": { + "dockerfile": "build/package/Dockerfile", + "tags": [ + "ghcr.io/snapp-incubator/soteria" + ] + } + } +} From fa7caa0779a44902cdd5d02718158da1eba03c86 Mon Sep 17 00:00:00 2001 From: Parham Alvani Date: Thu, 19 Oct 2023 11:28:52 +0000 Subject: [PATCH 447/660] feat: update readme --- README.md | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/README.md b/README.md index d385bef2..6c5809c7 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# Soteria +

Soteria

## Introduction @@ -60,15 +60,6 @@ PS: On Subscribe we have only one message from client that need authorization an Soteria is a multivendor authenticator for EMQX. Follow instruction from [here](docs/vendor.md) -### Generate JWT Token - -For testing Soteria on staging (I mean ODE) you can use the following -`curl`, just replace `driver` and `0` for issuer and ID respectively. - -```bash -curl -s -u 'admin:admin' -L https://doago-snapp-ode-020.apps.private.teh-1.snappcloud.io/api/snapp/driver/0 | jq '.Token' -r -``` - -### Architecure +### Architecture ![architectureOfSoteria](docs/arch.png) From 5f89aab00cd6d48de6bcd96ce3be82fe85ccd7d2 Mon Sep 17 00:00:00 2001 From: Parham Alvani Date: Thu, 19 Oct 2023 11:31:30 +0000 Subject: [PATCH 448/660] feat: use version 1.19 in go.mod --- go.mod | 6 +----- go.sum | 45 --------------------------------------------- 2 files changed, 1 insertion(+), 50 deletions(-) diff --git a/go.mod b/go.mod index 00734ec1..cf7b7c24 100644 --- a/go.mod +++ b/go.mod @@ -1,8 +1,6 @@ module github.com/snapp-incubator/soteria -go 1.21 - -toolchain go1.21.3 +go 1.19 require ( github.com/ansrivas/fiberprometheus/v2 v2.6.1 @@ -33,14 +31,12 @@ require ( github.com/go-logr/logr v1.2.4 // indirect github.com/go-logr/stdr v1.2.2 // indirect github.com/gofiber/adaptor/v2 v2.2.1 // indirect - github.com/golang/protobuf v1.5.3 // indirect github.com/google/uuid v1.3.1 // indirect github.com/inconshreveable/mousetrap v1.1.0 // indirect github.com/klauspost/compress v1.17.1 // indirect github.com/mattn/go-colorable v0.1.13 // indirect github.com/mattn/go-isatty v0.0.20 // indirect github.com/mattn/go-runewidth v0.0.15 // indirect - github.com/matttproud/golang_protobuf_extensions v1.0.4 // indirect github.com/matttproud/golang_protobuf_extensions/v2 v2.0.0 // indirect github.com/mitchellh/copystructure v1.2.0 // indirect github.com/mitchellh/mapstructure v1.5.0 // indirect diff --git a/go.sum b/go.sum index 2080e23f..f9354d9d 100644 --- a/go.sum +++ b/go.sum @@ -2,14 +2,11 @@ cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMT cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= github.com/agiledragon/gomonkey/v2 v2.10.1 h1:FPJJNykD1957cZlGhr9X0zjr291/lbazoZ/dmc4mS4c= -github.com/agiledragon/gomonkey/v2 v2.10.1/go.mod h1:ap1AmDzcVOAz1YpeJ3TCzIgstoaWLA6jbbgxfB4w2iY= github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= github.com/alecthomas/units v0.0.0-20190717042225-c3de453c63f4/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= github.com/alecthomas/units v0.0.0-20190924025748-f65c72e2690d/go.mod h1:rBZYJk541a8SKzHPHnH3zbiI+7dagKZ0cgpgrD7Fyho= -github.com/andybalholm/brotli v1.0.5 h1:8uQZIdzKmjc/iuPu7O2ioW48L81FgatrcpfFmiq/cCs= -github.com/andybalholm/brotli v1.0.5/go.mod h1:fO7iG3H7G2nSZ7m0zPUDn85XEX2GTukHGRSepvi9Eig= github.com/andybalholm/brotli v1.0.6 h1:Yf9fFpf49Zrxb9NlQaluyE92/+X7UVHlhMNJN2sxfOI= github.com/andybalholm/brotli v1.0.6/go.mod h1:fO7iG3H7G2nSZ7m0zPUDn85XEX2GTukHGRSepvi9Eig= github.com/ansrivas/fiberprometheus/v2 v2.6.1 h1:wac3pXaE6BYYTF04AC6K0ktk6vCD+MnDOJZ3SK66kXM= @@ -29,8 +26,6 @@ github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.3.2/go.mod h1:72H github.com/aws/aws-sdk-go-v2/service/sso v1.4.2/go.mod h1:NBvT9R1MEF+Ud6ApJKM0G+IkPchKS7p7c2YPKwHmBOk= github.com/aws/aws-sdk-go-v2/service/sts v1.7.2/go.mod h1:8EzeIqfWt2wWT4rJVu3f21TfrhJ8AEMzVybRNSb/b4g= github.com/aws/smithy-go v1.8.0/go.mod h1:SObp3lf9smib00L/v3U2eAKG8FyQ7iLrJnQiAmR5n+E= -github.com/benbjohnson/clock v1.3.0 h1:ip6w0uFQkncKQ979AypyG0ER7mqUSBdKLOgAle/AT8A= -github.com/benbjohnson/clock v1.3.0/go.mod h1:J11/hYXuz8f4ySSvYwY0FKfm+ezbsZBKZxNJlLklBHA= github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q= github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8= github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= @@ -82,8 +77,6 @@ github.com/gofiber/adaptor/v2 v2.2.1 h1:givE7iViQWlsTR4Jh7tB4iXzrlKBgiraB/yTdHs9 github.com/gofiber/adaptor/v2 v2.2.1/go.mod h1:AhR16dEqs25W2FY/l8gSj1b51Azg5dtPDmm+pruNOrc= github.com/gofiber/contrib/fiberzap v1.0.2 h1:EQwhggtszVfIdBeXxN9Xrmld71es34Ufs+ef8VMqZxc= github.com/gofiber/contrib/fiberzap v1.0.2/go.mod h1:jGO8BHU4gRI9U0JtM6zj2CIhYfgVmW5JxziN8NTgVwE= -github.com/gofiber/fiber/v2 v2.49.0 h1:xBVG2c66GDcWfww56xHvMn52Q0XX7UrSvjj6MD8/5EE= -github.com/gofiber/fiber/v2 v2.49.0/go.mod h1:oxpt7wQaEYgdDmq7nMxCGhilYicBLFnZ+jQSJcQDlSE= github.com/gofiber/fiber/v2 v2.50.0 h1:ia0JaB+uw3GpNSCR5nvC5dsaxXjRU5OEu36aytx+zGw= github.com/gofiber/fiber/v2 v2.50.0/go.mod h1:21eytvay9Is7S6z+OgPi7c7n4++tnClWmhpimVHMimw= github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= @@ -106,8 +99,6 @@ github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw github.com/golang/protobuf v1.4.3/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= -github.com/golang/protobuf v1.5.3 h1:KhyjKVUg7Usr/dYsdSqoFveMYd5ko72D+zANwlG1mmg= -github.com/golang/protobuf v1.5.3/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= github.com/golang/snappy v0.0.1/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= @@ -120,7 +111,6 @@ github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/ github.com/google/go-cmp v0.5.6/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.7/go.mod h1:n+brtR0CgQNWTVd5ZUFpTBC8YFBDLK/h/bpaJ8/DtOE= github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38= -github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.3.1 h1:KjJaJ9iWZ3jOFZIf1Lqf4laDRCasjl0BCmnEGxkdLb4= @@ -177,8 +167,6 @@ github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7V github.com/julienschmidt/httprouter v1.3.0/go.mod h1:JR6WtHb+2LUe8TCKY3cZOxFyyO8IZAc4RVcycCCAKdM= github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8= github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= -github.com/klauspost/compress v1.16.7 h1:2mk3MPGNzKyxErAw8YaohYh69+pa4sIQSC0fPGCFR9I= -github.com/klauspost/compress v1.16.7/go.mod h1:ntbaceVETuRiXiv4DpjP66DpAtAGkEQskQzEyD//IeE= github.com/klauspost/compress v1.17.1 h1:NE3C767s2ak2bweCZo3+rdP4U/HoyVXLv/X9f2gPS5g= github.com/klauspost/compress v1.17.1/go.mod h1:ntbaceVETuRiXiv4DpjP66DpAtAGkEQskQzEyD//IeE= github.com/knadh/koanf v1.5.0 h1:q2TSd/3Pyc/5yP9ldIrSdIz26MCcyNQzW0pEAugLPNs= @@ -189,11 +177,9 @@ github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFB github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= github.com/kr/pretty v0.2.0/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= -github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk= github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= -github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU= github.com/mattn/go-colorable v0.1.4/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE= github.com/mattn/go-colorable v0.1.6/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= @@ -205,15 +191,11 @@ github.com/mattn/go-isatty v0.0.10/go.mod h1:qgIWMr58cqv1PHHyhnkY9lrL7etaEgOFcME github.com/mattn/go-isatty v0.0.11/go.mod h1:PhnuNfih5lzO57/f3n+odYbM4JtupLOxQOAqxQCu2WE= github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU= github.com/mattn/go-isatty v0.0.16/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM= -github.com/mattn/go-isatty v0.0.19 h1:JITubQf0MOLdlGRuRq+jtsDlekdYPia9ZFsB8h/APPA= -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-runewidth v0.0.15 h1:UNAjwbU9l54TA3KzvqLGxwWjHmMgBUVhBiTjelZgg3U= github.com/mattn/go-runewidth v0.0.15/go.mod h1:Jdepj2loyihRzMpdS35Xk/zdY8IAYHsh153qUoGf23w= github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= -github.com/matttproud/golang_protobuf_extensions v1.0.4 h1:mmDVorXM7PCGKw94cs5zkfA9PSy5pEvNWRP0ET0TIVo= -github.com/matttproud/golang_protobuf_extensions v1.0.4/go.mod h1:BSXmuO+STAnVfrANrmjBb36TMTDstsz7MSK+HVaYKv4= github.com/matttproud/golang_protobuf_extensions/v2 v2.0.0 h1:jWpvCLoY8Z/e3VKvlsiIGKtc+UG6U5vzxaoagmhXfyg= github.com/matttproud/golang_protobuf_extensions/v2 v2.0.0/go.mod h1:QUyp042oQthUoa9bqDv0ER0wrtXnBruoNd7aNjkbP+k= github.com/miekg/dns v1.1.26/go.mod h1:bPDLeHnStXmXAq1m/Ch/hvfNHr14JKNPMBo3VZKjuso= @@ -255,36 +237,27 @@ github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZN github.com/posener/complete v1.1.1/go.mod h1:em0nMJCgc9GFtwrmVmEMR/ZL6WyhyjMBndrE9hABlRI= github.com/posener/complete v1.2.3/go.mod h1:WZIdtGGp+qx0sLrYKtIRAruyNpv6hFCicSgv7Sy7s/s= github.com/prashantv/gostub v1.1.0 h1:BTyx3RfQjRHnUWaGF9oQos79AlQ5k8WNktv7VGvVH4g= -github.com/prashantv/gostub v1.1.0/go.mod h1:A5zLQHz7ieHGG7is6LLXLz7I8+3LZzsrV0P1IAHhP5U= github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw= github.com/prometheus/client_golang v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5FsnadC4Ky3P0J6CfImo= github.com/prometheus/client_golang v1.7.1/go.mod h1:PY5Wy2awLA44sXw4AOSfFBetzPP4j5+D6mVACh+pe2M= github.com/prometheus/client_golang v1.11.1/go.mod h1:Z6t4BnS23TR94PD6BsDNk8yVqroYurpAkEiz0P2BEV0= -github.com/prometheus/client_golang v1.16.0 h1:yk/hx9hDbrGHovbci4BY+pRMfSuuat626eFsHb7tmT8= -github.com/prometheus/client_golang v1.16.0/go.mod h1:Zsulrv/L9oM40tJ7T815tM89lFEugiJ9HzIqaAx4LKc= github.com/prometheus/client_golang v1.17.0 h1:rl2sfwZMtSthVU752MqfjQozy7blglC+1SOtjMAMh+Q= github.com/prometheus/client_golang v1.17.0/go.mod h1:VeL+gMmOAxkS2IqfCq0ZmHSL+LjWfWDUmp1mBz9JgUY= github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/client_model v0.2.0/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= -github.com/prometheus/client_model v0.4.0 h1:5lQXD3cAg1OXBf4Wq03gTrXHeaV0TQvGfUooCfx1yqY= -github.com/prometheus/client_model v0.4.0/go.mod h1:oMQmHW1/JoDwqLtg57MGgP/Fb1CJEYF2imWWhWtMkYU= github.com/prometheus/client_model v0.5.0 h1:VQw1hfvPvk3Uv6Qf29VrPF32JB6rtbgI6cYPYQjL0Qw= github.com/prometheus/client_model v0.5.0/go.mod h1:dTiFglRmd66nLR9Pv9f0mZi7B7fk5Pm3gvsjB5tr+kI= github.com/prometheus/common v0.4.1/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= github.com/prometheus/common v0.10.0/go.mod h1:Tlit/dnDKsSWFlCLTWaA1cyBgKHSMdTB80sz/V91rCo= github.com/prometheus/common v0.26.0/go.mod h1:M7rCNAaPfAosfx8veZJCuw84e35h3Cfd9VFqTh1DIvc= -github.com/prometheus/common v0.44.0 h1:+5BrQJwiBB9xsMygAB3TNvpQKOwlkc25LbISbrdOOfY= -github.com/prometheus/common v0.44.0/go.mod h1:ofAIvZbQ1e/nugmZGz4/qCb9Ap1VoSTIO7x0VV9VvuY= github.com/prometheus/common v0.45.0 h1:2BGz0eBc2hdMDLnO/8n0jeB3oPrt2D08CekT0lneoxM= github.com/prometheus/common v0.45.0/go.mod h1:YJmSTw9BoKxJplESWWxlbyttQR4uaEcGyv9MZjVOJsY= github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= github.com/prometheus/procfs v0.1.3/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU= github.com/prometheus/procfs v0.6.0/go.mod h1:cz+aTbrPOrUb4q7XlbU9ygM+/jj0fzG6c1xBZuNvfVA= -github.com/prometheus/procfs v0.11.1 h1:xRC8Iq1yyca5ypa9n1EZnWZkt7dwcoRPQwX/5gwaUuI= -github.com/prometheus/procfs v0.11.1/go.mod h1:eesXgaPo1q7lBpVMoMy0ZOFTth9hBn4W/y0/p/ScXhY= github.com/prometheus/procfs v0.12.0 h1:jluTpSng7V9hY0O2R9DzzJHYb2xULk9VTR1V1R/k6Bo= github.com/prometheus/procfs v0.12.0/go.mod h1:pcuDEFsWDnvcgNzo4EEweacyhjeA9Zk3cnaOZAZEfOo= github.com/rhnvrm/simples3 v0.6.1/go.mod h1:Y+3vYm2V7Y4VijFoJHHTrja6OgPrJ2cBti8dPGkC3sA= @@ -293,7 +266,6 @@ github.com/rivo/uniseg v0.4.4 h1:8TfxU8dW6PdqD27gjM8MVNuicgxIjxpm4K7x4jp8sis= github.com/rivo/uniseg v0.4.4/go.mod h1:FN3SvrM+Zdj16jyLfmOkMNblXMcoc8DfTHruCPUcx88= github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6LYCDYWNEvQ= github.com/rogpeppe/go-internal v1.10.0 h1:TMyTOH3F/DB16zRVcYyreMH6GnZZrwQVAoYjRBZyWFQ= -github.com/rogpeppe/go-internal v1.10.0/go.mod h1:UQnix2H7Ngw/k4C5ijL5+65zddjncjaFoBhdsK/akog= github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= github.com/ryanuber/columnize v0.0.0-20160712163229-9b3edd62028f/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts= github.com/ryanuber/columnize v2.1.0+incompatible/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts= @@ -311,7 +283,6 @@ github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.5.0 h1:1zr/of2m5FGMsad5YfcqgdqdWrIhu+EBEJRhR1U7z/c= -github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo= github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= @@ -323,8 +294,6 @@ github.com/tidwall/pretty v1.2.1 h1:qjsOFOWWQl+N3RsoF5/ssm1pHmJJwhjlSbZ51I6wMl4= github.com/tidwall/pretty v1.2.1/go.mod h1:ITEVvHYasfjBbM0u2Pg8T2nJnzm8xPwvNhhsoaGGjNU= github.com/valyala/bytebufferpool v1.0.0 h1:GqA5TC/0021Y/b9FG4Oi9Mr3q7XYx6KllzawFIhcdPw= github.com/valyala/bytebufferpool v1.0.0/go.mod h1:6bBcMArwyJ5K/AmCkWv1jt77kVWyCJ6HpOuEn7z0Csc= -github.com/valyala/fasthttp v1.49.0 h1:9FdvCpmxB74LH4dPb7IJ1cOSsluR07XG3I1txXWwJpE= -github.com/valyala/fasthttp v1.49.0/go.mod h1:k2zXd82h/7UZc3VOdJ2WaUqt1uZ/XpXAfE9i+HBC3lA= github.com/valyala/fasthttp v1.50.0 h1:H7fweIlBm0rXLs2q0XbalvJ6r0CUPFWK3/bB4N13e9M= github.com/valyala/fasthttp v1.50.0/go.mod h1:k2zXd82h/7UZc3VOdJ2WaUqt1uZ/XpXAfE9i+HBC3lA= github.com/valyala/tcplisten v1.0.0 h1:rBHj/Xf+E1tRGZyWIWwJDiRY0zc1Js+CV5DqwacVSA8= @@ -337,35 +306,24 @@ gitlab.snapp.ir/security_regulatory/validator/pkg/sdk v0.2.2/go.mod h1:+0JXkekQp go.etcd.io/etcd/api/v3 v3.5.4/go.mod h1:5GB2vv4A4AOn3yk7MftYGHkUfGtDHnEraIjym4dYz5A= go.etcd.io/etcd/client/pkg/v3 v3.5.4/go.mod h1:IJHfcCEKxYu1Os13ZdwCwIUTUVGYTSAM3YSwc9/Ac1g= go.etcd.io/etcd/client/v3 v3.5.4/go.mod h1:ZaRkVgBZC+L+dLCjTcF1hRXpgZXQPOvnA/Ak/gq3kiY= -go.opentelemetry.io/otel v1.17.0 h1:MW+phZ6WZ5/uk2nd93ANk/6yJ+dVrvNWUjGhnnFU5jM= -go.opentelemetry.io/otel v1.17.0/go.mod h1:I2vmBGtFaODIVMBSTPVDlJSzBDNf93k60E6Ft0nyjo0= go.opentelemetry.io/otel v1.19.0 h1:MuS/TNf4/j4IXsZuJegVzI1cwut7Qc00344rgH7p8bs= go.opentelemetry.io/otel v1.19.0/go.mod h1:i0QyjOq3UPoTzff0PJB2N66fb4S0+rSbSB15/oyH9fY= go.opentelemetry.io/otel/exporters/jaeger v1.17.0 h1:D7UpUy2Xc2wsi1Ras6V40q806WM07rqoCWzXu7Sqy+4= go.opentelemetry.io/otel/exporters/jaeger v1.17.0/go.mod h1:nPCqOnEH9rNLKqH/+rrUjiMzHJdV1BlpKcTwRTyKkKI= -go.opentelemetry.io/otel/metric v1.17.0 h1:iG6LGVz5Gh+IuO0jmgvpTB6YVrCGngi8QGm+pMd8Pdc= -go.opentelemetry.io/otel/metric v1.17.0/go.mod h1:h4skoxdZI17AxwITdmdZjjYJQH5nzijUUjm+wtPph5o= go.opentelemetry.io/otel/metric v1.19.0 h1:aTzpGtV0ar9wlV4Sna9sdJyII5jTVJEvKETPiOKwvpE= go.opentelemetry.io/otel/metric v1.19.0/go.mod h1:L5rUsV9kM1IxCj1MmSdS+JQAcVm319EUrDVLrt7jqt8= -go.opentelemetry.io/otel/sdk v1.17.0 h1:FLN2X66Ke/k5Sg3V623Q7h7nt3cHXaW1FOvKKrW0IpE= -go.opentelemetry.io/otel/sdk v1.17.0/go.mod h1:U87sE0f5vQB7hwUoW98pW5Rz4ZDuCFBZFNUBlSgmDFQ= go.opentelemetry.io/otel/sdk v1.19.0 h1:6USY6zH+L8uMH8L3t1enZPR3WFEmSTADlqldyHtJi3o= go.opentelemetry.io/otel/sdk v1.19.0/go.mod h1:NedEbbS4w3C6zElbLdPJKOpJQOrGUJ+GfzpjUvI0v1A= -go.opentelemetry.io/otel/trace v1.17.0 h1:/SWhSRHmDPOImIAetP1QAeMnZYiQXrTy4fMMYOdSKWQ= -go.opentelemetry.io/otel/trace v1.17.0/go.mod h1:I/4vKTgFclIsXRVucpH25X0mpFSczM7aHeaz0ZBLWjY= go.opentelemetry.io/otel/trace v1.19.0 h1:DFVQmlVbfVeOuBRrwdtaehRrWiL1JoVs9CPIQ1Dzxpg= go.opentelemetry.io/otel/trace v1.19.0/go.mod h1:mfaSyvGyEJEI0nyV2I4qhNQnbBOUUmYZpYojqMnX2vo= go.uber.org/atomic v1.7.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc= go.uber.org/automaxprocs v1.5.3 h1:kWazyxZUrS3Gs4qUpbwo5kEIMGe/DAvi5Z4tl2NW4j8= go.uber.org/automaxprocs v1.5.3/go.mod h1:eRbA25aqJrxAbsLO0xy5jVwPt7FQnRgjW+efnwa1WM0= go.uber.org/goleak v1.2.0 h1:xqgm/S+aQvhWFTtR0XK3Jvg7z8kGV8P4X14IzwN3Eqk= -go.uber.org/goleak v1.2.0/go.mod h1:XJYK+MuIchqpmGmUSAzotztawfKvYLUIgg7guXrwVUo= go.uber.org/multierr v1.6.0/go.mod h1:cdWPpRnG4AhwMwsgIHip0KRBQjJy5kYEpYjJxpXp9iU= go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0= go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y= go.uber.org/zap v1.17.0/go.mod h1:MXVU+bhUf/A7Xi2HNOnopQOrmycQ5Ih87HtOu4q5SSo= -go.uber.org/zap v1.25.0 h1:4Hvk6GtkucQ790dqmj7l1eEnRdKm3k3ZUrUMS2d5+5c= -go.uber.org/zap v1.25.0/go.mod h1:JIAUzQIH94IC4fOJQm7gMmBJP5k7wQfdcnYdPoEXJYk= go.uber.org/zap v1.26.0 h1:sI7k6L95XOKS281NhVKOFCUNIvv9e0w4BF8N3u+tCRo= go.uber.org/zap v1.26.0/go.mod h1:dtElttAiwGvoJ/vj4IwHBS/gXsEu/pZ50mUIRWuG0so= golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= @@ -444,8 +402,6 @@ golang.org/x/sys v0.0.0-20210603081109-ebe580a85c40/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220908164124-27713097b956/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.11.0 h1:eG7RXZHdqOJ1i+0lgLgCpSXAp6M3LYlAo6osgSi0xOM= -golang.org/x/sys v0.11.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.13.0 h1:Af8nKPmuFypiUBjVoU9V20FiaFXOcuZI21p0ycVYYGE= golang.org/x/sys v0.13.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= @@ -505,7 +461,6 @@ gopkg.in/asn1-ber.v1 v1.0.0-20181015200546-f715ec2f112d/go.mod h1:cuepJuh7vyXfUy gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= -gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= gopkg.in/square/go-jose.v2 v2.3.1/go.mod h1:M9dMgbHiYLoDGQrXy7OpJDJWiKiU//h+vD76mk0e1AI= gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= From 0a23a1a3aabd32f9547ce6f5a7083e9a51f90cff Mon Sep 17 00:00:00 2001 From: Parham Alvani Date: Thu, 19 Oct 2023 12:06:58 +0000 Subject: [PATCH 449/660] feat: add client implementation for doing validation --- pkg/validator/client.go | 172 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 172 insertions(+) create mode 100644 pkg/validator/client.go diff --git a/pkg/validator/client.go b/pkg/validator/client.go new file mode 100644 index 00000000..3acb63e8 --- /dev/null +++ b/pkg/validator/client.go @@ -0,0 +1,172 @@ +package client + +import ( + "context" + "encoding/json" + "errors" + "fmt" + "io" + "net/http" + "strings" + "time" +) + +const ( + validateURI = "/api/v3/internal/validate" + authHeader = "Authorization" + UserDataHeader = "X-User-Data" + fingerprintHeader = "X-Fingerprint" + featureFlagsHeader = "X-Feature-Flags" + serviceNameHeader = "X-Service-Name" + + modeQueryParam = "mode" + fingerprintQueryParam = "fingerprint" + checksumQueryParam = "x-upstream-name" + subrequestQueryParam = "subrequest" +) + +type Client struct { + baseURL string + client *http.Client + timeout time.Duration + isOptional bool +} + +type Payload struct { + UserData UserData +} + +type UserData struct { + IAT int `json:"iat"` + Aud string `json:"aud"` + Iss int `json:"iss"` + Sub string `json:"sub"` + UserID int `json:"user_id"` + Email string `json:"email"` + Exp int `json:"exp"` + Locale string `json:"locale"` +} + +// New creates a new Client with default attributes. +func New(url string, timeout time.Duration) Client { + return Client{ + baseURL: url, + client: new(http.Client), + timeout: timeout, + isOptional: false, + } +} + +// WithOptionalValidate enables you to bypass the signature validation. +// If the validation of the JWT signature is optional for you, and you just want to extract +// the payload from the token, you can use the client in `WithOptionalValidate` mode. +func (c *Client) WithOptionalValidate() { + c.isOptional = true +} + +// Validate gets the parent context, headers, and JWT token and calls the validate API of the JWT validator service. +// The parent context is helpful in canceling the process in the upper hand (a function that used the SDK) and in case +// you have something like tracing spans in your context and want to extend these things in your custom HTTP handler. +// Otherwise, you can use `context.Background()`. +// The headers argument is used when you want to pass some headers like user-agent, +// X-Service-Name, X-App-Name, X-App-Version and +// X-App-Version-Code to the validator. It is extremely recommended to pass these headers (if you have them) because +// it increases the visibility in the logs and metrics of the JWT Validator service. +// You must place your Authorization header content in the bearerToken argument. +// Consider that the bearerToken must contain Bearer keyword and JWT. +// For `X-Service-Name` you should put your project/service name in this header. +func (c *Client) Validate(parentCtx context.Context, headers http.Header, bearerToken string) (*Payload, error) { + if headers.Get(serviceNameHeader) == "" { + return nil, errors.New("x-service-name can not be empty") + } + + segments := strings.Split(bearerToken, " ") + if len(segments) < 2 || strings.ToLower(segments[0]) != "bearer" { + return nil, errors.New("invalid jwt") + } + + ctx, cancel := context.WithTimeout(parentCtx, c.timeout) + defer cancel() + + url := c.baseURL + validateURI + + request, err := http.NewRequestWithContext(ctx, http.MethodGet, url, nil) + if err != nil { + return nil, err + } + + request.Header = headers + request.Header.Set(authHeader, bearerToken) + + query := request.URL.Query() + if c.isOptional { + query.Add(modeQueryParam, "optional") + } + + request.URL.RawQuery = query.Encode() + + response, err := c.client.Do(request) + if err != nil { + return nil, err + } + + closeBody(response) + + if response.StatusCode != http.StatusOK { + return nil, fmt.Errorf("invalid token: %s", response.Status) + } + + userDataHeader := response.Header.Get(UserDataHeader) + if userDataHeader == "" { + return nil, fmt.Errorf("invalid X-User-Data header") + } + + userData := map[string]interface{}{} + + if err := json.Unmarshal([]byte(userDataHeader), &userData); err != nil { + return nil, fmt.Errorf("X-User-Data header unmarshal failed: %s", err) + } + + payload := &Payload{UserData: UserData{}} + if iat, ok := userData["iat"].(float64); ok { + payload.UserData.IAT = int(iat) + } + + if aud, ok := userData["aud"].(string); ok { + payload.UserData.Aud = aud + } + + if iss, ok := userData["iss"].(float64); ok { + payload.UserData.Iss = int(iss) + } + + if sub, ok := userData["sub"].(string); ok { + payload.UserData.Sub = sub + } + + if userID, ok := userData["user_id"].(float64); ok { + payload.UserData.UserID = int(userID) + } + + if email, ok := userData["email"].(string); ok { + payload.UserData.Email = email + } + + if exp, ok := userData["exp"].(float64); ok { + payload.UserData.Exp = int(exp) + } + + if locale, ok := userData["locale"].(string); ok { + payload.UserData.Locale = locale + } + + return payload, nil +} + +// closeBody to avoid memory leak when reusing http connection. +func closeBody(response *http.Response) { + if response != nil { + _, _ = io.Copy(io.Discard, response.Body) + _ = response.Body.Close() + } +} From d3aa15f1d1f727d95eacfee06e0d984e6f7f7166 Mon Sep 17 00:00:00 2001 From: Parham Alvani Date: Thu, 19 Oct 2023 12:29:14 +0000 Subject: [PATCH 450/660] feat: update validator package --- internal/authenticator/auto_authenticator.go | 13 +++--- pkg/validator/client.go | 45 ++++++++------------ 2 files changed, 25 insertions(+), 33 deletions(-) diff --git a/internal/authenticator/auto_authenticator.go b/internal/authenticator/auto_authenticator.go index d41d7291..e447c224 100644 --- a/internal/authenticator/auto_authenticator.go +++ b/internal/authenticator/auto_authenticator.go @@ -9,6 +9,7 @@ import ( "github.com/snapp-incubator/soteria/internal/config" "github.com/snapp-incubator/soteria/internal/topics" "github.com/snapp-incubator/soteria/pkg/acl" + "github.com/snapp-incubator/soteria/pkg/validator" validatorSDK "gitlab.snapp.ir/security_regulatory/validator/pkg/sdk" ) @@ -26,12 +27,12 @@ type AutoAuthenticator struct { // isSuperuser is a flag that authenticator set it true when credentials is related to a superuser. func (a AutoAuthenticator) Auth(tokenString string) error { if _, err := a.Validator.Validate(context.Background(), &http.Header{ - "X-Service-Name": []string{"soteria"}, - "user-agent": []string{}, - "X-APP-Version-Code": []string{""}, - "X-APP-Version": []string{""}, - "X-APP-Name": []string{"soteria"}, - "locale": []string{"en-US"}, + validator.ServiceNameHeader: []string{"soteria"}, + "user-agent": []string{}, + "X-APP-Version-Code": []string{""}, + "X-APP-Version": []string{""}, + "X-APP-Name": []string{"soteria"}, + "locale": []string{"en-US"}, }, fmt.Sprintf("bearer %s", tokenString)); err != nil { return fmt.Errorf("token is invalid: %w", err) } diff --git a/pkg/validator/client.go b/pkg/validator/client.go index 3acb63e8..d25c5ade 100644 --- a/pkg/validator/client.go +++ b/pkg/validator/client.go @@ -1,4 +1,4 @@ -package client +package validator import ( "context" @@ -12,17 +12,12 @@ import ( ) const ( - validateURI = "/api/v3/internal/validate" - authHeader = "Authorization" - UserDataHeader = "X-User-Data" - fingerprintHeader = "X-Fingerprint" - featureFlagsHeader = "X-Feature-Flags" - serviceNameHeader = "X-Service-Name" - - modeQueryParam = "mode" - fingerprintQueryParam = "fingerprint" - checksumQueryParam = "x-upstream-name" - subrequestQueryParam = "subrequest" + ServiceNameHeader = "X-Service-Name" + + validateURI = "/api/v3/internal/validate" + authHeader = "Authorization" + userDataHeader = "X-User-Data" + modeQueryParam = "mode" ) type Client struct { @@ -33,10 +28,6 @@ type Client struct { } type Payload struct { - UserData UserData -} - -type UserData struct { IAT int `json:"iat"` Aud string `json:"aud"` Iss int `json:"iss"` @@ -76,7 +67,7 @@ func (c *Client) WithOptionalValidate() { // Consider that the bearerToken must contain Bearer keyword and JWT. // For `X-Service-Name` you should put your project/service name in this header. func (c *Client) Validate(parentCtx context.Context, headers http.Header, bearerToken string) (*Payload, error) { - if headers.Get(serviceNameHeader) == "" { + if headers.Get(ServiceNameHeader) == "" { return nil, errors.New("x-service-name can not be empty") } @@ -116,7 +107,7 @@ func (c *Client) Validate(parentCtx context.Context, headers http.Header, bearer return nil, fmt.Errorf("invalid token: %s", response.Status) } - userDataHeader := response.Header.Get(UserDataHeader) + userDataHeader := response.Header.Get(userDataHeader) if userDataHeader == "" { return nil, fmt.Errorf("invalid X-User-Data header") } @@ -127,37 +118,37 @@ func (c *Client) Validate(parentCtx context.Context, headers http.Header, bearer return nil, fmt.Errorf("X-User-Data header unmarshal failed: %s", err) } - payload := &Payload{UserData: UserData{}} + payload := new(Payload) if iat, ok := userData["iat"].(float64); ok { - payload.UserData.IAT = int(iat) + payload.IAT = int(iat) } if aud, ok := userData["aud"].(string); ok { - payload.UserData.Aud = aud + payload.Aud = aud } if iss, ok := userData["iss"].(float64); ok { - payload.UserData.Iss = int(iss) + payload.Iss = int(iss) } if sub, ok := userData["sub"].(string); ok { - payload.UserData.Sub = sub + payload.Sub = sub } if userID, ok := userData["user_id"].(float64); ok { - payload.UserData.UserID = int(userID) + payload.UserID = int(userID) } if email, ok := userData["email"].(string); ok { - payload.UserData.Email = email + payload.Email = email } if exp, ok := userData["exp"].(float64); ok { - payload.UserData.Exp = int(exp) + payload.Exp = int(exp) } if locale, ok := userData["locale"].(string); ok { - payload.UserData.Locale = locale + payload.Locale = locale } return payload, nil From 29a6766040766c65fc116e9da1acf2f926daed2d Mon Sep 17 00:00:00 2001 From: Parham Alvani Date: Thu, 19 Oct 2023 12:45:24 +0000 Subject: [PATCH 451/660] feat: completely remove dependencies --- go.mod | 1 - go.sum | 3 --- internal/authenticator/auto_authenticator.go | 5 ++--- internal/authenticator/builder.go | 6 +++--- 4 files changed, 5 insertions(+), 10 deletions(-) diff --git a/go.mod b/go.mod index cf7b7c24..ccdedb3b 100644 --- a/go.mod +++ b/go.mod @@ -12,7 +12,6 @@ require ( github.com/spf13/cobra v1.7.0 github.com/stretchr/testify v1.8.4 github.com/tidwall/pretty v1.2.1 - gitlab.snapp.ir/security_regulatory/validator/pkg/sdk v0.2.2 go.opentelemetry.io/otel v1.19.0 go.opentelemetry.io/otel/exporters/jaeger v1.17.0 go.opentelemetry.io/otel/sdk v1.19.0 diff --git a/go.sum b/go.sum index f9354d9d..07e25036 100644 --- a/go.sum +++ b/go.sum @@ -1,7 +1,6 @@ cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= -github.com/agiledragon/gomonkey/v2 v2.10.1 h1:FPJJNykD1957cZlGhr9X0zjr291/lbazoZ/dmc4mS4c= github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= @@ -301,8 +300,6 @@ github.com/valyala/tcplisten v1.0.0/go.mod h1:T0xQ8SeCZGxckz9qRXTfG43PvQ/mcWh7Fw github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.3.5/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= -gitlab.snapp.ir/security_regulatory/validator/pkg/sdk v0.2.2 h1:+JwjrfGwsdgojbfn26M4Af/ZzBHCsLyU9vNYWXe1HnM= -gitlab.snapp.ir/security_regulatory/validator/pkg/sdk v0.2.2/go.mod h1:+0JXkekQpl5kJvmIKyBH5EJLIj0u628fbk+GfaIS+3k= go.etcd.io/etcd/api/v3 v3.5.4/go.mod h1:5GB2vv4A4AOn3yk7MftYGHkUfGtDHnEraIjym4dYz5A= go.etcd.io/etcd/client/pkg/v3 v3.5.4/go.mod h1:IJHfcCEKxYu1Os13ZdwCwIUTUVGYTSAM3YSwc9/Ac1g= go.etcd.io/etcd/client/v3 v3.5.4/go.mod h1:ZaRkVgBZC+L+dLCjTcF1hRXpgZXQPOvnA/Ak/gq3kiY= diff --git a/internal/authenticator/auto_authenticator.go b/internal/authenticator/auto_authenticator.go index e447c224..8fa2d639 100644 --- a/internal/authenticator/auto_authenticator.go +++ b/internal/authenticator/auto_authenticator.go @@ -10,7 +10,6 @@ import ( "github.com/snapp-incubator/soteria/internal/topics" "github.com/snapp-incubator/soteria/pkg/acl" "github.com/snapp-incubator/soteria/pkg/validator" - validatorSDK "gitlab.snapp.ir/security_regulatory/validator/pkg/sdk" ) // AutoAuthenticator is responsible for Acl/Auth/Token of users. @@ -19,14 +18,14 @@ type AutoAuthenticator struct { TopicManager *topics.Manager Company string JwtConfig config.Jwt - Validator validatorSDK.Client + Validator validator.Client Parser *jwt.Parser } // Auth check user authentication by checking the user's token // isSuperuser is a flag that authenticator set it true when credentials is related to a superuser. func (a AutoAuthenticator) Auth(tokenString string) error { - if _, err := a.Validator.Validate(context.Background(), &http.Header{ + if _, err := a.Validator.Validate(context.Background(), http.Header{ validator.ServiceNameHeader: []string{"soteria"}, "user-agent": []string{}, "X-APP-Version-Code": []string{""}, diff --git a/internal/authenticator/builder.go b/internal/authenticator/builder.go index 314fdb49..ed2edf62 100644 --- a/internal/authenticator/builder.go +++ b/internal/authenticator/builder.go @@ -7,7 +7,7 @@ import ( "github.com/snapp-incubator/soteria/internal/config" "github.com/snapp-incubator/soteria/internal/topics" "github.com/snapp-incubator/soteria/pkg/acl" - validatorSDK "gitlab.snapp.ir/security_regulatory/validator/pkg/sdk" + "github.com/snapp-incubator/soteria/pkg/validator" "go.uber.org/zap" ) @@ -30,7 +30,7 @@ func (b Builder) Authenticators() map[string]Authenticator { b.Logger.Fatal("cannot create hash-id manager", zap.Error(err)) } - validatorClient := validatorSDK.New(b.ValidatorConfig.URL, b.ValidatorConfig.Timeout) + client := validator.New(b.ValidatorConfig.URL, b.ValidatorConfig.Timeout) var auth Authenticator @@ -47,7 +47,7 @@ func (b Builder) Authenticators() map[string]Authenticator { b.Logger.Named("topic-manager"), ), JwtConfig: vendor.Jwt, - Validator: validatorClient, + Validator: client, Parser: jwt.NewParser(), } } else { From 1d2363fc1887a78b552c79d92950cb39e5edcb31 Mon Sep 17 00:00:00 2001 From: Parham Alvani Date: Thu, 19 Oct 2023 12:52:42 +0000 Subject: [PATCH 452/660] feat: update readme --- .github/assets/logo.jpg | Bin 0 -> 239140 bytes README.md | 10 ++++++++++ 2 files changed, 10 insertions(+) create mode 100644 .github/assets/logo.jpg diff --git a/.github/assets/logo.jpg b/.github/assets/logo.jpg new file mode 100644 index 0000000000000000000000000000000000000000..e44d887878b30ca2a51f43462a6fd7ab8bd76295 GIT binary patch literal 239140 zcmb5VcT`j9);~^{>d=A^#7id$MFlo?v+K_HEUA_56XC@KUUuv|ev2xX`Nf-odN zAcfEo5a%ia(t-()P%JYRx@8n_uD&yKf4uMa{jT5o{rTH#opnCv?0xon*7KabpR>#P z&&q#ZDU2e2q>>dB0s|om>Iw=9Y6|*_$_k2y=)Vu3qU!&gafjISe{t*~2K}#$(jhib z`hVrAcU1mI{!ron(CGvPg)LBqM&lfbB4M&D^~m;tazwFq4|IByEr>5 zHvb=u|M`!Cf>QJU(fHpFDgR%5DE{B{pJxg_3hHWVN7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sMbQF0Q^f$P2i~>7IMat)wR1 z?|+O!HNILy1|=F*;2yU!O4lHSt$g#7;o1f4W8Ciw*HR+!`u*ixb*PWQsUTg+SJn}X=~ICfaS(G?NVap8 zbYBBT&m84SfvZc!^Sp8a5NW;KI{>tffd2r@A})7v{S=bOdf6P*9aaQBrDjRE_PO!=dw0yh8 ziJ2?9qcOmB*UGugkCi#X19s4Lf91m5IVTG&wHopN02r)+t7rXld0K)wYPHBt3(id` zNIp(-qSz;&cxYQ!PJ7M25xsN!#-Kg8!3|Go-}jaP+9s9GQID35<@JDQRE>jqFKJQb zefz}rz)q$KxVb;9n6RylLkgae+MIl2l%x@M@iK_xpD!6AuLZA@k*KjByedQxhWNp0 z07Bw{DmM4NaQ9=pAQC1CLczM{2{jC+k9Rd>?4!Zs0&jT>SFgN6+Ee_Vu~Wl`Uf13d uy Soteria +

+ +

+ +

+ GitHub Workflow Status + Codecov + GitHub repo size +

+ ## Introduction Soteria is responsible for Authentication and Authorization of every request sent to EMQ. From 22610ce36ec3b0dd699cf72d7c07eda9b388ec48 Mon Sep 17 00:00:00 2001 From: Parham Alvani Date: Thu, 19 Oct 2023 12:53:38 +0000 Subject: [PATCH 453/660] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 1d8b5fca..9330a29a 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@

Soteria

- +

From c542ee5d18d380df4abfd4748ede444d3e13ef3b Mon Sep 17 00:00:00 2001 From: Parham Alvani Date: Fri, 20 Oct 2023 05:04:05 +0000 Subject: [PATCH 454/660] fix: correct golang lint issues --- internal/authenticator/auto_authenticator_test.go | 4 ++-- internal/authenticator/manual_authenticator_test.go | 4 ++-- internal/cmd/root.go | 2 +- internal/cmd/serve/main.go | 2 +- internal/config/config.go | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/internal/authenticator/auto_authenticator_test.go b/internal/authenticator/auto_authenticator_test.go index f35a176b..25769808 100644 --- a/internal/authenticator/auto_authenticator_test.go +++ b/internal/authenticator/auto_authenticator_test.go @@ -8,12 +8,12 @@ import ( "time" "github.com/golang-jwt/jwt/v5" - "github.com/stretchr/testify/assert" - "github.com/stretchr/testify/suite" "github.com/snapp-incubator/soteria/internal/authenticator" "github.com/snapp-incubator/soteria/internal/config" "github.com/snapp-incubator/soteria/internal/topics" "github.com/snapp-incubator/soteria/pkg/acl" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/suite" "go.uber.org/zap" ) diff --git a/internal/authenticator/manual_authenticator_test.go b/internal/authenticator/manual_authenticator_test.go index bea1f384..1ebc7314 100644 --- a/internal/authenticator/manual_authenticator_test.go +++ b/internal/authenticator/manual_authenticator_test.go @@ -8,12 +8,12 @@ import ( "time" "github.com/golang-jwt/jwt/v5" - "github.com/stretchr/testify/assert" - "github.com/stretchr/testify/suite" "github.com/snapp-incubator/soteria/internal/authenticator" "github.com/snapp-incubator/soteria/internal/config" "github.com/snapp-incubator/soteria/internal/topics" "github.com/snapp-incubator/soteria/pkg/acl" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/suite" "go.uber.org/zap" ) diff --git a/internal/cmd/root.go b/internal/cmd/root.go index e9d1b119..adb76168 100644 --- a/internal/cmd/root.go +++ b/internal/cmd/root.go @@ -3,11 +3,11 @@ package cmd import ( "os" - "github.com/spf13/cobra" "github.com/snapp-incubator/soteria/internal/cmd/serve" "github.com/snapp-incubator/soteria/internal/config" "github.com/snapp-incubator/soteria/internal/logger" "github.com/snapp-incubator/soteria/internal/tracing" + "github.com/spf13/cobra" "go.uber.org/zap" ) diff --git a/internal/cmd/serve/main.go b/internal/cmd/serve/main.go index 897978cb..e7ec0706 100644 --- a/internal/cmd/serve/main.go +++ b/internal/cmd/serve/main.go @@ -7,10 +7,10 @@ import ( "os" "os/signal" - "github.com/spf13/cobra" "github.com/snapp-incubator/soteria/internal/api" "github.com/snapp-incubator/soteria/internal/authenticator" "github.com/snapp-incubator/soteria/internal/config" + "github.com/spf13/cobra" "go.opentelemetry.io/otel/trace" "go.uber.org/zap" ) diff --git a/internal/config/config.go b/internal/config/config.go index cb34c13d..0532435f 100644 --- a/internal/config/config.go +++ b/internal/config/config.go @@ -11,10 +11,10 @@ import ( "github.com/knadh/koanf/providers/env" "github.com/knadh/koanf/providers/file" "github.com/knadh/koanf/providers/structs" - "github.com/tidwall/pretty" "github.com/snapp-incubator/soteria/internal/logger" "github.com/snapp-incubator/soteria/internal/topics" "github.com/snapp-incubator/soteria/internal/tracing" + "github.com/tidwall/pretty" ) const ( From 77989ef0388d5e82647564f88c392b2ab5c41748 Mon Sep 17 00:00:00 2001 From: Parham Alvani Date: Fri, 20 Oct 2023 05:28:14 +0000 Subject: [PATCH 455/660] fix: correct lint issues --- pkg/validator/client.go | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/pkg/validator/client.go b/pkg/validator/client.go index d25c5ade..c60b6bd5 100644 --- a/pkg/validator/client.go +++ b/pkg/validator/client.go @@ -20,6 +20,13 @@ const ( modeQueryParam = "mode" ) +var ( + ErrEmptyServiceName = errors.New("x-service-name can not be empty") + ErrInvalidJWT = errors.New("invalid jwt") + ErrInvalidUserDataHeader = errors.New("invalid X-User-Data header") + ErrRequestFailed = errors.New("validator request failed") +) + type Client struct { baseURL string client *http.Client @@ -66,14 +73,15 @@ func (c *Client) WithOptionalValidate() { // You must place your Authorization header content in the bearerToken argument. // Consider that the bearerToken must contain Bearer keyword and JWT. // For `X-Service-Name` you should put your project/service name in this header. +// nolint: funlen, cyclop func (c *Client) Validate(parentCtx context.Context, headers http.Header, bearerToken string) (*Payload, error) { if headers.Get(ServiceNameHeader) == "" { - return nil, errors.New("x-service-name can not be empty") + return nil, ErrEmptyServiceName } segments := strings.Split(bearerToken, " ") if len(segments) < 2 || strings.ToLower(segments[0]) != "bearer" { - return nil, errors.New("invalid jwt") + return nil, ErrInvalidJWT } ctx, cancel := context.WithTimeout(parentCtx, c.timeout) @@ -83,7 +91,7 @@ func (c *Client) Validate(parentCtx context.Context, headers http.Header, bearer request, err := http.NewRequestWithContext(ctx, http.MethodGet, url, nil) if err != nil { - return nil, err + return nil, fmt.Errorf("validator creating request failed %w", err) } request.Header = headers @@ -98,24 +106,24 @@ func (c *Client) Validate(parentCtx context.Context, headers http.Header, bearer response, err := c.client.Do(request) if err != nil { - return nil, err + return nil, fmt.Errorf("validator sending request failed %w", err) } closeBody(response) if response.StatusCode != http.StatusOK { - return nil, fmt.Errorf("invalid token: %s", response.Status) + return nil, ErrRequestFailed } userDataHeader := response.Header.Get(userDataHeader) if userDataHeader == "" { - return nil, fmt.Errorf("invalid X-User-Data header") + return nil, ErrInvalidJWT } userData := map[string]interface{}{} if err := json.Unmarshal([]byte(userDataHeader), &userData); err != nil { - return nil, fmt.Errorf("X-User-Data header unmarshal failed: %s", err) + return nil, fmt.Errorf("X-User-Data header unmarshal failed: %w", err) } payload := new(Payload) From c5494b991700bf3e1ad8ecc73d54e0676895d331 Mon Sep 17 00:00:00 2001 From: Parham Alvani Date: Fri, 20 Oct 2023 05:30:27 +0000 Subject: [PATCH 456/660] fix: correct target name --- build/package/docker-bake.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/package/docker-bake.json b/build/package/docker-bake.json index 50c9d46a..b9429265 100644 --- a/build/package/docker-bake.json +++ b/build/package/docker-bake.json @@ -7,7 +7,7 @@ } }, "target": { - "koochooloo": { + "soteria": { "dockerfile": "build/package/Dockerfile", "tags": [ "ghcr.io/snapp-incubator/soteria" From 4521fb2bb4a78fdeda9391f1fb8eb5bec62ea7c2 Mon Sep 17 00:00:00 2001 From: Parham Alvani Date: Sat, 21 Oct 2023 03:03:35 +0000 Subject: [PATCH 457/660] feat: update configuration and tracing --- go.mod | 12 ++++++++++++ go.sum | 28 ++++++++++++++++++++++++++++ internal/config/config.go | 2 +- internal/tracing/config.go | 11 +++-------- internal/tracing/tracer.go | 11 +++++++---- 5 files changed, 51 insertions(+), 13 deletions(-) diff --git a/go.mod b/go.mod index ccdedb3b..4ae0248c 100644 --- a/go.mod +++ b/go.mod @@ -8,12 +8,14 @@ require ( github.com/gofiber/fiber/v2 v2.50.0 github.com/golang-jwt/jwt/v5 v5.0.0 github.com/knadh/koanf v1.5.0 + github.com/knadh/koanf/v2 v2.0.1 github.com/speps/go-hashids/v2 v2.0.1 github.com/spf13/cobra v1.7.0 github.com/stretchr/testify v1.8.4 github.com/tidwall/pretty v1.2.1 go.opentelemetry.io/otel v1.19.0 go.opentelemetry.io/otel/exporters/jaeger v1.17.0 + go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.19.0 go.opentelemetry.io/otel/sdk v1.19.0 go.opentelemetry.io/otel/trace v1.19.0 go.uber.org/automaxprocs v1.5.3 @@ -23,6 +25,7 @@ require ( require ( github.com/andybalholm/brotli v1.0.6 // indirect github.com/beorn7/perks v1.0.1 // indirect + github.com/cenkalti/backoff/v4 v4.2.1 // indirect github.com/cespare/xxhash/v2 v2.2.0 // indirect github.com/davecgh/go-spew v1.1.1 // indirect github.com/fatih/structs v1.1.0 // indirect @@ -30,7 +33,9 @@ require ( github.com/go-logr/logr v1.2.4 // indirect github.com/go-logr/stdr v1.2.2 // indirect github.com/gofiber/adaptor/v2 v2.2.1 // indirect + github.com/golang/protobuf v1.5.3 // indirect github.com/google/uuid v1.3.1 // indirect + github.com/grpc-ecosystem/grpc-gateway/v2 v2.18.0 // indirect github.com/inconshreveable/mousetrap v1.1.0 // indirect github.com/klauspost/compress v1.17.1 // indirect github.com/mattn/go-colorable v0.1.13 // indirect @@ -50,9 +55,16 @@ require ( github.com/valyala/bytebufferpool v1.0.0 // indirect github.com/valyala/fasthttp v1.50.0 // indirect github.com/valyala/tcplisten v1.0.0 // indirect + go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.19.0 // indirect go.opentelemetry.io/otel/metric v1.19.0 // indirect + go.opentelemetry.io/proto/otlp v1.0.0 // indirect go.uber.org/multierr v1.11.0 // indirect + golang.org/x/net v0.17.0 // indirect golang.org/x/sys v0.13.0 // indirect + golang.org/x/text v0.13.0 // indirect + google.golang.org/genproto/googleapis/api v0.0.0-20231016165738-49dd2c1f3d0b // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20231016165738-49dd2c1f3d0b // indirect + google.golang.org/grpc v1.59.0 // indirect google.golang.org/protobuf v1.31.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect ) diff --git a/go.sum b/go.sum index 07e25036..4610c9d0 100644 --- a/go.sum +++ b/go.sum @@ -30,6 +30,8 @@ github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+Ce 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/bgentry/speakeasy v0.1.0/go.mod h1:+zsyZBPWlz7T6j88CTgSN5bM796AkVf0kBD4zp0CCIs= +github.com/cenkalti/backoff/v4 v4.2.1 h1:y4OZtCnogmCPw98Zjyt5a6+QwPLGkiQsYW5oUqylYbM= +github.com/cenkalti/backoff/v4 v4.2.1/go.mod h1:Y3VNntkOUPxTVeUxJ/G5vcM//AlwfmyYozVcomhLiZE= github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= github.com/cespare/xxhash/v2 v2.2.0 h1:DC2CZ1Ep5Y4k3ZQ899DldepgrayRUGE6BBZ/cd9Cj44= @@ -98,6 +100,8 @@ github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw github.com/golang/protobuf v1.4.3/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= +github.com/golang/protobuf v1.5.3 h1:KhyjKVUg7Usr/dYsdSqoFveMYd5ko72D+zANwlG1mmg= +github.com/golang/protobuf v1.5.3/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= github.com/golang/snappy v0.0.1/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= @@ -115,7 +119,10 @@ github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+ github.com/google/uuid v1.3.1 h1:KjJaJ9iWZ3jOFZIf1Lqf4laDRCasjl0BCmnEGxkdLb4= github.com/google/uuid v1.3.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0/go.mod h1:8NvIoxWQoOIhqOTXgfV/d3M/q6VIi02HzZEHgUlZvzk= +github.com/grpc-ecosystem/grpc-gateway v1.16.0 h1:gmcG1KaJ57LophUzW0Hy8NmPhnMZb4M0+kPpLofRdBo= github.com/grpc-ecosystem/grpc-gateway v1.16.0/go.mod h1:BDjrQk3hbvj6Nolgz8mAMFbcEtjT1g+wF4CSlocrBnw= +github.com/grpc-ecosystem/grpc-gateway/v2 v2.18.0 h1:RtRsiaGvWxcwd8y3BiRZxsylPT8hLWZ5SPcfI+3IDNk= +github.com/grpc-ecosystem/grpc-gateway/v2 v2.18.0/go.mod h1:TzP6duP4Py2pHLVPPQp42aoYI92+PCrVotyR5e8Vqlk= github.com/hashicorp/consul/api v1.13.0/go.mod h1:ZlVrynguJKcYr54zGaDbaL3fOvKC9m72FhPvA8T35KQ= github.com/hashicorp/consul/sdk v0.8.0/go.mod h1:GBvyrGALthsZObzUGsfgHZQDXjg4lOjagTIwIR1vPms= github.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= @@ -170,6 +177,9 @@ github.com/klauspost/compress v1.17.1 h1:NE3C767s2ak2bweCZo3+rdP4U/HoyVXLv/X9f2g github.com/klauspost/compress v1.17.1/go.mod h1:ntbaceVETuRiXiv4DpjP66DpAtAGkEQskQzEyD//IeE= github.com/knadh/koanf v1.5.0 h1:q2TSd/3Pyc/5yP9ldIrSdIz26MCcyNQzW0pEAugLPNs= github.com/knadh/koanf v1.5.0/go.mod h1:Hgyjp4y8v44hpZtPzs7JZfRAW5AhN7KfZcwv1RYggDs= +github.com/knadh/koanf/maps v0.1.1 h1:G5TjmUh2D7G2YWf5SQQqSiHRJEjaicvU0KpypqB3NIs= +github.com/knadh/koanf/v2 v2.0.1 h1:1dYGITt1I23x8cfx8ZnldtezdyaZtfAuRtIFOiRzK7g= +github.com/knadh/koanf/v2 v2.0.1/go.mod h1:ZeiIlIDXTE7w1lMT6UVcNiRAS2/rCeLn/GdLNvY1Dus= github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/konsorten/go-windows-terminal-sequences v1.0.3/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc= @@ -195,6 +205,7 @@ github.com/mattn/go-isatty v0.0.20/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D github.com/mattn/go-runewidth v0.0.15 h1:UNAjwbU9l54TA3KzvqLGxwWjHmMgBUVhBiTjelZgg3U= github.com/mattn/go-runewidth v0.0.15/go.mod h1:Jdepj2loyihRzMpdS35Xk/zdY8IAYHsh153qUoGf23w= github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= +github.com/matttproud/golang_protobuf_extensions v1.0.4 h1:mmDVorXM7PCGKw94cs5zkfA9PSy5pEvNWRP0ET0TIVo= github.com/matttproud/golang_protobuf_extensions/v2 v2.0.0 h1:jWpvCLoY8Z/e3VKvlsiIGKtc+UG6U5vzxaoagmhXfyg= github.com/matttproud/golang_protobuf_extensions/v2 v2.0.0/go.mod h1:QUyp042oQthUoa9bqDv0ER0wrtXnBruoNd7aNjkbP+k= github.com/miekg/dns v1.1.26/go.mod h1:bPDLeHnStXmXAq1m/Ch/hvfNHr14JKNPMBo3VZKjuso= @@ -307,16 +318,23 @@ go.opentelemetry.io/otel v1.19.0 h1:MuS/TNf4/j4IXsZuJegVzI1cwut7Qc00344rgH7p8bs= go.opentelemetry.io/otel v1.19.0/go.mod h1:i0QyjOq3UPoTzff0PJB2N66fb4S0+rSbSB15/oyH9fY= go.opentelemetry.io/otel/exporters/jaeger v1.17.0 h1:D7UpUy2Xc2wsi1Ras6V40q806WM07rqoCWzXu7Sqy+4= go.opentelemetry.io/otel/exporters/jaeger v1.17.0/go.mod h1:nPCqOnEH9rNLKqH/+rrUjiMzHJdV1BlpKcTwRTyKkKI= +go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.19.0 h1:Mne5On7VWdx7omSrSSZvM4Kw7cS7NQkOOmLcgscI51U= +go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.19.0/go.mod h1:IPtUMKL4O3tH5y+iXVyAXqpAwMuzC1IrxVS81rummfE= +go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.19.0 h1:3d+S281UTjM+AbF31XSOYn1qXn3BgIdWl8HNEpx08Jk= +go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.19.0/go.mod h1:0+KuTDyKL4gjKCF75pHOX4wuzYDUZYfAQdSu43o+Z2I= go.opentelemetry.io/otel/metric v1.19.0 h1:aTzpGtV0ar9wlV4Sna9sdJyII5jTVJEvKETPiOKwvpE= go.opentelemetry.io/otel/metric v1.19.0/go.mod h1:L5rUsV9kM1IxCj1MmSdS+JQAcVm319EUrDVLrt7jqt8= go.opentelemetry.io/otel/sdk v1.19.0 h1:6USY6zH+L8uMH8L3t1enZPR3WFEmSTADlqldyHtJi3o= go.opentelemetry.io/otel/sdk v1.19.0/go.mod h1:NedEbbS4w3C6zElbLdPJKOpJQOrGUJ+GfzpjUvI0v1A= go.opentelemetry.io/otel/trace v1.19.0 h1:DFVQmlVbfVeOuBRrwdtaehRrWiL1JoVs9CPIQ1Dzxpg= go.opentelemetry.io/otel/trace v1.19.0/go.mod h1:mfaSyvGyEJEI0nyV2I4qhNQnbBOUUmYZpYojqMnX2vo= +go.opentelemetry.io/proto/otlp v1.0.0 h1:T0TX0tmXU8a3CbNXzEKGeU5mIVOdf0oykP+u2lIVU/I= +go.opentelemetry.io/proto/otlp v1.0.0/go.mod h1:Sy6pihPLfYHkr3NkUbEhGHFhINUSI/v80hjKIs5JXpM= go.uber.org/atomic v1.7.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc= go.uber.org/automaxprocs v1.5.3 h1:kWazyxZUrS3Gs4qUpbwo5kEIMGe/DAvi5Z4tl2NW4j8= go.uber.org/automaxprocs v1.5.3/go.mod h1:eRbA25aqJrxAbsLO0xy5jVwPt7FQnRgjW+efnwa1WM0= go.uber.org/goleak v1.2.0 h1:xqgm/S+aQvhWFTtR0XK3Jvg7z8kGV8P4X14IzwN3Eqk= +go.uber.org/goleak v1.2.1 h1:NBol2c7O1ZokfZ0LEU9K6Whx/KnwvepVetCUhtKja4A= go.uber.org/multierr v1.6.0/go.mod h1:cdWPpRnG4AhwMwsgIHip0KRBQjJy5kYEpYjJxpXp9iU= go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0= go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y= @@ -354,6 +372,8 @@ golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwY golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM= golang.org/x/net v0.0.0-20210410081132-afb366fc7cd1/go.mod h1:9tjilg8BloeKEkVJvy7fQ90B1CfIiPueXVOjqfkSzI8= +golang.org/x/net v0.17.0 h1:pVaXccu2ozPjCXewfr1S7xza/zcXTity9cCdXQYSjIM= +golang.org/x/net v0.17.0/go.mod h1:NxSsAGuq816PNPmqtQdLE42eU2Fs7NoRIZrHJAlaCOE= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= @@ -408,6 +428,8 @@ golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= +golang.org/x/text v0.13.0 h1:ablQoSUd0tRdKxZewP80B+BaqeKJuVhuRxj/dkrun3k= +golang.org/x/text v0.13.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= @@ -432,6 +454,10 @@ google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98 google.golang.org/genproto v0.0.0-20200513103714-09dca8ec2884/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo= google.golang.org/genproto v0.0.0-20210602131652-f16073e35f0c/go.mod h1:UODoCrxHCcBojKKwX1terBiRUaqAsFqJiF615XL43r0= +google.golang.org/genproto/googleapis/api v0.0.0-20231016165738-49dd2c1f3d0b h1:CIC2YMXmIhYw6evmhPxBKJ4fmLbOFtXQN/GV3XOZR8k= +google.golang.org/genproto/googleapis/api v0.0.0-20231016165738-49dd2c1f3d0b/go.mod h1:IBQ646DjkDkvUIsVq/cc03FUFQ9wbZu7yE396YcL870= +google.golang.org/genproto/googleapis/rpc v0.0.0-20231016165738-49dd2c1f3d0b h1:ZlWIi1wSK56/8hn4QcBp/j9M7Gt3U/3hZw3mC7vDICo= +google.golang.org/genproto/googleapis/rpc v0.0.0-20231016165738-49dd2c1f3d0b/go.mod h1:swOH3j0KzcDDgGUWr+SNpyTen5YrXjS3eyPzFYKc6lc= google.golang.org/grpc v1.14.0/go.mod h1:yo6s7OP7yaDglbqo1J04qKzAhqBH6lvTonzMVmEdcZw= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= google.golang.org/grpc v1.22.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= @@ -440,6 +466,8 @@ google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQ google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= google.golang.org/grpc v1.33.1/go.mod h1:fr5YgcSWrqhRRxogOsw7RzIpsmvOZ6IcH4kBYTpR3n0= google.golang.org/grpc v1.38.0/go.mod h1:NREThFqKR1f3iQ6oBuvc5LadQuXVGo9rkm5ZGrQdJfM= +google.golang.org/grpc v1.59.0 h1:Z5Iec2pjwb+LEOqzpB2MR12/eKFhDPhuqW91O+4bwUk= +google.golang.org/grpc v1.59.0/go.mod h1:aUPDwccQo6OTjy7Hct4AfBPD1GptF4fyUjIkQ9YtF98= 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= diff --git a/internal/config/config.go b/internal/config/config.go index 0532435f..101cf9f4 100644 --- a/internal/config/config.go +++ b/internal/config/config.go @@ -6,11 +6,11 @@ import ( "strings" "time" - "github.com/knadh/koanf" "github.com/knadh/koanf/parsers/yaml" "github.com/knadh/koanf/providers/env" "github.com/knadh/koanf/providers/file" "github.com/knadh/koanf/providers/structs" + "github.com/knadh/koanf/v2" "github.com/snapp-incubator/soteria/internal/logger" "github.com/snapp-incubator/soteria/internal/topics" "github.com/snapp-incubator/soteria/internal/tracing" diff --git a/internal/tracing/config.go b/internal/tracing/config.go index 041ebcb2..0552396d 100644 --- a/internal/tracing/config.go +++ b/internal/tracing/config.go @@ -1,12 +1,7 @@ package tracing type Config struct { - Enabled bool `json:"enabled,omitempty" koanf:"enabled"` - Agent `json:"agent,omitempty" koanf:"agent"` - Ratio float64 `json:"ratio,omitempty" koanf:"ratio"` -} - -type Agent struct { - Host string `json:"host,omitempty" koanf:"host"` - Port string `json:"port,omitempty" koanf:"port"` + Enabled bool `json:"enabled,omitempty" koanf:"enabled"` + Endpoint string `json:"endpoint,omitempty" koanf:"endpoint"` + Ratio float64 `json:"ratio,omitempty" koanf:"ratio"` } diff --git a/internal/tracing/tracer.go b/internal/tracing/tracer.go index 221a6159..361144cc 100644 --- a/internal/tracing/tracer.go +++ b/internal/tracing/tracer.go @@ -1,8 +1,10 @@ package tracing import ( + "context" + "go.opentelemetry.io/otel" - "go.opentelemetry.io/otel/exporters/jaeger" // nolint: staticcheck + "go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc" "go.opentelemetry.io/otel/propagation" "go.opentelemetry.io/otel/sdk/resource" sdktrace "go.opentelemetry.io/otel/sdk/trace" @@ -16,11 +18,12 @@ func New(cfg Config, logger *zap.Logger) trace.Tracer { //nolint: ireturn return trace.NewNoopTracerProvider().Tracer("snapp.dispatching") } - exporter, err := jaeger.New( - jaeger.WithAgentEndpoint(jaeger.WithAgentHost(cfg.Agent.Host), jaeger.WithAgentPort(cfg.Agent.Port)), + exporter, err := otlptracegrpc.New( + context.Background(), + otlptracegrpc.WithEndpoint(cfg.Endpoint), otlptracegrpc.WithInsecure(), ) if err != nil { - logger.Fatal("failed to initialize export pipeline", zap.Error(err)) + log.Fatalf("failed to initialize export pipeline for traces (otlp with grpc): %v", err) } res, err := resource.Merge( From ab7fd1bb10e19a5edd7b250a55f558f4d567a71c Mon Sep 17 00:00:00 2001 From: Parham Alvani Date: Sat, 21 Oct 2023 03:05:59 +0000 Subject: [PATCH 458/660] fix: correct logger usage --- internal/tracing/tracer.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/tracing/tracer.go b/internal/tracing/tracer.go index 361144cc..857c3764 100644 --- a/internal/tracing/tracer.go +++ b/internal/tracing/tracer.go @@ -23,7 +23,7 @@ func New(cfg Config, logger *zap.Logger) trace.Tracer { //nolint: ireturn otlptracegrpc.WithEndpoint(cfg.Endpoint), otlptracegrpc.WithInsecure(), ) if err != nil { - log.Fatalf("failed to initialize export pipeline for traces (otlp with grpc): %v", err) + logger.Fatal("failed to initialize export pipeline for traces (otlp with grpc)", zap.Error(err)) } res, err := resource.Merge( From d993c4be60e734e830398fa24eb7d11675e3a9c4 Mon Sep 17 00:00:00 2001 From: Parham Alvani Date: Sat, 21 Oct 2023 03:09:07 +0000 Subject: [PATCH 459/660] fix: correct default configuration --- internal/config/default.go | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/internal/config/default.go b/internal/config/default.go index d3ae319d..0fb274bd 100644 --- a/internal/config/default.go +++ b/internal/config/default.go @@ -28,12 +28,9 @@ func Default() Config { }, HTTPPort: DefaultHTTPPort, Tracer: tracing.Config{ - Enabled: false, - Ratio: 0.1, - Agent: tracing.Agent{ - Host: "127.0.0.1", - Port: "6831", - }, + Enabled: false, + Ratio: 0.1, + Endpoint: "127.0.0.1:4317", }, Validator: Validator{ URL: "http://validator-lb", @@ -42,7 +39,7 @@ func Default() Config { } } -//nolint:funlen +// nolint: funlen func SnappVendor() Vendor { return Vendor{ UseValidator: false, From e11a021902f15e72b61d30a26c8b04fbc9e0caef Mon Sep 17 00:00:00 2001 From: Parham Alvani Date: Sat, 21 Oct 2023 03:11:38 +0000 Subject: [PATCH 460/660] feat: update vendor documents --- docs/vendor.md | 59 +++++++++++++++++++++++++++++++++----------------- 1 file changed, 39 insertions(+), 20 deletions(-) diff --git a/docs/vendor.md b/docs/vendor.md index 9b57f737..b109885d 100644 --- a/docs/vendor.md +++ b/docs/vendor.md @@ -1,18 +1,19 @@ # Add Vendor -add vendors in the <>/values.yaml. + +Add vendors in the `/values.yaml`. # Vendor Configuration + ```yaml company: "<>" driver_salt: "" passenger_salt: "" passenger_hash_length: 15 driver_hash_length: 15 -allowed_access_types: [ "pub", "sub" ] +allowed_access_types: ["pub", "sub"] keys: iss-0: "key-value" iss-1: "key-value" - ... iss_entity_map: 0: "entity-0" 1: "entity-1" @@ -32,12 +33,16 @@ topics: ``` ## HashID Manager -`driver_salt` ,`passenger_salt`, `passenger_hash_length`, `driver_hash_length` are used for HashIDManager. This component only works for passenger and driver issuers. + +`driver_salt`,`passenger_salt`, `passenger_hash_length`, `driver_hash_length` are used for HashIDManager. +This component only works for passenger and driver issuers. ## Keys -this is a map of issuer to key for opening jwt token. + +This is a map of issuer to key for opening JWT token. ## IssEntityMap & IssPeerMap + These two configuration map iss to entity and peer respectively. **Note**: default case is `required` @@ -64,51 +69,57 @@ In the example above, we have two maps for entity & peer maps. As it's clear for In the topic example, we have an accesses section in which **0** is mapped to **2** and **1** is mapped to **-1** which can be interpreted as a map from **IssEntity's Keys** to **Access Types**. In the other words this structure means: -* **Driver** has a **Pub** access on topic -* **Passenger** has a **None** access on topic (No Access) +- **Driver** has a **Pub** access on topic +- **Passenger** has a **None** access on topic (No Access) ## JWT + This is the jwt configuration. `iss_name` and `sub_name` are the name of issuer and subject in the jwt token's payload respectively. `signing_method` is the method that is used to sign the jwt token. Here are list of different signing methods + - ES384 -- RS512 * +- RS512 \* - PS512 -- RS384 * -- HS256 * -- HS384 * -- RS256 * +- RS384 \* +- HS256 \* +- HS384 \* +- RS256 \* - PS384 - ES256 - ES512 - EdDSA -- HS512 * +- HS512 \* - PS256 **Note**: only the methods with `*` are supported for now. - # Topic Configuration + ```yaml type: "<>" template: "<>" hash_type: 0|1 accesses: - iss-0: "<>" - iss-1: "<>" - ... + iss-0: "<>" + iss-1: "<>" + ... ``` ## Template + Topic template is a string consists of [Variables](##Available_Variables) and [Functions](##Available_Functions) and regular expressions. Variables and Function are replaced first and then the whole template will compile as a regular expression. The end result will be compared against the requested topic. ### Example + This is template topic given in `vendor:topics[#]:template`. + ```regex ^{{.company}}/driver/{{HashID .hashType .sub (IssToSnappID .iss)}}/location/[a-zA-Z0-9-_]+$ ``` After parsing the template we get something like this + ```regex // company=snapp // hashType=0 @@ -118,6 +129,7 @@ After parsing the template we get something like this ``` Now if the requested topic match the create topic it is consider a valid topic for that particular user. + ```text requested_topic: snapp/driver/D96ZbvJakLp4PYd/location/23fw49vxd created_topic_regex: ^snapp/driver/D96ZbvJakLp4PYd/location/[a-zA-Z0-9-_]+$ @@ -126,7 +138,9 @@ created_topic_regex: ^snapp/driver/D96ZbvJakLp4PYd/location/[a-zA-Z0-9-_]+$ # Values ## Available Variables + These are the variables available to use in the topic templates. + - iss issuer obtained from jwt-token - sub @@ -137,12 +151,15 @@ These are the variables available to use in the topic templates. | HashType | Value | | -------- | ----- | | HashID | 0 | - | MD5 | 1 | + | MD5 | 1 | + - company company field defined in vendor configuration ## Available Functions + These are the function available to use in the topic templates. + - IssToEntity(iss string) string convert `iss` obtained from jwt-token to defined entity in `issEntityMap` - IssToPeer(iss string) string @@ -155,6 +172,7 @@ These are the function available to use in the topic templates. **Note**: snappid.audience only is available for issuer 0 and 1 which are for driver and passenger respectively. ## Accesses + List of all types of access on a topic. | Access | Value | @@ -162,12 +180,13 @@ List of all types of access on a topic. | Subscribe | 1 | | Publish | 2 | | Subscribe & Publish | 3 | -| None | -1 | +| None | -1 | ## Suggested Issuers + Use any value for issuer but if you have an entity called `Driver` or `Passenger`, we recommend to use the following issuers for them. | Issuer | Value | | --------- | ----- | | Driver | 0 | -| Passenger | 1 | +| Passenger | 1 | From c2d420108eea83e22db4466f59d51789fab87b01 Mon Sep 17 00:00:00 2001 From: Parham Alvani Date: Sat, 21 Oct 2023 03:13:02 +0000 Subject: [PATCH 461/660] feat: update readme --- README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 9330a29a..4c311e82 100644 --- a/README.md +++ b/README.md @@ -12,9 +12,9 @@ ## Introduction -Soteria is responsible for Authentication and Authorization of every request sent to EMQ. +Soteria is responsible for Authentication and Authorization of every request sent to [EMQ](https://github.com/emqx/emqx/). The following configuration in [HOCON](https://github.com/lightbend/config/blob/master/HOCON.md) -format, configure EMQX to use HTTP Service for Authentication and Authorization. +format, configure EMQ to use HTTP Service for Authentication and Authorization. ```hocon { @@ -60,7 +60,7 @@ format, configure EMQX to use HTTP Service for Authentication and Authorization. We are using the [Authentication HTTP Service](https://www.emqx.io/docs/en/v5.2/access-control/authn/http.html) and [Authorization HTTP Service](https://www.emqx.io/docs/en/v5.2/access-control/authn/http.html) plugins of EMQ for forwarding these requests to Soteria and doing Authentication and Authorization. -EMQX has caching mechanism, but it sends requests almost for each Publish message to Soteria. +EMQ has caching mechanism, but it sends requests almost for each Publish message to Soteria. PS: On Subscribe we have only one message from client that need authorization and other messages are coming from server. ## Deployment From a55b61128ac9dd2331f10c6162ff879314f9c301 Mon Sep 17 00:00:00 2001 From: Parham Alvani Date: Sat, 21 Oct 2023 03:26:06 +0000 Subject: [PATCH 462/660] feat: update readme --- README.md | 204 +++++++++++++++++++++++++++++++++++++++++++++++-- docs/vendor.md | 192 ---------------------------------------------- 2 files changed, 198 insertions(+), 198 deletions(-) delete mode 100644 docs/vendor.md diff --git a/README.md b/README.md index 4c311e82..efdcb327 100644 --- a/README.md +++ b/README.md @@ -63,13 +63,205 @@ plugins of EMQ for forwarding these requests to Soteria and doing Authentication EMQ has caching mechanism, but it sends requests almost for each Publish message to Soteria. PS: On Subscribe we have only one message from client that need authorization and other messages are coming from server. -## Deployment +## Architecture -### Add Vendor +![arch](docs/arch.png) -Soteria is a multivendor authenticator for EMQX. -Follow instruction from [here](docs/vendor.md) +## Support Vendors -### Architecture +Soteria supports having multiple vendors at the same time. +Means you can use single cluster for multiple companies at the same time and validate their tokens +and control accesses. -![architectureOfSoteria](docs/arch.png) +### Vendor Configuration + +```yaml +company: "<>" +driver_salt: "" +passenger_salt: "" +passenger_hash_length: 15 +driver_hash_length: 15 +allowed_access_types: ["pub", "sub"] +keys: + iss-0: "key-value" + iss-1: "key-value" +iss_entity_map: + 0: "entity-0" + 1: "entity-1" + default: "default-entity" +iss_peer_map: + 0: "peer-0" + 1: "peer-1" + default: "default-peer" +jwt: + iss_name: "iss" + sub_name: "sub" + signing_method: "RS512" +topics: + - topic1 + - topic2 + - ... +``` + +### HashID Manager + +`driver_salt`,`passenger_salt`, `passenger_hash_length`, `driver_hash_length` are used for HashIDManager. +This component only works for passenger and driver issuers. + +### Keys + +This is a map of issuer to key for opening JWT token. + +#### IssEntityMap & IssPeerMap + +These two configuration map iss to entity and peer respectively. + +**Note**: default case is `required` + +```yaml +iss_entity_map: + 0: "driver" + 1: "passenger" + default: "none" +iss_peer_map: + 0: "passenger" + 1: "driver" + default: "none" +``` + +In the example above, we have two maps for entity & peer maps. As it's clear for **entity** structure **0** and **1** is mapped to **driver** and **passenger**, respectively. Vice Versa, for peer structure it can be seen that **1** and **0** is mapped to **driver** and **passenger**. We have also the **default** key for both two cases. + +In the topic example, we have an accesses section in which **0** is mapped to **2** and **1** is mapped to **-1** which can be interpreted as a map from **IssEntity's Keys** to **Access Types**. In the other words this structure means: + +- **Driver** has a **Pub** access on topic +- **Passenger** has a **None** access on topic (No Access) + +### JWT + +This is the JWT configuration. `iss_name` and `sub_name` are the name of issuer +and subject in the JWT token's payload respectively. + +`signing_method` is the method that is used to sign the JWT token. +Here are list of different signing methods + +- ES384 +- RS512 \* +- PS512 +- RS384 \* +- HS256 \* +- HS384 \* +- RS256 \* +- PS384 +- ES256 +- ES512 +- EdDSA +- HS512 \* +- PS256 + **Note**: only the methods with `*` are supported for now. + +### Topic Configuration + +```yaml +type: "<>" +template: "<>" +hash_type: 0|1 +accesses: + iss-0: "<>" + iss-1: "<>" +``` + +### Template + +Topic template is a string consist of [Variables](##Available_Variables) and [Functions](##Available_Functions) +and regular expressions. + +Variables and Function are replaced first, and then the whole template will compile as a regular expression. +The end result will be compared against the requested topic. + +#### Example + +This is template topic given in `vendor:topics[#]:template`. + +```yaml +- type: driver_location + template: ^{{.company}}/driver/{{.sub}}/location$ + accesses: + 0: "2" + 1: "-1" +``` + +```regex +^{{.company}}/driver/{{HashID .hashType .sub (IssToSnappID .iss)}}/location/[a-zA-Z0-9-_]+$ +``` + +After parsing the template we get something like this + +```regex +// company=snapp +// hashType=0 +// sub=D96ZbvJakLp4PYd +// iss=0 +^snapp/driver/D96ZbvJakLp4PYd/location/[a-zA-Z0-9-_]+$ +``` + +Now if the requested topic match the created topic it is considered as a valid topic for that particular user. + +```text +requested_topic: snapp/driver/D96ZbvJakLp4PYd/location/23fw49vxd +created_topic_regex: ^snapp/driver/D96ZbvJakLp4PYd/location/[a-zA-Z0-9-_]+$ +``` + +#### Available Variables + +These are the variables available to use in the topic templates. + +- `iss` + issuer obtained from JWT token +- `sub` + subject obtained from JWT token +- `hashType` + Hash type field defined in topic template configuration + + | HashType | Value | + | -------- | ----- | + | HashID | 0 | + | MD5 | 1 | + +- `company` + company field defined in vendor configuration + +#### Available Functions + +These are the function available to use in the topic templates. + +- `IssToEntity(iss string) string` + convert `iss` obtained from JWT token to defined entity in `issEntityMap` +- `IssToPeer(iss string) string` + convert `iss` obtained from JWT token to define peer in `issPeerMap` +- `IssToSnappID(iss string) string` + convert `iss` obtained from JWT token to `snappid.audience` +- `HashID(hashType int, sub string, snappID snappid.audience)` + generated `hashID` for the given `subject` base on the `hashType` and `snappid.audience` + +**Note**: `snappid.audience` only is available for issuer 0 and 1 which are for driver and passenger respectively. + +#### Accesses + +List of all types of access on a topic. + +| Access | Value | +| ------------------- | ----- | +| Subscribe | 1 | +| Publish | 2 | +| Subscribe & Publish | 3 | +| None | -1 | + +#### Suggested Issuers + +Use any value for issuer but if you have an entity called `Driver` or `Passenger`, +we recommend use the following issuers for them. + +| Issuer | Value | +| --------- | ----- | +| Driver | 0 | +| Passenger | 1 | diff --git a/docs/vendor.md b/docs/vendor.md deleted file mode 100644 index b109885d..00000000 --- a/docs/vendor.md +++ /dev/null @@ -1,192 +0,0 @@ -# Add Vendor - -Add vendors in the `/values.yaml`. - -# Vendor Configuration - -```yaml -company: "<>" -driver_salt: "" -passenger_salt: "" -passenger_hash_length: 15 -driver_hash_length: 15 -allowed_access_types: ["pub", "sub"] -keys: - iss-0: "key-value" - iss-1: "key-value" -iss_entity_map: - 0: "entity-0" - 1: "entity-1" - default: "default-entity" -iss_peer_map: - 0: "peer-0" - 1: "peer-1" - default: "default-peer" -jwt: - iss_name: "iss" - sub_name: "sub" - signing_method: "RS512" -topics: - - topic1 - - topic2 - - ... -``` - -## HashID Manager - -`driver_salt`,`passenger_salt`, `passenger_hash_length`, `driver_hash_length` are used for HashIDManager. -This component only works for passenger and driver issuers. - -## Keys - -This is a map of issuer to key for opening JWT token. - -## IssEntityMap & IssPeerMap - -These two configuration map iss to entity and peer respectively. - -**Note**: default case is `required` - -```yaml - -iss_entity_map: - 0: "driver" - 1: "passenger" - default: "none" -iss_peer_map: - 0: "passenger" - 1: "driver" - default: "none" - -- type: driver_location - template: ^{{.company}}/driver/{{.sub}}/location$ - accesses: - 0: '2' - 1: '-1' -``` - -In the example above, we have two maps for entity & peer maps. As it's clear for **entity** structure **0** and **1** is mapped to **driver** and **passenger**, respectively. Vice Versa, for peer structure it can be seen that **1** and **0** is mapped to **driver** and **passenger**. We have also the **default** key for both two cases. - -In the topic example, we have an accesses section in which **0** is mapped to **2** and **1** is mapped to **-1** which can be interpreted as a map from **IssEntity's Keys** to **Access Types**. In the other words this structure means: - -- **Driver** has a **Pub** access on topic -- **Passenger** has a **None** access on topic (No Access) - -## JWT - -This is the jwt configuration. `iss_name` and `sub_name` are the name of issuer and subject in the jwt token's payload respectively. - -`signing_method` is the method that is used to sign the jwt token. -Here are list of different signing methods - -- ES384 -- RS512 \* -- PS512 -- RS384 \* -- HS256 \* -- HS384 \* -- RS256 \* -- PS384 -- ES256 -- ES512 -- EdDSA -- HS512 \* -- PS256 - **Note**: only the methods with `*` are supported for now. - -# Topic Configuration - -```yaml -type: "<>" -template: "<>" -hash_type: 0|1 -accesses: - iss-0: "<>" - iss-1: "<>" - ... -``` - -## Template - -Topic template is a string consists of [Variables](##Available_Variables) and [Functions](##Available_Functions) and regular expressions. Variables and Function are replaced first and then the whole template will compile as a regular expression. The end result will be compared against the requested topic. - -### Example - -This is template topic given in `vendor:topics[#]:template`. - -```regex -^{{.company}}/driver/{{HashID .hashType .sub (IssToSnappID .iss)}}/location/[a-zA-Z0-9-_]+$ -``` - -After parsing the template we get something like this - -```regex -// company=snapp -// hashType=0 -// sub=D96ZbvJakLp4PYd -// iss=0 -^snapp/driver/D96ZbvJakLp4PYd/location/[a-zA-Z0-9-_]+$ -``` - -Now if the requested topic match the create topic it is consider a valid topic for that particular user. - -```text -requested_topic: snapp/driver/D96ZbvJakLp4PYd/location/23fw49vxd -created_topic_regex: ^snapp/driver/D96ZbvJakLp4PYd/location/[a-zA-Z0-9-_]+$ -``` - -# Values - -## Available Variables - -These are the variables available to use in the topic templates. - -- iss - issuer obtained from jwt-token -- sub - subject obtained from jwt-token -- hashType - Hash type field defined in topic template configuration - - | HashType | Value | - | -------- | ----- | - | HashID | 0 | - | MD5 | 1 | - -- company - company field defined in vendor configuration - -## Available Functions - -These are the function available to use in the topic templates. - -- IssToEntity(iss string) string - convert `iss` obtained from jwt-token to defined entity in `issEntityMap` -- IssToPeer(iss string) string - convert `iss` onbtained from jwt-token to define peer in `issPeerMap` -- IssToSnappID(iss string) string - convert `iss` obtained from jwt-token to snappid.audience -- HashID(hashType int, sub string, snappID snappid.audience) - generated `hashID` for the given `subject` base on the `hashType` and `snappid.audience` - -**Note**: snappid.audience only is available for issuer 0 and 1 which are for driver and passenger respectively. - -## Accesses - -List of all types of access on a topic. - -| Access | Value | -| ------------------- | ----- | -| Subscribe | 1 | -| Publish | 2 | -| Subscribe & Publish | 3 | -| None | -1 | - -## Suggested Issuers - -Use any value for issuer but if you have an entity called `Driver` or `Passenger`, we recommend to use the following issuers for them. - -| Issuer | Value | -| --------- | ----- | -| Driver | 0 | -| Passenger | 1 | From 96e79fc44c703274eec8e052e597fed8e25ab39f Mon Sep 17 00:00:00 2001 From: Parham Alvani Date: Sat, 21 Oct 2023 03:27:05 +0000 Subject: [PATCH 463/660] feat: update packages --- go.mod | 1 - go.sum | 13 ++----------- 2 files changed, 2 insertions(+), 12 deletions(-) diff --git a/go.mod b/go.mod index 4ae0248c..2ebf592e 100644 --- a/go.mod +++ b/go.mod @@ -14,7 +14,6 @@ require ( github.com/stretchr/testify v1.8.4 github.com/tidwall/pretty v1.2.1 go.opentelemetry.io/otel v1.19.0 - go.opentelemetry.io/otel/exporters/jaeger v1.17.0 go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.19.0 go.opentelemetry.io/otel/sdk v1.19.0 go.opentelemetry.io/otel/trace v1.19.0 diff --git a/go.sum b/go.sum index 4610c9d0..2a5296ca 100644 --- a/go.sum +++ b/go.sum @@ -85,6 +85,7 @@ github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69 github.com/golang-jwt/jwt/v5 v5.0.0 h1:1n1XNM9hk7O9mnQoNBGolZvzebBQ7p93ULHRc28XJUE= github.com/golang-jwt/jwt/v5 v5.0.0/go.mod h1:pqrtFR0X4osieyHYxtmOUWsAWrfe1Q5UVIyoH402zdk= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= +github.com/golang/glog v1.1.2 h1:DVjP2PbBOzHyzA+dn3WhHIq4NdVu3Q+pvivFICf/7fo= github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= @@ -119,7 +120,6 @@ github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+ github.com/google/uuid v1.3.1 h1:KjJaJ9iWZ3jOFZIf1Lqf4laDRCasjl0BCmnEGxkdLb4= github.com/google/uuid v1.3.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0/go.mod h1:8NvIoxWQoOIhqOTXgfV/d3M/q6VIi02HzZEHgUlZvzk= -github.com/grpc-ecosystem/grpc-gateway v1.16.0 h1:gmcG1KaJ57LophUzW0Hy8NmPhnMZb4M0+kPpLofRdBo= github.com/grpc-ecosystem/grpc-gateway v1.16.0/go.mod h1:BDjrQk3hbvj6Nolgz8mAMFbcEtjT1g+wF4CSlocrBnw= github.com/grpc-ecosystem/grpc-gateway/v2 v2.18.0 h1:RtRsiaGvWxcwd8y3BiRZxsylPT8hLWZ5SPcfI+3IDNk= github.com/grpc-ecosystem/grpc-gateway/v2 v2.18.0/go.mod h1:TzP6duP4Py2pHLVPPQp42aoYI92+PCrVotyR5e8Vqlk= @@ -147,7 +147,6 @@ github.com/hashicorp/go-uuid v1.0.1/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/b github.com/hashicorp/go-version v1.1.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= -github.com/hashicorp/hcl v1.0.0 h1:0Anlzjpi4vEasTeNFn2mLJgTSwt0+6sfsiTG8qcWGx4= github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ= github.com/hashicorp/logutils v1.0.0/go.mod h1:QIAnNjmIWmVIIkWDTG1z5v++HQmx9WQRO+LraFDTW64= github.com/hashicorp/mdns v1.0.4/go.mod h1:mtBihi+LeNXGtG8L9dX59gAEa12BDtBQSp4v/YAJqrc= @@ -157,13 +156,11 @@ github.com/hashicorp/vault/api v1.0.4/go.mod h1:gDcqh3WGcR1cpF5AJz/B1UFheUEneMoI github.com/hashicorp/vault/sdk v0.1.13/go.mod h1:B+hVj7TpuQY1Y/GPbCpffmgd+tSEwvhkWnjtSYCaS2M= github.com/hashicorp/yamux v0.0.0-20180604194846-3520598351bb/go.mod h1:+NfK9FKeTrX5uv1uIXGdwYDTeHna2qgaIlx54MXqjAM= github.com/hashicorp/yamux v0.0.0-20181012175058-2f1d1f20f75d/go.mod h1:+NfK9FKeTrX5uv1uIXGdwYDTeHna2qgaIlx54MXqjAM= -github.com/hjson/hjson-go/v4 v4.0.0 h1:wlm6IYYqHjOdXH1gHev4VoXCaW20HdQAGCxdOEEg2cs= github.com/hjson/hjson-go/v4 v4.0.0/go.mod h1:KaYt3bTw3zhBjYqnXkYywcYctk0A2nxeEFTse3rH13E= github.com/inconshreveable/mousetrap v1.1.0 h1:wN+x4NVGpMsO7ErUn/mUI3vEoE6Jt13X2s0bqwp9tc8= github.com/inconshreveable/mousetrap v1.1.0/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw= github.com/jmespath/go-jmespath v0.4.0/go.mod h1:T8mJZnbsbmF+m6zOOFylbeCJqk5+pHWvzYPziyZiYoo= github.com/jmespath/go-jmespath/internal/testify v1.5.1/go.mod h1:L3OGu8Wl2/fWfCI6z80xFu9LTZmf1ZRjMHUOPmWr69U= -github.com/joho/godotenv v1.3.0 h1:Zjp+RcGpHhGlrMbJzXTrZZPrWj+1vfm90La1wgB6Bhc= github.com/joho/godotenv v1.3.0/go.mod h1:7hK45KPybAkOC6peb+G5yklZfMxEjkZhHbwpqxOKXbg= github.com/jpillora/backoff v1.0.0/go.mod h1:J/6gKK9jxlEcS3zixgDgUAsiuZ7yrSoa/FX5e0EB2j4= github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= @@ -177,7 +174,6 @@ github.com/klauspost/compress v1.17.1 h1:NE3C767s2ak2bweCZo3+rdP4U/HoyVXLv/X9f2g github.com/klauspost/compress v1.17.1/go.mod h1:ntbaceVETuRiXiv4DpjP66DpAtAGkEQskQzEyD//IeE= github.com/knadh/koanf v1.5.0 h1:q2TSd/3Pyc/5yP9ldIrSdIz26MCcyNQzW0pEAugLPNs= github.com/knadh/koanf v1.5.0/go.mod h1:Hgyjp4y8v44hpZtPzs7JZfRAW5AhN7KfZcwv1RYggDs= -github.com/knadh/koanf/maps v0.1.1 h1:G5TjmUh2D7G2YWf5SQQqSiHRJEjaicvU0KpypqB3NIs= github.com/knadh/koanf/v2 v2.0.1 h1:1dYGITt1I23x8cfx8ZnldtezdyaZtfAuRtIFOiRzK7g= github.com/knadh/koanf/v2 v2.0.1/go.mod h1:ZeiIlIDXTE7w1lMT6UVcNiRAS2/rCeLn/GdLNvY1Dus= github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= @@ -205,7 +201,6 @@ github.com/mattn/go-isatty v0.0.20/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D github.com/mattn/go-runewidth v0.0.15 h1:UNAjwbU9l54TA3KzvqLGxwWjHmMgBUVhBiTjelZgg3U= github.com/mattn/go-runewidth v0.0.15/go.mod h1:Jdepj2loyihRzMpdS35Xk/zdY8IAYHsh153qUoGf23w= github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= -github.com/matttproud/golang_protobuf_extensions v1.0.4 h1:mmDVorXM7PCGKw94cs5zkfA9PSy5pEvNWRP0ET0TIVo= github.com/matttproud/golang_protobuf_extensions/v2 v2.0.0 h1:jWpvCLoY8Z/e3VKvlsiIGKtc+UG6U5vzxaoagmhXfyg= github.com/matttproud/golang_protobuf_extensions/v2 v2.0.0/go.mod h1:QUyp042oQthUoa9bqDv0ER0wrtXnBruoNd7aNjkbP+k= github.com/miekg/dns v1.1.26/go.mod h1:bPDLeHnStXmXAq1m/Ch/hvfNHr14JKNPMBo3VZKjuso= @@ -236,7 +231,6 @@ github.com/npillmayer/nestext v0.1.3/go.mod h1:h2lrijH8jpicr25dFY+oAJLyzlya6jhnu github.com/oklog/run v1.0.0/go.mod h1:dlhp/R75TPv97u0XWUtDeV/lRKWPKSdTuV0TZvrmrQA= github.com/pascaldekloe/goe v0.0.0-20180627143212-57f6aae5913c/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc= github.com/pascaldekloe/goe v0.1.0/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc= -github.com/pelletier/go-toml v1.7.0 h1:7utD74fnzVc/cpcyy8sjrlFr5vYpypUixARcHIMIGuI= github.com/pelletier/go-toml v1.7.0/go.mod h1:vwGMzjaWMwyfHwgIBhI2YUM4fB6nL6lVAvS1LBMMhTE= github.com/pierrec/lz4 v2.0.5+incompatible/go.mod h1:pdkljMzZIN41W+lC3N2tnIh5sFi+IEE17M5jbnwPHcY= github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= @@ -292,7 +286,6 @@ github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA= github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= -github.com/stretchr/objx v0.5.0 h1:1zr/of2m5FGMsad5YfcqgdqdWrIhu+EBEJRhR1U7z/c= github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= @@ -316,8 +309,6 @@ go.etcd.io/etcd/client/pkg/v3 v3.5.4/go.mod h1:IJHfcCEKxYu1Os13ZdwCwIUTUVGYTSAM3 go.etcd.io/etcd/client/v3 v3.5.4/go.mod h1:ZaRkVgBZC+L+dLCjTcF1hRXpgZXQPOvnA/Ak/gq3kiY= go.opentelemetry.io/otel v1.19.0 h1:MuS/TNf4/j4IXsZuJegVzI1cwut7Qc00344rgH7p8bs= go.opentelemetry.io/otel v1.19.0/go.mod h1:i0QyjOq3UPoTzff0PJB2N66fb4S0+rSbSB15/oyH9fY= -go.opentelemetry.io/otel/exporters/jaeger v1.17.0 h1:D7UpUy2Xc2wsi1Ras6V40q806WM07rqoCWzXu7Sqy+4= -go.opentelemetry.io/otel/exporters/jaeger v1.17.0/go.mod h1:nPCqOnEH9rNLKqH/+rrUjiMzHJdV1BlpKcTwRTyKkKI= go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.19.0 h1:Mne5On7VWdx7omSrSSZvM4Kw7cS7NQkOOmLcgscI51U= go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.19.0/go.mod h1:IPtUMKL4O3tH5y+iXVyAXqpAwMuzC1IrxVS81rummfE= go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.19.0 h1:3d+S281UTjM+AbF31XSOYn1qXn3BgIdWl8HNEpx08Jk= @@ -333,7 +324,6 @@ go.opentelemetry.io/proto/otlp v1.0.0/go.mod h1:Sy6pihPLfYHkr3NkUbEhGHFhINUSI/v8 go.uber.org/atomic v1.7.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc= go.uber.org/automaxprocs v1.5.3 h1:kWazyxZUrS3Gs4qUpbwo5kEIMGe/DAvi5Z4tl2NW4j8= go.uber.org/automaxprocs v1.5.3/go.mod h1:eRbA25aqJrxAbsLO0xy5jVwPt7FQnRgjW+efnwa1WM0= -go.uber.org/goleak v1.2.0 h1:xqgm/S+aQvhWFTtR0XK3Jvg7z8kGV8P4X14IzwN3Eqk= go.uber.org/goleak v1.2.1 h1:NBol2c7O1ZokfZ0LEU9K6Whx/KnwvepVetCUhtKja4A= go.uber.org/multierr v1.6.0/go.mod h1:cdWPpRnG4AhwMwsgIHip0KRBQjJy5kYEpYjJxpXp9iU= go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0= @@ -454,6 +444,7 @@ google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98 google.golang.org/genproto v0.0.0-20200513103714-09dca8ec2884/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo= google.golang.org/genproto v0.0.0-20210602131652-f16073e35f0c/go.mod h1:UODoCrxHCcBojKKwX1terBiRUaqAsFqJiF615XL43r0= +google.golang.org/genproto v0.0.0-20231012201019-e917dd12ba7a h1:fwgW9j3vHirt4ObdHoYNwuO24BEZjSzbh+zPaNWoiY8= google.golang.org/genproto/googleapis/api v0.0.0-20231016165738-49dd2c1f3d0b h1:CIC2YMXmIhYw6evmhPxBKJ4fmLbOFtXQN/GV3XOZR8k= google.golang.org/genproto/googleapis/api v0.0.0-20231016165738-49dd2c1f3d0b/go.mod h1:IBQ646DjkDkvUIsVq/cc03FUFQ9wbZu7yE396YcL870= google.golang.org/genproto/googleapis/rpc v0.0.0-20231016165738-49dd2c1f3d0b h1:ZlWIi1wSK56/8hn4QcBp/j9M7Gt3U/3hZw3mC7vDICo= From 479fcef6c810e60d507f25487a16e83c18bf34b7 Mon Sep 17 00:00:00 2001 From: Parham Alvani Date: Sat, 21 Oct 2023 03:38:37 +0000 Subject: [PATCH 464/660] fix: correct lint issues --- internal/authenticator/auto_authenticator_test.go | 14 +++++++------- .../authenticator/manual_authenticator_test.go | 14 +++++++------- internal/topics/manager.go | 6 ++++-- 3 files changed, 18 insertions(+), 16 deletions(-) diff --git a/internal/authenticator/auto_authenticator_test.go b/internal/authenticator/auto_authenticator_test.go index 25769808..b3269f7a 100644 --- a/internal/authenticator/auto_authenticator_test.go +++ b/internal/authenticator/auto_authenticator_test.go @@ -12,7 +12,7 @@ import ( "github.com/snapp-incubator/soteria/internal/config" "github.com/snapp-incubator/soteria/internal/topics" "github.com/snapp-incubator/soteria/pkg/acl" - "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" "github.com/stretchr/testify/suite" "go.uber.org/zap" ) @@ -219,14 +219,14 @@ func (suite *AutoAuthenticatorTestSuite) TestACL_Driver() { suite.Run("testing driver subscribe on valid superapp event topic", func() { ok, err := suite.Authenticator.ACL(acl.Sub, token, validDriverSuperappEventTopic) - suite.NoError(err) - suite.True(ok) + require.NoError(err) + require.True(ok) }) suite.Run("testing driver subscribe on invalid superapp event topic", func() { ok, err := suite.Authenticator.ACL(acl.Sub, token, invalidDriverSuperappEventTopic) - suite.Error(err) - suite.False(ok) + require.Error(err) + require.False(ok) }) suite.Run("testing driver subscribe on valid shared location topic", func() { @@ -291,7 +291,7 @@ func TestAutoAuthenticator_ValidateTopicBySender(t *testing.T) { cfg.UseValidator = true hid, err := topics.NewHashIDManager(cfg.HashIDMap) - assert.NoError(t, err) + require.NoError(t, err) // nolint: exhaustruct authenticator := authenticator.AutoAuthenticator{ @@ -304,7 +304,7 @@ func TestAutoAuthenticator_ValidateTopicBySender(t *testing.T) { t.Parallel() topicTemplate := authenticator.TopicManager.ParseTopic(validDriverCabEventTopic, topics.DriverIss, "DXKgaNQa7N5Y7bo") - assert.True(t, topicTemplate != nil) + require.NotNil(t, topicTemplate) }) } diff --git a/internal/authenticator/manual_authenticator_test.go b/internal/authenticator/manual_authenticator_test.go index 1ebc7314..69ec1e5a 100644 --- a/internal/authenticator/manual_authenticator_test.go +++ b/internal/authenticator/manual_authenticator_test.go @@ -12,7 +12,7 @@ import ( "github.com/snapp-incubator/soteria/internal/config" "github.com/snapp-incubator/soteria/internal/topics" "github.com/snapp-incubator/soteria/pkg/acl" - "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" "github.com/stretchr/testify/suite" "go.uber.org/zap" ) @@ -221,14 +221,14 @@ func (suite *ManualAuthenticatorTestSuite) TestACL_Driver() { suite.Run("testing driver subscribe on valid superapp event topic", func() { ok, err := suite.Authenticator.ACL(acl.Sub, token, validDriverSuperappEventTopic) - suite.NoError(err) - suite.True(ok) + require.NoError(err) + require.True(ok) }) suite.Run("testing driver subscribe on invalid superapp event topic", func() { ok, err := suite.Authenticator.ACL(acl.Sub, token, invalidDriverSuperappEventTopic) - suite.Error(err) - suite.False(ok) + require.Error(err) + require.False(ok) }) suite.Run("testing driver subscribe on valid shared location topic", func() { @@ -292,7 +292,7 @@ func TestManualAuthenticator_ValidateTopicBySender(t *testing.T) { cfg := config.SnappVendor() hid, err := topics.NewHashIDManager(cfg.HashIDMap) - assert.NoError(t, err) + require.NoError(t, err) // nolint: exhaustruct authenticator := authenticator.ManualAuthenticator{ @@ -304,7 +304,7 @@ func TestManualAuthenticator_ValidateTopicBySender(t *testing.T) { t.Run("testing valid driver cab event", func(t *testing.T) { t.Parallel() topicTemplate := authenticator.TopicManager.ParseTopic(validDriverCabEventTopic, topics.DriverIss, "DXKgaNQa7N5Y7bo") - assert.True(t, topicTemplate != nil) + require.NotNil(t, topicTemplate) }) } diff --git a/internal/topics/manager.go b/internal/topics/manager.go index 446e063a..03d841c8 100644 --- a/internal/topics/manager.go +++ b/internal/topics/manager.go @@ -5,8 +5,10 @@ package topics import ( "crypto/md5" //nolint: gosec + "encoding/hex" "fmt" "regexp" + "strconv" "strings" "text/template" @@ -127,7 +129,7 @@ func (t *Manager) ParseTopic(topic, iss, sub string) *Template { func (t *Manager) EncodeMD5(iss string) string { hid := md5.Sum([]byte(fmt.Sprintf("%s-%s", EmqCabHashPrefix, iss))) //nolint:gosec - return fmt.Sprintf("%x", hid) + return hex.EncodeToString(hid[:]) } func (t *Manager) DecodeHashID(sub, iss string) string { @@ -138,7 +140,7 @@ func (t *Manager) DecodeHashID(sub, iss string) string { return "" } - return fmt.Sprintf("%d", id[0]) + return strconv.Itoa(id[0]) } func (t *Manager) IssEntityMapper(iss string) string { From 00164a486dee610bb7646ef00f8d44bfdb3ae3b8 Mon Sep 17 00:00:00 2001 From: Parham Alvani Date: Sat, 21 Oct 2023 14:37:58 +0000 Subject: [PATCH 465/660] feat: support tag for building image --- .github/workflows/test.yaml | 13 ++++++++++--- build/package/docker-bake.json | 7 ++++++- 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 24104b2e..49c35458 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -32,21 +32,28 @@ jobs: files: coverage.out docker: - name: docker runs-on: ubuntu-latest needs: - lint - test + if: github.event_name != 'pull_request' steps: - uses: actions/checkout@v4 - uses: docker/setup-buildx-action@v3 - - uses: docker/setup-qemu-action@v3 - uses: docker/login-action@v3 with: registry: ghcr.io username: ${{ github.repository_owner }} password: ${{ secrets.GITHUB_TOKEN }} - uses: docker/bake-action@v4 + if: ${{ startsWith(github.ref, 'refs/tags/v') }} + env: + TAG: ${{ github.ref_name }} with: - files: "build/package/docker-bake.json" push: true + files: 'docker-bake.json' + - uses: docker/bake-action@v4 + if: ${{ !startsWith(github.ref, 'refs/tags/v') }} + with: + push: true + files: 'docker-bake.json' diff --git a/build/package/docker-bake.json b/build/package/docker-bake.json index b9429265..4e9a7c7b 100644 --- a/build/package/docker-bake.json +++ b/build/package/docker-bake.json @@ -6,11 +6,16 @@ ] } }, + "variable": { + "TAG": { + "default": "latest" + } + }, "target": { "soteria": { "dockerfile": "build/package/Dockerfile", "tags": [ - "ghcr.io/snapp-incubator/soteria" + "ghcr.io/snapp-incubator/soteria:${TAG}" ] } } From 492d153d98ec5a9209b6e28dc1f3ce57619bdd5c Mon Sep 17 00:00:00 2001 From: Parham Alvani Date: Sat, 21 Oct 2023 16:20:17 +0000 Subject: [PATCH 466/660] fix: correct docker-bake address in github workflow --- .github/workflows/test.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 49c35458..a20b8bb7 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -51,9 +51,9 @@ jobs: TAG: ${{ github.ref_name }} with: push: true - files: 'docker-bake.json' + files: 'build/package/docker-bake.json' - uses: docker/bake-action@v4 if: ${{ !startsWith(github.ref, 'refs/tags/v') }} with: push: true - files: 'docker-bake.json' + files: 'build/package/docker-bake.json' From b986aab8d77b6d41d21e68c602bb3d03a4f357ad Mon Sep 17 00:00:00 2001 From: Parham Alvani Date: Sat, 21 Oct 2023 19:40:25 +0000 Subject: [PATCH 467/660] feat: add docker compose to test soteria with emqx --- docker-compose.yml | 30 ++++++++++++++++++++++++++++++ internal/config/default.go | 2 +- 2 files changed, 31 insertions(+), 1 deletion(-) create mode 100644 docker-compose.yml diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 00000000..98454bea --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,30 @@ +services: + soteria: + build: + dockerfile: ./build/package/Dockerfile + context: . + command: serve + emqx: + image: emqx/emqx + environment: + EMQX_DASHBOARD__DEFAULT_PASSWORD: public + EMQX_DASHBOARD__DEFAULT_USERNAME: admin + EMQX_AUTHENTICATION__1__MECHANISM: "password_based" + EMQX_AUTHENTICATION__1__BACKEND: "http" + EMQX_AUTHENTICATION__1__ENABLE: "true" + EMQX_AUTHENTICATION__1__METHOD: "post" + EMQX_AUTHENTICATION__1__URL: "http://soteria:9999/v2/auth" + EMQX_AUTHENTICATION__1__BODY: '{"username" = "$${username}", "password" = "$${password}", "token" = "$${username}"}' + EMQX_AUTHORIZATION__NO_MATCH: deny + EMQX_AUTHORIZATION__DENY_ACTION: disconnect + EMQX_AUTHORIZATION__SOURCES__1__TYPE: http + EMQX_AUTHORIZATION__SOURCES__1__METHOD: post + EMQX_AUTHORIZATION__SOURCES__1__URL: "http://soteria:9999/v2/acl" + EMQX_AUTHORIZATION__SOURCES__1__BODY: '{"username" = "$${username}", "password" = "$${password}", "token" = "$${username}"}' + EMQX_LISTENERS__TCP__DEFAULT__ENABLE_AUTHN: "quick_deny_anonymous" + EMQX_LISTENERS__TCP__INTERNAL__ENABLE: "true" + EMQX_LISTENERS__TCP__INTERNAL__BIND: 11883 + EMQX_LISTENERS__TCP__INTERNAL__ENABLE_AUTHN: "false" + ports: + - 1883:1883 + - 18083:18083 diff --git a/internal/config/default.go b/internal/config/default.go index 0fb274bd..516daebb 100644 --- a/internal/config/default.go +++ b/internal/config/default.go @@ -24,7 +24,7 @@ func Default() Config { SnappVendor(), }, Logger: logger.Config{ - Level: "warn", + Level: "debug", }, HTTPPort: DefaultHTTPPort, Tracer: tracing.Config{ From 1a071298734bad012ba0bf8fde0d8eedbc920fce Mon Sep 17 00:00:00 2001 From: Parham Alvani Date: Sat, 21 Oct 2023 19:41:39 +0000 Subject: [PATCH 468/660] feat: update address to use new opensource emqx --- deployments/soteria/values.ode.baly.yaml | 6 +++--- deployments/soteria/values.ode.snapp.yaml | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/deployments/soteria/values.ode.baly.yaml b/deployments/soteria/values.ode.baly.yaml index 072461d8..6fd96d6c 100644 --- a/deployments/soteria/values.ode.baly.yaml +++ b/deployments/soteria/values.ode.baly.yaml @@ -5,9 +5,9 @@ labels: createdby: mozart image: - registry: image-registry.openshift-image-registry.svc:5000 - repository: mozart/soteria - tag: main + registry: ghcr.io + repository: snapp-incubator/soteria + tag: latest pullPolicy: Always timezone: Asia/Tehran diff --git a/deployments/soteria/values.ode.snapp.yaml b/deployments/soteria/values.ode.snapp.yaml index 585597a8..cfa90b45 100644 --- a/deployments/soteria/values.ode.snapp.yaml +++ b/deployments/soteria/values.ode.snapp.yaml @@ -7,9 +7,9 @@ labels: createdby: mozart image: - registry: image-registry.openshift-image-registry.svc:5000 - repository: mozart/soteria - tag: main + registry: ghcr.io + repository: snapp-incubator/soteria + tag: latest pullPolicy: Always config: From 9b6fdf8a38867523a77c6356592291458b4d6ce2 Mon Sep 17 00:00:00 2001 From: Parham Alvani Date: Sat, 21 Oct 2023 20:02:41 +0000 Subject: [PATCH 469/660] Update README.md --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index efdcb327..e4e7ef2d 100644 --- a/README.md +++ b/README.md @@ -8,6 +8,8 @@ GitHub Workflow Status Codecov GitHub repo size + GitHub tag (with filter) + GitHub go.mod Go version (subdirectory of monorepo)

## Introduction From 10d4c02e39fc0173f8d7062f6a899c909f730d99 Mon Sep 17 00:00:00 2001 From: Parham Alvani Date: Wed, 25 Oct 2023 09:38:52 +0000 Subject: [PATCH 470/660] feat: remove ode values --- deployments/soteria/values.ode.baly.yaml | 162 ---------------------- deployments/soteria/values.ode.snapp.yaml | 125 ----------------- 2 files changed, 287 deletions(-) delete mode 100644 deployments/soteria/values.ode.baly.yaml delete mode 100644 deployments/soteria/values.ode.snapp.yaml diff --git a/deployments/soteria/values.ode.baly.yaml b/deployments/soteria/values.ode.baly.yaml deleted file mode 100644 index 6fd96d6c..00000000 --- a/deployments/soteria/values.ode.baly.yaml +++ /dev/null @@ -1,162 +0,0 @@ -replicaCount: 1 - -labels: - managedby: dispatching-team - createdby: mozart - -image: - registry: ghcr.io - repository: snapp-incubator/soteria - tag: latest - pullPolicy: Always - -timezone: Asia/Tehran - -service: - type: ClusterIP - ports: - - name: http - port: 9999 - protocol: tcp - -resources: - limits: - memory: 128Mi - cpu: 200m - requests: - memory: 128Mi - cpu: 100m - -autoscaling: - enabled: false - minReplicas: 3 - maxReplicas: 20 - targetCPUUtilizationPercentage: 65 - -rollingParams: - maxSurge: 5 - maxUnavailable: 0 - -serviceMonitor: - enabled: false - -config: - http_port: 9999 - default_vendor: baly - logger: - level: "debug" - tracer: - enabled: true - ratio: 1 - agent: - host: 'jaeger-all-in-one-inmemory-agent' - port: 6831 - -vendors: - snapp: - company: "baly" - hashid_map: - 0: - salt: "secret" - length: 15 - 1: - salt: "secret" - length: 15 - allowed_access_types: [ "pub", "sub" ] - topics: - - type: cab_event - template: ^{{IssToEntity .iss}}-event-{{ EncodeMD5 (DecodeHashID .sub .iss) }}$ - hash_type: 1 - accesses: - 0: '1' - 1: '1' - - type: driver_location - template: ^{{.company}}/driver/{{.sub}}/location$ - hash_type: 0 - accesses: - 0: '2' - 1: '-1' - - type: passenger_location - template: ^{{.company}}/passenger/{{.sub}}/location$ - hash_type: 0 - accesses: - 0: '2' - 1: '2' - - type: superapp_event - template: ^{{.company}}/{{IssToEntity .iss}}/{{.sub}}/superapp$ - hash_type: 0 - accesses: - 0: '1' - 1: '1' - - type: box_event - template: ^bucks$ - hash_type: 0 - accesses: - 0: '-1' - 1: '-1' - - type: shared_location - template: ^{{.company}}/{{IssToEntity .iss}}/{{.sub}}/{{IssToPeer .iss}}-location$ - hash_type: 0 - accesses: - 0: '1' - 1: '1' - - type: chat - template: ^{{.company}}/{{IssToEntity .iss}}/{{.sub}}/chat$ - hash_type: 0 - accesses: - 0: '1' - 1: '1' - - type: general_call_entry - template: ^shared/{{.company}}/{{IssToEntity .iss}}/{{.sub}}/call/send$ - hash_type: 0 - accesses: - 0: '2' - 1: '2' - - type: node_call_entry - template: ^{{.company}}/{{IssToEntity .iss}}/{{.sub}}/call/[a-zA-Z0-9-_]+/send$ - hash_type: 0 - accesses: - 0: '2' - 1: '2' - - type: call_outgoing - template: ^{{.company}}/{{IssToEntity .iss}}/{{.sub}}/call/receive$ - hash_type: 0 - accesses: - 0: '1' - 1: '1' - keys: - 0: |- - -----BEGIN PUBLIC KEY----- - MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAyG4XpV9TpDfgWJF9TiIv - va4hNhDuqYMJO6iXLzr3y8oCvoB7zUK0EjtbLH+A3gr1kUvyZKDWT4qHTvU2Sshm - X+ttWGK34EhCvF3Lb18yxmVDSSK8JIcTaJjMqmyubxzamQnNoWazJ7ea9BIo2YGL - C9rgPbi1hihhdb07xPGUkJRqbWkI98xjDhKdMqiwW1hIRXm/apo++FjptvqvF84s - ynC5gWGFHiGNICRsLJBczLEAf2Atbafigq6/tovzMabnp2yRtr1ReEgioH1RO4gX - J7F4N5f6y/VWd8+sDOSxtS/HcnP/7g8/A54G2IbXxr+EiwOO/1F+pyMPKq7sGDSU - DwIDAQAB - -----END PUBLIC KEY----- - 1: |- - -----BEGIN PUBLIC KEY----- - MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA5SeRfOdTyvQZ7N9ahFHl - +J05r7e9fgOQ2cpOtnnsIjAjCt1dF7/NkqVifEaxABRBGG9iXIw//G4hi0TqoKqK - aoSHMGf6q9pSRLGyB8FatxZf2RBTgrXYqVvpasbnB1ZNv858yTpRjV9NzJXYHLp8 - 8Hbd/yYTR6Q7ajs11/SMLGO7KBELsI1pBz7UW/fngJ2pRmd+RkG+EcGrOIZ27TkI - Xjtog6bgfmtV9FWxSVdKACOY0OmW+g7jIMik2eZTYG3kgCmW2odu3zRoUa7l9VwN - YMuhTePaIWwOifzRQt8HDsAOpzqJuLCoYX7HmBfpGAnwu4BuTZgXVwpvPNb+KlgS - pQIDAQAB - -----END PUBLIC KEY----- - iss_entity_map: - 0: "driver" - 1: "passenger" - default: "none" - iss_peer_map: - 0: "passenger" - 1: "driver" - default: "none" - jwt: - iss_name: "iss" - sub_name: "sub" - signing_method: "RS512" - - - diff --git a/deployments/soteria/values.ode.snapp.yaml b/deployments/soteria/values.ode.snapp.yaml deleted file mode 100644 index cfa90b45..00000000 --- a/deployments/soteria/values.ode.snapp.yaml +++ /dev/null @@ -1,125 +0,0 @@ ---- -namespace: ode -region: teh-1 - -labels: - managedby: dispatching-team - createdby: mozart - -image: - registry: ghcr.io - repository: snapp-incubator/soteria - tag: latest - pullPolicy: Always - -config: - validator: - url: "http://validator.snapp-ode-central.svc.cluster.local:80" - timeout: 10s - -vendors: - snapp: - use_validator: true - company: "snapp" - hashid_map: - 0: - salt: "secret" - length: 15 - 1: - salt: "secret" - length: 15 - allowed_access_types: [ "pub", "sub" ] - topics: - - type: cab_event - template: ^{{IssToEntity .iss}}-event-{{ EncodeMD5 (DecodeHashID .sub .iss) }}$ - accesses: - 0: '1' - 1: '1' - - type: driver_location - template: ^{{.company}}/driver/{{.sub}}/location$ - accesses: - 0: '2' - 1: '-1' - - type: passenger_location - template: ^{{.company}}/passenger/{{.sub}}/location$ - hash_type: 0 - accesses: - 0: '2' - 1: '2' - - type: superapp_event - template: ^{{.company}}/{{IssToEntity .iss}}/{{.sub}}/superapp$ - accesses: - 0: '1' - 1: '1' - - type: box_event - template: ^bucks$ - hash_type: 0 - accesses: - 0: '-1' - 1: '-1' - - type: shared_location - template: ^{{.company}}/{{IssToEntity .iss}}/{{.sub}}/{{IssToPeer .iss}}-location$ - accesses: - 0: '1' - 1: '1' - - type: chat - template: ^{{.company}}/{{IssToEntity .iss}}/{{.sub}}/chat$ - accesses: - 0: '1' - 1: '1' - - type: general_call_entry - template: ^shared/{{.company}}/{{IssToEntity .iss}}/{{.sub}}/call/send$ - accesses: - 0: '2' - 1: '2' - - type: node_call_entry - template: ^{{.company}}/{{IssToEntity .iss}}/{{.sub}}/call/[a-zA-Z0-9-_]+/send$ - accesses: - 0: '2' - 1: '2' - - type: call_outgoing - template: ^{{.company}}/{{IssToEntity .iss}}/{{.sub}}/call/receive$ - accesses: - 0: '1' - 1: '1' - iss_entity_map: - 0: "driver" - 1: "passenger" - default: "none" - iss_peer_map: - 0: "passenger" - 1: "driver" - default: "none" - jwt: - iss_name: "iss" - sub_name: "sub" - signing_method: "RS512" - - snapp_pay: - company: "snapp_pay" - hashid_map: - snpay: - length: "20" - salt: "UKjqkklfurigkvoslxp7vi0vcm66w" - alphabet: "abcdefghijklmnopqrstuvwxyz1234567890" - allowed_access_types: ["pub", "sub"] - keys: - snpay: "ZVFzRTBYT1pXYzk5Z2MzNkdjN2JJNzUwc2k4VUlp" - iss_entity_map: - snpay: "passenger" - default: "none" - iss_peer_map: - default: "none" - jwt: - iss_name: "iss" - sub_name: "ud" - signing_method: "HS512" - topics: - - type: test - template: snapp_pay/passenger/{{.sub}}/pay - accesses: - snpay: '1' - - type: cab_event - template: ^{{IssToEntity .iss}}-event-{{ EncodeMD5 (DecodeHashID .sub .iss) }}$ - accesses: - snpay: '1' From 783be363254ea7c1d47ca918f7e6c111e352a95f Mon Sep 17 00:00:00 2001 From: Parham Alvani Date: Wed, 25 Oct 2023 09:43:46 +0000 Subject: [PATCH 471/660] feat: add github action for helm chart --- .github/workflows/helm.yaml | 54 +++++++++++++++++++++++++++++++++++++ 1 file changed, 54 insertions(+) create mode 100644 .github/workflows/helm.yaml diff --git a/.github/workflows/helm.yaml b/.github/workflows/helm.yaml new file mode 100644 index 00000000..77e8d92b --- /dev/null +++ b/.github/workflows/helm.yaml @@ -0,0 +1,54 @@ +--- +name: release + +on: + push: + branches: + - main + paths: + - deployments/soteria + +jobs: + release: + permissions: + contents: write + runs-on: ubuntu-latest + steps: + - name: checkout + uses: actions/checkout@v4 + + - name: set up helm + uses: azure/setup-helm@v3 + with: + version: v3.4.0 + + - uses: actions/setup-python@v4 + with: + python-version: 3.7 + + - name: set up chart-testing + uses: helm/chart-testing-action@v2.4.0 + + - name: run chart-testing (lint) + run: ct lint --all + + - name: create kind cluster + uses: helm/kind-action@v1.8.0 + + - name: run chart-testing (install) + run: ct install --all + + - name: configure git + run: | + git config user.name "$GITHUB_ACTOR" + git config user.email "$GITHUB_ACTOR@users.noreply.github.com" + + - name: install helm + uses: azure/setup-helm@v3 + with: + version: v3.4.0 + + - name: run chart-releaser + uses: helm/chart-releaser-action@v1.5.0 + env: + CR_TOKEN: "${{ secrets.GITHUB_TOKEN }}" From b970f197af6d70e8797a3f42ea603551c4e69676 Mon Sep 17 00:00:00 2001 From: Parham Alvani Date: Wed, 25 Oct 2023 09:44:33 +0000 Subject: [PATCH 472/660] feat: update chart version --- deployments/soteria/Chart.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/deployments/soteria/Chart.yaml b/deployments/soteria/Chart.yaml index 45648a57..1ab9019c 100644 --- a/deployments/soteria/Chart.yaml +++ b/deployments/soteria/Chart.yaml @@ -5,6 +5,6 @@ description: Soteria Helm Chart type: application -version: 7.1.8 +version: 8.0.0 -appVersion: "v7-1-8" +appVersion: "v8-0-0" From 5233ac32ef9d35d9ab7374c2b82f9d5f8432e44f Mon Sep 17 00:00:00 2001 From: Parham Alvani Date: Wed, 25 Oct 2023 09:45:51 +0000 Subject: [PATCH 473/660] feat: update default configuration to use new github instance --- deployments/soteria/values.yaml | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/deployments/soteria/values.yaml b/deployments/soteria/values.yaml index afd70c4e..5cb813bd 100644 --- a/deployments/soteria/values.yaml +++ b/deployments/soteria/values.yaml @@ -1,16 +1,13 @@ --- replicaCount: 1 -namespace: dispatching-staging -region: teh-1 - labels: - managedby: dispatching-team - createdby: dispatching-team + managedby: cloud-platform-team + createdby: cloud-platform-team image: - registry: image-registry.openshift-image-registry.svc:5000 - repository: mozart/soteria + registry: ghcr.io + repository: snapp-incubator/soteria pullPolicy: Always timezone: Asia/Tehran @@ -25,10 +22,10 @@ service: resources: limits: memory: 128Mi - cpu: 2 + cpu: 1 requests: memory: 128Mi - cpu: 1 + cpu: 500m autoscaling: enabled: false From 9c1f7d537bfc86de601958944393ea67e90f9964 Mon Sep 17 00:00:00 2001 From: Parham Alvani Date: Wed, 25 Oct 2023 09:51:00 +0000 Subject: [PATCH 474/660] Update helm.yaml --- .github/workflows/helm.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/helm.yaml b/.github/workflows/helm.yaml index 77e8d92b..1da9d515 100644 --- a/.github/workflows/helm.yaml +++ b/.github/workflows/helm.yaml @@ -1,5 +1,5 @@ --- -name: release +name: helm on: push: From 45b478de1dc725b22b2f921558a7432737d5aa3c Mon Sep 17 00:00:00 2001 From: Parham Alvani Date: Wed, 25 Oct 2023 09:52:01 +0000 Subject: [PATCH 475/660] Update helm.yaml --- .github/workflows/helm.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/helm.yaml b/.github/workflows/helm.yaml index 1da9d515..9a7e8d4f 100644 --- a/.github/workflows/helm.yaml +++ b/.github/workflows/helm.yaml @@ -6,7 +6,7 @@ on: branches: - main paths: - - deployments/soteria + - deployments/soteria/** jobs: release: From 3aa5fc9cb99a5c75408c4b86cbd8b705befcb343 Mon Sep 17 00:00:00 2001 From: Parham Alvani Date: Wed, 25 Oct 2023 09:52:47 +0000 Subject: [PATCH 476/660] Update Chart.yaml --- deployments/soteria/Chart.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/deployments/soteria/Chart.yaml b/deployments/soteria/Chart.yaml index 1ab9019c..4ea1bbff 100644 --- a/deployments/soteria/Chart.yaml +++ b/deployments/soteria/Chart.yaml @@ -1,7 +1,7 @@ --- apiVersion: v2 name: soteria -description: Soteria Helm Chart +description: Soteria provides EMQX authentication using HTTP type: application From 613df88905c462ed779952b7a4854944dbc36cdf Mon Sep 17 00:00:00 2001 From: Parham Alvani Date: Wed, 25 Oct 2023 09:58:08 +0000 Subject: [PATCH 477/660] feat: use name charts for charts folder --- .github/workflows/helm.yaml | 2 +- {deployments => charts}/soteria/.helmignore | 0 {deployments => charts}/soteria/Chart.yaml | 0 {deployments => charts}/soteria/templates/NOTES.txt | 0 {deployments => charts}/soteria/templates/_helpers.tpl | 0 {deployments => charts}/soteria/templates/configmap.yaml | 0 {deployments => charts}/soteria/templates/deployment.yaml | 0 {deployments => charts}/soteria/templates/hpa.yaml | 0 {deployments => charts}/soteria/templates/secret.yaml | 0 {deployments => charts}/soteria/templates/service.yaml | 0 {deployments => charts}/soteria/templates/servicemonitor.yaml | 0 .../soteria/templates/tests/test-connection.yaml | 0 {deployments => charts}/soteria/values.yaml | 0 13 files changed, 1 insertion(+), 1 deletion(-) rename {deployments => charts}/soteria/.helmignore (100%) rename {deployments => charts}/soteria/Chart.yaml (100%) rename {deployments => charts}/soteria/templates/NOTES.txt (100%) rename {deployments => charts}/soteria/templates/_helpers.tpl (100%) rename {deployments => charts}/soteria/templates/configmap.yaml (100%) rename {deployments => charts}/soteria/templates/deployment.yaml (100%) rename {deployments => charts}/soteria/templates/hpa.yaml (100%) rename {deployments => charts}/soteria/templates/secret.yaml (100%) rename {deployments => charts}/soteria/templates/service.yaml (100%) rename {deployments => charts}/soteria/templates/servicemonitor.yaml (100%) rename {deployments => charts}/soteria/templates/tests/test-connection.yaml (100%) rename {deployments => charts}/soteria/values.yaml (100%) diff --git a/.github/workflows/helm.yaml b/.github/workflows/helm.yaml index 9a7e8d4f..f00d968c 100644 --- a/.github/workflows/helm.yaml +++ b/.github/workflows/helm.yaml @@ -6,7 +6,7 @@ on: branches: - main paths: - - deployments/soteria/** + - charts/soteria/** jobs: release: diff --git a/deployments/soteria/.helmignore b/charts/soteria/.helmignore similarity index 100% rename from deployments/soteria/.helmignore rename to charts/soteria/.helmignore diff --git a/deployments/soteria/Chart.yaml b/charts/soteria/Chart.yaml similarity index 100% rename from deployments/soteria/Chart.yaml rename to charts/soteria/Chart.yaml diff --git a/deployments/soteria/templates/NOTES.txt b/charts/soteria/templates/NOTES.txt similarity index 100% rename from deployments/soteria/templates/NOTES.txt rename to charts/soteria/templates/NOTES.txt diff --git a/deployments/soteria/templates/_helpers.tpl b/charts/soteria/templates/_helpers.tpl similarity index 100% rename from deployments/soteria/templates/_helpers.tpl rename to charts/soteria/templates/_helpers.tpl diff --git a/deployments/soteria/templates/configmap.yaml b/charts/soteria/templates/configmap.yaml similarity index 100% rename from deployments/soteria/templates/configmap.yaml rename to charts/soteria/templates/configmap.yaml diff --git a/deployments/soteria/templates/deployment.yaml b/charts/soteria/templates/deployment.yaml similarity index 100% rename from deployments/soteria/templates/deployment.yaml rename to charts/soteria/templates/deployment.yaml diff --git a/deployments/soteria/templates/hpa.yaml b/charts/soteria/templates/hpa.yaml similarity index 100% rename from deployments/soteria/templates/hpa.yaml rename to charts/soteria/templates/hpa.yaml diff --git a/deployments/soteria/templates/secret.yaml b/charts/soteria/templates/secret.yaml similarity index 100% rename from deployments/soteria/templates/secret.yaml rename to charts/soteria/templates/secret.yaml diff --git a/deployments/soteria/templates/service.yaml b/charts/soteria/templates/service.yaml similarity index 100% rename from deployments/soteria/templates/service.yaml rename to charts/soteria/templates/service.yaml diff --git a/deployments/soteria/templates/servicemonitor.yaml b/charts/soteria/templates/servicemonitor.yaml similarity index 100% rename from deployments/soteria/templates/servicemonitor.yaml rename to charts/soteria/templates/servicemonitor.yaml diff --git a/deployments/soteria/templates/tests/test-connection.yaml b/charts/soteria/templates/tests/test-connection.yaml similarity index 100% rename from deployments/soteria/templates/tests/test-connection.yaml rename to charts/soteria/templates/tests/test-connection.yaml diff --git a/deployments/soteria/values.yaml b/charts/soteria/values.yaml similarity index 100% rename from deployments/soteria/values.yaml rename to charts/soteria/values.yaml From 5646830f625f7a35ea76ced8848c42f5c20004b9 Mon Sep 17 00:00:00 2001 From: Parham Alvani Date: Wed, 25 Oct 2023 10:07:06 +0000 Subject: [PATCH 478/660] feat: update soteria chart description --- charts/soteria/Chart.yaml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/charts/soteria/Chart.yaml b/charts/soteria/Chart.yaml index 4ea1bbff..61e0897c 100644 --- a/charts/soteria/Chart.yaml +++ b/charts/soteria/Chart.yaml @@ -1,8 +1,14 @@ --- apiVersion: v2 name: soteria +icon: https://github.com/snapp-incubator/soteria/blob/main/.github/assets/logo.jpg description: Soteria provides EMQX authentication using HTTP +maintainers: + - name: 1995parham + url: https://github.com/1995parham + email: parham.alvani@gmail.com + type: application version: 8.0.0 From 51d412d3d88ed710472d4544c92708a27bbc5b7d Mon Sep 17 00:00:00 2001 From: Parham Alvani Date: Wed, 25 Oct 2023 10:15:24 +0000 Subject: [PATCH 479/660] Update Chart.yaml --- charts/soteria/Chart.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/charts/soteria/Chart.yaml b/charts/soteria/Chart.yaml index 61e0897c..f935c449 100644 --- a/charts/soteria/Chart.yaml +++ b/charts/soteria/Chart.yaml @@ -13,4 +13,4 @@ type: application version: 8.0.0 -appVersion: "v8-0-0" +appVersion: "v8.0.0" From 263de4e23e2f3b6401b98a689976bc5820b50965 Mon Sep 17 00:00:00 2001 From: Parham Alvani Date: Wed, 25 Oct 2023 10:33:57 +0000 Subject: [PATCH 480/660] Update values.yaml --- charts/soteria/values.yaml | 55 +++++++++++++++++++++++++++++++++++++- 1 file changed, 54 insertions(+), 1 deletion(-) diff --git a/charts/soteria/values.yaml b/charts/soteria/values.yaml index 5cb813bd..47e3d555 100644 --- a/charts/soteria/values.yaml +++ b/charts/soteria/values.yaml @@ -52,4 +52,57 @@ config: host: 127.0.0.1 port: 6831 -vendors: {} +vendors: + snapp: + company: "snapp" + hashid_map: + 0: + salt: "secret" + length: 15 + 1: + salt: "secret" + length: 15 + allowed_access_types: [ "pub", "sub" ] + topics: + - type: cab_event + template: ^{{IssToEntity .iss}}-event-{{ EncodeMD5 (DecodeHashID .sub .iss) }}$ + hash_type: 1 + # describe the way issuers (from the jwt token) can interact with topic. + # here issuer 1 (mapped to passenger in the iss_entity_map) can subscribe (second element in the allowed_access_types). + accesses: + 0: '1' + 1: '1' + keys: + 0: |- + -----BEGIN PUBLIC KEY----- + MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAyG4XpV9TpDfgWJF9TiIv + va4hNhDuqYMJO6iXLzr3y8oCvoB7zUK0EjtbLH+A3gr1kUvyZKDWT4qHTvU2Sshm + X+ttWGK34EhCvF3Lb18yxmVDSSK8JIcTaJjMqmyubxzamQnNoWazJ7ea9BIo2YGL + C9rgPbi1hihhdb07xPGUkJRqbWkI98xjDhKdMqiwW1hIRXm/apo++FjptvqvF84s + ynC5gWGFHiGNICRsLJBczLEAf2Atbafigq6/tovzMabnp2yRtr1ReEgioH1RO4gX + J7F4N5f6y/VWd8+sDOSxtS/HcnP/7g8/A54G2IbXxr+EiwOO/1F+pyMPKq7sGDSU + DwIDAQAB + -----END PUBLIC KEY----- + 1: |- + -----BEGIN PUBLIC KEY----- + MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA5SeRfOdTyvQZ7N9ahFHl + +J05r7e9fgOQ2cpOtnnsIjAjCt1dF7/NkqVifEaxABRBGG9iXIw//G4hi0TqoKqK + aoSHMGf6q9pSRLGyB8FatxZf2RBTgrXYqVvpasbnB1ZNv858yTpRjV9NzJXYHLp8 + 8Hbd/yYTR6Q7ajs11/SMLGO7KBELsI1pBz7UW/fngJ2pRmd+RkG+EcGrOIZ27TkI + Xjtog6bgfmtV9FWxSVdKACOY0OmW+g7jIMik2eZTYG3kgCmW2odu3zRoUa7l9VwN + YMuhTePaIWwOifzRQt8HDsAOpzqJuLCoYX7HmBfpGAnwu4BuTZgXVwpvPNb+KlgS + pQIDAQAB + -----END PUBLIC KEY----- + iss_entity_map: + 0: "driver" + 1: "passenger" + default: "none" + iss_peer_map: + 0: "passenger" + 1: "driver" + default: "none" + jwt: + # provide keys and algorithm to parse JWT token. + iss_name: "iss" + sub_name: "sub" + signing_method: "RS512" From e1ab3edf9d9cd88a9326d4b9f7e83aa45d282273 Mon Sep 17 00:00:00 2001 From: Parham Alvani Date: Wed, 25 Oct 2023 10:39:15 +0000 Subject: [PATCH 481/660] fix: correct lint issues in values.yaml --- charts/soteria/values.yaml | 44 +++++++++++++++++++------------------- 1 file changed, 22 insertions(+), 22 deletions(-) diff --git a/charts/soteria/values.yaml b/charts/soteria/values.yaml index 47e3d555..78997d03 100644 --- a/charts/soteria/values.yaml +++ b/charts/soteria/values.yaml @@ -53,7 +53,7 @@ config: port: 6831 vendors: - snapp: + snapp: company: "snapp" hashid_map: 0: @@ -62,7 +62,7 @@ vendors: 1: salt: "secret" length: 15 - allowed_access_types: [ "pub", "sub" ] + allowed_access_types: ["pub", "sub"] topics: - type: cab_event template: ^{{IssToEntity .iss}}-event-{{ EncodeMD5 (DecodeHashID .sub .iss) }}$ @@ -73,26 +73,26 @@ vendors: 0: '1' 1: '1' keys: - 0: |- - -----BEGIN PUBLIC KEY----- - MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAyG4XpV9TpDfgWJF9TiIv - va4hNhDuqYMJO6iXLzr3y8oCvoB7zUK0EjtbLH+A3gr1kUvyZKDWT4qHTvU2Sshm - X+ttWGK34EhCvF3Lb18yxmVDSSK8JIcTaJjMqmyubxzamQnNoWazJ7ea9BIo2YGL - C9rgPbi1hihhdb07xPGUkJRqbWkI98xjDhKdMqiwW1hIRXm/apo++FjptvqvF84s - ynC5gWGFHiGNICRsLJBczLEAf2Atbafigq6/tovzMabnp2yRtr1ReEgioH1RO4gX - J7F4N5f6y/VWd8+sDOSxtS/HcnP/7g8/A54G2IbXxr+EiwOO/1F+pyMPKq7sGDSU - DwIDAQAB - -----END PUBLIC KEY----- - 1: |- - -----BEGIN PUBLIC KEY----- - MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA5SeRfOdTyvQZ7N9ahFHl - +J05r7e9fgOQ2cpOtnnsIjAjCt1dF7/NkqVifEaxABRBGG9iXIw//G4hi0TqoKqK - aoSHMGf6q9pSRLGyB8FatxZf2RBTgrXYqVvpasbnB1ZNv858yTpRjV9NzJXYHLp8 - 8Hbd/yYTR6Q7ajs11/SMLGO7KBELsI1pBz7UW/fngJ2pRmd+RkG+EcGrOIZ27TkI - Xjtog6bgfmtV9FWxSVdKACOY0OmW+g7jIMik2eZTYG3kgCmW2odu3zRoUa7l9VwN - YMuhTePaIWwOifzRQt8HDsAOpzqJuLCoYX7HmBfpGAnwu4BuTZgXVwpvPNb+KlgS - pQIDAQAB - -----END PUBLIC KEY----- + 0: |- + -----BEGIN PUBLIC KEY----- + MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAyG4XpV9TpDfgWJF9TiIv + va4hNhDuqYMJO6iXLzr3y8oCvoB7zUK0EjtbLH+A3gr1kUvyZKDWT4qHTvU2Sshm + X+ttWGK34EhCvF3Lb18yxmVDSSK8JIcTaJjMqmyubxzamQnNoWazJ7ea9BIo2YGL + C9rgPbi1hihhdb07xPGUkJRqbWkI98xjDhKdMqiwW1hIRXm/apo++FjptvqvF84s + ynC5gWGFHiGNICRsLJBczLEAf2Atbafigq6/tovzMabnp2yRtr1ReEgioH1RO4gX + J7F4N5f6y/VWd8+sDOSxtS/HcnP/7g8/A54G2IbXxr+EiwOO/1F+pyMPKq7sGDSU + DwIDAQAB + -----END PUBLIC KEY----- + 1: |- + -----BEGIN PUBLIC KEY----- + MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA5SeRfOdTyvQZ7N9ahFHl + +J05r7e9fgOQ2cpOtnnsIjAjCt1dF7/NkqVifEaxABRBGG9iXIw//G4hi0TqoKqK + aoSHMGf6q9pSRLGyB8FatxZf2RBTgrXYqVvpasbnB1ZNv858yTpRjV9NzJXYHLp8 + 8Hbd/yYTR6Q7ajs11/SMLGO7KBELsI1pBz7UW/fngJ2pRmd+RkG+EcGrOIZ27TkI + Xjtog6bgfmtV9FWxSVdKACOY0OmW+g7jIMik2eZTYG3kgCmW2odu3zRoUa7l9VwN + YMuhTePaIWwOifzRQt8HDsAOpzqJuLCoYX7HmBfpGAnwu4BuTZgXVwpvPNb+KlgS + pQIDAQAB + -----END PUBLIC KEY----- iss_entity_map: 0: "driver" 1: "passenger" From f0c2ed841789248cf83b65e19ca2bb758ecf9f6c Mon Sep 17 00:00:00 2001 From: Parham Alvani Date: Wed, 25 Oct 2023 10:44:33 +0000 Subject: [PATCH 482/660] fix: correct test url in the helm chart --- charts/soteria/templates/tests/test-connection.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/charts/soteria/templates/tests/test-connection.yaml b/charts/soteria/templates/tests/test-connection.yaml index fb669ce6..a48eac00 100644 --- a/charts/soteria/templates/tests/test-connection.yaml +++ b/charts/soteria/templates/tests/test-connection.yaml @@ -15,7 +15,7 @@ spec: {{ range .Values.service.ports }} {{ if eq .name "http"}} args: - - {{ include "soteria.fullname" $ }}:{{ .port }} + - {{ include "soteria.fullname" $ }}:{{ .port }}/healthz {{ end }} {{ end }} restartPolicy: Never From 71adc7f7ad393173fa5bc71628b92115dc691347 Mon Sep 17 00:00:00 2001 From: Parham Alvani Date: Wed, 25 Oct 2023 10:50:35 +0000 Subject: [PATCH 483/660] fix: correct test url in the helm chart --- charts/soteria/templates/tests/test-connection.yaml | 2 +- charts/soteria/values.yaml | 4 ---- 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/charts/soteria/templates/tests/test-connection.yaml b/charts/soteria/templates/tests/test-connection.yaml index a48eac00..fb2635ef 100644 --- a/charts/soteria/templates/tests/test-connection.yaml +++ b/charts/soteria/templates/tests/test-connection.yaml @@ -15,7 +15,7 @@ spec: {{ range .Values.service.ports }} {{ if eq .name "http"}} args: - - {{ include "soteria.fullname" $ }}:{{ .port }}/healthz + - {{ include "soteria.fullname" $ }}:{{ .port }}/metrics {{ end }} {{ end }} restartPolicy: Never diff --git a/charts/soteria/values.yaml b/charts/soteria/values.yaml index 78997d03..b66e713e 100644 --- a/charts/soteria/values.yaml +++ b/charts/soteria/values.yaml @@ -47,10 +47,6 @@ config: level: "debug" tracer: enabled: false - ratio: 0.1 - agent: - host: 127.0.0.1 - port: 6831 vendors: snapp: From ec9055ae131a333f9c37149218b85fff2e5cf90a Mon Sep 17 00:00:00 2001 From: Parham Alvani Date: Wed, 25 Oct 2023 11:01:00 +0000 Subject: [PATCH 484/660] feat: use helm workflow on tag --- .github/workflows/helm.yaml | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/.github/workflows/helm.yaml b/.github/workflows/helm.yaml index f00d968c..3aa4409d 100644 --- a/.github/workflows/helm.yaml +++ b/.github/workflows/helm.yaml @@ -3,10 +3,8 @@ name: helm on: push: - branches: - - main - paths: - - charts/soteria/** + tags: + - 'v*' jobs: release: From 560a910979e4dbe1e14deecdfa9b3bab30f1cf54 Mon Sep 17 00:00:00 2001 From: Parham Alvani Date: Wed, 25 Oct 2023 11:17:39 +0000 Subject: [PATCH 485/660] chore: disable skip for chart release so it creates release --- .github/workflows/helm.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/helm.yaml b/.github/workflows/helm.yaml index 3aa4409d..e4a3d011 100644 --- a/.github/workflows/helm.yaml +++ b/.github/workflows/helm.yaml @@ -48,5 +48,7 @@ jobs: - name: run chart-releaser uses: helm/chart-releaser-action@v1.5.0 + with: + skip_existing: false env: CR_TOKEN: "${{ secrets.GITHUB_TOKEN }}" From d04591fdcbe5afb67c92a485746a5745ed304b00 Mon Sep 17 00:00:00 2001 From: Parham Alvani Date: Wed, 25 Oct 2023 11:25:20 +0000 Subject: [PATCH 486/660] chore: disable skip for chart release so it creates release --- .github/workflows/helm.yaml | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/.github/workflows/helm.yaml b/.github/workflows/helm.yaml index e4a3d011..67111155 100644 --- a/.github/workflows/helm.yaml +++ b/.github/workflows/helm.yaml @@ -18,7 +18,7 @@ jobs: - name: set up helm uses: azure/setup-helm@v3 with: - version: v3.4.0 + version: v3.14.0 - uses: actions/setup-python@v4 with: @@ -41,14 +41,8 @@ jobs: git config user.name "$GITHUB_ACTOR" git config user.email "$GITHUB_ACTOR@users.noreply.github.com" - - name: install helm - uses: azure/setup-helm@v3 - with: - version: v3.4.0 - - name: run chart-releaser uses: helm/chart-releaser-action@v1.5.0 - with: - skip_existing: false env: + CR_SKIP_EXISTING: false CR_TOKEN: "${{ secrets.GITHUB_TOKEN }}" From d4b1e2b6e99ab4031ecc1bf8b6a9e717eebbbaee Mon Sep 17 00:00:00 2001 From: Parham Alvani Date: Wed, 25 Oct 2023 11:27:44 +0000 Subject: [PATCH 487/660] fix: correct helm version to install --- .github/workflows/helm.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/helm.yaml b/.github/workflows/helm.yaml index 67111155..388f5645 100644 --- a/.github/workflows/helm.yaml +++ b/.github/workflows/helm.yaml @@ -18,7 +18,7 @@ jobs: - name: set up helm uses: azure/setup-helm@v3 with: - version: v3.14.0 + version: v3.5.0 - uses: actions/setup-python@v4 with: From f9b0c0f8624a578db0368e680023f59301579f96 Mon Sep 17 00:00:00 2001 From: Parham Alvani Date: Wed, 25 Oct 2023 14:02:50 +0000 Subject: [PATCH 488/660] feat: update workflows --- .github/workflows/helm.yaml | 41 +++++++++++++++++++++++-------------- .github/workflows/test.yaml | 1 + 2 files changed, 27 insertions(+), 15 deletions(-) diff --git a/.github/workflows/helm.yaml b/.github/workflows/helm.yaml index 388f5645..b20d7e93 100644 --- a/.github/workflows/helm.yaml +++ b/.github/workflows/helm.yaml @@ -3,13 +3,11 @@ name: helm on: push: - tags: - - 'v*' + paths: + /charts/** jobs: - release: - permissions: - contents: write + test: runs-on: ubuntu-latest steps: - name: checkout @@ -18,7 +16,7 @@ jobs: - name: set up helm uses: azure/setup-helm@v3 with: - version: v3.5.0 + version: v3.13.0 - uses: actions/setup-python@v4 with: @@ -36,13 +34,26 @@ jobs: - name: run chart-testing (install) run: ct install --all - - name: configure git + release: + runs-on: ubuntu-latest + if: ${{ startsWith(github.ref, 'refs/tags/v') }} + steps: + - name: checkout + uses: actions/checkout@v4 + + - name: set up helm + uses: azure/setup-helm@v3 + with: + version: v3.13.0 + + - name: login to github container registry using helm + run: | + echo ${{ secrets.GITHUB_TOKEN }} | helm registry login ghcr.io/snapp-incubator/soteria --username ${{ github.repository_owner }} --password-stdin + + - name: save helm chart to local registry + run: | + helm chart save / ghcr.io/snapp-incubator/soteria-chart:${{ github.sha }} + + - name: publish chart to acr run: | - git config user.name "$GITHUB_ACTOR" - git config user.email "$GITHUB_ACTOR@users.noreply.github.com" - - - name: run chart-releaser - uses: helm/chart-releaser-action@v1.5.0 - env: - CR_SKIP_EXISTING: false - CR_TOKEN: "${{ secrets.GITHUB_TOKEN }}" + helm chart push ghcr.io/snapp-incubator/soteria-chart:${{ github.sha }} diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index a20b8bb7..753b5a44 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -2,6 +2,7 @@ name: test on: - push + jobs: lint: name: lint From 50979b3054411e35c76a36cc9dc910dc03ccb548 Mon Sep 17 00:00:00 2001 From: Parham Alvani Date: Wed, 25 Oct 2023 14:06:09 +0000 Subject: [PATCH 489/660] chore: use helm pipeline in all releases --- .github/workflows/helm.yaml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.github/workflows/helm.yaml b/.github/workflows/helm.yaml index b20d7e93..6a43691b 100644 --- a/.github/workflows/helm.yaml +++ b/.github/workflows/helm.yaml @@ -2,9 +2,7 @@ name: helm on: - push: - paths: - /charts/** + - push jobs: test: From f9d45a213890962cee8caf2e39133d23be6d9312 Mon Sep 17 00:00:00 2001 From: Parham Alvani Date: Wed, 25 Oct 2023 14:07:37 +0000 Subject: [PATCH 490/660] feat: re-add the path change constraints --- .github/workflows/helm.yaml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/helm.yaml b/.github/workflows/helm.yaml index 6a43691b..7ad15809 100644 --- a/.github/workflows/helm.yaml +++ b/.github/workflows/helm.yaml @@ -2,7 +2,10 @@ name: helm on: - - push + push: + paths: + /charts/** + /.github/workflows/** jobs: test: From 623384afebbac9d5f717cc10e486b114b3c4c476 Mon Sep 17 00:00:00 2001 From: Parham Alvani Date: Wed, 25 Oct 2023 14:26:14 +0000 Subject: [PATCH 491/660] chore: re-enable helm check over all commit --- .github/workflows/helm.yaml | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/.github/workflows/helm.yaml b/.github/workflows/helm.yaml index 7ad15809..50ed5d2e 100644 --- a/.github/workflows/helm.yaml +++ b/.github/workflows/helm.yaml @@ -1,11 +1,7 @@ --- name: helm - on: - push: - paths: - /charts/** - /.github/workflows/** + - push jobs: test: From be8cc2bac18af98e5b8933cb24932faddf29a172 Mon Sep 17 00:00:00 2001 From: Parham Alvani Date: Wed, 25 Oct 2023 15:21:11 +0000 Subject: [PATCH 492/660] feat: update chart publish --- .github/workflows/helm.yaml | 10 ++++++---- charts/soteria/Chart.yaml | 5 ++--- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/.github/workflows/helm.yaml b/.github/workflows/helm.yaml index 50ed5d2e..01355033 100644 --- a/.github/workflows/helm.yaml +++ b/.github/workflows/helm.yaml @@ -47,10 +47,12 @@ jobs: run: | echo ${{ secrets.GITHUB_TOKEN }} | helm registry login ghcr.io/snapp-incubator/soteria --username ${{ github.repository_owner }} --password-stdin - - name: save helm chart to local registry + - name: package soteria helm chart run: | - helm chart save / ghcr.io/snapp-incubator/soteria-chart:${{ github.sha }} + version=${{ github.ref_name }} + helm package --version "${version##v}" --app-version "${version}" ./charts/soteria - - name: publish chart to acr + - name: publish soteria chart to github container registry run: | - helm chart push ghcr.io/snapp-incubator/soteria-chart:${{ github.sha }} + version=${{ github.ref_name }} + helm push "soteria-${version##v}".tgz ghcr.io/snapp-incubator/soteria-chart diff --git a/charts/soteria/Chart.yaml b/charts/soteria/Chart.yaml index f935c449..40c0e4c5 100644 --- a/charts/soteria/Chart.yaml +++ b/charts/soteria/Chart.yaml @@ -11,6 +11,5 @@ maintainers: type: application -version: 8.0.0 - -appVersion: "v8.0.0" +version: 0.0.0 +appVersion: latest From b7306539d3f6c71fe7bca7f925e7cc5d629197af Mon Sep 17 00:00:00 2001 From: Parham Alvani Date: Wed, 25 Oct 2023 15:32:03 +0000 Subject: [PATCH 493/660] fix: correct helm push address --- .github/workflows/helm.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/helm.yaml b/.github/workflows/helm.yaml index 01355033..8df12787 100644 --- a/.github/workflows/helm.yaml +++ b/.github/workflows/helm.yaml @@ -55,4 +55,4 @@ jobs: - name: publish soteria chart to github container registry run: | version=${{ github.ref_name }} - helm push "soteria-${version##v}".tgz ghcr.io/snapp-incubator/soteria-chart + helm push "soteria-${version##v}".tgz oci://ghcr.io/snapp-incubator/soteria-chart From 177d342967de2b425faccccd11f169a1f9d259a8 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 6 Nov 2023 01:13:40 +0000 Subject: [PATCH 494/660] chore(deps): bump helm/chart-testing-action from 2.4.0 to 2.6.1 Bumps [helm/chart-testing-action](https://github.com/helm/chart-testing-action) from 2.4.0 to 2.6.1. - [Release notes](https://github.com/helm/chart-testing-action/releases) - [Commits](https://github.com/helm/chart-testing-action/compare/v2.4.0...v2.6.1) --- updated-dependencies: - dependency-name: helm/chart-testing-action dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- .github/workflows/helm.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/helm.yaml b/.github/workflows/helm.yaml index 8df12787..f056e0a5 100644 --- a/.github/workflows/helm.yaml +++ b/.github/workflows/helm.yaml @@ -20,7 +20,7 @@ jobs: python-version: 3.7 - name: set up chart-testing - uses: helm/chart-testing-action@v2.4.0 + uses: helm/chart-testing-action@v2.6.1 - name: run chart-testing (lint) run: ct lint --all From 8545fb7c4f60221b32fe686271c4604ffec5aff5 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 6 Nov 2023 01:26:55 +0000 Subject: [PATCH 495/660] chore(deps): bump github.com/spf13/cobra from 1.7.0 to 1.8.0 Bumps [github.com/spf13/cobra](https://github.com/spf13/cobra) from 1.7.0 to 1.8.0. - [Release notes](https://github.com/spf13/cobra/releases) - [Commits](https://github.com/spf13/cobra/compare/v1.7.0...v1.8.0) --- updated-dependencies: - dependency-name: github.com/spf13/cobra dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- go.mod | 2 +- go.sum | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/go.mod b/go.mod index 2ebf592e..756a5005 100644 --- a/go.mod +++ b/go.mod @@ -10,7 +10,7 @@ require ( github.com/knadh/koanf v1.5.0 github.com/knadh/koanf/v2 v2.0.1 github.com/speps/go-hashids/v2 v2.0.1 - github.com/spf13/cobra v1.7.0 + github.com/spf13/cobra v1.8.0 github.com/stretchr/testify v1.8.4 github.com/tidwall/pretty v1.2.1 go.opentelemetry.io/otel v1.19.0 diff --git a/go.sum b/go.sum index 2a5296ca..8554af2d 100644 --- a/go.sum +++ b/go.sum @@ -41,7 +41,7 @@ github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGX github.com/cncf/udpa/go v0.0.0-20201120205902-5459f2c99403/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= github.com/coreos/go-semver v0.3.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk= github.com/coreos/go-systemd/v22 v22.3.2/go.mod h1:Y58oyj3AT4RCenI/lSvhwexgC+NSVTIJ3seZv2GcEnc= -github.com/cpuguy83/go-md2man/v2 v2.0.2/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= +github.com/cpuguy83/go-md2man/v2 v2.0.3/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= @@ -280,8 +280,8 @@ github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6Mwd github.com/sirupsen/logrus v1.6.0/go.mod h1:7uNnSEd1DgxDLC74fIahvMZmmYsHGZGEOFrfsX/uA88= github.com/speps/go-hashids/v2 v2.0.1 h1:ViWOEqWES/pdOSq+C1SLVa8/Tnsd52XC34RY7lt7m4g= github.com/speps/go-hashids/v2 v2.0.1/go.mod h1:47LKunwvDZki/uRVD6NImtyk712yFzIs3UF3KlHohGw= -github.com/spf13/cobra v1.7.0 h1:hyqWnYt1ZQShIddO5kBpj3vu05/++x6tJ6dg8EC572I= -github.com/spf13/cobra v1.7.0/go.mod h1:uLxZILRyS/50WlhOIKD7W6V5bgeIt+4sICxh6uRMrb0= +github.com/spf13/cobra v1.8.0 h1:7aJaZx1B85qltLMc546zn58BxxfZdR/W22ej9CFoEf0= +github.com/spf13/cobra v1.8.0/go.mod h1:WXLWApfZ71AjXPya3WOlMsY9yMs7YeiHhFVlvLyhcho= github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA= github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= From f14d9e54d1f3d88d038770911dfb753c82bc4042 Mon Sep 17 00:00:00 2001 From: Parham Alvani Date: Sat, 11 Nov 2023 14:50:29 +0000 Subject: [PATCH 496/660] feat: implement admin authenticator --- internal/authenticator/admin_authenticator.go | 60 +++++++++++++++++++ internal/authenticator/builder.go | 23 +++++-- internal/config/config.go | 11 ++-- 3 files changed, 86 insertions(+), 8 deletions(-) create mode 100644 internal/authenticator/admin_authenticator.go diff --git a/internal/authenticator/admin_authenticator.go b/internal/authenticator/admin_authenticator.go new file mode 100644 index 00000000..a315d45e --- /dev/null +++ b/internal/authenticator/admin_authenticator.go @@ -0,0 +1,60 @@ +package authenticator + +import ( + "fmt" + + "github.com/golang-jwt/jwt/v5" + "github.com/snapp-incubator/soteria/internal/config" + "github.com/snapp-incubator/soteria/pkg/acl" +) + +// AdminAuthenticator is responsible for Acl/Auth/Token of the internal system users, +// these users have admin access. +type AdminAuthenticator struct { + Key any + Company string + JwtConfig config.Jwt + Parser *jwt.Parser +} + +// Auth check user authentication by checking the user's token +// isSuperuser is a flag that authenticator set it true when credentials is related to a superuser. +func (a AdminAuthenticator) Auth(tokenString string) error { + _, err := a.Parser.Parse(tokenString, func( + token *jwt.Token, + ) (interface{}, error) { + claims, ok := token.Claims.(jwt.MapClaims) + if !ok { + return nil, ErrInvalidClaims + } + if claims[a.JwtConfig.IssName] == nil { + return nil, ErrIssNotFound + } + + return a.Key, nil + }) + if err != nil { + return fmt.Errorf("token is invalid: %w", err) + } + + return nil +} + +// ACL check a system user access to a topic. +// because we returns is-admin: true, this endpoint shouldn't +// be called. +func (a AdminAuthenticator) ACL( + _ acl.AccessType, + _ string, + _ string, +) (bool, error) { + return true, nil +} + +func (a AdminAuthenticator) ValidateAccessType(_ acl.AccessType) bool { + return true +} + +func (a AdminAuthenticator) GetCompany() string { + return a.Company +} diff --git a/internal/authenticator/builder.go b/internal/authenticator/builder.go index ed2edf62..4735c5f0 100644 --- a/internal/authenticator/builder.go +++ b/internal/authenticator/builder.go @@ -17,6 +17,7 @@ type Builder struct { ValidatorConfig config.Validator } +// nolint: funlen func (b Builder) Authenticators() map[string]Authenticator { all := make(map[string]Authenticator) @@ -30,11 +31,12 @@ func (b Builder) Authenticators() map[string]Authenticator { b.Logger.Fatal("cannot create hash-id manager", zap.Error(err)) } - client := validator.New(b.ValidatorConfig.URL, b.ValidatorConfig.Timeout) - var auth Authenticator - if vendor.UseValidator { + switch { + case vendor.UseValidator: + client := validator.New(b.ValidatorConfig.URL, b.ValidatorConfig.Timeout) + auth = &AutoAuthenticator{ AllowedAccessTypes: allowedAccessTypes, Company: vendor.Company, @@ -50,7 +52,20 @@ func (b Builder) Authenticators() map[string]Authenticator { Validator: client, Parser: jwt.NewParser(), } - } else { + case vendor.IsInternal: + if _, ok := vendor.Keys["system"]; !ok || len(vendor.Keys) != 1 { + b.Logger.Fatal("admin authenticator supports only one key named system") + } + + keys := b.GenerateKeys(vendor.Jwt.SigningMethod, vendor.Keys) + + auth = &AdminAuthenticator{ + Key: keys["system"], + Company: vendor.Company, + JwtConfig: vendor.Jwt, + Parser: jwt.NewParser(), + } + default: keys := b.GenerateKeys(vendor.Jwt.SigningMethod, vendor.Keys) auth = &ManualAuthenticator{ diff --git a/internal/config/config.go b/internal/config/config.go index 101cf9f4..33121c93 100644 --- a/internal/config/config.go +++ b/internal/config/config.go @@ -41,10 +41,13 @@ type ( IssEntityMap map[string]string `json:"iss_entity_map,omitempty" koanf:"iss_entity_map"` IssPeerMap map[string]string `json:"iss_peer_map,omitempty" koanf:"iss_peer_map"` Jwt Jwt `json:"jwt,omitempty" koanf:"jwt"` - // by setting do validate to false we don't validate the jwt token and deligate - // it into a function. - UseValidator bool `json:"use_validator,omitempty" koanf:"use_validator"` - HashIDMap map[string]topics.HashData `json:"hash_id_map,omitempty" koanf:"hashid_map"` + // by setting use validator to true we don't validate the jwt token and deligate + // it into an http client. + UseValidator bool `json:"use_validator,omitempty" koanf:"use_validator"` + // by setting is internal to true we use internal authenticator which provides admin access + // on the authentication method. + IsInternal bool `json:"is_internal,omitempty" koanf:"is_internal"` + HashIDMap map[string]topics.HashData `json:"hash_id_map,omitempty" koanf:"hashid_map"` } Jwt struct { From cabc3c1b7554991fbd7a6033fe4202cc892f47a1 Mon Sep 17 00:00:00 2001 From: Parham Alvani Date: Sat, 11 Nov 2023 17:41:47 +0000 Subject: [PATCH 497/660] fix: correct default configuration --- internal/config/default.go | 1 + 1 file changed, 1 insertion(+) diff --git a/internal/config/default.go b/internal/config/default.go index 516daebb..b8020e47 100644 --- a/internal/config/default.go +++ b/internal/config/default.go @@ -43,6 +43,7 @@ func Default() Config { func SnappVendor() Vendor { return Vendor{ UseValidator: false, + IsInternal: false, AllowedAccessTypes: []string{ "pub", "sub", From 4aa12e3b2d70a03fdb4748d32a36943d9d9a561e Mon Sep 17 00:00:00 2001 From: Parham Alvani Date: Sat, 11 Nov 2023 20:30:53 +0000 Subject: [PATCH 498/660] feat: handle superuser field in the API response --- internal/api/auth.go | 2 +- internal/authenticator/admin_authenticator.go | 4 ++++ internal/authenticator/authenticator.go | 7 ++++++- internal/authenticator/auto_authenticator.go | 4 ++++ internal/authenticator/manual_authenticator.go | 4 ++++ 5 files changed, 19 insertions(+), 2 deletions(-) diff --git a/internal/api/auth.go b/internal/api/auth.go index bee6da01..35331be7 100644 --- a/internal/api/auth.go +++ b/internal/api/auth.go @@ -144,6 +144,6 @@ func (a API) Authv2(c *fiber.Ctx) error { return c.Status(http.StatusOK).JSON(authResponse{ Result: "allow", - IsSuperuser: false, + IsSuperuser: authenticator.IsSuperuser(), }) } diff --git a/internal/authenticator/admin_authenticator.go b/internal/authenticator/admin_authenticator.go index a315d45e..6fbbece4 100644 --- a/internal/authenticator/admin_authenticator.go +++ b/internal/authenticator/admin_authenticator.go @@ -58,3 +58,7 @@ func (a AdminAuthenticator) ValidateAccessType(_ acl.AccessType) bool { func (a AdminAuthenticator) GetCompany() string { return a.Company } + +func (a AdminAuthenticator) IsSuperuser() bool { + return true +} diff --git a/internal/authenticator/authenticator.go b/internal/authenticator/authenticator.go index 27b990bf..21805220 100644 --- a/internal/authenticator/authenticator.go +++ b/internal/authenticator/authenticator.go @@ -5,7 +5,8 @@ import ( ) type Authenticator interface { - // Auth check user authentication by checking the user's token + // Auth check user authentication by checking the user's token. + // it retruns error in case of any issue with the user token. Auth(tokenString string) error // ACL check a user access to a topic. @@ -20,4 +21,8 @@ type Authenticator interface { // GetCompany Return the Company Field of The Inherited Objects GetCompany() string + + // IsSuperuser changes the Auth response in case of successful authentication + // and shows user as superuser which disables the ACL. + IsSuperuser() bool } diff --git a/internal/authenticator/auto_authenticator.go b/internal/authenticator/auto_authenticator.go index 8fa2d639..64febb41 100644 --- a/internal/authenticator/auto_authenticator.go +++ b/internal/authenticator/auto_authenticator.go @@ -99,3 +99,7 @@ func (a AutoAuthenticator) ValidateAccessType(accessType acl.AccessType) bool { func (a AutoAuthenticator) GetCompany() string { return a.Company } + +func (a AutoAuthenticator) IsSuperuser() bool { + return false +} diff --git a/internal/authenticator/manual_authenticator.go b/internal/authenticator/manual_authenticator.go index 7c712111..5c5e0b9d 100644 --- a/internal/authenticator/manual_authenticator.go +++ b/internal/authenticator/manual_authenticator.go @@ -129,3 +129,7 @@ func (a ManualAuthenticator) ValidateAccessType(accessType acl.AccessType) bool func (a ManualAuthenticator) GetCompany() string { return a.Company } + +func (a ManualAuthenticator) IsSuperuser() bool { + return false +} From b7a58ff405921fd4457fa03fbdca2f3cffe68f94 Mon Sep 17 00:00:00 2001 From: Parham Alvani Date: Sat, 11 Nov 2023 23:06:06 +0000 Subject: [PATCH 499/660] fix: correct tests and their usage --- internal/authenticator/auto_authenticator.go | 2 + .../authenticator/auto_authenticator_test.go | 472 ------------------ .../authenticator/manual_authenticator.go | 6 +- .../manual_authenticator_test.go | 449 +---------------- 4 files changed, 16 insertions(+), 913 deletions(-) delete mode 100644 internal/authenticator/auto_authenticator_test.go diff --git a/internal/authenticator/auto_authenticator.go b/internal/authenticator/auto_authenticator.go index 64febb41..7d0d25bb 100644 --- a/internal/authenticator/auto_authenticator.go +++ b/internal/authenticator/auto_authenticator.go @@ -25,6 +25,8 @@ type AutoAuthenticator struct { // Auth check user authentication by checking the user's token // isSuperuser is a flag that authenticator set it true when credentials is related to a superuser. func (a AutoAuthenticator) Auth(tokenString string) error { + fmt.Println("I am here") + if _, err := a.Validator.Validate(context.Background(), http.Header{ validator.ServiceNameHeader: []string{"soteria"}, "user-agent": []string{}, diff --git a/internal/authenticator/auto_authenticator_test.go b/internal/authenticator/auto_authenticator_test.go deleted file mode 100644 index b3269f7a..00000000 --- a/internal/authenticator/auto_authenticator_test.go +++ /dev/null @@ -1,472 +0,0 @@ -package authenticator_test - -import ( - "crypto/rsa" - "errors" - "os" - "testing" - "time" - - "github.com/golang-jwt/jwt/v5" - "github.com/snapp-incubator/soteria/internal/authenticator" - "github.com/snapp-incubator/soteria/internal/config" - "github.com/snapp-incubator/soteria/internal/topics" - "github.com/snapp-incubator/soteria/pkg/acl" - "github.com/stretchr/testify/require" - "github.com/stretchr/testify/suite" - "go.uber.org/zap" -) - -type AutoAuthenticatorTestSuite struct { - suite.Suite - - Tokens struct { - Passenger string - Driver string - } - - PublicKeys struct { - Passenger *rsa.PublicKey - Driver *rsa.PublicKey - } - - Authenticator authenticator.Authenticator -} - -func (suite *AutoAuthenticatorTestSuite) SetupSuite() { - require := suite.Require() - - driverToken := suite.getSampleToken(topics.DriverIss) - - suite.Tokens.Driver = driverToken - - passengerToken := suite.getSampleToken(topics.PassengerIss) - - suite.Tokens.Passenger = passengerToken - - pkey0, err := suite.getPublicKey(topics.DriverIss) - require.NoError(err) - - suite.PublicKeys.Driver = pkey0 - - pkey1, err := suite.getPublicKey(topics.PassengerIss) - require.NoError(err) - - suite.PublicKeys.Passenger = pkey1 - - cfg := config.SnappVendor() - cfg.UseValidator = true - - hid, err := topics.NewHashIDManager(cfg.HashIDMap) - require.NoError(err) - - // nolint: exhaustruct - suite.Authenticator = authenticator.AutoAuthenticator{ - AllowedAccessTypes: []acl.AccessType{acl.Pub, acl.Sub, acl.PubSub}, - Company: "snapp", - TopicManager: topics.NewTopicManager(cfg.Topics, hid, "snapp", cfg.IssEntityMap, cfg.IssPeerMap, zap.NewNop()), - // Validator: validatorClient, - } -} - -func (suite *AutoAuthenticatorTestSuite) TestAuth() { - require := suite.Require() - - suite.Run("testing driver token auth", func() { - require.NoError(suite.Authenticator.Auth(suite.Tokens.Driver)) - }) - - suite.Run("testing passenger token auth", func() { - require.NoError(suite.Authenticator.Auth(suite.Tokens.Passenger)) - }) - - suite.Run("testing invalid token auth", func() { - require.Error(suite.Authenticator.Auth(invalidToken)) - }) -} - -// nolint: dupl -func (suite *AutoAuthenticatorTestSuite) TestACL_Basics() { - require := suite.Require() - - suite.Run("testing acl with invalid access type", func() { - ok, err := suite.Authenticator.ACL("invalid-access", suite.Tokens.Passenger, "test") - require.Error(err) - require.False(ok) - require.ErrorIs(err, authenticator.ErrInvalidAccessType) - }) - - suite.Run("testing acl with invalid token", func() { - ok, err := suite.Authenticator.ACL(acl.Pub, invalidToken, validDriverCabEventTopic) - require.False(ok) - require.Error(err) - require.Equal("token is invalid illegal base64 data at input byte 36", err.Error()) - }) - - suite.Run("testing acl with valid inputs", func() { - ok, err := suite.Authenticator.ACL(acl.Sub, suite.Tokens.Passenger, validPassengerCabEventTopic) - require.NoError(err) - require.True(ok) - }) - - suite.Run("testing acl with invalid topic", func() { - ok, err := suite.Authenticator.ACL(acl.Sub, suite.Tokens.Passenger, invalidPassengerCabEventTopic) - require.Error(err) - require.False(ok) - }) - - suite.Run("testing acl with invalid access type", func() { - ok, err := suite.Authenticator.ACL(acl.Pub, suite.Tokens.Passenger, validPassengerCabEventTopic) - require.Error(err) - require.False(ok) - }) -} - -// nolint: funlen -func (suite *AutoAuthenticatorTestSuite) TestACL_Passenger() { - require := suite.Require() - token := suite.Tokens.Passenger - - suite.Run("testing passenger subscribe on valid superapp event topic", func() { - ok, err := suite.Authenticator.ACL(acl.Sub, token, validPassengerSuperappEventTopic) - require.NoError(err) - require.True(ok) - }) - - suite.Run("testing passenger subscribe on invalid superapp event topic", func() { - ok, err := suite.Authenticator.ACL(acl.Sub, token, invalidPassengerSuperappEventTopic) - require.Error(err) - require.False(ok) - }) - - suite.Run("testing passenger subscribe on valid shared location topic", func() { - ok, err := suite.Authenticator.ACL(acl.Sub, token, validPassengerSharedTopic) - require.NoError(err) - require.True(ok) - }) - - suite.Run("testing passenger subscribe on invalid shared location topic", func() { - ok, err := suite.Authenticator.ACL(acl.Sub, token, invalidPassengerSharedTopic) - require.Error(err) - require.False(ok) - }) - - suite.Run("testing passenger subscribe on valid chat topic", func() { - ok, err := suite.Authenticator.ACL(acl.Sub, token, validPassengerChatTopic) - require.NoError(err) - require.True(ok) - }) - - suite.Run("testing passenger subscribe on invalid chat topic", func() { - ok, err := suite.Authenticator.ACL(acl.Sub, token, invalidPassengerChatTopic) - require.Error(err) - require.False(ok) - }) - - suite.Run("testing passenger subscribe on valid entry call topic", func() { - ok, err := suite.Authenticator.ACL(acl.Pub, token, validPassengerCallEntryTopic) - require.NoError(err) - require.True(ok) - }) - - suite.Run("testing passenger subscribe on invalid call entry topic", func() { - ok, err := suite.Authenticator.ACL(acl.Pub, token, invalidPassengerCallEntryTopic) - require.Error(err) - require.False(ok) - }) - - suite.Run("testing passenger subscribe on valid outgoing call topic", func() { - ok, err := suite.Authenticator.ACL(acl.Sub, token, validPassengerCallOutgoingTopic) - require.NoError(err) - require.True(ok) - }) - - suite.Run("testing passenger subscribe on valid outgoing call node topic", func() { - ok, err := suite.Authenticator.ACL(acl.Pub, token, validPassengerNodeCallEntryTopic) - require.NoError(err) - require.True(ok) - }) - - suite.Run("testing passenger subscribe on invalid call outgoing topic", func() { - ok, err := suite.Authenticator.ACL(acl.Sub, token, invalidPassengerCallOutgoingTopic) - require.Error(err) - require.False(ok) - }) -} - -// nolint: funlen -func (suite *AutoAuthenticatorTestSuite) TestACL_Driver() { - require := suite.Require() - token := suite.Tokens.Driver - - suite.Run("testing driver publish on its location topic", func() { - ok, err := suite.Authenticator.ACL(acl.Pub, token, validDriverLocationTopic) - require.NoError(err) - require.True(ok) - }) - - suite.Run("testing driver publish on invalid location topic", func() { - ok, err := suite.Authenticator.ACL(acl.Pub, token, invalidDriverLocationTopic) - require.Error(err) - require.False(ok) - }) - - suite.Run("testing driver subscribe on invalid cab event topic", func() { - ok, err := suite.Authenticator.ACL(acl.Sub, token, invalidDriverCabEventTopic) - require.Error(err) - require.False(ok) - }) - - suite.Run("testing driver subscribe on valid superapp event topic", func() { - ok, err := suite.Authenticator.ACL(acl.Sub, token, validDriverSuperappEventTopic) - require.NoError(err) - require.True(ok) - }) - - suite.Run("testing driver subscribe on invalid superapp event topic", func() { - ok, err := suite.Authenticator.ACL(acl.Sub, token, invalidDriverSuperappEventTopic) - require.Error(err) - require.False(ok) - }) - - suite.Run("testing driver subscribe on valid shared location topic", func() { - ok, err := suite.Authenticator.ACL(acl.Sub, token, validDriverSharedTopic) - require.NoError(err) - require.True(ok) - }) - - suite.Run("testing driver subscribe on invalid shared location topic", func() { - ok, err := suite.Authenticator.ACL(acl.Sub, token, invalidDriverSharedTopic) - require.Error(err) - require.False(ok) - }) - - suite.Run("testing driver subscribe on valid chat topic", func() { - ok, err := suite.Authenticator.ACL(acl.Sub, token, validDriverChatTopic) - require.NoError(err) - require.True(ok) - }) - - suite.Run("testing driver subscribe on invalid chat topic", func() { - ok, err := suite.Authenticator.ACL(acl.Sub, token, invalidDriverChatTopic) - require.Error(err) - require.False(ok) - }) - - suite.Run("testing driver subscribe on valid call entry topic", func() { - ok, err := suite.Authenticator.ACL(acl.Pub, token, validDriverCallEntryTopic) - require.NoError(err) - require.True(ok) - }) - - suite.Run("testing driver subscribe on invalid call entry topic", func() { - ok, err := suite.Authenticator.ACL(acl.Pub, token, invalidDriverCallEntryTopic) - require.Error(err) - require.False(ok) - }) - - suite.Run("testing driver subscribe on valid call outgoing topic", func() { - ok, err := suite.Authenticator.ACL(acl.Sub, token, validDriverCallOutgoingTopic) - require.NoError(err) - require.True(ok) - }) - - suite.Run("testing driver subscribe on valid call outgoing node topic", func() { - ok, err := suite.Authenticator.ACL(acl.Pub, token, validDriverNodeCallEntryTopic) - require.NoError(err) - require.True(ok) - }) - - suite.Run("testing driver subscribe on invalid call outgoing topic", func() { - ok, err := suite.Authenticator.ACL(acl.Sub, token, invalidDriverCallOutgoingTopic) - require.Error(err) - require.False(ok) - }) -} - -func TestAutoAuthenticator_ValidateTopicBySender(t *testing.T) { - t.Parallel() - - cfg := config.SnappVendor() - cfg.UseValidator = true - - hid, err := topics.NewHashIDManager(cfg.HashIDMap) - require.NoError(t, err) - - // nolint: exhaustruct - authenticator := authenticator.AutoAuthenticator{ - AllowedAccessTypes: []acl.AccessType{acl.Pub, acl.Sub}, - Company: "snapp", - TopicManager: topics.NewTopicManager(cfg.Topics, hid, "snapp", cfg.IssEntityMap, cfg.IssPeerMap, zap.NewNop()), - } - - t.Run("testing valid driver cab event", func(t *testing.T) { - t.Parallel() - - topicTemplate := authenticator.TopicManager.ParseTopic(validDriverCabEventTopic, topics.DriverIss, "DXKgaNQa7N5Y7bo") - require.NotNil(t, topicTemplate) - }) -} - -// nolint: funlen, dupl -func TestAutoAuthenticator_validateAccessType(t *testing.T) { - t.Parallel() - - type fields struct { - AllowedAccessTypes []acl.AccessType - } - - type args struct { - accessType acl.AccessType - } - - tests := []struct { - name string - fields fields - args args - want bool - }{ - { - name: "#1 testing with no allowed access type", - fields: fields{AllowedAccessTypes: []acl.AccessType{}}, - args: args{accessType: acl.Sub}, - want: false, - }, - { - name: "#2 testing with no allowed access type", - fields: fields{AllowedAccessTypes: []acl.AccessType{}}, - args: args{accessType: acl.Pub}, - want: false, - }, - { - name: "#3 testing with no allowed access type", - fields: fields{AllowedAccessTypes: []acl.AccessType{}}, - args: args{accessType: acl.PubSub}, - want: false, - }, - { - name: "#4 testing with one allowed access type", - fields: fields{AllowedAccessTypes: []acl.AccessType{acl.Pub}}, - args: args{accessType: acl.Pub}, - want: true, - }, - { - name: "#5 testing with one allowed access type", - fields: fields{AllowedAccessTypes: []acl.AccessType{acl.Pub}}, - args: args{accessType: acl.Sub}, - want: false, - }, - { - name: "#6 testing with two allowed access type", - fields: fields{AllowedAccessTypes: []acl.AccessType{acl.Pub, acl.Sub}}, - args: args{accessType: acl.Sub}, - want: true, - }, - { - name: "#7 testing with two allowed access type", - fields: fields{AllowedAccessTypes: []acl.AccessType{acl.Pub, acl.Sub}}, - args: args{accessType: acl.Pub}, - want: true, - }, - { - name: "#8 testing with two allowed access type", - fields: fields{AllowedAccessTypes: []acl.AccessType{acl.Pub, acl.Sub}}, - args: args{accessType: acl.PubSub}, - want: false, - }, - { - name: "#9 testing with three allowed access type", - fields: fields{AllowedAccessTypes: []acl.AccessType{acl.Pub, acl.Sub, acl.PubSub}}, - args: args{accessType: acl.PubSub}, - want: true, - }, - } - - for _, tt := range tests { - tt := tt - t.Run(tt.name, func(t *testing.T) { - t.Parallel() - - // nolint: exhaustruct - a := authenticator.AutoAuthenticator{ - AllowedAccessTypes: tt.fields.AllowedAccessTypes, - } - if got := a.ValidateAccessType(tt.args.accessType); got != tt.want { - t.Errorf("validateAccessType() = %v, want %v", got, tt.want) - } - }) - } -} - -// nolint: goerr113, wrapcheck -func (suite *AutoAuthenticatorTestSuite) getPublicKey(u string) (*rsa.PublicKey, error) { - var fileName string - - switch u { - case topics.PassengerIss: - fileName = "../../test/1.pem" - case topics.DriverIss: - fileName = "../../test/0.pem" - default: - return nil, errors.New("invalid user, public key not found") - } - - pem, err := os.ReadFile(fileName) - if err != nil { - return nil, err - } - - publicKey, err := jwt.ParseRSAPublicKeyFromPEM(pem) - if err != nil { - return nil, err - } - - return publicKey, nil -} - -// nolint: goerr113, wrapcheck -func (suite *AutoAuthenticatorTestSuite) getPrivateKey(u string) (*rsa.PrivateKey, error) { - var fileName string - - switch u { - case topics.DriverIss: - fileName = "../../test/0.private.pem" - case topics.PassengerIss: - fileName = "../../test/1.private.pem" - default: - return nil, errors.New("invalid user, private key not found") - } - - pem, err := os.ReadFile(fileName) - if err != nil { - return nil, err - } - - privateKey, err := jwt.ParseRSAPrivateKeyFromPEM(pem) - if err != nil { - return nil, err - } - - return privateKey, nil -} - -func (suite *AutoAuthenticatorTestSuite) getSampleToken(issuer string) string { - key, err := suite.getPrivateKey(issuer) - suite.Require().NoError(err) - - exp := time.Now().Add(time.Hour * 24 * 365 * 10) - sub := "DXKgaNQa7N5Y7bo" - - // nolint: exhaustruct - claims := jwt.RegisteredClaims{ - ExpiresAt: jwt.NewNumericDate(exp), - Issuer: issuer, - Subject: sub, - } - token := jwt.NewWithClaims(jwt.SigningMethodRS256, claims) - - tokenString, err := token.SignedString(key) - suite.Require().NoError(err) - - return tokenString -} diff --git a/internal/authenticator/manual_authenticator.go b/internal/authenticator/manual_authenticator.go index 5c5e0b9d..abfbb1f6 100644 --- a/internal/authenticator/manual_authenticator.go +++ b/internal/authenticator/manual_authenticator.go @@ -9,7 +9,8 @@ import ( "github.com/snapp-incubator/soteria/pkg/acl" ) -// ManualAuthenticator is responsible for Acl/Auth/Token of users. +// ManualAuthenticator is responsible for Acl/Auth/Token of users without calling +// any http client, etc. type ManualAuthenticator struct { Keys map[string]any AllowedAccessTypes []acl.AccessType @@ -19,8 +20,7 @@ type ManualAuthenticator struct { Parser *jwt.Parser } -// Auth check user authentication by checking the user's token -// isSuperuser is a flag that authenticator set it true when credentials is related to a superuser. +// Auth check user authentication by checking the user's token. func (a ManualAuthenticator) Auth(tokenString string) error { _, err := a.Parser.Parse(tokenString, func( token *jwt.Token, diff --git a/internal/authenticator/manual_authenticator_test.go b/internal/authenticator/manual_authenticator_test.go index 69ec1e5a..ee9931c3 100644 --- a/internal/authenticator/manual_authenticator_test.go +++ b/internal/authenticator/manual_authenticator_test.go @@ -1,11 +1,7 @@ package authenticator_test import ( - "crypto/rsa" - "errors" - "os" "testing" - "time" "github.com/golang-jwt/jwt/v5" "github.com/snapp-incubator/soteria/internal/authenticator" @@ -17,456 +13,33 @@ import ( "go.uber.org/zap" ) -type ManualAuthenticatorTestSuite struct { - suite.Suite - - Tokens struct { - Passenger string - Driver string - } - - PublicKeys struct { - Passenger *rsa.PublicKey - Driver *rsa.PublicKey - } - - Authenticator authenticator.Authenticator -} - -func (suite *ManualAuthenticatorTestSuite) SetupSuite() { - require := suite.Require() - - driverToken := suite.getSampleToken(topics.DriverIss) - - suite.Tokens.Driver = driverToken - - passengerToken := suite.getSampleToken(topics.PassengerIss) - - suite.Tokens.Passenger = passengerToken - - pkey0, err := suite.getPublicKey(topics.DriverIss) - require.NoError(err) +func TestManualAuthenticator_suite(t *testing.T) { + t.Parallel() - suite.PublicKeys.Driver = pkey0 + st := new(AuthenticatorTestSuite) - pkey1, err := suite.getPublicKey(topics.PassengerIss) - require.NoError(err) + pkey0, err := st.getPublicKey(topics.DriverIss) + require.NoError(t, err) - suite.PublicKeys.Passenger = pkey1 + pkey1, err := st.getPublicKey(topics.PassengerIss) + require.NoError(t, err) cfg := config.SnappVendor() hid, err := topics.NewHashIDManager(cfg.HashIDMap) - require.NoError(err) + require.NoError(t, err) // nolint: exhaustruct - suite.Authenticator = authenticator.ManualAuthenticator{ + st.Authenticator = authenticator.ManualAuthenticator{ Keys: map[string]any{ topics.DriverIss: pkey0, topics.PassengerIss: pkey1, }, AllowedAccessTypes: []acl.AccessType{acl.Pub, acl.Sub, acl.PubSub}, Company: "snapp", + Parser: jwt.NewParser(), TopicManager: topics.NewTopicManager(cfg.Topics, hid, "snapp", cfg.IssEntityMap, cfg.IssPeerMap, zap.NewNop()), } -} - -func (suite *ManualAuthenticatorTestSuite) TestAuth() { - require := suite.Require() - - suite.Run("testing driver token auth", func() { - require.NoError(suite.Authenticator.Auth(suite.Tokens.Driver)) - }) - - suite.Run("testing passenger token auth", func() { - require.NoError(suite.Authenticator.Auth(suite.Tokens.Passenger)) - }) - - suite.Run("testing invalid token auth", func() { - require.Error(suite.Authenticator.Auth(invalidToken)) - }) -} - -// nolint: dupl -func (suite *ManualAuthenticatorTestSuite) TestACL_Basics() { - require := suite.Require() - - suite.Run("testing acl with invalid access type", func() { - ok, err := suite.Authenticator.ACL("invalid-access", suite.Tokens.Passenger, "test") - require.Error(err) - require.False(ok) - require.ErrorIs(err, authenticator.ErrInvalidAccessType) - }) - - suite.Run("testing acl with invalid token", func() { - ok, err := suite.Authenticator.ACL(acl.Pub, invalidToken, validDriverCabEventTopic) - require.False(ok) - require.Error(err) - require.Equal("token is invalid illegal base64 data at input byte 36", err.Error()) - }) - - suite.Run("testing acl with valid inputs", func() { - ok, err := suite.Authenticator.ACL(acl.Sub, suite.Tokens.Passenger, validPassengerCabEventTopic) - require.NoError(err) - require.True(ok) - }) - - suite.Run("testing acl with invalid topic", func() { - ok, err := suite.Authenticator.ACL(acl.Sub, suite.Tokens.Passenger, invalidPassengerCabEventTopic) - require.Error(err) - require.False(ok) - }) - - suite.Run("testing acl with invalid access type", func() { - ok, err := suite.Authenticator.ACL(acl.Pub, suite.Tokens.Passenger, validPassengerCabEventTopic) - require.Error(err) - require.False(ok) - }) -} - -// nolint: funlen -func (suite *ManualAuthenticatorTestSuite) TestACL_Passenger() { - require := suite.Require() - token := suite.Tokens.Passenger - - suite.Run("testing passenger subscribe on valid superapp event topic", func() { - ok, err := suite.Authenticator.ACL(acl.Sub, token, validPassengerSuperappEventTopic) - require.NoError(err) - require.True(ok) - }) - - suite.Run("testing passenger subscribe on invalid superapp event topic", func() { - ok, err := suite.Authenticator.ACL(acl.Sub, token, invalidPassengerSuperappEventTopic) - require.Error(err) - require.False(ok) - }) - - suite.Run("testing passenger subscribe on valid shared location topic", func() { - ok, err := suite.Authenticator.ACL(acl.Sub, token, validPassengerSharedTopic) - require.NoError(err) - require.True(ok) - }) - - suite.Run("testing passenger subscribe on invalid shared location topic", func() { - ok, err := suite.Authenticator.ACL(acl.Sub, token, invalidPassengerSharedTopic) - require.Error(err) - require.False(ok) - }) - - suite.Run("testing passenger subscribe on valid chat topic", func() { - ok, err := suite.Authenticator.ACL(acl.Sub, token, validPassengerChatTopic) - require.NoError(err) - require.True(ok) - }) - - suite.Run("testing passenger subscribe on invalid chat topic", func() { - ok, err := suite.Authenticator.ACL(acl.Sub, token, invalidPassengerChatTopic) - require.Error(err) - require.False(ok) - }) - - suite.Run("testing passenger subscribe on valid entry call topic", func() { - ok, err := suite.Authenticator.ACL(acl.Pub, token, validPassengerCallEntryTopic) - require.NoError(err) - require.True(ok) - }) - - suite.Run("testing passenger subscribe on invalid call entry topic", func() { - ok, err := suite.Authenticator.ACL(acl.Pub, token, invalidPassengerCallEntryTopic) - require.Error(err) - require.False(ok) - }) - - suite.Run("testing passenger subscribe on valid outgoing call topic", func() { - ok, err := suite.Authenticator.ACL(acl.Sub, token, validPassengerCallOutgoingTopic) - require.NoError(err) - require.True(ok) - }) - - suite.Run("testing passenger subscribe on valid outgoing call node topic", func() { - ok, err := suite.Authenticator.ACL(acl.Pub, token, validPassengerNodeCallEntryTopic) - require.NoError(err) - require.True(ok) - }) - - suite.Run("testing passenger subscribe on invalid call outgoing topic", func() { - ok, err := suite.Authenticator.ACL(acl.Sub, token, invalidPassengerCallOutgoingTopic) - require.Error(err) - require.False(ok) - }) -} - -// nolint: funlen -func (suite *ManualAuthenticatorTestSuite) TestACL_Driver() { - require := suite.Require() - token := suite.Tokens.Driver - - suite.Run("testing driver publish on its location topic", func() { - ok, err := suite.Authenticator.ACL(acl.Pub, token, validDriverLocationTopic) - require.NoError(err) - require.True(ok) - }) - - suite.Run("testing driver publish on invalid location topic", func() { - ok, err := suite.Authenticator.ACL(acl.Pub, token, invalidDriverLocationTopic) - require.Error(err) - require.False(ok) - }) - - suite.Run("testing driver subscribe on invalid cab event topic", func() { - ok, err := suite.Authenticator.ACL(acl.Sub, token, invalidDriverCabEventTopic) - require.Error(err) - require.False(ok) - }) - - suite.Run("testing driver subscribe on valid superapp event topic", func() { - ok, err := suite.Authenticator.ACL(acl.Sub, token, validDriverSuperappEventTopic) - require.NoError(err) - require.True(ok) - }) - - suite.Run("testing driver subscribe on invalid superapp event topic", func() { - ok, err := suite.Authenticator.ACL(acl.Sub, token, invalidDriverSuperappEventTopic) - require.Error(err) - require.False(ok) - }) - - suite.Run("testing driver subscribe on valid shared location topic", func() { - ok, err := suite.Authenticator.ACL(acl.Sub, token, validDriverSharedTopic) - require.NoError(err) - require.True(ok) - }) - - suite.Run("testing driver subscribe on invalid shared location topic", func() { - ok, err := suite.Authenticator.ACL(acl.Sub, token, invalidDriverSharedTopic) - require.Error(err) - require.False(ok) - }) - - suite.Run("testing driver subscribe on valid chat topic", func() { - ok, err := suite.Authenticator.ACL(acl.Sub, token, validDriverChatTopic) - require.NoError(err) - require.True(ok) - }) - - suite.Run("testing driver subscribe on invalid chat topic", func() { - ok, err := suite.Authenticator.ACL(acl.Sub, token, invalidDriverChatTopic) - require.Error(err) - require.False(ok) - }) - - suite.Run("testing driver subscribe on valid call entry topic", func() { - ok, err := suite.Authenticator.ACL(acl.Pub, token, validDriverCallEntryTopic) - require.NoError(err) - require.True(ok) - }) - - suite.Run("testing driver subscribe on invalid call entry topic", func() { - ok, err := suite.Authenticator.ACL(acl.Pub, token, invalidDriverCallEntryTopic) - require.Error(err) - require.False(ok) - }) - - suite.Run("testing driver subscribe on valid call outgoing topic", func() { - ok, err := suite.Authenticator.ACL(acl.Sub, token, validDriverCallOutgoingTopic) - require.NoError(err) - require.True(ok) - }) - - suite.Run("testing driver subscribe on valid call outgoing node topic", func() { - ok, err := suite.Authenticator.ACL(acl.Pub, token, validDriverNodeCallEntryTopic) - require.NoError(err) - require.True(ok) - }) - - suite.Run("testing driver subscribe on invalid call outgoing topic", func() { - ok, err := suite.Authenticator.ACL(acl.Sub, token, invalidDriverCallOutgoingTopic) - require.Error(err) - require.False(ok) - }) -} - -func TestManualAuthenticator_ValidateTopicBySender(t *testing.T) { - t.Parallel() - - cfg := config.SnappVendor() - - hid, err := topics.NewHashIDManager(cfg.HashIDMap) - require.NoError(t, err) - - // nolint: exhaustruct - authenticator := authenticator.ManualAuthenticator{ - AllowedAccessTypes: []acl.AccessType{acl.Pub, acl.Sub}, - Company: "snapp", - TopicManager: topics.NewTopicManager(cfg.Topics, hid, "snapp", cfg.IssEntityMap, cfg.IssPeerMap, zap.NewNop()), - } - - t.Run("testing valid driver cab event", func(t *testing.T) { - t.Parallel() - topicTemplate := authenticator.TopicManager.ParseTopic(validDriverCabEventTopic, topics.DriverIss, "DXKgaNQa7N5Y7bo") - require.NotNil(t, topicTemplate) - }) -} - -// nolint: funlen, dupl -func TestManualAuthenticator_validateAccessType(t *testing.T) { - t.Parallel() - - type fields struct { - AllowedAccessTypes []acl.AccessType - } - - type args struct { - accessType acl.AccessType - } - - tests := []struct { - name string - fields fields - args args - want bool - }{ - { - name: "#1 testing with no allowed access type", - fields: fields{AllowedAccessTypes: []acl.AccessType{}}, - args: args{accessType: acl.Sub}, - want: false, - }, - { - name: "#2 testing with no allowed access type", - fields: fields{AllowedAccessTypes: []acl.AccessType{}}, - args: args{accessType: acl.Pub}, - want: false, - }, - { - name: "#3 testing with no allowed access type", - fields: fields{AllowedAccessTypes: []acl.AccessType{}}, - args: args{accessType: acl.PubSub}, - want: false, - }, - { - name: "#4 testing with one allowed access type", - fields: fields{AllowedAccessTypes: []acl.AccessType{acl.Pub}}, - args: args{accessType: acl.Pub}, - want: true, - }, - { - name: "#5 testing with one allowed access type", - fields: fields{AllowedAccessTypes: []acl.AccessType{acl.Pub}}, - args: args{accessType: acl.Sub}, - want: false, - }, - { - name: "#6 testing with two allowed access type", - fields: fields{AllowedAccessTypes: []acl.AccessType{acl.Pub, acl.Sub}}, - args: args{accessType: acl.Sub}, - want: true, - }, - { - name: "#7 testing with two allowed access type", - fields: fields{AllowedAccessTypes: []acl.AccessType{acl.Pub, acl.Sub}}, - args: args{accessType: acl.Pub}, - want: true, - }, - { - name: "#8 testing with two allowed access type", - fields: fields{AllowedAccessTypes: []acl.AccessType{acl.Pub, acl.Sub}}, - args: args{accessType: acl.PubSub}, - want: false, - }, - { - name: "#9 testing with three allowed access type", - fields: fields{AllowedAccessTypes: []acl.AccessType{acl.Pub, acl.Sub, acl.PubSub}}, - args: args{accessType: acl.PubSub}, - want: true, - }, - } - - for _, tt := range tests { - tt := tt - t.Run(tt.name, func(t *testing.T) { - t.Parallel() - - // nolint: exhaustruct - a := authenticator.ManualAuthenticator{ - AllowedAccessTypes: tt.fields.AllowedAccessTypes, - } - if got := a.ValidateAccessType(tt.args.accessType); got != tt.want { - t.Errorf("validateAccessType() = %v, want %v", got, tt.want) - } - }) - } -} - -// nolint: goerr113, wrapcheck -func (suite *ManualAuthenticatorTestSuite) getPublicKey(u string) (*rsa.PublicKey, error) { - var fileName string - - switch u { - case topics.PassengerIss: - fileName = "../../test/1.pem" - case topics.DriverIss: - fileName = "../../test/0.pem" - default: - return nil, errors.New("invalid user, public key not found") - } - - pem, err := os.ReadFile(fileName) - if err != nil { - return nil, err - } - - publicKey, err := jwt.ParseRSAPublicKeyFromPEM(pem) - if err != nil { - return nil, err - } - - return publicKey, nil -} - -// nolint: goerr113, wrapcheck -func (suite *ManualAuthenticatorTestSuite) getPrivateKey(u string) (*rsa.PrivateKey, error) { - var fileName string - - switch u { - case topics.DriverIss: - fileName = "../../test/0.private.pem" - case topics.PassengerIss: - fileName = "../../test/1.private.pem" - default: - return nil, errors.New("invalid user, private key not found") - } - - pem, err := os.ReadFile(fileName) - if err != nil { - return nil, err - } - - privateKey, err := jwt.ParseRSAPrivateKeyFromPEM(pem) - if err != nil { - return nil, err - } - - return privateKey, nil -} - -func (suite *ManualAuthenticatorTestSuite) getSampleToken(issuer string) string { - key, err := suite.getPrivateKey(issuer) - suite.Require().NoError(err) - - exp := time.Now().Add(time.Hour * 24 * 365 * 10) - sub := "DXKgaNQa7N5Y7bo" - - // nolint: exhaustruct - claims := jwt.RegisteredClaims{ - ExpiresAt: jwt.NewNumericDate(exp), - Issuer: issuer, - Subject: sub, - } - token := jwt.NewWithClaims(jwt.SigningMethodRS256, claims) - - tokenString, err := token.SignedString(key) - suite.Require().NoError(err) - return tokenString + suite.Run(t, st) } From f9aa5112fa5d1a8fde4d51726cd12f5aeba2d2a8 Mon Sep 17 00:00:00 2001 From: Parham Alvani Date: Sat, 11 Nov 2023 23:06:36 +0000 Subject: [PATCH 500/660] fix: correct tests and their usage --- internal/authenticator/authenticator_test.go | 459 +++++++++++++++++++ 1 file changed, 459 insertions(+) diff --git a/internal/authenticator/authenticator_test.go b/internal/authenticator/authenticator_test.go index 7d777c73..6dd83454 100644 --- a/internal/authenticator/authenticator_test.go +++ b/internal/authenticator/authenticator_test.go @@ -1,5 +1,23 @@ package authenticator_test +import ( + "crypto/rsa" + "errors" + "fmt" + "os" + "testing" + "time" + + "github.com/golang-jwt/jwt/v5" + "github.com/snapp-incubator/soteria/internal/authenticator" + "github.com/snapp-incubator/soteria/internal/config" + "github.com/snapp-incubator/soteria/internal/topics" + "github.com/snapp-incubator/soteria/pkg/acl" + "github.com/stretchr/testify/require" + "github.com/stretchr/testify/suite" + "go.uber.org/zap" +) + const ( // nolint: gosec, lll invalidToken = "ey1JhbGciOiJSUzI1NiIsInR5cCI56kpXVCJ9.eyJzdWIiOiJCRzdScDFkcnpWRE5RcjYiLCJuYW1lIjoiSm9obiBEb2UiLCJhZG1pbiI6dHJ1ZSwiaXNzIjowLCJpYXQiOjE1MTYyMzkwMjJ9.1cYXFEhcewOYFjGJYhB8dsaFO9uKEXwlM8954rkt4Tsu0lWMITbRf_hHh1l9QD4MFqD-0LwRPUYaiaemy0OClMu00G2sujLCWaquYDEP37iIt8RoOQAh8Jb5vT8LX5C3PEKvbW_i98u8HHJoFUR9CXJmzrKi48sAcOYvXVYamN0S9KoY38H-Ze37Mdu3o6B58i73krk7QHecsc2_PkCJisvUVAzb0tiInIalBc8-zI3QZSxwNLr_hjlBg1sUxTUvH5SCcRR7hxI8TxJzkOHqAHWDRO84NC_DSAoO2p04vrHpqglN9XPJ8RC2YWpfefvD2ttH554RJWu_0RlR2kAYvQ" @@ -40,3 +58,444 @@ const ( invalidDriverCallOutgoingTopic = "snapp/driver/0596923be632d673560af9adadd2f78a/call/receive" invalidPassengerCallOutgoingTopic = "snapp/passenger/0596923be632d673560af9adadd2f78a/call/receive" ) + +var ( + ErrPrivateKeyNotFound = errors.New("invalid user, private key not found") + ErrPublicKeyNotFound = errors.New("invalid user, public key not found") +) + +type AuthenticatorTestSuite struct { + suite.Suite + + Tokens struct { + Passenger string + Driver string + } + + PublicKeys struct { + Passenger *rsa.PublicKey + Driver *rsa.PublicKey + } + + Authenticator authenticator.Authenticator +} + +func (suite *AuthenticatorTestSuite) SetupSuite() { + require := suite.Require() + + driverToken := suite.getSampleToken(topics.DriverIss) + + suite.Tokens.Driver = driverToken + + passengerToken := suite.getSampleToken(topics.PassengerIss) + + suite.Tokens.Passenger = passengerToken + + pkey0, err := suite.getPublicKey(topics.DriverIss) + require.NoError(err) + + suite.PublicKeys.Driver = pkey0 + + pkey1, err := suite.getPublicKey(topics.PassengerIss) + require.NoError(err) + + suite.PublicKeys.Passenger = pkey1 +} + +func (suite *AuthenticatorTestSuite) TestAuth() { + require := suite.Require() + + suite.Run("testing driver token auth", func() { + require.NoError(suite.Authenticator.Auth(suite.Tokens.Driver)) + }) + + suite.Run("testing passenger token auth", func() { + require.NoError(suite.Authenticator.Auth(suite.Tokens.Passenger)) + }) + + suite.Run("testing invalid token auth", func() { + require.Error(suite.Authenticator.Auth(invalidToken)) + }) +} + +// nolint: dupl +func (suite *AuthenticatorTestSuite) TestACL_Basics() { + require := suite.Require() + + suite.Run("testing acl with invalid access type", func() { + ok, err := suite.Authenticator.ACL("invalid-access", suite.Tokens.Passenger, "test") + require.Error(err) + require.False(ok) + require.ErrorIs(err, authenticator.ErrInvalidAccessType) + }) + + suite.Run("testing acl with invalid token", func() { + ok, err := suite.Authenticator.ACL(acl.Pub, invalidToken, validDriverCabEventTopic) + require.False(ok) + require.Error(err) + require.ErrorIs(err, jwt.ErrTokenMalformed) + }) + + suite.Run("testing acl with valid inputs", func() { + ok, err := suite.Authenticator.ACL(acl.Sub, suite.Tokens.Passenger, validPassengerCabEventTopic) + require.NoError(err) + require.True(ok) + }) + + suite.Run("testing acl with invalid topic", func() { + ok, err := suite.Authenticator.ACL(acl.Sub, suite.Tokens.Passenger, invalidPassengerCabEventTopic) + require.Error(err) + require.False(ok) + }) + + suite.Run("testing acl with invalid access type", func() { + ok, err := suite.Authenticator.ACL(acl.Pub, suite.Tokens.Passenger, validPassengerCabEventTopic) + require.Error(err) + require.False(ok) + }) +} + +// nolint: funlen +func (suite *AuthenticatorTestSuite) TestACL_Passenger() { + require := suite.Require() + token := suite.Tokens.Passenger + + suite.Run("testing passenger subscribe on valid superapp event topic", func() { + ok, err := suite.Authenticator.ACL(acl.Sub, token, validPassengerSuperappEventTopic) + require.NoError(err) + require.True(ok) + }) + + suite.Run("testing passenger subscribe on invalid superapp event topic", func() { + ok, err := suite.Authenticator.ACL(acl.Sub, token, invalidPassengerSuperappEventTopic) + require.Error(err) + require.False(ok) + }) + + suite.Run("testing passenger subscribe on valid shared location topic", func() { + ok, err := suite.Authenticator.ACL(acl.Sub, token, validPassengerSharedTopic) + require.NoError(err) + require.True(ok) + }) + + suite.Run("testing passenger subscribe on invalid shared location topic", func() { + ok, err := suite.Authenticator.ACL(acl.Sub, token, invalidPassengerSharedTopic) + require.Error(err) + require.False(ok) + }) + + suite.Run("testing passenger subscribe on valid chat topic", func() { + ok, err := suite.Authenticator.ACL(acl.Sub, token, validPassengerChatTopic) + require.NoError(err) + require.True(ok) + }) + + suite.Run("testing passenger subscribe on invalid chat topic", func() { + ok, err := suite.Authenticator.ACL(acl.Sub, token, invalidPassengerChatTopic) + require.Error(err) + require.False(ok) + }) + + suite.Run("testing passenger subscribe on valid entry call topic", func() { + ok, err := suite.Authenticator.ACL(acl.Pub, token, validPassengerCallEntryTopic) + require.NoError(err) + require.True(ok) + }) + + suite.Run("testing passenger subscribe on invalid call entry topic", func() { + ok, err := suite.Authenticator.ACL(acl.Pub, token, invalidPassengerCallEntryTopic) + require.Error(err) + require.False(ok) + }) + + suite.Run("testing passenger subscribe on valid outgoing call topic", func() { + ok, err := suite.Authenticator.ACL(acl.Sub, token, validPassengerCallOutgoingTopic) + require.NoError(err) + require.True(ok) + }) + + suite.Run("testing passenger subscribe on valid outgoing call node topic", func() { + ok, err := suite.Authenticator.ACL(acl.Pub, token, validPassengerNodeCallEntryTopic) + require.NoError(err) + require.True(ok) + }) + + suite.Run("testing passenger subscribe on invalid call outgoing topic", func() { + ok, err := suite.Authenticator.ACL(acl.Sub, token, invalidPassengerCallOutgoingTopic) + require.Error(err) + require.False(ok) + }) +} + +// nolint: funlen +func (suite *AuthenticatorTestSuite) TestACL_Driver() { + require := suite.Require() + token := suite.Tokens.Driver + + suite.Run("testing driver publish on its location topic", func() { + ok, err := suite.Authenticator.ACL(acl.Pub, token, validDriverLocationTopic) + require.NoError(err) + require.True(ok) + }) + + suite.Run("testing driver publish on invalid location topic", func() { + ok, err := suite.Authenticator.ACL(acl.Pub, token, invalidDriverLocationTopic) + require.Error(err) + require.False(ok) + }) + + suite.Run("testing driver subscribe on invalid cab event topic", func() { + ok, err := suite.Authenticator.ACL(acl.Sub, token, invalidDriverCabEventTopic) + require.Error(err) + require.False(ok) + }) + + suite.Run("testing driver subscribe on valid superapp event topic", func() { + ok, err := suite.Authenticator.ACL(acl.Sub, token, validDriverSuperappEventTopic) + require.NoError(err) + require.True(ok) + }) + + suite.Run("testing driver subscribe on invalid superapp event topic", func() { + ok, err := suite.Authenticator.ACL(acl.Sub, token, invalidDriverSuperappEventTopic) + require.Error(err) + require.False(ok) + }) + + suite.Run("testing driver subscribe on valid shared location topic", func() { + ok, err := suite.Authenticator.ACL(acl.Sub, token, validDriverSharedTopic) + require.NoError(err) + require.True(ok) + }) + + suite.Run("testing driver subscribe on invalid shared location topic", func() { + ok, err := suite.Authenticator.ACL(acl.Sub, token, invalidDriverSharedTopic) + require.Error(err) + require.False(ok) + }) + + suite.Run("testing driver subscribe on valid chat topic", func() { + ok, err := suite.Authenticator.ACL(acl.Sub, token, validDriverChatTopic) + require.NoError(err) + require.True(ok) + }) + + suite.Run("testing driver subscribe on invalid chat topic", func() { + ok, err := suite.Authenticator.ACL(acl.Sub, token, invalidDriverChatTopic) + require.Error(err) + require.False(ok) + }) + + suite.Run("testing driver subscribe on valid call entry topic", func() { + ok, err := suite.Authenticator.ACL(acl.Pub, token, validDriverCallEntryTopic) + require.NoError(err) + require.True(ok) + }) + + suite.Run("testing driver subscribe on invalid call entry topic", func() { + ok, err := suite.Authenticator.ACL(acl.Pub, token, invalidDriverCallEntryTopic) + require.Error(err) + require.False(ok) + }) + + suite.Run("testing driver subscribe on valid call outgoing topic", func() { + ok, err := suite.Authenticator.ACL(acl.Sub, token, validDriverCallOutgoingTopic) + require.NoError(err) + require.True(ok) + }) + + suite.Run("testing driver subscribe on valid call outgoing node topic", func() { + ok, err := suite.Authenticator.ACL(acl.Pub, token, validDriverNodeCallEntryTopic) + require.NoError(err) + require.True(ok) + }) + + suite.Run("testing driver subscribe on invalid call outgoing topic", func() { + ok, err := suite.Authenticator.ACL(acl.Sub, token, invalidDriverCallOutgoingTopic) + require.Error(err) + require.False(ok) + }) +} + +func TestManualAuthenticator_ValidateTopicBySender(t *testing.T) { + t.Parallel() + + cfg := config.SnappVendor() + + hid, err := topics.NewHashIDManager(cfg.HashIDMap) + require.NoError(t, err) + + // nolint: exhaustruct + authenticator := authenticator.ManualAuthenticator{ + AllowedAccessTypes: []acl.AccessType{acl.Pub, acl.Sub}, + Company: "snapp", + TopicManager: topics.NewTopicManager(cfg.Topics, hid, "snapp", cfg.IssEntityMap, cfg.IssPeerMap, zap.NewNop()), + } + + t.Run("testing valid driver cab event", func(t *testing.T) { + t.Parallel() + topicTemplate := authenticator.TopicManager.ParseTopic(validDriverCabEventTopic, topics.DriverIss, "DXKgaNQa7N5Y7bo") + require.NotNil(t, topicTemplate) + }) +} + +// nolint: funlen +func TestManualAuthenticator_validateAccessType(t *testing.T) { + t.Parallel() + + type fields struct { + AllowedAccessTypes []acl.AccessType + } + + type args struct { + accessType acl.AccessType + } + + tests := []struct { + name string + fields fields + args args + want bool + }{ + { + name: "#1 testing with no allowed access type", + fields: fields{AllowedAccessTypes: []acl.AccessType{}}, + args: args{accessType: acl.Sub}, + want: false, + }, + { + name: "#2 testing with no allowed access type", + fields: fields{AllowedAccessTypes: []acl.AccessType{}}, + args: args{accessType: acl.Pub}, + want: false, + }, + { + name: "#3 testing with no allowed access type", + fields: fields{AllowedAccessTypes: []acl.AccessType{}}, + args: args{accessType: acl.PubSub}, + want: false, + }, + { + name: "#4 testing with one allowed access type", + fields: fields{AllowedAccessTypes: []acl.AccessType{acl.Pub}}, + args: args{accessType: acl.Pub}, + want: true, + }, + { + name: "#5 testing with one allowed access type", + fields: fields{AllowedAccessTypes: []acl.AccessType{acl.Pub}}, + args: args{accessType: acl.Sub}, + want: false, + }, + { + name: "#6 testing with two allowed access type", + fields: fields{AllowedAccessTypes: []acl.AccessType{acl.Pub, acl.Sub}}, + args: args{accessType: acl.Sub}, + want: true, + }, + { + name: "#7 testing with two allowed access type", + fields: fields{AllowedAccessTypes: []acl.AccessType{acl.Pub, acl.Sub}}, + args: args{accessType: acl.Pub}, + want: true, + }, + { + name: "#8 testing with two allowed access type", + fields: fields{AllowedAccessTypes: []acl.AccessType{acl.Pub, acl.Sub}}, + args: args{accessType: acl.PubSub}, + want: false, + }, + { + name: "#9 testing with three allowed access type", + fields: fields{AllowedAccessTypes: []acl.AccessType{acl.Pub, acl.Sub, acl.PubSub}}, + args: args{accessType: acl.PubSub}, + want: true, + }, + } + + for _, tt := range tests { + tt := tt + t.Run(tt.name, func(t *testing.T) { + t.Parallel() + + // nolint: exhaustruct + a := authenticator.ManualAuthenticator{ + AllowedAccessTypes: tt.fields.AllowedAccessTypes, + } + if got := a.ValidateAccessType(tt.args.accessType); got != tt.want { + t.Errorf("validateAccessType() = %v, want %v", got, tt.want) + } + }) + } +} + +func (suite *AuthenticatorTestSuite) getPublicKey(u string) (*rsa.PublicKey, error) { + var fileName string + + switch u { + case topics.PassengerIss: + fileName = "../../test/snapp-1.pem" + case topics.DriverIss: + fileName = "../../test/snapp-0.pem" + default: + return nil, ErrPublicKeyNotFound + } + + pem, err := os.ReadFile(fileName) + if err != nil { + return nil, fmt.Errorf("reading public key failed %w", err) + } + + publicKey, err := jwt.ParseRSAPublicKeyFromPEM(pem) + if err != nil { + return nil, fmt.Errorf("paring public key failed %w", err) + } + + return publicKey, nil +} + +func (suite *AuthenticatorTestSuite) getPrivateKey(u string) (*rsa.PrivateKey, error) { + var fileName string + + switch u { + case topics.DriverIss: + fileName = "../../test/snapp-0.private.pem" + case topics.PassengerIss: + fileName = "../../test/snapp-1.private.pem" + default: + return nil, ErrPrivateKeyNotFound + } + + pem, err := os.ReadFile(fileName) + if err != nil { + return nil, fmt.Errorf("reading private key failed %w", err) + } + + privateKey, err := jwt.ParseRSAPrivateKeyFromPEM(pem) + if err != nil { + return nil, fmt.Errorf("paring private key failed %w", err) + } + + return privateKey, nil +} + +func (suite *AuthenticatorTestSuite) getSampleToken(issuer string) string { + key, err := suite.getPrivateKey(issuer) + suite.Require().NoError(err) + + exp := time.Now().Add(time.Hour * 24 * 365 * 10) + sub := "DXKgaNQa7N5Y7bo" + + // nolint: exhaustruct + claims := jwt.RegisteredClaims{ + ExpiresAt: jwt.NewNumericDate(exp), + Issuer: issuer, + Subject: sub, + } + token := jwt.NewWithClaims(jwt.SigningMethodRS256, claims) + + tokenString, err := token.SignedString(key) + suite.Require().NoError(err) + + return tokenString +} From b4abe4f8d4d7c0653f476d493628e47dbdbb2e71 Mon Sep 17 00:00:00 2001 From: Parham Alvani Date: Sat, 11 Nov 2023 23:11:03 +0000 Subject: [PATCH 501/660] fix: we have working tests :dancer: --- internal/authenticator/manual_authenticator_test.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/internal/authenticator/manual_authenticator_test.go b/internal/authenticator/manual_authenticator_test.go index ee9931c3..7dbd5518 100644 --- a/internal/authenticator/manual_authenticator_test.go +++ b/internal/authenticator/manual_authenticator_test.go @@ -39,6 +39,11 @@ func TestManualAuthenticator_suite(t *testing.T) { Company: "snapp", Parser: jwt.NewParser(), TopicManager: topics.NewTopicManager(cfg.Topics, hid, "snapp", cfg.IssEntityMap, cfg.IssPeerMap, zap.NewNop()), + JwtConfig: config.Jwt{ + IssName: "iss", + SubName: "sub", + SigningMethod: "rsa256", + }, } suite.Run(t, st) From f480c08bb12030ae80456bdfa5a2a9d45a663ec4 Mon Sep 17 00:00:00 2001 From: Parham Alvani Date: Sat, 11 Nov 2023 23:12:47 +0000 Subject: [PATCH 502/660] chore: remove debug statement --- internal/authenticator/auto_authenticator.go | 2 -- 1 file changed, 2 deletions(-) diff --git a/internal/authenticator/auto_authenticator.go b/internal/authenticator/auto_authenticator.go index 7d0d25bb..64febb41 100644 --- a/internal/authenticator/auto_authenticator.go +++ b/internal/authenticator/auto_authenticator.go @@ -25,8 +25,6 @@ type AutoAuthenticator struct { // Auth check user authentication by checking the user's token // isSuperuser is a flag that authenticator set it true when credentials is related to a superuser. func (a AutoAuthenticator) Auth(tokenString string) error { - fmt.Println("I am here") - if _, err := a.Validator.Validate(context.Background(), http.Header{ validator.ServiceNameHeader: []string{"soteria"}, "user-agent": []string{}, From 01abd9c969949ecc897063773fab7518be861839 Mon Sep 17 00:00:00 2001 From: Parham Alvani Date: Sat, 11 Nov 2023 23:33:26 +0000 Subject: [PATCH 503/660] feat: improve test coverage --- .../authenticator/admin_authenticator_test.go | 65 ++++++++++++++++ internal/authenticator/authenticator_test.go | 77 ++++++++----------- .../manual_authenticator_test.go | 31 ++++++-- test/snapp-admin.pem | 9 +++ test/snapp-admin.private.pem | 28 +++++++ 5 files changed, 160 insertions(+), 50 deletions(-) create mode 100644 internal/authenticator/admin_authenticator_test.go create mode 100644 test/snapp-admin.pem create mode 100644 test/snapp-admin.private.pem diff --git a/internal/authenticator/admin_authenticator_test.go b/internal/authenticator/admin_authenticator_test.go new file mode 100644 index 00000000..63863386 --- /dev/null +++ b/internal/authenticator/admin_authenticator_test.go @@ -0,0 +1,65 @@ +package authenticator_test + +import ( + "testing" + + "github.com/golang-jwt/jwt/v5" + "github.com/snapp-incubator/soteria/internal/authenticator" + "github.com/snapp-incubator/soteria/internal/config" + "github.com/stretchr/testify/require" + "github.com/stretchr/testify/suite" +) + +type AdminAuthenticatorTestSuite struct { + suite.Suite + + AdminToken string + + Authenticator authenticator.Authenticator +} + +func TestAdminAuthenticator_suite(t *testing.T) { + t.Parallel() + + st := new(AdminAuthenticatorTestSuite) + + pkey0, err := getPublicKey("admin") + require.NoError(t, err) + + st.Authenticator = authenticator.AdminAuthenticator{ + Key: pkey0, + Company: "snapp-admin", + Parser: jwt.NewParser(), + JwtConfig: config.Jwt{ + IssName: "iss", + SubName: "sub", + SigningMethod: "rsa256", + }, + } + + suite.Run(t, st) +} + +func (suite *AdminAuthenticatorTestSuite) SetupSuite() { + require := suite.Require() + + key, err := getPrivateKey("admin") + require.NoError(err) + + adminToken, err := getSampleToken("admin", key) + require.NoError(err) + + suite.AdminToken = adminToken +} + +func (suite *AdminAuthenticatorTestSuite) TestAuth() { + require := suite.Require() + + suite.Run("testing admin token auth", func() { + require.NoError(suite.Authenticator.Auth(suite.AdminToken)) + }) + + suite.Run("testing invalid token auth", func() { + require.Error(suite.Authenticator.Auth(invalidToken)) + }) +} diff --git a/internal/authenticator/authenticator_test.go b/internal/authenticator/authenticator_test.go index 6dd83454..ba4bd272 100644 --- a/internal/authenticator/authenticator_test.go +++ b/internal/authenticator/authenticator_test.go @@ -10,12 +10,8 @@ import ( "github.com/golang-jwt/jwt/v5" "github.com/snapp-incubator/soteria/internal/authenticator" - "github.com/snapp-incubator/soteria/internal/config" - "github.com/snapp-incubator/soteria/internal/topics" "github.com/snapp-incubator/soteria/pkg/acl" - "github.com/stretchr/testify/require" "github.com/stretchr/testify/suite" - "go.uber.org/zap" ) const ( @@ -83,23 +79,33 @@ type AuthenticatorTestSuite struct { func (suite *AuthenticatorTestSuite) SetupSuite() { require := suite.Require() - driverToken := suite.getSampleToken(topics.DriverIss) + pkey0, err := getPublicKey("0") + require.NoError(err) - suite.Tokens.Driver = driverToken + suite.PublicKeys.Driver = pkey0 - passengerToken := suite.getSampleToken(topics.PassengerIss) + pkey1, err := getPublicKey("1") + require.NoError(err) - suite.Tokens.Passenger = passengerToken + suite.PublicKeys.Passenger = pkey1 - pkey0, err := suite.getPublicKey(topics.DriverIss) + key0, err := getPrivateKey("0") require.NoError(err) suite.PublicKeys.Driver = pkey0 - pkey1, err := suite.getPublicKey(topics.PassengerIss) + key1, err := getPrivateKey("1") require.NoError(err) - suite.PublicKeys.Passenger = pkey1 + driverToken, err := getSampleToken("0", key0) + require.NoError(err) + + suite.Tokens.Driver = driverToken + + passengerToken, err := getSampleToken("1", key1) + require.NoError(err) + + suite.Tokens.Passenger = passengerToken } func (suite *AuthenticatorTestSuite) TestAuth() { @@ -317,28 +323,6 @@ func (suite *AuthenticatorTestSuite) TestACL_Driver() { }) } -func TestManualAuthenticator_ValidateTopicBySender(t *testing.T) { - t.Parallel() - - cfg := config.SnappVendor() - - hid, err := topics.NewHashIDManager(cfg.HashIDMap) - require.NoError(t, err) - - // nolint: exhaustruct - authenticator := authenticator.ManualAuthenticator{ - AllowedAccessTypes: []acl.AccessType{acl.Pub, acl.Sub}, - Company: "snapp", - TopicManager: topics.NewTopicManager(cfg.Topics, hid, "snapp", cfg.IssEntityMap, cfg.IssPeerMap, zap.NewNop()), - } - - t.Run("testing valid driver cab event", func(t *testing.T) { - t.Parallel() - topicTemplate := authenticator.TopicManager.ParseTopic(validDriverCabEventTopic, topics.DriverIss, "DXKgaNQa7N5Y7bo") - require.NotNil(t, topicTemplate) - }) -} - // nolint: funlen func TestManualAuthenticator_validateAccessType(t *testing.T) { t.Parallel() @@ -429,14 +413,16 @@ func TestManualAuthenticator_validateAccessType(t *testing.T) { } } -func (suite *AuthenticatorTestSuite) getPublicKey(u string) (*rsa.PublicKey, error) { +func getPublicKey(u string) (*rsa.PublicKey, error) { var fileName string switch u { - case topics.PassengerIss: + case "1": fileName = "../../test/snapp-1.pem" - case topics.DriverIss: + case "0": fileName = "../../test/snapp-0.pem" + case "admin": + fileName = "../../test/snapp-admin.pem" default: return nil, ErrPublicKeyNotFound } @@ -454,14 +440,16 @@ func (suite *AuthenticatorTestSuite) getPublicKey(u string) (*rsa.PublicKey, err return publicKey, nil } -func (suite *AuthenticatorTestSuite) getPrivateKey(u string) (*rsa.PrivateKey, error) { +func getPrivateKey(u string) (*rsa.PrivateKey, error) { var fileName string switch u { - case topics.DriverIss: + case "0": fileName = "../../test/snapp-0.private.pem" - case topics.PassengerIss: + case "1": fileName = "../../test/snapp-1.private.pem" + case "admin": + fileName = "../../test/snapp-admin.private.pem" default: return nil, ErrPrivateKeyNotFound } @@ -479,10 +467,7 @@ func (suite *AuthenticatorTestSuite) getPrivateKey(u string) (*rsa.PrivateKey, e return privateKey, nil } -func (suite *AuthenticatorTestSuite) getSampleToken(issuer string) string { - key, err := suite.getPrivateKey(issuer) - suite.Require().NoError(err) - +func getSampleToken(issuer string, key *rsa.PrivateKey) (string, error) { exp := time.Now().Add(time.Hour * 24 * 365 * 10) sub := "DXKgaNQa7N5Y7bo" @@ -495,7 +480,9 @@ func (suite *AuthenticatorTestSuite) getSampleToken(issuer string) string { token := jwt.NewWithClaims(jwt.SigningMethodRS256, claims) tokenString, err := token.SignedString(key) - suite.Require().NoError(err) + if err != nil { + return "", fmt.Errorf("cannot generate a signed string %w", err) + } - return tokenString + return tokenString, nil } diff --git a/internal/authenticator/manual_authenticator_test.go b/internal/authenticator/manual_authenticator_test.go index 7dbd5518..3c0e9894 100644 --- a/internal/authenticator/manual_authenticator_test.go +++ b/internal/authenticator/manual_authenticator_test.go @@ -16,12 +16,10 @@ import ( func TestManualAuthenticator_suite(t *testing.T) { t.Parallel() - st := new(AuthenticatorTestSuite) - - pkey0, err := st.getPublicKey(topics.DriverIss) + pkey0, err := getPublicKey("0") require.NoError(t, err) - pkey1, err := st.getPublicKey(topics.PassengerIss) + pkey1, err := getPublicKey("1") require.NoError(t, err) cfg := config.SnappVendor() @@ -29,7 +27,8 @@ func TestManualAuthenticator_suite(t *testing.T) { hid, err := topics.NewHashIDManager(cfg.HashIDMap) require.NoError(t, err) - // nolint: exhaustruct + st := new(AuthenticatorTestSuite) + st.Authenticator = authenticator.ManualAuthenticator{ Keys: map[string]any{ topics.DriverIss: pkey0, @@ -48,3 +47,25 @@ func TestManualAuthenticator_suite(t *testing.T) { suite.Run(t, st) } + +func TestManualAuthenticator_ValidateTopicBySender(t *testing.T) { + t.Parallel() + + cfg := config.SnappVendor() + + hid, err := topics.NewHashIDManager(cfg.HashIDMap) + require.NoError(t, err) + + // nolint: exhaustruct + authenticator := authenticator.ManualAuthenticator{ + AllowedAccessTypes: []acl.AccessType{acl.Pub, acl.Sub}, + Company: "snapp", + TopicManager: topics.NewTopicManager(cfg.Topics, hid, "snapp", cfg.IssEntityMap, cfg.IssPeerMap, zap.NewNop()), + } + + t.Run("testing valid driver cab event", func(t *testing.T) { + t.Parallel() + topicTemplate := authenticator.TopicManager.ParseTopic(validDriverCabEventTopic, topics.DriverIss, "DXKgaNQa7N5Y7bo") + require.NotNil(t, topicTemplate) + }) +} diff --git a/test/snapp-admin.pem b/test/snapp-admin.pem new file mode 100644 index 00000000..c73d6089 --- /dev/null +++ b/test/snapp-admin.pem @@ -0,0 +1,9 @@ +-----BEGIN PUBLIC KEY----- +MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA1lNRwyNsDieWs6LvHOJ+ +GyehhRC4Pn5yL5edKP3565F3LtRDMrkzwDRsQbqnUtTea9HCdTdBv+lI8vE17qRi +RQn10IMaIH6e4Aa3OWNClFhuqNOag7VmffsjTOgxHgHpfGAKVF/4BwqOHrdHFbAD +VOiWB1hv9Uc0C5laffGAub7fj+EAI02zlrsNDxYW8vyF2H47N7VWcvgd3RhZpxlG +8bq9phl7Ja55YmQiT2Ic3/K5tsazg5z9lz6OTrx+JvWbefHFlJpjCLz5yefEaRmX +9L/zyDMi4jgFTZEWNXC2vIrxwZMFwFhBXEp0PcCbuHJgJIucbRrbwukQC16uHJwP +zQIDAQAB +-----END PUBLIC KEY----- \ No newline at end of file diff --git a/test/snapp-admin.private.pem b/test/snapp-admin.private.pem new file mode 100644 index 00000000..bffadbc9 --- /dev/null +++ b/test/snapp-admin.private.pem @@ -0,0 +1,28 @@ +-----BEGIN PRIVATE KEY----- +MIIEvwIBADANBgkqhkiG9w0BAQEFAASCBKkwggSlAgEAAoIBAQDWU1HDI2wOJ5az +ou8c4n4bJ6GFELg+fnIvl50o/fnrkXcu1EMyuTPANGxBuqdS1N5r0cJ1N0G/6Ujy +8TXupGJFCfXQgxogfp7gBrc5Y0KUWG6o05qDtWZ9+yNM6DEeAel8YApUX/gHCo4e +t0cVsANU6JYHWG/1RzQLmVp98YC5vt+P4QAjTbOWuw0PFhby/IXYfjs3tVZy+B3d +GFmnGUbxur2mGXslrnliZCJPYhzf8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djtP4ROJMT/t7di +NU8tZ9BCgbSFf/qQvyPq0wBB1bgNCm26Yz+ftUeDwduOep0HpNfYpBdXGSqi/yKq +qi4NBQS2okn5iKNu/LuwAOaJARQgKKz9ETJuAUycaYECgYA43841te0rJ81lNKE5 +wnCL/tx3OURDhSUJVf6tjwB+vo2FOIUfUJTBowzdWn5cTXCwGTp04JZBrZlY5RDH +24Tzo+/PTIbH9jiSYtKJCwJ+umPxek3OuBQo+4zAejN55jwcPOJcadp6u4hwq6yy +wpqfsglQldbuiZ0TilCRNhv00g== +-----END PRIVATE KEY----- \ No newline at end of file From da5cd3ae708aba6b3fb12581998e3b682b722cba Mon Sep 17 00:00:00 2001 From: Parham Alvani Date: Sun, 12 Nov 2023 05:21:43 +0000 Subject: [PATCH 504/660] feat: update testing structure --- internal/authenticator/authenticator_test.go | 357 ----------------- .../authenticator/auto_authenticator_test.go | 128 +++++++ .../manual_authenticator_test.go | 361 +++++++++++++++++- 3 files changed, 480 insertions(+), 366 deletions(-) create mode 100644 internal/authenticator/auto_authenticator_test.go diff --git a/internal/authenticator/authenticator_test.go b/internal/authenticator/authenticator_test.go index ba4bd272..91faa21a 100644 --- a/internal/authenticator/authenticator_test.go +++ b/internal/authenticator/authenticator_test.go @@ -5,13 +5,9 @@ import ( "errors" "fmt" "os" - "testing" "time" "github.com/golang-jwt/jwt/v5" - "github.com/snapp-incubator/soteria/internal/authenticator" - "github.com/snapp-incubator/soteria/pkg/acl" - "github.com/stretchr/testify/suite" ) const ( @@ -60,359 +56,6 @@ var ( ErrPublicKeyNotFound = errors.New("invalid user, public key not found") ) -type AuthenticatorTestSuite struct { - suite.Suite - - Tokens struct { - Passenger string - Driver string - } - - PublicKeys struct { - Passenger *rsa.PublicKey - Driver *rsa.PublicKey - } - - Authenticator authenticator.Authenticator -} - -func (suite *AuthenticatorTestSuite) SetupSuite() { - require := suite.Require() - - pkey0, err := getPublicKey("0") - require.NoError(err) - - suite.PublicKeys.Driver = pkey0 - - pkey1, err := getPublicKey("1") - require.NoError(err) - - suite.PublicKeys.Passenger = pkey1 - - key0, err := getPrivateKey("0") - require.NoError(err) - - suite.PublicKeys.Driver = pkey0 - - key1, err := getPrivateKey("1") - require.NoError(err) - - driverToken, err := getSampleToken("0", key0) - require.NoError(err) - - suite.Tokens.Driver = driverToken - - passengerToken, err := getSampleToken("1", key1) - require.NoError(err) - - suite.Tokens.Passenger = passengerToken -} - -func (suite *AuthenticatorTestSuite) TestAuth() { - require := suite.Require() - - suite.Run("testing driver token auth", func() { - require.NoError(suite.Authenticator.Auth(suite.Tokens.Driver)) - }) - - suite.Run("testing passenger token auth", func() { - require.NoError(suite.Authenticator.Auth(suite.Tokens.Passenger)) - }) - - suite.Run("testing invalid token auth", func() { - require.Error(suite.Authenticator.Auth(invalidToken)) - }) -} - -// nolint: dupl -func (suite *AuthenticatorTestSuite) TestACL_Basics() { - require := suite.Require() - - suite.Run("testing acl with invalid access type", func() { - ok, err := suite.Authenticator.ACL("invalid-access", suite.Tokens.Passenger, "test") - require.Error(err) - require.False(ok) - require.ErrorIs(err, authenticator.ErrInvalidAccessType) - }) - - suite.Run("testing acl with invalid token", func() { - ok, err := suite.Authenticator.ACL(acl.Pub, invalidToken, validDriverCabEventTopic) - require.False(ok) - require.Error(err) - require.ErrorIs(err, jwt.ErrTokenMalformed) - }) - - suite.Run("testing acl with valid inputs", func() { - ok, err := suite.Authenticator.ACL(acl.Sub, suite.Tokens.Passenger, validPassengerCabEventTopic) - require.NoError(err) - require.True(ok) - }) - - suite.Run("testing acl with invalid topic", func() { - ok, err := suite.Authenticator.ACL(acl.Sub, suite.Tokens.Passenger, invalidPassengerCabEventTopic) - require.Error(err) - require.False(ok) - }) - - suite.Run("testing acl with invalid access type", func() { - ok, err := suite.Authenticator.ACL(acl.Pub, suite.Tokens.Passenger, validPassengerCabEventTopic) - require.Error(err) - require.False(ok) - }) -} - -// nolint: funlen -func (suite *AuthenticatorTestSuite) TestACL_Passenger() { - require := suite.Require() - token := suite.Tokens.Passenger - - suite.Run("testing passenger subscribe on valid superapp event topic", func() { - ok, err := suite.Authenticator.ACL(acl.Sub, token, validPassengerSuperappEventTopic) - require.NoError(err) - require.True(ok) - }) - - suite.Run("testing passenger subscribe on invalid superapp event topic", func() { - ok, err := suite.Authenticator.ACL(acl.Sub, token, invalidPassengerSuperappEventTopic) - require.Error(err) - require.False(ok) - }) - - suite.Run("testing passenger subscribe on valid shared location topic", func() { - ok, err := suite.Authenticator.ACL(acl.Sub, token, validPassengerSharedTopic) - require.NoError(err) - require.True(ok) - }) - - suite.Run("testing passenger subscribe on invalid shared location topic", func() { - ok, err := suite.Authenticator.ACL(acl.Sub, token, invalidPassengerSharedTopic) - require.Error(err) - require.False(ok) - }) - - suite.Run("testing passenger subscribe on valid chat topic", func() { - ok, err := suite.Authenticator.ACL(acl.Sub, token, validPassengerChatTopic) - require.NoError(err) - require.True(ok) - }) - - suite.Run("testing passenger subscribe on invalid chat topic", func() { - ok, err := suite.Authenticator.ACL(acl.Sub, token, invalidPassengerChatTopic) - require.Error(err) - require.False(ok) - }) - - suite.Run("testing passenger subscribe on valid entry call topic", func() { - ok, err := suite.Authenticator.ACL(acl.Pub, token, validPassengerCallEntryTopic) - require.NoError(err) - require.True(ok) - }) - - suite.Run("testing passenger subscribe on invalid call entry topic", func() { - ok, err := suite.Authenticator.ACL(acl.Pub, token, invalidPassengerCallEntryTopic) - require.Error(err) - require.False(ok) - }) - - suite.Run("testing passenger subscribe on valid outgoing call topic", func() { - ok, err := suite.Authenticator.ACL(acl.Sub, token, validPassengerCallOutgoingTopic) - require.NoError(err) - require.True(ok) - }) - - suite.Run("testing passenger subscribe on valid outgoing call node topic", func() { - ok, err := suite.Authenticator.ACL(acl.Pub, token, validPassengerNodeCallEntryTopic) - require.NoError(err) - require.True(ok) - }) - - suite.Run("testing passenger subscribe on invalid call outgoing topic", func() { - ok, err := suite.Authenticator.ACL(acl.Sub, token, invalidPassengerCallOutgoingTopic) - require.Error(err) - require.False(ok) - }) -} - -// nolint: funlen -func (suite *AuthenticatorTestSuite) TestACL_Driver() { - require := suite.Require() - token := suite.Tokens.Driver - - suite.Run("testing driver publish on its location topic", func() { - ok, err := suite.Authenticator.ACL(acl.Pub, token, validDriverLocationTopic) - require.NoError(err) - require.True(ok) - }) - - suite.Run("testing driver publish on invalid location topic", func() { - ok, err := suite.Authenticator.ACL(acl.Pub, token, invalidDriverLocationTopic) - require.Error(err) - require.False(ok) - }) - - suite.Run("testing driver subscribe on invalid cab event topic", func() { - ok, err := suite.Authenticator.ACL(acl.Sub, token, invalidDriverCabEventTopic) - require.Error(err) - require.False(ok) - }) - - suite.Run("testing driver subscribe on valid superapp event topic", func() { - ok, err := suite.Authenticator.ACL(acl.Sub, token, validDriverSuperappEventTopic) - require.NoError(err) - require.True(ok) - }) - - suite.Run("testing driver subscribe on invalid superapp event topic", func() { - ok, err := suite.Authenticator.ACL(acl.Sub, token, invalidDriverSuperappEventTopic) - require.Error(err) - require.False(ok) - }) - - suite.Run("testing driver subscribe on valid shared location topic", func() { - ok, err := suite.Authenticator.ACL(acl.Sub, token, validDriverSharedTopic) - require.NoError(err) - require.True(ok) - }) - - suite.Run("testing driver subscribe on invalid shared location topic", func() { - ok, err := suite.Authenticator.ACL(acl.Sub, token, invalidDriverSharedTopic) - require.Error(err) - require.False(ok) - }) - - suite.Run("testing driver subscribe on valid chat topic", func() { - ok, err := suite.Authenticator.ACL(acl.Sub, token, validDriverChatTopic) - require.NoError(err) - require.True(ok) - }) - - suite.Run("testing driver subscribe on invalid chat topic", func() { - ok, err := suite.Authenticator.ACL(acl.Sub, token, invalidDriverChatTopic) - require.Error(err) - require.False(ok) - }) - - suite.Run("testing driver subscribe on valid call entry topic", func() { - ok, err := suite.Authenticator.ACL(acl.Pub, token, validDriverCallEntryTopic) - require.NoError(err) - require.True(ok) - }) - - suite.Run("testing driver subscribe on invalid call entry topic", func() { - ok, err := suite.Authenticator.ACL(acl.Pub, token, invalidDriverCallEntryTopic) - require.Error(err) - require.False(ok) - }) - - suite.Run("testing driver subscribe on valid call outgoing topic", func() { - ok, err := suite.Authenticator.ACL(acl.Sub, token, validDriverCallOutgoingTopic) - require.NoError(err) - require.True(ok) - }) - - suite.Run("testing driver subscribe on valid call outgoing node topic", func() { - ok, err := suite.Authenticator.ACL(acl.Pub, token, validDriverNodeCallEntryTopic) - require.NoError(err) - require.True(ok) - }) - - suite.Run("testing driver subscribe on invalid call outgoing topic", func() { - ok, err := suite.Authenticator.ACL(acl.Sub, token, invalidDriverCallOutgoingTopic) - require.Error(err) - require.False(ok) - }) -} - -// nolint: funlen -func TestManualAuthenticator_validateAccessType(t *testing.T) { - t.Parallel() - - type fields struct { - AllowedAccessTypes []acl.AccessType - } - - type args struct { - accessType acl.AccessType - } - - tests := []struct { - name string - fields fields - args args - want bool - }{ - { - name: "#1 testing with no allowed access type", - fields: fields{AllowedAccessTypes: []acl.AccessType{}}, - args: args{accessType: acl.Sub}, - want: false, - }, - { - name: "#2 testing with no allowed access type", - fields: fields{AllowedAccessTypes: []acl.AccessType{}}, - args: args{accessType: acl.Pub}, - want: false, - }, - { - name: "#3 testing with no allowed access type", - fields: fields{AllowedAccessTypes: []acl.AccessType{}}, - args: args{accessType: acl.PubSub}, - want: false, - }, - { - name: "#4 testing with one allowed access type", - fields: fields{AllowedAccessTypes: []acl.AccessType{acl.Pub}}, - args: args{accessType: acl.Pub}, - want: true, - }, - { - name: "#5 testing with one allowed access type", - fields: fields{AllowedAccessTypes: []acl.AccessType{acl.Pub}}, - args: args{accessType: acl.Sub}, - want: false, - }, - { - name: "#6 testing with two allowed access type", - fields: fields{AllowedAccessTypes: []acl.AccessType{acl.Pub, acl.Sub}}, - args: args{accessType: acl.Sub}, - want: true, - }, - { - name: "#7 testing with two allowed access type", - fields: fields{AllowedAccessTypes: []acl.AccessType{acl.Pub, acl.Sub}}, - args: args{accessType: acl.Pub}, - want: true, - }, - { - name: "#8 testing with two allowed access type", - fields: fields{AllowedAccessTypes: []acl.AccessType{acl.Pub, acl.Sub}}, - args: args{accessType: acl.PubSub}, - want: false, - }, - { - name: "#9 testing with three allowed access type", - fields: fields{AllowedAccessTypes: []acl.AccessType{acl.Pub, acl.Sub, acl.PubSub}}, - args: args{accessType: acl.PubSub}, - want: true, - }, - } - - for _, tt := range tests { - tt := tt - t.Run(tt.name, func(t *testing.T) { - t.Parallel() - - // nolint: exhaustruct - a := authenticator.ManualAuthenticator{ - AllowedAccessTypes: tt.fields.AllowedAccessTypes, - } - if got := a.ValidateAccessType(tt.args.accessType); got != tt.want { - t.Errorf("validateAccessType() = %v, want %v", got, tt.want) - } - }) - } -} - func getPublicKey(u string) (*rsa.PublicKey, error) { var fileName string diff --git a/internal/authenticator/auto_authenticator_test.go b/internal/authenticator/auto_authenticator_test.go new file mode 100644 index 00000000..d8aba5dc --- /dev/null +++ b/internal/authenticator/auto_authenticator_test.go @@ -0,0 +1,128 @@ +package authenticator_test + +import ( + "crypto/rsa" + "net/http" + "net/http/httptest" + "strings" + "testing" + "time" + + "github.com/golang-jwt/jwt/v5" + "github.com/snapp-incubator/soteria/internal/authenticator" + "github.com/snapp-incubator/soteria/internal/config" + "github.com/snapp-incubator/soteria/internal/topics" + "github.com/snapp-incubator/soteria/pkg/acl" + "github.com/snapp-incubator/soteria/pkg/validator" + "github.com/stretchr/testify/require" + "github.com/stretchr/testify/suite" + "go.uber.org/zap" +) + +type AutoAuthenticatorTestSuite struct { + suite.Suite + + Token string + PublicKey *rsa.PublicKey + + Server *httptest.Server + + Authenticator authenticator.Authenticator +} + +func TestAutoAuthenticator_suite(t *testing.T) { + t.Parallel() + + suite.Run(t, new(AutoAuthenticatorTestSuite)) +} + +func (suite *AutoAuthenticatorTestSuite) SetupSuite() { + cfg := config.SnappVendor() + + require := suite.Require() + + pkey0, err := getPublicKey("0") + require.NoError(err) + + suite.PublicKey = pkey0 + + key0, err := getPrivateKey("0") + require.NoError(err) + + token, err := getSampleToken("0", key0) + require.NoError(err) + + suite.Token = token + + hid, err := topics.NewHashIDManager(cfg.HashIDMap) + require.NoError(err) + + testServer := httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) { + authHeader := req.Header.Get("Authentication") + tokenString := strings.TrimSuffix(authHeader, "Bearer") + + _, err := jwt.Parse(tokenString, func( + token *jwt.Token, + ) (interface{}, error) { + return pkey0, nil + }) + if err != nil { + res.WriteHeader(http.StatusUnauthorized) + return + } + + res.WriteHeader(http.StatusOK) + })) + suite.Server = testServer + + suite.Authenticator = authenticator.AutoAuthenticator{ + Validator: validator.New(testServer.URL, time.Second), + AllowedAccessTypes: []acl.AccessType{acl.Pub, acl.Sub, acl.PubSub}, + Company: "snapp", + Parser: jwt.NewParser(), + TopicManager: topics.NewTopicManager(cfg.Topics, hid, "snapp", cfg.IssEntityMap, cfg.IssPeerMap, zap.NewNop()), + JwtConfig: config.Jwt{ + IssName: "iss", + SubName: "sub", + SigningMethod: "rsa256", + }, + } +} + +func (suite *AutoAuthenticatorTestSuite) TestAuth() { + require := suite.Require() + + suite.Run("testing valid token auth", func() { + require.NoError(suite.Authenticator.Auth(suite.Token)) + }) + + suite.Run("testing invalid token auth", func() { + require.Error(suite.Authenticator.Auth(invalidToken)) + }) +} + +func (suite *AutoAuthenticatorTestSuite) TearDownSuite() { + suite.Server.Close() +} + +func TestAutoAuthenticator_ValidateTopicBySender(t *testing.T) { + t.Parallel() + + cfg := config.SnappVendor() + + hid, err := topics.NewHashIDManager(cfg.HashIDMap) + require.NoError(t, err) + + // nolint: exhaustruct + authenticator := authenticator.AutoAuthenticator{ + AllowedAccessTypes: []acl.AccessType{acl.Pub, acl.Sub}, + Company: "snapp", + TopicManager: topics.NewTopicManager(cfg.Topics, hid, "snapp", cfg.IssEntityMap, cfg.IssPeerMap, zap.NewNop()), + } + + t.Run("testing valid driver cab event", func(t *testing.T) { + t.Parallel() + topicTemplate := authenticator.TopicManager.ParseTopic(validDriverCabEventTopic, topics.DriverIss, "DXKgaNQa7N5Y7bo") + require.NotNil(t, topicTemplate) + }) +} diff --git a/internal/authenticator/manual_authenticator_test.go b/internal/authenticator/manual_authenticator_test.go index 3c0e9894..151227e1 100644 --- a/internal/authenticator/manual_authenticator_test.go +++ b/internal/authenticator/manual_authenticator_test.go @@ -1,6 +1,7 @@ package authenticator_test import ( + "crypto/rsa" "testing" "github.com/golang-jwt/jwt/v5" @@ -13,23 +14,63 @@ import ( "go.uber.org/zap" ) +type ManualAuthenticatorTestSuite struct { + suite.Suite + + Tokens struct { + Passenger string + Driver string + } + + PublicKeys struct { + Passenger *rsa.PublicKey + Driver *rsa.PublicKey + } + + Authenticator authenticator.Authenticator +} + func TestManualAuthenticator_suite(t *testing.T) { - t.Parallel() + suite.Run(t, new(ManualAuthenticatorTestSuite)) +} + +func (suite *ManualAuthenticatorTestSuite) SetupSuite() { + cfg := config.SnappVendor() + + require := suite.Require() pkey0, err := getPublicKey("0") - require.NoError(t, err) + require.NoError(err) + + suite.PublicKeys.Driver = pkey0 pkey1, err := getPublicKey("1") - require.NoError(t, err) + require.NoError(err) - cfg := config.SnappVendor() + suite.PublicKeys.Passenger = pkey1 - hid, err := topics.NewHashIDManager(cfg.HashIDMap) - require.NoError(t, err) + key0, err := getPrivateKey("0") + require.NoError(err) + + suite.PublicKeys.Driver = pkey0 + + key1, err := getPrivateKey("1") + require.NoError(err) + + driverToken, err := getSampleToken("0", key0) + require.NoError(err) + + suite.Tokens.Driver = driverToken + + passengerToken, err := getSampleToken("1", key1) + require.NoError(err) - st := new(AuthenticatorTestSuite) + suite.Tokens.Passenger = passengerToken - st.Authenticator = authenticator.ManualAuthenticator{ + hid, err := topics.NewHashIDManager(cfg.HashIDMap) + require.NoError(err) + + suite.Authenticator = authenticator.ManualAuthenticator{ Keys: map[string]any{ topics.DriverIss: pkey0, topics.PassengerIss: pkey1, @@ -44,8 +85,220 @@ func TestManualAuthenticator_suite(t *testing.T) { SigningMethod: "rsa256", }, } +} + +func (suite *ManualAuthenticatorTestSuite) TestAuth() { + require := suite.Require() + + suite.Run("testing driver token auth", func() { + require.NoError(suite.Authenticator.Auth(suite.Tokens.Driver)) + }) + + suite.Run("testing passenger token auth", func() { + require.NoError(suite.Authenticator.Auth(suite.Tokens.Passenger)) + }) - suite.Run(t, st) + suite.Run("testing invalid token auth", func() { + require.Error(suite.Authenticator.Auth(invalidToken)) + }) +} + +func (suite *ManualAuthenticatorTestSuite) TestACL_Basics() { + require := suite.Require() + + suite.Run("testing acl with invalid access type", func() { + ok, err := suite.Authenticator.ACL("invalid-access", suite.Tokens.Passenger, "test") + require.Error(err) + require.False(ok) + require.ErrorIs(err, authenticator.ErrInvalidAccessType) + }) + + suite.Run("testing acl with invalid token", func() { + ok, err := suite.Authenticator.ACL(acl.Pub, invalidToken, validDriverCabEventTopic) + require.False(ok) + require.Error(err) + require.ErrorIs(err, jwt.ErrTokenMalformed) + }) + + suite.Run("testing acl with valid inputs", func() { + ok, err := suite.Authenticator.ACL(acl.Sub, suite.Tokens.Passenger, validPassengerCabEventTopic) + require.NoError(err) + require.True(ok) + }) + + suite.Run("testing acl with invalid topic", func() { + ok, err := suite.Authenticator.ACL(acl.Sub, suite.Tokens.Passenger, invalidPassengerCabEventTopic) + require.Error(err) + require.False(ok) + }) + + suite.Run("testing acl with invalid access type", func() { + ok, err := suite.Authenticator.ACL(acl.Pub, suite.Tokens.Passenger, validPassengerCabEventTopic) + require.Error(err) + require.False(ok) + }) +} + +// nolint: funlen +func (suite *ManualAuthenticatorTestSuite) TestACL_Passenger() { + require := suite.Require() + token := suite.Tokens.Passenger + + suite.Run("testing passenger subscribe on valid superapp event topic", func() { + ok, err := suite.Authenticator.ACL(acl.Sub, token, validPassengerSuperappEventTopic) + require.NoError(err) + require.True(ok) + }) + + suite.Run("testing passenger subscribe on invalid superapp event topic", func() { + ok, err := suite.Authenticator.ACL(acl.Sub, token, invalidPassengerSuperappEventTopic) + require.Error(err) + require.False(ok) + }) + + suite.Run("testing passenger subscribe on valid shared location topic", func() { + ok, err := suite.Authenticator.ACL(acl.Sub, token, validPassengerSharedTopic) + require.NoError(err) + require.True(ok) + }) + + suite.Run("testing passenger subscribe on invalid shared location topic", func() { + ok, err := suite.Authenticator.ACL(acl.Sub, token, invalidPassengerSharedTopic) + require.Error(err) + require.False(ok) + }) + + suite.Run("testing passenger subscribe on valid chat topic", func() { + ok, err := suite.Authenticator.ACL(acl.Sub, token, validPassengerChatTopic) + require.NoError(err) + require.True(ok) + }) + + suite.Run("testing passenger subscribe on invalid chat topic", func() { + ok, err := suite.Authenticator.ACL(acl.Sub, token, invalidPassengerChatTopic) + require.Error(err) + require.False(ok) + }) + + suite.Run("testing passenger subscribe on valid entry call topic", func() { + ok, err := suite.Authenticator.ACL(acl.Pub, token, validPassengerCallEntryTopic) + require.NoError(err) + require.True(ok) + }) + + suite.Run("testing passenger subscribe on invalid call entry topic", func() { + ok, err := suite.Authenticator.ACL(acl.Pub, token, invalidPassengerCallEntryTopic) + require.Error(err) + require.False(ok) + }) + + suite.Run("testing passenger subscribe on valid outgoing call topic", func() { + ok, err := suite.Authenticator.ACL(acl.Sub, token, validPassengerCallOutgoingTopic) + require.NoError(err) + require.True(ok) + }) + + suite.Run("testing passenger subscribe on valid outgoing call node topic", func() { + ok, err := suite.Authenticator.ACL(acl.Pub, token, validPassengerNodeCallEntryTopic) + require.NoError(err) + require.True(ok) + }) + + suite.Run("testing passenger subscribe on invalid call outgoing topic", func() { + ok, err := suite.Authenticator.ACL(acl.Sub, token, invalidPassengerCallOutgoingTopic) + require.Error(err) + require.False(ok) + }) +} + +// nolint: funlen +func (suite *ManualAuthenticatorTestSuite) TestACL_Driver() { + require := suite.Require() + token := suite.Tokens.Driver + + suite.Run("testing driver publish on its location topic", func() { + ok, err := suite.Authenticator.ACL(acl.Pub, token, validDriverLocationTopic) + require.NoError(err) + require.True(ok) + }) + + suite.Run("testing driver publish on invalid location topic", func() { + ok, err := suite.Authenticator.ACL(acl.Pub, token, invalidDriverLocationTopic) + require.Error(err) + require.False(ok) + }) + + suite.Run("testing driver subscribe on invalid cab event topic", func() { + ok, err := suite.Authenticator.ACL(acl.Sub, token, invalidDriverCabEventTopic) + require.Error(err) + require.False(ok) + }) + + suite.Run("testing driver subscribe on valid superapp event topic", func() { + ok, err := suite.Authenticator.ACL(acl.Sub, token, validDriverSuperappEventTopic) + require.NoError(err) + require.True(ok) + }) + + suite.Run("testing driver subscribe on invalid superapp event topic", func() { + ok, err := suite.Authenticator.ACL(acl.Sub, token, invalidDriverSuperappEventTopic) + require.Error(err) + require.False(ok) + }) + + suite.Run("testing driver subscribe on valid shared location topic", func() { + ok, err := suite.Authenticator.ACL(acl.Sub, token, validDriverSharedTopic) + require.NoError(err) + require.True(ok) + }) + + suite.Run("testing driver subscribe on invalid shared location topic", func() { + ok, err := suite.Authenticator.ACL(acl.Sub, token, invalidDriverSharedTopic) + require.Error(err) + require.False(ok) + }) + + suite.Run("testing driver subscribe on valid chat topic", func() { + ok, err := suite.Authenticator.ACL(acl.Sub, token, validDriverChatTopic) + require.NoError(err) + require.True(ok) + }) + + suite.Run("testing driver subscribe on invalid chat topic", func() { + ok, err := suite.Authenticator.ACL(acl.Sub, token, invalidDriverChatTopic) + require.Error(err) + require.False(ok) + }) + + suite.Run("testing driver subscribe on valid call entry topic", func() { + ok, err := suite.Authenticator.ACL(acl.Pub, token, validDriverCallEntryTopic) + require.NoError(err) + require.True(ok) + }) + + suite.Run("testing driver subscribe on invalid call entry topic", func() { + ok, err := suite.Authenticator.ACL(acl.Pub, token, invalidDriverCallEntryTopic) + require.Error(err) + require.False(ok) + }) + + suite.Run("testing driver subscribe on valid call outgoing topic", func() { + ok, err := suite.Authenticator.ACL(acl.Sub, token, validDriverCallOutgoingTopic) + require.NoError(err) + require.True(ok) + }) + + suite.Run("testing driver subscribe on valid call outgoing node topic", func() { + ok, err := suite.Authenticator.ACL(acl.Pub, token, validDriverNodeCallEntryTopic) + require.NoError(err) + require.True(ok) + }) + + suite.Run("testing driver subscribe on invalid call outgoing topic", func() { + ok, err := suite.Authenticator.ACL(acl.Sub, token, invalidDriverCallOutgoingTopic) + require.Error(err) + require.False(ok) + }) } func TestManualAuthenticator_ValidateTopicBySender(t *testing.T) { @@ -69,3 +322,93 @@ func TestManualAuthenticator_ValidateTopicBySender(t *testing.T) { require.NotNil(t, topicTemplate) }) } + +// nolint: funlen +func TestManualAuthenticator_validateAccessType(t *testing.T) { + t.Parallel() + + type fields struct { + AllowedAccessTypes []acl.AccessType + } + + type args struct { + accessType acl.AccessType + } + + tests := []struct { + name string + fields fields + args args + want bool + }{ + { + name: "#1 testing with no allowed access type", + fields: fields{AllowedAccessTypes: []acl.AccessType{}}, + args: args{accessType: acl.Sub}, + want: false, + }, + { + name: "#2 testing with no allowed access type", + fields: fields{AllowedAccessTypes: []acl.AccessType{}}, + args: args{accessType: acl.Pub}, + want: false, + }, + { + name: "#3 testing with no allowed access type", + fields: fields{AllowedAccessTypes: []acl.AccessType{}}, + args: args{accessType: acl.PubSub}, + want: false, + }, + { + name: "#4 testing with one allowed access type", + fields: fields{AllowedAccessTypes: []acl.AccessType{acl.Pub}}, + args: args{accessType: acl.Pub}, + want: true, + }, + { + name: "#5 testing with one allowed access type", + fields: fields{AllowedAccessTypes: []acl.AccessType{acl.Pub}}, + args: args{accessType: acl.Sub}, + want: false, + }, + { + name: "#6 testing with two allowed access type", + fields: fields{AllowedAccessTypes: []acl.AccessType{acl.Pub, acl.Sub}}, + args: args{accessType: acl.Sub}, + want: true, + }, + { + name: "#7 testing with two allowed access type", + fields: fields{AllowedAccessTypes: []acl.AccessType{acl.Pub, acl.Sub}}, + args: args{accessType: acl.Pub}, + want: true, + }, + { + name: "#8 testing with two allowed access type", + fields: fields{AllowedAccessTypes: []acl.AccessType{acl.Pub, acl.Sub}}, + args: args{accessType: acl.PubSub}, + want: false, + }, + { + name: "#9 testing with three allowed access type", + fields: fields{AllowedAccessTypes: []acl.AccessType{acl.Pub, acl.Sub, acl.PubSub}}, + args: args{accessType: acl.PubSub}, + want: true, + }, + } + + for _, tt := range tests { + tt := tt + t.Run(tt.name, func(t *testing.T) { + t.Parallel() + + // nolint: exhaustruct + a := authenticator.ManualAuthenticator{ + AllowedAccessTypes: tt.fields.AllowedAccessTypes, + } + if got := a.ValidateAccessType(tt.args.accessType); got != tt.want { + t.Errorf("validateAccessType() = %v, want %v", got, tt.want) + } + }) + } +} From 6d46f8cfd3bad052b7970105abd2232c89dd272a Mon Sep 17 00:00:00 2001 From: Parham Alvani Date: Sun, 12 Nov 2023 05:38:07 +0000 Subject: [PATCH 505/660] feat: add more tests for auto authenticator --- internal/authenticator/auto_authenticator_test.go | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/internal/authenticator/auto_authenticator_test.go b/internal/authenticator/auto_authenticator_test.go index d8aba5dc..15ff3bf0 100644 --- a/internal/authenticator/auto_authenticator_test.go +++ b/internal/authenticator/auto_authenticator_test.go @@ -2,6 +2,7 @@ package authenticator_test import ( "crypto/rsa" + "encoding/json" "net/http" "net/http/httptest" "strings" @@ -58,8 +59,8 @@ func (suite *AutoAuthenticatorTestSuite) SetupSuite() { require.NoError(err) testServer := httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) { - authHeader := req.Header.Get("Authentication") - tokenString := strings.TrimSuffix(authHeader, "Bearer") + authHeader := req.Header.Get("Authorization") + tokenString := strings.TrimPrefix(authHeader, "bearer ") _, err := jwt.Parse(tokenString, func( token *jwt.Token, @@ -68,9 +69,14 @@ func (suite *AutoAuthenticatorTestSuite) SetupSuite() { }) if err != nil { res.WriteHeader(http.StatusUnauthorized) + return } + userData, err := json.Marshal(map[string]any{}) + require.NoError(err) + res.Header().Add("X-User-Data", string(userData)) + res.WriteHeader(http.StatusOK) })) suite.Server = testServer From 6d81666b48068d6a9b23c785307750914f983851 Mon Sep 17 00:00:00 2001 From: Parham Alvani Date: Sun, 12 Nov 2023 05:53:50 +0000 Subject: [PATCH 506/660] fix: correct lint issues --- internal/authenticator/manual_authenticator_test.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/internal/authenticator/manual_authenticator_test.go b/internal/authenticator/manual_authenticator_test.go index 151227e1..75ba768b 100644 --- a/internal/authenticator/manual_authenticator_test.go +++ b/internal/authenticator/manual_authenticator_test.go @@ -31,6 +31,8 @@ type ManualAuthenticatorTestSuite struct { } func TestManualAuthenticator_suite(t *testing.T) { + t.Parallel() + suite.Run(t, new(ManualAuthenticatorTestSuite)) } From bf2df4b58f2664e8251f93369e81604b738b7a99 Mon Sep 17 00:00:00 2001 From: Parham Alvani Date: Mon, 13 Nov 2023 03:46:40 +0000 Subject: [PATCH 507/660] feat: update packages --- go.mod | 34 +++++++++++++++++----------------- go.sum | 37 +++++++++++++++++++++++++++++++++++++ 2 files changed, 54 insertions(+), 17 deletions(-) diff --git a/go.mod b/go.mod index 756a5005..c31992c6 100644 --- a/go.mod +++ b/go.mod @@ -6,17 +6,17 @@ require ( github.com/ansrivas/fiberprometheus/v2 v2.6.1 github.com/gofiber/contrib/fiberzap v1.0.2 github.com/gofiber/fiber/v2 v2.50.0 - github.com/golang-jwt/jwt/v5 v5.0.0 + github.com/golang-jwt/jwt/v5 v5.1.0 github.com/knadh/koanf v1.5.0 github.com/knadh/koanf/v2 v2.0.1 github.com/speps/go-hashids/v2 v2.0.1 github.com/spf13/cobra v1.8.0 github.com/stretchr/testify v1.8.4 github.com/tidwall/pretty v1.2.1 - go.opentelemetry.io/otel v1.19.0 - go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.19.0 - go.opentelemetry.io/otel/sdk v1.19.0 - go.opentelemetry.io/otel/trace v1.19.0 + go.opentelemetry.io/otel v1.20.0 + go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.20.0 + go.opentelemetry.io/otel/sdk v1.20.0 + go.opentelemetry.io/otel/trace v1.20.0 go.uber.org/automaxprocs v1.5.3 go.uber.org/zap v1.26.0 ) @@ -28,15 +28,15 @@ require ( github.com/cespare/xxhash/v2 v2.2.0 // indirect github.com/davecgh/go-spew v1.1.1 // indirect github.com/fatih/structs v1.1.0 // indirect - github.com/fsnotify/fsnotify v1.6.0 // indirect - github.com/go-logr/logr v1.2.4 // indirect + github.com/fsnotify/fsnotify v1.7.0 // indirect + github.com/go-logr/logr v1.3.0 // indirect github.com/go-logr/stdr v1.2.2 // indirect github.com/gofiber/adaptor/v2 v2.2.1 // indirect github.com/golang/protobuf v1.5.3 // indirect - github.com/google/uuid v1.3.1 // indirect - github.com/grpc-ecosystem/grpc-gateway/v2 v2.18.0 // indirect + github.com/google/uuid v1.4.0 // indirect + github.com/grpc-ecosystem/grpc-gateway/v2 v2.18.1 // indirect github.com/inconshreveable/mousetrap v1.1.0 // indirect - github.com/klauspost/compress v1.17.1 // indirect + github.com/klauspost/compress v1.17.2 // indirect github.com/mattn/go-colorable v0.1.13 // indirect github.com/mattn/go-isatty v0.0.20 // indirect github.com/mattn/go-runewidth v0.0.15 // indirect @@ -54,15 +54,15 @@ require ( github.com/valyala/bytebufferpool v1.0.0 // indirect github.com/valyala/fasthttp v1.50.0 // indirect github.com/valyala/tcplisten v1.0.0 // indirect - go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.19.0 // indirect - go.opentelemetry.io/otel/metric v1.19.0 // indirect + go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.20.0 // indirect + go.opentelemetry.io/otel/metric v1.20.0 // indirect go.opentelemetry.io/proto/otlp v1.0.0 // indirect go.uber.org/multierr v1.11.0 // indirect - golang.org/x/net v0.17.0 // indirect - golang.org/x/sys v0.13.0 // indirect - golang.org/x/text v0.13.0 // indirect - google.golang.org/genproto/googleapis/api v0.0.0-20231016165738-49dd2c1f3d0b // indirect - google.golang.org/genproto/googleapis/rpc v0.0.0-20231016165738-49dd2c1f3d0b // indirect + golang.org/x/net v0.18.0 // indirect + golang.org/x/sys v0.14.0 // indirect + golang.org/x/text v0.14.0 // indirect + google.golang.org/genproto/googleapis/api v0.0.0-20231106174013-bbf56f31fb17 // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20231106174013-bbf56f31fb17 // indirect google.golang.org/grpc v1.59.0 // indirect google.golang.org/protobuf v1.31.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect diff --git a/go.sum b/go.sum index 8554af2d..c7dd2933 100644 --- a/go.sum +++ b/go.sum @@ -58,6 +58,8 @@ github.com/fatih/structs v1.1.0/go.mod h1:9NiDSp5zOcgEDl+j00MP/WkGVPOlPRLejGD8Ga github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ= github.com/fsnotify/fsnotify v1.6.0 h1:n+5WquG0fcWoWp6xPWfHdbskMCQaFnG6PfBrh1Ky4HY= github.com/fsnotify/fsnotify v1.6.0/go.mod h1:sl3t1tCWJFWoRz9R8WJCbQihKKwmorjAbSClcnxKAGw= +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/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= github.com/go-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= github.com/go-kit/kit v0.9.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= @@ -69,6 +71,8 @@ github.com/go-logfmt/logfmt v0.5.0/go.mod h1:wCYkCAKZfumFQihp8CzCvQ3paCTfi41vtzG github.com/go-logr/logr v1.2.2/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= github.com/go-logr/logr v1.2.4 h1:g01GSCwiDw2xSZfjJ2/T9M+S6pFdcNtFYsp+Y43HYDQ= github.com/go-logr/logr v1.2.4/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= +github.com/go-logr/logr v1.3.0 h1:2y3SDp0ZXuc6/cjLSZ+Q3ir+QB9T/iG5yYRXqsagWSY= +github.com/go-logr/logr v1.3.0/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY= github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag= github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE= github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= @@ -84,6 +88,8 @@ github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7a github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q= github.com/golang-jwt/jwt/v5 v5.0.0 h1:1n1XNM9hk7O9mnQoNBGolZvzebBQ7p93ULHRc28XJUE= github.com/golang-jwt/jwt/v5 v5.0.0/go.mod h1:pqrtFR0X4osieyHYxtmOUWsAWrfe1Q5UVIyoH402zdk= +github.com/golang-jwt/jwt/v5 v5.1.0 h1:UGKbA/IPjtS6zLcdB7i5TyACMgSbOTiR8qzXgw8HWQU= +github.com/golang-jwt/jwt/v5 v5.1.0/go.mod h1:pqrtFR0X4osieyHYxtmOUWsAWrfe1Q5UVIyoH402zdk= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= github.com/golang/glog v1.1.2 h1:DVjP2PbBOzHyzA+dn3WhHIq4NdVu3Q+pvivFICf/7fo= github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= @@ -119,10 +125,15 @@ github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/ github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.3.1 h1:KjJaJ9iWZ3jOFZIf1Lqf4laDRCasjl0BCmnEGxkdLb4= github.com/google/uuid v1.3.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/google/uuid v1.4.0 h1:MtMxsa51/r9yyhkyLsVeVt0B+BGQZzpQiTQ4eHZ8bc4= +github.com/google/uuid v1.4.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0/go.mod h1:8NvIoxWQoOIhqOTXgfV/d3M/q6VIi02HzZEHgUlZvzk= +github.com/grpc-ecosystem/grpc-gateway v1.16.0 h1:gmcG1KaJ57LophUzW0Hy8NmPhnMZb4M0+kPpLofRdBo= github.com/grpc-ecosystem/grpc-gateway v1.16.0/go.mod h1:BDjrQk3hbvj6Nolgz8mAMFbcEtjT1g+wF4CSlocrBnw= github.com/grpc-ecosystem/grpc-gateway/v2 v2.18.0 h1:RtRsiaGvWxcwd8y3BiRZxsylPT8hLWZ5SPcfI+3IDNk= github.com/grpc-ecosystem/grpc-gateway/v2 v2.18.0/go.mod h1:TzP6duP4Py2pHLVPPQp42aoYI92+PCrVotyR5e8Vqlk= +github.com/grpc-ecosystem/grpc-gateway/v2 v2.18.1 h1:6UKoz5ujsI55KNpsJH3UwCq3T8kKbZwNZBNPuTTje8U= +github.com/grpc-ecosystem/grpc-gateway/v2 v2.18.1/go.mod h1:YvJ2f6MplWDhfxiUC3KpyTy76kYUZA4W3pTv/wdKQ9Y= github.com/hashicorp/consul/api v1.13.0/go.mod h1:ZlVrynguJKcYr54zGaDbaL3fOvKC9m72FhPvA8T35KQ= github.com/hashicorp/consul/sdk v0.8.0/go.mod h1:GBvyrGALthsZObzUGsfgHZQDXjg4lOjagTIwIR1vPms= github.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= @@ -172,8 +183,11 @@ github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= github.com/klauspost/compress v1.17.1 h1:NE3C767s2ak2bweCZo3+rdP4U/HoyVXLv/X9f2gPS5g= github.com/klauspost/compress v1.17.1/go.mod h1:ntbaceVETuRiXiv4DpjP66DpAtAGkEQskQzEyD//IeE= +github.com/klauspost/compress v1.17.2 h1:RlWWUY/Dr4fL8qk9YG7DTZ7PDgME2V4csBXA8L/ixi4= +github.com/klauspost/compress v1.17.2/go.mod h1:ntbaceVETuRiXiv4DpjP66DpAtAGkEQskQzEyD//IeE= github.com/knadh/koanf v1.5.0 h1:q2TSd/3Pyc/5yP9ldIrSdIz26MCcyNQzW0pEAugLPNs= github.com/knadh/koanf v1.5.0/go.mod h1:Hgyjp4y8v44hpZtPzs7JZfRAW5AhN7KfZcwv1RYggDs= +github.com/knadh/koanf/maps v0.1.1 h1:G5TjmUh2D7G2YWf5SQQqSiHRJEjaicvU0KpypqB3NIs= github.com/knadh/koanf/v2 v2.0.1 h1:1dYGITt1I23x8cfx8ZnldtezdyaZtfAuRtIFOiRzK7g= github.com/knadh/koanf/v2 v2.0.1/go.mod h1:ZeiIlIDXTE7w1lMT6UVcNiRAS2/rCeLn/GdLNvY1Dus= github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= @@ -201,6 +215,7 @@ github.com/mattn/go-isatty v0.0.20/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D github.com/mattn/go-runewidth v0.0.15 h1:UNAjwbU9l54TA3KzvqLGxwWjHmMgBUVhBiTjelZgg3U= github.com/mattn/go-runewidth v0.0.15/go.mod h1:Jdepj2loyihRzMpdS35Xk/zdY8IAYHsh153qUoGf23w= github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= +github.com/matttproud/golang_protobuf_extensions v1.0.4 h1:mmDVorXM7PCGKw94cs5zkfA9PSy5pEvNWRP0ET0TIVo= github.com/matttproud/golang_protobuf_extensions/v2 v2.0.0 h1:jWpvCLoY8Z/e3VKvlsiIGKtc+UG6U5vzxaoagmhXfyg= github.com/matttproud/golang_protobuf_extensions/v2 v2.0.0/go.mod h1:QUyp042oQthUoa9bqDv0ER0wrtXnBruoNd7aNjkbP+k= github.com/miekg/dns v1.1.26/go.mod h1:bPDLeHnStXmXAq1m/Ch/hvfNHr14JKNPMBo3VZKjuso= @@ -309,16 +324,28 @@ go.etcd.io/etcd/client/pkg/v3 v3.5.4/go.mod h1:IJHfcCEKxYu1Os13ZdwCwIUTUVGYTSAM3 go.etcd.io/etcd/client/v3 v3.5.4/go.mod h1:ZaRkVgBZC+L+dLCjTcF1hRXpgZXQPOvnA/Ak/gq3kiY= go.opentelemetry.io/otel v1.19.0 h1:MuS/TNf4/j4IXsZuJegVzI1cwut7Qc00344rgH7p8bs= go.opentelemetry.io/otel v1.19.0/go.mod h1:i0QyjOq3UPoTzff0PJB2N66fb4S0+rSbSB15/oyH9fY= +go.opentelemetry.io/otel v1.20.0 h1:vsb/ggIY+hUjD/zCAQHpzTmndPqv/ml2ArbsbfBYTAc= +go.opentelemetry.io/otel v1.20.0/go.mod h1:oUIGj3D77RwJdM6PPZImDpSZGDvkD9fhesHny69JFrs= go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.19.0 h1:Mne5On7VWdx7omSrSSZvM4Kw7cS7NQkOOmLcgscI51U= go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.19.0/go.mod h1:IPtUMKL4O3tH5y+iXVyAXqpAwMuzC1IrxVS81rummfE= +go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.20.0 h1:DeFD0VgTZ+Cj6hxravYYZE2W4GlneVH81iAOPjZkzk8= +go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.20.0/go.mod h1:GijYcYmNpX1KazD5JmWGsi4P7dDTTTnfv1UbGn84MnU= go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.19.0 h1:3d+S281UTjM+AbF31XSOYn1qXn3BgIdWl8HNEpx08Jk= go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.19.0/go.mod h1:0+KuTDyKL4gjKCF75pHOX4wuzYDUZYfAQdSu43o+Z2I= +go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.20.0 h1:gvmNvqrPYovvyRmCSygkUDyL8lC5Tl845MLEwqpxhEU= +go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.20.0/go.mod h1:vNUq47TGFioo+ffTSnKNdob241vePmtNZnAODKapKd0= go.opentelemetry.io/otel/metric v1.19.0 h1:aTzpGtV0ar9wlV4Sna9sdJyII5jTVJEvKETPiOKwvpE= go.opentelemetry.io/otel/metric v1.19.0/go.mod h1:L5rUsV9kM1IxCj1MmSdS+JQAcVm319EUrDVLrt7jqt8= +go.opentelemetry.io/otel/metric v1.20.0 h1:ZlrO8Hu9+GAhnepmRGhSU7/VkpjrNowxRN9GyKR4wzA= +go.opentelemetry.io/otel/metric v1.20.0/go.mod h1:90DRw3nfK4D7Sm/75yQ00gTJxtkBxX+wu6YaNymbpVM= go.opentelemetry.io/otel/sdk v1.19.0 h1:6USY6zH+L8uMH8L3t1enZPR3WFEmSTADlqldyHtJi3o= go.opentelemetry.io/otel/sdk v1.19.0/go.mod h1:NedEbbS4w3C6zElbLdPJKOpJQOrGUJ+GfzpjUvI0v1A= +go.opentelemetry.io/otel/sdk v1.20.0 h1:5Jf6imeFZlZtKv9Qbo6qt2ZkmWtdWx/wzcCbNUlAWGM= +go.opentelemetry.io/otel/sdk v1.20.0/go.mod h1:rmkSx1cZCm/tn16iWDn1GQbLtsW/LvsdEEFzCSRM6V0= go.opentelemetry.io/otel/trace v1.19.0 h1:DFVQmlVbfVeOuBRrwdtaehRrWiL1JoVs9CPIQ1Dzxpg= go.opentelemetry.io/otel/trace v1.19.0/go.mod h1:mfaSyvGyEJEI0nyV2I4qhNQnbBOUUmYZpYojqMnX2vo= +go.opentelemetry.io/otel/trace v1.20.0 h1:+yxVAPZPbQhbC3OfAkeIVTky6iTFpcr4SiY9om7mXSQ= +go.opentelemetry.io/otel/trace v1.20.0/go.mod h1:HJSK7F/hA5RlzpZ0zKDCHCDHm556LCDtKaAo6JmBFUU= go.opentelemetry.io/proto/otlp v1.0.0 h1:T0TX0tmXU8a3CbNXzEKGeU5mIVOdf0oykP+u2lIVU/I= go.opentelemetry.io/proto/otlp v1.0.0/go.mod h1:Sy6pihPLfYHkr3NkUbEhGHFhINUSI/v80hjKIs5JXpM= go.uber.org/atomic v1.7.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc= @@ -364,6 +391,8 @@ golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96b golang.org/x/net v0.0.0-20210410081132-afb366fc7cd1/go.mod h1:9tjilg8BloeKEkVJvy7fQ90B1CfIiPueXVOjqfkSzI8= golang.org/x/net v0.17.0 h1:pVaXccu2ozPjCXewfr1S7xza/zcXTity9cCdXQYSjIM= golang.org/x/net v0.17.0/go.mod h1:NxSsAGuq816PNPmqtQdLE42eU2Fs7NoRIZrHJAlaCOE= +golang.org/x/net v0.18.0 h1:mIYleuAkSbHh0tCv7RvjL3F6ZVbLjq4+R7zbOn3Kokg= +golang.org/x/net v0.18.0/go.mod h1:/czyP5RqHAH4odGYxBJ1qz0+CE5WZ+2j1YgoEo8F2jQ= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= @@ -411,6 +440,8 @@ golang.org/x/sys v0.0.0-20220908164124-27713097b956/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.13.0 h1:Af8nKPmuFypiUBjVoU9V20FiaFXOcuZI21p0ycVYYGE= golang.org/x/sys v0.13.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.14.0 h1:Vz7Qs629MkJkGyHxUlRHizWJRG2j8fbQKjELVSNhy7Q= +golang.org/x/sys v0.14.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.1-0.20181227161524-e6919f6577db/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= @@ -420,6 +451,8 @@ golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.13.0 h1:ablQoSUd0tRdKxZewP80B+BaqeKJuVhuRxj/dkrun3k= golang.org/x/text v0.13.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE= +golang.org/x/text v0.14.0 h1:ScX5w1eTa3QqT8oi6+ziP7dTV1S2+ALU0bI+0zXKWiQ= +golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= @@ -447,8 +480,12 @@ google.golang.org/genproto v0.0.0-20210602131652-f16073e35f0c/go.mod h1:UODoCrxH google.golang.org/genproto v0.0.0-20231012201019-e917dd12ba7a h1:fwgW9j3vHirt4ObdHoYNwuO24BEZjSzbh+zPaNWoiY8= google.golang.org/genproto/googleapis/api v0.0.0-20231016165738-49dd2c1f3d0b h1:CIC2YMXmIhYw6evmhPxBKJ4fmLbOFtXQN/GV3XOZR8k= google.golang.org/genproto/googleapis/api v0.0.0-20231016165738-49dd2c1f3d0b/go.mod h1:IBQ646DjkDkvUIsVq/cc03FUFQ9wbZu7yE396YcL870= +google.golang.org/genproto/googleapis/api v0.0.0-20231106174013-bbf56f31fb17 h1:JpwMPBpFN3uKhdaekDpiNlImDdkUAyiJ6ez/uxGaUSo= +google.golang.org/genproto/googleapis/api v0.0.0-20231106174013-bbf56f31fb17/go.mod h1:0xJLfVdJqpAPl8tDg1ujOCGzx6LFLttXT5NhllGOXY4= google.golang.org/genproto/googleapis/rpc v0.0.0-20231016165738-49dd2c1f3d0b h1:ZlWIi1wSK56/8hn4QcBp/j9M7Gt3U/3hZw3mC7vDICo= google.golang.org/genproto/googleapis/rpc v0.0.0-20231016165738-49dd2c1f3d0b/go.mod h1:swOH3j0KzcDDgGUWr+SNpyTen5YrXjS3eyPzFYKc6lc= +google.golang.org/genproto/googleapis/rpc v0.0.0-20231106174013-bbf56f31fb17 h1:Jyp0Hsi0bmHXG6k9eATXoYtjd6e2UzZ1SCn/wIupY14= +google.golang.org/genproto/googleapis/rpc v0.0.0-20231106174013-bbf56f31fb17/go.mod h1:oQ5rr10WTTMvP4A36n8JpR1OrO1BEiV4f78CneXZxkA= google.golang.org/grpc v1.14.0/go.mod h1:yo6s7OP7yaDglbqo1J04qKzAhqBH6lvTonzMVmEdcZw= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= google.golang.org/grpc v1.22.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= From 87cce25c3a768adc6cb21b20c6cb55109c239611 Mon Sep 17 00:00:00 2001 From: Parham Alvani Date: Mon, 13 Nov 2023 04:22:29 +0000 Subject: [PATCH 508/660] feat: update tracer usage --- internal/tracing/tracer.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/internal/tracing/tracer.go b/internal/tracing/tracer.go index 857c3764..a009cc37 100644 --- a/internal/tracing/tracer.go +++ b/internal/tracing/tracer.go @@ -10,12 +10,13 @@ import ( sdktrace "go.opentelemetry.io/otel/sdk/trace" semconv "go.opentelemetry.io/otel/semconv/v1.7.0" "go.opentelemetry.io/otel/trace" + "go.opentelemetry.io/otel/trace/noop" "go.uber.org/zap" ) -func New(cfg Config, logger *zap.Logger) trace.Tracer { //nolint: ireturn +func New(cfg Config, logger *zap.Logger) trace.Tracer { if !cfg.Enabled { - return trace.NewNoopTracerProvider().Tracer("snapp.dispatching") + return noop.NewTracerProvider().Tracer("snapp.dispatching") } exporter, err := otlptracegrpc.New( From 5895a776ce439254c08096494126ffe0a5715c83 Mon Sep 17 00:00:00 2001 From: Parham Alvani Date: Mon, 13 Nov 2023 06:59:03 +0000 Subject: [PATCH 509/660] feat: add tests for api module --- internal/api/acl.go | 14 +++++++------- internal/api/api_test.go | 42 ++++++++++++++++++++++++++++++++++++++++ internal/api/auth.go | 16 +++++++-------- 3 files changed, 57 insertions(+), 15 deletions(-) diff --git a/internal/api/acl.go b/internal/api/acl.go index dad2d281..4e2b1fe5 100644 --- a/internal/api/acl.go +++ b/internal/api/acl.go @@ -12,12 +12,12 @@ import ( "go.uber.org/zap" ) -type aclResponse struct { +type AclResponse struct { Result string `json:"result,omitempty"` } -// aclRequest is the body payload structure of the ACL endpoint. -type aclRequest struct { +// AclRequest is the body payload structure of the ACL endpoint. +type AclRequest struct { Access acl.AccessType `form:"access"` Token string `form:"token"` Username string `from:"username"` @@ -31,7 +31,7 @@ func (a API) ACLv1(c *fiber.Ctx) error { _, span := a.Tracer.Start(c.Context(), "api.v1.acl") defer span.End() - request := new(aclRequest) + request := new(AclRequest) if err := c.BodyParser(request); err != nil { a.Logger. Warn("acl bad request", @@ -133,7 +133,7 @@ func (a API) ACLv2(c *fiber.Ctx) error { zap.String("password", request.Password), ) - return c.Status(http.StatusBadRequest).JSON(aclResponse{ + return c.Status(http.StatusBadRequest).JSON(AclResponse{ Result: "deny", }) } @@ -191,7 +191,7 @@ func (a API) ACLv2(c *fiber.Ctx) error { zap.String("authenticator", auth.GetCompany())) } - return c.Status(http.StatusUnauthorized).JSON(aclResponse{ + return c.Status(http.StatusUnauthorized).JSON(AclResponse{ Result: "deny", }) } @@ -206,7 +206,7 @@ func (a API) ACLv2(c *fiber.Ctx) error { zap.String("authenticator", auth.GetCompany()), ) - return c.Status(http.StatusOK).JSON(aclResponse{ + return c.Status(http.StatusOK).JSON(AclResponse{ Result: "allow", }) } diff --git a/internal/api/api_test.go b/internal/api/api_test.go index 1eccbd26..3bb2f494 100644 --- a/internal/api/api_test.go +++ b/internal/api/api_test.go @@ -1,9 +1,18 @@ package api_test import ( + "bytes" + "encoding/json" + "net/http" + "net/http/httptest" "testing" + "github.com/gofiber/fiber/v2" "github.com/snapp-incubator/soteria/internal/api" + "github.com/snapp-incubator/soteria/internal/authenticator" + "github.com/stretchr/testify/require" + "go.opentelemetry.io/otel/trace/noop" + "go.uber.org/zap" ) // nolint: funlen @@ -78,3 +87,36 @@ func TestExtractVendorToken(t *testing.T) { }) } } + +func TestAuthv2(t *testing.T) { + t.Parallel() + + require := require.New(t) + + app := fiber.New() + + a := api.API{ + Authenticators: map[string]authenticator.Authenticator{}, + DefaultVendor: "snapp", + Tracer: noop.NewTracerProvider().Tracer(""), + Logger: zap.NewExample(), + } + + app.Post("/v2/auth", a.Authv2) + + t.Run("bad request because it doesn't have json heaer", func(_ *testing.T) { + body, err := json.Marshal(api.AuthRequest{ + Token: "", + Username: "not-found:token", + Password: "", + }) + require.NoError(err) + + req := httptest.NewRequest(http.MethodPost, "/v2/auth", bytes.NewReader(body)) + + resp, err := app.Test(req) + require.NoError(err) + + require.Equal(http.StatusBadRequest, resp.StatusCode) + }) +} diff --git a/internal/api/auth.go b/internal/api/auth.go index bee6da01..dda38e79 100644 --- a/internal/api/auth.go +++ b/internal/api/auth.go @@ -10,14 +10,14 @@ import ( "go.uber.org/zap" ) -// authRequest is the body payload structure of the auth endpoint. -type authRequest struct { +// AuthRequest is the body payload structure of the auth endpoint. +type AuthRequest struct { Token string `form:"token" json:"token,omitempty"` Username string `from:"username" json:"username,omitempty"` Password string `form:"password" json:"password,omitempty"` } -type authResponse struct { +type AuthResponse struct { Result string `json:"result,omitempty"` IsSuperuser bool `json:"is_superuser,omitempty"` } @@ -28,7 +28,7 @@ func (a API) Authv1(c *fiber.Ctx) error { _, span := a.Tracer.Start(c.Context(), "api.v1.auth") defer span.End() - request := new(authRequest) + request := new(AuthRequest) if err := c.BodyParser(request); err != nil { span.RecordError(err) @@ -87,7 +87,7 @@ func (a API) Authv2(c *fiber.Ctx) error { _, span := a.Tracer.Start(c.Context(), "api.v2.auth") defer span.End() - request := new(authRequest) + request := new(AuthRequest) if err := c.BodyParser(request); err != nil { span.RecordError(err) @@ -97,7 +97,7 @@ func (a API) Authv2(c *fiber.Ctx) error { zap.Error(err), ) - return c.Status(http.StatusBadRequest).JSON(authResponse{ + return c.Status(http.StatusBadRequest).JSON(AuthResponse{ Result: "deny", IsSuperuser: false, }) @@ -128,7 +128,7 @@ func (a API) Authv2(c *fiber.Ctx) error { ) } - return c.Status(http.StatusUnauthorized).JSON(authResponse{ + return c.Status(http.StatusUnauthorized).JSON(AuthResponse{ Result: "deny", IsSuperuser: false, }) @@ -142,7 +142,7 @@ func (a API) Authv2(c *fiber.Ctx) error { zap.String("authenticator", authenticator.GetCompany()), ) - return c.Status(http.StatusOK).JSON(authResponse{ + return c.Status(http.StatusOK).JSON(AuthResponse{ Result: "allow", IsSuperuser: false, }) From 768633b32765b45549f1e137ea6007b1950d2611 Mon Sep 17 00:00:00 2001 From: Parham Alvani Date: Mon, 13 Nov 2023 07:03:25 +0000 Subject: [PATCH 510/660] fix: correct lint issues --- internal/api/api_test.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/internal/api/api_test.go b/internal/api/api_test.go index 3bb2f494..c97e1d12 100644 --- a/internal/api/api_test.go +++ b/internal/api/api_test.go @@ -104,7 +104,9 @@ func TestAuthv2(t *testing.T) { app.Post("/v2/auth", a.Authv2) - t.Run("bad request because it doesn't have json heaer", func(_ *testing.T) { + t.Run("bad request because it doesn't have json heaer", func(t *testing.T) { + t.Parallel() + body, err := json.Marshal(api.AuthRequest{ Token: "", Username: "not-found:token", @@ -117,6 +119,8 @@ func TestAuthv2(t *testing.T) { resp, err := app.Test(req) require.NoError(err) + defer resp.Body.Close() + require.Equal(http.StatusBadRequest, resp.StatusCode) }) } From cd5490c1d0ae841e1d23c8ee481a0a585a3baddf Mon Sep 17 00:00:00 2001 From: Parham Alvani Date: Mon, 13 Nov 2023 14:32:57 +0000 Subject: [PATCH 511/660] fix: correct lint issues --- internal/api/acl.go | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/internal/api/acl.go b/internal/api/acl.go index 4e2b1fe5..dd081572 100644 --- a/internal/api/acl.go +++ b/internal/api/acl.go @@ -12,12 +12,12 @@ import ( "go.uber.org/zap" ) -type AclResponse struct { +type ACLResponse struct { Result string `json:"result,omitempty"` } // AclRequest is the body payload structure of the ACL endpoint. -type AclRequest struct { +type ACLRequest struct { Access acl.AccessType `form:"access"` Token string `form:"token"` Username string `from:"username"` @@ -31,7 +31,7 @@ func (a API) ACLv1(c *fiber.Ctx) error { _, span := a.Tracer.Start(c.Context(), "api.v1.acl") defer span.End() - request := new(AclRequest) + request := new(ACLRequest) if err := c.BodyParser(request); err != nil { a.Logger. Warn("acl bad request", @@ -133,7 +133,7 @@ func (a API) ACLv2(c *fiber.Ctx) error { zap.String("password", request.Password), ) - return c.Status(http.StatusBadRequest).JSON(AclResponse{ + return c.Status(http.StatusBadRequest).JSON(ACLResponse{ Result: "deny", }) } @@ -191,7 +191,7 @@ func (a API) ACLv2(c *fiber.Ctx) error { zap.String("authenticator", auth.GetCompany())) } - return c.Status(http.StatusUnauthorized).JSON(AclResponse{ + return c.Status(http.StatusUnauthorized).JSON(ACLResponse{ Result: "deny", }) } @@ -206,7 +206,7 @@ func (a API) ACLv2(c *fiber.Ctx) error { zap.String("authenticator", auth.GetCompany()), ) - return c.Status(http.StatusOK).JSON(AclResponse{ + return c.Status(http.StatusOK).JSON(ACLResponse{ Result: "allow", }) } From 7f612bb30ea6298b2fafd5a55899441510e273e1 Mon Sep 17 00:00:00 2001 From: Parham Alvani Date: Mon, 13 Nov 2023 15:33:24 +0000 Subject: [PATCH 512/660] feat: improve coverage over api --- internal/api/api_test.go | 124 ++++++++++++++++++++++++++++++++------- 1 file changed, 103 insertions(+), 21 deletions(-) diff --git a/internal/api/api_test.go b/internal/api/api_test.go index c97e1d12..0dc990cb 100644 --- a/internal/api/api_test.go +++ b/internal/api/api_test.go @@ -3,18 +3,43 @@ package api_test import ( "bytes" "encoding/json" + "fmt" + "io" "net/http" "net/http/httptest" "testing" + "time" "github.com/gofiber/fiber/v2" + "github.com/golang-jwt/jwt/v5" "github.com/snapp-incubator/soteria/internal/api" "github.com/snapp-incubator/soteria/internal/authenticator" - "github.com/stretchr/testify/require" + "github.com/snapp-incubator/soteria/internal/config" + "github.com/stretchr/testify/suite" "go.opentelemetry.io/otel/trace/noop" "go.uber.org/zap" ) +func getSampleToken(key string) (string, error) { + exp := time.Now().Add(time.Hour * 24 * 365 * 10) + sub := "DXKgaNQa7N5Y7bo" + + // nolint: exhaustruct + claims := jwt.RegisteredClaims{ + ExpiresAt: jwt.NewNumericDate(exp), + Issuer: "Colony", + Subject: sub, + } + token := jwt.NewWithClaims(jwt.SigningMethodHS512, claims) + + tokenString, err := token.SignedString([]byte(key)) + if err != nil { + return "", fmt.Errorf("cannot generate a signed string %w", err) + } + + return tokenString, nil +} + // nolint: funlen func TestExtractVendorToken(t *testing.T) { t.Parallel() @@ -88,39 +113,96 @@ func TestExtractVendorToken(t *testing.T) { } } -func TestAuthv2(t *testing.T) { - t.Parallel() +type APITestSuite struct { + suite.Suite - require := require.New(t) + app *fiber.App + key string +} + +func (suite *APITestSuite) SetupSuite() { + suite.key = "secret" app := fiber.New() a := api.API{ - Authenticators: map[string]authenticator.Authenticator{}, - DefaultVendor: "snapp", - Tracer: noop.NewTracerProvider().Tracer(""), - Logger: zap.NewExample(), + Authenticators: map[string]authenticator.Authenticator{ + "snapp-admin": authenticator.AdminAuthenticator{ + Key: []byte(suite.key), + Company: "snapp-admin", + JwtConfig: config.Jwt{ + IssName: "iss", + SubName: "sub", + SigningMethod: "HS512", + }, + Parser: jwt.NewParser(), + }, + }, + DefaultVendor: "snapp", + Tracer: noop.NewTracerProvider().Tracer(""), + Logger: zap.NewExample(), } app.Post("/v2/auth", a.Authv2) - t.Run("bad request because it doesn't have json heaer", func(t *testing.T) { - t.Parallel() + suite.app = app +} - body, err := json.Marshal(api.AuthRequest{ - Token: "", - Username: "not-found:token", - Password: "", - }) - require.NoError(err) +func (suite *APITestSuite) BadRequest() { + require := suite.Require() + + body, err := json.Marshal(api.AuthRequest{ + Token: "", + Username: "not-found:token", + Password: "", + }) + require.NoError(err) - req := httptest.NewRequest(http.MethodPost, "/v2/auth", bytes.NewReader(body)) + req := httptest.NewRequest(http.MethodPost, "/v2/auth", bytes.NewReader(body)) - resp, err := app.Test(req) - require.NoError(err) + resp, err := suite.app.Test(req) + require.NoError(err) - defer resp.Body.Close() + defer resp.Body.Close() - require.Equal(http.StatusBadRequest, resp.StatusCode) + require.Equal(http.StatusBadRequest, resp.StatusCode) +} + +func (suite *APITestSuite) ValidToken() { + require := suite.Require() + + token, err := getSampleToken(suite.key) + require.NoError(err) + + body, err := json.Marshal(api.AuthRequest{ + Token: "", + Username: fmt.Sprintf("snapp-admin:%s", token), + Password: "", }) + require.NoError(err) + + req := httptest.NewRequest(http.MethodPost, "/v2/auth", bytes.NewReader(body)) + req.Header.Add("Content-Type", "application/json") + + resp, err := suite.app.Test(req) + require.NoError(err) + + defer resp.Body.Close() + + require.Equal(http.StatusOK, resp.StatusCode) + + data, err := io.ReadAll(resp.Body) + require.NoError(err) + + var authResp api.AuthResponse + require.NoError(json.Unmarshal(data, &authResp)) + + require.Equal("allow", authResp.Result) + require.True(authResp.IsSuperuser) +} + +func TestAPITestSuite(t *testing.T) { + t.Parallel() + + suite.Run(t, new(APITestSuite)) } From a26a806f61fea6b8f1ee3f8a79e91710ead6ebe7 Mon Sep 17 00:00:00 2001 From: Parham Alvani Date: Mon, 13 Nov 2023 15:40:37 +0000 Subject: [PATCH 513/660] fix: correct lint issues --- internal/api/api_test.go | 1 + 1 file changed, 1 insertion(+) diff --git a/internal/api/api_test.go b/internal/api/api_test.go index 0dc990cb..f0de82d7 100644 --- a/internal/api/api_test.go +++ b/internal/api/api_test.go @@ -195,6 +195,7 @@ func (suite *APITestSuite) ValidToken() { require.NoError(err) var authResp api.AuthResponse + require.NoError(json.Unmarshal(data, &authResp)) require.Equal("allow", authResp.Result) From 289658b1d5616eb0423e2cd584a8369072c6b5b2 Mon Sep 17 00:00:00 2001 From: Parham Alvani Date: Mon, 13 Nov 2023 16:12:03 +0000 Subject: [PATCH 514/660] feat: add more tests --- internal/topics/manager_test.go | 2 +- internal/topics/topic_test.go | 35 +++++++++++++++++++++++++++++++++ 2 files changed, 36 insertions(+), 1 deletion(-) create mode 100644 internal/topics/topic_test.go diff --git a/internal/topics/manager_test.go b/internal/topics/manager_test.go index d235a255..f61e3ca5 100644 --- a/internal/topics/manager_test.go +++ b/internal/topics/manager_test.go @@ -9,7 +9,7 @@ import ( ) // nolint: funlen -func TestTopic_GetType(t *testing.T) { +func TestTopicManager(t *testing.T) { t.Parallel() tests := []struct { diff --git a/internal/topics/topic_test.go b/internal/topics/topic_test.go new file mode 100644 index 00000000..a7459e00 --- /dev/null +++ b/internal/topics/topic_test.go @@ -0,0 +1,35 @@ +package topics_test + +import ( + "testing" + "text/template" + + "github.com/snapp-incubator/soteria/internal/topics" + "github.com/snapp-incubator/soteria/pkg/acl" + "github.com/stretchr/testify/require" +) + +func TestTopic(t *testing.T) { + require := require.New(t) + + topic := topics.Topic{ + Type: topics.CabEvent, + Template: "^{{.iss}}-event-$", + Accesses: map[string]acl.AccessType{ + topics.DriverIss: acl.Sub, + topics.PassengerIss: acl.Sub, + }, + } + + temp := topics.Template{ + Type: topic.Type, + Template: template.Must(template.New("").Parse(topic.Template)), + Accesses: topic.Accesses, + } + + s := temp.Parse(map[string]string{ + "iss": "passenger", + }) + + require.Equal("^passenger-event-$", s) +} From 59fb8d850bf11adebe37b4541f55a3fde454f1ae Mon Sep 17 00:00:00 2001 From: Parham Alvani Date: Mon, 13 Nov 2023 16:15:05 +0000 Subject: [PATCH 515/660] fix: correct lint issues --- internal/topics/topic_test.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/internal/topics/topic_test.go b/internal/topics/topic_test.go index a7459e00..d4c36243 100644 --- a/internal/topics/topic_test.go +++ b/internal/topics/topic_test.go @@ -10,6 +10,8 @@ import ( ) func TestTopic(t *testing.T) { + t.Parallel() + require := require.New(t) topic := topics.Topic{ From 6d49122d4c88fb3b962c7d92ca004350a1ee5b31 Mon Sep 17 00:00:00 2001 From: Ahmad Anvari Date: Fri, 17 Nov 2023 21:33:11 +0330 Subject: [PATCH 516/660] feat: create example config for easier running the project --- config.example.yml | 109 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 109 insertions(+) create mode 100644 config.example.yml diff --git a/config.example.yml b/config.example.yml new file mode 100644 index 00000000..ef65c000 --- /dev/null +++ b/config.example.yml @@ -0,0 +1,109 @@ +default_vendor: snapp +http_port: 9999 +logger: + level: debug +validator: + url: http://validator-lb + timeout: "5s" +vendors: + - allowed_access_types: + - pub + - sub + company: snapp + hash_id_map: + "0": + alphabet: "" + length: 15 + salt: secret + "1": + alphabet: "" + length: 15 + salt: secret + iss_entity_map: + "0": driver + "1": passenger + default: "" + iss_peer_map: + "0": passenger + "1": driver + default: "" + jwt: + iss_name: iss + signing_method: RS512 + sub_name: sub + keys: + "0": |- + -----BEGIN PUBLIC KEY----- + MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAyG4XpV9TpDfgWJF9TiIv + va4hNhDuqYMJO6iXLzr3y8oCvoB7zUK0EjtbLH+A3gr1kUvyZKDWT4qHTvU2Sshm + X+ttWGK34EhCvF3Lb18yxmVDSSK8JIcTaJjMqmyubxzamQnNoWazJ7ea9BIo2YGL + C9rgPbi1hihhdb07xPGUkJRqbWkI98xjDhKdMqiwW1hIRXm/apo++FjptvqvF84s + ynC5gWGFHiGNICRsLJBczLEAf2Atbafigq6/tovzMabnp2yRtr1ReEgioH1RO4gX + J7F4N5f6y/VWd8+sDOSxtS/HcnP/7g8/A54G2IbXxr+EiwOO/1F+pyMPKq7sGDSU + DwIDAQAB + -----END PUBLIC KEY----- + "1": |- + -----BEGIN PUBLIC KEY----- + MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA5SeRfOdTyvQZ7N9ahFHl + +J05r7e9fgOQ2cpOtnnsIjAjCt1dF7/NkqVifEaxABRBGG9iXIw//G4hi0TqoKqK + aoSHMGf6q9pSRLGyB8FatxZf2RBTgrXYqVvpasbnB1ZNv858yTpRjV9NzJXYHLp8 + 8Hbd/yYTR6Q7ajs11/SMLGO7KBELsI1pBz7UW/fngJ2pRmd+RkG+EcGrOIZ27TkI + Xjtog6bgfmtV9FWxSVdKACOY0OmW+g7jIMik2eZTYG3kgCmW2odu3zRoUa7l9VwN + YMuhTePaIWwOifzRQt8HDsAOpzqJuLCoYX7HmBfpGAnwu4BuTZgXVwpvPNb+KlgS + pQIDAQAB + -----END PUBLIC KEY----- + topics: + - accesses: + "0": "1" + "1": "1" + template: ^{{IssToEntity .iss}}-event-{{ EncodeMD5 (DecodeHashID .sub .iss) }}$ + type: cab_event + - accesses: + "0": "2" + "1": "-1" + template: ^{{.company}}/driver/{{.sub}}/location$ + type: driver_location + - accesses: + "0": "2" + "1": "2" + template: ^{{.company}}/passenger/{{.sub}}/location$ + type: passenger_location + - accesses: + "0": "1" + "1": "1" + template: ^{{.company}}/{{IssToEntity .iss}}/{{.sub}}/superapp$ + type: superapp_event + - accesses: + "0": "-1" + "1": "-1" + template: ^bucks$ + type: box_event + - accesses: + "0": "1" + "1": "1" + template: ^{{.company}}/{{IssToEntity .iss}}/{{.sub}}/{{IssToPeer .iss}}-location$ + type: shared_location + - accesses: + "0": "1" + "1": "1" + template: ^{{.company}}/{{IssToEntity .iss}}/{{.sub}}/chat$ + type: chat + - accesses: + "0": "2" + "1": "2" + template: ^shared/{{.company}}/{{IssToEntity .iss}}/{{.sub}}/call/send$ + type: general_call_entry + - accesses: + "0": "2" + "1": "2" + template: ^{{.company}}/{{IssToEntity .iss}}/{{.sub}}/call/[a-zA-Z0-9-_]+/send$ + type: node_call_entry + - accesses: + "0": "1" + "1": "1" + template: ^{{.company}}/{{IssToEntity .iss}}/{{.sub}}/call/receive$ + type: call_outgoing +tracer: + enabled: false + endpoint: 127.0.0.1:4317 + ratio: 0.1 From 9f488334c85df488ec012342dade1e97984196af Mon Sep 17 00:00:00 2001 From: Ahmad Anvari Date: Fri, 17 Nov 2023 22:13:19 +0330 Subject: [PATCH 517/660] chore: add some documentations --- config.example.yml | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/config.example.yml b/config.example.yml index ef65c000..e6a661cc 100644 --- a/config.example.yml +++ b/config.example.yml @@ -1,10 +1,15 @@ +# Company name of the vendor to use if the incoming ACL request vendor is not found withing the registered vendors. default_vendor: snapp +# Port of the HTTP server: http_port: 9999 +# Application logger config: logger: level: debug +# Validator is the upstream backend service that can validate the tokens: validator: url: http://validator-lb timeout: "5s" +# The list of different vendors or companies that Soteria should work with: vendors: - allowed_access_types: - pub @@ -52,6 +57,16 @@ vendors: YMuhTePaIWwOifzRQt8HDsAOpzqJuLCoYX7HmBfpGAnwu4BuTZgXVwpvPNb+KlgS pQIDAQAB -----END PUBLIC KEY----- + # Examples of different use cases of template functions: + # Topics are dynamics and their patterns can be defined using some GoTemplate functions. + # + # + # IssToEntity: converts iss claim token to company name. + # + # EncodeMD5: encode MD5 of the input + # + # DecodeHashID: runs hashid algorithm on the input. The first argument is the input of hashid and the second argument + # is the issuer of id of hash_id_map. topics: - accesses: "0": "1" From cf2a680d445c59e38e503aa7a8bcdc531eb68c2d Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 20 Nov 2023 01:19:42 +0000 Subject: [PATCH 518/660] chore(deps): bump go.opentelemetry.io/otel/trace from 1.20.0 to 1.21.0 Bumps [go.opentelemetry.io/otel/trace](https://github.com/open-telemetry/opentelemetry-go) from 1.20.0 to 1.21.0. - [Release notes](https://github.com/open-telemetry/opentelemetry-go/releases) - [Changelog](https://github.com/open-telemetry/opentelemetry-go/blob/main/CHANGELOG.md) - [Commits](https://github.com/open-telemetry/opentelemetry-go/compare/v1.20.0...v1.21.0) --- updated-dependencies: - dependency-name: go.opentelemetry.io/otel/trace dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- go.mod | 6 +++--- go.sum | 57 +++++++++------------------------------------------------ 2 files changed, 12 insertions(+), 51 deletions(-) diff --git a/go.mod b/go.mod index c31992c6..6f727353 100644 --- a/go.mod +++ b/go.mod @@ -13,10 +13,10 @@ require ( github.com/spf13/cobra v1.8.0 github.com/stretchr/testify v1.8.4 github.com/tidwall/pretty v1.2.1 - go.opentelemetry.io/otel v1.20.0 + go.opentelemetry.io/otel v1.21.0 go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.20.0 go.opentelemetry.io/otel/sdk v1.20.0 - go.opentelemetry.io/otel/trace v1.20.0 + go.opentelemetry.io/otel/trace v1.21.0 go.uber.org/automaxprocs v1.5.3 go.uber.org/zap v1.26.0 ) @@ -55,7 +55,7 @@ require ( github.com/valyala/fasthttp v1.50.0 // indirect github.com/valyala/tcplisten v1.0.0 // indirect go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.20.0 // indirect - go.opentelemetry.io/otel/metric v1.20.0 // indirect + go.opentelemetry.io/otel/metric v1.21.0 // indirect go.opentelemetry.io/proto/otlp v1.0.0 // indirect go.uber.org/multierr v1.11.0 // indirect golang.org/x/net v0.18.0 // indirect diff --git a/go.sum b/go.sum index c7dd2933..0055cce4 100644 --- a/go.sum +++ b/go.sum @@ -56,8 +56,6 @@ github.com/fatih/color v1.9.0/go.mod h1:eQcE1qtQxscV5RaZvpXrrb8Drkc3/DdQ+uUYCNjL github.com/fatih/structs v1.1.0 h1:Q7juDM0QtcnhCpeyLGQKyg4TOIghuNXrkL32pHAUMxo= github.com/fatih/structs v1.1.0/go.mod h1:9NiDSp5zOcgEDl+j00MP/WkGVPOlPRLejGD8Ga6PJ7M= github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ= -github.com/fsnotify/fsnotify v1.6.0 h1:n+5WquG0fcWoWp6xPWfHdbskMCQaFnG6PfBrh1Ky4HY= -github.com/fsnotify/fsnotify v1.6.0/go.mod h1:sl3t1tCWJFWoRz9R8WJCbQihKKwmorjAbSClcnxKAGw= 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/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= @@ -69,8 +67,6 @@ github.com/go-logfmt/logfmt v0.3.0/go.mod h1:Qt1PoO58o5twSAckw1HlFXLmHsOX5/0LbT9 github.com/go-logfmt/logfmt v0.4.0/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V4qmtdjCk= github.com/go-logfmt/logfmt v0.5.0/go.mod h1:wCYkCAKZfumFQihp8CzCvQ3paCTfi41vtzG1KdI/P7A= github.com/go-logr/logr v1.2.2/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= -github.com/go-logr/logr v1.2.4 h1:g01GSCwiDw2xSZfjJ2/T9M+S6pFdcNtFYsp+Y43HYDQ= -github.com/go-logr/logr v1.2.4/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= github.com/go-logr/logr v1.3.0 h1:2y3SDp0ZXuc6/cjLSZ+Q3ir+QB9T/iG5yYRXqsagWSY= github.com/go-logr/logr v1.3.0/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY= github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag= @@ -86,12 +82,9 @@ github.com/gofiber/fiber/v2 v2.50.0 h1:ia0JaB+uw3GpNSCR5nvC5dsaxXjRU5OEu36aytx+z github.com/gofiber/fiber/v2 v2.50.0/go.mod h1:21eytvay9Is7S6z+OgPi7c7n4++tnClWmhpimVHMimw= github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q= -github.com/golang-jwt/jwt/v5 v5.0.0 h1:1n1XNM9hk7O9mnQoNBGolZvzebBQ7p93ULHRc28XJUE= -github.com/golang-jwt/jwt/v5 v5.0.0/go.mod h1:pqrtFR0X4osieyHYxtmOUWsAWrfe1Q5UVIyoH402zdk= github.com/golang-jwt/jwt/v5 v5.1.0 h1:UGKbA/IPjtS6zLcdB7i5TyACMgSbOTiR8qzXgw8HWQU= github.com/golang-jwt/jwt/v5 v5.1.0/go.mod h1:pqrtFR0X4osieyHYxtmOUWsAWrfe1Q5UVIyoH402zdk= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= -github.com/golang/glog v1.1.2 h1:DVjP2PbBOzHyzA+dn3WhHIq4NdVu3Q+pvivFICf/7fo= github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= @@ -120,18 +113,13 @@ github.com/google/go-cmp v0.5.4/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/ github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.6/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.7/go.mod h1:n+brtR0CgQNWTVd5ZUFpTBC8YFBDLK/h/bpaJ8/DtOE= -github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38= +github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/google/uuid v1.3.1 h1:KjJaJ9iWZ3jOFZIf1Lqf4laDRCasjl0BCmnEGxkdLb4= -github.com/google/uuid v1.3.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.4.0 h1:MtMxsa51/r9yyhkyLsVeVt0B+BGQZzpQiTQ4eHZ8bc4= github.com/google/uuid v1.4.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0/go.mod h1:8NvIoxWQoOIhqOTXgfV/d3M/q6VIi02HzZEHgUlZvzk= -github.com/grpc-ecosystem/grpc-gateway v1.16.0 h1:gmcG1KaJ57LophUzW0Hy8NmPhnMZb4M0+kPpLofRdBo= github.com/grpc-ecosystem/grpc-gateway v1.16.0/go.mod h1:BDjrQk3hbvj6Nolgz8mAMFbcEtjT1g+wF4CSlocrBnw= -github.com/grpc-ecosystem/grpc-gateway/v2 v2.18.0 h1:RtRsiaGvWxcwd8y3BiRZxsylPT8hLWZ5SPcfI+3IDNk= -github.com/grpc-ecosystem/grpc-gateway/v2 v2.18.0/go.mod h1:TzP6duP4Py2pHLVPPQp42aoYI92+PCrVotyR5e8Vqlk= github.com/grpc-ecosystem/grpc-gateway/v2 v2.18.1 h1:6UKoz5ujsI55KNpsJH3UwCq3T8kKbZwNZBNPuTTje8U= github.com/grpc-ecosystem/grpc-gateway/v2 v2.18.1/go.mod h1:YvJ2f6MplWDhfxiUC3KpyTy76kYUZA4W3pTv/wdKQ9Y= github.com/hashicorp/consul/api v1.13.0/go.mod h1:ZlVrynguJKcYr54zGaDbaL3fOvKC9m72FhPvA8T35KQ= @@ -181,13 +169,10 @@ github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7V github.com/julienschmidt/httprouter v1.3.0/go.mod h1:JR6WtHb+2LUe8TCKY3cZOxFyyO8IZAc4RVcycCCAKdM= github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8= github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= -github.com/klauspost/compress v1.17.1 h1:NE3C767s2ak2bweCZo3+rdP4U/HoyVXLv/X9f2gPS5g= -github.com/klauspost/compress v1.17.1/go.mod h1:ntbaceVETuRiXiv4DpjP66DpAtAGkEQskQzEyD//IeE= github.com/klauspost/compress v1.17.2 h1:RlWWUY/Dr4fL8qk9YG7DTZ7PDgME2V4csBXA8L/ixi4= github.com/klauspost/compress v1.17.2/go.mod h1:ntbaceVETuRiXiv4DpjP66DpAtAGkEQskQzEyD//IeE= github.com/knadh/koanf v1.5.0 h1:q2TSd/3Pyc/5yP9ldIrSdIz26MCcyNQzW0pEAugLPNs= github.com/knadh/koanf v1.5.0/go.mod h1:Hgyjp4y8v44hpZtPzs7JZfRAW5AhN7KfZcwv1RYggDs= -github.com/knadh/koanf/maps v0.1.1 h1:G5TjmUh2D7G2YWf5SQQqSiHRJEjaicvU0KpypqB3NIs= github.com/knadh/koanf/v2 v2.0.1 h1:1dYGITt1I23x8cfx8ZnldtezdyaZtfAuRtIFOiRzK7g= github.com/knadh/koanf/v2 v2.0.1/go.mod h1:ZeiIlIDXTE7w1lMT6UVcNiRAS2/rCeLn/GdLNvY1Dus= github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= @@ -215,7 +200,6 @@ github.com/mattn/go-isatty v0.0.20/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D github.com/mattn/go-runewidth v0.0.15 h1:UNAjwbU9l54TA3KzvqLGxwWjHmMgBUVhBiTjelZgg3U= github.com/mattn/go-runewidth v0.0.15/go.mod h1:Jdepj2loyihRzMpdS35Xk/zdY8IAYHsh153qUoGf23w= github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= -github.com/matttproud/golang_protobuf_extensions v1.0.4 h1:mmDVorXM7PCGKw94cs5zkfA9PSy5pEvNWRP0ET0TIVo= github.com/matttproud/golang_protobuf_extensions/v2 v2.0.0 h1:jWpvCLoY8Z/e3VKvlsiIGKtc+UG6U5vzxaoagmhXfyg= github.com/matttproud/golang_protobuf_extensions/v2 v2.0.0/go.mod h1:QUyp042oQthUoa9bqDv0ER0wrtXnBruoNd7aNjkbP+k= github.com/miekg/dns v1.1.26/go.mod h1:bPDLeHnStXmXAq1m/Ch/hvfNHr14JKNPMBo3VZKjuso= @@ -322,36 +306,24 @@ github.com/yuin/goldmark v1.3.5/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1 go.etcd.io/etcd/api/v3 v3.5.4/go.mod h1:5GB2vv4A4AOn3yk7MftYGHkUfGtDHnEraIjym4dYz5A= go.etcd.io/etcd/client/pkg/v3 v3.5.4/go.mod h1:IJHfcCEKxYu1Os13ZdwCwIUTUVGYTSAM3YSwc9/Ac1g= go.etcd.io/etcd/client/v3 v3.5.4/go.mod h1:ZaRkVgBZC+L+dLCjTcF1hRXpgZXQPOvnA/Ak/gq3kiY= -go.opentelemetry.io/otel v1.19.0 h1:MuS/TNf4/j4IXsZuJegVzI1cwut7Qc00344rgH7p8bs= -go.opentelemetry.io/otel v1.19.0/go.mod h1:i0QyjOq3UPoTzff0PJB2N66fb4S0+rSbSB15/oyH9fY= -go.opentelemetry.io/otel v1.20.0 h1:vsb/ggIY+hUjD/zCAQHpzTmndPqv/ml2ArbsbfBYTAc= -go.opentelemetry.io/otel v1.20.0/go.mod h1:oUIGj3D77RwJdM6PPZImDpSZGDvkD9fhesHny69JFrs= -go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.19.0 h1:Mne5On7VWdx7omSrSSZvM4Kw7cS7NQkOOmLcgscI51U= -go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.19.0/go.mod h1:IPtUMKL4O3tH5y+iXVyAXqpAwMuzC1IrxVS81rummfE= +go.opentelemetry.io/otel v1.21.0 h1:hzLeKBZEL7Okw2mGzZ0cc4k/A7Fta0uoPgaJCr8fsFc= +go.opentelemetry.io/otel v1.21.0/go.mod h1:QZzNPQPm1zLX4gZK4cMi+71eaorMSGT3A4znnUvNNEo= go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.20.0 h1:DeFD0VgTZ+Cj6hxravYYZE2W4GlneVH81iAOPjZkzk8= go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.20.0/go.mod h1:GijYcYmNpX1KazD5JmWGsi4P7dDTTTnfv1UbGn84MnU= -go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.19.0 h1:3d+S281UTjM+AbF31XSOYn1qXn3BgIdWl8HNEpx08Jk= -go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.19.0/go.mod h1:0+KuTDyKL4gjKCF75pHOX4wuzYDUZYfAQdSu43o+Z2I= go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.20.0 h1:gvmNvqrPYovvyRmCSygkUDyL8lC5Tl845MLEwqpxhEU= go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.20.0/go.mod h1:vNUq47TGFioo+ffTSnKNdob241vePmtNZnAODKapKd0= -go.opentelemetry.io/otel/metric v1.19.0 h1:aTzpGtV0ar9wlV4Sna9sdJyII5jTVJEvKETPiOKwvpE= -go.opentelemetry.io/otel/metric v1.19.0/go.mod h1:L5rUsV9kM1IxCj1MmSdS+JQAcVm319EUrDVLrt7jqt8= -go.opentelemetry.io/otel/metric v1.20.0 h1:ZlrO8Hu9+GAhnepmRGhSU7/VkpjrNowxRN9GyKR4wzA= -go.opentelemetry.io/otel/metric v1.20.0/go.mod h1:90DRw3nfK4D7Sm/75yQ00gTJxtkBxX+wu6YaNymbpVM= -go.opentelemetry.io/otel/sdk v1.19.0 h1:6USY6zH+L8uMH8L3t1enZPR3WFEmSTADlqldyHtJi3o= -go.opentelemetry.io/otel/sdk v1.19.0/go.mod h1:NedEbbS4w3C6zElbLdPJKOpJQOrGUJ+GfzpjUvI0v1A= +go.opentelemetry.io/otel/metric v1.21.0 h1:tlYWfeo+Bocx5kLEloTjbcDwBuELRrIFxwdQ36PlJu4= +go.opentelemetry.io/otel/metric v1.21.0/go.mod h1:o1p3CA8nNHW8j5yuQLdc1eeqEaPfzug24uvsyIEJRWM= go.opentelemetry.io/otel/sdk v1.20.0 h1:5Jf6imeFZlZtKv9Qbo6qt2ZkmWtdWx/wzcCbNUlAWGM= go.opentelemetry.io/otel/sdk v1.20.0/go.mod h1:rmkSx1cZCm/tn16iWDn1GQbLtsW/LvsdEEFzCSRM6V0= -go.opentelemetry.io/otel/trace v1.19.0 h1:DFVQmlVbfVeOuBRrwdtaehRrWiL1JoVs9CPIQ1Dzxpg= -go.opentelemetry.io/otel/trace v1.19.0/go.mod h1:mfaSyvGyEJEI0nyV2I4qhNQnbBOUUmYZpYojqMnX2vo= -go.opentelemetry.io/otel/trace v1.20.0 h1:+yxVAPZPbQhbC3OfAkeIVTky6iTFpcr4SiY9om7mXSQ= -go.opentelemetry.io/otel/trace v1.20.0/go.mod h1:HJSK7F/hA5RlzpZ0zKDCHCDHm556LCDtKaAo6JmBFUU= +go.opentelemetry.io/otel/trace v1.21.0 h1:WD9i5gzvoUPuXIXH24ZNBudiarZDKuekPqi/E8fpfLc= +go.opentelemetry.io/otel/trace v1.21.0/go.mod h1:LGbsEB0f9LGjN+OZaQQ26sohbOmiMR+BaslueVtS/qQ= go.opentelemetry.io/proto/otlp v1.0.0 h1:T0TX0tmXU8a3CbNXzEKGeU5mIVOdf0oykP+u2lIVU/I= go.opentelemetry.io/proto/otlp v1.0.0/go.mod h1:Sy6pihPLfYHkr3NkUbEhGHFhINUSI/v80hjKIs5JXpM= go.uber.org/atomic v1.7.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc= go.uber.org/automaxprocs v1.5.3 h1:kWazyxZUrS3Gs4qUpbwo5kEIMGe/DAvi5Z4tl2NW4j8= go.uber.org/automaxprocs v1.5.3/go.mod h1:eRbA25aqJrxAbsLO0xy5jVwPt7FQnRgjW+efnwa1WM0= -go.uber.org/goleak v1.2.1 h1:NBol2c7O1ZokfZ0LEU9K6Whx/KnwvepVetCUhtKja4A= +go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto= go.uber.org/multierr v1.6.0/go.mod h1:cdWPpRnG4AhwMwsgIHip0KRBQjJy5kYEpYjJxpXp9iU= go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0= go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y= @@ -389,8 +361,6 @@ golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwY golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM= golang.org/x/net v0.0.0-20210410081132-afb366fc7cd1/go.mod h1:9tjilg8BloeKEkVJvy7fQ90B1CfIiPueXVOjqfkSzI8= -golang.org/x/net v0.17.0 h1:pVaXccu2ozPjCXewfr1S7xza/zcXTity9cCdXQYSjIM= -golang.org/x/net v0.17.0/go.mod h1:NxSsAGuq816PNPmqtQdLE42eU2Fs7NoRIZrHJAlaCOE= golang.org/x/net v0.18.0 h1:mIYleuAkSbHh0tCv7RvjL3F6ZVbLjq4+R7zbOn3Kokg= golang.org/x/net v0.18.0/go.mod h1:/czyP5RqHAH4odGYxBJ1qz0+CE5WZ+2j1YgoEo8F2jQ= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= @@ -436,10 +406,7 @@ golang.org/x/sys v0.0.0-20210403161142-5e06dd20ab57/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210603081109-ebe580a85c40/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220908164124-27713097b956/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.13.0 h1:Af8nKPmuFypiUBjVoU9V20FiaFXOcuZI21p0ycVYYGE= -golang.org/x/sys v0.13.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.14.0 h1:Vz7Qs629MkJkGyHxUlRHizWJRG2j8fbQKjELVSNhy7Q= golang.org/x/sys v0.14.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= @@ -449,8 +416,6 @@ golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/text v0.13.0 h1:ablQoSUd0tRdKxZewP80B+BaqeKJuVhuRxj/dkrun3k= -golang.org/x/text v0.13.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE= golang.org/x/text v0.14.0 h1:ScX5w1eTa3QqT8oi6+ziP7dTV1S2+ALU0bI+0zXKWiQ= golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= @@ -477,13 +442,9 @@ google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98 google.golang.org/genproto v0.0.0-20200513103714-09dca8ec2884/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo= google.golang.org/genproto v0.0.0-20210602131652-f16073e35f0c/go.mod h1:UODoCrxHCcBojKKwX1terBiRUaqAsFqJiF615XL43r0= -google.golang.org/genproto v0.0.0-20231012201019-e917dd12ba7a h1:fwgW9j3vHirt4ObdHoYNwuO24BEZjSzbh+zPaNWoiY8= -google.golang.org/genproto/googleapis/api v0.0.0-20231016165738-49dd2c1f3d0b h1:CIC2YMXmIhYw6evmhPxBKJ4fmLbOFtXQN/GV3XOZR8k= -google.golang.org/genproto/googleapis/api v0.0.0-20231016165738-49dd2c1f3d0b/go.mod h1:IBQ646DjkDkvUIsVq/cc03FUFQ9wbZu7yE396YcL870= +google.golang.org/genproto v0.0.0-20231030173426-d783a09b4405 h1:I6WNifs6pF9tNdSob2W24JtyxIYjzFB9qDlpUC76q+U= google.golang.org/genproto/googleapis/api v0.0.0-20231106174013-bbf56f31fb17 h1:JpwMPBpFN3uKhdaekDpiNlImDdkUAyiJ6ez/uxGaUSo= google.golang.org/genproto/googleapis/api v0.0.0-20231106174013-bbf56f31fb17/go.mod h1:0xJLfVdJqpAPl8tDg1ujOCGzx6LFLttXT5NhllGOXY4= -google.golang.org/genproto/googleapis/rpc v0.0.0-20231016165738-49dd2c1f3d0b h1:ZlWIi1wSK56/8hn4QcBp/j9M7Gt3U/3hZw3mC7vDICo= -google.golang.org/genproto/googleapis/rpc v0.0.0-20231016165738-49dd2c1f3d0b/go.mod h1:swOH3j0KzcDDgGUWr+SNpyTen5YrXjS3eyPzFYKc6lc= google.golang.org/genproto/googleapis/rpc v0.0.0-20231106174013-bbf56f31fb17 h1:Jyp0Hsi0bmHXG6k9eATXoYtjd6e2UzZ1SCn/wIupY14= google.golang.org/genproto/googleapis/rpc v0.0.0-20231106174013-bbf56f31fb17/go.mod h1:oQ5rr10WTTMvP4A36n8JpR1OrO1BEiV4f78CneXZxkA= google.golang.org/grpc v1.14.0/go.mod h1:yo6s7OP7yaDglbqo1J04qKzAhqBH6lvTonzMVmEdcZw= From 810922ecd0bb045db6ebbdcb408a6e9456549c3c Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 20 Nov 2023 01:24:38 +0000 Subject: [PATCH 519/660] chore(deps): bump github.com/gofiber/fiber/v2 from 2.50.0 to 2.51.0 Bumps [github.com/gofiber/fiber/v2](https://github.com/gofiber/fiber) from 2.50.0 to 2.51.0. - [Release notes](https://github.com/gofiber/fiber/releases) - [Commits](https://github.com/gofiber/fiber/compare/v2.50.0...v2.51.0) --- updated-dependencies: - dependency-name: github.com/gofiber/fiber/v2 dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index 6f727353..ea9f6294 100644 --- a/go.mod +++ b/go.mod @@ -5,7 +5,7 @@ go 1.19 require ( github.com/ansrivas/fiberprometheus/v2 v2.6.1 github.com/gofiber/contrib/fiberzap v1.0.2 - github.com/gofiber/fiber/v2 v2.50.0 + github.com/gofiber/fiber/v2 v2.51.0 github.com/golang-jwt/jwt/v5 v5.1.0 github.com/knadh/koanf v1.5.0 github.com/knadh/koanf/v2 v2.0.1 diff --git a/go.sum b/go.sum index 0055cce4..ca7b65ec 100644 --- a/go.sum +++ b/go.sum @@ -78,8 +78,8 @@ github.com/gofiber/adaptor/v2 v2.2.1 h1:givE7iViQWlsTR4Jh7tB4iXzrlKBgiraB/yTdHs9 github.com/gofiber/adaptor/v2 v2.2.1/go.mod h1:AhR16dEqs25W2FY/l8gSj1b51Azg5dtPDmm+pruNOrc= github.com/gofiber/contrib/fiberzap v1.0.2 h1:EQwhggtszVfIdBeXxN9Xrmld71es34Ufs+ef8VMqZxc= github.com/gofiber/contrib/fiberzap v1.0.2/go.mod h1:jGO8BHU4gRI9U0JtM6zj2CIhYfgVmW5JxziN8NTgVwE= -github.com/gofiber/fiber/v2 v2.50.0 h1:ia0JaB+uw3GpNSCR5nvC5dsaxXjRU5OEu36aytx+zGw= -github.com/gofiber/fiber/v2 v2.50.0/go.mod h1:21eytvay9Is7S6z+OgPi7c7n4++tnClWmhpimVHMimw= +github.com/gofiber/fiber/v2 v2.51.0 h1:JNACcZy5e2tGApWB2QrRpenTWn0fq0hkFm6k0C86gKQ= +github.com/gofiber/fiber/v2 v2.51.0/go.mod h1:xaQRZQJGqnKOQnbQw+ltvku3/h8QxvNi8o6JiJ7Ll0U= github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q= github.com/golang-jwt/jwt/v5 v5.1.0 h1:UGKbA/IPjtS6zLcdB7i5TyACMgSbOTiR8qzXgw8HWQU= From 924c8f5fc15b8de0add334b9a7620f17e8396968 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 20 Nov 2023 01:25:05 +0000 Subject: [PATCH 520/660] chore(deps): bump go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc Bumps [go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc](https://github.com/open-telemetry/opentelemetry-go) from 1.20.0 to 1.21.0. - [Release notes](https://github.com/open-telemetry/opentelemetry-go/releases) - [Changelog](https://github.com/open-telemetry/opentelemetry-go/blob/main/CHANGELOG.md) - [Commits](https://github.com/open-telemetry/opentelemetry-go/compare/v1.20.0...v1.21.0) --- updated-dependencies: - dependency-name: go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- go.mod | 6 +++--- go.sum | 12 ++++++------ 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/go.mod b/go.mod index 6f727353..0f3c0c16 100644 --- a/go.mod +++ b/go.mod @@ -14,8 +14,8 @@ require ( github.com/stretchr/testify v1.8.4 github.com/tidwall/pretty v1.2.1 go.opentelemetry.io/otel v1.21.0 - go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.20.0 - go.opentelemetry.io/otel/sdk v1.20.0 + go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.21.0 + go.opentelemetry.io/otel/sdk v1.21.0 go.opentelemetry.io/otel/trace v1.21.0 go.uber.org/automaxprocs v1.5.3 go.uber.org/zap v1.26.0 @@ -54,7 +54,7 @@ require ( github.com/valyala/bytebufferpool v1.0.0 // indirect github.com/valyala/fasthttp v1.50.0 // indirect github.com/valyala/tcplisten v1.0.0 // indirect - go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.20.0 // indirect + go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.21.0 // indirect go.opentelemetry.io/otel/metric v1.21.0 // indirect go.opentelemetry.io/proto/otlp v1.0.0 // indirect go.uber.org/multierr v1.11.0 // indirect diff --git a/go.sum b/go.sum index 0055cce4..824a5f22 100644 --- a/go.sum +++ b/go.sum @@ -308,14 +308,14 @@ go.etcd.io/etcd/client/pkg/v3 v3.5.4/go.mod h1:IJHfcCEKxYu1Os13ZdwCwIUTUVGYTSAM3 go.etcd.io/etcd/client/v3 v3.5.4/go.mod h1:ZaRkVgBZC+L+dLCjTcF1hRXpgZXQPOvnA/Ak/gq3kiY= go.opentelemetry.io/otel v1.21.0 h1:hzLeKBZEL7Okw2mGzZ0cc4k/A7Fta0uoPgaJCr8fsFc= go.opentelemetry.io/otel v1.21.0/go.mod h1:QZzNPQPm1zLX4gZK4cMi+71eaorMSGT3A4znnUvNNEo= -go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.20.0 h1:DeFD0VgTZ+Cj6hxravYYZE2W4GlneVH81iAOPjZkzk8= -go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.20.0/go.mod h1:GijYcYmNpX1KazD5JmWGsi4P7dDTTTnfv1UbGn84MnU= -go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.20.0 h1:gvmNvqrPYovvyRmCSygkUDyL8lC5Tl845MLEwqpxhEU= -go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.20.0/go.mod h1:vNUq47TGFioo+ffTSnKNdob241vePmtNZnAODKapKd0= +go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.21.0 h1:cl5P5/GIfFh4t6xyruOgJP5QiA1pw4fYYdv6nc6CBWw= +go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.21.0/go.mod h1:zgBdWWAu7oEEMC06MMKc5NLbA/1YDXV1sMpSqEeLQLg= +go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.21.0 h1:tIqheXEFWAZ7O8A7m+J0aPTmpJN3YQ7qetUAdkkkKpk= +go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.21.0/go.mod h1:nUeKExfxAQVbiVFn32YXpXZZHZ61Cc3s3Rn1pDBGAb0= go.opentelemetry.io/otel/metric v1.21.0 h1:tlYWfeo+Bocx5kLEloTjbcDwBuELRrIFxwdQ36PlJu4= go.opentelemetry.io/otel/metric v1.21.0/go.mod h1:o1p3CA8nNHW8j5yuQLdc1eeqEaPfzug24uvsyIEJRWM= -go.opentelemetry.io/otel/sdk v1.20.0 h1:5Jf6imeFZlZtKv9Qbo6qt2ZkmWtdWx/wzcCbNUlAWGM= -go.opentelemetry.io/otel/sdk v1.20.0/go.mod h1:rmkSx1cZCm/tn16iWDn1GQbLtsW/LvsdEEFzCSRM6V0= +go.opentelemetry.io/otel/sdk v1.21.0 h1:FTt8qirL1EysG6sTQRZ5TokkU8d0ugCj8htOgThZXQ8= +go.opentelemetry.io/otel/sdk v1.21.0/go.mod h1:Nna6Yv7PWTdgJHVRD9hIYywQBRx7pbox6nwBnZIxl/E= go.opentelemetry.io/otel/trace v1.21.0 h1:WD9i5gzvoUPuXIXH24ZNBudiarZDKuekPqi/E8fpfLc= go.opentelemetry.io/otel/trace v1.21.0/go.mod h1:LGbsEB0f9LGjN+OZaQQ26sohbOmiMR+BaslueVtS/qQ= go.opentelemetry.io/proto/otlp v1.0.0 h1:T0TX0tmXU8a3CbNXzEKGeU5mIVOdf0oykP+u2lIVU/I= From 987ccfbb919dffa1747f7364b1a4f3bef2224d6b Mon Sep 17 00:00:00 2001 From: Parham Alvani Date: Sat, 25 Nov 2023 19:58:33 +0000 Subject: [PATCH 521/660] Update README.md --- README.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index e4e7ef2d..3e598785 100644 --- a/README.md +++ b/README.md @@ -112,9 +112,11 @@ This component only works for passenger and driver issuers. ### Keys -This is a map of issuer to key for opening JWT token. +The following is a mapping that associates vendors (companies) with the keys used for opening JWT tokens. +If symmetrical keys are utilized, it is important to use their base64 representation. +It should also be noted that Soteria only requires public keys in cases where asymmetrical keys are employed. -#### IssEntityMap & IssPeerMap +### IssEntityMap & IssPeerMap These two configuration map iss to entity and peer respectively. From b40d5efa6a0ab241b863a24a1ed384ac6c253f6c Mon Sep 17 00:00:00 2001 From: Parham Alvani Date: Thu, 30 Nov 2023 14:27:08 +0000 Subject: [PATCH 522/660] feat: update new version of APIs to be more emqx compatible --- internal/api/acl.go | 13 +++++++------ internal/api/auth.go | 5 +++-- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/internal/api/acl.go b/internal/api/acl.go index dd081572..b3b68708 100644 --- a/internal/api/acl.go +++ b/internal/api/acl.go @@ -106,8 +106,8 @@ func (a API) ACLv1(c *fiber.Ctx) error { return c.Status(http.StatusOK).SendString("ok") } -// aclRequest is the body payload structure of the ACL endpoint. -type aclv2Request struct { +// ACLv2Request is the body payload structure of the ACL endpoint. +type ACLv2Request struct { Token string `json:"token"` Username string `json:"username"` Password string `json:"password"` @@ -115,13 +115,14 @@ type aclv2Request struct { Action string `json:"action"` } -// ACL is the handler responsible for ACL requests. +// ACLv2 is the handler responsible for ACL requests coming from EMQv5. +// https://www.emqx.io/docs/en/latest/access-control/authz/http.html // nolint: wrapcheck, funlen func (a API) ACLv2(c *fiber.Ctx) error { _, span := a.Tracer.Start(c.Context(), "api.v2.acl") defer span.End() - request := new(aclv2Request) + request := new(ACLv2Request) if err := c.BodyParser(request); err != nil { a.Logger. Warn("acl bad request", @@ -133,7 +134,7 @@ func (a API) ACLv2(c *fiber.Ctx) error { zap.String("password", request.Password), ) - return c.Status(http.StatusBadRequest).JSON(ACLResponse{ + return c.Status(http.StatusOK).JSON(ACLResponse{ Result: "deny", }) } @@ -191,7 +192,7 @@ func (a API) ACLv2(c *fiber.Ctx) error { zap.String("authenticator", auth.GetCompany())) } - return c.Status(http.StatusUnauthorized).JSON(ACLResponse{ + return c.Status(http.StatusOK).JSON(ACLResponse{ Result: "deny", }) } diff --git a/internal/api/auth.go b/internal/api/auth.go index a6e35bfb..2c9f44bd 100644 --- a/internal/api/auth.go +++ b/internal/api/auth.go @@ -82,6 +82,7 @@ func (a API) Authv1(c *fiber.Ctx) error { // Auth is the handler responsible for authentication. // Endpoint will be used by EMQ version 5 which supports JSON on both request and response. +// https://www.emqx.io/docs/en/latest/access-control/authn/http.html // nolint: wrapcheck, funlen func (a API) Authv2(c *fiber.Ctx) error { _, span := a.Tracer.Start(c.Context(), "api.v2.auth") @@ -97,7 +98,7 @@ func (a API) Authv2(c *fiber.Ctx) error { zap.Error(err), ) - return c.Status(http.StatusBadRequest).JSON(AuthResponse{ + return c.Status(http.StatusOK).JSON(AuthResponse{ Result: "deny", IsSuperuser: false, }) @@ -128,7 +129,7 @@ func (a API) Authv2(c *fiber.Ctx) error { ) } - return c.Status(http.StatusUnauthorized).JSON(AuthResponse{ + return c.Status(http.StatusOK).JSON(AuthResponse{ Result: "deny", IsSuperuser: false, }) From cbf79b68d8200defdfa6795517f0d31954185ade Mon Sep 17 00:00:00 2001 From: Parham Alvani Date: Thu, 30 Nov 2023 15:28:05 +0000 Subject: [PATCH 523/660] feat: add new tests --- internal/authenticator/builder.go | 3 +- .../authenticator/builder_internal_test.go | 46 +++++++++++++++++++ 2 files changed, 47 insertions(+), 2 deletions(-) create mode 100644 internal/authenticator/builder_internal_test.go diff --git a/internal/authenticator/builder.go b/internal/authenticator/builder.go index 4735c5f0..6b548106 100644 --- a/internal/authenticator/builder.go +++ b/internal/authenticator/builder.go @@ -113,7 +113,6 @@ func (b Builder) GetAllowedAccessTypes(accessTypes []string) []acl.AccessType { } // toUserAccessType will convert string access type to it's own type. -// nolint: goerr113 func toUserAccessType(access string) (acl.AccessType, error) { switch access { case "pub": @@ -124,7 +123,7 @@ func toUserAccessType(access string) (acl.AccessType, error) { return acl.PubSub, nil } - return "", fmt.Errorf("%v is a invalid acces type", access) + return "", ErrInvalidAccessType } func (b Builder) ValidateMappers(issEntityMap, issPeerMap map[string]string) { diff --git a/internal/authenticator/builder_internal_test.go b/internal/authenticator/builder_internal_test.go new file mode 100644 index 00000000..5617cc14 --- /dev/null +++ b/internal/authenticator/builder_internal_test.go @@ -0,0 +1,46 @@ +package authenticator + +import ( + "testing" + + "github.com/snapp-incubator/soteria/pkg/acl" + "github.com/stretchr/testify/require" +) + +func TestToUserAccessType(t *testing.T) { + t.Parallel() + + require := require.New(t) + + cases := []struct { + name string + input string + expected acl.AccessType + expectedErr error + }{ + { + name: "success", + input: "pub", + expected: acl.Pub, + expectedErr: nil, + }, + { + name: "failed", + input: "-", + expected: "", + expectedErr: ErrInvalidAccessType, + }, + } + + for _, c := range cases { + c := c + + t.Run(c.name, func(t *testing.T) { + t.Parallel() + + v, err := toUserAccessType(c.input) + require.ErrorIs(c.expectedErr, err) + require.Equal(c.expected, v) + }) + } +} From 67947fcd4046bd1329b69537bea9e9edf3ff90c5 Mon Sep 17 00:00:00 2001 From: Parham Alvani Date: Thu, 30 Nov 2023 15:37:31 +0000 Subject: [PATCH 524/660] feat: increase test coverage --- internal/authenticator/builder.go | 6 ++-- .../authenticator/builder_internal_test.go | 30 +++++++++++++++++++ 2 files changed, 33 insertions(+), 3 deletions(-) diff --git a/internal/authenticator/builder.go b/internal/authenticator/builder.go index 6b548106..aca5406f 100644 --- a/internal/authenticator/builder.go +++ b/internal/authenticator/builder.go @@ -115,11 +115,11 @@ func (b Builder) GetAllowedAccessTypes(accessTypes []string) []acl.AccessType { // toUserAccessType will convert string access type to it's own type. func toUserAccessType(access string) (acl.AccessType, error) { switch access { - case "pub": + case "pub", "publish": return acl.Pub, nil - case "sub": + case "sub", "subscribe": return acl.Sub, nil - case "pubsub": + case "pubsub", "subpub": return acl.PubSub, nil } diff --git a/internal/authenticator/builder_internal_test.go b/internal/authenticator/builder_internal_test.go index 5617cc14..ac5a0aea 100644 --- a/internal/authenticator/builder_internal_test.go +++ b/internal/authenticator/builder_internal_test.go @@ -24,6 +24,36 @@ func TestToUserAccessType(t *testing.T) { expected: acl.Pub, expectedErr: nil, }, + { + name: "success", + input: "publish", + expected: acl.Pub, + expectedErr: nil, + }, + { + name: "success", + input: "sub", + expected: acl.Sub, + expectedErr: nil, + }, + { + name: "success", + input: "subscribe", + expected: acl.Sub, + expectedErr: nil, + }, + { + name: "success", + input: "pubsub", + expected: acl.PubSub, + expectedErr: nil, + }, + { + name: "success", + input: "subpub", + expected: acl.PubSub, + expectedErr: nil, + }, { name: "failed", input: "-", From 5caf2ae23c84d46c7129352eb61d8e40c0da5237 Mon Sep 17 00:00:00 2001 From: Parham Alvani Date: Thu, 30 Nov 2023 15:41:15 +0000 Subject: [PATCH 525/660] fix: correct lint issues --- internal/authenticator/builder_internal_test.go | 1 + 1 file changed, 1 insertion(+) diff --git a/internal/authenticator/builder_internal_test.go b/internal/authenticator/builder_internal_test.go index ac5a0aea..c86840e3 100644 --- a/internal/authenticator/builder_internal_test.go +++ b/internal/authenticator/builder_internal_test.go @@ -7,6 +7,7 @@ import ( "github.com/stretchr/testify/require" ) +// nolint: funlen func TestToUserAccessType(t *testing.T) { t.Parallel() From 4b21b0cd34a27d73c6b2f9eb4def354fad5c1cec Mon Sep 17 00:00:00 2001 From: Parham Alvani Date: Thu, 30 Nov 2023 19:59:02 +0000 Subject: [PATCH 526/660] feat: improve the builder pattern and increase coverage --- internal/authenticator/builder.go | 177 ++++++++++++++++--------- internal/authenticator/builder_test.go | 49 +++++++ internal/cmd/root.go | 4 +- internal/cmd/serve/main.go | 22 +-- 4 files changed, 177 insertions(+), 75 deletions(-) create mode 100644 internal/authenticator/builder_test.go diff --git a/internal/authenticator/builder.go b/internal/authenticator/builder.go index aca5406f..9f81da69 100644 --- a/internal/authenticator/builder.go +++ b/internal/authenticator/builder.go @@ -1,6 +1,7 @@ package authenticator import ( + "errors" "fmt" "github.com/golang-jwt/jwt/v5" @@ -11,77 +12,43 @@ import ( "go.uber.org/zap" ) +var ( + ErrAdminAuthenticatorSystemKey = errors.New("admin authenticator supports only one key named system") + ErrNoAuthenticator = errors.New("at least one vendor should be enable to have soteria") + ErrNoDefaultCaseIssEntry = errors.New("default case for iss-entity map is required") + ErrNoDefaultCaseIssPeer = errors.New("default case for iss-peer map is required") +) + type Builder struct { Vendors []config.Vendor - Logger zap.Logger + Logger *zap.Logger ValidatorConfig config.Validator } -// nolint: funlen -func (b Builder) Authenticators() map[string]Authenticator { +func (b Builder) Authenticators() (map[string]Authenticator, error) { all := make(map[string]Authenticator) for _, vendor := range b.Vendors { - b.ValidateMappers(vendor.IssEntityMap, vendor.IssPeerMap) - - allowedAccessTypes := b.GetAllowedAccessTypes(vendor.AllowedAccessTypes) - - hid, err := topics.NewHashIDManager(vendor.HashIDMap) - if err != nil { - b.Logger.Fatal("cannot create hash-id manager", zap.Error(err)) - } - - var auth Authenticator + var ( + auth Authenticator + err error + ) switch { case vendor.UseValidator: - client := validator.New(b.ValidatorConfig.URL, b.ValidatorConfig.Timeout) - - auth = &AutoAuthenticator{ - AllowedAccessTypes: allowedAccessTypes, - Company: vendor.Company, - TopicManager: topics.NewTopicManager( - vendor.Topics, - hid, - vendor.Company, - vendor.IssEntityMap, - vendor.IssPeerMap, - b.Logger.Named("topic-manager"), - ), - JwtConfig: vendor.Jwt, - Validator: client, - Parser: jwt.NewParser(), + auth, err = b.autoAuthenticator(vendor) + if err != nil { + return nil, fmt.Errorf("cannot build auto authenticator %w", err) } case vendor.IsInternal: - if _, ok := vendor.Keys["system"]; !ok || len(vendor.Keys) != 1 { - b.Logger.Fatal("admin authenticator supports only one key named system") - } - - keys := b.GenerateKeys(vendor.Jwt.SigningMethod, vendor.Keys) - - auth = &AdminAuthenticator{ - Key: keys["system"], - Company: vendor.Company, - JwtConfig: vendor.Jwt, - Parser: jwt.NewParser(), + auth, err = b.adminAuthenticator(vendor) + if err != nil { + return nil, fmt.Errorf("cannot build admin authenticator %w", err) } default: - keys := b.GenerateKeys(vendor.Jwt.SigningMethod, vendor.Keys) - - auth = &ManualAuthenticator{ - Keys: keys, - AllowedAccessTypes: allowedAccessTypes, - Company: vendor.Company, - TopicManager: topics.NewTopicManager( - vendor.Topics, - hid, - vendor.Company, - vendor.IssEntityMap, - vendor.IssPeerMap, - b.Logger.Named("topic-manager"), - ), - JwtConfig: vendor.Jwt, - Parser: jwt.NewParser(jwt.WithValidMethods([]string{vendor.Jwt.SigningMethod})), + auth, err = b.manualAuthenticator(vendor) + if err != nil { + return nil, fmt.Errorf("cannot build manual authenticator %w", err) } } @@ -89,27 +56,105 @@ func (b Builder) Authenticators() map[string]Authenticator { } if len(all) == 0 { - b.Logger.Fatal("at least one vendor should be enable to have soteria") + return nil, ErrNoAuthenticator + } + + return all, nil +} + +func (b Builder) adminAuthenticator(vendor config.Vendor) (*AdminAuthenticator, error) { + if _, ok := vendor.Keys["system"]; !ok || len(vendor.Keys) != 1 { + return nil, ErrAdminAuthenticatorSystemKey + } + + keys := b.GenerateKeys(vendor.Jwt.SigningMethod, vendor.Keys) + + return &AdminAuthenticator{ + Key: keys["system"], + Company: vendor.Company, + JwtConfig: vendor.Jwt, + Parser: jwt.NewParser(), + }, nil +} + +func (b Builder) manualAuthenticator(vendor config.Vendor) (*ManualAuthenticator, error) { + if err := b.ValidateMappers(vendor.IssEntityMap, vendor.IssPeerMap); err != nil { + return nil, fmt.Errorf("failed to validate mappers %w", err) + } + + allowedAccessTypes, err := b.GetAllowedAccessTypes(vendor.AllowedAccessTypes) + if err != nil { + return nil, fmt.Errorf("cannot parse allowed access types %w", err) + } + + hid, err := topics.NewHashIDManager(vendor.HashIDMap) + if err != nil { + return nil, fmt.Errorf("cannot create hash-id manager %w", err) } - return all + keys := b.GenerateKeys(vendor.Jwt.SigningMethod, vendor.Keys) + + return &ManualAuthenticator{ + Keys: keys, + AllowedAccessTypes: allowedAccessTypes, + Company: vendor.Company, + TopicManager: topics.NewTopicManager( + vendor.Topics, + hid, + vendor.Company, + vendor.IssEntityMap, + vendor.IssPeerMap, + b.Logger.Named("topic-manager"), + ), + JwtConfig: vendor.Jwt, + Parser: jwt.NewParser(jwt.WithValidMethods([]string{vendor.Jwt.SigningMethod})), + }, nil +} + +func (b Builder) autoAuthenticator(vendor config.Vendor) (*AutoAuthenticator, error) { + allowedAccessTypes, err := b.GetAllowedAccessTypes(vendor.AllowedAccessTypes) + if err != nil { + return nil, fmt.Errorf("cannot parse allowed access types %w", err) + } + + hid, err := topics.NewHashIDManager(vendor.HashIDMap) + if err != nil { + return nil, fmt.Errorf("cannot create hash-id manager %w", err) + } + + client := validator.New(b.ValidatorConfig.URL, b.ValidatorConfig.Timeout) + + return &AutoAuthenticator{ + AllowedAccessTypes: allowedAccessTypes, + Company: vendor.Company, + TopicManager: topics.NewTopicManager( + vendor.Topics, + hid, + vendor.Company, + vendor.IssEntityMap, + vendor.IssPeerMap, + b.Logger.Named("topic-manager"), + ), + JwtConfig: vendor.Jwt, + Validator: client, + Parser: jwt.NewParser(), + }, nil } // GetAllowedAccessTypes will return all allowed access types in Soteria. -func (b Builder) GetAllowedAccessTypes(accessTypes []string) []acl.AccessType { +func (b Builder) GetAllowedAccessTypes(accessTypes []string) ([]acl.AccessType, error) { allowedAccessTypes := make([]acl.AccessType, 0, len(accessTypes)) for _, a := range accessTypes { at, err := toUserAccessType(a) if err != nil { - err = fmt.Errorf("could not convert %s: %w", at, err) - b.Logger.Fatal("error while getting allowed access types", zap.Error(err)) + return nil, fmt.Errorf("could not convert %s: %w", at, err) } allowedAccessTypes = append(allowedAccessTypes, at) } - return allowedAccessTypes + return allowedAccessTypes, nil } // toUserAccessType will convert string access type to it's own type. @@ -126,12 +171,14 @@ func toUserAccessType(access string) (acl.AccessType, error) { return "", ErrInvalidAccessType } -func (b Builder) ValidateMappers(issEntityMap, issPeerMap map[string]string) { +func (b Builder) ValidateMappers(issEntityMap, issPeerMap map[string]string) error { if _, ok := issEntityMap[topics.Default]; !ok { - b.Logger.Fatal("default case for iss-entity map is required") + return ErrNoDefaultCaseIssEntry } if _, ok := issPeerMap[topics.Default]; !ok { - b.Logger.Fatal("default case for iss-peer map is required") + return ErrNoDefaultCaseIssPeer } + + return nil } diff --git a/internal/authenticator/builder_test.go b/internal/authenticator/builder_test.go new file mode 100644 index 00000000..1d377d5c --- /dev/null +++ b/internal/authenticator/builder_test.go @@ -0,0 +1,49 @@ +package authenticator_test + +import ( + "testing" + + "github.com/snapp-incubator/soteria/internal/authenticator" + "github.com/snapp-incubator/soteria/internal/config" + "github.com/stretchr/testify/require" + "go.uber.org/zap" +) + +func TestBuilderInternalAuthenticator(t *testing.T) { + t.Parallel() + + require := require.New(t) + + b := authenticator.Builder{ + Vendors: []config.Vendor{ + { + Company: "internal", + Jwt: config.Jwt{ + IssName: "iss", + SubName: "sub", + SigningMethod: "HS512", + }, + IsInternal: true, + UseValidator: false, + AllowedAccessTypes: nil, + Topics: nil, + HashIDMap: nil, + IssEntityMap: nil, + IssPeerMap: nil, + Keys: map[string]string{ + "system": "c2VjcmV0", + }, + }, + }, + Logger: zap.NewNop(), + ValidatorConfig: config.Validator{ + URL: "", + Timeout: 0, + }, + } + + vendors, err := b.Authenticators() + require.NoError(err) + require.Len(vendors, 1) + require.Contains(vendors, "internal") +} diff --git a/internal/cmd/root.go b/internal/cmd/root.go index adb76168..f7eb3564 100644 --- a/internal/cmd/root.go +++ b/internal/cmd/root.go @@ -28,14 +28,14 @@ func Execute() { Use: "soteria", Short: "Soteria is the authentication service.", Long: `Soteria is responsible for Authentication and Authorization of every request witch send to EMQ Server.`, - Run: func(cmd *cobra.Command, args []string) { + Run: func(cmd *cobra.Command, _ []string) { cmd.Println("Run `soteria serve` to start serving requests") }, } serve.Serve{ Cfg: cfg, - Logger: *logger.Named("serve"), + Logger: logger.Named("serve"), Tracer: tracer, }.Register(root) diff --git a/internal/cmd/serve/main.go b/internal/cmd/serve/main.go index e7ec0706..73583520 100644 --- a/internal/cmd/serve/main.go +++ b/internal/cmd/serve/main.go @@ -17,19 +17,25 @@ import ( type Serve struct { Cfg config.Config - Logger zap.Logger + Logger *zap.Logger Tracer trace.Tracer } func (s Serve) main() { + auth, err := authenticator.Builder{ + Vendors: s.Cfg.Vendors, + Logger: s.Logger, + ValidatorConfig: s.Cfg.Validator, + }.Authenticators() + if err != nil { + s.Logger.Fatal("authenticator building failed", zap.Error(err)) + } + api := api.API{ - DefaultVendor: s.Cfg.DefaultVendor, - Authenticators: authenticator.Builder{ - Vendors: s.Cfg.Vendors, Logger: s.Logger, - ValidatorConfig: s.Cfg.Validator, - }.Authenticators(), - Tracer: s.Tracer, - Logger: s.Logger.Named("api"), + DefaultVendor: s.Cfg.DefaultVendor, + Authenticators: auth, + Tracer: s.Tracer, + Logger: s.Logger.Named("api"), } if _, ok := api.Authenticators[s.Cfg.DefaultVendor]; !ok { From 526a9fc448d6ed648b4640a4ba00f23d8bc9e773 Mon Sep 17 00:00:00 2001 From: Parham Alvani Date: Thu, 30 Nov 2023 20:02:09 +0000 Subject: [PATCH 527/660] feat: add system key not found error --- internal/authenticator/builder_test.go | 37 ++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) diff --git a/internal/authenticator/builder_test.go b/internal/authenticator/builder_test.go index 1d377d5c..cf7a4e8c 100644 --- a/internal/authenticator/builder_test.go +++ b/internal/authenticator/builder_test.go @@ -47,3 +47,40 @@ func TestBuilderInternalAuthenticator(t *testing.T) { require.Len(vendors, 1) require.Contains(vendors, "internal") } + +func TestBuilderInternalAuthenticatorWithInvalidKey(t *testing.T) { + t.Parallel() + + require := require.New(t) + + b := authenticator.Builder{ + Vendors: []config.Vendor{ + { + Company: "internal", + Jwt: config.Jwt{ + IssName: "iss", + SubName: "sub", + SigningMethod: "HS512", + }, + IsInternal: true, + UseValidator: false, + AllowedAccessTypes: nil, + Topics: nil, + HashIDMap: nil, + IssEntityMap: nil, + IssPeerMap: nil, + Keys: map[string]string{ + "not-system": "c2VjcmV0", + }, + }, + }, + Logger: zap.NewNop(), + ValidatorConfig: config.Validator{ + URL: "", + Timeout: 0, + }, + } + + _, err := b.Authenticators() + require.ErrorIs(err, authenticator.ErrAdminAuthenticatorSystemKey) +} From f20c9ae92266ad6d9a5c348ff95f0b24ab6f007c Mon Sep 17 00:00:00 2001 From: Parham Alvani Date: Thu, 30 Nov 2023 20:08:04 +0000 Subject: [PATCH 528/660] feat: add coverage for the case we do not have any authenticator --- internal/authenticator/builder_test.go | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/internal/authenticator/builder_test.go b/internal/authenticator/builder_test.go index cf7a4e8c..a832dafb 100644 --- a/internal/authenticator/builder_test.go +++ b/internal/authenticator/builder_test.go @@ -9,6 +9,24 @@ import ( "go.uber.org/zap" ) +func TestBuilderWithoutAuthenticator(t *testing.T) { + t.Parallel() + + require := require.New(t) + + b := authenticator.Builder{ + Vendors: []config.Vendor{}, + Logger: zap.NewNop(), + ValidatorConfig: config.Validator{ + URL: "", + Timeout: 0, + }, + } + + _, err := b.Authenticators() + require.ErrorIs(err, authenticator.ErrNoAuthenticator) +} + func TestBuilderInternalAuthenticator(t *testing.T) { t.Parallel() From efd92404dc7dbf942044971b6291d16184912362 Mon Sep 17 00:00:00 2001 From: Parham Alvani Date: Thu, 30 Nov 2023 20:14:39 +0000 Subject: [PATCH 529/660] chore: handle invalid authenticator --- internal/authenticator/builder.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/internal/authenticator/builder.go b/internal/authenticator/builder.go index 9f81da69..dcc27ee0 100644 --- a/internal/authenticator/builder.go +++ b/internal/authenticator/builder.go @@ -17,6 +17,7 @@ var ( ErrNoAuthenticator = errors.New("at least one vendor should be enable to have soteria") ErrNoDefaultCaseIssEntry = errors.New("default case for iss-entity map is required") ErrNoDefaultCaseIssPeer = errors.New("default case for iss-peer map is required") + ErrInvalidAuthenticator = errors.New("there is no authenticator to support your request") ) type Builder struct { @@ -35,6 +36,8 @@ func (b Builder) Authenticators() (map[string]Authenticator, error) { ) switch { + case vendor.UseValidator && vendor.IsInternal: + return nil, ErrInvalidAuthenticator case vendor.UseValidator: auth, err = b.autoAuthenticator(vendor) if err != nil { From 5a1255176b7c4c871c152c07d8d0c31055630213 Mon Sep 17 00:00:00 2001 From: Parham Alvani Date: Thu, 30 Nov 2023 20:18:31 +0000 Subject: [PATCH 530/660] chore: handle invalid authenticator --- internal/authenticator/builder.go | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/internal/authenticator/builder.go b/internal/authenticator/builder.go index dcc27ee0..1a3a1fda 100644 --- a/internal/authenticator/builder.go +++ b/internal/authenticator/builder.go @@ -36,8 +36,6 @@ func (b Builder) Authenticators() (map[string]Authenticator, error) { ) switch { - case vendor.UseValidator && vendor.IsInternal: - return nil, ErrInvalidAuthenticator case vendor.UseValidator: auth, err = b.autoAuthenticator(vendor) if err != nil { @@ -66,6 +64,10 @@ func (b Builder) Authenticators() (map[string]Authenticator, error) { } func (b Builder) adminAuthenticator(vendor config.Vendor) (*AdminAuthenticator, error) { + if vendor.UseValidator { + return nil, ErrInvalidAuthenticator + } + if _, ok := vendor.Keys["system"]; !ok || len(vendor.Keys) != 1 { return nil, ErrAdminAuthenticatorSystemKey } @@ -115,6 +117,10 @@ func (b Builder) manualAuthenticator(vendor config.Vendor) (*ManualAuthenticator } func (b Builder) autoAuthenticator(vendor config.Vendor) (*AutoAuthenticator, error) { + if vendor.IsInternal { + return nil, ErrInvalidAuthenticator + } + allowedAccessTypes, err := b.GetAllowedAccessTypes(vendor.AllowedAccessTypes) if err != nil { return nil, fmt.Errorf("cannot parse allowed access types %w", err) From 8550c492a701175062699bd4bf77a5375b523258 Mon Sep 17 00:00:00 2001 From: Parham Alvani Date: Thu, 30 Nov 2023 20:29:48 +0000 Subject: [PATCH 531/660] feat: handle errors for loading keys --- internal/authenticator/builder.go | 10 ++++- internal/authenticator/key.go | 63 ++++++++++++++++++++++++------- 2 files changed, 57 insertions(+), 16 deletions(-) diff --git a/internal/authenticator/builder.go b/internal/authenticator/builder.go index 1a3a1fda..a7027739 100644 --- a/internal/authenticator/builder.go +++ b/internal/authenticator/builder.go @@ -72,7 +72,10 @@ func (b Builder) adminAuthenticator(vendor config.Vendor) (*AdminAuthenticator, return nil, ErrAdminAuthenticatorSystemKey } - keys := b.GenerateKeys(vendor.Jwt.SigningMethod, vendor.Keys) + keys, err := b.GenerateKeys(vendor.Jwt.SigningMethod, vendor.Keys) + if err != nil { + return nil, fmt.Errorf("loading keys failed %w", err) + } return &AdminAuthenticator{ Key: keys["system"], @@ -97,7 +100,10 @@ func (b Builder) manualAuthenticator(vendor config.Vendor) (*ManualAuthenticator return nil, fmt.Errorf("cannot create hash-id manager %w", err) } - keys := b.GenerateKeys(vendor.Jwt.SigningMethod, vendor.Keys) + keys, err := b.GenerateKeys(vendor.Jwt.SigningMethod, vendor.Keys) + if err != nil { + return nil, fmt.Errorf("loading keys failed %w", err) + } return &ManualAuthenticator{ Keys: keys, diff --git a/internal/authenticator/key.go b/internal/authenticator/key.go index 1b2de40f..b794f4d1 100644 --- a/internal/authenticator/key.go +++ b/internal/authenticator/key.go @@ -2,30 +2,50 @@ package authenticator import ( "encoding/base64" + "errors" + "fmt" "strings" "github.com/golang-jwt/jwt/v5" "go.uber.org/zap" ) -func (b Builder) GenerateKeys(method string, keys map[string]string) map[string]any { - var keyList map[string]any +var ( + ErrInvalidKeyType = errors.New("cannot determine the key type") + ErrNoKeys = errors.New("at least one key required") +) + +func (b Builder) GenerateKeys(method string, keys map[string]string) (map[string]any, error) { + var ( + keyList map[string]any + err error + ) - // ES RS HS PS EdDSA + // https://jwt.io/ switch { case strings.HasPrefix(method, "RS"): - keyList = b.GenerateRsaKeys(keys) + keyList, err = b.GenerateRSAKeys(keys) case strings.HasPrefix(method, "HS"): - keyList = b.GenerateHMacKeys(keys) + keyList, err = b.GenerateHMACKeys(keys) + case strings.HasPrefix(method, "ES"): + keyList, err = b.GenerateECDSAKeys(keys) default: - keyList = make(map[string]any) + return nil, ErrInvalidKeyType + } + + if err != nil { + return nil, fmt.Errorf("reading keys failed %w", err) + } + + if len(keyList) == 0 { + return nil, ErrNoKeys } - return keyList + return keyList, nil } -func (b Builder) GenerateRsaKeys(raw map[string]string) map[string]any { - rsaKeys := make(map[string]any) +func (b Builder) GenerateRSAKeys(raw map[string]string) (map[string]any, error) { + keys := make(map[string]any) for iss, publicKey := range raw { bytes, err := jwt.ParseRSAPublicKeyFromPEM([]byte(publicKey)) @@ -33,23 +53,38 @@ func (b Builder) GenerateRsaKeys(raw map[string]string) map[string]any { b.Logger.Fatal("could not read public key", zap.String("issuer", iss), zap.Error(err)) } - rsaKeys[iss] = bytes + keys[iss] = bytes + } + + return keys, nil +} + +func (b Builder) GenerateECDSAKeys(raw map[string]string) (map[string]any, error) { + keys := make(map[string]any) + + for iss, publicKey := range raw { + bytes, err := jwt.ParseECPublicKeyFromPEM([]byte(publicKey)) + if err != nil { + b.Logger.Fatal("could not read public key", zap.String("issuer", iss), zap.Error(err)) + } + + keys[iss] = bytes } - return rsaKeys + return keys, nil } -func (b Builder) GenerateHMacKeys(raw map[string]string) map[string]any { +func (b Builder) GenerateHMACKeys(raw map[string]string) (map[string]any, error) { keys := make(map[string]any) for iss, key := range raw { bytes, err := base64.StdEncoding.DecodeString(key) if err != nil { - b.Logger.Fatal("failed to generate hmac key from base64", zap.Error(err)) + return nil, fmt.Errorf("failed to generate hmac key from base64 %w", err) } keys[iss] = bytes } - return keys + return keys, nil } From 973ff3a5b5bfd845582f8fe085d67f8c409af87f Mon Sep 17 00:00:00 2001 From: Parham Alvani Date: Thu, 30 Nov 2023 20:35:26 +0000 Subject: [PATCH 532/660] feat: increase test coverage --- internal/authenticator/builder_test.go | 55 ++++++++++++++++++++++++++ 1 file changed, 55 insertions(+) diff --git a/internal/authenticator/builder_test.go b/internal/authenticator/builder_test.go index a832dafb..7826e642 100644 --- a/internal/authenticator/builder_test.go +++ b/internal/authenticator/builder_test.go @@ -5,6 +5,7 @@ import ( "github.com/snapp-incubator/soteria/internal/authenticator" "github.com/snapp-incubator/soteria/internal/config" + "github.com/snapp-incubator/soteria/internal/topics" "github.com/stretchr/testify/require" "go.uber.org/zap" ) @@ -102,3 +103,57 @@ func TestBuilderInternalAuthenticatorWithInvalidKey(t *testing.T) { _, err := b.Authenticators() require.ErrorIs(err, authenticator.ErrAdminAuthenticatorSystemKey) } + +func TestBuilderManualAuthenticatorWithoutKey(t *testing.T) { + t.Parallel() + + require := require.New(t) + + b := authenticator.Builder{ + Vendors: []config.Vendor{ + { + Company: "internal", + Jwt: config.Jwt{ + IssName: "iss", + SubName: "sub", + SigningMethod: "HS512", + }, + IsInternal: false, + UseValidator: false, + AllowedAccessTypes: []string{"pub", "sub"}, + Topics: nil, + HashIDMap: map[string]topics.HashData{ + "0": { + Alphabet: "", + Length: 15, + Salt: "secret", + }, + "1": { + Alphabet: "", + Length: 15, + Salt: "secret", + }, + }, + IssEntityMap: map[string]string{ + "0": "driver", + "1": "passenger", + "default": "", + }, + IssPeerMap: map[string]string{ + "0": "passenger", + "1": "driver", + "default": "", + }, + Keys: nil, + }, + }, + Logger: zap.NewNop(), + ValidatorConfig: config.Validator{ + URL: "", + Timeout: 0, + }, + } + + _, err := b.Authenticators() + require.ErrorIs(err, authenticator.ErrNoKeys) +} From 99407619c4b9d8b264cd619546c3117126253ce2 Mon Sep 17 00:00:00 2001 From: Parham Alvani Date: Thu, 30 Nov 2023 20:39:50 +0000 Subject: [PATCH 533/660] feat: add more test cases for manual authenticator --- internal/authenticator/builder_test.go | 79 +++++++++++++++++++++++++- 1 file changed, 78 insertions(+), 1 deletion(-) diff --git a/internal/authenticator/builder_test.go b/internal/authenticator/builder_test.go index 7826e642..240fceee 100644 --- a/internal/authenticator/builder_test.go +++ b/internal/authenticator/builder_test.go @@ -112,7 +112,7 @@ func TestBuilderManualAuthenticatorWithoutKey(t *testing.T) { b := authenticator.Builder{ Vendors: []config.Vendor{ { - Company: "internal", + Company: "snapp", Jwt: config.Jwt{ IssName: "iss", SubName: "sub", @@ -157,3 +157,80 @@ func TestBuilderManualAuthenticatorWithoutKey(t *testing.T) { _, err := b.Authenticators() require.ErrorIs(err, authenticator.ErrNoKeys) } + +// nolint: funlen +func TestBuilderManualAuthenticator(t *testing.T) { + t.Parallel() + + require := require.New(t) + + b := authenticator.Builder{ + Vendors: []config.Vendor{ + { + Company: "snapp", + Jwt: config.Jwt{ + IssName: "iss", + SubName: "sub", + SigningMethod: "RSA512", + }, + IsInternal: false, + UseValidator: false, + AllowedAccessTypes: []string{"pub", "sub"}, + Topics: nil, + HashIDMap: map[string]topics.HashData{ + "0": { + Alphabet: "", + Length: 15, + Salt: "secret", + }, + "1": { + Alphabet: "", + Length: 15, + Salt: "secret", + }, + }, + IssEntityMap: map[string]string{ + "0": "driver", + "1": "passenger", + "default": "", + }, + IssPeerMap: map[string]string{ + "0": "passenger", + "1": "driver", + "default": "", + }, + Keys: map[string]string{ + "0": `-----BEGIN PUBLIC KEY----- + MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAyG4XpV9TpDfgWJF9TiIv + va4hNhDuqYMJO6iXLzr3y8oCvoB7zUK0EjtbLH+A3gr1kUvyZKDWT4qHTvU2Sshm + X+ttWGK34EhCvF3Lb18yxmVDSSK8JIcTaJjMqmyubxzamQnNoWazJ7ea9BIo2YGL + C9rgPbi1hihhdb07xPGUkJRqbWkI98xjDhKdMqiwW1hIRXm/apo++FjptvqvF84s + ynC5gWGFHiGNICRsLJBczLEAf2Atbafigq6/tovzMabnp2yRtr1ReEgioH1RO4gX + J7F4N5f6y/VWd8+sDOSxtS/HcnP/7g8/A54G2IbXxr+EiwOO/1F+pyMPKq7sGDSU + DwIDAQAB +-----END PUBLIC KEY-----`, + + "1": `-----BEGIN PUBLIC KEY----- + MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA5SeRfOdTyvQZ7N9ahFHl + +J05r7e9fgOQ2cpOtnnsIjAjCt1dF7/NkqVifEaxABRBGG9iXIw//G4hi0TqoKqK + aoSHMGf6q9pSRLGyB8FatxZf2RBTgrXYqVvpasbnB1ZNv858yTpRjV9NzJXYHLp8 + 8Hbd/yYTR6Q7ajs11/SMLGO7KBELsI1pBz7UW/fngJ2pRmd+RkG+EcGrOIZ27TkI + Xjtog6bgfmtV9FWxSVdKACOY0OmW+g7jIMik2eZTYG3kgCmW2odu3zRoUa7l9VwN + YMuhTePaIWwOifzRQt8HDsAOpzqJuLCoYX7HmBfpGAnwu4BuTZgXVwpvPNb+KlgS + pQIDAQAB +-----END PUBLIC KEY-----`, + }, + }, + }, + Logger: zap.NewNop(), + ValidatorConfig: config.Validator{ + URL: "", + Timeout: 0, + }, + } + + vendors, err := b.Authenticators() + require.NoError(err) + require.Len(vendors, 1) + require.Contains(vendors, "snapp") +} From b9d255f3f6d9455b1067a48edef8b4d9533c44f7 Mon Sep 17 00:00:00 2001 From: Parham Alvani Date: Fri, 1 Dec 2023 14:46:06 +0000 Subject: [PATCH 534/660] feat: update vendor configuration --- internal/api/api_test.go | 2 +- internal/authenticator/admin_authenticator.go | 2 +- .../authenticator/admin_authenticator_test.go | 2 +- internal/authenticator/auto_authenticator.go | 2 +- .../authenticator/auto_authenticator_test.go | 2 +- internal/authenticator/builder.go | 18 +++++-------- internal/authenticator/builder_test.go | 20 ++++++--------- .../authenticator/manual_authenticator.go | 2 +- .../manual_authenticator_test.go | 2 +- internal/config/config.go | 25 ++++++++----------- internal/config/default.go | 5 ++-- 11 files changed, 33 insertions(+), 49 deletions(-) diff --git a/internal/api/api_test.go b/internal/api/api_test.go index f0de82d7..fd1e8f1e 100644 --- a/internal/api/api_test.go +++ b/internal/api/api_test.go @@ -130,7 +130,7 @@ func (suite *APITestSuite) SetupSuite() { "snapp-admin": authenticator.AdminAuthenticator{ Key: []byte(suite.key), Company: "snapp-admin", - JwtConfig: config.Jwt{ + JwtConfig: config.JWT{ IssName: "iss", SubName: "sub", SigningMethod: "HS512", diff --git a/internal/authenticator/admin_authenticator.go b/internal/authenticator/admin_authenticator.go index 6fbbece4..1e7516d0 100644 --- a/internal/authenticator/admin_authenticator.go +++ b/internal/authenticator/admin_authenticator.go @@ -13,7 +13,7 @@ import ( type AdminAuthenticator struct { Key any Company string - JwtConfig config.Jwt + JwtConfig config.JWT Parser *jwt.Parser } diff --git a/internal/authenticator/admin_authenticator_test.go b/internal/authenticator/admin_authenticator_test.go index 63863386..8b1992e0 100644 --- a/internal/authenticator/admin_authenticator_test.go +++ b/internal/authenticator/admin_authenticator_test.go @@ -30,7 +30,7 @@ func TestAdminAuthenticator_suite(t *testing.T) { Key: pkey0, Company: "snapp-admin", Parser: jwt.NewParser(), - JwtConfig: config.Jwt{ + JwtConfig: config.JWT{ IssName: "iss", SubName: "sub", SigningMethod: "rsa256", diff --git a/internal/authenticator/auto_authenticator.go b/internal/authenticator/auto_authenticator.go index 64febb41..5775e4fb 100644 --- a/internal/authenticator/auto_authenticator.go +++ b/internal/authenticator/auto_authenticator.go @@ -17,7 +17,7 @@ type AutoAuthenticator struct { AllowedAccessTypes []acl.AccessType TopicManager *topics.Manager Company string - JwtConfig config.Jwt + JwtConfig config.JWT Validator validator.Client Parser *jwt.Parser } diff --git a/internal/authenticator/auto_authenticator_test.go b/internal/authenticator/auto_authenticator_test.go index 15ff3bf0..f2870894 100644 --- a/internal/authenticator/auto_authenticator_test.go +++ b/internal/authenticator/auto_authenticator_test.go @@ -87,7 +87,7 @@ func (suite *AutoAuthenticatorTestSuite) SetupSuite() { Company: "snapp", Parser: jwt.NewParser(), TopicManager: topics.NewTopicManager(cfg.Topics, hid, "snapp", cfg.IssEntityMap, cfg.IssPeerMap, zap.NewNop()), - JwtConfig: config.Jwt{ + JwtConfig: config.JWT{ IssName: "iss", SubName: "sub", SigningMethod: "rsa256", diff --git a/internal/authenticator/builder.go b/internal/authenticator/builder.go index a7027739..882f76c0 100644 --- a/internal/authenticator/builder.go +++ b/internal/authenticator/builder.go @@ -35,22 +35,24 @@ func (b Builder) Authenticators() (map[string]Authenticator, error) { err error ) - switch { - case vendor.UseValidator: + switch vendor.Type { + case "auto": auth, err = b.autoAuthenticator(vendor) if err != nil { return nil, fmt.Errorf("cannot build auto authenticator %w", err) } - case vendor.IsInternal: + case "admin", "internal": auth, err = b.adminAuthenticator(vendor) if err != nil { return nil, fmt.Errorf("cannot build admin authenticator %w", err) } - default: + case "manual": auth, err = b.manualAuthenticator(vendor) if err != nil { return nil, fmt.Errorf("cannot build manual authenticator %w", err) } + default: + return nil, ErrInvalidAuthenticator } all[vendor.Company] = auth @@ -64,10 +66,6 @@ func (b Builder) Authenticators() (map[string]Authenticator, error) { } func (b Builder) adminAuthenticator(vendor config.Vendor) (*AdminAuthenticator, error) { - if vendor.UseValidator { - return nil, ErrInvalidAuthenticator - } - if _, ok := vendor.Keys["system"]; !ok || len(vendor.Keys) != 1 { return nil, ErrAdminAuthenticatorSystemKey } @@ -123,10 +121,6 @@ func (b Builder) manualAuthenticator(vendor config.Vendor) (*ManualAuthenticator } func (b Builder) autoAuthenticator(vendor config.Vendor) (*AutoAuthenticator, error) { - if vendor.IsInternal { - return nil, ErrInvalidAuthenticator - } - allowedAccessTypes, err := b.GetAllowedAccessTypes(vendor.AllowedAccessTypes) if err != nil { return nil, fmt.Errorf("cannot parse allowed access types %w", err) diff --git a/internal/authenticator/builder_test.go b/internal/authenticator/builder_test.go index 240fceee..222908b5 100644 --- a/internal/authenticator/builder_test.go +++ b/internal/authenticator/builder_test.go @@ -37,13 +37,12 @@ func TestBuilderInternalAuthenticator(t *testing.T) { Vendors: []config.Vendor{ { Company: "internal", - Jwt: config.Jwt{ + Jwt: config.JWT{ IssName: "iss", SubName: "sub", SigningMethod: "HS512", }, - IsInternal: true, - UseValidator: false, + Type: "internal", AllowedAccessTypes: nil, Topics: nil, HashIDMap: nil, @@ -76,13 +75,12 @@ func TestBuilderInternalAuthenticatorWithInvalidKey(t *testing.T) { Vendors: []config.Vendor{ { Company: "internal", - Jwt: config.Jwt{ + Jwt: config.JWT{ IssName: "iss", SubName: "sub", SigningMethod: "HS512", }, - IsInternal: true, - UseValidator: false, + Type: "internal", AllowedAccessTypes: nil, Topics: nil, HashIDMap: nil, @@ -113,13 +111,12 @@ func TestBuilderManualAuthenticatorWithoutKey(t *testing.T) { Vendors: []config.Vendor{ { Company: "snapp", - Jwt: config.Jwt{ + Jwt: config.JWT{ IssName: "iss", SubName: "sub", SigningMethod: "HS512", }, - IsInternal: false, - UseValidator: false, + Type: "manual", AllowedAccessTypes: []string{"pub", "sub"}, Topics: nil, HashIDMap: map[string]topics.HashData{ @@ -168,13 +165,12 @@ func TestBuilderManualAuthenticator(t *testing.T) { Vendors: []config.Vendor{ { Company: "snapp", - Jwt: config.Jwt{ + Jwt: config.JWT{ IssName: "iss", SubName: "sub", SigningMethod: "RSA512", }, - IsInternal: false, - UseValidator: false, + Type: "manual", AllowedAccessTypes: []string{"pub", "sub"}, Topics: nil, HashIDMap: map[string]topics.HashData{ diff --git a/internal/authenticator/manual_authenticator.go b/internal/authenticator/manual_authenticator.go index abfbb1f6..0b6ef2b1 100644 --- a/internal/authenticator/manual_authenticator.go +++ b/internal/authenticator/manual_authenticator.go @@ -16,7 +16,7 @@ type ManualAuthenticator struct { AllowedAccessTypes []acl.AccessType TopicManager *topics.Manager Company string - JwtConfig config.Jwt + JwtConfig config.JWT Parser *jwt.Parser } diff --git a/internal/authenticator/manual_authenticator_test.go b/internal/authenticator/manual_authenticator_test.go index 75ba768b..a6aee2f0 100644 --- a/internal/authenticator/manual_authenticator_test.go +++ b/internal/authenticator/manual_authenticator_test.go @@ -81,7 +81,7 @@ func (suite *ManualAuthenticatorTestSuite) SetupSuite() { Company: "snapp", Parser: jwt.NewParser(), TopicManager: topics.NewTopicManager(cfg.Topics, hid, "snapp", cfg.IssEntityMap, cfg.IssPeerMap, zap.NewNop()), - JwtConfig: config.Jwt{ + JwtConfig: config.JWT{ IssName: "iss", SubName: "sub", SigningMethod: "rsa256", diff --git a/internal/config/config.go b/internal/config/config.go index 33121c93..e2603c66 100644 --- a/internal/config/config.go +++ b/internal/config/config.go @@ -34,23 +34,18 @@ type ( } Vendor struct { - AllowedAccessTypes []string `json:"allowed_access_types,omitempty" koanf:"allowed_access_types"` - Company string `json:"company,omitempty" koanf:"company"` - Topics []topics.Topic `json:"topics,omitempty" koanf:"topics"` - Keys map[string]string `json:"keys,omitempty" koanf:"keys"` - IssEntityMap map[string]string `json:"iss_entity_map,omitempty" koanf:"iss_entity_map"` - IssPeerMap map[string]string `json:"iss_peer_map,omitempty" koanf:"iss_peer_map"` - Jwt Jwt `json:"jwt,omitempty" koanf:"jwt"` - // by setting use validator to true we don't validate the jwt token and deligate - // it into an http client. - UseValidator bool `json:"use_validator,omitempty" koanf:"use_validator"` - // by setting is internal to true we use internal authenticator which provides admin access - // on the authentication method. - IsInternal bool `json:"is_internal,omitempty" koanf:"is_internal"` - HashIDMap map[string]topics.HashData `json:"hash_id_map,omitempty" koanf:"hashid_map"` + AllowedAccessTypes []string `json:"allowed_access_types,omitempty" koanf:"allowed_access_types"` + Company string `json:"company,omitempty" koanf:"company"` + Topics []topics.Topic `json:"topics,omitempty" koanf:"topics"` + Keys map[string]string `json:"keys,omitempty" koanf:"keys"` + IssEntityMap map[string]string `json:"iss_entity_map,omitempty" koanf:"iss_entity_map"` + IssPeerMap map[string]string `json:"iss_peer_map,omitempty" koanf:"iss_peer_map"` + Jwt JWT `json:"jwt,omitempty" koanf:"jwt"` + Type string `json:"type" koanf:"type"` + HashIDMap map[string]topics.HashData `json:"hash_id_map,omitempty" koanf:"hashid_map"` } - Jwt struct { + JWT struct { IssName string `json:"iss_name,omitempty" koanf:"iss_name"` SubName string `json:"sub_name,omitempty" koanf:"sub_name"` SigningMethod string `json:"signing_method,omitempty" koanf:"signing_method"` diff --git a/internal/config/default.go b/internal/config/default.go index b8020e47..9de645aa 100644 --- a/internal/config/default.go +++ b/internal/config/default.go @@ -42,8 +42,7 @@ func Default() Config { // nolint: funlen func SnappVendor() Vendor { return Vendor{ - UseValidator: false, - IsInternal: false, + Type: "manual", AllowedAccessTypes: []string{ "pub", "sub", @@ -174,7 +173,7 @@ func SnappVendor() Vendor { "1": "driver", "default": "", }, - Jwt: Jwt{ + Jwt: JWT{ IssName: "iss", SubName: "sub", SigningMethod: "RS512", From cbbb2203c8b72b1d74100a85cd10c8836ca7f5c3 Mon Sep 17 00:00:00 2001 From: Parham Alvani Date: Fri, 1 Dec 2023 14:48:56 +0000 Subject: [PATCH 535/660] fix: correct lint issues --- internal/config/config.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/internal/config/config.go b/internal/config/config.go index e2603c66..1b7de39f 100644 --- a/internal/config/config.go +++ b/internal/config/config.go @@ -41,8 +41,8 @@ type ( IssEntityMap map[string]string `json:"iss_entity_map,omitempty" koanf:"iss_entity_map"` IssPeerMap map[string]string `json:"iss_peer_map,omitempty" koanf:"iss_peer_map"` Jwt JWT `json:"jwt,omitempty" koanf:"jwt"` - Type string `json:"type" koanf:"type"` - HashIDMap map[string]topics.HashData `json:"hash_id_map,omitempty" koanf:"hashid_map"` + Type string `json:"type,omitempty" koanf:"type"` + HashIDMap map[string]topics.HashData `json:"hash_id_map,omitempty" koanf:"hashid_map"` } JWT struct { From bdf272d3befe4160f70e3891c9177e3d9eb9fd78 Mon Sep 17 00:00:00 2001 From: Parham Alvani Date: Fri, 1 Dec 2023 14:52:23 +0000 Subject: [PATCH 536/660] feat: update builder test cases --- internal/authenticator/builder.go | 2 +- internal/authenticator/builder_test.go | 38 +++++++++++++++++++++++++- 2 files changed, 38 insertions(+), 2 deletions(-) diff --git a/internal/authenticator/builder.go b/internal/authenticator/builder.go index 882f76c0..34fd5c8e 100644 --- a/internal/authenticator/builder.go +++ b/internal/authenticator/builder.go @@ -36,7 +36,7 @@ func (b Builder) Authenticators() (map[string]Authenticator, error) { ) switch vendor.Type { - case "auto": + case "auto", "validator", "validator-based", "using-validator": auth, err = b.autoAuthenticator(vendor) if err != nil { return nil, fmt.Errorf("cannot build auto authenticator %w", err) diff --git a/internal/authenticator/builder_test.go b/internal/authenticator/builder_test.go index 222908b5..7c04ef16 100644 --- a/internal/authenticator/builder_test.go +++ b/internal/authenticator/builder_test.go @@ -28,6 +28,42 @@ func TestBuilderWithoutAuthenticator(t *testing.T) { require.ErrorIs(err, authenticator.ErrNoAuthenticator) } +func TestBuilderInvalidAuthenticator(t *testing.T) { + t.Parallel() + + require := require.New(t) + + b := authenticator.Builder{ + Vendors: []config.Vendor{ + { + Company: "internal", + Jwt: config.JWT{ + IssName: "iss", + SubName: "sub", + SigningMethod: "HS512", + }, + Type: "invalid", + AllowedAccessTypes: nil, + Topics: nil, + HashIDMap: nil, + IssEntityMap: nil, + IssPeerMap: nil, + Keys: map[string]string{ + "system": "c2VjcmV0", + }, + }, + }, + Logger: zap.NewNop(), + ValidatorConfig: config.Validator{ + URL: "", + Timeout: 0, + }, + } + + _, err := b.Authenticators() + require.ErrorIs(err, authenticator.ErrInvalidAuthenticator) +} + func TestBuilderInternalAuthenticator(t *testing.T) { t.Parallel() @@ -74,7 +110,7 @@ func TestBuilderInternalAuthenticatorWithInvalidKey(t *testing.T) { b := authenticator.Builder{ Vendors: []config.Vendor{ { - Company: "internal", + Company: "admin", Jwt: config.JWT{ IssName: "iss", SubName: "sub", From 14f66514ff26b8fc8f3191d7cf5cca3e2e1afc40 Mon Sep 17 00:00:00 2001 From: Parham Alvani Date: Fri, 1 Dec 2023 14:56:40 +0000 Subject: [PATCH 537/660] feat: add more tests for builder --- internal/authenticator/builder.go | 4 +- internal/authenticator/builder_test.go | 143 +++++++++++++++++++++++++ 2 files changed, 145 insertions(+), 2 deletions(-) diff --git a/internal/authenticator/builder.go b/internal/authenticator/builder.go index 34fd5c8e..297a4a83 100644 --- a/internal/authenticator/builder.go +++ b/internal/authenticator/builder.go @@ -15,7 +15,7 @@ import ( var ( ErrAdminAuthenticatorSystemKey = errors.New("admin authenticator supports only one key named system") ErrNoAuthenticator = errors.New("at least one vendor should be enable to have soteria") - ErrNoDefaultCaseIssEntry = errors.New("default case for iss-entity map is required") + ErrNoDefaultCaseIssEntity = errors.New("default case for iss-entity map is required") ErrNoDefaultCaseIssPeer = errors.New("default case for iss-peer map is required") ErrInvalidAuthenticator = errors.New("there is no authenticator to support your request") ) @@ -182,7 +182,7 @@ func toUserAccessType(access string) (acl.AccessType, error) { func (b Builder) ValidateMappers(issEntityMap, issPeerMap map[string]string) error { if _, ok := issEntityMap[topics.Default]; !ok { - return ErrNoDefaultCaseIssEntry + return ErrNoDefaultCaseIssEntity } if _, ok := issPeerMap[topics.Default]; !ok { diff --git a/internal/authenticator/builder_test.go b/internal/authenticator/builder_test.go index 7c04ef16..77d7ef44 100644 --- a/internal/authenticator/builder_test.go +++ b/internal/authenticator/builder_test.go @@ -266,3 +266,146 @@ func TestBuilderManualAuthenticator(t *testing.T) { require.Len(vendors, 1) require.Contains(vendors, "snapp") } + +// nolint: funlen +func TestBuilderManualAuthenticatorInvalidMapping_1(t *testing.T) { + t.Parallel() + + require := require.New(t) + + b := authenticator.Builder{ + Vendors: []config.Vendor{ + { + Company: "snapp", + Jwt: config.JWT{ + IssName: "iss", + SubName: "sub", + SigningMethod: "RSA512", + }, + Type: "manual", + AllowedAccessTypes: []string{"pub", "sub"}, + Topics: nil, + HashIDMap: map[string]topics.HashData{ + "0": { + Alphabet: "", + Length: 15, + Salt: "secret", + }, + "1": { + Alphabet: "", + Length: 15, + Salt: "secret", + }, + }, + IssEntityMap: map[string]string{ + "0": "driver", + "1": "passenger", + "default": "", + }, + IssPeerMap: nil, + Keys: map[string]string{ + "0": `-----BEGIN PUBLIC KEY----- + MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAyG4XpV9TpDfgWJF9TiIv + va4hNhDuqYMJO6iXLzr3y8oCvoB7zUK0EjtbLH+A3gr1kUvyZKDWT4qHTvU2Sshm + X+ttWGK34EhCvF3Lb18yxmVDSSK8JIcTaJjMqmyubxzamQnNoWazJ7ea9BIo2YGL + C9rgPbi1hihhdb07xPGUkJRqbWkI98xjDhKdMqiwW1hIRXm/apo++FjptvqvF84s + ynC5gWGFHiGNICRsLJBczLEAf2Atbafigq6/tovzMabnp2yRtr1ReEgioH1RO4gX + J7F4N5f6y/VWd8+sDOSxtS/HcnP/7g8/A54G2IbXxr+EiwOO/1F+pyMPKq7sGDSU + DwIDAQAB +-----END PUBLIC KEY-----`, + + "1": `-----BEGIN PUBLIC KEY----- + MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA5SeRfOdTyvQZ7N9ahFHl + +J05r7e9fgOQ2cpOtnnsIjAjCt1dF7/NkqVifEaxABRBGG9iXIw//G4hi0TqoKqK + aoSHMGf6q9pSRLGyB8FatxZf2RBTgrXYqVvpasbnB1ZNv858yTpRjV9NzJXYHLp8 + 8Hbd/yYTR6Q7ajs11/SMLGO7KBELsI1pBz7UW/fngJ2pRmd+RkG+EcGrOIZ27TkI + Xjtog6bgfmtV9FWxSVdKACOY0OmW+g7jIMik2eZTYG3kgCmW2odu3zRoUa7l9VwN + YMuhTePaIWwOifzRQt8HDsAOpzqJuLCoYX7HmBfpGAnwu4BuTZgXVwpvPNb+KlgS + pQIDAQAB +-----END PUBLIC KEY-----`, + }, + }, + }, + Logger: zap.NewNop(), + ValidatorConfig: config.Validator{ + URL: "", + Timeout: 0, + }, + } + + _, err := b.Authenticators() + require.ErrorIs(err, authenticator.ErrNoDefaultCaseIssPeer) +} + +// nolint: funlen +func TestBuilderManualAuthenticatorInvalidMapping_2(t *testing.T) { + t.Parallel() + + require := require.New(t) + + b := authenticator.Builder{ + Vendors: []config.Vendor{ + { + Company: "snapp", + Jwt: config.JWT{ + IssName: "iss", + SubName: "sub", + SigningMethod: "RSA512", + }, + Type: "manual", + AllowedAccessTypes: []string{"pub", "sub"}, + Topics: nil, + HashIDMap: map[string]topics.HashData{ + "0": { + Alphabet: "", + Length: 15, + Salt: "secret", + }, + "1": { + Alphabet: "", + Length: 15, + Salt: "secret", + }, + }, + IssEntityMap: map[string]string{ + "0": "driver", + "1": "passenger", + }, + IssPeerMap: map[string]string{ + "0": "passenger", + "1": "driver", + "default": "", + }, + Keys: map[string]string{ + "0": `-----BEGIN PUBLIC KEY----- + MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAyG4XpV9TpDfgWJF9TiIv + va4hNhDuqYMJO6iXLzr3y8oCvoB7zUK0EjtbLH+A3gr1kUvyZKDWT4qHTvU2Sshm + X+ttWGK34EhCvF3Lb18yxmVDSSK8JIcTaJjMqmyubxzamQnNoWazJ7ea9BIo2YGL + C9rgPbi1hihhdb07xPGUkJRqbWkI98xjDhKdMqiwW1hIRXm/apo++FjptvqvF84s + ynC5gWGFHiGNICRsLJBczLEAf2Atbafigq6/tovzMabnp2yRtr1ReEgioH1RO4gX + J7F4N5f6y/VWd8+sDOSxtS/HcnP/7g8/A54G2IbXxr+EiwOO/1F+pyMPKq7sGDSU + DwIDAQAB +-----END PUBLIC KEY-----`, + + "1": `-----BEGIN PUBLIC KEY----- + MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA5SeRfOdTyvQZ7N9ahFHl + +J05r7e9fgOQ2cpOtnnsIjAjCt1dF7/NkqVifEaxABRBGG9iXIw//G4hi0TqoKqK + aoSHMGf6q9pSRLGyB8FatxZf2RBTgrXYqVvpasbnB1ZNv858yTpRjV9NzJXYHLp8 + 8Hbd/yYTR6Q7ajs11/SMLGO7KBELsI1pBz7UW/fngJ2pRmd+RkG+EcGrOIZ27TkI + Xjtog6bgfmtV9FWxSVdKACOY0OmW+g7jIMik2eZTYG3kgCmW2odu3zRoUa7l9VwN + YMuhTePaIWwOifzRQt8HDsAOpzqJuLCoYX7HmBfpGAnwu4BuTZgXVwpvPNb+KlgS + pQIDAQAB +-----END PUBLIC KEY-----`, + }, + }, + }, + Logger: zap.NewNop(), + ValidatorConfig: config.Validator{ + URL: "", + Timeout: 0, + }, + } + + _, err := b.Authenticators() + require.ErrorIs(err, authenticator.ErrNoDefaultCaseIssEntity) +} From 466bf2e58eeed9f0fa4d480d4cfb2b79062159de Mon Sep 17 00:00:00 2001 From: Parham Alvani Date: Fri, 1 Dec 2023 15:07:30 +0000 Subject: [PATCH 538/660] fix: correct chart configuration --- charts/soteria/values.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/charts/soteria/values.yaml b/charts/soteria/values.yaml index b66e713e..1a792e97 100644 --- a/charts/soteria/values.yaml +++ b/charts/soteria/values.yaml @@ -51,6 +51,7 @@ config: vendors: snapp: company: "snapp" + type: "manual" hashid_map: 0: salt: "secret" From 03dd002ef21b24f37ca9e9ebdd69a398864ef3bb Mon Sep 17 00:00:00 2001 From: Parham Alvani Date: Fri, 1 Dec 2023 17:58:02 +0000 Subject: [PATCH 539/660] feat: update test coverage --- internal/authenticator/builder_test.go | 74 ++++++++++++++++++++++++++ 1 file changed, 74 insertions(+) diff --git a/internal/authenticator/builder_test.go b/internal/authenticator/builder_test.go index 77d7ef44..25b13471 100644 --- a/internal/authenticator/builder_test.go +++ b/internal/authenticator/builder_test.go @@ -409,3 +409,77 @@ func TestBuilderManualAuthenticatorInvalidMapping_2(t *testing.T) { _, err := b.Authenticators() require.ErrorIs(err, authenticator.ErrNoDefaultCaseIssEntity) } + +// nolint: funlen +func TestBuilderManualAuthenticatorInvalidAccess(t *testing.T) { + t.Parallel() + + require := require.New(t) + + b := authenticator.Builder{ + Vendors: []config.Vendor{ + { + Company: "snapp", + Jwt: config.JWT{ + IssName: "iss", + SubName: "sub", + SigningMethod: "RSA512", + }, + Type: "manual", + AllowedAccessTypes: []string{"pub", "superuser"}, + Topics: nil, + HashIDMap: map[string]topics.HashData{ + "0": { + Alphabet: "", + Length: 15, + Salt: "secret", + }, + "1": { + Alphabet: "", + Length: 15, + Salt: "secret", + }, + }, + IssEntityMap: map[string]string{ + "0": "driver", + "1": "passenger", + "default": "", + }, + IssPeerMap: map[string]string{ + "0": "passenger", + "1": "driver", + "default": "", + }, + Keys: map[string]string{ + "0": `-----BEGIN PUBLIC KEY----- + MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAyG4XpV9TpDfgWJF9TiIv + va4hNhDuqYMJO6iXLzr3y8oCvoB7zUK0EjtbLH+A3gr1kUvyZKDWT4qHTvU2Sshm + X+ttWGK34EhCvF3Lb18yxmVDSSK8JIcTaJjMqmyubxzamQnNoWazJ7ea9BIo2YGL + C9rgPbi1hihhdb07xPGUkJRqbWkI98xjDhKdMqiwW1hIRXm/apo++FjptvqvF84s + ynC5gWGFHiGNICRsLJBczLEAf2Atbafigq6/tovzMabnp2yRtr1ReEgioH1RO4gX + J7F4N5f6y/VWd8+sDOSxtS/HcnP/7g8/A54G2IbXxr+EiwOO/1F+pyMPKq7sGDSU + DwIDAQAB +-----END PUBLIC KEY-----`, + + "1": `-----BEGIN PUBLIC KEY----- + MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA5SeRfOdTyvQZ7N9ahFHl + +J05r7e9fgOQ2cpOtnnsIjAjCt1dF7/NkqVifEaxABRBGG9iXIw//G4hi0TqoKqK + aoSHMGf6q9pSRLGyB8FatxZf2RBTgrXYqVvpasbnB1ZNv858yTpRjV9NzJXYHLp8 + 8Hbd/yYTR6Q7ajs11/SMLGO7KBELsI1pBz7UW/fngJ2pRmd+RkG+EcGrOIZ27TkI + Xjtog6bgfmtV9FWxSVdKACOY0OmW+g7jIMik2eZTYG3kgCmW2odu3zRoUa7l9VwN + YMuhTePaIWwOifzRQt8HDsAOpzqJuLCoYX7HmBfpGAnwu4BuTZgXVwpvPNb+KlgS + pQIDAQAB +-----END PUBLIC KEY-----`, + }, + }, + }, + Logger: zap.NewNop(), + ValidatorConfig: config.Validator{ + URL: "", + Timeout: 0, + }, + } + + _, err := b.Authenticators() + require.ErrorIs(err, authenticator.ErrInvalidAccessType) +} From 7801ee0407cfd8eb0366db0e0ad7ed544e3f4ab5 Mon Sep 17 00:00:00 2001 From: Parham Alvani Date: Sat, 2 Dec 2023 19:34:09 +0000 Subject: [PATCH 540/660] feat: update the way of handling jwt in authentication --- .../authenticator/manual_authenticator.go | 24 ++++++++++--------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/internal/authenticator/manual_authenticator.go b/internal/authenticator/manual_authenticator.go index 0b6ef2b1..73b61efc 100644 --- a/internal/authenticator/manual_authenticator.go +++ b/internal/authenticator/manual_authenticator.go @@ -16,7 +16,7 @@ type ManualAuthenticator struct { AllowedAccessTypes []acl.AccessType TopicManager *topics.Manager Company string - JwtConfig config.JWT + JWTConfig config.JWT Parser *jwt.Parser } @@ -29,13 +29,15 @@ func (a ManualAuthenticator) Auth(tokenString string) error { if !ok { return nil, ErrInvalidClaims } - if claims[a.JwtConfig.IssName] == nil { + if claims[a.JWTConfig.IssName] == nil { return nil, ErrIssNotFound } - issuer := fmt.Sprintf("%v", claims[a.JwtConfig.IssName]) - + issuer := fmt.Sprintf("%v", claims[a.JWTConfig.IssName]) key := a.Keys[issuer] + if key == nil { + return nil, KeyNotFoundError{Issuer: issuer} + } return key, nil }) @@ -62,14 +64,14 @@ func (a ManualAuthenticator) ACL( if !ok { return nil, ErrInvalidClaims } - if claims[a.JwtConfig.IssName] == nil { + if claims[a.JWTConfig.IssName] == nil { return nil, ErrIssNotFound } - if claims[a.JwtConfig.SubName] == nil { + if claims[a.JWTConfig.SubName] == nil { return nil, ErrSubNotFound } - issuer := fmt.Sprintf("%v", claims[a.JwtConfig.IssName]) + issuer := fmt.Sprintf("%v", claims[a.JWTConfig.IssName]) key := a.Keys[issuer] if key == nil { return nil, KeyNotFoundError{Issuer: issuer} @@ -86,17 +88,17 @@ func (a ManualAuthenticator) ACL( return false, ErrInvalidClaims } - if claims[a.JwtConfig.IssName] == nil { + if claims[a.JWTConfig.IssName] == nil { return false, ErrIssNotFound } - issuer := fmt.Sprintf("%v", claims[a.JwtConfig.IssName]) + issuer := fmt.Sprintf("%v", claims[a.JWTConfig.IssName]) - if claims[a.JwtConfig.SubName] == nil { + if claims[a.JWTConfig.SubName] == nil { return false, ErrSubNotFound } - sub, _ := claims[a.JwtConfig.SubName].(string) + sub, _ := claims[a.JWTConfig.SubName].(string) topicTemplate := a.TopicManager.ParseTopic(topic, issuer, sub) if topicTemplate == nil { From 5e437cb52d0e9105c281b2971a2f9330aa3f7c41 Mon Sep 17 00:00:00 2001 From: Parham Alvani Date: Sat, 2 Dec 2023 19:38:42 +0000 Subject: [PATCH 541/660] feat: update packages --- go.mod | 14 +++++++------- go.sum | 17 +++++++++++++++++ internal/authenticator/builder.go | 2 +- 3 files changed, 25 insertions(+), 8 deletions(-) diff --git a/go.mod b/go.mod index ef9f47ed..efebdde7 100644 --- a/go.mod +++ b/go.mod @@ -6,7 +6,7 @@ require ( github.com/ansrivas/fiberprometheus/v2 v2.6.1 github.com/gofiber/contrib/fiberzap v1.0.2 github.com/gofiber/fiber/v2 v2.51.0 - github.com/golang-jwt/jwt/v5 v5.1.0 + github.com/golang-jwt/jwt/v5 v5.2.0 github.com/knadh/koanf v1.5.0 github.com/knadh/koanf/v2 v2.0.1 github.com/speps/go-hashids/v2 v2.0.1 @@ -36,7 +36,7 @@ require ( github.com/google/uuid v1.4.0 // indirect github.com/grpc-ecosystem/grpc-gateway/v2 v2.18.1 // indirect github.com/inconshreveable/mousetrap v1.1.0 // indirect - github.com/klauspost/compress v1.17.2 // indirect + github.com/klauspost/compress v1.17.4 // indirect github.com/mattn/go-colorable v0.1.13 // indirect github.com/mattn/go-isatty v0.0.20 // indirect github.com/mattn/go-runewidth v0.0.15 // indirect @@ -52,17 +52,17 @@ require ( github.com/rivo/uniseg v0.4.4 // indirect github.com/spf13/pflag v1.0.5 // indirect github.com/valyala/bytebufferpool v1.0.0 // indirect - github.com/valyala/fasthttp v1.50.0 // indirect + github.com/valyala/fasthttp v1.51.0 // indirect github.com/valyala/tcplisten v1.0.0 // indirect go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.21.0 // indirect go.opentelemetry.io/otel/metric v1.21.0 // indirect go.opentelemetry.io/proto/otlp v1.0.0 // indirect go.uber.org/multierr v1.11.0 // indirect - golang.org/x/net v0.18.0 // indirect - golang.org/x/sys v0.14.0 // indirect + golang.org/x/net v0.19.0 // indirect + golang.org/x/sys v0.15.0 // indirect golang.org/x/text v0.14.0 // indirect - google.golang.org/genproto/googleapis/api v0.0.0-20231106174013-bbf56f31fb17 // indirect - google.golang.org/genproto/googleapis/rpc v0.0.0-20231106174013-bbf56f31fb17 // indirect + google.golang.org/genproto/googleapis/api v0.0.0-20231127180814-3a041ad873d4 // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20231127180814-3a041ad873d4 // indirect google.golang.org/grpc v1.59.0 // indirect google.golang.org/protobuf v1.31.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect diff --git a/go.sum b/go.sum index 32a60cd6..fb3712c1 100644 --- a/go.sum +++ b/go.sum @@ -84,6 +84,8 @@ github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7a github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q= github.com/golang-jwt/jwt/v5 v5.1.0 h1:UGKbA/IPjtS6zLcdB7i5TyACMgSbOTiR8qzXgw8HWQU= github.com/golang-jwt/jwt/v5 v5.1.0/go.mod h1:pqrtFR0X4osieyHYxtmOUWsAWrfe1Q5UVIyoH402zdk= +github.com/golang-jwt/jwt/v5 v5.2.0 h1:d/ix8ftRUorsN+5eMIlF4T6J8CAt9rch3My2winC1Jw= +github.com/golang-jwt/jwt/v5 v5.2.0/go.mod h1:pqrtFR0X4osieyHYxtmOUWsAWrfe1Q5UVIyoH402zdk= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= @@ -119,6 +121,7 @@ github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+ github.com/google/uuid v1.4.0 h1:MtMxsa51/r9yyhkyLsVeVt0B+BGQZzpQiTQ4eHZ8bc4= github.com/google/uuid v1.4.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0/go.mod h1:8NvIoxWQoOIhqOTXgfV/d3M/q6VIi02HzZEHgUlZvzk= +github.com/grpc-ecosystem/grpc-gateway v1.16.0 h1:gmcG1KaJ57LophUzW0Hy8NmPhnMZb4M0+kPpLofRdBo= github.com/grpc-ecosystem/grpc-gateway v1.16.0/go.mod h1:BDjrQk3hbvj6Nolgz8mAMFbcEtjT1g+wF4CSlocrBnw= github.com/grpc-ecosystem/grpc-gateway/v2 v2.18.1 h1:6UKoz5ujsI55KNpsJH3UwCq3T8kKbZwNZBNPuTTje8U= github.com/grpc-ecosystem/grpc-gateway/v2 v2.18.1/go.mod h1:YvJ2f6MplWDhfxiUC3KpyTy76kYUZA4W3pTv/wdKQ9Y= @@ -171,8 +174,11 @@ github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= github.com/klauspost/compress v1.17.2 h1:RlWWUY/Dr4fL8qk9YG7DTZ7PDgME2V4csBXA8L/ixi4= github.com/klauspost/compress v1.17.2/go.mod h1:ntbaceVETuRiXiv4DpjP66DpAtAGkEQskQzEyD//IeE= +github.com/klauspost/compress v1.17.4 h1:Ej5ixsIri7BrIjBkRZLTo6ghwrEtHFk7ijlczPW4fZ4= +github.com/klauspost/compress v1.17.4/go.mod h1:/dCuZOvVtNoHsyb+cuJD3itjs3NbnF6KH9zAO4BDxPM= github.com/knadh/koanf v1.5.0 h1:q2TSd/3Pyc/5yP9ldIrSdIz26MCcyNQzW0pEAugLPNs= github.com/knadh/koanf v1.5.0/go.mod h1:Hgyjp4y8v44hpZtPzs7JZfRAW5AhN7KfZcwv1RYggDs= +github.com/knadh/koanf/maps v0.1.1 h1:G5TjmUh2D7G2YWf5SQQqSiHRJEjaicvU0KpypqB3NIs= github.com/knadh/koanf/v2 v2.0.1 h1:1dYGITt1I23x8cfx8ZnldtezdyaZtfAuRtIFOiRzK7g= github.com/knadh/koanf/v2 v2.0.1/go.mod h1:ZeiIlIDXTE7w1lMT6UVcNiRAS2/rCeLn/GdLNvY1Dus= github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= @@ -200,6 +206,7 @@ github.com/mattn/go-isatty v0.0.20/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D github.com/mattn/go-runewidth v0.0.15 h1:UNAjwbU9l54TA3KzvqLGxwWjHmMgBUVhBiTjelZgg3U= github.com/mattn/go-runewidth v0.0.15/go.mod h1:Jdepj2loyihRzMpdS35Xk/zdY8IAYHsh153qUoGf23w= github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= +github.com/matttproud/golang_protobuf_extensions v1.0.4 h1:mmDVorXM7PCGKw94cs5zkfA9PSy5pEvNWRP0ET0TIVo= github.com/matttproud/golang_protobuf_extensions/v2 v2.0.0 h1:jWpvCLoY8Z/e3VKvlsiIGKtc+UG6U5vzxaoagmhXfyg= github.com/matttproud/golang_protobuf_extensions/v2 v2.0.0/go.mod h1:QUyp042oQthUoa9bqDv0ER0wrtXnBruoNd7aNjkbP+k= github.com/miekg/dns v1.1.26/go.mod h1:bPDLeHnStXmXAq1m/Ch/hvfNHr14JKNPMBo3VZKjuso= @@ -298,6 +305,8 @@ github.com/valyala/bytebufferpool v1.0.0 h1:GqA5TC/0021Y/b9FG4Oi9Mr3q7XYx6Kllzaw github.com/valyala/bytebufferpool v1.0.0/go.mod h1:6bBcMArwyJ5K/AmCkWv1jt77kVWyCJ6HpOuEn7z0Csc= github.com/valyala/fasthttp v1.50.0 h1:H7fweIlBm0rXLs2q0XbalvJ6r0CUPFWK3/bB4N13e9M= github.com/valyala/fasthttp v1.50.0/go.mod h1:k2zXd82h/7UZc3VOdJ2WaUqt1uZ/XpXAfE9i+HBC3lA= +github.com/valyala/fasthttp v1.51.0 h1:8b30A5JlZ6C7AS81RsWjYMQmrZG6feChmgAolCl1SqA= +github.com/valyala/fasthttp v1.51.0/go.mod h1:oI2XroL+lI7vdXyYoQk03bXBThfFl2cVdIA3Xl7cH8g= github.com/valyala/tcplisten v1.0.0 h1:rBHj/Xf+E1tRGZyWIWwJDiRY0zc1Js+CV5DqwacVSA8= github.com/valyala/tcplisten v1.0.0/go.mod h1:T0xQ8SeCZGxckz9qRXTfG43PvQ/mcWh7FwZEA7Ioqkc= github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= @@ -363,6 +372,8 @@ golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96b golang.org/x/net v0.0.0-20210410081132-afb366fc7cd1/go.mod h1:9tjilg8BloeKEkVJvy7fQ90B1CfIiPueXVOjqfkSzI8= golang.org/x/net v0.18.0 h1:mIYleuAkSbHh0tCv7RvjL3F6ZVbLjq4+R7zbOn3Kokg= golang.org/x/net v0.18.0/go.mod h1:/czyP5RqHAH4odGYxBJ1qz0+CE5WZ+2j1YgoEo8F2jQ= +golang.org/x/net v0.19.0 h1:zTwKpTd2XuCqf8huc7Fo2iSy+4RHPd10s4KzeTnVr1c= +golang.org/x/net v0.19.0/go.mod h1:CfAk/cbD4CthTvqiEl8NpboMuiuOYsAr/7NOjZJtv1U= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= @@ -409,6 +420,8 @@ golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.14.0 h1:Vz7Qs629MkJkGyHxUlRHizWJRG2j8fbQKjELVSNhy7Q= golang.org/x/sys v0.14.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.15.0 h1:h48lPFYpsTvQJZF4EKyI4aLHaev3CxivZmv7yZig9pc= +golang.org/x/sys v0.15.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.1-0.20181227161524-e6919f6577db/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= @@ -445,8 +458,12 @@ google.golang.org/genproto v0.0.0-20210602131652-f16073e35f0c/go.mod h1:UODoCrxH google.golang.org/genproto v0.0.0-20231030173426-d783a09b4405 h1:I6WNifs6pF9tNdSob2W24JtyxIYjzFB9qDlpUC76q+U= google.golang.org/genproto/googleapis/api v0.0.0-20231106174013-bbf56f31fb17 h1:JpwMPBpFN3uKhdaekDpiNlImDdkUAyiJ6ez/uxGaUSo= google.golang.org/genproto/googleapis/api v0.0.0-20231106174013-bbf56f31fb17/go.mod h1:0xJLfVdJqpAPl8tDg1ujOCGzx6LFLttXT5NhllGOXY4= +google.golang.org/genproto/googleapis/api v0.0.0-20231127180814-3a041ad873d4 h1:ZcOkrmX74HbKFYnpPY8Qsw93fC29TbJXspYKaBkSXDQ= +google.golang.org/genproto/googleapis/api v0.0.0-20231127180814-3a041ad873d4/go.mod h1:k2dtGpRrbsSyKcNPKKI5sstZkrNCZwpU/ns96JoHbGg= google.golang.org/genproto/googleapis/rpc v0.0.0-20231106174013-bbf56f31fb17 h1:Jyp0Hsi0bmHXG6k9eATXoYtjd6e2UzZ1SCn/wIupY14= google.golang.org/genproto/googleapis/rpc v0.0.0-20231106174013-bbf56f31fb17/go.mod h1:oQ5rr10WTTMvP4A36n8JpR1OrO1BEiV4f78CneXZxkA= +google.golang.org/genproto/googleapis/rpc v0.0.0-20231127180814-3a041ad873d4 h1:DC7wcm+i+P1rN3Ff07vL+OndGg5OhNddHyTA+ocPqYE= +google.golang.org/genproto/googleapis/rpc v0.0.0-20231127180814-3a041ad873d4/go.mod h1:eJVxU6o+4G1PSczBr85xmyvSNYAKvAYgkub40YGomFM= google.golang.org/grpc v1.14.0/go.mod h1:yo6s7OP7yaDglbqo1J04qKzAhqBH6lvTonzMVmEdcZw= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= google.golang.org/grpc v1.22.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= diff --git a/internal/authenticator/builder.go b/internal/authenticator/builder.go index 297a4a83..7cac4957 100644 --- a/internal/authenticator/builder.go +++ b/internal/authenticator/builder.go @@ -115,7 +115,7 @@ func (b Builder) manualAuthenticator(vendor config.Vendor) (*ManualAuthenticator vendor.IssPeerMap, b.Logger.Named("topic-manager"), ), - JwtConfig: vendor.Jwt, + JWTConfig: vendor.Jwt, Parser: jwt.NewParser(jwt.WithValidMethods([]string{vendor.Jwt.SigningMethod})), }, nil } From 7b977d9c3a596fbca2b90b4f831e86ba555a980f Mon Sep 17 00:00:00 2001 From: Parham Alvani Date: Sat, 2 Dec 2023 19:40:12 +0000 Subject: [PATCH 542/660] fix: correct issues with jwt configuration renaming --- internal/authenticator/manual_authenticator_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/authenticator/manual_authenticator_test.go b/internal/authenticator/manual_authenticator_test.go index a6aee2f0..8bb5d522 100644 --- a/internal/authenticator/manual_authenticator_test.go +++ b/internal/authenticator/manual_authenticator_test.go @@ -81,7 +81,7 @@ func (suite *ManualAuthenticatorTestSuite) SetupSuite() { Company: "snapp", Parser: jwt.NewParser(), TopicManager: topics.NewTopicManager(cfg.Topics, hid, "snapp", cfg.IssEntityMap, cfg.IssPeerMap, zap.NewNop()), - JwtConfig: config.JWT{ + JWTConfig: config.JWT{ IssName: "iss", SubName: "sub", SigningMethod: "rsa256", From c7c199f5dfbcf28011efacfa37e1ed4de87b136b Mon Sep 17 00:00:00 2001 From: Parham Alvani Date: Sat, 2 Dec 2023 19:50:45 +0000 Subject: [PATCH 543/660] feat: add test case for key not found --- .../authenticator/manual_authenticator_test.go | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/internal/authenticator/manual_authenticator_test.go b/internal/authenticator/manual_authenticator_test.go index 8bb5d522..1a5a33fd 100644 --- a/internal/authenticator/manual_authenticator_test.go +++ b/internal/authenticator/manual_authenticator_test.go @@ -27,6 +27,11 @@ type ManualAuthenticatorTestSuite struct { Driver *rsa.PublicKey } + PrivateKeys struct { + Passenger *rsa.PrivateKey + Driver *rsa.PrivateKey + } + Authenticator authenticator.Authenticator } @@ -54,11 +59,13 @@ func (suite *ManualAuthenticatorTestSuite) SetupSuite() { key0, err := getPrivateKey("0") require.NoError(err) - suite.PublicKeys.Driver = pkey0 + suite.PrivateKeys.Driver = key0 key1, err := getPrivateKey("1") require.NoError(err) + suite.PrivateKeys.Passenger = key1 + driverToken, err := getSampleToken("0", key0) require.NoError(err) @@ -103,6 +110,13 @@ func (suite *ManualAuthenticatorTestSuite) TestAuth() { suite.Run("testing invalid token auth", func() { require.Error(suite.Authenticator.Auth(invalidToken)) }) + + suite.Run("testing token with invalid iss", func() { + token, err := getSampleToken("-1", suite.PrivateKeys.Passenger) + require.NoError(err) + + require.ErrorAs(suite.Authenticator.Auth(token), new(authenticator.KeyNotFoundError)) + }) } func (suite *ManualAuthenticatorTestSuite) TestACL_Basics() { From f62e89c68973743ea27824e5a9757653a6169db4 Mon Sep 17 00:00:00 2001 From: Parham Alvani Date: Sat, 2 Dec 2023 19:52:01 +0000 Subject: [PATCH 544/660] chor: rename manual authenticator test suite --- .../authenticator/manual_authenticator_test.go | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/internal/authenticator/manual_authenticator_test.go b/internal/authenticator/manual_authenticator_test.go index 1a5a33fd..5cf54029 100644 --- a/internal/authenticator/manual_authenticator_test.go +++ b/internal/authenticator/manual_authenticator_test.go @@ -14,7 +14,7 @@ import ( "go.uber.org/zap" ) -type ManualAuthenticatorTestSuite struct { +type ManualAuthenticatorSnappTestSuite struct { suite.Suite Tokens struct { @@ -38,10 +38,10 @@ type ManualAuthenticatorTestSuite struct { func TestManualAuthenticator_suite(t *testing.T) { t.Parallel() - suite.Run(t, new(ManualAuthenticatorTestSuite)) + suite.Run(t, new(ManualAuthenticatorSnappTestSuite)) } -func (suite *ManualAuthenticatorTestSuite) SetupSuite() { +func (suite *ManualAuthenticatorSnappTestSuite) SetupSuite() { cfg := config.SnappVendor() require := suite.Require() @@ -96,7 +96,7 @@ func (suite *ManualAuthenticatorTestSuite) SetupSuite() { } } -func (suite *ManualAuthenticatorTestSuite) TestAuth() { +func (suite *ManualAuthenticatorSnappTestSuite) TestAuth() { require := suite.Require() suite.Run("testing driver token auth", func() { @@ -119,7 +119,7 @@ func (suite *ManualAuthenticatorTestSuite) TestAuth() { }) } -func (suite *ManualAuthenticatorTestSuite) TestACL_Basics() { +func (suite *ManualAuthenticatorSnappTestSuite) TestACL_Basics() { require := suite.Require() suite.Run("testing acl with invalid access type", func() { @@ -156,7 +156,7 @@ func (suite *ManualAuthenticatorTestSuite) TestACL_Basics() { } // nolint: funlen -func (suite *ManualAuthenticatorTestSuite) TestACL_Passenger() { +func (suite *ManualAuthenticatorSnappTestSuite) TestACL_Passenger() { require := suite.Require() token := suite.Tokens.Passenger @@ -228,7 +228,7 @@ func (suite *ManualAuthenticatorTestSuite) TestACL_Passenger() { } // nolint: funlen -func (suite *ManualAuthenticatorTestSuite) TestACL_Driver() { +func (suite *ManualAuthenticatorSnappTestSuite) TestACL_Driver() { require := suite.Require() token := suite.Tokens.Driver From 219c537daaa355c936fed32cd3314a1dfa409a57 Mon Sep 17 00:00:00 2001 From: Parham Alvani Date: Sat, 2 Dec 2023 20:09:37 +0000 Subject: [PATCH 545/660] chore: fix tests over authenticator --- internal/authenticator/manual_authenticator_test.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/internal/authenticator/manual_authenticator_test.go b/internal/authenticator/manual_authenticator_test.go index 5cf54029..4fd5f0c5 100644 --- a/internal/authenticator/manual_authenticator_test.go +++ b/internal/authenticator/manual_authenticator_test.go @@ -115,7 +115,9 @@ func (suite *ManualAuthenticatorSnappTestSuite) TestAuth() { token, err := getSampleToken("-1", suite.PrivateKeys.Passenger) require.NoError(err) - require.ErrorAs(suite.Authenticator.Auth(token), new(authenticator.KeyNotFoundError)) + require.ErrorIs(suite.Authenticator.Auth(token), authenticator.KeyNotFoundError{ + Issuer: "-1", + }) }) } From 67b2183baba3254f32571ac16f26db430357b18c Mon Sep 17 00:00:00 2001 From: Parham Alvani Date: Sat, 2 Dec 2023 20:15:11 +0000 Subject: [PATCH 546/660] feat: increase test coverage --- internal/authenticator/manual_authenticator_test.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/internal/authenticator/manual_authenticator_test.go b/internal/authenticator/manual_authenticator_test.go index 4fd5f0c5..202ba478 100644 --- a/internal/authenticator/manual_authenticator_test.go +++ b/internal/authenticator/manual_authenticator_test.go @@ -206,7 +206,9 @@ func (suite *ManualAuthenticatorSnappTestSuite) TestACL_Passenger() { suite.Run("testing passenger subscribe on invalid call entry topic", func() { ok, err := suite.Authenticator.ACL(acl.Pub, token, invalidPassengerCallEntryTopic) - require.Error(err) + require.ErrorIs(err, authenticator.InvalidTopicError{ + Topic: invalidPassengerCallEntryTopic, + }) require.False(ok) }) From 01029e8eb4d3b473386f55b2a4c26b5c022cba86 Mon Sep 17 00:00:00 2001 From: Parham Alvani Date: Sat, 2 Dec 2023 20:21:37 +0000 Subject: [PATCH 547/660] feat: improve authenticator tests --- internal/authenticator/manual_authenticator_test.go | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/internal/authenticator/manual_authenticator_test.go b/internal/authenticator/manual_authenticator_test.go index 202ba478..785c08c4 100644 --- a/internal/authenticator/manual_authenticator_test.go +++ b/internal/authenticator/manual_authenticator_test.go @@ -121,12 +121,11 @@ func (suite *ManualAuthenticatorSnappTestSuite) TestAuth() { }) } -func (suite *ManualAuthenticatorSnappTestSuite) TestACL_Basics() { +func (suite *ManualAuthenticatorSnappTestSuite) TestACLBasics() { require := suite.Require() suite.Run("testing acl with invalid access type", func() { ok, err := suite.Authenticator.ACL("invalid-access", suite.Tokens.Passenger, "test") - require.Error(err) require.False(ok) require.ErrorIs(err, authenticator.ErrInvalidAccessType) }) @@ -134,7 +133,6 @@ func (suite *ManualAuthenticatorSnappTestSuite) TestACL_Basics() { suite.Run("testing acl with invalid token", func() { ok, err := suite.Authenticator.ACL(acl.Pub, invalidToken, validDriverCabEventTopic) require.False(ok) - require.Error(err) require.ErrorIs(err, jwt.ErrTokenMalformed) }) @@ -158,7 +156,7 @@ func (suite *ManualAuthenticatorSnappTestSuite) TestACL_Basics() { } // nolint: funlen -func (suite *ManualAuthenticatorSnappTestSuite) TestACL_Passenger() { +func (suite *ManualAuthenticatorSnappTestSuite) TestACLPassenger() { require := suite.Require() token := suite.Tokens.Passenger @@ -232,7 +230,7 @@ func (suite *ManualAuthenticatorSnappTestSuite) TestACL_Passenger() { } // nolint: funlen -func (suite *ManualAuthenticatorSnappTestSuite) TestACL_Driver() { +func (suite *ManualAuthenticatorSnappTestSuite) TestACLDriver() { require := suite.Require() token := suite.Tokens.Driver From d614301473e3adc5fb5bcb82c24b97199daa06c0 Mon Sep 17 00:00:00 2001 From: Parham Alvani Date: Mon, 4 Dec 2023 06:19:44 +0000 Subject: [PATCH 548/660] chore: rename a field in the auto authenticator --- internal/authenticator/auto_authenticator.go | 10 +++++----- internal/authenticator/auto_authenticator_test.go | 2 +- internal/authenticator/builder.go | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/internal/authenticator/auto_authenticator.go b/internal/authenticator/auto_authenticator.go index 5775e4fb..1f1069ef 100644 --- a/internal/authenticator/auto_authenticator.go +++ b/internal/authenticator/auto_authenticator.go @@ -17,7 +17,7 @@ type AutoAuthenticator struct { AllowedAccessTypes []acl.AccessType TopicManager *topics.Manager Company string - JwtConfig config.JWT + JWTConfig config.JWT Validator validator.Client Parser *jwt.Parser } @@ -56,17 +56,17 @@ func (a AutoAuthenticator) ACL( return false, ErrInvalidClaims } - if claims[a.JwtConfig.IssName] == nil { + if claims[a.JWTConfig.IssName] == nil { return false, ErrIssNotFound } - issuer := fmt.Sprintf("%v", claims[a.JwtConfig.IssName]) + issuer := fmt.Sprintf("%v", claims[a.JWTConfig.IssName]) - if claims[a.JwtConfig.SubName] == nil { + if claims[a.JWTConfig.SubName] == nil { return false, ErrSubNotFound } - sub, _ := claims[a.JwtConfig.SubName].(string) + sub, _ := claims[a.JWTConfig.SubName].(string) topicTemplate := a.TopicManager.ParseTopic(topic, issuer, sub) if topicTemplate == nil { diff --git a/internal/authenticator/auto_authenticator_test.go b/internal/authenticator/auto_authenticator_test.go index f2870894..b269c58e 100644 --- a/internal/authenticator/auto_authenticator_test.go +++ b/internal/authenticator/auto_authenticator_test.go @@ -87,7 +87,7 @@ func (suite *AutoAuthenticatorTestSuite) SetupSuite() { Company: "snapp", Parser: jwt.NewParser(), TopicManager: topics.NewTopicManager(cfg.Topics, hid, "snapp", cfg.IssEntityMap, cfg.IssPeerMap, zap.NewNop()), - JwtConfig: config.JWT{ + JWTConfig: config.JWT{ IssName: "iss", SubName: "sub", SigningMethod: "rsa256", diff --git a/internal/authenticator/builder.go b/internal/authenticator/builder.go index 7cac4957..b16e440c 100644 --- a/internal/authenticator/builder.go +++ b/internal/authenticator/builder.go @@ -144,7 +144,7 @@ func (b Builder) autoAuthenticator(vendor config.Vendor) (*AutoAuthenticator, er vendor.IssPeerMap, b.Logger.Named("topic-manager"), ), - JwtConfig: vendor.Jwt, + JWTConfig: vendor.Jwt, Validator: client, Parser: jwt.NewParser(), }, nil From 89805dd9cfe51c3bb4ef840d0b43a12fb0a8fcb2 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 25 Dec 2023 01:31:53 +0000 Subject: [PATCH 549/660] chore(deps): bump actions/setup-python from 4 to 5 Bumps [actions/setup-python](https://github.com/actions/setup-python) from 4 to 5. - [Release notes](https://github.com/actions/setup-python/releases) - [Commits](https://github.com/actions/setup-python/compare/v4...v5) --- updated-dependencies: - dependency-name: actions/setup-python dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- .github/workflows/helm.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/helm.yaml b/.github/workflows/helm.yaml index f056e0a5..d202bf58 100644 --- a/.github/workflows/helm.yaml +++ b/.github/workflows/helm.yaml @@ -15,7 +15,7 @@ jobs: with: version: v3.13.0 - - uses: actions/setup-python@v4 + - uses: actions/setup-python@v5 with: python-version: 3.7 From 9bdf8d29984125edc955616824323a354f278995 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 25 Dec 2023 01:31:57 +0000 Subject: [PATCH 550/660] chore(deps): bump actions/setup-go from 4 to 5 Bumps [actions/setup-go](https://github.com/actions/setup-go) from 4 to 5. - [Release notes](https://github.com/actions/setup-go/releases) - [Commits](https://github.com/actions/setup-go/compare/v4...v5) --- updated-dependencies: - dependency-name: actions/setup-go dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- .github/workflows/test.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 753b5a44..18279e79 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -9,7 +9,7 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - - uses: actions/setup-go@v4 + - uses: actions/setup-go@v5 with: go-version: "1.19" - name: golangci-lint @@ -24,7 +24,7 @@ jobs: steps: - uses: extractions/setup-just@v1 - uses: actions/checkout@v4 - - uses: actions/setup-go@v4 + - uses: actions/setup-go@v5 with: go-version: "1.19" - run: go test -v ./... -covermode=atomic -coverprofile=coverage.out From 43e662e988337616ac5f041bbe1c08c0e90c598d Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 8 Jan 2024 01:29:38 +0000 Subject: [PATCH 551/660] chore(deps): bump github.com/gofiber/fiber/v2 from 2.51.0 to 2.52.0 Bumps [github.com/gofiber/fiber/v2](https://github.com/gofiber/fiber) from 2.51.0 to 2.52.0. - [Release notes](https://github.com/gofiber/fiber/releases) - [Commits](https://github.com/gofiber/fiber/compare/v2.51.0...v2.52.0) --- updated-dependencies: - dependency-name: github.com/gofiber/fiber/v2 dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- go.mod | 4 ++-- go.sum | 27 +++++---------------------- 2 files changed, 7 insertions(+), 24 deletions(-) diff --git a/go.mod b/go.mod index efebdde7..7b6f03ba 100644 --- a/go.mod +++ b/go.mod @@ -5,7 +5,7 @@ go 1.19 require ( github.com/ansrivas/fiberprometheus/v2 v2.6.1 github.com/gofiber/contrib/fiberzap v1.0.2 - github.com/gofiber/fiber/v2 v2.51.0 + github.com/gofiber/fiber/v2 v2.52.0 github.com/golang-jwt/jwt/v5 v5.2.0 github.com/knadh/koanf v1.5.0 github.com/knadh/koanf/v2 v2.0.1 @@ -33,7 +33,7 @@ require ( github.com/go-logr/stdr v1.2.2 // indirect github.com/gofiber/adaptor/v2 v2.2.1 // indirect github.com/golang/protobuf v1.5.3 // indirect - github.com/google/uuid v1.4.0 // indirect + github.com/google/uuid v1.5.0 // indirect github.com/grpc-ecosystem/grpc-gateway/v2 v2.18.1 // indirect github.com/inconshreveable/mousetrap v1.1.0 // indirect github.com/klauspost/compress v1.17.4 // indirect diff --git a/go.sum b/go.sum index fb3712c1..a6e21576 100644 --- a/go.sum +++ b/go.sum @@ -78,12 +78,10 @@ github.com/gofiber/adaptor/v2 v2.2.1 h1:givE7iViQWlsTR4Jh7tB4iXzrlKBgiraB/yTdHs9 github.com/gofiber/adaptor/v2 v2.2.1/go.mod h1:AhR16dEqs25W2FY/l8gSj1b51Azg5dtPDmm+pruNOrc= github.com/gofiber/contrib/fiberzap v1.0.2 h1:EQwhggtszVfIdBeXxN9Xrmld71es34Ufs+ef8VMqZxc= github.com/gofiber/contrib/fiberzap v1.0.2/go.mod h1:jGO8BHU4gRI9U0JtM6zj2CIhYfgVmW5JxziN8NTgVwE= -github.com/gofiber/fiber/v2 v2.51.0 h1:JNACcZy5e2tGApWB2QrRpenTWn0fq0hkFm6k0C86gKQ= -github.com/gofiber/fiber/v2 v2.51.0/go.mod h1:xaQRZQJGqnKOQnbQw+ltvku3/h8QxvNi8o6JiJ7Ll0U= +github.com/gofiber/fiber/v2 v2.52.0 h1:S+qXi7y+/Pgvqq4DrSmREGiFwtB7Bu6+QFLuIHYw/UE= +github.com/gofiber/fiber/v2 v2.52.0/go.mod h1:KEOE+cXMhXG0zHc9d8+E38hoX+ZN7bhOtgeF2oT6jrQ= github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q= -github.com/golang-jwt/jwt/v5 v5.1.0 h1:UGKbA/IPjtS6zLcdB7i5TyACMgSbOTiR8qzXgw8HWQU= -github.com/golang-jwt/jwt/v5 v5.1.0/go.mod h1:pqrtFR0X4osieyHYxtmOUWsAWrfe1Q5UVIyoH402zdk= github.com/golang-jwt/jwt/v5 v5.2.0 h1:d/ix8ftRUorsN+5eMIlF4T6J8CAt9rch3My2winC1Jw= github.com/golang-jwt/jwt/v5 v5.2.0/go.mod h1:pqrtFR0X4osieyHYxtmOUWsAWrfe1Q5UVIyoH402zdk= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= @@ -118,10 +116,9 @@ github.com/google/go-cmp v0.5.7/go.mod h1:n+brtR0CgQNWTVd5ZUFpTBC8YFBDLK/h/bpaJ8 github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/google/uuid v1.4.0 h1:MtMxsa51/r9yyhkyLsVeVt0B+BGQZzpQiTQ4eHZ8bc4= -github.com/google/uuid v1.4.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/google/uuid v1.5.0 h1:1p67kYwdtXjb0gL0BPiP1Av9wiZPo5A8z2cWkTZ+eyU= +github.com/google/uuid v1.5.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0/go.mod h1:8NvIoxWQoOIhqOTXgfV/d3M/q6VIi02HzZEHgUlZvzk= -github.com/grpc-ecosystem/grpc-gateway v1.16.0 h1:gmcG1KaJ57LophUzW0Hy8NmPhnMZb4M0+kPpLofRdBo= github.com/grpc-ecosystem/grpc-gateway v1.16.0/go.mod h1:BDjrQk3hbvj6Nolgz8mAMFbcEtjT1g+wF4CSlocrBnw= github.com/grpc-ecosystem/grpc-gateway/v2 v2.18.1 h1:6UKoz5ujsI55KNpsJH3UwCq3T8kKbZwNZBNPuTTje8U= github.com/grpc-ecosystem/grpc-gateway/v2 v2.18.1/go.mod h1:YvJ2f6MplWDhfxiUC3KpyTy76kYUZA4W3pTv/wdKQ9Y= @@ -172,13 +169,10 @@ github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7V github.com/julienschmidt/httprouter v1.3.0/go.mod h1:JR6WtHb+2LUe8TCKY3cZOxFyyO8IZAc4RVcycCCAKdM= github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8= github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= -github.com/klauspost/compress v1.17.2 h1:RlWWUY/Dr4fL8qk9YG7DTZ7PDgME2V4csBXA8L/ixi4= -github.com/klauspost/compress v1.17.2/go.mod h1:ntbaceVETuRiXiv4DpjP66DpAtAGkEQskQzEyD//IeE= github.com/klauspost/compress v1.17.4 h1:Ej5ixsIri7BrIjBkRZLTo6ghwrEtHFk7ijlczPW4fZ4= github.com/klauspost/compress v1.17.4/go.mod h1:/dCuZOvVtNoHsyb+cuJD3itjs3NbnF6KH9zAO4BDxPM= github.com/knadh/koanf v1.5.0 h1:q2TSd/3Pyc/5yP9ldIrSdIz26MCcyNQzW0pEAugLPNs= github.com/knadh/koanf v1.5.0/go.mod h1:Hgyjp4y8v44hpZtPzs7JZfRAW5AhN7KfZcwv1RYggDs= -github.com/knadh/koanf/maps v0.1.1 h1:G5TjmUh2D7G2YWf5SQQqSiHRJEjaicvU0KpypqB3NIs= github.com/knadh/koanf/v2 v2.0.1 h1:1dYGITt1I23x8cfx8ZnldtezdyaZtfAuRtIFOiRzK7g= github.com/knadh/koanf/v2 v2.0.1/go.mod h1:ZeiIlIDXTE7w1lMT6UVcNiRAS2/rCeLn/GdLNvY1Dus= github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= @@ -206,7 +200,6 @@ github.com/mattn/go-isatty v0.0.20/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D github.com/mattn/go-runewidth v0.0.15 h1:UNAjwbU9l54TA3KzvqLGxwWjHmMgBUVhBiTjelZgg3U= github.com/mattn/go-runewidth v0.0.15/go.mod h1:Jdepj2loyihRzMpdS35Xk/zdY8IAYHsh153qUoGf23w= github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= -github.com/matttproud/golang_protobuf_extensions v1.0.4 h1:mmDVorXM7PCGKw94cs5zkfA9PSy5pEvNWRP0ET0TIVo= github.com/matttproud/golang_protobuf_extensions/v2 v2.0.0 h1:jWpvCLoY8Z/e3VKvlsiIGKtc+UG6U5vzxaoagmhXfyg= github.com/matttproud/golang_protobuf_extensions/v2 v2.0.0/go.mod h1:QUyp042oQthUoa9bqDv0ER0wrtXnBruoNd7aNjkbP+k= github.com/miekg/dns v1.1.26/go.mod h1:bPDLeHnStXmXAq1m/Ch/hvfNHr14JKNPMBo3VZKjuso= @@ -303,8 +296,6 @@ github.com/tidwall/pretty v1.2.1 h1:qjsOFOWWQl+N3RsoF5/ssm1pHmJJwhjlSbZ51I6wMl4= github.com/tidwall/pretty v1.2.1/go.mod h1:ITEVvHYasfjBbM0u2Pg8T2nJnzm8xPwvNhhsoaGGjNU= github.com/valyala/bytebufferpool v1.0.0 h1:GqA5TC/0021Y/b9FG4Oi9Mr3q7XYx6KllzawFIhcdPw= github.com/valyala/bytebufferpool v1.0.0/go.mod h1:6bBcMArwyJ5K/AmCkWv1jt77kVWyCJ6HpOuEn7z0Csc= -github.com/valyala/fasthttp v1.50.0 h1:H7fweIlBm0rXLs2q0XbalvJ6r0CUPFWK3/bB4N13e9M= -github.com/valyala/fasthttp v1.50.0/go.mod h1:k2zXd82h/7UZc3VOdJ2WaUqt1uZ/XpXAfE9i+HBC3lA= github.com/valyala/fasthttp v1.51.0 h1:8b30A5JlZ6C7AS81RsWjYMQmrZG6feChmgAolCl1SqA= github.com/valyala/fasthttp v1.51.0/go.mod h1:oI2XroL+lI7vdXyYoQk03bXBThfFl2cVdIA3Xl7cH8g= github.com/valyala/tcplisten v1.0.0 h1:rBHj/Xf+E1tRGZyWIWwJDiRY0zc1Js+CV5DqwacVSA8= @@ -370,8 +361,6 @@ golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwY golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM= golang.org/x/net v0.0.0-20210410081132-afb366fc7cd1/go.mod h1:9tjilg8BloeKEkVJvy7fQ90B1CfIiPueXVOjqfkSzI8= -golang.org/x/net v0.18.0 h1:mIYleuAkSbHh0tCv7RvjL3F6ZVbLjq4+R7zbOn3Kokg= -golang.org/x/net v0.18.0/go.mod h1:/czyP5RqHAH4odGYxBJ1qz0+CE5WZ+2j1YgoEo8F2jQ= golang.org/x/net v0.19.0 h1:zTwKpTd2XuCqf8huc7Fo2iSy+4RHPd10s4KzeTnVr1c= golang.org/x/net v0.19.0/go.mod h1:CfAk/cbD4CthTvqiEl8NpboMuiuOYsAr/7NOjZJtv1U= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= @@ -418,8 +407,6 @@ golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20210603081109-ebe580a85c40/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.14.0 h1:Vz7Qs629MkJkGyHxUlRHizWJRG2j8fbQKjELVSNhy7Q= -golang.org/x/sys v0.14.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/sys v0.15.0 h1:h48lPFYpsTvQJZF4EKyI4aLHaev3CxivZmv7yZig9pc= golang.org/x/sys v0.15.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= @@ -455,13 +442,9 @@ google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98 google.golang.org/genproto v0.0.0-20200513103714-09dca8ec2884/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo= google.golang.org/genproto v0.0.0-20210602131652-f16073e35f0c/go.mod h1:UODoCrxHCcBojKKwX1terBiRUaqAsFqJiF615XL43r0= -google.golang.org/genproto v0.0.0-20231030173426-d783a09b4405 h1:I6WNifs6pF9tNdSob2W24JtyxIYjzFB9qDlpUC76q+U= -google.golang.org/genproto/googleapis/api v0.0.0-20231106174013-bbf56f31fb17 h1:JpwMPBpFN3uKhdaekDpiNlImDdkUAyiJ6ez/uxGaUSo= -google.golang.org/genproto/googleapis/api v0.0.0-20231106174013-bbf56f31fb17/go.mod h1:0xJLfVdJqpAPl8tDg1ujOCGzx6LFLttXT5NhllGOXY4= +google.golang.org/genproto v0.0.0-20231120223509-83a465c0220f h1:Vn+VyHU5guc9KjB5KrjI2q0wCOWEOIh0OEsleqakHJg= google.golang.org/genproto/googleapis/api v0.0.0-20231127180814-3a041ad873d4 h1:ZcOkrmX74HbKFYnpPY8Qsw93fC29TbJXspYKaBkSXDQ= google.golang.org/genproto/googleapis/api v0.0.0-20231127180814-3a041ad873d4/go.mod h1:k2dtGpRrbsSyKcNPKKI5sstZkrNCZwpU/ns96JoHbGg= -google.golang.org/genproto/googleapis/rpc v0.0.0-20231106174013-bbf56f31fb17 h1:Jyp0Hsi0bmHXG6k9eATXoYtjd6e2UzZ1SCn/wIupY14= -google.golang.org/genproto/googleapis/rpc v0.0.0-20231106174013-bbf56f31fb17/go.mod h1:oQ5rr10WTTMvP4A36n8JpR1OrO1BEiV4f78CneXZxkA= google.golang.org/genproto/googleapis/rpc v0.0.0-20231127180814-3a041ad873d4 h1:DC7wcm+i+P1rN3Ff07vL+OndGg5OhNddHyTA+ocPqYE= google.golang.org/genproto/googleapis/rpc v0.0.0-20231127180814-3a041ad873d4/go.mod h1:eJVxU6o+4G1PSczBr85xmyvSNYAKvAYgkub40YGomFM= google.golang.org/grpc v1.14.0/go.mod h1:yo6s7OP7yaDglbqo1J04qKzAhqBH6lvTonzMVmEdcZw= From 17763b80783755c0ad2d15e1c36b44bffe2f38b0 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 22 Jan 2024 01:38:37 +0000 Subject: [PATCH 552/660] chore(deps): bump go.opentelemetry.io/otel/trace from 1.21.0 to 1.22.0 Bumps [go.opentelemetry.io/otel/trace](https://github.com/open-telemetry/opentelemetry-go) from 1.21.0 to 1.22.0. - [Release notes](https://github.com/open-telemetry/opentelemetry-go/releases) - [Changelog](https://github.com/open-telemetry/opentelemetry-go/blob/main/CHANGELOG.md) - [Commits](https://github.com/open-telemetry/opentelemetry-go/compare/v1.21.0...v1.22.0) --- updated-dependencies: - dependency-name: go.opentelemetry.io/otel/trace dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- go.mod | 8 ++++---- go.sum | 16 ++++++++-------- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/go.mod b/go.mod index 7b6f03ba..b391b9aa 100644 --- a/go.mod +++ b/go.mod @@ -13,10 +13,10 @@ require ( github.com/spf13/cobra v1.8.0 github.com/stretchr/testify v1.8.4 github.com/tidwall/pretty v1.2.1 - go.opentelemetry.io/otel v1.21.0 + go.opentelemetry.io/otel v1.22.0 go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.21.0 go.opentelemetry.io/otel/sdk v1.21.0 - go.opentelemetry.io/otel/trace v1.21.0 + go.opentelemetry.io/otel/trace v1.22.0 go.uber.org/automaxprocs v1.5.3 go.uber.org/zap v1.26.0 ) @@ -29,7 +29,7 @@ require ( github.com/davecgh/go-spew v1.1.1 // indirect github.com/fatih/structs v1.1.0 // indirect github.com/fsnotify/fsnotify v1.7.0 // indirect - github.com/go-logr/logr v1.3.0 // indirect + github.com/go-logr/logr v1.4.1 // indirect github.com/go-logr/stdr v1.2.2 // indirect github.com/gofiber/adaptor/v2 v2.2.1 // indirect github.com/golang/protobuf v1.5.3 // indirect @@ -55,7 +55,7 @@ require ( github.com/valyala/fasthttp v1.51.0 // indirect github.com/valyala/tcplisten v1.0.0 // indirect go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.21.0 // indirect - go.opentelemetry.io/otel/metric v1.21.0 // indirect + go.opentelemetry.io/otel/metric v1.22.0 // indirect go.opentelemetry.io/proto/otlp v1.0.0 // indirect go.uber.org/multierr v1.11.0 // indirect golang.org/x/net v0.19.0 // indirect diff --git a/go.sum b/go.sum index a6e21576..fc7f9d7b 100644 --- a/go.sum +++ b/go.sum @@ -67,8 +67,8 @@ github.com/go-logfmt/logfmt v0.3.0/go.mod h1:Qt1PoO58o5twSAckw1HlFXLmHsOX5/0LbT9 github.com/go-logfmt/logfmt v0.4.0/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V4qmtdjCk= github.com/go-logfmt/logfmt v0.5.0/go.mod h1:wCYkCAKZfumFQihp8CzCvQ3paCTfi41vtzG1KdI/P7A= github.com/go-logr/logr v1.2.2/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= -github.com/go-logr/logr v1.3.0 h1:2y3SDp0ZXuc6/cjLSZ+Q3ir+QB9T/iG5yYRXqsagWSY= -github.com/go-logr/logr v1.3.0/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY= +github.com/go-logr/logr v1.4.1 h1:pKouT5E8xu9zeFC39JXRDukb6JFQPXM5p5I91188VAQ= +github.com/go-logr/logr v1.4.1/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY= github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag= github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE= github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= @@ -306,18 +306,18 @@ github.com/yuin/goldmark v1.3.5/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1 go.etcd.io/etcd/api/v3 v3.5.4/go.mod h1:5GB2vv4A4AOn3yk7MftYGHkUfGtDHnEraIjym4dYz5A= go.etcd.io/etcd/client/pkg/v3 v3.5.4/go.mod h1:IJHfcCEKxYu1Os13ZdwCwIUTUVGYTSAM3YSwc9/Ac1g= go.etcd.io/etcd/client/v3 v3.5.4/go.mod h1:ZaRkVgBZC+L+dLCjTcF1hRXpgZXQPOvnA/Ak/gq3kiY= -go.opentelemetry.io/otel v1.21.0 h1:hzLeKBZEL7Okw2mGzZ0cc4k/A7Fta0uoPgaJCr8fsFc= -go.opentelemetry.io/otel v1.21.0/go.mod h1:QZzNPQPm1zLX4gZK4cMi+71eaorMSGT3A4znnUvNNEo= +go.opentelemetry.io/otel v1.22.0 h1:xS7Ku+7yTFvDfDraDIJVpw7XPyuHlB9MCiqqX5mcJ6Y= +go.opentelemetry.io/otel v1.22.0/go.mod h1:eoV4iAi3Ea8LkAEI9+GFT44O6T/D0GWAVFyZVCC6pMI= go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.21.0 h1:cl5P5/GIfFh4t6xyruOgJP5QiA1pw4fYYdv6nc6CBWw= go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.21.0/go.mod h1:zgBdWWAu7oEEMC06MMKc5NLbA/1YDXV1sMpSqEeLQLg= go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.21.0 h1:tIqheXEFWAZ7O8A7m+J0aPTmpJN3YQ7qetUAdkkkKpk= go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.21.0/go.mod h1:nUeKExfxAQVbiVFn32YXpXZZHZ61Cc3s3Rn1pDBGAb0= -go.opentelemetry.io/otel/metric v1.21.0 h1:tlYWfeo+Bocx5kLEloTjbcDwBuELRrIFxwdQ36PlJu4= -go.opentelemetry.io/otel/metric v1.21.0/go.mod h1:o1p3CA8nNHW8j5yuQLdc1eeqEaPfzug24uvsyIEJRWM= +go.opentelemetry.io/otel/metric v1.22.0 h1:lypMQnGyJYeuYPhOM/bgjbFM6WE44W1/T45er4d8Hhg= +go.opentelemetry.io/otel/metric v1.22.0/go.mod h1:evJGjVpZv0mQ5QBRJoBF64yMuOf4xCWdXjK8pzFvliY= go.opentelemetry.io/otel/sdk v1.21.0 h1:FTt8qirL1EysG6sTQRZ5TokkU8d0ugCj8htOgThZXQ8= go.opentelemetry.io/otel/sdk v1.21.0/go.mod h1:Nna6Yv7PWTdgJHVRD9hIYywQBRx7pbox6nwBnZIxl/E= -go.opentelemetry.io/otel/trace v1.21.0 h1:WD9i5gzvoUPuXIXH24ZNBudiarZDKuekPqi/E8fpfLc= -go.opentelemetry.io/otel/trace v1.21.0/go.mod h1:LGbsEB0f9LGjN+OZaQQ26sohbOmiMR+BaslueVtS/qQ= +go.opentelemetry.io/otel/trace v1.22.0 h1:Hg6pPujv0XG9QaVbGOBVHunyuLcCC3jN7WEhPx83XD0= +go.opentelemetry.io/otel/trace v1.22.0/go.mod h1:RbbHXVqKES9QhzZq/fE5UnOSILqRt40a21sPw2He1xo= go.opentelemetry.io/proto/otlp v1.0.0 h1:T0TX0tmXU8a3CbNXzEKGeU5mIVOdf0oykP+u2lIVU/I= go.opentelemetry.io/proto/otlp v1.0.0/go.mod h1:Sy6pihPLfYHkr3NkUbEhGHFhINUSI/v80hjKIs5JXpM= go.uber.org/atomic v1.7.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc= From 72f6d82f746804c1f0166bb8a645312b0c822025 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 22 Jan 2024 03:15:56 +0000 Subject: [PATCH 553/660] chore(deps): bump go.opentelemetry.io/otel/sdk from 1.21.0 to 1.22.0 Bumps [go.opentelemetry.io/otel/sdk](https://github.com/open-telemetry/opentelemetry-go) from 1.21.0 to 1.22.0. - [Release notes](https://github.com/open-telemetry/opentelemetry-go/releases) - [Changelog](https://github.com/open-telemetry/opentelemetry-go/blob/main/CHANGELOG.md) - [Commits](https://github.com/open-telemetry/opentelemetry-go/compare/v1.21.0...v1.22.0) --- updated-dependencies: - dependency-name: go.opentelemetry.io/otel/sdk dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- go.mod | 4 ++-- go.sum | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/go.mod b/go.mod index b391b9aa..e8d80680 100644 --- a/go.mod +++ b/go.mod @@ -15,7 +15,7 @@ require ( github.com/tidwall/pretty v1.2.1 go.opentelemetry.io/otel v1.22.0 go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.21.0 - go.opentelemetry.io/otel/sdk v1.21.0 + go.opentelemetry.io/otel/sdk v1.22.0 go.opentelemetry.io/otel/trace v1.22.0 go.uber.org/automaxprocs v1.5.3 go.uber.org/zap v1.26.0 @@ -59,7 +59,7 @@ require ( go.opentelemetry.io/proto/otlp v1.0.0 // indirect go.uber.org/multierr v1.11.0 // indirect golang.org/x/net v0.19.0 // indirect - golang.org/x/sys v0.15.0 // indirect + golang.org/x/sys v0.16.0 // indirect golang.org/x/text v0.14.0 // indirect google.golang.org/genproto/googleapis/api v0.0.0-20231127180814-3a041ad873d4 // indirect google.golang.org/genproto/googleapis/rpc v0.0.0-20231127180814-3a041ad873d4 // indirect diff --git a/go.sum b/go.sum index fc7f9d7b..f19ea539 100644 --- a/go.sum +++ b/go.sum @@ -314,8 +314,8 @@ go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.21.0 h1:tIqhe go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.21.0/go.mod h1:nUeKExfxAQVbiVFn32YXpXZZHZ61Cc3s3Rn1pDBGAb0= go.opentelemetry.io/otel/metric v1.22.0 h1:lypMQnGyJYeuYPhOM/bgjbFM6WE44W1/T45er4d8Hhg= go.opentelemetry.io/otel/metric v1.22.0/go.mod h1:evJGjVpZv0mQ5QBRJoBF64yMuOf4xCWdXjK8pzFvliY= -go.opentelemetry.io/otel/sdk v1.21.0 h1:FTt8qirL1EysG6sTQRZ5TokkU8d0ugCj8htOgThZXQ8= -go.opentelemetry.io/otel/sdk v1.21.0/go.mod h1:Nna6Yv7PWTdgJHVRD9hIYywQBRx7pbox6nwBnZIxl/E= +go.opentelemetry.io/otel/sdk v1.22.0 h1:6coWHw9xw7EfClIC/+O31R8IY3/+EiRFHevmHafB2Gw= +go.opentelemetry.io/otel/sdk v1.22.0/go.mod h1:iu7luyVGYovrRpe2fmj3CVKouQNdTOkxtLzPvPz1DOc= go.opentelemetry.io/otel/trace v1.22.0 h1:Hg6pPujv0XG9QaVbGOBVHunyuLcCC3jN7WEhPx83XD0= go.opentelemetry.io/otel/trace v1.22.0/go.mod h1:RbbHXVqKES9QhzZq/fE5UnOSILqRt40a21sPw2He1xo= go.opentelemetry.io/proto/otlp v1.0.0 h1:T0TX0tmXU8a3CbNXzEKGeU5mIVOdf0oykP+u2lIVU/I= @@ -407,8 +407,8 @@ golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20210603081109-ebe580a85c40/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.15.0 h1:h48lPFYpsTvQJZF4EKyI4aLHaev3CxivZmv7yZig9pc= -golang.org/x/sys v0.15.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.16.0 h1:xWw16ngr6ZMtmxDyKyIgsE93KNKz5HKmMa3b8ALHidU= +golang.org/x/sys v0.16.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.1-0.20181227161524-e6919f6577db/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= From 9cac63a57d9df9efc5adbe35555f9932123d53cd Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 22 Jan 2024 03:16:32 +0000 Subject: [PATCH 554/660] chore(deps): bump go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc Bumps [go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc](https://github.com/open-telemetry/opentelemetry-go) from 1.21.0 to 1.22.0. - [Release notes](https://github.com/open-telemetry/opentelemetry-go/releases) - [Changelog](https://github.com/open-telemetry/opentelemetry-go/blob/main/CHANGELOG.md) - [Commits](https://github.com/open-telemetry/opentelemetry-go/compare/v1.21.0...v1.22.0) --- updated-dependencies: - dependency-name: go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- go.mod | 8 ++++---- go.sum | 16 ++++++++-------- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/go.mod b/go.mod index e8d80680..bb683c96 100644 --- a/go.mod +++ b/go.mod @@ -14,7 +14,7 @@ require ( github.com/stretchr/testify v1.8.4 github.com/tidwall/pretty v1.2.1 go.opentelemetry.io/otel v1.22.0 - go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.21.0 + go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.22.0 go.opentelemetry.io/otel/sdk v1.22.0 go.opentelemetry.io/otel/trace v1.22.0 go.uber.org/automaxprocs v1.5.3 @@ -54,7 +54,7 @@ require ( github.com/valyala/bytebufferpool v1.0.0 // indirect github.com/valyala/fasthttp v1.51.0 // indirect github.com/valyala/tcplisten v1.0.0 // indirect - go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.21.0 // indirect + go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.22.0 // indirect go.opentelemetry.io/otel/metric v1.22.0 // indirect go.opentelemetry.io/proto/otlp v1.0.0 // indirect go.uber.org/multierr v1.11.0 // indirect @@ -63,7 +63,7 @@ require ( golang.org/x/text v0.14.0 // indirect google.golang.org/genproto/googleapis/api v0.0.0-20231127180814-3a041ad873d4 // indirect google.golang.org/genproto/googleapis/rpc v0.0.0-20231127180814-3a041ad873d4 // indirect - google.golang.org/grpc v1.59.0 // indirect - google.golang.org/protobuf v1.31.0 // indirect + google.golang.org/grpc v1.60.1 // indirect + google.golang.org/protobuf v1.32.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect ) diff --git a/go.sum b/go.sum index f19ea539..eec963b8 100644 --- a/go.sum +++ b/go.sum @@ -308,10 +308,10 @@ go.etcd.io/etcd/client/pkg/v3 v3.5.4/go.mod h1:IJHfcCEKxYu1Os13ZdwCwIUTUVGYTSAM3 go.etcd.io/etcd/client/v3 v3.5.4/go.mod h1:ZaRkVgBZC+L+dLCjTcF1hRXpgZXQPOvnA/Ak/gq3kiY= go.opentelemetry.io/otel v1.22.0 h1:xS7Ku+7yTFvDfDraDIJVpw7XPyuHlB9MCiqqX5mcJ6Y= go.opentelemetry.io/otel v1.22.0/go.mod h1:eoV4iAi3Ea8LkAEI9+GFT44O6T/D0GWAVFyZVCC6pMI= -go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.21.0 h1:cl5P5/GIfFh4t6xyruOgJP5QiA1pw4fYYdv6nc6CBWw= -go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.21.0/go.mod h1:zgBdWWAu7oEEMC06MMKc5NLbA/1YDXV1sMpSqEeLQLg= -go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.21.0 h1:tIqheXEFWAZ7O8A7m+J0aPTmpJN3YQ7qetUAdkkkKpk= -go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.21.0/go.mod h1:nUeKExfxAQVbiVFn32YXpXZZHZ61Cc3s3Rn1pDBGAb0= +go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.22.0 h1:9M3+rhx7kZCIQQhQRYaZCdNu1V73tm4TvXs2ntl98C4= +go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.22.0/go.mod h1:noq80iT8rrHP1SfybmPiRGc9dc5M8RPmGvtwo7Oo7tc= +go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.22.0 h1:H2JFgRcGiyHg7H7bwcwaQJYrNFqCqrbTQ8K4p1OvDu8= +go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.22.0/go.mod h1:WfCWp1bGoYK8MeULtI15MmQVczfR+bFkk0DF3h06QmQ= go.opentelemetry.io/otel/metric v1.22.0 h1:lypMQnGyJYeuYPhOM/bgjbFM6WE44W1/T45er4d8Hhg= go.opentelemetry.io/otel/metric v1.22.0/go.mod h1:evJGjVpZv0mQ5QBRJoBF64yMuOf4xCWdXjK8pzFvliY= go.opentelemetry.io/otel/sdk v1.22.0 h1:6coWHw9xw7EfClIC/+O31R8IY3/+EiRFHevmHafB2Gw= @@ -455,8 +455,8 @@ google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQ google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= google.golang.org/grpc v1.33.1/go.mod h1:fr5YgcSWrqhRRxogOsw7RzIpsmvOZ6IcH4kBYTpR3n0= google.golang.org/grpc v1.38.0/go.mod h1:NREThFqKR1f3iQ6oBuvc5LadQuXVGo9rkm5ZGrQdJfM= -google.golang.org/grpc v1.59.0 h1:Z5Iec2pjwb+LEOqzpB2MR12/eKFhDPhuqW91O+4bwUk= -google.golang.org/grpc v1.59.0/go.mod h1:aUPDwccQo6OTjy7Hct4AfBPD1GptF4fyUjIkQ9YtF98= +google.golang.org/grpc v1.60.1 h1:26+wFr+cNqSGFcOXcabYC0lUVJVRa2Sb2ortSK7VrEU= +google.golang.org/grpc v1.60.1/go.mod h1:OlCHIeLYqSSsLi6i49B5QGdzaMZK9+M7LXN2FKz4eGM= 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= @@ -468,8 +468,8 @@ google.golang.org/protobuf v1.23.1-0.20200526195155-81db48ad09cc/go.mod h1:EGpAD google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c= google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= -google.golang.org/protobuf v1.31.0 h1:g0LDEJHgrBl9N9r17Ru3sqWhkIx2NB67okBHPwC7hs8= -google.golang.org/protobuf v1.31.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= +google.golang.org/protobuf v1.32.0 h1:pPC6BG5ex8PDFnkbrGU3EixyhKcQ2aDuBS36lqK/C7I= +google.golang.org/protobuf v1.32.0/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos= gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= gopkg.in/asn1-ber.v1 v1.0.0-20181015200546-f715ec2f112d/go.mod h1:cuepJuh7vyXfUyUwEgHQXw849cJrilpS5NeIjOWESAw= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= From 70f524748d0dcf010d8700f5832cb43f65d4a5c5 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 29 Jan 2024 01:51:02 +0000 Subject: [PATCH 555/660] chore(deps): bump codecov/codecov-action from 3.1.4 to 3.1.5 Bumps [codecov/codecov-action](https://github.com/codecov/codecov-action) from 3.1.4 to 3.1.5. - [Release notes](https://github.com/codecov/codecov-action/releases) - [Changelog](https://github.com/codecov/codecov-action/blob/main/CHANGELOG.md) - [Commits](https://github.com/codecov/codecov-action/compare/v3.1.4...v3.1.5) --- updated-dependencies: - dependency-name: codecov/codecov-action dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- .github/workflows/test.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 18279e79..95452be5 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -28,7 +28,7 @@ jobs: with: go-version: "1.19" - run: go test -v ./... -covermode=atomic -coverprofile=coverage.out - - uses: codecov/codecov-action@v3.1.4 + - uses: codecov/codecov-action@v3.1.5 with: files: coverage.out From db99f7f437083d12f1cbbc73e1bd64d17a87e789 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 5 Feb 2024 01:24:38 +0000 Subject: [PATCH 556/660] chore(deps): bump github.com/knadh/koanf/v2 from 2.0.1 to 2.0.2 Bumps [github.com/knadh/koanf/v2](https://github.com/knadh/koanf) from 2.0.1 to 2.0.2. - [Release notes](https://github.com/knadh/koanf/releases) - [Commits](https://github.com/knadh/koanf/compare/v2.0.1...v2.0.2) --- updated-dependencies: - dependency-name: github.com/knadh/koanf/v2 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- go.mod | 4 ++-- go.sum | 7 ++++--- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/go.mod b/go.mod index bb683c96..945c1ca8 100644 --- a/go.mod +++ b/go.mod @@ -8,7 +8,7 @@ require ( github.com/gofiber/fiber/v2 v2.52.0 github.com/golang-jwt/jwt/v5 v5.2.0 github.com/knadh/koanf v1.5.0 - github.com/knadh/koanf/v2 v2.0.1 + github.com/knadh/koanf/v2 v2.0.2 github.com/speps/go-hashids/v2 v2.0.1 github.com/spf13/cobra v1.8.0 github.com/stretchr/testify v1.8.4 @@ -31,6 +31,7 @@ require ( github.com/fsnotify/fsnotify v1.7.0 // indirect github.com/go-logr/logr v1.4.1 // indirect github.com/go-logr/stdr v1.2.2 // indirect + github.com/go-viper/mapstructure/v2 v2.0.0-alpha.1 // indirect github.com/gofiber/adaptor/v2 v2.2.1 // indirect github.com/golang/protobuf v1.5.3 // indirect github.com/google/uuid v1.5.0 // indirect @@ -42,7 +43,6 @@ require ( github.com/mattn/go-runewidth v0.0.15 // indirect github.com/matttproud/golang_protobuf_extensions/v2 v2.0.0 // indirect github.com/mitchellh/copystructure v1.2.0 // indirect - github.com/mitchellh/mapstructure v1.5.0 // indirect github.com/mitchellh/reflectwalk v1.0.2 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect github.com/prometheus/client_golang v1.17.0 // indirect diff --git a/go.sum b/go.sum index eec963b8..e051ccc6 100644 --- a/go.sum +++ b/go.sum @@ -73,6 +73,8 @@ github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag= github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE= github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= github.com/go-test/deep v1.0.2-0.20181118220953-042da051cf31/go.mod h1:wGDj63lr65AM2AQyKZd/NYHGb0R+1RLqB8NKt3aSFNA= +github.com/go-viper/mapstructure/v2 v2.0.0-alpha.1 h1:TQcrn6Wq+sKGkpyPvppOz99zsMBaUOKXq6HSv655U1c= +github.com/go-viper/mapstructure/v2 v2.0.0-alpha.1/go.mod h1:oJDH3BJKyqBA2TXFhDsKDGDTlndYOZ6rGS0BRZIxGhM= github.com/godbus/dbus/v5 v5.0.4/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA= github.com/gofiber/adaptor/v2 v2.2.1 h1:givE7iViQWlsTR4Jh7tB4iXzrlKBgiraB/yTdHs9Lv4= github.com/gofiber/adaptor/v2 v2.2.1/go.mod h1:AhR16dEqs25W2FY/l8gSj1b51Azg5dtPDmm+pruNOrc= @@ -173,8 +175,8 @@ github.com/klauspost/compress v1.17.4 h1:Ej5ixsIri7BrIjBkRZLTo6ghwrEtHFk7ijlczPW github.com/klauspost/compress v1.17.4/go.mod h1:/dCuZOvVtNoHsyb+cuJD3itjs3NbnF6KH9zAO4BDxPM= github.com/knadh/koanf v1.5.0 h1:q2TSd/3Pyc/5yP9ldIrSdIz26MCcyNQzW0pEAugLPNs= github.com/knadh/koanf v1.5.0/go.mod h1:Hgyjp4y8v44hpZtPzs7JZfRAW5AhN7KfZcwv1RYggDs= -github.com/knadh/koanf/v2 v2.0.1 h1:1dYGITt1I23x8cfx8ZnldtezdyaZtfAuRtIFOiRzK7g= -github.com/knadh/koanf/v2 v2.0.1/go.mod h1:ZeiIlIDXTE7w1lMT6UVcNiRAS2/rCeLn/GdLNvY1Dus= +github.com/knadh/koanf/v2 v2.0.2 h1:sEZzPW2rVWSahcYILNq/syJdEyRafZIG0l9aWwL86HA= +github.com/knadh/koanf/v2 v2.0.2/go.mod h1:HN9uZ+qFAejH1e4G41gnoffIanINWQuONLXiV7kir6k= github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/konsorten/go-windows-terminal-sequences v1.0.3/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc= @@ -215,7 +217,6 @@ github.com/mitchellh/go-testing-interface v1.0.0/go.mod h1:kRemZodwjscx+RGhAo8eI github.com/mitchellh/go-wordwrap v1.0.0/go.mod h1:ZXFpozHsX6DPmq2I0TCekCxypsnAUbP2oI0UX1GXzOo= github.com/mitchellh/mapstructure v0.0.0-20160808181253-ca63d7c062ee/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= -github.com/mitchellh/mapstructure v1.5.0 h1:jeMsZIYE/09sWLaz43PL7Gy6RuMjD2eJVyuac5Z2hdY= github.com/mitchellh/mapstructure v1.5.0/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= github.com/mitchellh/reflectwalk v1.0.0/go.mod h1:mSTlrgnPZtwu0c4WaC2kGObEpuNDbx0jmZXqmk4esnw= github.com/mitchellh/reflectwalk v1.0.2 h1:G2LzWKi524PWgd3mLHV8Y5k7s6XUvT0Gef6zxSIeXaQ= From 942c7c3062af59c3f267e2a0f95eb3caa5b57583 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 5 Feb 2024 01:36:44 +0000 Subject: [PATCH 557/660] chore(deps): bump codecov/codecov-action from 3.1.5 to 4.0.1 Bumps [codecov/codecov-action](https://github.com/codecov/codecov-action) from 3.1.5 to 4.0.1. - [Release notes](https://github.com/codecov/codecov-action/releases) - [Changelog](https://github.com/codecov/codecov-action/blob/main/CHANGELOG.md) - [Commits](https://github.com/codecov/codecov-action/compare/v3.1.5...v4.0.1) --- updated-dependencies: - dependency-name: codecov/codecov-action dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- .github/workflows/test.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 95452be5..b9b1cfea 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -28,7 +28,7 @@ jobs: with: go-version: "1.19" - run: go test -v ./... -covermode=atomic -coverprofile=coverage.out - - uses: codecov/codecov-action@v3.1.5 + - uses: codecov/codecov-action@v4.0.1 with: files: coverage.out From b7df16aa8b07369305cfadcc56767237d1bafdd7 Mon Sep 17 00:00:00 2001 From: Parham Alvani Date: Mon, 12 Feb 2024 04:01:34 +0000 Subject: [PATCH 558/660] feat: update packages --- go.mod | 40 ++++++++++++++++++++-------------------- go.sum | 44 ++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 64 insertions(+), 20 deletions(-) diff --git a/go.mod b/go.mod index 945c1ca8..4bc762db 100644 --- a/go.mod +++ b/go.mod @@ -8,21 +8,21 @@ require ( github.com/gofiber/fiber/v2 v2.52.0 github.com/golang-jwt/jwt/v5 v5.2.0 github.com/knadh/koanf v1.5.0 - github.com/knadh/koanf/v2 v2.0.2 + github.com/knadh/koanf/v2 v2.1.0 github.com/speps/go-hashids/v2 v2.0.1 github.com/spf13/cobra v1.8.0 github.com/stretchr/testify v1.8.4 github.com/tidwall/pretty v1.2.1 - go.opentelemetry.io/otel v1.22.0 - go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.22.0 - go.opentelemetry.io/otel/sdk v1.22.0 - go.opentelemetry.io/otel/trace v1.22.0 + go.opentelemetry.io/otel v1.23.1 + go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.23.1 + go.opentelemetry.io/otel/sdk v1.23.1 + go.opentelemetry.io/otel/trace v1.23.1 go.uber.org/automaxprocs v1.5.3 go.uber.org/zap v1.26.0 ) require ( - github.com/andybalholm/brotli v1.0.6 // indirect + github.com/andybalholm/brotli v1.1.0 // indirect github.com/beorn7/perks v1.0.1 // indirect github.com/cenkalti/backoff/v4 v4.2.1 // indirect github.com/cespare/xxhash/v2 v2.2.0 // indirect @@ -34,10 +34,10 @@ require ( github.com/go-viper/mapstructure/v2 v2.0.0-alpha.1 // indirect github.com/gofiber/adaptor/v2 v2.2.1 // indirect github.com/golang/protobuf v1.5.3 // indirect - github.com/google/uuid v1.5.0 // indirect - github.com/grpc-ecosystem/grpc-gateway/v2 v2.18.1 // indirect + github.com/google/uuid v1.6.0 // indirect + github.com/grpc-ecosystem/grpc-gateway/v2 v2.19.1 // indirect github.com/inconshreveable/mousetrap v1.1.0 // indirect - github.com/klauspost/compress v1.17.4 // indirect + github.com/klauspost/compress v1.17.6 // indirect github.com/mattn/go-colorable v0.1.13 // indirect github.com/mattn/go-isatty v0.0.20 // indirect github.com/mattn/go-runewidth v0.0.15 // indirect @@ -45,25 +45,25 @@ require ( github.com/mitchellh/copystructure v1.2.0 // indirect github.com/mitchellh/reflectwalk v1.0.2 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect - github.com/prometheus/client_golang v1.17.0 // indirect + github.com/prometheus/client_golang v1.18.0 // indirect github.com/prometheus/client_model v0.5.0 // indirect - github.com/prometheus/common v0.45.0 // indirect + github.com/prometheus/common v0.46.0 // indirect github.com/prometheus/procfs v0.12.0 // indirect - github.com/rivo/uniseg v0.4.4 // indirect + github.com/rivo/uniseg v0.4.7 // indirect github.com/spf13/pflag v1.0.5 // indirect github.com/valyala/bytebufferpool v1.0.0 // indirect github.com/valyala/fasthttp v1.51.0 // indirect github.com/valyala/tcplisten v1.0.0 // indirect - go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.22.0 // indirect - go.opentelemetry.io/otel/metric v1.22.0 // indirect - go.opentelemetry.io/proto/otlp v1.0.0 // indirect + go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.23.1 // indirect + go.opentelemetry.io/otel/metric v1.23.1 // indirect + go.opentelemetry.io/proto/otlp v1.1.0 // indirect go.uber.org/multierr v1.11.0 // indirect - golang.org/x/net v0.19.0 // indirect - golang.org/x/sys v0.16.0 // indirect + golang.org/x/net v0.21.0 // indirect + golang.org/x/sys v0.17.0 // indirect golang.org/x/text v0.14.0 // indirect - google.golang.org/genproto/googleapis/api v0.0.0-20231127180814-3a041ad873d4 // indirect - google.golang.org/genproto/googleapis/rpc v0.0.0-20231127180814-3a041ad873d4 // indirect - google.golang.org/grpc v1.60.1 // indirect + google.golang.org/genproto/googleapis/api v0.0.0-20240205150955-31a09d347014 // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20240205150955-31a09d347014 // indirect + google.golang.org/grpc v1.61.0 // indirect google.golang.org/protobuf v1.32.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect ) diff --git a/go.sum b/go.sum index e051ccc6..a5f2b7c3 100644 --- a/go.sum +++ b/go.sum @@ -8,6 +8,8 @@ github.com/alecthomas/units v0.0.0-20190717042225-c3de453c63f4/go.mod h1:ybxpYRF github.com/alecthomas/units v0.0.0-20190924025748-f65c72e2690d/go.mod h1:rBZYJk541a8SKzHPHnH3zbiI+7dagKZ0cgpgrD7Fyho= github.com/andybalholm/brotli v1.0.6 h1:Yf9fFpf49Zrxb9NlQaluyE92/+X7UVHlhMNJN2sxfOI= github.com/andybalholm/brotli v1.0.6/go.mod h1:fO7iG3H7G2nSZ7m0zPUDn85XEX2GTukHGRSepvi9Eig= +github.com/andybalholm/brotli v1.1.0 h1:eLKJA0d02Lf0mVpIDgYnqXcUn0GqVmEFny3VuID1U3M= +github.com/andybalholm/brotli v1.1.0/go.mod h1:sms7XGricyQI9K10gOSf56VKKWS4oLer58Q+mhRPtnY= github.com/ansrivas/fiberprometheus/v2 v2.6.1 h1:wac3pXaE6BYYTF04AC6K0ktk6vCD+MnDOJZ3SK66kXM= github.com/ansrivas/fiberprometheus/v2 v2.6.1/go.mod h1:MloIKvy4yN6hVqlRpJ/jDiR244YnWJaQC0FIqS8A+MY= github.com/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kdvxnR2qWY= @@ -120,10 +122,15 @@ github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/ github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.5.0 h1:1p67kYwdtXjb0gL0BPiP1Av9wiZPo5A8z2cWkTZ+eyU= github.com/google/uuid v1.5.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +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/grpc-ecosystem/go-grpc-prometheus v1.2.0/go.mod h1:8NvIoxWQoOIhqOTXgfV/d3M/q6VIi02HzZEHgUlZvzk= +github.com/grpc-ecosystem/grpc-gateway v1.16.0 h1:gmcG1KaJ57LophUzW0Hy8NmPhnMZb4M0+kPpLofRdBo= github.com/grpc-ecosystem/grpc-gateway v1.16.0/go.mod h1:BDjrQk3hbvj6Nolgz8mAMFbcEtjT1g+wF4CSlocrBnw= github.com/grpc-ecosystem/grpc-gateway/v2 v2.18.1 h1:6UKoz5ujsI55KNpsJH3UwCq3T8kKbZwNZBNPuTTje8U= github.com/grpc-ecosystem/grpc-gateway/v2 v2.18.1/go.mod h1:YvJ2f6MplWDhfxiUC3KpyTy76kYUZA4W3pTv/wdKQ9Y= +github.com/grpc-ecosystem/grpc-gateway/v2 v2.19.1 h1:/c3QmbOGMGTOumP2iT/rCwB7b0QDGLKzqOmktBjT+Is= +github.com/grpc-ecosystem/grpc-gateway/v2 v2.19.1/go.mod h1:5SN9VR2LTsRFsrEC6FHgRbTWrTHu6tqPeKxEQv15giM= github.com/hashicorp/consul/api v1.13.0/go.mod h1:ZlVrynguJKcYr54zGaDbaL3fOvKC9m72FhPvA8T35KQ= github.com/hashicorp/consul/sdk v0.8.0/go.mod h1:GBvyrGALthsZObzUGsfgHZQDXjg4lOjagTIwIR1vPms= github.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= @@ -173,10 +180,15 @@ github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= github.com/klauspost/compress v1.17.4 h1:Ej5ixsIri7BrIjBkRZLTo6ghwrEtHFk7ijlczPW4fZ4= github.com/klauspost/compress v1.17.4/go.mod h1:/dCuZOvVtNoHsyb+cuJD3itjs3NbnF6KH9zAO4BDxPM= +github.com/klauspost/compress v1.17.6 h1:60eq2E/jlfwQXtvZEeBUYADs+BwKBWURIY+Gj2eRGjI= +github.com/klauspost/compress v1.17.6/go.mod h1:/dCuZOvVtNoHsyb+cuJD3itjs3NbnF6KH9zAO4BDxPM= github.com/knadh/koanf v1.5.0 h1:q2TSd/3Pyc/5yP9ldIrSdIz26MCcyNQzW0pEAugLPNs= github.com/knadh/koanf v1.5.0/go.mod h1:Hgyjp4y8v44hpZtPzs7JZfRAW5AhN7KfZcwv1RYggDs= +github.com/knadh/koanf/maps v0.1.1 h1:G5TjmUh2D7G2YWf5SQQqSiHRJEjaicvU0KpypqB3NIs= github.com/knadh/koanf/v2 v2.0.2 h1:sEZzPW2rVWSahcYILNq/syJdEyRafZIG0l9aWwL86HA= github.com/knadh/koanf/v2 v2.0.2/go.mod h1:HN9uZ+qFAejH1e4G41gnoffIanINWQuONLXiV7kir6k= +github.com/knadh/koanf/v2 v2.1.0 h1:eh4QmHHBuU8BybfIJ8mB8K8gsGCD/AUQTdwGq/GzId8= +github.com/knadh/koanf/v2 v2.1.0/go.mod h1:4mnTRbZCK+ALuBXHZMjDfG9y714L7TykVnZkXbMU3Es= github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/konsorten/go-windows-terminal-sequences v1.0.3/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc= @@ -202,6 +214,7 @@ github.com/mattn/go-isatty v0.0.20/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D github.com/mattn/go-runewidth v0.0.15 h1:UNAjwbU9l54TA3KzvqLGxwWjHmMgBUVhBiTjelZgg3U= github.com/mattn/go-runewidth v0.0.15/go.mod h1:Jdepj2loyihRzMpdS35Xk/zdY8IAYHsh153qUoGf23w= github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= +github.com/matttproud/golang_protobuf_extensions v1.0.4 h1:mmDVorXM7PCGKw94cs5zkfA9PSy5pEvNWRP0ET0TIVo= github.com/matttproud/golang_protobuf_extensions/v2 v2.0.0 h1:jWpvCLoY8Z/e3VKvlsiIGKtc+UG6U5vzxaoagmhXfyg= github.com/matttproud/golang_protobuf_extensions/v2 v2.0.0/go.mod h1:QUyp042oQthUoa9bqDv0ER0wrtXnBruoNd7aNjkbP+k= github.com/miekg/dns v1.1.26/go.mod h1:bPDLeHnStXmXAq1m/Ch/hvfNHr14JKNPMBo3VZKjuso= @@ -247,6 +260,8 @@ github.com/prometheus/client_golang v1.7.1/go.mod h1:PY5Wy2awLA44sXw4AOSfFBetzPP github.com/prometheus/client_golang v1.11.1/go.mod h1:Z6t4BnS23TR94PD6BsDNk8yVqroYurpAkEiz0P2BEV0= github.com/prometheus/client_golang v1.17.0 h1:rl2sfwZMtSthVU752MqfjQozy7blglC+1SOtjMAMh+Q= github.com/prometheus/client_golang v1.17.0/go.mod h1:VeL+gMmOAxkS2IqfCq0ZmHSL+LjWfWDUmp1mBz9JgUY= +github.com/prometheus/client_golang v1.18.0 h1:HzFfmkOzH5Q8L8G+kSJKUx5dtG87sewO+FoDDqP5Tbk= +github.com/prometheus/client_golang v1.18.0/go.mod h1:T+GXkCk5wSJyOqMIzVgvvjFDlkOQntgjkJWKrN5txjA= github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= @@ -258,6 +273,8 @@ github.com/prometheus/common v0.10.0/go.mod h1:Tlit/dnDKsSWFlCLTWaA1cyBgKHSMdTB8 github.com/prometheus/common v0.26.0/go.mod h1:M7rCNAaPfAosfx8veZJCuw84e35h3Cfd9VFqTh1DIvc= github.com/prometheus/common v0.45.0 h1:2BGz0eBc2hdMDLnO/8n0jeB3oPrt2D08CekT0lneoxM= github.com/prometheus/common v0.45.0/go.mod h1:YJmSTw9BoKxJplESWWxlbyttQR4uaEcGyv9MZjVOJsY= +github.com/prometheus/common v0.46.0 h1:doXzt5ybi1HBKpsZOL0sSkaNHJJqkyfEWZGGqqScV0Y= +github.com/prometheus/common v0.46.0/go.mod h1:Tp0qkxpb9Jsg54QMe+EAmqXkSV7Evdy1BTn+g2pa/hQ= github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= github.com/prometheus/procfs v0.1.3/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU= @@ -268,6 +285,8 @@ github.com/rhnvrm/simples3 v0.6.1/go.mod h1:Y+3vYm2V7Y4VijFoJHHTrja6OgPrJ2cBti8d github.com/rivo/uniseg v0.2.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc= github.com/rivo/uniseg v0.4.4 h1:8TfxU8dW6PdqD27gjM8MVNuicgxIjxpm4K7x4jp8sis= github.com/rivo/uniseg v0.4.4/go.mod h1:FN3SvrM+Zdj16jyLfmOkMNblXMcoc8DfTHruCPUcx88= +github.com/rivo/uniseg v0.4.7 h1:WUdvkW8uEhrYfLC4ZzdpI2ztxP1I582+49Oc5Mq64VQ= +github.com/rivo/uniseg v0.4.7/go.mod h1:FN3SvrM+Zdj16jyLfmOkMNblXMcoc8DfTHruCPUcx88= github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6LYCDYWNEvQ= github.com/rogpeppe/go-internal v1.10.0 h1:TMyTOH3F/DB16zRVcYyreMH6GnZZrwQVAoYjRBZyWFQ= github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= @@ -309,18 +328,32 @@ go.etcd.io/etcd/client/pkg/v3 v3.5.4/go.mod h1:IJHfcCEKxYu1Os13ZdwCwIUTUVGYTSAM3 go.etcd.io/etcd/client/v3 v3.5.4/go.mod h1:ZaRkVgBZC+L+dLCjTcF1hRXpgZXQPOvnA/Ak/gq3kiY= go.opentelemetry.io/otel v1.22.0 h1:xS7Ku+7yTFvDfDraDIJVpw7XPyuHlB9MCiqqX5mcJ6Y= go.opentelemetry.io/otel v1.22.0/go.mod h1:eoV4iAi3Ea8LkAEI9+GFT44O6T/D0GWAVFyZVCC6pMI= +go.opentelemetry.io/otel v1.23.1 h1:Za4UzOqJYS+MUczKI320AtqZHZb7EqxO00jAHE0jmQY= +go.opentelemetry.io/otel v1.23.1/go.mod h1:Td0134eafDLcTS4y+zQ26GE8u3dEuRBiBCTUIRHaikA= go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.22.0 h1:9M3+rhx7kZCIQQhQRYaZCdNu1V73tm4TvXs2ntl98C4= go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.22.0/go.mod h1:noq80iT8rrHP1SfybmPiRGc9dc5M8RPmGvtwo7Oo7tc= +go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.23.1 h1:o8iWeVFa1BcLtVEV0LzrCxV2/55tB3xLxADr6Kyoey4= +go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.23.1/go.mod h1:SEVfdK4IoBnbT2FXNM/k8yC08MrfbhWk3U4ljM8B3HE= go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.22.0 h1:H2JFgRcGiyHg7H7bwcwaQJYrNFqCqrbTQ8K4p1OvDu8= go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.22.0/go.mod h1:WfCWp1bGoYK8MeULtI15MmQVczfR+bFkk0DF3h06QmQ= +go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.23.1 h1:p3A5+f5l9e/kuEBwLOrnpkIDHQFlHmbiVxMURWRK6gQ= +go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.23.1/go.mod h1:OClrnXUjBqQbInvjJFjYSnMxBSCXBF8r3b34WqjiIrQ= go.opentelemetry.io/otel/metric v1.22.0 h1:lypMQnGyJYeuYPhOM/bgjbFM6WE44W1/T45er4d8Hhg= go.opentelemetry.io/otel/metric v1.22.0/go.mod h1:evJGjVpZv0mQ5QBRJoBF64yMuOf4xCWdXjK8pzFvliY= +go.opentelemetry.io/otel/metric v1.23.1 h1:PQJmqJ9u2QaJLBOELl1cxIdPcpbwzbkjfEyelTl2rlo= +go.opentelemetry.io/otel/metric v1.23.1/go.mod h1:mpG2QPlAfnK8yNhNJAxDZruU9Y1/HubbC+KyH8FaCWI= go.opentelemetry.io/otel/sdk v1.22.0 h1:6coWHw9xw7EfClIC/+O31R8IY3/+EiRFHevmHafB2Gw= go.opentelemetry.io/otel/sdk v1.22.0/go.mod h1:iu7luyVGYovrRpe2fmj3CVKouQNdTOkxtLzPvPz1DOc= +go.opentelemetry.io/otel/sdk v1.23.1 h1:O7JmZw0h76if63LQdsBMKQDWNb5oEcOThG9IrxscV+E= +go.opentelemetry.io/otel/sdk v1.23.1/go.mod h1:LzdEVR5am1uKOOwfBWFef2DCi1nu3SA8XQxx2IerWFk= go.opentelemetry.io/otel/trace v1.22.0 h1:Hg6pPujv0XG9QaVbGOBVHunyuLcCC3jN7WEhPx83XD0= go.opentelemetry.io/otel/trace v1.22.0/go.mod h1:RbbHXVqKES9QhzZq/fE5UnOSILqRt40a21sPw2He1xo= +go.opentelemetry.io/otel/trace v1.23.1 h1:4LrmmEd8AU2rFvU1zegmvqW7+kWarxtNOPyeL6HmYY8= +go.opentelemetry.io/otel/trace v1.23.1/go.mod h1:4IpnpJFwr1mo/6HL8XIPJaE9y0+u1KcVmuW7dwFSVrI= go.opentelemetry.io/proto/otlp v1.0.0 h1:T0TX0tmXU8a3CbNXzEKGeU5mIVOdf0oykP+u2lIVU/I= go.opentelemetry.io/proto/otlp v1.0.0/go.mod h1:Sy6pihPLfYHkr3NkUbEhGHFhINUSI/v80hjKIs5JXpM= +go.opentelemetry.io/proto/otlp v1.1.0 h1:2Di21piLrCqJ3U3eXGCTPHE9R8Nh+0uglSnOyxikMeI= +go.opentelemetry.io/proto/otlp v1.1.0/go.mod h1:GpBHCBWiqvVLDqmHZsoMM3C5ySeKTC7ej/RNTae6MdY= go.uber.org/atomic v1.7.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc= go.uber.org/automaxprocs v1.5.3 h1:kWazyxZUrS3Gs4qUpbwo5kEIMGe/DAvi5Z4tl2NW4j8= go.uber.org/automaxprocs v1.5.3/go.mod h1:eRbA25aqJrxAbsLO0xy5jVwPt7FQnRgjW+efnwa1WM0= @@ -364,6 +397,8 @@ golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96b golang.org/x/net v0.0.0-20210410081132-afb366fc7cd1/go.mod h1:9tjilg8BloeKEkVJvy7fQ90B1CfIiPueXVOjqfkSzI8= golang.org/x/net v0.19.0 h1:zTwKpTd2XuCqf8huc7Fo2iSy+4RHPd10s4KzeTnVr1c= golang.org/x/net v0.19.0/go.mod h1:CfAk/cbD4CthTvqiEl8NpboMuiuOYsAr/7NOjZJtv1U= +golang.org/x/net v0.21.0 h1:AQyQV4dYCvJ7vGmJyKki9+PBdyvhkSd8EIx/qb0AYv4= +golang.org/x/net v0.21.0/go.mod h1:bIjVDfnllIU7BJ2DNgfnXvpSvtn8VRwhlsaeUTyUS44= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= @@ -410,6 +445,8 @@ golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.16.0 h1:xWw16ngr6ZMtmxDyKyIgsE93KNKz5HKmMa3b8ALHidU= golang.org/x/sys v0.16.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.17.0 h1:25cE3gD+tdBA7lp7QfhuV+rJiE9YXTcS3VG1SqssI/Y= +golang.org/x/sys v0.17.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.1-0.20181227161524-e6919f6577db/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= @@ -444,10 +481,15 @@ google.golang.org/genproto v0.0.0-20200513103714-09dca8ec2884/go.mod h1:55QSHmfG google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo= google.golang.org/genproto v0.0.0-20210602131652-f16073e35f0c/go.mod h1:UODoCrxHCcBojKKwX1terBiRUaqAsFqJiF615XL43r0= google.golang.org/genproto v0.0.0-20231120223509-83a465c0220f h1:Vn+VyHU5guc9KjB5KrjI2q0wCOWEOIh0OEsleqakHJg= +google.golang.org/genproto v0.0.0-20240125205218-1f4bbc51befe h1:USL2DhxfgRchafRvt/wYyyQNzwgL7ZiURcozOE/Pkvo= google.golang.org/genproto/googleapis/api v0.0.0-20231127180814-3a041ad873d4 h1:ZcOkrmX74HbKFYnpPY8Qsw93fC29TbJXspYKaBkSXDQ= google.golang.org/genproto/googleapis/api v0.0.0-20231127180814-3a041ad873d4/go.mod h1:k2dtGpRrbsSyKcNPKKI5sstZkrNCZwpU/ns96JoHbGg= +google.golang.org/genproto/googleapis/api v0.0.0-20240205150955-31a09d347014 h1:x9PwdEgd11LgK+orcck69WVRo7DezSO4VUMPI4xpc8A= +google.golang.org/genproto/googleapis/api v0.0.0-20240205150955-31a09d347014/go.mod h1:rbHMSEDyoYX62nRVLOCc4Qt1HbsdytAYoVwgjiOhF3I= google.golang.org/genproto/googleapis/rpc v0.0.0-20231127180814-3a041ad873d4 h1:DC7wcm+i+P1rN3Ff07vL+OndGg5OhNddHyTA+ocPqYE= google.golang.org/genproto/googleapis/rpc v0.0.0-20231127180814-3a041ad873d4/go.mod h1:eJVxU6o+4G1PSczBr85xmyvSNYAKvAYgkub40YGomFM= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240205150955-31a09d347014 h1:FSL3lRCkhaPFxqi0s9o+V4UI2WTzAVOvkgbd4kVV4Wg= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240205150955-31a09d347014/go.mod h1:SaPjaZGWb0lPqs6Ittu0spdfrOArqji4ZdeP5IC/9N4= google.golang.org/grpc v1.14.0/go.mod h1:yo6s7OP7yaDglbqo1J04qKzAhqBH6lvTonzMVmEdcZw= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= google.golang.org/grpc v1.22.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= @@ -458,6 +500,8 @@ google.golang.org/grpc v1.33.1/go.mod h1:fr5YgcSWrqhRRxogOsw7RzIpsmvOZ6IcH4kBYTp google.golang.org/grpc v1.38.0/go.mod h1:NREThFqKR1f3iQ6oBuvc5LadQuXVGo9rkm5ZGrQdJfM= google.golang.org/grpc v1.60.1 h1:26+wFr+cNqSGFcOXcabYC0lUVJVRa2Sb2ortSK7VrEU= google.golang.org/grpc v1.60.1/go.mod h1:OlCHIeLYqSSsLi6i49B5QGdzaMZK9+M7LXN2FKz4eGM= +google.golang.org/grpc v1.61.0 h1:TOvOcuXn30kRao+gfcvsebNEa5iZIiLkisYEkf7R7o0= +google.golang.org/grpc v1.61.0/go.mod h1:VUbo7IFqmF1QtCAstipjG0GIoq49KvMe9+h1jFLBNJs= 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= From 913d468bbb32966cba12f2cf37c8899ba053b879 Mon Sep 17 00:00:00 2001 From: Parham Alvani Date: Mon, 12 Feb 2024 04:02:12 +0000 Subject: [PATCH 559/660] feat: update actions --- .github/workflows/test.yaml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index b9b1cfea..8485716f 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -13,7 +13,7 @@ jobs: with: go-version: "1.19" - name: golangci-lint - uses: golangci/golangci-lint-action@v3 + uses: golangci/golangci-lint-action@v4 with: version: latest args: --enable-all --timeout=30m @@ -22,7 +22,6 @@ jobs: name: test runs-on: ubuntu-latest steps: - - uses: extractions/setup-just@v1 - uses: actions/checkout@v4 - uses: actions/setup-go@v5 with: From 40409ce51d75a4c50a583fad1bcb0d254762a654 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 12 Feb 2024 04:04:18 +0000 Subject: [PATCH 560/660] chore(deps): bump helm/kind-action from 1.8.0 to 1.9.0 Dependabot couldn't find the original pull request head commit, 8f8c025ae965a275482b9506feb49ec37f83381c. --- .github/workflows/helm.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/helm.yaml b/.github/workflows/helm.yaml index d202bf58..2b167b79 100644 --- a/.github/workflows/helm.yaml +++ b/.github/workflows/helm.yaml @@ -26,7 +26,7 @@ jobs: run: ct lint --all - name: create kind cluster - uses: helm/kind-action@v1.8.0 + uses: helm/kind-action@v1.9.0 - name: run chart-testing (install) run: ct install --all From b418ce4c5d2d207997274119113121d2bc40c5d0 Mon Sep 17 00:00:00 2001 From: Parham Alvani Date: Mon, 12 Feb 2024 04:14:20 +0000 Subject: [PATCH 561/660] fix: correct lint issues --- internal/api/api_test.go | 8 +++----- internal/authenticator/admin_authenticator.go | 1 + internal/authenticator/auto_authenticator.go | 2 +- internal/authenticator/auto_authenticator_test.go | 3 ++- internal/authenticator/manual_authenticator.go | 5 +++++ internal/authenticator/manual_authenticator_test.go | 1 + internal/topics/manager_test.go | 1 + 7 files changed, 14 insertions(+), 7 deletions(-) diff --git a/internal/api/api_test.go b/internal/api/api_test.go index fd1e8f1e..c4cc70fc 100644 --- a/internal/api/api_test.go +++ b/internal/api/api_test.go @@ -102,13 +102,11 @@ func TestExtractVendorToken(t *testing.T) { t.Run(tt.name, func(t *testing.T) { t.Parallel() + vendor, token := api.ExtractVendorToken(tt.fields.Token, tt.fields.Username, tt.fields.Password) - if vendor != tt.vendor { + if vendor != tt.vendor || token != tt.token { t.Errorf("ExtractVendorToken() vendor = %v, vendor %v", vendor, tt.vendor) } - if token != tt.token { - t.Errorf("ExtractVendorToken() token = %v, vendor %v", token, tt.token) - } }) } } @@ -176,7 +174,7 @@ func (suite *APITestSuite) ValidToken() { body, err := json.Marshal(api.AuthRequest{ Token: "", - Username: fmt.Sprintf("snapp-admin:%s", token), + Username: "snapp-admin:" + token, Password: "", }) require.NoError(err) diff --git a/internal/authenticator/admin_authenticator.go b/internal/authenticator/admin_authenticator.go index 1e7516d0..f7212771 100644 --- a/internal/authenticator/admin_authenticator.go +++ b/internal/authenticator/admin_authenticator.go @@ -27,6 +27,7 @@ func (a AdminAuthenticator) Auth(tokenString string) error { if !ok { return nil, ErrInvalidClaims } + if claims[a.JwtConfig.IssName] == nil { return nil, ErrIssNotFound } diff --git a/internal/authenticator/auto_authenticator.go b/internal/authenticator/auto_authenticator.go index 1f1069ef..3b58371f 100644 --- a/internal/authenticator/auto_authenticator.go +++ b/internal/authenticator/auto_authenticator.go @@ -32,7 +32,7 @@ func (a AutoAuthenticator) Auth(tokenString string) error { "X-APP-Version": []string{""}, "X-APP-Name": []string{"soteria"}, "locale": []string{"en-US"}, - }, fmt.Sprintf("bearer %s", tokenString)); err != nil { + }, "bearer "+tokenString); err != nil { return fmt.Errorf("token is invalid: %w", err) } diff --git a/internal/authenticator/auto_authenticator_test.go b/internal/authenticator/auto_authenticator_test.go index b269c58e..c2c9acf9 100644 --- a/internal/authenticator/auto_authenticator_test.go +++ b/internal/authenticator/auto_authenticator_test.go @@ -63,7 +63,7 @@ func (suite *AutoAuthenticatorTestSuite) SetupSuite() { tokenString := strings.TrimPrefix(authHeader, "bearer ") _, err := jwt.Parse(tokenString, func( - token *jwt.Token, + _ *jwt.Token, ) (interface{}, error) { return pkey0, nil }) @@ -128,6 +128,7 @@ func TestAutoAuthenticator_ValidateTopicBySender(t *testing.T) { t.Run("testing valid driver cab event", func(t *testing.T) { t.Parallel() + topicTemplate := authenticator.TopicManager.ParseTopic(validDriverCabEventTopic, topics.DriverIss, "DXKgaNQa7N5Y7bo") require.NotNil(t, topicTemplate) }) diff --git a/internal/authenticator/manual_authenticator.go b/internal/authenticator/manual_authenticator.go index 73b61efc..28f46ee5 100644 --- a/internal/authenticator/manual_authenticator.go +++ b/internal/authenticator/manual_authenticator.go @@ -29,11 +29,13 @@ func (a ManualAuthenticator) Auth(tokenString string) error { if !ok { return nil, ErrInvalidClaims } + if claims[a.JWTConfig.IssName] == nil { return nil, ErrIssNotFound } issuer := fmt.Sprintf("%v", claims[a.JWTConfig.IssName]) + key := a.Keys[issuer] if key == nil { return nil, KeyNotFoundError{Issuer: issuer} @@ -64,14 +66,17 @@ func (a ManualAuthenticator) ACL( if !ok { return nil, ErrInvalidClaims } + if claims[a.JWTConfig.IssName] == nil { return nil, ErrIssNotFound } + if claims[a.JWTConfig.SubName] == nil { return nil, ErrSubNotFound } issuer := fmt.Sprintf("%v", claims[a.JWTConfig.IssName]) + key := a.Keys[issuer] if key == nil { return nil, KeyNotFoundError{Issuer: issuer} diff --git a/internal/authenticator/manual_authenticator_test.go b/internal/authenticator/manual_authenticator_test.go index 785c08c4..67ca0ed5 100644 --- a/internal/authenticator/manual_authenticator_test.go +++ b/internal/authenticator/manual_authenticator_test.go @@ -336,6 +336,7 @@ func TestManualAuthenticator_ValidateTopicBySender(t *testing.T) { t.Run("testing valid driver cab event", func(t *testing.T) { t.Parallel() + topicTemplate := authenticator.TopicManager.ParseTopic(validDriverCabEventTopic, topics.DriverIss, "DXKgaNQa7N5Y7bo") require.NotNil(t, topicTemplate) }) diff --git a/internal/topics/manager_test.go b/internal/topics/manager_test.go index f61e3ca5..4314fe5f 100644 --- a/internal/topics/manager_test.go +++ b/internal/topics/manager_test.go @@ -146,6 +146,7 @@ func TestTopicManager(t *testing.T) { t.Parallel() topic := tc.arg + topicTemplate := topicManager.ParseTopic(topic, tc.issuer, sub) if topicTemplate != nil { if len(tc.want) == 0 { From ca6e6956123bff4085be52f2e9f3f1a4f9b0aada Mon Sep 17 00:00:00 2001 From: Parham Alvani Date: Tue, 20 Feb 2024 22:53:32 +0000 Subject: [PATCH 562/660] feat: update packages --- go.mod | 14 +++++++------- go.sum | 14 ++++++++++++++ 2 files changed, 21 insertions(+), 7 deletions(-) diff --git a/go.mod b/go.mod index 4bc762db..a2955075 100644 --- a/go.mod +++ b/go.mod @@ -18,7 +18,7 @@ require ( go.opentelemetry.io/otel/sdk v1.23.1 go.opentelemetry.io/otel/trace v1.23.1 go.uber.org/automaxprocs v1.5.3 - go.uber.org/zap v1.26.0 + go.uber.org/zap v1.27.0 ) require ( @@ -46,13 +46,13 @@ require ( github.com/mitchellh/reflectwalk v1.0.2 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect github.com/prometheus/client_golang v1.18.0 // indirect - github.com/prometheus/client_model v0.5.0 // indirect - github.com/prometheus/common v0.46.0 // indirect + github.com/prometheus/client_model v0.6.0 // indirect + github.com/prometheus/common v0.47.0 // indirect github.com/prometheus/procfs v0.12.0 // indirect github.com/rivo/uniseg v0.4.7 // indirect github.com/spf13/pflag v1.0.5 // indirect github.com/valyala/bytebufferpool v1.0.0 // indirect - github.com/valyala/fasthttp v1.51.0 // indirect + github.com/valyala/fasthttp v1.52.0 // indirect github.com/valyala/tcplisten v1.0.0 // indirect go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.23.1 // indirect go.opentelemetry.io/otel/metric v1.23.1 // indirect @@ -61,9 +61,9 @@ require ( golang.org/x/net v0.21.0 // indirect golang.org/x/sys v0.17.0 // indirect golang.org/x/text v0.14.0 // indirect - google.golang.org/genproto/googleapis/api v0.0.0-20240205150955-31a09d347014 // indirect - google.golang.org/genproto/googleapis/rpc v0.0.0-20240205150955-31a09d347014 // indirect - google.golang.org/grpc v1.61.0 // indirect + google.golang.org/genproto/googleapis/api v0.0.0-20240213162025-012b6fc9bca9 // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20240213162025-012b6fc9bca9 // indirect + google.golang.org/grpc v1.61.1 // indirect google.golang.org/protobuf v1.32.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect ) diff --git a/go.sum b/go.sum index a5f2b7c3..493f81ff 100644 --- a/go.sum +++ b/go.sum @@ -268,6 +268,8 @@ github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1: github.com/prometheus/client_model v0.2.0/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/client_model v0.5.0 h1:VQw1hfvPvk3Uv6Qf29VrPF32JB6rtbgI6cYPYQjL0Qw= github.com/prometheus/client_model v0.5.0/go.mod h1:dTiFglRmd66nLR9Pv9f0mZi7B7fk5Pm3gvsjB5tr+kI= +github.com/prometheus/client_model v0.6.0 h1:k1v3CzpSRUTrKMppY35TLwPvxHqBu0bYgxZzqGIgaos= +github.com/prometheus/client_model v0.6.0/go.mod h1:NTQHnmxFpouOD0DpvP4XujX3CdOAGQPoaGhyTchlyt8= github.com/prometheus/common v0.4.1/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= github.com/prometheus/common v0.10.0/go.mod h1:Tlit/dnDKsSWFlCLTWaA1cyBgKHSMdTB80sz/V91rCo= github.com/prometheus/common v0.26.0/go.mod h1:M7rCNAaPfAosfx8veZJCuw84e35h3Cfd9VFqTh1DIvc= @@ -275,6 +277,8 @@ github.com/prometheus/common v0.45.0 h1:2BGz0eBc2hdMDLnO/8n0jeB3oPrt2D08CekT0lne github.com/prometheus/common v0.45.0/go.mod h1:YJmSTw9BoKxJplESWWxlbyttQR4uaEcGyv9MZjVOJsY= github.com/prometheus/common v0.46.0 h1:doXzt5ybi1HBKpsZOL0sSkaNHJJqkyfEWZGGqqScV0Y= github.com/prometheus/common v0.46.0/go.mod h1:Tp0qkxpb9Jsg54QMe+EAmqXkSV7Evdy1BTn+g2pa/hQ= +github.com/prometheus/common v0.47.0 h1:p5Cz0FNHo7SnWOmWmoRozVcjEp0bIVU8cV7OShpjL1k= +github.com/prometheus/common v0.47.0/go.mod h1:0/KsvlIEfPQCQ5I2iNSAWKPZziNCvRs5EC6ILDTlAPc= github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= github.com/prometheus/procfs v0.1.3/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU= @@ -318,6 +322,8 @@ github.com/valyala/bytebufferpool v1.0.0 h1:GqA5TC/0021Y/b9FG4Oi9Mr3q7XYx6Kllzaw github.com/valyala/bytebufferpool v1.0.0/go.mod h1:6bBcMArwyJ5K/AmCkWv1jt77kVWyCJ6HpOuEn7z0Csc= github.com/valyala/fasthttp v1.51.0 h1:8b30A5JlZ6C7AS81RsWjYMQmrZG6feChmgAolCl1SqA= github.com/valyala/fasthttp v1.51.0/go.mod h1:oI2XroL+lI7vdXyYoQk03bXBThfFl2cVdIA3Xl7cH8g= +github.com/valyala/fasthttp v1.52.0 h1:wqBQpxH71XW0e2g+Og4dzQM8pk34aFYlA1Ga8db7gU0= +github.com/valyala/fasthttp v1.52.0/go.mod h1:hf5C4QnVMkNXMspnsUlfM3WitlgYflyhHYoKol/szxQ= github.com/valyala/tcplisten v1.0.0 h1:rBHj/Xf+E1tRGZyWIWwJDiRY0zc1Js+CV5DqwacVSA8= github.com/valyala/tcplisten v1.0.0/go.mod h1:T0xQ8SeCZGxckz9qRXTfG43PvQ/mcWh7FwZEA7Ioqkc= github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= @@ -364,6 +370,8 @@ go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN8 go.uber.org/zap v1.17.0/go.mod h1:MXVU+bhUf/A7Xi2HNOnopQOrmycQ5Ih87HtOu4q5SSo= go.uber.org/zap v1.26.0 h1:sI7k6L95XOKS281NhVKOFCUNIvv9e0w4BF8N3u+tCRo= go.uber.org/zap v1.26.0/go.mod h1:dtElttAiwGvoJ/vj4IwHBS/gXsEu/pZ50mUIRWuG0so= +go.uber.org/zap v1.27.0 h1:aJMhYGrd5QSmlpLMr2MftRKl7t8J8PTZPA732ud/XR8= +go.uber.org/zap v1.27.0/go.mod h1:GB2qFLM7cTU87MWRP2mPIjqfIDnGu+VIO4V/SdhGo2E= golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20190923035154-9ee001bba392/go.mod h1:/lpIB1dKB+9EgE3H3cr1v9wB50oz8l4C4h62xy7jSTY= @@ -486,10 +494,14 @@ google.golang.org/genproto/googleapis/api v0.0.0-20231127180814-3a041ad873d4 h1: google.golang.org/genproto/googleapis/api v0.0.0-20231127180814-3a041ad873d4/go.mod h1:k2dtGpRrbsSyKcNPKKI5sstZkrNCZwpU/ns96JoHbGg= google.golang.org/genproto/googleapis/api v0.0.0-20240205150955-31a09d347014 h1:x9PwdEgd11LgK+orcck69WVRo7DezSO4VUMPI4xpc8A= google.golang.org/genproto/googleapis/api v0.0.0-20240205150955-31a09d347014/go.mod h1:rbHMSEDyoYX62nRVLOCc4Qt1HbsdytAYoVwgjiOhF3I= +google.golang.org/genproto/googleapis/api v0.0.0-20240213162025-012b6fc9bca9 h1:4++qSzdWBUy9/2x8L5KZgwZw+mjJZ2yDSCGMVM0YzRs= +google.golang.org/genproto/googleapis/api v0.0.0-20240213162025-012b6fc9bca9/go.mod h1:PVreiBMirk8ypES6aw9d4p6iiBNSIfZEBqr3UGoAi2E= google.golang.org/genproto/googleapis/rpc v0.0.0-20231127180814-3a041ad873d4 h1:DC7wcm+i+P1rN3Ff07vL+OndGg5OhNddHyTA+ocPqYE= google.golang.org/genproto/googleapis/rpc v0.0.0-20231127180814-3a041ad873d4/go.mod h1:eJVxU6o+4G1PSczBr85xmyvSNYAKvAYgkub40YGomFM= google.golang.org/genproto/googleapis/rpc v0.0.0-20240205150955-31a09d347014 h1:FSL3lRCkhaPFxqi0s9o+V4UI2WTzAVOvkgbd4kVV4Wg= google.golang.org/genproto/googleapis/rpc v0.0.0-20240205150955-31a09d347014/go.mod h1:SaPjaZGWb0lPqs6Ittu0spdfrOArqji4ZdeP5IC/9N4= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240213162025-012b6fc9bca9 h1:hZB7eLIaYlW9qXRfCq/qDaPdbeY3757uARz5Vvfv+cY= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240213162025-012b6fc9bca9/go.mod h1:YUWgXUFRPfoYK1IHMuxH5K6nPEXSCzIMljnQ59lLRCk= google.golang.org/grpc v1.14.0/go.mod h1:yo6s7OP7yaDglbqo1J04qKzAhqBH6lvTonzMVmEdcZw= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= google.golang.org/grpc v1.22.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= @@ -502,6 +514,8 @@ google.golang.org/grpc v1.60.1 h1:26+wFr+cNqSGFcOXcabYC0lUVJVRa2Sb2ortSK7VrEU= google.golang.org/grpc v1.60.1/go.mod h1:OlCHIeLYqSSsLi6i49B5QGdzaMZK9+M7LXN2FKz4eGM= google.golang.org/grpc v1.61.0 h1:TOvOcuXn30kRao+gfcvsebNEa5iZIiLkisYEkf7R7o0= google.golang.org/grpc v1.61.0/go.mod h1:VUbo7IFqmF1QtCAstipjG0GIoq49KvMe9+h1jFLBNJs= +google.golang.org/grpc v1.61.1 h1:kLAiWrZs7YeDM6MumDe7m3y4aM6wacLzM1Y/wiLP9XY= +google.golang.org/grpc v1.61.1/go.mod h1:VUbo7IFqmF1QtCAstipjG0GIoq49KvMe9+h1jFLBNJs= 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= From 28c6e81df194296ca65cc4d8239e8bf1c0e5dcbc Mon Sep 17 00:00:00 2001 From: Parham Alvani Date: Tue, 20 Feb 2024 22:54:56 +0000 Subject: [PATCH 563/660] feat: update go version to 1.22 --- .github/workflows/test.yaml | 4 ++-- go.mod | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 8485716f..a30eee28 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -11,7 +11,7 @@ jobs: - uses: actions/checkout@v4 - uses: actions/setup-go@v5 with: - go-version: "1.19" + go-version: "1.22" - name: golangci-lint uses: golangci/golangci-lint-action@v4 with: @@ -25,7 +25,7 @@ jobs: - uses: actions/checkout@v4 - uses: actions/setup-go@v5 with: - go-version: "1.19" + go-version: "1.22" - run: go test -v ./... -covermode=atomic -coverprofile=coverage.out - uses: codecov/codecov-action@v4.0.1 with: diff --git a/go.mod b/go.mod index a2955075..343d5504 100644 --- a/go.mod +++ b/go.mod @@ -1,6 +1,6 @@ module github.com/snapp-incubator/soteria -go 1.19 +go 1.22 require ( github.com/ansrivas/fiberprometheus/v2 v2.6.1 From f1f27e224e095266d23e1112aeec44d517962171 Mon Sep 17 00:00:00 2001 From: Parham Alvani Date: Tue, 20 Feb 2024 23:01:43 +0000 Subject: [PATCH 564/660] fix: update image builder --- build/package/Dockerfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/build/package/Dockerfile b/build/package/Dockerfile index e3cff4e6..0976edc5 100644 --- a/build/package/Dockerfile +++ b/build/package/Dockerfile @@ -1,4 +1,4 @@ -FROM golang:1.19-alpine3.17 as builder +FROM golang:1.22-alpine3.19 as builder # hadolint ignore=DL3018 RUN apk --no-cache add git @@ -14,7 +14,7 @@ COPY . . WORKDIR /app/cmd/soteria RUN go build -o /soteria -FROM alpine:3.17 +FROM alpine:3.19 # hadolint ignore=DL3018 RUN apk --no-cache add ca-certificates tzdata && \ From a4e82111a6c5e7033d5a80236c246c96a21861c7 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 26 Feb 2024 01:19:29 +0000 Subject: [PATCH 565/660] chore(deps): bump codecov/codecov-action from 4.0.1 to 4.0.2 Bumps [codecov/codecov-action](https://github.com/codecov/codecov-action) from 4.0.1 to 4.0.2. - [Release notes](https://github.com/codecov/codecov-action/releases) - [Changelog](https://github.com/codecov/codecov-action/blob/main/CHANGELOG.md) - [Commits](https://github.com/codecov/codecov-action/compare/v4.0.1...v4.0.2) --- updated-dependencies: - dependency-name: codecov/codecov-action dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- .github/workflows/test.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index a30eee28..318a2cb0 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -27,7 +27,7 @@ jobs: with: go-version: "1.22" - run: go test -v ./... -covermode=atomic -coverprofile=coverage.out - - uses: codecov/codecov-action@v4.0.1 + - uses: codecov/codecov-action@v4.0.2 with: files: coverage.out From 880798aa33d1477087d6c5b646c184979f111766 Mon Sep 17 00:00:00 2001 From: Parham Alvani Date: Mon, 26 Feb 2024 04:29:49 +0000 Subject: [PATCH 566/660] feat: update packages --- go.mod | 24 ++++++++++++------------ go.sum | 24 ++++++++++++++++++++++++ 2 files changed, 36 insertions(+), 12 deletions(-) diff --git a/go.mod b/go.mod index 343d5504..58c0b05a 100644 --- a/go.mod +++ b/go.mod @@ -5,7 +5,7 @@ go 1.22 require ( github.com/ansrivas/fiberprometheus/v2 v2.6.1 github.com/gofiber/contrib/fiberzap v1.0.2 - github.com/gofiber/fiber/v2 v2.52.0 + github.com/gofiber/fiber/v2 v2.52.1 github.com/golang-jwt/jwt/v5 v5.2.0 github.com/knadh/koanf v1.5.0 github.com/knadh/koanf/v2 v2.1.0 @@ -13,10 +13,10 @@ require ( github.com/spf13/cobra v1.8.0 github.com/stretchr/testify v1.8.4 github.com/tidwall/pretty v1.2.1 - go.opentelemetry.io/otel v1.23.1 - go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.23.1 - go.opentelemetry.io/otel/sdk v1.23.1 - go.opentelemetry.io/otel/trace v1.23.1 + go.opentelemetry.io/otel v1.24.0 + go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.24.0 + go.opentelemetry.io/otel/sdk v1.24.0 + go.opentelemetry.io/otel/trace v1.24.0 go.uber.org/automaxprocs v1.5.3 go.uber.org/zap v1.27.0 ) @@ -37,7 +37,7 @@ require ( github.com/google/uuid v1.6.0 // indirect github.com/grpc-ecosystem/grpc-gateway/v2 v2.19.1 // indirect github.com/inconshreveable/mousetrap v1.1.0 // indirect - github.com/klauspost/compress v1.17.6 // indirect + github.com/klauspost/compress v1.17.7 // indirect github.com/mattn/go-colorable v0.1.13 // indirect github.com/mattn/go-isatty v0.0.20 // indirect github.com/mattn/go-runewidth v0.0.15 // indirect @@ -47,23 +47,23 @@ require ( github.com/pmezard/go-difflib v1.0.0 // indirect github.com/prometheus/client_golang v1.18.0 // indirect github.com/prometheus/client_model v0.6.0 // indirect - github.com/prometheus/common v0.47.0 // indirect + github.com/prometheus/common v0.48.0 // indirect github.com/prometheus/procfs v0.12.0 // indirect github.com/rivo/uniseg v0.4.7 // indirect github.com/spf13/pflag v1.0.5 // indirect github.com/valyala/bytebufferpool v1.0.0 // indirect github.com/valyala/fasthttp v1.52.0 // indirect github.com/valyala/tcplisten v1.0.0 // indirect - go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.23.1 // indirect - go.opentelemetry.io/otel/metric v1.23.1 // indirect + go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.24.0 // indirect + go.opentelemetry.io/otel/metric v1.24.0 // indirect go.opentelemetry.io/proto/otlp v1.1.0 // indirect go.uber.org/multierr v1.11.0 // indirect golang.org/x/net v0.21.0 // indirect golang.org/x/sys v0.17.0 // indirect golang.org/x/text v0.14.0 // indirect - google.golang.org/genproto/googleapis/api v0.0.0-20240213162025-012b6fc9bca9 // indirect - google.golang.org/genproto/googleapis/rpc v0.0.0-20240213162025-012b6fc9bca9 // indirect - google.golang.org/grpc v1.61.1 // indirect + google.golang.org/genproto/googleapis/api v0.0.0-20240221002015-b0ce06bbee7c // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20240221002015-b0ce06bbee7c // indirect + google.golang.org/grpc v1.62.0 // indirect google.golang.org/protobuf v1.32.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect ) diff --git a/go.sum b/go.sum index 493f81ff..9c36654e 100644 --- a/go.sum +++ b/go.sum @@ -84,6 +84,8 @@ github.com/gofiber/contrib/fiberzap v1.0.2 h1:EQwhggtszVfIdBeXxN9Xrmld71es34Ufs+ github.com/gofiber/contrib/fiberzap v1.0.2/go.mod h1:jGO8BHU4gRI9U0JtM6zj2CIhYfgVmW5JxziN8NTgVwE= github.com/gofiber/fiber/v2 v2.52.0 h1:S+qXi7y+/Pgvqq4DrSmREGiFwtB7Bu6+QFLuIHYw/UE= github.com/gofiber/fiber/v2 v2.52.0/go.mod h1:KEOE+cXMhXG0zHc9d8+E38hoX+ZN7bhOtgeF2oT6jrQ= +github.com/gofiber/fiber/v2 v2.52.1 h1:1RoU2NS+b98o1L77sdl5mboGPiW+0Ypsi5oLmcYlgHI= +github.com/gofiber/fiber/v2 v2.52.1/go.mod h1:KEOE+cXMhXG0zHc9d8+E38hoX+ZN7bhOtgeF2oT6jrQ= github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q= github.com/golang-jwt/jwt/v5 v5.2.0 h1:d/ix8ftRUorsN+5eMIlF4T6J8CAt9rch3My2winC1Jw= @@ -182,6 +184,8 @@ github.com/klauspost/compress v1.17.4 h1:Ej5ixsIri7BrIjBkRZLTo6ghwrEtHFk7ijlczPW github.com/klauspost/compress v1.17.4/go.mod h1:/dCuZOvVtNoHsyb+cuJD3itjs3NbnF6KH9zAO4BDxPM= github.com/klauspost/compress v1.17.6 h1:60eq2E/jlfwQXtvZEeBUYADs+BwKBWURIY+Gj2eRGjI= github.com/klauspost/compress v1.17.6/go.mod h1:/dCuZOvVtNoHsyb+cuJD3itjs3NbnF6KH9zAO4BDxPM= +github.com/klauspost/compress v1.17.7 h1:ehO88t2UGzQK66LMdE8tibEd1ErmzZjNEqWkjLAKQQg= +github.com/klauspost/compress v1.17.7/go.mod h1:Di0epgTjJY877eYKx5yC51cX2A2Vl2ibi7bDH9ttBbw= github.com/knadh/koanf v1.5.0 h1:q2TSd/3Pyc/5yP9ldIrSdIz26MCcyNQzW0pEAugLPNs= github.com/knadh/koanf v1.5.0/go.mod h1:Hgyjp4y8v44hpZtPzs7JZfRAW5AhN7KfZcwv1RYggDs= github.com/knadh/koanf/maps v0.1.1 h1:G5TjmUh2D7G2YWf5SQQqSiHRJEjaicvU0KpypqB3NIs= @@ -279,6 +283,8 @@ github.com/prometheus/common v0.46.0 h1:doXzt5ybi1HBKpsZOL0sSkaNHJJqkyfEWZGGqqSc github.com/prometheus/common v0.46.0/go.mod h1:Tp0qkxpb9Jsg54QMe+EAmqXkSV7Evdy1BTn+g2pa/hQ= github.com/prometheus/common v0.47.0 h1:p5Cz0FNHo7SnWOmWmoRozVcjEp0bIVU8cV7OShpjL1k= github.com/prometheus/common v0.47.0/go.mod h1:0/KsvlIEfPQCQ5I2iNSAWKPZziNCvRs5EC6ILDTlAPc= +github.com/prometheus/common v0.48.0 h1:QO8U2CdOzSn1BBsmXJXduaaW+dY/5QLjfB8svtSzKKE= +github.com/prometheus/common v0.48.0/go.mod h1:0/KsvlIEfPQCQ5I2iNSAWKPZziNCvRs5EC6ILDTlAPc= github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= github.com/prometheus/procfs v0.1.3/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU= @@ -336,26 +342,38 @@ go.opentelemetry.io/otel v1.22.0 h1:xS7Ku+7yTFvDfDraDIJVpw7XPyuHlB9MCiqqX5mcJ6Y= go.opentelemetry.io/otel v1.22.0/go.mod h1:eoV4iAi3Ea8LkAEI9+GFT44O6T/D0GWAVFyZVCC6pMI= go.opentelemetry.io/otel v1.23.1 h1:Za4UzOqJYS+MUczKI320AtqZHZb7EqxO00jAHE0jmQY= go.opentelemetry.io/otel v1.23.1/go.mod h1:Td0134eafDLcTS4y+zQ26GE8u3dEuRBiBCTUIRHaikA= +go.opentelemetry.io/otel v1.24.0 h1:0LAOdjNmQeSTzGBzduGe/rU4tZhMwL5rWgtp9Ku5Jfo= +go.opentelemetry.io/otel v1.24.0/go.mod h1:W7b9Ozg4nkF5tWI5zsXkaKKDjdVjpD4oAt9Qi/MArHo= go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.22.0 h1:9M3+rhx7kZCIQQhQRYaZCdNu1V73tm4TvXs2ntl98C4= go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.22.0/go.mod h1:noq80iT8rrHP1SfybmPiRGc9dc5M8RPmGvtwo7Oo7tc= go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.23.1 h1:o8iWeVFa1BcLtVEV0LzrCxV2/55tB3xLxADr6Kyoey4= go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.23.1/go.mod h1:SEVfdK4IoBnbT2FXNM/k8yC08MrfbhWk3U4ljM8B3HE= +go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.24.0 h1:t6wl9SPayj+c7lEIFgm4ooDBZVb01IhLB4InpomhRw8= +go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.24.0/go.mod h1:iSDOcsnSA5INXzZtwaBPrKp/lWu/V14Dd+llD0oI2EA= go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.22.0 h1:H2JFgRcGiyHg7H7bwcwaQJYrNFqCqrbTQ8K4p1OvDu8= go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.22.0/go.mod h1:WfCWp1bGoYK8MeULtI15MmQVczfR+bFkk0DF3h06QmQ= go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.23.1 h1:p3A5+f5l9e/kuEBwLOrnpkIDHQFlHmbiVxMURWRK6gQ= go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.23.1/go.mod h1:OClrnXUjBqQbInvjJFjYSnMxBSCXBF8r3b34WqjiIrQ= +go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.24.0 h1:Mw5xcxMwlqoJd97vwPxA8isEaIoxsta9/Q51+TTJLGE= +go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.24.0/go.mod h1:CQNu9bj7o7mC6U7+CA/schKEYakYXWr79ucDHTMGhCM= go.opentelemetry.io/otel/metric v1.22.0 h1:lypMQnGyJYeuYPhOM/bgjbFM6WE44W1/T45er4d8Hhg= go.opentelemetry.io/otel/metric v1.22.0/go.mod h1:evJGjVpZv0mQ5QBRJoBF64yMuOf4xCWdXjK8pzFvliY= go.opentelemetry.io/otel/metric v1.23.1 h1:PQJmqJ9u2QaJLBOELl1cxIdPcpbwzbkjfEyelTl2rlo= go.opentelemetry.io/otel/metric v1.23.1/go.mod h1:mpG2QPlAfnK8yNhNJAxDZruU9Y1/HubbC+KyH8FaCWI= +go.opentelemetry.io/otel/metric v1.24.0 h1:6EhoGWWK28x1fbpA4tYTOWBkPefTDQnb8WSGXlc88kI= +go.opentelemetry.io/otel/metric v1.24.0/go.mod h1:VYhLe1rFfxuTXLgj4CBiyz+9WYBA8pNGJgDcSFRKBco= go.opentelemetry.io/otel/sdk v1.22.0 h1:6coWHw9xw7EfClIC/+O31R8IY3/+EiRFHevmHafB2Gw= go.opentelemetry.io/otel/sdk v1.22.0/go.mod h1:iu7luyVGYovrRpe2fmj3CVKouQNdTOkxtLzPvPz1DOc= go.opentelemetry.io/otel/sdk v1.23.1 h1:O7JmZw0h76if63LQdsBMKQDWNb5oEcOThG9IrxscV+E= go.opentelemetry.io/otel/sdk v1.23.1/go.mod h1:LzdEVR5am1uKOOwfBWFef2DCi1nu3SA8XQxx2IerWFk= +go.opentelemetry.io/otel/sdk v1.24.0 h1:YMPPDNymmQN3ZgczicBY3B6sf9n62Dlj9pWD3ucgoDw= +go.opentelemetry.io/otel/sdk v1.24.0/go.mod h1:KVrIYw6tEubO9E96HQpcmpTKDVn9gdv35HoYiQWGDFg= go.opentelemetry.io/otel/trace v1.22.0 h1:Hg6pPujv0XG9QaVbGOBVHunyuLcCC3jN7WEhPx83XD0= go.opentelemetry.io/otel/trace v1.22.0/go.mod h1:RbbHXVqKES9QhzZq/fE5UnOSILqRt40a21sPw2He1xo= go.opentelemetry.io/otel/trace v1.23.1 h1:4LrmmEd8AU2rFvU1zegmvqW7+kWarxtNOPyeL6HmYY8= go.opentelemetry.io/otel/trace v1.23.1/go.mod h1:4IpnpJFwr1mo/6HL8XIPJaE9y0+u1KcVmuW7dwFSVrI= +go.opentelemetry.io/otel/trace v1.24.0 h1:CsKnnL4dUAr/0llH9FKuc698G04IrpWV0MQA/Y1YELI= +go.opentelemetry.io/otel/trace v1.24.0/go.mod h1:HPc3Xr/cOApsBI154IU0OI0HJexz+aw5uPdbs3UCjNU= go.opentelemetry.io/proto/otlp v1.0.0 h1:T0TX0tmXU8a3CbNXzEKGeU5mIVOdf0oykP+u2lIVU/I= go.opentelemetry.io/proto/otlp v1.0.0/go.mod h1:Sy6pihPLfYHkr3NkUbEhGHFhINUSI/v80hjKIs5JXpM= go.opentelemetry.io/proto/otlp v1.1.0 h1:2Di21piLrCqJ3U3eXGCTPHE9R8Nh+0uglSnOyxikMeI= @@ -496,12 +514,16 @@ google.golang.org/genproto/googleapis/api v0.0.0-20240205150955-31a09d347014 h1: google.golang.org/genproto/googleapis/api v0.0.0-20240205150955-31a09d347014/go.mod h1:rbHMSEDyoYX62nRVLOCc4Qt1HbsdytAYoVwgjiOhF3I= google.golang.org/genproto/googleapis/api v0.0.0-20240213162025-012b6fc9bca9 h1:4++qSzdWBUy9/2x8L5KZgwZw+mjJZ2yDSCGMVM0YzRs= google.golang.org/genproto/googleapis/api v0.0.0-20240213162025-012b6fc9bca9/go.mod h1:PVreiBMirk8ypES6aw9d4p6iiBNSIfZEBqr3UGoAi2E= +google.golang.org/genproto/googleapis/api v0.0.0-20240221002015-b0ce06bbee7c h1:9g7erC9qu44ks7UK4gDNlnk4kOxZG707xKm4jVniy6o= +google.golang.org/genproto/googleapis/api v0.0.0-20240221002015-b0ce06bbee7c/go.mod h1:5iCWqnniDlqZHrd3neWVTOwvh/v6s3232omMecelax8= google.golang.org/genproto/googleapis/rpc v0.0.0-20231127180814-3a041ad873d4 h1:DC7wcm+i+P1rN3Ff07vL+OndGg5OhNddHyTA+ocPqYE= google.golang.org/genproto/googleapis/rpc v0.0.0-20231127180814-3a041ad873d4/go.mod h1:eJVxU6o+4G1PSczBr85xmyvSNYAKvAYgkub40YGomFM= google.golang.org/genproto/googleapis/rpc v0.0.0-20240205150955-31a09d347014 h1:FSL3lRCkhaPFxqi0s9o+V4UI2WTzAVOvkgbd4kVV4Wg= google.golang.org/genproto/googleapis/rpc v0.0.0-20240205150955-31a09d347014/go.mod h1:SaPjaZGWb0lPqs6Ittu0spdfrOArqji4ZdeP5IC/9N4= google.golang.org/genproto/googleapis/rpc v0.0.0-20240213162025-012b6fc9bca9 h1:hZB7eLIaYlW9qXRfCq/qDaPdbeY3757uARz5Vvfv+cY= google.golang.org/genproto/googleapis/rpc v0.0.0-20240213162025-012b6fc9bca9/go.mod h1:YUWgXUFRPfoYK1IHMuxH5K6nPEXSCzIMljnQ59lLRCk= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240221002015-b0ce06bbee7c h1:NUsgEN92SQQqzfA+YtqYNqYmB3DMMYLlIwUZAQFVFbo= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240221002015-b0ce06bbee7c/go.mod h1:H4O17MA/PE9BsGx3w+a+W2VOLLD1Qf7oJneAoU6WktY= google.golang.org/grpc v1.14.0/go.mod h1:yo6s7OP7yaDglbqo1J04qKzAhqBH6lvTonzMVmEdcZw= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= google.golang.org/grpc v1.22.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= @@ -516,6 +538,8 @@ google.golang.org/grpc v1.61.0 h1:TOvOcuXn30kRao+gfcvsebNEa5iZIiLkisYEkf7R7o0= google.golang.org/grpc v1.61.0/go.mod h1:VUbo7IFqmF1QtCAstipjG0GIoq49KvMe9+h1jFLBNJs= google.golang.org/grpc v1.61.1 h1:kLAiWrZs7YeDM6MumDe7m3y4aM6wacLzM1Y/wiLP9XY= google.golang.org/grpc v1.61.1/go.mod h1:VUbo7IFqmF1QtCAstipjG0GIoq49KvMe9+h1jFLBNJs= +google.golang.org/grpc v1.62.0 h1:HQKZ/fa1bXkX1oFOvSjmZEUL8wLSaZTjCcLAlmZRtdk= +google.golang.org/grpc v1.62.0/go.mod h1:IWTG0VlJLCh1SkC58F7np9ka9mx/WNkjl4PGJaiq+QE= 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= From 5671e964afa5fd961d230bfa85fc716fb0fd02a9 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 4 Mar 2024 01:41:48 +0000 Subject: [PATCH 567/660] chore(deps): bump codecov/codecov-action from 4.0.2 to 4.1.0 Bumps [codecov/codecov-action](https://github.com/codecov/codecov-action) from 4.0.2 to 4.1.0. - [Release notes](https://github.com/codecov/codecov-action/releases) - [Changelog](https://github.com/codecov/codecov-action/blob/main/CHANGELOG.md) - [Commits](https://github.com/codecov/codecov-action/compare/v4.0.2...v4.1.0) --- updated-dependencies: - dependency-name: codecov/codecov-action dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- .github/workflows/test.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 318a2cb0..6591d368 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -27,7 +27,7 @@ jobs: with: go-version: "1.22" - run: go test -v ./... -covermode=atomic -coverprofile=coverage.out - - uses: codecov/codecov-action@v4.0.2 + - uses: codecov/codecov-action@v4.1.0 with: files: coverage.out From 0926f8d8d45c0fd65fdc8a72e1c43788c9554307 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 4 Mar 2024 01:41:51 +0000 Subject: [PATCH 568/660] chore(deps): bump azure/setup-helm from 3 to 4 Bumps [azure/setup-helm](https://github.com/azure/setup-helm) from 3 to 4. - [Release notes](https://github.com/azure/setup-helm/releases) - [Changelog](https://github.com/Azure/setup-helm/blob/main/CHANGELOG.md) - [Commits](https://github.com/azure/setup-helm/compare/v3...v4) --- updated-dependencies: - dependency-name: azure/setup-helm dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- .github/workflows/helm.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/helm.yaml b/.github/workflows/helm.yaml index 2b167b79..c9eece63 100644 --- a/.github/workflows/helm.yaml +++ b/.github/workflows/helm.yaml @@ -11,7 +11,7 @@ jobs: uses: actions/checkout@v4 - name: set up helm - uses: azure/setup-helm@v3 + uses: azure/setup-helm@v4 with: version: v3.13.0 @@ -39,7 +39,7 @@ jobs: uses: actions/checkout@v4 - name: set up helm - uses: azure/setup-helm@v3 + uses: azure/setup-helm@v4 with: version: v3.13.0 From c63589287aaf96d2b6991794c1a8b21b63c49ef9 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 4 Mar 2024 01:48:17 +0000 Subject: [PATCH 569/660] chore(deps): bump github.com/gofiber/fiber/v2 from 2.52.1 to 2.52.2 Bumps [github.com/gofiber/fiber/v2](https://github.com/gofiber/fiber) from 2.52.1 to 2.52.2. - [Release notes](https://github.com/gofiber/fiber/releases) - [Commits](https://github.com/gofiber/fiber/compare/v2.52.1...v2.52.2) --- updated-dependencies: - dependency-name: github.com/gofiber/fiber/v2 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- go.mod | 3 +- go.sum | 98 +++++++--------------------------------------------------- 2 files changed, 12 insertions(+), 89 deletions(-) diff --git a/go.mod b/go.mod index 58c0b05a..35ab3bf9 100644 --- a/go.mod +++ b/go.mod @@ -5,7 +5,7 @@ go 1.22 require ( github.com/ansrivas/fiberprometheus/v2 v2.6.1 github.com/gofiber/contrib/fiberzap v1.0.2 - github.com/gofiber/fiber/v2 v2.52.1 + github.com/gofiber/fiber/v2 v2.52.2 github.com/golang-jwt/jwt/v5 v5.2.0 github.com/knadh/koanf v1.5.0 github.com/knadh/koanf/v2 v2.1.0 @@ -41,7 +41,6 @@ require ( github.com/mattn/go-colorable v0.1.13 // indirect github.com/mattn/go-isatty v0.0.20 // indirect github.com/mattn/go-runewidth v0.0.15 // indirect - github.com/matttproud/golang_protobuf_extensions/v2 v2.0.0 // indirect github.com/mitchellh/copystructure v1.2.0 // indirect github.com/mitchellh/reflectwalk v1.0.2 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect diff --git a/go.sum b/go.sum index 9c36654e..9ff0dc26 100644 --- a/go.sum +++ b/go.sum @@ -6,8 +6,6 @@ github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751/go.mod h1:LOuy github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= github.com/alecthomas/units v0.0.0-20190717042225-c3de453c63f4/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= github.com/alecthomas/units v0.0.0-20190924025748-f65c72e2690d/go.mod h1:rBZYJk541a8SKzHPHnH3zbiI+7dagKZ0cgpgrD7Fyho= -github.com/andybalholm/brotli v1.0.6 h1:Yf9fFpf49Zrxb9NlQaluyE92/+X7UVHlhMNJN2sxfOI= -github.com/andybalholm/brotli v1.0.6/go.mod h1:fO7iG3H7G2nSZ7m0zPUDn85XEX2GTukHGRSepvi9Eig= github.com/andybalholm/brotli v1.1.0 h1:eLKJA0d02Lf0mVpIDgYnqXcUn0GqVmEFny3VuID1U3M= github.com/andybalholm/brotli v1.1.0/go.mod h1:sms7XGricyQI9K10gOSf56VKKWS4oLer58Q+mhRPtnY= github.com/ansrivas/fiberprometheus/v2 v2.6.1 h1:wac3pXaE6BYYTF04AC6K0ktk6vCD+MnDOJZ3SK66kXM= @@ -82,10 +80,8 @@ github.com/gofiber/adaptor/v2 v2.2.1 h1:givE7iViQWlsTR4Jh7tB4iXzrlKBgiraB/yTdHs9 github.com/gofiber/adaptor/v2 v2.2.1/go.mod h1:AhR16dEqs25W2FY/l8gSj1b51Azg5dtPDmm+pruNOrc= github.com/gofiber/contrib/fiberzap v1.0.2 h1:EQwhggtszVfIdBeXxN9Xrmld71es34Ufs+ef8VMqZxc= github.com/gofiber/contrib/fiberzap v1.0.2/go.mod h1:jGO8BHU4gRI9U0JtM6zj2CIhYfgVmW5JxziN8NTgVwE= -github.com/gofiber/fiber/v2 v2.52.0 h1:S+qXi7y+/Pgvqq4DrSmREGiFwtB7Bu6+QFLuIHYw/UE= -github.com/gofiber/fiber/v2 v2.52.0/go.mod h1:KEOE+cXMhXG0zHc9d8+E38hoX+ZN7bhOtgeF2oT6jrQ= -github.com/gofiber/fiber/v2 v2.52.1 h1:1RoU2NS+b98o1L77sdl5mboGPiW+0Ypsi5oLmcYlgHI= -github.com/gofiber/fiber/v2 v2.52.1/go.mod h1:KEOE+cXMhXG0zHc9d8+E38hoX+ZN7bhOtgeF2oT6jrQ= +github.com/gofiber/fiber/v2 v2.52.2 h1:b0rYH6b06Df+4NyrbdptQL8ifuxw/Tf2DgfkZkDaxEo= +github.com/gofiber/fiber/v2 v2.52.2/go.mod h1:KEOE+cXMhXG0zHc9d8+E38hoX+ZN7bhOtgeF2oT6jrQ= github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q= github.com/golang-jwt/jwt/v5 v5.2.0 h1:d/ix8ftRUorsN+5eMIlF4T6J8CAt9rch3My2winC1Jw= @@ -120,17 +116,13 @@ github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/ github.com/google/go-cmp v0.5.6/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.7/go.mod h1:n+brtR0CgQNWTVd5ZUFpTBC8YFBDLK/h/bpaJ8/DtOE= 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/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/google/uuid v1.5.0 h1:1p67kYwdtXjb0gL0BPiP1Av9wiZPo5A8z2cWkTZ+eyU= -github.com/google/uuid v1.5.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= 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/grpc-ecosystem/go-grpc-prometheus v1.2.0/go.mod h1:8NvIoxWQoOIhqOTXgfV/d3M/q6VIi02HzZEHgUlZvzk= -github.com/grpc-ecosystem/grpc-gateway v1.16.0 h1:gmcG1KaJ57LophUzW0Hy8NmPhnMZb4M0+kPpLofRdBo= github.com/grpc-ecosystem/grpc-gateway v1.16.0/go.mod h1:BDjrQk3hbvj6Nolgz8mAMFbcEtjT1g+wF4CSlocrBnw= -github.com/grpc-ecosystem/grpc-gateway/v2 v2.18.1 h1:6UKoz5ujsI55KNpsJH3UwCq3T8kKbZwNZBNPuTTje8U= -github.com/grpc-ecosystem/grpc-gateway/v2 v2.18.1/go.mod h1:YvJ2f6MplWDhfxiUC3KpyTy76kYUZA4W3pTv/wdKQ9Y= github.com/grpc-ecosystem/grpc-gateway/v2 v2.19.1 h1:/c3QmbOGMGTOumP2iT/rCwB7b0QDGLKzqOmktBjT+Is= github.com/grpc-ecosystem/grpc-gateway/v2 v2.19.1/go.mod h1:5SN9VR2LTsRFsrEC6FHgRbTWrTHu6tqPeKxEQv15giM= github.com/hashicorp/consul/api v1.13.0/go.mod h1:ZlVrynguJKcYr54zGaDbaL3fOvKC9m72FhPvA8T35KQ= @@ -180,17 +172,10 @@ github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7V github.com/julienschmidt/httprouter v1.3.0/go.mod h1:JR6WtHb+2LUe8TCKY3cZOxFyyO8IZAc4RVcycCCAKdM= github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8= github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= -github.com/klauspost/compress v1.17.4 h1:Ej5ixsIri7BrIjBkRZLTo6ghwrEtHFk7ijlczPW4fZ4= -github.com/klauspost/compress v1.17.4/go.mod h1:/dCuZOvVtNoHsyb+cuJD3itjs3NbnF6KH9zAO4BDxPM= -github.com/klauspost/compress v1.17.6 h1:60eq2E/jlfwQXtvZEeBUYADs+BwKBWURIY+Gj2eRGjI= -github.com/klauspost/compress v1.17.6/go.mod h1:/dCuZOvVtNoHsyb+cuJD3itjs3NbnF6KH9zAO4BDxPM= github.com/klauspost/compress v1.17.7 h1:ehO88t2UGzQK66LMdE8tibEd1ErmzZjNEqWkjLAKQQg= github.com/klauspost/compress v1.17.7/go.mod h1:Di0epgTjJY877eYKx5yC51cX2A2Vl2ibi7bDH9ttBbw= github.com/knadh/koanf v1.5.0 h1:q2TSd/3Pyc/5yP9ldIrSdIz26MCcyNQzW0pEAugLPNs= github.com/knadh/koanf v1.5.0/go.mod h1:Hgyjp4y8v44hpZtPzs7JZfRAW5AhN7KfZcwv1RYggDs= -github.com/knadh/koanf/maps v0.1.1 h1:G5TjmUh2D7G2YWf5SQQqSiHRJEjaicvU0KpypqB3NIs= -github.com/knadh/koanf/v2 v2.0.2 h1:sEZzPW2rVWSahcYILNq/syJdEyRafZIG0l9aWwL86HA= -github.com/knadh/koanf/v2 v2.0.2/go.mod h1:HN9uZ+qFAejH1e4G41gnoffIanINWQuONLXiV7kir6k= github.com/knadh/koanf/v2 v2.1.0 h1:eh4QmHHBuU8BybfIJ8mB8K8gsGCD/AUQTdwGq/GzId8= github.com/knadh/koanf/v2 v2.1.0/go.mod h1:4mnTRbZCK+ALuBXHZMjDfG9y714L7TykVnZkXbMU3Es= github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= @@ -199,9 +184,11 @@ github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFB github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= github.com/kr/pretty v0.2.0/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= +github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk= github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= +github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU= github.com/mattn/go-colorable v0.1.4/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE= github.com/mattn/go-colorable v0.1.6/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= @@ -218,9 +205,6 @@ github.com/mattn/go-isatty v0.0.20/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D github.com/mattn/go-runewidth v0.0.15 h1:UNAjwbU9l54TA3KzvqLGxwWjHmMgBUVhBiTjelZgg3U= github.com/mattn/go-runewidth v0.0.15/go.mod h1:Jdepj2loyihRzMpdS35Xk/zdY8IAYHsh153qUoGf23w= github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= -github.com/matttproud/golang_protobuf_extensions v1.0.4 h1:mmDVorXM7PCGKw94cs5zkfA9PSy5pEvNWRP0ET0TIVo= -github.com/matttproud/golang_protobuf_extensions/v2 v2.0.0 h1:jWpvCLoY8Z/e3VKvlsiIGKtc+UG6U5vzxaoagmhXfyg= -github.com/matttproud/golang_protobuf_extensions/v2 v2.0.0/go.mod h1:QUyp042oQthUoa9bqDv0ER0wrtXnBruoNd7aNjkbP+k= github.com/miekg/dns v1.1.26/go.mod h1:bPDLeHnStXmXAq1m/Ch/hvfNHr14JKNPMBo3VZKjuso= github.com/miekg/dns v1.1.41/go.mod h1:p6aan82bvRIyn+zDIv9xYNUpwa73JcSh9BKwknJysuI= github.com/mitchellh/cli v1.0.0/go.mod h1:hNIlj7HEI86fIcpObd7a0FcrxTWetlwJDGcceTlRvqc= @@ -258,31 +242,22 @@ github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZN github.com/posener/complete v1.1.1/go.mod h1:em0nMJCgc9GFtwrmVmEMR/ZL6WyhyjMBndrE9hABlRI= github.com/posener/complete v1.2.3/go.mod h1:WZIdtGGp+qx0sLrYKtIRAruyNpv6hFCicSgv7Sy7s/s= github.com/prashantv/gostub v1.1.0 h1:BTyx3RfQjRHnUWaGF9oQos79AlQ5k8WNktv7VGvVH4g= +github.com/prashantv/gostub v1.1.0/go.mod h1:A5zLQHz7ieHGG7is6LLXLz7I8+3LZzsrV0P1IAHhP5U= github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw= github.com/prometheus/client_golang v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5FsnadC4Ky3P0J6CfImo= github.com/prometheus/client_golang v1.7.1/go.mod h1:PY5Wy2awLA44sXw4AOSfFBetzPP4j5+D6mVACh+pe2M= github.com/prometheus/client_golang v1.11.1/go.mod h1:Z6t4BnS23TR94PD6BsDNk8yVqroYurpAkEiz0P2BEV0= -github.com/prometheus/client_golang v1.17.0 h1:rl2sfwZMtSthVU752MqfjQozy7blglC+1SOtjMAMh+Q= -github.com/prometheus/client_golang v1.17.0/go.mod h1:VeL+gMmOAxkS2IqfCq0ZmHSL+LjWfWDUmp1mBz9JgUY= github.com/prometheus/client_golang v1.18.0 h1:HzFfmkOzH5Q8L8G+kSJKUx5dtG87sewO+FoDDqP5Tbk= github.com/prometheus/client_golang v1.18.0/go.mod h1:T+GXkCk5wSJyOqMIzVgvvjFDlkOQntgjkJWKrN5txjA= github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/client_model v0.2.0/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= -github.com/prometheus/client_model v0.5.0 h1:VQw1hfvPvk3Uv6Qf29VrPF32JB6rtbgI6cYPYQjL0Qw= -github.com/prometheus/client_model v0.5.0/go.mod h1:dTiFglRmd66nLR9Pv9f0mZi7B7fk5Pm3gvsjB5tr+kI= github.com/prometheus/client_model v0.6.0 h1:k1v3CzpSRUTrKMppY35TLwPvxHqBu0bYgxZzqGIgaos= github.com/prometheus/client_model v0.6.0/go.mod h1:NTQHnmxFpouOD0DpvP4XujX3CdOAGQPoaGhyTchlyt8= github.com/prometheus/common v0.4.1/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= github.com/prometheus/common v0.10.0/go.mod h1:Tlit/dnDKsSWFlCLTWaA1cyBgKHSMdTB80sz/V91rCo= github.com/prometheus/common v0.26.0/go.mod h1:M7rCNAaPfAosfx8veZJCuw84e35h3Cfd9VFqTh1DIvc= -github.com/prometheus/common v0.45.0 h1:2BGz0eBc2hdMDLnO/8n0jeB3oPrt2D08CekT0lneoxM= -github.com/prometheus/common v0.45.0/go.mod h1:YJmSTw9BoKxJplESWWxlbyttQR4uaEcGyv9MZjVOJsY= -github.com/prometheus/common v0.46.0 h1:doXzt5ybi1HBKpsZOL0sSkaNHJJqkyfEWZGGqqScV0Y= -github.com/prometheus/common v0.46.0/go.mod h1:Tp0qkxpb9Jsg54QMe+EAmqXkSV7Evdy1BTn+g2pa/hQ= -github.com/prometheus/common v0.47.0 h1:p5Cz0FNHo7SnWOmWmoRozVcjEp0bIVU8cV7OShpjL1k= -github.com/prometheus/common v0.47.0/go.mod h1:0/KsvlIEfPQCQ5I2iNSAWKPZziNCvRs5EC6ILDTlAPc= github.com/prometheus/common v0.48.0 h1:QO8U2CdOzSn1BBsmXJXduaaW+dY/5QLjfB8svtSzKKE= github.com/prometheus/common v0.48.0/go.mod h1:0/KsvlIEfPQCQ5I2iNSAWKPZziNCvRs5EC6ILDTlAPc= github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= @@ -293,12 +268,11 @@ github.com/prometheus/procfs v0.12.0 h1:jluTpSng7V9hY0O2R9DzzJHYb2xULk9VTR1V1R/k github.com/prometheus/procfs v0.12.0/go.mod h1:pcuDEFsWDnvcgNzo4EEweacyhjeA9Zk3cnaOZAZEfOo= github.com/rhnvrm/simples3 v0.6.1/go.mod h1:Y+3vYm2V7Y4VijFoJHHTrja6OgPrJ2cBti8dPGkC3sA= github.com/rivo/uniseg v0.2.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc= -github.com/rivo/uniseg v0.4.4 h1:8TfxU8dW6PdqD27gjM8MVNuicgxIjxpm4K7x4jp8sis= -github.com/rivo/uniseg v0.4.4/go.mod h1:FN3SvrM+Zdj16jyLfmOkMNblXMcoc8DfTHruCPUcx88= github.com/rivo/uniseg v0.4.7 h1:WUdvkW8uEhrYfLC4ZzdpI2ztxP1I582+49Oc5Mq64VQ= github.com/rivo/uniseg v0.4.7/go.mod h1:FN3SvrM+Zdj16jyLfmOkMNblXMcoc8DfTHruCPUcx88= github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6LYCDYWNEvQ= github.com/rogpeppe/go-internal v1.10.0 h1:TMyTOH3F/DB16zRVcYyreMH6GnZZrwQVAoYjRBZyWFQ= +github.com/rogpeppe/go-internal v1.10.0/go.mod h1:UQnix2H7Ngw/k4C5ijL5+65zddjncjaFoBhdsK/akog= github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= github.com/ryanuber/columnize v0.0.0-20160712163229-9b3edd62028f/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts= github.com/ryanuber/columnize v2.1.0+incompatible/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts= @@ -326,8 +300,6 @@ github.com/tidwall/pretty v1.2.1 h1:qjsOFOWWQl+N3RsoF5/ssm1pHmJJwhjlSbZ51I6wMl4= github.com/tidwall/pretty v1.2.1/go.mod h1:ITEVvHYasfjBbM0u2Pg8T2nJnzm8xPwvNhhsoaGGjNU= github.com/valyala/bytebufferpool v1.0.0 h1:GqA5TC/0021Y/b9FG4Oi9Mr3q7XYx6KllzawFIhcdPw= github.com/valyala/bytebufferpool v1.0.0/go.mod h1:6bBcMArwyJ5K/AmCkWv1jt77kVWyCJ6HpOuEn7z0Csc= -github.com/valyala/fasthttp v1.51.0 h1:8b30A5JlZ6C7AS81RsWjYMQmrZG6feChmgAolCl1SqA= -github.com/valyala/fasthttp v1.51.0/go.mod h1:oI2XroL+lI7vdXyYoQk03bXBThfFl2cVdIA3Xl7cH8g= github.com/valyala/fasthttp v1.52.0 h1:wqBQpxH71XW0e2g+Og4dzQM8pk34aFYlA1Ga8db7gU0= github.com/valyala/fasthttp v1.52.0/go.mod h1:hf5C4QnVMkNXMspnsUlfM3WitlgYflyhHYoKol/szxQ= github.com/valyala/tcplisten v1.0.0 h1:rBHj/Xf+E1tRGZyWIWwJDiRY0zc1Js+CV5DqwacVSA8= @@ -338,56 +310,29 @@ github.com/yuin/goldmark v1.3.5/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1 go.etcd.io/etcd/api/v3 v3.5.4/go.mod h1:5GB2vv4A4AOn3yk7MftYGHkUfGtDHnEraIjym4dYz5A= go.etcd.io/etcd/client/pkg/v3 v3.5.4/go.mod h1:IJHfcCEKxYu1Os13ZdwCwIUTUVGYTSAM3YSwc9/Ac1g= go.etcd.io/etcd/client/v3 v3.5.4/go.mod h1:ZaRkVgBZC+L+dLCjTcF1hRXpgZXQPOvnA/Ak/gq3kiY= -go.opentelemetry.io/otel v1.22.0 h1:xS7Ku+7yTFvDfDraDIJVpw7XPyuHlB9MCiqqX5mcJ6Y= -go.opentelemetry.io/otel v1.22.0/go.mod h1:eoV4iAi3Ea8LkAEI9+GFT44O6T/D0GWAVFyZVCC6pMI= -go.opentelemetry.io/otel v1.23.1 h1:Za4UzOqJYS+MUczKI320AtqZHZb7EqxO00jAHE0jmQY= -go.opentelemetry.io/otel v1.23.1/go.mod h1:Td0134eafDLcTS4y+zQ26GE8u3dEuRBiBCTUIRHaikA= go.opentelemetry.io/otel v1.24.0 h1:0LAOdjNmQeSTzGBzduGe/rU4tZhMwL5rWgtp9Ku5Jfo= go.opentelemetry.io/otel v1.24.0/go.mod h1:W7b9Ozg4nkF5tWI5zsXkaKKDjdVjpD4oAt9Qi/MArHo= -go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.22.0 h1:9M3+rhx7kZCIQQhQRYaZCdNu1V73tm4TvXs2ntl98C4= -go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.22.0/go.mod h1:noq80iT8rrHP1SfybmPiRGc9dc5M8RPmGvtwo7Oo7tc= -go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.23.1 h1:o8iWeVFa1BcLtVEV0LzrCxV2/55tB3xLxADr6Kyoey4= -go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.23.1/go.mod h1:SEVfdK4IoBnbT2FXNM/k8yC08MrfbhWk3U4ljM8B3HE= go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.24.0 h1:t6wl9SPayj+c7lEIFgm4ooDBZVb01IhLB4InpomhRw8= go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.24.0/go.mod h1:iSDOcsnSA5INXzZtwaBPrKp/lWu/V14Dd+llD0oI2EA= -go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.22.0 h1:H2JFgRcGiyHg7H7bwcwaQJYrNFqCqrbTQ8K4p1OvDu8= -go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.22.0/go.mod h1:WfCWp1bGoYK8MeULtI15MmQVczfR+bFkk0DF3h06QmQ= -go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.23.1 h1:p3A5+f5l9e/kuEBwLOrnpkIDHQFlHmbiVxMURWRK6gQ= -go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.23.1/go.mod h1:OClrnXUjBqQbInvjJFjYSnMxBSCXBF8r3b34WqjiIrQ= go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.24.0 h1:Mw5xcxMwlqoJd97vwPxA8isEaIoxsta9/Q51+TTJLGE= go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.24.0/go.mod h1:CQNu9bj7o7mC6U7+CA/schKEYakYXWr79ucDHTMGhCM= -go.opentelemetry.io/otel/metric v1.22.0 h1:lypMQnGyJYeuYPhOM/bgjbFM6WE44W1/T45er4d8Hhg= -go.opentelemetry.io/otel/metric v1.22.0/go.mod h1:evJGjVpZv0mQ5QBRJoBF64yMuOf4xCWdXjK8pzFvliY= -go.opentelemetry.io/otel/metric v1.23.1 h1:PQJmqJ9u2QaJLBOELl1cxIdPcpbwzbkjfEyelTl2rlo= -go.opentelemetry.io/otel/metric v1.23.1/go.mod h1:mpG2QPlAfnK8yNhNJAxDZruU9Y1/HubbC+KyH8FaCWI= go.opentelemetry.io/otel/metric v1.24.0 h1:6EhoGWWK28x1fbpA4tYTOWBkPefTDQnb8WSGXlc88kI= go.opentelemetry.io/otel/metric v1.24.0/go.mod h1:VYhLe1rFfxuTXLgj4CBiyz+9WYBA8pNGJgDcSFRKBco= -go.opentelemetry.io/otel/sdk v1.22.0 h1:6coWHw9xw7EfClIC/+O31R8IY3/+EiRFHevmHafB2Gw= -go.opentelemetry.io/otel/sdk v1.22.0/go.mod h1:iu7luyVGYovrRpe2fmj3CVKouQNdTOkxtLzPvPz1DOc= -go.opentelemetry.io/otel/sdk v1.23.1 h1:O7JmZw0h76if63LQdsBMKQDWNb5oEcOThG9IrxscV+E= -go.opentelemetry.io/otel/sdk v1.23.1/go.mod h1:LzdEVR5am1uKOOwfBWFef2DCi1nu3SA8XQxx2IerWFk= go.opentelemetry.io/otel/sdk v1.24.0 h1:YMPPDNymmQN3ZgczicBY3B6sf9n62Dlj9pWD3ucgoDw= go.opentelemetry.io/otel/sdk v1.24.0/go.mod h1:KVrIYw6tEubO9E96HQpcmpTKDVn9gdv35HoYiQWGDFg= -go.opentelemetry.io/otel/trace v1.22.0 h1:Hg6pPujv0XG9QaVbGOBVHunyuLcCC3jN7WEhPx83XD0= -go.opentelemetry.io/otel/trace v1.22.0/go.mod h1:RbbHXVqKES9QhzZq/fE5UnOSILqRt40a21sPw2He1xo= -go.opentelemetry.io/otel/trace v1.23.1 h1:4LrmmEd8AU2rFvU1zegmvqW7+kWarxtNOPyeL6HmYY8= -go.opentelemetry.io/otel/trace v1.23.1/go.mod h1:4IpnpJFwr1mo/6HL8XIPJaE9y0+u1KcVmuW7dwFSVrI= go.opentelemetry.io/otel/trace v1.24.0 h1:CsKnnL4dUAr/0llH9FKuc698G04IrpWV0MQA/Y1YELI= go.opentelemetry.io/otel/trace v1.24.0/go.mod h1:HPc3Xr/cOApsBI154IU0OI0HJexz+aw5uPdbs3UCjNU= -go.opentelemetry.io/proto/otlp v1.0.0 h1:T0TX0tmXU8a3CbNXzEKGeU5mIVOdf0oykP+u2lIVU/I= -go.opentelemetry.io/proto/otlp v1.0.0/go.mod h1:Sy6pihPLfYHkr3NkUbEhGHFhINUSI/v80hjKIs5JXpM= go.opentelemetry.io/proto/otlp v1.1.0 h1:2Di21piLrCqJ3U3eXGCTPHE9R8Nh+0uglSnOyxikMeI= go.opentelemetry.io/proto/otlp v1.1.0/go.mod h1:GpBHCBWiqvVLDqmHZsoMM3C5ySeKTC7ej/RNTae6MdY= go.uber.org/atomic v1.7.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc= go.uber.org/automaxprocs v1.5.3 h1:kWazyxZUrS3Gs4qUpbwo5kEIMGe/DAvi5Z4tl2NW4j8= go.uber.org/automaxprocs v1.5.3/go.mod h1:eRbA25aqJrxAbsLO0xy5jVwPt7FQnRgjW+efnwa1WM0= go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto= +go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE= go.uber.org/multierr v1.6.0/go.mod h1:cdWPpRnG4AhwMwsgIHip0KRBQjJy5kYEpYjJxpXp9iU= go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0= go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y= go.uber.org/zap v1.17.0/go.mod h1:MXVU+bhUf/A7Xi2HNOnopQOrmycQ5Ih87HtOu4q5SSo= -go.uber.org/zap v1.26.0 h1:sI7k6L95XOKS281NhVKOFCUNIvv9e0w4BF8N3u+tCRo= -go.uber.org/zap v1.26.0/go.mod h1:dtElttAiwGvoJ/vj4IwHBS/gXsEu/pZ50mUIRWuG0so= go.uber.org/zap v1.27.0 h1:aJMhYGrd5QSmlpLMr2MftRKl7t8J8PTZPA732ud/XR8= go.uber.org/zap v1.27.0/go.mod h1:GB2qFLM7cTU87MWRP2mPIjqfIDnGu+VIO4V/SdhGo2E= golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= @@ -421,8 +366,6 @@ golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwY golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM= golang.org/x/net v0.0.0-20210410081132-afb366fc7cd1/go.mod h1:9tjilg8BloeKEkVJvy7fQ90B1CfIiPueXVOjqfkSzI8= -golang.org/x/net v0.19.0 h1:zTwKpTd2XuCqf8huc7Fo2iSy+4RHPd10s4KzeTnVr1c= -golang.org/x/net v0.19.0/go.mod h1:CfAk/cbD4CthTvqiEl8NpboMuiuOYsAr/7NOjZJtv1U= golang.org/x/net v0.21.0 h1:AQyQV4dYCvJ7vGmJyKki9+PBdyvhkSd8EIx/qb0AYv4= golang.org/x/net v0.21.0/go.mod h1:bIjVDfnllIU7BJ2DNgfnXvpSvtn8VRwhlsaeUTyUS44= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= @@ -469,8 +412,6 @@ golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20210603081109-ebe580a85c40/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.16.0 h1:xWw16ngr6ZMtmxDyKyIgsE93KNKz5HKmMa3b8ALHidU= -golang.org/x/sys v0.16.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/sys v0.17.0 h1:25cE3gD+tdBA7lp7QfhuV+rJiE9YXTcS3VG1SqssI/Y= golang.org/x/sys v0.17.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= @@ -506,22 +447,10 @@ google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98 google.golang.org/genproto v0.0.0-20200513103714-09dca8ec2884/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo= google.golang.org/genproto v0.0.0-20210602131652-f16073e35f0c/go.mod h1:UODoCrxHCcBojKKwX1terBiRUaqAsFqJiF615XL43r0= -google.golang.org/genproto v0.0.0-20231120223509-83a465c0220f h1:Vn+VyHU5guc9KjB5KrjI2q0wCOWEOIh0OEsleqakHJg= -google.golang.org/genproto v0.0.0-20240125205218-1f4bbc51befe h1:USL2DhxfgRchafRvt/wYyyQNzwgL7ZiURcozOE/Pkvo= -google.golang.org/genproto/googleapis/api v0.0.0-20231127180814-3a041ad873d4 h1:ZcOkrmX74HbKFYnpPY8Qsw93fC29TbJXspYKaBkSXDQ= -google.golang.org/genproto/googleapis/api v0.0.0-20231127180814-3a041ad873d4/go.mod h1:k2dtGpRrbsSyKcNPKKI5sstZkrNCZwpU/ns96JoHbGg= -google.golang.org/genproto/googleapis/api v0.0.0-20240205150955-31a09d347014 h1:x9PwdEgd11LgK+orcck69WVRo7DezSO4VUMPI4xpc8A= -google.golang.org/genproto/googleapis/api v0.0.0-20240205150955-31a09d347014/go.mod h1:rbHMSEDyoYX62nRVLOCc4Qt1HbsdytAYoVwgjiOhF3I= -google.golang.org/genproto/googleapis/api v0.0.0-20240213162025-012b6fc9bca9 h1:4++qSzdWBUy9/2x8L5KZgwZw+mjJZ2yDSCGMVM0YzRs= -google.golang.org/genproto/googleapis/api v0.0.0-20240213162025-012b6fc9bca9/go.mod h1:PVreiBMirk8ypES6aw9d4p6iiBNSIfZEBqr3UGoAi2E= +google.golang.org/genproto v0.0.0-20240213162025-012b6fc9bca9 h1:9+tzLLstTlPTRyJTh+ah5wIMsBW5c4tQwGTN3thOW9Y= +google.golang.org/genproto v0.0.0-20240213162025-012b6fc9bca9/go.mod h1:mqHbVIp48Muh7Ywss/AD6I5kNVKZMmAa/QEW58Gxp2s= google.golang.org/genproto/googleapis/api v0.0.0-20240221002015-b0ce06bbee7c h1:9g7erC9qu44ks7UK4gDNlnk4kOxZG707xKm4jVniy6o= google.golang.org/genproto/googleapis/api v0.0.0-20240221002015-b0ce06bbee7c/go.mod h1:5iCWqnniDlqZHrd3neWVTOwvh/v6s3232omMecelax8= -google.golang.org/genproto/googleapis/rpc v0.0.0-20231127180814-3a041ad873d4 h1:DC7wcm+i+P1rN3Ff07vL+OndGg5OhNddHyTA+ocPqYE= -google.golang.org/genproto/googleapis/rpc v0.0.0-20231127180814-3a041ad873d4/go.mod h1:eJVxU6o+4G1PSczBr85xmyvSNYAKvAYgkub40YGomFM= -google.golang.org/genproto/googleapis/rpc v0.0.0-20240205150955-31a09d347014 h1:FSL3lRCkhaPFxqi0s9o+V4UI2WTzAVOvkgbd4kVV4Wg= -google.golang.org/genproto/googleapis/rpc v0.0.0-20240205150955-31a09d347014/go.mod h1:SaPjaZGWb0lPqs6Ittu0spdfrOArqji4ZdeP5IC/9N4= -google.golang.org/genproto/googleapis/rpc v0.0.0-20240213162025-012b6fc9bca9 h1:hZB7eLIaYlW9qXRfCq/qDaPdbeY3757uARz5Vvfv+cY= -google.golang.org/genproto/googleapis/rpc v0.0.0-20240213162025-012b6fc9bca9/go.mod h1:YUWgXUFRPfoYK1IHMuxH5K6nPEXSCzIMljnQ59lLRCk= google.golang.org/genproto/googleapis/rpc v0.0.0-20240221002015-b0ce06bbee7c h1:NUsgEN92SQQqzfA+YtqYNqYmB3DMMYLlIwUZAQFVFbo= google.golang.org/genproto/googleapis/rpc v0.0.0-20240221002015-b0ce06bbee7c/go.mod h1:H4O17MA/PE9BsGx3w+a+W2VOLLD1Qf7oJneAoU6WktY= google.golang.org/grpc v1.14.0/go.mod h1:yo6s7OP7yaDglbqo1J04qKzAhqBH6lvTonzMVmEdcZw= @@ -532,12 +461,6 @@ google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQ google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= google.golang.org/grpc v1.33.1/go.mod h1:fr5YgcSWrqhRRxogOsw7RzIpsmvOZ6IcH4kBYTpR3n0= google.golang.org/grpc v1.38.0/go.mod h1:NREThFqKR1f3iQ6oBuvc5LadQuXVGo9rkm5ZGrQdJfM= -google.golang.org/grpc v1.60.1 h1:26+wFr+cNqSGFcOXcabYC0lUVJVRa2Sb2ortSK7VrEU= -google.golang.org/grpc v1.60.1/go.mod h1:OlCHIeLYqSSsLi6i49B5QGdzaMZK9+M7LXN2FKz4eGM= -google.golang.org/grpc v1.61.0 h1:TOvOcuXn30kRao+gfcvsebNEa5iZIiLkisYEkf7R7o0= -google.golang.org/grpc v1.61.0/go.mod h1:VUbo7IFqmF1QtCAstipjG0GIoq49KvMe9+h1jFLBNJs= -google.golang.org/grpc v1.61.1 h1:kLAiWrZs7YeDM6MumDe7m3y4aM6wacLzM1Y/wiLP9XY= -google.golang.org/grpc v1.61.1/go.mod h1:VUbo7IFqmF1QtCAstipjG0GIoq49KvMe9+h1jFLBNJs= google.golang.org/grpc v1.62.0 h1:HQKZ/fa1bXkX1oFOvSjmZEUL8wLSaZTjCcLAlmZRtdk= google.golang.org/grpc v1.62.0/go.mod h1:IWTG0VlJLCh1SkC58F7np9ka9mx/WNkjl4PGJaiq+QE= google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= @@ -558,6 +481,7 @@ gopkg.in/asn1-ber.v1 v1.0.0-20181015200546-f715ec2f112d/go.mod h1:cuepJuh7vyXfUy gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= +gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= gopkg.in/square/go-jose.v2 v2.3.1/go.mod h1:M9dMgbHiYLoDGQrXy7OpJDJWiKiU//h+vD76mk0e1AI= gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= From 60a03ce8e324ad497645c03546d65ab88b070626 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 4 Mar 2024 04:24:39 +0000 Subject: [PATCH 570/660] chore(deps): bump github.com/stretchr/testify from 1.8.4 to 1.9.0 Bumps [github.com/stretchr/testify](https://github.com/stretchr/testify) from 1.8.4 to 1.9.0. - [Release notes](https://github.com/stretchr/testify/releases) - [Commits](https://github.com/stretchr/testify/compare/v1.8.4...v1.9.0) --- updated-dependencies: - dependency-name: github.com/stretchr/testify dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index 35ab3bf9..b3c5adb0 100644 --- a/go.mod +++ b/go.mod @@ -11,7 +11,7 @@ require ( github.com/knadh/koanf/v2 v2.1.0 github.com/speps/go-hashids/v2 v2.0.1 github.com/spf13/cobra v1.8.0 - github.com/stretchr/testify v1.8.4 + github.com/stretchr/testify v1.9.0 github.com/tidwall/pretty v1.2.1 go.opentelemetry.io/otel v1.24.0 go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.24.0 diff --git a/go.sum b/go.sum index 9ff0dc26..a9cd7300 100644 --- a/go.sum +++ b/go.sum @@ -294,8 +294,8 @@ github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UV github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA= github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= -github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk= -github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= +github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg= +github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= github.com/tidwall/pretty v1.2.1 h1:qjsOFOWWQl+N3RsoF5/ssm1pHmJJwhjlSbZ51I6wMl4= github.com/tidwall/pretty v1.2.1/go.mod h1:ITEVvHYasfjBbM0u2Pg8T2nJnzm8xPwvNhhsoaGGjNU= github.com/valyala/bytebufferpool v1.0.0 h1:GqA5TC/0021Y/b9FG4Oi9Mr3q7XYx6KllzawFIhcdPw= From 3b380693cce341c911123aac8c8a43c46361984b Mon Sep 17 00:00:00 2001 From: Parham Alvani Date: Sun, 10 Mar 2024 07:47:11 +0000 Subject: [PATCH 571/660] feat: update workflows --- .github/workflows/test.yaml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 6591d368..319b5ac2 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -11,7 +11,7 @@ jobs: - uses: actions/checkout@v4 - uses: actions/setup-go@v5 with: - go-version: "1.22" + go-version-file: "go.mod" - name: golangci-lint uses: golangci/golangci-lint-action@v4 with: @@ -25,11 +25,13 @@ jobs: - uses: actions/checkout@v4 - uses: actions/setup-go@v5 with: - go-version: "1.22" + go-version-file: "go.mod" - run: go test -v ./... -covermode=atomic -coverprofile=coverage.out - uses: codecov/codecov-action@v4.1.0 with: files: coverage.out + token: ${{ secrets.CODECOV_TOKEN }} + slug: snapp-incubator/soteria docker: runs-on: ubuntu-latest From 29c111908c87ef48733a1755e2f6ca1c0f4c69b2 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 11 Mar 2024 01:43:01 +0000 Subject: [PATCH 572/660] chore(deps): bump github.com/golang-jwt/jwt/v5 from 5.2.0 to 5.2.1 Bumps [github.com/golang-jwt/jwt/v5](https://github.com/golang-jwt/jwt) from 5.2.0 to 5.2.1. - [Release notes](https://github.com/golang-jwt/jwt/releases) - [Changelog](https://github.com/golang-jwt/jwt/blob/main/VERSION_HISTORY.md) - [Commits](https://github.com/golang-jwt/jwt/compare/v5.2.0...v5.2.1) --- updated-dependencies: - dependency-name: github.com/golang-jwt/jwt/v5 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index b3c5adb0..110e7659 100644 --- a/go.mod +++ b/go.mod @@ -6,7 +6,7 @@ require ( github.com/ansrivas/fiberprometheus/v2 v2.6.1 github.com/gofiber/contrib/fiberzap v1.0.2 github.com/gofiber/fiber/v2 v2.52.2 - github.com/golang-jwt/jwt/v5 v5.2.0 + github.com/golang-jwt/jwt/v5 v5.2.1 github.com/knadh/koanf v1.5.0 github.com/knadh/koanf/v2 v2.1.0 github.com/speps/go-hashids/v2 v2.0.1 diff --git a/go.sum b/go.sum index a9cd7300..08d73be3 100644 --- a/go.sum +++ b/go.sum @@ -84,8 +84,8 @@ github.com/gofiber/fiber/v2 v2.52.2 h1:b0rYH6b06Df+4NyrbdptQL8ifuxw/Tf2DgfkZkDax github.com/gofiber/fiber/v2 v2.52.2/go.mod h1:KEOE+cXMhXG0zHc9d8+E38hoX+ZN7bhOtgeF2oT6jrQ= github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q= -github.com/golang-jwt/jwt/v5 v5.2.0 h1:d/ix8ftRUorsN+5eMIlF4T6J8CAt9rch3My2winC1Jw= -github.com/golang-jwt/jwt/v5 v5.2.0/go.mod h1:pqrtFR0X4osieyHYxtmOUWsAWrfe1Q5UVIyoH402zdk= +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= github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= From 778d0efcf18d66c70a4218ed0dd464e0b2287974 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 1 Apr 2024 01:32:25 +0000 Subject: [PATCH 573/660] chore(deps): bump codecov/codecov-action from 4.1.0 to 4.1.1 Bumps [codecov/codecov-action](https://github.com/codecov/codecov-action) from 4.1.0 to 4.1.1. - [Release notes](https://github.com/codecov/codecov-action/releases) - [Changelog](https://github.com/codecov/codecov-action/blob/main/CHANGELOG.md) - [Commits](https://github.com/codecov/codecov-action/compare/v4.1.0...v4.1.1) --- updated-dependencies: - dependency-name: codecov/codecov-action dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- .github/workflows/test.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 319b5ac2..e35ab657 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -27,7 +27,7 @@ jobs: with: go-version-file: "go.mod" - run: go test -v ./... -covermode=atomic -coverprofile=coverage.out - - uses: codecov/codecov-action@v4.1.0 + - uses: codecov/codecov-action@v4.1.1 with: files: coverage.out token: ${{ secrets.CODECOV_TOKEN }} From b20da195a46e1b82e5920011932d649f97cdf1b5 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 1 Apr 2024 01:37:40 +0000 Subject: [PATCH 574/660] chore(deps): bump github.com/gofiber/fiber/v2 from 2.52.2 to 2.52.4 Bumps [github.com/gofiber/fiber/v2](https://github.com/gofiber/fiber) from 2.52.2 to 2.52.4. - [Release notes](https://github.com/gofiber/fiber/releases) - [Commits](https://github.com/gofiber/fiber/compare/v2.52.2...v2.52.4) --- updated-dependencies: - dependency-name: github.com/gofiber/fiber/v2 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index 110e7659..45e1f23a 100644 --- a/go.mod +++ b/go.mod @@ -5,7 +5,7 @@ go 1.22 require ( github.com/ansrivas/fiberprometheus/v2 v2.6.1 github.com/gofiber/contrib/fiberzap v1.0.2 - github.com/gofiber/fiber/v2 v2.52.2 + github.com/gofiber/fiber/v2 v2.52.4 github.com/golang-jwt/jwt/v5 v5.2.1 github.com/knadh/koanf v1.5.0 github.com/knadh/koanf/v2 v2.1.0 diff --git a/go.sum b/go.sum index 08d73be3..3e04ad5c 100644 --- a/go.sum +++ b/go.sum @@ -80,8 +80,8 @@ github.com/gofiber/adaptor/v2 v2.2.1 h1:givE7iViQWlsTR4Jh7tB4iXzrlKBgiraB/yTdHs9 github.com/gofiber/adaptor/v2 v2.2.1/go.mod h1:AhR16dEqs25W2FY/l8gSj1b51Azg5dtPDmm+pruNOrc= github.com/gofiber/contrib/fiberzap v1.0.2 h1:EQwhggtszVfIdBeXxN9Xrmld71es34Ufs+ef8VMqZxc= github.com/gofiber/contrib/fiberzap v1.0.2/go.mod h1:jGO8BHU4gRI9U0JtM6zj2CIhYfgVmW5JxziN8NTgVwE= -github.com/gofiber/fiber/v2 v2.52.2 h1:b0rYH6b06Df+4NyrbdptQL8ifuxw/Tf2DgfkZkDaxEo= -github.com/gofiber/fiber/v2 v2.52.2/go.mod h1:KEOE+cXMhXG0zHc9d8+E38hoX+ZN7bhOtgeF2oT6jrQ= +github.com/gofiber/fiber/v2 v2.52.4 h1:P+T+4iK7VaqUsq2PALYEfBBo6bJZ4q3FP8cZ84EggTM= +github.com/gofiber/fiber/v2 v2.52.4/go.mod h1:KEOE+cXMhXG0zHc9d8+E38hoX+ZN7bhOtgeF2oT6jrQ= github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q= github.com/golang-jwt/jwt/v5 v5.2.1 h1:OuVbFODueb089Lh128TAcimifWaLhJwVflnrgM17wHk= From a513d5766fbc4b57a8494990ab61f4ee8a265b3f Mon Sep 17 00:00:00 2001 From: Parham Alvani Date: Mon, 1 Apr 2024 18:36:25 +0000 Subject: [PATCH 575/660] fix: correct lint issues --- internal/api/api_test.go | 2 -- internal/authenticator/builder_internal_test.go | 2 -- internal/authenticator/manual_authenticator_test.go | 1 - internal/topics/config.go | 6 +++--- internal/topics/manager_test.go | 1 - internal/topics/topic.go | 6 +++--- 6 files changed, 6 insertions(+), 12 deletions(-) diff --git a/internal/api/api_test.go b/internal/api/api_test.go index c4cc70fc..f5d895c6 100644 --- a/internal/api/api_test.go +++ b/internal/api/api_test.go @@ -98,8 +98,6 @@ func TestExtractVendorToken(t *testing.T) { }, } for _, tt := range tests { - tt := tt - t.Run(tt.name, func(t *testing.T) { t.Parallel() diff --git a/internal/authenticator/builder_internal_test.go b/internal/authenticator/builder_internal_test.go index c86840e3..35f7f66a 100644 --- a/internal/authenticator/builder_internal_test.go +++ b/internal/authenticator/builder_internal_test.go @@ -64,8 +64,6 @@ func TestToUserAccessType(t *testing.T) { } for _, c := range cases { - c := c - t.Run(c.name, func(t *testing.T) { t.Parallel() diff --git a/internal/authenticator/manual_authenticator_test.go b/internal/authenticator/manual_authenticator_test.go index 67ca0ed5..dee45a00 100644 --- a/internal/authenticator/manual_authenticator_test.go +++ b/internal/authenticator/manual_authenticator_test.go @@ -417,7 +417,6 @@ func TestManualAuthenticator_validateAccessType(t *testing.T) { } for _, tt := range tests { - tt := tt t.Run(tt.name, func(t *testing.T) { t.Parallel() diff --git a/internal/topics/config.go b/internal/topics/config.go index 341e8901..148422f4 100644 --- a/internal/topics/config.go +++ b/internal/topics/config.go @@ -1,7 +1,7 @@ package topics type HashData struct { - Length int `koanf:"length"` - Salt string `koanf:"salt"` - Alphabet string `koanf:"alphabet"` + Length int `json:"length,omitempty" koanf:"length"` + Salt string `json:"salt,omitempty" koanf:"salt"` + Alphabet string `json:"alphabet,omitempty" koanf:"alphabet"` } diff --git a/internal/topics/manager_test.go b/internal/topics/manager_test.go index 4314fe5f..8ef7313e 100644 --- a/internal/topics/manager_test.go +++ b/internal/topics/manager_test.go @@ -141,7 +141,6 @@ func TestTopicManager(t *testing.T) { sub := "DXKgaNQa7N5Y7bo" for _, tc := range tests { - tc := tc t.Run(tc.name, func(t *testing.T) { t.Parallel() diff --git a/internal/topics/topic.go b/internal/topics/topic.go index 136ff263..9ad8ffed 100644 --- a/internal/topics/topic.go +++ b/internal/topics/topic.go @@ -8,9 +8,9 @@ import ( ) type Topic struct { - Type string `koanf:"type"` - Template string `koanf:"template"` - Accesses map[string]acl.AccessType `koanf:"accesses"` + Type string `json:"type,omitempty" koanf:"type"` + Template string `json:"template,omitempty" koanf:"template"` + Accesses map[string]acl.AccessType `json:"accesses,omitempty" koanf:"accesses"` } type Template struct { From 375b1d57a5c82f5c999cf27359ad9f27726f215d Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 8 Apr 2024 01:34:49 +0000 Subject: [PATCH 576/660] chore(deps): bump codecov/codecov-action from 4.1.1 to 4.2.0 Bumps [codecov/codecov-action](https://github.com/codecov/codecov-action) from 4.1.1 to 4.2.0. - [Release notes](https://github.com/codecov/codecov-action/releases) - [Changelog](https://github.com/codecov/codecov-action/blob/main/CHANGELOG.md) - [Commits](https://github.com/codecov/codecov-action/compare/v4.1.1...v4.2.0) --- updated-dependencies: - dependency-name: codecov/codecov-action dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- .github/workflows/test.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index e35ab657..b0da35c4 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -27,7 +27,7 @@ jobs: with: go-version-file: "go.mod" - run: go test -v ./... -covermode=atomic -coverprofile=coverage.out - - uses: codecov/codecov-action@v4.1.1 + - uses: codecov/codecov-action@v4.2.0 with: files: coverage.out token: ${{ secrets.CODECOV_TOKEN }} From 4526bf1da83f719bc206d0dc2b45ffe4acce3f78 Mon Sep 17 00:00:00 2001 From: Parham Alvani Date: Mon, 8 Apr 2024 03:06:58 +0000 Subject: [PATCH 577/660] feat: update packages --- go.mod | 40 ++++++++++++++++++++-------------------- go.sum | 43 +++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 63 insertions(+), 20 deletions(-) diff --git a/go.mod b/go.mod index 45e1f23a..9d9b6903 100644 --- a/go.mod +++ b/go.mod @@ -8,15 +8,15 @@ require ( github.com/gofiber/fiber/v2 v2.52.4 github.com/golang-jwt/jwt/v5 v5.2.1 github.com/knadh/koanf v1.5.0 - github.com/knadh/koanf/v2 v2.1.0 + github.com/knadh/koanf/v2 v2.1.1 github.com/speps/go-hashids/v2 v2.0.1 github.com/spf13/cobra v1.8.0 github.com/stretchr/testify v1.9.0 github.com/tidwall/pretty v1.2.1 - go.opentelemetry.io/otel v1.24.0 - go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.24.0 - go.opentelemetry.io/otel/sdk v1.24.0 - go.opentelemetry.io/otel/trace v1.24.0 + go.opentelemetry.io/otel v1.25.0 + go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.25.0 + go.opentelemetry.io/otel/sdk v1.25.0 + go.opentelemetry.io/otel/trace v1.25.0 go.uber.org/automaxprocs v1.5.3 go.uber.org/zap v1.27.0 ) @@ -24,8 +24,8 @@ require ( require ( github.com/andybalholm/brotli v1.1.0 // indirect github.com/beorn7/perks v1.0.1 // indirect - github.com/cenkalti/backoff/v4 v4.2.1 // indirect - github.com/cespare/xxhash/v2 v2.2.0 // indirect + github.com/cenkalti/backoff/v4 v4.3.0 // indirect + github.com/cespare/xxhash/v2 v2.3.0 // indirect github.com/davecgh/go-spew v1.1.1 // indirect github.com/fatih/structs v1.1.0 // indirect github.com/fsnotify/fsnotify v1.7.0 // indirect @@ -33,7 +33,7 @@ require ( github.com/go-logr/stdr v1.2.2 // indirect github.com/go-viper/mapstructure/v2 v2.0.0-alpha.1 // indirect github.com/gofiber/adaptor/v2 v2.2.1 // indirect - github.com/golang/protobuf v1.5.3 // indirect + github.com/golang/protobuf v1.5.4 // indirect github.com/google/uuid v1.6.0 // indirect github.com/grpc-ecosystem/grpc-gateway/v2 v2.19.1 // indirect github.com/inconshreveable/mousetrap v1.1.0 // indirect @@ -44,25 +44,25 @@ require ( github.com/mitchellh/copystructure v1.2.0 // indirect github.com/mitchellh/reflectwalk v1.0.2 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect - github.com/prometheus/client_golang v1.18.0 // indirect - github.com/prometheus/client_model v0.6.0 // indirect - github.com/prometheus/common v0.48.0 // indirect - github.com/prometheus/procfs v0.12.0 // indirect + github.com/prometheus/client_golang v1.19.0 // indirect + github.com/prometheus/client_model v0.6.1 // indirect + github.com/prometheus/common v0.52.2 // indirect + github.com/prometheus/procfs v0.13.0 // indirect github.com/rivo/uniseg v0.4.7 // indirect github.com/spf13/pflag v1.0.5 // indirect github.com/valyala/bytebufferpool v1.0.0 // indirect github.com/valyala/fasthttp v1.52.0 // indirect github.com/valyala/tcplisten v1.0.0 // indirect - go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.24.0 // indirect - go.opentelemetry.io/otel/metric v1.24.0 // indirect + go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.25.0 // indirect + go.opentelemetry.io/otel/metric v1.25.0 // indirect go.opentelemetry.io/proto/otlp v1.1.0 // indirect go.uber.org/multierr v1.11.0 // indirect - golang.org/x/net v0.21.0 // indirect - golang.org/x/sys v0.17.0 // indirect + golang.org/x/net v0.24.0 // indirect + golang.org/x/sys v0.19.0 // indirect golang.org/x/text v0.14.0 // indirect - google.golang.org/genproto/googleapis/api v0.0.0-20240221002015-b0ce06bbee7c // indirect - google.golang.org/genproto/googleapis/rpc v0.0.0-20240221002015-b0ce06bbee7c // indirect - google.golang.org/grpc v1.62.0 // indirect - google.golang.org/protobuf v1.32.0 // indirect + google.golang.org/genproto/googleapis/api v0.0.0-20240401170217-c3f982113cda // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20240401170217-c3f982113cda // indirect + google.golang.org/grpc v1.63.0 // indirect + google.golang.org/protobuf v1.33.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect ) diff --git a/go.sum b/go.sum index 3e04ad5c..ffef6770 100644 --- a/go.sum +++ b/go.sum @@ -32,10 +32,14 @@ github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6r github.com/bgentry/speakeasy v0.1.0/go.mod h1:+zsyZBPWlz7T6j88CTgSN5bM796AkVf0kBD4zp0CCIs= github.com/cenkalti/backoff/v4 v4.2.1 h1:y4OZtCnogmCPw98Zjyt5a6+QwPLGkiQsYW5oUqylYbM= github.com/cenkalti/backoff/v4 v4.2.1/go.mod h1:Y3VNntkOUPxTVeUxJ/G5vcM//AlwfmyYozVcomhLiZE= +github.com/cenkalti/backoff/v4 v4.3.0 h1:MyRJ/UdXutAwSAT+s3wNd7MfTIcy71VQueUuFK343L8= +github.com/cenkalti/backoff/v4 v4.3.0/go.mod h1:Y3VNntkOUPxTVeUxJ/G5vcM//AlwfmyYozVcomhLiZE= github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= github.com/cespare/xxhash/v2 v2.2.0 h1:DC2CZ1Ep5Y4k3ZQ899DldepgrayRUGE6BBZ/cd9Cj44= github.com/cespare/xxhash/v2 v2.2.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= +github.com/cespare/xxhash/v2 v2.3.0 h1:UL815xU9SqsFlibzuggzjXhog7bL6oX9BbNZnL2UFvs= +github.com/cespare/xxhash/v2 v2.3.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc= github.com/cncf/udpa/go v0.0.0-20201120205902-5459f2c99403/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= @@ -104,6 +108,8 @@ github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaS github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= github.com/golang/protobuf v1.5.3 h1:KhyjKVUg7Usr/dYsdSqoFveMYd5ko72D+zANwlG1mmg= github.com/golang/protobuf v1.5.3/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= +github.com/golang/protobuf v1.5.4 h1:i7eJL8qZTpSEXOPTxNKhASYpMn+8e5Q6AdndVa1dWek= +github.com/golang/protobuf v1.5.4/go.mod h1:lnTiLA8Wa4RWRcIUkrtSVa5nRhsEGBg48fD6rSs7xps= github.com/golang/snappy v0.0.1/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= @@ -122,6 +128,7 @@ github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+ 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/grpc-ecosystem/go-grpc-prometheus v1.2.0/go.mod h1:8NvIoxWQoOIhqOTXgfV/d3M/q6VIi02HzZEHgUlZvzk= +github.com/grpc-ecosystem/grpc-gateway v1.16.0 h1:gmcG1KaJ57LophUzW0Hy8NmPhnMZb4M0+kPpLofRdBo= github.com/grpc-ecosystem/grpc-gateway v1.16.0/go.mod h1:BDjrQk3hbvj6Nolgz8mAMFbcEtjT1g+wF4CSlocrBnw= github.com/grpc-ecosystem/grpc-gateway/v2 v2.19.1 h1:/c3QmbOGMGTOumP2iT/rCwB7b0QDGLKzqOmktBjT+Is= github.com/grpc-ecosystem/grpc-gateway/v2 v2.19.1/go.mod h1:5SN9VR2LTsRFsrEC6FHgRbTWrTHu6tqPeKxEQv15giM= @@ -176,8 +183,11 @@ github.com/klauspost/compress v1.17.7 h1:ehO88t2UGzQK66LMdE8tibEd1ErmzZjNEqWkjLA github.com/klauspost/compress v1.17.7/go.mod h1:Di0epgTjJY877eYKx5yC51cX2A2Vl2ibi7bDH9ttBbw= github.com/knadh/koanf v1.5.0 h1:q2TSd/3Pyc/5yP9ldIrSdIz26MCcyNQzW0pEAugLPNs= github.com/knadh/koanf v1.5.0/go.mod h1:Hgyjp4y8v44hpZtPzs7JZfRAW5AhN7KfZcwv1RYggDs= +github.com/knadh/koanf/maps v0.1.1 h1:G5TjmUh2D7G2YWf5SQQqSiHRJEjaicvU0KpypqB3NIs= github.com/knadh/koanf/v2 v2.1.0 h1:eh4QmHHBuU8BybfIJ8mB8K8gsGCD/AUQTdwGq/GzId8= github.com/knadh/koanf/v2 v2.1.0/go.mod h1:4mnTRbZCK+ALuBXHZMjDfG9y714L7TykVnZkXbMU3Es= +github.com/knadh/koanf/v2 v2.1.1 h1:/R8eXqasSTsmDCsAyYj+81Wteg8AqrV9CP6gvsTsOmM= +github.com/knadh/koanf/v2 v2.1.1/go.mod h1:4mnTRbZCK+ALuBXHZMjDfG9y714L7TykVnZkXbMU3Es= github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/konsorten/go-windows-terminal-sequences v1.0.3/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc= @@ -249,23 +259,31 @@ github.com/prometheus/client_golang v1.7.1/go.mod h1:PY5Wy2awLA44sXw4AOSfFBetzPP github.com/prometheus/client_golang v1.11.1/go.mod h1:Z6t4BnS23TR94PD6BsDNk8yVqroYurpAkEiz0P2BEV0= github.com/prometheus/client_golang v1.18.0 h1:HzFfmkOzH5Q8L8G+kSJKUx5dtG87sewO+FoDDqP5Tbk= github.com/prometheus/client_golang v1.18.0/go.mod h1:T+GXkCk5wSJyOqMIzVgvvjFDlkOQntgjkJWKrN5txjA= +github.com/prometheus/client_golang v1.19.0 h1:ygXvpU1AoN1MhdzckN+PyD9QJOSD4x7kmXYlnfbA6JU= +github.com/prometheus/client_golang v1.19.0/go.mod h1:ZRM9uEAypZakd+q/x7+gmsvXdURP+DABIEIjnmDdp+k= github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/client_model v0.2.0/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/client_model v0.6.0 h1:k1v3CzpSRUTrKMppY35TLwPvxHqBu0bYgxZzqGIgaos= github.com/prometheus/client_model v0.6.0/go.mod h1:NTQHnmxFpouOD0DpvP4XujX3CdOAGQPoaGhyTchlyt8= +github.com/prometheus/client_model v0.6.1 h1:ZKSh/rekM+n3CeS952MLRAdFwIKqeY8b62p8ais2e9E= +github.com/prometheus/client_model v0.6.1/go.mod h1:OrxVMOVHjw3lKMa8+x6HeMGkHMQyHDk9E3jmP2AmGiY= github.com/prometheus/common v0.4.1/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= github.com/prometheus/common v0.10.0/go.mod h1:Tlit/dnDKsSWFlCLTWaA1cyBgKHSMdTB80sz/V91rCo= github.com/prometheus/common v0.26.0/go.mod h1:M7rCNAaPfAosfx8veZJCuw84e35h3Cfd9VFqTh1DIvc= github.com/prometheus/common v0.48.0 h1:QO8U2CdOzSn1BBsmXJXduaaW+dY/5QLjfB8svtSzKKE= github.com/prometheus/common v0.48.0/go.mod h1:0/KsvlIEfPQCQ5I2iNSAWKPZziNCvRs5EC6ILDTlAPc= +github.com/prometheus/common v0.52.2 h1:LW8Vk7BccEdONfrJBDffQGRtpSzi5CQaRZGtboOO2ck= +github.com/prometheus/common v0.52.2/go.mod h1:lrWtQx+iDfn2mbH5GUzlH9TSHyfZpHkSiG1W7y3sF2Q= github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= github.com/prometheus/procfs v0.1.3/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU= github.com/prometheus/procfs v0.6.0/go.mod h1:cz+aTbrPOrUb4q7XlbU9ygM+/jj0fzG6c1xBZuNvfVA= github.com/prometheus/procfs v0.12.0 h1:jluTpSng7V9hY0O2R9DzzJHYb2xULk9VTR1V1R/k6Bo= github.com/prometheus/procfs v0.12.0/go.mod h1:pcuDEFsWDnvcgNzo4EEweacyhjeA9Zk3cnaOZAZEfOo= +github.com/prometheus/procfs v0.13.0 h1:GqzLlQyfsPbaEHaQkO7tbDlriv/4o5Hudv6OXHGKX7o= +github.com/prometheus/procfs v0.13.0/go.mod h1:cd4PFCR54QLnGKPaKGA6l+cfuNXtht43ZKY6tow0Y1g= github.com/rhnvrm/simples3 v0.6.1/go.mod h1:Y+3vYm2V7Y4VijFoJHHTrja6OgPrJ2cBti8dPGkC3sA= github.com/rivo/uniseg v0.2.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc= github.com/rivo/uniseg v0.4.7 h1:WUdvkW8uEhrYfLC4ZzdpI2ztxP1I582+49Oc5Mq64VQ= @@ -312,16 +330,28 @@ go.etcd.io/etcd/client/pkg/v3 v3.5.4/go.mod h1:IJHfcCEKxYu1Os13ZdwCwIUTUVGYTSAM3 go.etcd.io/etcd/client/v3 v3.5.4/go.mod h1:ZaRkVgBZC+L+dLCjTcF1hRXpgZXQPOvnA/Ak/gq3kiY= go.opentelemetry.io/otel v1.24.0 h1:0LAOdjNmQeSTzGBzduGe/rU4tZhMwL5rWgtp9Ku5Jfo= go.opentelemetry.io/otel v1.24.0/go.mod h1:W7b9Ozg4nkF5tWI5zsXkaKKDjdVjpD4oAt9Qi/MArHo= +go.opentelemetry.io/otel v1.25.0 h1:gldB5FfhRl7OJQbUHt/8s0a7cE8fbsPAtdpRaApKy4k= +go.opentelemetry.io/otel v1.25.0/go.mod h1:Wa2ds5NOXEMkCmUou1WA7ZBfLTHWIsp034OVD7AO+Vg= go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.24.0 h1:t6wl9SPayj+c7lEIFgm4ooDBZVb01IhLB4InpomhRw8= go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.24.0/go.mod h1:iSDOcsnSA5INXzZtwaBPrKp/lWu/V14Dd+llD0oI2EA= +go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.25.0 h1:dT33yIHtmsqpixFsSQPwNeY5drM9wTcoL8h0FWF4oGM= +go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.25.0/go.mod h1:h95q0LBGh7hlAC08X2DhSeyIG02YQ0UyioTCVAqRPmc= go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.24.0 h1:Mw5xcxMwlqoJd97vwPxA8isEaIoxsta9/Q51+TTJLGE= go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.24.0/go.mod h1:CQNu9bj7o7mC6U7+CA/schKEYakYXWr79ucDHTMGhCM= +go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.25.0 h1:vOL89uRfOCCNIjkisd0r7SEdJF3ZJFyCNY34fdZs8eU= +go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.25.0/go.mod h1:8GlBGcDk8KKi7n+2S4BT/CPZQYH3erLu0/k64r1MYgo= go.opentelemetry.io/otel/metric v1.24.0 h1:6EhoGWWK28x1fbpA4tYTOWBkPefTDQnb8WSGXlc88kI= go.opentelemetry.io/otel/metric v1.24.0/go.mod h1:VYhLe1rFfxuTXLgj4CBiyz+9WYBA8pNGJgDcSFRKBco= +go.opentelemetry.io/otel/metric v1.25.0 h1:LUKbS7ArpFL/I2jJHdJcqMGxkRdxpPHE0VU/D4NuEwA= +go.opentelemetry.io/otel/metric v1.25.0/go.mod h1:rkDLUSd2lC5lq2dFNrX9LGAbINP5B7WBkC78RXCpH5s= go.opentelemetry.io/otel/sdk v1.24.0 h1:YMPPDNymmQN3ZgczicBY3B6sf9n62Dlj9pWD3ucgoDw= go.opentelemetry.io/otel/sdk v1.24.0/go.mod h1:KVrIYw6tEubO9E96HQpcmpTKDVn9gdv35HoYiQWGDFg= +go.opentelemetry.io/otel/sdk v1.25.0 h1:PDryEJPC8YJZQSyLY5eqLeafHtG+X7FWnf3aXMtxbqo= +go.opentelemetry.io/otel/sdk v1.25.0/go.mod h1:oFgzCM2zdsxKzz6zwpTZYLLQsFwc+K0daArPdIhuxkw= go.opentelemetry.io/otel/trace v1.24.0 h1:CsKnnL4dUAr/0llH9FKuc698G04IrpWV0MQA/Y1YELI= go.opentelemetry.io/otel/trace v1.24.0/go.mod h1:HPc3Xr/cOApsBI154IU0OI0HJexz+aw5uPdbs3UCjNU= +go.opentelemetry.io/otel/trace v1.25.0 h1:tqukZGLwQYRIFtSQM2u2+yfMVTgGVeqRLPUYx1Dq6RM= +go.opentelemetry.io/otel/trace v1.25.0/go.mod h1:hCCs70XM/ljO+BeQkyFnbK28SBIJ/Emuha+ccrCRT7I= go.opentelemetry.io/proto/otlp v1.1.0 h1:2Di21piLrCqJ3U3eXGCTPHE9R8Nh+0uglSnOyxikMeI= go.opentelemetry.io/proto/otlp v1.1.0/go.mod h1:GpBHCBWiqvVLDqmHZsoMM3C5ySeKTC7ej/RNTae6MdY= go.uber.org/atomic v1.7.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc= @@ -368,6 +398,8 @@ golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96b golang.org/x/net v0.0.0-20210410081132-afb366fc7cd1/go.mod h1:9tjilg8BloeKEkVJvy7fQ90B1CfIiPueXVOjqfkSzI8= golang.org/x/net v0.21.0 h1:AQyQV4dYCvJ7vGmJyKki9+PBdyvhkSd8EIx/qb0AYv4= golang.org/x/net v0.21.0/go.mod h1:bIjVDfnllIU7BJ2DNgfnXvpSvtn8VRwhlsaeUTyUS44= +golang.org/x/net v0.24.0 h1:1PcaxkF854Fu3+lvBIx5SYn9wRlBzzcnHZSiaFFAb0w= +golang.org/x/net v0.24.0/go.mod h1:2Q7sJY5mzlzWjKtYUEXSlBWCdyaioyXzRB2RtU8KVE8= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= @@ -414,6 +446,8 @@ golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.17.0 h1:25cE3gD+tdBA7lp7QfhuV+rJiE9YXTcS3VG1SqssI/Y= golang.org/x/sys v0.17.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.19.0 h1:q5f1RH2jigJ1MoAWp2KTp3gm5zAGFUTarQZ5U386+4o= +golang.org/x/sys v0.19.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.1-0.20181227161524-e6919f6577db/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= @@ -449,10 +483,15 @@ google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEY google.golang.org/genproto v0.0.0-20210602131652-f16073e35f0c/go.mod h1:UODoCrxHCcBojKKwX1terBiRUaqAsFqJiF615XL43r0= google.golang.org/genproto v0.0.0-20240213162025-012b6fc9bca9 h1:9+tzLLstTlPTRyJTh+ah5wIMsBW5c4tQwGTN3thOW9Y= google.golang.org/genproto v0.0.0-20240213162025-012b6fc9bca9/go.mod h1:mqHbVIp48Muh7Ywss/AD6I5kNVKZMmAa/QEW58Gxp2s= +google.golang.org/genproto v0.0.0-20240227224415-6ceb2ff114de h1:F6qOa9AZTYJXOUEr4jDysRDLrm4PHePlge4v4TGAlxY= google.golang.org/genproto/googleapis/api v0.0.0-20240221002015-b0ce06bbee7c h1:9g7erC9qu44ks7UK4gDNlnk4kOxZG707xKm4jVniy6o= google.golang.org/genproto/googleapis/api v0.0.0-20240221002015-b0ce06bbee7c/go.mod h1:5iCWqnniDlqZHrd3neWVTOwvh/v6s3232omMecelax8= +google.golang.org/genproto/googleapis/api v0.0.0-20240401170217-c3f982113cda h1:b6F6WIV4xHHD0FA4oIyzU6mHWg2WI2X1RBehwa5QN38= +google.golang.org/genproto/googleapis/api v0.0.0-20240401170217-c3f982113cda/go.mod h1:AHcE/gZH76Bk/ROZhQphlRoWo5xKDEtz3eVEO1LfA8c= google.golang.org/genproto/googleapis/rpc v0.0.0-20240221002015-b0ce06bbee7c h1:NUsgEN92SQQqzfA+YtqYNqYmB3DMMYLlIwUZAQFVFbo= google.golang.org/genproto/googleapis/rpc v0.0.0-20240221002015-b0ce06bbee7c/go.mod h1:H4O17MA/PE9BsGx3w+a+W2VOLLD1Qf7oJneAoU6WktY= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240401170217-c3f982113cda h1:LI5DOvAxUPMv/50agcLLoo+AdWc1irS9Rzz4vPuD1V4= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240401170217-c3f982113cda/go.mod h1:WtryC6hu0hhx87FDGxWCDptyssuo68sk10vYjF+T9fY= google.golang.org/grpc v1.14.0/go.mod h1:yo6s7OP7yaDglbqo1J04qKzAhqBH6lvTonzMVmEdcZw= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= google.golang.org/grpc v1.22.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= @@ -463,6 +502,8 @@ google.golang.org/grpc v1.33.1/go.mod h1:fr5YgcSWrqhRRxogOsw7RzIpsmvOZ6IcH4kBYTp google.golang.org/grpc v1.38.0/go.mod h1:NREThFqKR1f3iQ6oBuvc5LadQuXVGo9rkm5ZGrQdJfM= google.golang.org/grpc v1.62.0 h1:HQKZ/fa1bXkX1oFOvSjmZEUL8wLSaZTjCcLAlmZRtdk= google.golang.org/grpc v1.62.0/go.mod h1:IWTG0VlJLCh1SkC58F7np9ka9mx/WNkjl4PGJaiq+QE= +google.golang.org/grpc v1.63.0 h1:WjKe+dnvABXyPJMD7KDNLxtoGk5tgk+YFWN6cBWjZE8= +google.golang.org/grpc v1.63.0/go.mod h1:WAX/8DgncnokcFUldAxq7GeB5DXHDbMF+lLvDomNkRA= 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= @@ -476,6 +517,8 @@ google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp0 google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= google.golang.org/protobuf v1.32.0 h1:pPC6BG5ex8PDFnkbrGU3EixyhKcQ2aDuBS36lqK/C7I= google.golang.org/protobuf v1.32.0/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos= +google.golang.org/protobuf v1.33.0 h1:uNO2rsAINq/JlFpSdYEKIZ0uKD/R9cpdv0T+yoGwGmI= +google.golang.org/protobuf v1.33.0/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos= gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= gopkg.in/asn1-ber.v1 v1.0.0-20181015200546-f715ec2f112d/go.mod h1:cuepJuh7vyXfUyUwEgHQXw849cJrilpS5NeIjOWESAw= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= From ebba0f944625df6893fe2a4ff3c055db6efe3d7d Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 15 Apr 2024 01:16:57 +0000 Subject: [PATCH 578/660] chore(deps): bump codecov/codecov-action from 4.2.0 to 4.3.0 Bumps [codecov/codecov-action](https://github.com/codecov/codecov-action) from 4.2.0 to 4.3.0. - [Release notes](https://github.com/codecov/codecov-action/releases) - [Changelog](https://github.com/codecov/codecov-action/blob/main/CHANGELOG.md) - [Commits](https://github.com/codecov/codecov-action/compare/v4.2.0...v4.3.0) --- updated-dependencies: - dependency-name: codecov/codecov-action dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- .github/workflows/test.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index b0da35c4..414752ae 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -27,7 +27,7 @@ jobs: with: go-version-file: "go.mod" - run: go test -v ./... -covermode=atomic -coverprofile=coverage.out - - uses: codecov/codecov-action@v4.2.0 + - uses: codecov/codecov-action@v4.3.0 with: files: coverage.out token: ${{ secrets.CODECOV_TOKEN }} From 3bfd53496410ace1dca98b01d64aeb841746943c Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 29 Apr 2024 01:26:22 +0000 Subject: [PATCH 579/660] chore(deps): bump go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc Bumps [go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc](https://github.com/open-telemetry/opentelemetry-go) from 1.25.0 to 1.26.0. - [Release notes](https://github.com/open-telemetry/opentelemetry-go/releases) - [Changelog](https://github.com/open-telemetry/opentelemetry-go/blob/main/CHANGELOG.md) - [Commits](https://github.com/open-telemetry/opentelemetry-go/compare/v1.25.0...v1.26.0) --- updated-dependencies: - dependency-name: go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- go.mod | 17 ++++++------- go.sum | 79 ++++++++++++---------------------------------------------- 2 files changed, 24 insertions(+), 72 deletions(-) diff --git a/go.mod b/go.mod index 9d9b6903..0f5d5d21 100644 --- a/go.mod +++ b/go.mod @@ -13,10 +13,10 @@ require ( github.com/spf13/cobra v1.8.0 github.com/stretchr/testify v1.9.0 github.com/tidwall/pretty v1.2.1 - go.opentelemetry.io/otel v1.25.0 - go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.25.0 - go.opentelemetry.io/otel/sdk v1.25.0 - go.opentelemetry.io/otel/trace v1.25.0 + go.opentelemetry.io/otel v1.26.0 + go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.26.0 + go.opentelemetry.io/otel/sdk v1.26.0 + go.opentelemetry.io/otel/trace v1.26.0 go.uber.org/automaxprocs v1.5.3 go.uber.org/zap v1.27.0 ) @@ -33,7 +33,6 @@ require ( github.com/go-logr/stdr v1.2.2 // indirect github.com/go-viper/mapstructure/v2 v2.0.0-alpha.1 // indirect github.com/gofiber/adaptor/v2 v2.2.1 // indirect - github.com/golang/protobuf v1.5.4 // indirect github.com/google/uuid v1.6.0 // indirect github.com/grpc-ecosystem/grpc-gateway/v2 v2.19.1 // indirect github.com/inconshreveable/mousetrap v1.1.0 // indirect @@ -53,16 +52,16 @@ require ( github.com/valyala/bytebufferpool v1.0.0 // indirect github.com/valyala/fasthttp v1.52.0 // indirect github.com/valyala/tcplisten v1.0.0 // indirect - go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.25.0 // indirect - go.opentelemetry.io/otel/metric v1.25.0 // indirect - go.opentelemetry.io/proto/otlp v1.1.0 // indirect + go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.26.0 // indirect + go.opentelemetry.io/otel/metric v1.26.0 // indirect + go.opentelemetry.io/proto/otlp v1.2.0 // indirect go.uber.org/multierr v1.11.0 // indirect golang.org/x/net v0.24.0 // indirect golang.org/x/sys v0.19.0 // indirect golang.org/x/text v0.14.0 // indirect google.golang.org/genproto/googleapis/api v0.0.0-20240401170217-c3f982113cda // indirect google.golang.org/genproto/googleapis/rpc v0.0.0-20240401170217-c3f982113cda // indirect - google.golang.org/grpc v1.63.0 // indirect + google.golang.org/grpc v1.63.2 // indirect google.golang.org/protobuf v1.33.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect ) diff --git a/go.sum b/go.sum index ffef6770..0b066e93 100644 --- a/go.sum +++ b/go.sum @@ -30,14 +30,10 @@ github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+Ce 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/bgentry/speakeasy v0.1.0/go.mod h1:+zsyZBPWlz7T6j88CTgSN5bM796AkVf0kBD4zp0CCIs= -github.com/cenkalti/backoff/v4 v4.2.1 h1:y4OZtCnogmCPw98Zjyt5a6+QwPLGkiQsYW5oUqylYbM= -github.com/cenkalti/backoff/v4 v4.2.1/go.mod h1:Y3VNntkOUPxTVeUxJ/G5vcM//AlwfmyYozVcomhLiZE= github.com/cenkalti/backoff/v4 v4.3.0 h1:MyRJ/UdXutAwSAT+s3wNd7MfTIcy71VQueUuFK343L8= github.com/cenkalti/backoff/v4 v4.3.0/go.mod h1:Y3VNntkOUPxTVeUxJ/G5vcM//AlwfmyYozVcomhLiZE= github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= -github.com/cespare/xxhash/v2 v2.2.0 h1:DC2CZ1Ep5Y4k3ZQ899DldepgrayRUGE6BBZ/cd9Cj44= -github.com/cespare/xxhash/v2 v2.2.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= github.com/cespare/xxhash/v2 v2.3.0 h1:UL815xU9SqsFlibzuggzjXhog7bL6oX9BbNZnL2UFvs= github.com/cespare/xxhash/v2 v2.3.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= @@ -106,10 +102,6 @@ github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw github.com/golang/protobuf v1.4.3/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= -github.com/golang/protobuf v1.5.3 h1:KhyjKVUg7Usr/dYsdSqoFveMYd5ko72D+zANwlG1mmg= -github.com/golang/protobuf v1.5.3/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= -github.com/golang/protobuf v1.5.4 h1:i7eJL8qZTpSEXOPTxNKhASYpMn+8e5Q6AdndVa1dWek= -github.com/golang/protobuf v1.5.4/go.mod h1:lnTiLA8Wa4RWRcIUkrtSVa5nRhsEGBg48fD6rSs7xps= github.com/golang/snappy v0.0.1/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= @@ -128,7 +120,6 @@ github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+ 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/grpc-ecosystem/go-grpc-prometheus v1.2.0/go.mod h1:8NvIoxWQoOIhqOTXgfV/d3M/q6VIi02HzZEHgUlZvzk= -github.com/grpc-ecosystem/grpc-gateway v1.16.0 h1:gmcG1KaJ57LophUzW0Hy8NmPhnMZb4M0+kPpLofRdBo= github.com/grpc-ecosystem/grpc-gateway v1.16.0/go.mod h1:BDjrQk3hbvj6Nolgz8mAMFbcEtjT1g+wF4CSlocrBnw= github.com/grpc-ecosystem/grpc-gateway/v2 v2.19.1 h1:/c3QmbOGMGTOumP2iT/rCwB7b0QDGLKzqOmktBjT+Is= github.com/grpc-ecosystem/grpc-gateway/v2 v2.19.1/go.mod h1:5SN9VR2LTsRFsrEC6FHgRbTWrTHu6tqPeKxEQv15giM= @@ -183,9 +174,6 @@ github.com/klauspost/compress v1.17.7 h1:ehO88t2UGzQK66LMdE8tibEd1ErmzZjNEqWkjLA github.com/klauspost/compress v1.17.7/go.mod h1:Di0epgTjJY877eYKx5yC51cX2A2Vl2ibi7bDH9ttBbw= github.com/knadh/koanf v1.5.0 h1:q2TSd/3Pyc/5yP9ldIrSdIz26MCcyNQzW0pEAugLPNs= github.com/knadh/koanf v1.5.0/go.mod h1:Hgyjp4y8v44hpZtPzs7JZfRAW5AhN7KfZcwv1RYggDs= -github.com/knadh/koanf/maps v0.1.1 h1:G5TjmUh2D7G2YWf5SQQqSiHRJEjaicvU0KpypqB3NIs= -github.com/knadh/koanf/v2 v2.1.0 h1:eh4QmHHBuU8BybfIJ8mB8K8gsGCD/AUQTdwGq/GzId8= -github.com/knadh/koanf/v2 v2.1.0/go.mod h1:4mnTRbZCK+ALuBXHZMjDfG9y714L7TykVnZkXbMU3Es= github.com/knadh/koanf/v2 v2.1.1 h1:/R8eXqasSTsmDCsAyYj+81Wteg8AqrV9CP6gvsTsOmM= github.com/knadh/koanf/v2 v2.1.1/go.mod h1:4mnTRbZCK+ALuBXHZMjDfG9y714L7TykVnZkXbMU3Es= github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= @@ -257,31 +245,23 @@ github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXP github.com/prometheus/client_golang v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5FsnadC4Ky3P0J6CfImo= github.com/prometheus/client_golang v1.7.1/go.mod h1:PY5Wy2awLA44sXw4AOSfFBetzPP4j5+D6mVACh+pe2M= github.com/prometheus/client_golang v1.11.1/go.mod h1:Z6t4BnS23TR94PD6BsDNk8yVqroYurpAkEiz0P2BEV0= -github.com/prometheus/client_golang v1.18.0 h1:HzFfmkOzH5Q8L8G+kSJKUx5dtG87sewO+FoDDqP5Tbk= -github.com/prometheus/client_golang v1.18.0/go.mod h1:T+GXkCk5wSJyOqMIzVgvvjFDlkOQntgjkJWKrN5txjA= github.com/prometheus/client_golang v1.19.0 h1:ygXvpU1AoN1MhdzckN+PyD9QJOSD4x7kmXYlnfbA6JU= github.com/prometheus/client_golang v1.19.0/go.mod h1:ZRM9uEAypZakd+q/x7+gmsvXdURP+DABIEIjnmDdp+k= github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/client_model v0.2.0/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= -github.com/prometheus/client_model v0.6.0 h1:k1v3CzpSRUTrKMppY35TLwPvxHqBu0bYgxZzqGIgaos= -github.com/prometheus/client_model v0.6.0/go.mod h1:NTQHnmxFpouOD0DpvP4XujX3CdOAGQPoaGhyTchlyt8= github.com/prometheus/client_model v0.6.1 h1:ZKSh/rekM+n3CeS952MLRAdFwIKqeY8b62p8ais2e9E= github.com/prometheus/client_model v0.6.1/go.mod h1:OrxVMOVHjw3lKMa8+x6HeMGkHMQyHDk9E3jmP2AmGiY= github.com/prometheus/common v0.4.1/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= github.com/prometheus/common v0.10.0/go.mod h1:Tlit/dnDKsSWFlCLTWaA1cyBgKHSMdTB80sz/V91rCo= github.com/prometheus/common v0.26.0/go.mod h1:M7rCNAaPfAosfx8veZJCuw84e35h3Cfd9VFqTh1DIvc= -github.com/prometheus/common v0.48.0 h1:QO8U2CdOzSn1BBsmXJXduaaW+dY/5QLjfB8svtSzKKE= -github.com/prometheus/common v0.48.0/go.mod h1:0/KsvlIEfPQCQ5I2iNSAWKPZziNCvRs5EC6ILDTlAPc= github.com/prometheus/common v0.52.2 h1:LW8Vk7BccEdONfrJBDffQGRtpSzi5CQaRZGtboOO2ck= github.com/prometheus/common v0.52.2/go.mod h1:lrWtQx+iDfn2mbH5GUzlH9TSHyfZpHkSiG1W7y3sF2Q= github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= github.com/prometheus/procfs v0.1.3/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU= github.com/prometheus/procfs v0.6.0/go.mod h1:cz+aTbrPOrUb4q7XlbU9ygM+/jj0fzG6c1xBZuNvfVA= -github.com/prometheus/procfs v0.12.0 h1:jluTpSng7V9hY0O2R9DzzJHYb2xULk9VTR1V1R/k6Bo= -github.com/prometheus/procfs v0.12.0/go.mod h1:pcuDEFsWDnvcgNzo4EEweacyhjeA9Zk3cnaOZAZEfOo= github.com/prometheus/procfs v0.13.0 h1:GqzLlQyfsPbaEHaQkO7tbDlriv/4o5Hudv6OXHGKX7o= github.com/prometheus/procfs v0.13.0/go.mod h1:cd4PFCR54QLnGKPaKGA6l+cfuNXtht43ZKY6tow0Y1g= github.com/rhnvrm/simples3 v0.6.1/go.mod h1:Y+3vYm2V7Y4VijFoJHHTrja6OgPrJ2cBti8dPGkC3sA= @@ -328,32 +308,20 @@ github.com/yuin/goldmark v1.3.5/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1 go.etcd.io/etcd/api/v3 v3.5.4/go.mod h1:5GB2vv4A4AOn3yk7MftYGHkUfGtDHnEraIjym4dYz5A= go.etcd.io/etcd/client/pkg/v3 v3.5.4/go.mod h1:IJHfcCEKxYu1Os13ZdwCwIUTUVGYTSAM3YSwc9/Ac1g= go.etcd.io/etcd/client/v3 v3.5.4/go.mod h1:ZaRkVgBZC+L+dLCjTcF1hRXpgZXQPOvnA/Ak/gq3kiY= -go.opentelemetry.io/otel v1.24.0 h1:0LAOdjNmQeSTzGBzduGe/rU4tZhMwL5rWgtp9Ku5Jfo= -go.opentelemetry.io/otel v1.24.0/go.mod h1:W7b9Ozg4nkF5tWI5zsXkaKKDjdVjpD4oAt9Qi/MArHo= -go.opentelemetry.io/otel v1.25.0 h1:gldB5FfhRl7OJQbUHt/8s0a7cE8fbsPAtdpRaApKy4k= -go.opentelemetry.io/otel v1.25.0/go.mod h1:Wa2ds5NOXEMkCmUou1WA7ZBfLTHWIsp034OVD7AO+Vg= -go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.24.0 h1:t6wl9SPayj+c7lEIFgm4ooDBZVb01IhLB4InpomhRw8= -go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.24.0/go.mod h1:iSDOcsnSA5INXzZtwaBPrKp/lWu/V14Dd+llD0oI2EA= -go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.25.0 h1:dT33yIHtmsqpixFsSQPwNeY5drM9wTcoL8h0FWF4oGM= -go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.25.0/go.mod h1:h95q0LBGh7hlAC08X2DhSeyIG02YQ0UyioTCVAqRPmc= -go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.24.0 h1:Mw5xcxMwlqoJd97vwPxA8isEaIoxsta9/Q51+TTJLGE= -go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.24.0/go.mod h1:CQNu9bj7o7mC6U7+CA/schKEYakYXWr79ucDHTMGhCM= -go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.25.0 h1:vOL89uRfOCCNIjkisd0r7SEdJF3ZJFyCNY34fdZs8eU= -go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.25.0/go.mod h1:8GlBGcDk8KKi7n+2S4BT/CPZQYH3erLu0/k64r1MYgo= -go.opentelemetry.io/otel/metric v1.24.0 h1:6EhoGWWK28x1fbpA4tYTOWBkPefTDQnb8WSGXlc88kI= -go.opentelemetry.io/otel/metric v1.24.0/go.mod h1:VYhLe1rFfxuTXLgj4CBiyz+9WYBA8pNGJgDcSFRKBco= -go.opentelemetry.io/otel/metric v1.25.0 h1:LUKbS7ArpFL/I2jJHdJcqMGxkRdxpPHE0VU/D4NuEwA= -go.opentelemetry.io/otel/metric v1.25.0/go.mod h1:rkDLUSd2lC5lq2dFNrX9LGAbINP5B7WBkC78RXCpH5s= -go.opentelemetry.io/otel/sdk v1.24.0 h1:YMPPDNymmQN3ZgczicBY3B6sf9n62Dlj9pWD3ucgoDw= -go.opentelemetry.io/otel/sdk v1.24.0/go.mod h1:KVrIYw6tEubO9E96HQpcmpTKDVn9gdv35HoYiQWGDFg= -go.opentelemetry.io/otel/sdk v1.25.0 h1:PDryEJPC8YJZQSyLY5eqLeafHtG+X7FWnf3aXMtxbqo= -go.opentelemetry.io/otel/sdk v1.25.0/go.mod h1:oFgzCM2zdsxKzz6zwpTZYLLQsFwc+K0daArPdIhuxkw= -go.opentelemetry.io/otel/trace v1.24.0 h1:CsKnnL4dUAr/0llH9FKuc698G04IrpWV0MQA/Y1YELI= -go.opentelemetry.io/otel/trace v1.24.0/go.mod h1:HPc3Xr/cOApsBI154IU0OI0HJexz+aw5uPdbs3UCjNU= -go.opentelemetry.io/otel/trace v1.25.0 h1:tqukZGLwQYRIFtSQM2u2+yfMVTgGVeqRLPUYx1Dq6RM= -go.opentelemetry.io/otel/trace v1.25.0/go.mod h1:hCCs70XM/ljO+BeQkyFnbK28SBIJ/Emuha+ccrCRT7I= -go.opentelemetry.io/proto/otlp v1.1.0 h1:2Di21piLrCqJ3U3eXGCTPHE9R8Nh+0uglSnOyxikMeI= -go.opentelemetry.io/proto/otlp v1.1.0/go.mod h1:GpBHCBWiqvVLDqmHZsoMM3C5ySeKTC7ej/RNTae6MdY= +go.opentelemetry.io/otel v1.26.0 h1:LQwgL5s/1W7YiiRwxf03QGnWLb2HW4pLiAhaA5cZXBs= +go.opentelemetry.io/otel v1.26.0/go.mod h1:UmLkJHUAidDval2EICqBMbnAd0/m2vmpf/dAM+fvFs4= +go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.26.0 h1:1u/AyyOqAWzy+SkPxDpahCNZParHV8Vid1RnI2clyDE= +go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.26.0/go.mod h1:z46paqbJ9l7c9fIPCXTqTGwhQZ5XoTIsfeFYWboizjs= +go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.26.0 h1:Waw9Wfpo/IXzOI8bCB7DIk+0JZcqqsyn1JFnAc+iam8= +go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.26.0/go.mod h1:wnJIG4fOqyynOnnQF/eQb4/16VlX2EJAHhHgqIqWfAo= +go.opentelemetry.io/otel/metric v1.26.0 h1:7S39CLuY5Jgg9CrnA9HHiEjGMF/X2VHvoXGgSllRz30= +go.opentelemetry.io/otel/metric v1.26.0/go.mod h1:SY+rHOI4cEawI9a7N1A4nIg/nTQXe1ccCNWYOJUrpX4= +go.opentelemetry.io/otel/sdk v1.26.0 h1:Y7bumHf5tAiDlRYFmGqetNcLaVUZmh4iYfmGxtmz7F8= +go.opentelemetry.io/otel/sdk v1.26.0/go.mod h1:0p8MXpqLeJ0pzcszQQN4F0S5FVjBLgypeGSngLsmirs= +go.opentelemetry.io/otel/trace v1.26.0 h1:1ieeAUb4y0TE26jUFrCIXKpTuVK7uJGN9/Z/2LP5sQA= +go.opentelemetry.io/otel/trace v1.26.0/go.mod h1:4iDxvGDQuUkHve82hJJ8UqrwswHYsZuWCBllGV2U2y0= +go.opentelemetry.io/proto/otlp v1.2.0 h1:pVeZGk7nXDC9O2hncA6nHldxEjm6LByfA2aN8IOkz94= +go.opentelemetry.io/proto/otlp v1.2.0/go.mod h1:gGpR8txAl5M03pDhMC79G6SdqNV26naRm/KDsgaHD8A= go.uber.org/atomic v1.7.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc= go.uber.org/automaxprocs v1.5.3 h1:kWazyxZUrS3Gs4qUpbwo5kEIMGe/DAvi5Z4tl2NW4j8= go.uber.org/automaxprocs v1.5.3/go.mod h1:eRbA25aqJrxAbsLO0xy5jVwPt7FQnRgjW+efnwa1WM0= @@ -396,8 +364,6 @@ golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwY golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM= golang.org/x/net v0.0.0-20210410081132-afb366fc7cd1/go.mod h1:9tjilg8BloeKEkVJvy7fQ90B1CfIiPueXVOjqfkSzI8= -golang.org/x/net v0.21.0 h1:AQyQV4dYCvJ7vGmJyKki9+PBdyvhkSd8EIx/qb0AYv4= -golang.org/x/net v0.21.0/go.mod h1:bIjVDfnllIU7BJ2DNgfnXvpSvtn8VRwhlsaeUTyUS44= golang.org/x/net v0.24.0 h1:1PcaxkF854Fu3+lvBIx5SYn9wRlBzzcnHZSiaFFAb0w= golang.org/x/net v0.24.0/go.mod h1:2Q7sJY5mzlzWjKtYUEXSlBWCdyaioyXzRB2RtU8KVE8= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= @@ -444,8 +410,6 @@ golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20210603081109-ebe580a85c40/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.17.0 h1:25cE3gD+tdBA7lp7QfhuV+rJiE9YXTcS3VG1SqssI/Y= -golang.org/x/sys v0.17.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/sys v0.19.0 h1:q5f1RH2jigJ1MoAWp2KTp3gm5zAGFUTarQZ5U386+4o= golang.org/x/sys v0.19.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= @@ -481,15 +445,8 @@ google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98 google.golang.org/genproto v0.0.0-20200513103714-09dca8ec2884/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo= google.golang.org/genproto v0.0.0-20210602131652-f16073e35f0c/go.mod h1:UODoCrxHCcBojKKwX1terBiRUaqAsFqJiF615XL43r0= -google.golang.org/genproto v0.0.0-20240213162025-012b6fc9bca9 h1:9+tzLLstTlPTRyJTh+ah5wIMsBW5c4tQwGTN3thOW9Y= -google.golang.org/genproto v0.0.0-20240213162025-012b6fc9bca9/go.mod h1:mqHbVIp48Muh7Ywss/AD6I5kNVKZMmAa/QEW58Gxp2s= -google.golang.org/genproto v0.0.0-20240227224415-6ceb2ff114de h1:F6qOa9AZTYJXOUEr4jDysRDLrm4PHePlge4v4TGAlxY= -google.golang.org/genproto/googleapis/api v0.0.0-20240221002015-b0ce06bbee7c h1:9g7erC9qu44ks7UK4gDNlnk4kOxZG707xKm4jVniy6o= -google.golang.org/genproto/googleapis/api v0.0.0-20240221002015-b0ce06bbee7c/go.mod h1:5iCWqnniDlqZHrd3neWVTOwvh/v6s3232omMecelax8= google.golang.org/genproto/googleapis/api v0.0.0-20240401170217-c3f982113cda h1:b6F6WIV4xHHD0FA4oIyzU6mHWg2WI2X1RBehwa5QN38= google.golang.org/genproto/googleapis/api v0.0.0-20240401170217-c3f982113cda/go.mod h1:AHcE/gZH76Bk/ROZhQphlRoWo5xKDEtz3eVEO1LfA8c= -google.golang.org/genproto/googleapis/rpc v0.0.0-20240221002015-b0ce06bbee7c h1:NUsgEN92SQQqzfA+YtqYNqYmB3DMMYLlIwUZAQFVFbo= -google.golang.org/genproto/googleapis/rpc v0.0.0-20240221002015-b0ce06bbee7c/go.mod h1:H4O17MA/PE9BsGx3w+a+W2VOLLD1Qf7oJneAoU6WktY= google.golang.org/genproto/googleapis/rpc v0.0.0-20240401170217-c3f982113cda h1:LI5DOvAxUPMv/50agcLLoo+AdWc1irS9Rzz4vPuD1V4= google.golang.org/genproto/googleapis/rpc v0.0.0-20240401170217-c3f982113cda/go.mod h1:WtryC6hu0hhx87FDGxWCDptyssuo68sk10vYjF+T9fY= google.golang.org/grpc v1.14.0/go.mod h1:yo6s7OP7yaDglbqo1J04qKzAhqBH6lvTonzMVmEdcZw= @@ -500,10 +457,8 @@ google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQ google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= google.golang.org/grpc v1.33.1/go.mod h1:fr5YgcSWrqhRRxogOsw7RzIpsmvOZ6IcH4kBYTpR3n0= google.golang.org/grpc v1.38.0/go.mod h1:NREThFqKR1f3iQ6oBuvc5LadQuXVGo9rkm5ZGrQdJfM= -google.golang.org/grpc v1.62.0 h1:HQKZ/fa1bXkX1oFOvSjmZEUL8wLSaZTjCcLAlmZRtdk= -google.golang.org/grpc v1.62.0/go.mod h1:IWTG0VlJLCh1SkC58F7np9ka9mx/WNkjl4PGJaiq+QE= -google.golang.org/grpc v1.63.0 h1:WjKe+dnvABXyPJMD7KDNLxtoGk5tgk+YFWN6cBWjZE8= -google.golang.org/grpc v1.63.0/go.mod h1:WAX/8DgncnokcFUldAxq7GeB5DXHDbMF+lLvDomNkRA= +google.golang.org/grpc v1.63.2 h1:MUeiw1B2maTVZthpU5xvASfTh3LDbxHd6IJ6QQVU+xM= +google.golang.org/grpc v1.63.2/go.mod h1:WAX/8DgncnokcFUldAxq7GeB5DXHDbMF+lLvDomNkRA= 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= @@ -515,8 +470,6 @@ google.golang.org/protobuf v1.23.1-0.20200526195155-81db48ad09cc/go.mod h1:EGpAD google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c= google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= -google.golang.org/protobuf v1.32.0 h1:pPC6BG5ex8PDFnkbrGU3EixyhKcQ2aDuBS36lqK/C7I= -google.golang.org/protobuf v1.32.0/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos= google.golang.org/protobuf v1.33.0 h1:uNO2rsAINq/JlFpSdYEKIZ0uKD/R9cpdv0T+yoGwGmI= google.golang.org/protobuf v1.33.0/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos= gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= From 32e306bc701c876b07476d1e8a780e98fdb76777 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 29 Apr 2024 01:26:33 +0000 Subject: [PATCH 580/660] chore(deps): bump golangci/golangci-lint-action from 4 to 5 Bumps [golangci/golangci-lint-action](https://github.com/golangci/golangci-lint-action) from 4 to 5. - [Release notes](https://github.com/golangci/golangci-lint-action/releases) - [Commits](https://github.com/golangci/golangci-lint-action/compare/v4...v5) --- updated-dependencies: - dependency-name: golangci/golangci-lint-action dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- .github/workflows/test.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 414752ae..be0aaaed 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -13,7 +13,7 @@ jobs: with: go-version-file: "go.mod" - name: golangci-lint - uses: golangci/golangci-lint-action@v4 + uses: golangci/golangci-lint-action@v5 with: version: latest args: --enable-all --timeout=30m From 292896c5070f383a221e7dcd659ea5283a9225e3 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 29 Apr 2024 01:26:37 +0000 Subject: [PATCH 581/660] chore(deps): bump helm/kind-action from 1.9.0 to 1.10.0 Bumps [helm/kind-action](https://github.com/helm/kind-action) from 1.9.0 to 1.10.0. - [Release notes](https://github.com/helm/kind-action/releases) - [Commits](https://github.com/helm/kind-action/compare/v1.9.0...v1.10.0) --- updated-dependencies: - dependency-name: helm/kind-action dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- .github/workflows/helm.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/helm.yaml b/.github/workflows/helm.yaml index c9eece63..e3098b8b 100644 --- a/.github/workflows/helm.yaml +++ b/.github/workflows/helm.yaml @@ -26,7 +26,7 @@ jobs: run: ct lint --all - name: create kind cluster - uses: helm/kind-action@v1.9.0 + uses: helm/kind-action@v1.10.0 - name: run chart-testing (install) run: ct install --all From b39d6173a22e77a8ab07a0328d95562103ad6f89 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 6 May 2024 01:41:52 +0000 Subject: [PATCH 582/660] chore(deps): bump codecov/codecov-action from 4.3.0 to 4.3.1 Bumps [codecov/codecov-action](https://github.com/codecov/codecov-action) from 4.3.0 to 4.3.1. - [Release notes](https://github.com/codecov/codecov-action/releases) - [Changelog](https://github.com/codecov/codecov-action/blob/main/CHANGELOG.md) - [Commits](https://github.com/codecov/codecov-action/compare/v4.3.0...v4.3.1) --- updated-dependencies: - dependency-name: codecov/codecov-action dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- .github/workflows/test.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index be0aaaed..ffcd70c2 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -27,7 +27,7 @@ jobs: with: go-version-file: "go.mod" - run: go test -v ./... -covermode=atomic -coverprofile=coverage.out - - uses: codecov/codecov-action@v4.3.0 + - uses: codecov/codecov-action@v4.3.1 with: files: coverage.out token: ${{ secrets.CODECOV_TOKEN }} From 3d368c16167ed5dfb86b8929b76d01f658edb404 Mon Sep 17 00:00:00 2001 From: Parham Alvani Date: Mon, 6 May 2024 17:16:57 +0000 Subject: [PATCH 583/660] fix: correct lint issues --- .golangci.yml | 2 ++ internal/api/api.go | 2 +- internal/config/default.go | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/.golangci.yml b/.golangci.yml index bead5895..e76e34b6 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -20,6 +20,8 @@ linters: - varcheck - deadcode - structcheck + - gomnd + - execinquery linters-settings: wrapcheck: diff --git a/internal/api/api.go b/internal/api/api.go index d6a36b84..0cce488e 100644 --- a/internal/api/api.go +++ b/internal/api/api.go @@ -75,7 +75,7 @@ func ExtractVendorToken(rawToken, username, password string) (string, string) { var vendor, token string - if len(split) == 2 { //nolint:gomnd + if len(split) == 2 { //nolint:mnd vendor = split[0] token = split[1] } else { diff --git a/internal/config/default.go b/internal/config/default.go index 9de645aa..24bf6ee2 100644 --- a/internal/config/default.go +++ b/internal/config/default.go @@ -16,7 +16,7 @@ const ( ) // Default return default configuration. -// nolint: gomnd +// nolint: mnd func Default() Config { return Config{ DefaultVendor: "snapp", From c6d64de17066d473d4d11282756c4a136c14fe81 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 13 May 2024 01:53:51 +0000 Subject: [PATCH 584/660] chore(deps): bump golangci/golangci-lint-action from 5 to 6 Bumps [golangci/golangci-lint-action](https://github.com/golangci/golangci-lint-action) from 5 to 6. - [Release notes](https://github.com/golangci/golangci-lint-action/releases) - [Commits](https://github.com/golangci/golangci-lint-action/compare/v5...v6) --- updated-dependencies: - dependency-name: golangci/golangci-lint-action dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- .github/workflows/test.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index ffcd70c2..c6e11a25 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -13,7 +13,7 @@ jobs: with: go-version-file: "go.mod" - name: golangci-lint - uses: golangci/golangci-lint-action@v5 + uses: golangci/golangci-lint-action@v6 with: version: latest args: --enable-all --timeout=30m From 4bbeac95d4f7b99b10bd57ff043405e1b381cc1d Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 20 May 2024 01:57:31 +0000 Subject: [PATCH 585/660] chore(deps): bump codecov/codecov-action from 4.3.1 to 4.4.0 Bumps [codecov/codecov-action](https://github.com/codecov/codecov-action) from 4.3.1 to 4.4.0. - [Release notes](https://github.com/codecov/codecov-action/releases) - [Changelog](https://github.com/codecov/codecov-action/blob/main/CHANGELOG.md) - [Commits](https://github.com/codecov/codecov-action/compare/v4.3.1...v4.4.0) --- updated-dependencies: - dependency-name: codecov/codecov-action dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- .github/workflows/test.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index c6e11a25..9aa59011 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -27,7 +27,7 @@ jobs: with: go-version-file: "go.mod" - run: go test -v ./... -covermode=atomic -coverprofile=coverage.out - - uses: codecov/codecov-action@v4.3.1 + - uses: codecov/codecov-action@v4.4.0 with: files: coverage.out token: ${{ secrets.CODECOV_TOKEN }} From b09d3a0b55925962ed1facf8d103549f31376895 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 27 May 2024 01:25:11 +0000 Subject: [PATCH 586/660] chore(deps): bump codecov/codecov-action from 4.4.0 to 4.4.1 Bumps [codecov/codecov-action](https://github.com/codecov/codecov-action) from 4.4.0 to 4.4.1. - [Release notes](https://github.com/codecov/codecov-action/releases) - [Changelog](https://github.com/codecov/codecov-action/blob/main/CHANGELOG.md) - [Commits](https://github.com/codecov/codecov-action/compare/v4.4.0...v4.4.1) --- updated-dependencies: - dependency-name: codecov/codecov-action dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- .github/workflows/test.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 9aa59011..b63435fa 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -27,7 +27,7 @@ jobs: with: go-version-file: "go.mod" - run: go test -v ./... -covermode=atomic -coverprofile=coverage.out - - uses: codecov/codecov-action@v4.4.0 + - uses: codecov/codecov-action@v4.4.1 with: files: coverage.out token: ${{ secrets.CODECOV_TOKEN }} From d450b94526ee8435c9cb253fa7d09066a51b5615 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 27 May 2024 01:39:32 +0000 Subject: [PATCH 587/660] chore(deps): bump go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc Bumps [go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc](https://github.com/open-telemetry/opentelemetry-go) from 1.26.0 to 1.27.0. - [Release notes](https://github.com/open-telemetry/opentelemetry-go/releases) - [Changelog](https://github.com/open-telemetry/opentelemetry-go/blob/main/CHANGELOG.md) - [Commits](https://github.com/open-telemetry/opentelemetry-go/compare/v1.26.0...v1.27.0) --- updated-dependencies: - dependency-name: go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- go.mod | 28 +++++++++++++-------------- go.sum | 60 +++++++++++++++++++++++++++++----------------------------- 2 files changed, 44 insertions(+), 44 deletions(-) diff --git a/go.mod b/go.mod index 0f5d5d21..d399778f 100644 --- a/go.mod +++ b/go.mod @@ -13,10 +13,10 @@ require ( github.com/spf13/cobra v1.8.0 github.com/stretchr/testify v1.9.0 github.com/tidwall/pretty v1.2.1 - go.opentelemetry.io/otel v1.26.0 - go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.26.0 - go.opentelemetry.io/otel/sdk v1.26.0 - go.opentelemetry.io/otel/trace v1.26.0 + go.opentelemetry.io/otel v1.27.0 + go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.27.0 + go.opentelemetry.io/otel/sdk v1.27.0 + go.opentelemetry.io/otel/trace v1.27.0 go.uber.org/automaxprocs v1.5.3 go.uber.org/zap v1.27.0 ) @@ -34,7 +34,7 @@ require ( github.com/go-viper/mapstructure/v2 v2.0.0-alpha.1 // indirect github.com/gofiber/adaptor/v2 v2.2.1 // indirect github.com/google/uuid v1.6.0 // indirect - github.com/grpc-ecosystem/grpc-gateway/v2 v2.19.1 // indirect + github.com/grpc-ecosystem/grpc-gateway/v2 v2.20.0 // indirect github.com/inconshreveable/mousetrap v1.1.0 // indirect github.com/klauspost/compress v1.17.7 // indirect github.com/mattn/go-colorable v0.1.13 // indirect @@ -52,16 +52,16 @@ require ( github.com/valyala/bytebufferpool v1.0.0 // indirect github.com/valyala/fasthttp v1.52.0 // indirect github.com/valyala/tcplisten v1.0.0 // indirect - go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.26.0 // indirect - go.opentelemetry.io/otel/metric v1.26.0 // indirect + go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.27.0 // indirect + go.opentelemetry.io/otel/metric v1.27.0 // indirect go.opentelemetry.io/proto/otlp v1.2.0 // indirect go.uber.org/multierr v1.11.0 // indirect - golang.org/x/net v0.24.0 // indirect - golang.org/x/sys v0.19.0 // indirect - golang.org/x/text v0.14.0 // indirect - google.golang.org/genproto/googleapis/api v0.0.0-20240401170217-c3f982113cda // indirect - google.golang.org/genproto/googleapis/rpc v0.0.0-20240401170217-c3f982113cda // indirect - google.golang.org/grpc v1.63.2 // indirect - google.golang.org/protobuf v1.33.0 // indirect + golang.org/x/net v0.25.0 // indirect + golang.org/x/sys v0.20.0 // indirect + golang.org/x/text v0.15.0 // indirect + google.golang.org/genproto/googleapis/api v0.0.0-20240520151616-dc85e6b867a5 // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20240515191416-fc5f0ca64291 // indirect + google.golang.org/grpc v1.64.0 // indirect + google.golang.org/protobuf v1.34.1 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect ) diff --git a/go.sum b/go.sum index 0b066e93..66c00bcc 100644 --- a/go.sum +++ b/go.sum @@ -121,8 +121,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/grpc-ecosystem/go-grpc-prometheus v1.2.0/go.mod h1:8NvIoxWQoOIhqOTXgfV/d3M/q6VIi02HzZEHgUlZvzk= github.com/grpc-ecosystem/grpc-gateway v1.16.0/go.mod h1:BDjrQk3hbvj6Nolgz8mAMFbcEtjT1g+wF4CSlocrBnw= -github.com/grpc-ecosystem/grpc-gateway/v2 v2.19.1 h1:/c3QmbOGMGTOumP2iT/rCwB7b0QDGLKzqOmktBjT+Is= -github.com/grpc-ecosystem/grpc-gateway/v2 v2.19.1/go.mod h1:5SN9VR2LTsRFsrEC6FHgRbTWrTHu6tqPeKxEQv15giM= +github.com/grpc-ecosystem/grpc-gateway/v2 v2.20.0 h1:bkypFPDjIYGfCYD5mRBvpqxfYX1YCS1PXdKYWi8FsN0= +github.com/grpc-ecosystem/grpc-gateway/v2 v2.20.0/go.mod h1:P+Lt/0by1T8bfcF3z737NnSbmxQAppXMRziHUxPOC8k= github.com/hashicorp/consul/api v1.13.0/go.mod h1:ZlVrynguJKcYr54zGaDbaL3fOvKC9m72FhPvA8T35KQ= github.com/hashicorp/consul/sdk v0.8.0/go.mod h1:GBvyrGALthsZObzUGsfgHZQDXjg4lOjagTIwIR1vPms= github.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= @@ -269,8 +269,8 @@ github.com/rivo/uniseg v0.2.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJ github.com/rivo/uniseg v0.4.7 h1:WUdvkW8uEhrYfLC4ZzdpI2ztxP1I582+49Oc5Mq64VQ= github.com/rivo/uniseg v0.4.7/go.mod h1:FN3SvrM+Zdj16jyLfmOkMNblXMcoc8DfTHruCPUcx88= github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6LYCDYWNEvQ= -github.com/rogpeppe/go-internal v1.10.0 h1:TMyTOH3F/DB16zRVcYyreMH6GnZZrwQVAoYjRBZyWFQ= -github.com/rogpeppe/go-internal v1.10.0/go.mod h1:UQnix2H7Ngw/k4C5ijL5+65zddjncjaFoBhdsK/akog= +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/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= github.com/ryanuber/columnize v0.0.0-20160712163229-9b3edd62028f/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts= github.com/ryanuber/columnize v2.1.0+incompatible/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts= @@ -308,18 +308,18 @@ github.com/yuin/goldmark v1.3.5/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1 go.etcd.io/etcd/api/v3 v3.5.4/go.mod h1:5GB2vv4A4AOn3yk7MftYGHkUfGtDHnEraIjym4dYz5A= go.etcd.io/etcd/client/pkg/v3 v3.5.4/go.mod h1:IJHfcCEKxYu1Os13ZdwCwIUTUVGYTSAM3YSwc9/Ac1g= go.etcd.io/etcd/client/v3 v3.5.4/go.mod h1:ZaRkVgBZC+L+dLCjTcF1hRXpgZXQPOvnA/Ak/gq3kiY= -go.opentelemetry.io/otel v1.26.0 h1:LQwgL5s/1W7YiiRwxf03QGnWLb2HW4pLiAhaA5cZXBs= -go.opentelemetry.io/otel v1.26.0/go.mod h1:UmLkJHUAidDval2EICqBMbnAd0/m2vmpf/dAM+fvFs4= -go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.26.0 h1:1u/AyyOqAWzy+SkPxDpahCNZParHV8Vid1RnI2clyDE= -go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.26.0/go.mod h1:z46paqbJ9l7c9fIPCXTqTGwhQZ5XoTIsfeFYWboizjs= -go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.26.0 h1:Waw9Wfpo/IXzOI8bCB7DIk+0JZcqqsyn1JFnAc+iam8= -go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.26.0/go.mod h1:wnJIG4fOqyynOnnQF/eQb4/16VlX2EJAHhHgqIqWfAo= -go.opentelemetry.io/otel/metric v1.26.0 h1:7S39CLuY5Jgg9CrnA9HHiEjGMF/X2VHvoXGgSllRz30= -go.opentelemetry.io/otel/metric v1.26.0/go.mod h1:SY+rHOI4cEawI9a7N1A4nIg/nTQXe1ccCNWYOJUrpX4= -go.opentelemetry.io/otel/sdk v1.26.0 h1:Y7bumHf5tAiDlRYFmGqetNcLaVUZmh4iYfmGxtmz7F8= -go.opentelemetry.io/otel/sdk v1.26.0/go.mod h1:0p8MXpqLeJ0pzcszQQN4F0S5FVjBLgypeGSngLsmirs= -go.opentelemetry.io/otel/trace v1.26.0 h1:1ieeAUb4y0TE26jUFrCIXKpTuVK7uJGN9/Z/2LP5sQA= -go.opentelemetry.io/otel/trace v1.26.0/go.mod h1:4iDxvGDQuUkHve82hJJ8UqrwswHYsZuWCBllGV2U2y0= +go.opentelemetry.io/otel v1.27.0 h1:9BZoF3yMK/O1AafMiQTVu0YDj5Ea4hPhxCs7sGva+cg= +go.opentelemetry.io/otel v1.27.0/go.mod h1:DMpAK8fzYRzs+bi3rS5REupisuqTheUlSZJ1WnZaPAQ= +go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.27.0 h1:R9DE4kQ4k+YtfLI2ULwX82VtNQ2J8yZmA7ZIF/D+7Mc= +go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.27.0/go.mod h1:OQFyQVrDlbe+R7xrEyDr/2Wr67Ol0hRUgsfA+V5A95s= +go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.27.0 h1:qFffATk0X+HD+f1Z8lswGiOQYKHRlzfmdJm0wEaVrFA= +go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.27.0/go.mod h1:MOiCmryaYtc+V0Ei+Tx9o5S1ZjA7kzLucuVuyzBZloQ= +go.opentelemetry.io/otel/metric v1.27.0 h1:hvj3vdEKyeCi4YaYfNjv2NUje8FqKqUY8IlF0FxV/ik= +go.opentelemetry.io/otel/metric v1.27.0/go.mod h1:mVFgmRlhljgBiuk/MP/oKylr4hs85GZAylncepAX/ak= +go.opentelemetry.io/otel/sdk v1.27.0 h1:mlk+/Y1gLPLn84U4tI8d3GNJmGT/eXe3ZuOXN9kTWmI= +go.opentelemetry.io/otel/sdk v1.27.0/go.mod h1:Ha9vbLwJE6W86YstIywK2xFfPjbWlCuwPtMkKdz/Y4A= +go.opentelemetry.io/otel/trace v1.27.0 h1:IqYb813p7cmbHk0a5y6pD5JPakbVfftRXABGt5/Rscw= +go.opentelemetry.io/otel/trace v1.27.0/go.mod h1:6RiD1hkAprV4/q+yd2ln1HG9GoPx39SuvvstaLBl+l4= go.opentelemetry.io/proto/otlp v1.2.0 h1:pVeZGk7nXDC9O2hncA6nHldxEjm6LByfA2aN8IOkz94= go.opentelemetry.io/proto/otlp v1.2.0/go.mod h1:gGpR8txAl5M03pDhMC79G6SdqNV26naRm/KDsgaHD8A= go.uber.org/atomic v1.7.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc= @@ -364,8 +364,8 @@ golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwY golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM= golang.org/x/net v0.0.0-20210410081132-afb366fc7cd1/go.mod h1:9tjilg8BloeKEkVJvy7fQ90B1CfIiPueXVOjqfkSzI8= -golang.org/x/net v0.24.0 h1:1PcaxkF854Fu3+lvBIx5SYn9wRlBzzcnHZSiaFFAb0w= -golang.org/x/net v0.24.0/go.mod h1:2Q7sJY5mzlzWjKtYUEXSlBWCdyaioyXzRB2RtU8KVE8= +golang.org/x/net v0.25.0 h1:d/OCCoBEUq33pjydKrGQhw7IlUPI2Oylr+8qLx49kac= +golang.org/x/net v0.25.0/go.mod h1:JkAGAh7GEvH74S6FOH42FLoXpXbE/aqXSrIQjXgsiwM= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= @@ -410,8 +410,8 @@ golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20210603081109-ebe580a85c40/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.19.0 h1:q5f1RH2jigJ1MoAWp2KTp3gm5zAGFUTarQZ5U386+4o= -golang.org/x/sys v0.19.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.20.0 h1:Od9JTbYCk261bKm4M/mw7AklTlFYIa0bIp9BgSm1S8Y= +golang.org/x/sys v0.20.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.1-0.20181227161524-e6919f6577db/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= @@ -419,8 +419,8 @@ golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/text v0.14.0 h1:ScX5w1eTa3QqT8oi6+ziP7dTV1S2+ALU0bI+0zXKWiQ= -golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= +golang.org/x/text v0.15.0 h1:h1V/4gjBv8v9cjcR6+AR5+/cIYK5N/WAgiv4xlsEtAk= +golang.org/x/text v0.15.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= @@ -445,10 +445,10 @@ google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98 google.golang.org/genproto v0.0.0-20200513103714-09dca8ec2884/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo= google.golang.org/genproto v0.0.0-20210602131652-f16073e35f0c/go.mod h1:UODoCrxHCcBojKKwX1terBiRUaqAsFqJiF615XL43r0= -google.golang.org/genproto/googleapis/api v0.0.0-20240401170217-c3f982113cda h1:b6F6WIV4xHHD0FA4oIyzU6mHWg2WI2X1RBehwa5QN38= -google.golang.org/genproto/googleapis/api v0.0.0-20240401170217-c3f982113cda/go.mod h1:AHcE/gZH76Bk/ROZhQphlRoWo5xKDEtz3eVEO1LfA8c= -google.golang.org/genproto/googleapis/rpc v0.0.0-20240401170217-c3f982113cda h1:LI5DOvAxUPMv/50agcLLoo+AdWc1irS9Rzz4vPuD1V4= -google.golang.org/genproto/googleapis/rpc v0.0.0-20240401170217-c3f982113cda/go.mod h1:WtryC6hu0hhx87FDGxWCDptyssuo68sk10vYjF+T9fY= +google.golang.org/genproto/googleapis/api v0.0.0-20240520151616-dc85e6b867a5 h1:P8OJ/WCl/Xo4E4zoe4/bifHpSmmKwARqyqE4nW6J2GQ= +google.golang.org/genproto/googleapis/api v0.0.0-20240520151616-dc85e6b867a5/go.mod h1:RGnPtTG7r4i8sPlNyDeikXF99hMM+hN6QMm4ooG9g2g= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240515191416-fc5f0ca64291 h1:AgADTJarZTBqgjiUzRgfaBchgYB3/WFTC80GPwsMcRI= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240515191416-fc5f0ca64291/go.mod h1:EfXuqaE1J41VCDicxHzUDm+8rk+7ZdXzHV0IhO/I6s0= google.golang.org/grpc v1.14.0/go.mod h1:yo6s7OP7yaDglbqo1J04qKzAhqBH6lvTonzMVmEdcZw= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= google.golang.org/grpc v1.22.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= @@ -457,8 +457,8 @@ google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQ google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= google.golang.org/grpc v1.33.1/go.mod h1:fr5YgcSWrqhRRxogOsw7RzIpsmvOZ6IcH4kBYTpR3n0= google.golang.org/grpc v1.38.0/go.mod h1:NREThFqKR1f3iQ6oBuvc5LadQuXVGo9rkm5ZGrQdJfM= -google.golang.org/grpc v1.63.2 h1:MUeiw1B2maTVZthpU5xvASfTh3LDbxHd6IJ6QQVU+xM= -google.golang.org/grpc v1.63.2/go.mod h1:WAX/8DgncnokcFUldAxq7GeB5DXHDbMF+lLvDomNkRA= +google.golang.org/grpc v1.64.0 h1:KH3VH9y/MgNQg1dE7b3XfVK0GsPSIzJwdF617gUSbvY= +google.golang.org/grpc v1.64.0/go.mod h1:oxjF8E3FBnjp+/gVFYdWacaLDx9na1aqy9oovLpxQYg= 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= @@ -470,8 +470,8 @@ google.golang.org/protobuf v1.23.1-0.20200526195155-81db48ad09cc/go.mod h1:EGpAD google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c= google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= -google.golang.org/protobuf v1.33.0 h1:uNO2rsAINq/JlFpSdYEKIZ0uKD/R9cpdv0T+yoGwGmI= -google.golang.org/protobuf v1.33.0/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos= +google.golang.org/protobuf v1.34.1 h1:9ddQBjfCyZPOHPUiPxpYESBLc+T8P3E+Vo4IbKZgFWg= +google.golang.org/protobuf v1.34.1/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos= gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= gopkg.in/asn1-ber.v1 v1.0.0-20181015200546-f715ec2f112d/go.mod h1:cuepJuh7vyXfUyUwEgHQXw849cJrilpS5NeIjOWESAw= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= From f16dd3208929f330716af87a755e72e08ea55724 Mon Sep 17 00:00:00 2001 From: Parham Alvani Date: Mon, 27 May 2024 03:02:19 +0000 Subject: [PATCH 588/660] feat: update packages --- go.mod | 16 ++++++++-------- go.sum | 18 ++++++++++++++++++ 2 files changed, 26 insertions(+), 8 deletions(-) diff --git a/go.mod b/go.mod index d399778f..3967ed53 100644 --- a/go.mod +++ b/go.mod @@ -29,28 +29,28 @@ require ( github.com/davecgh/go-spew v1.1.1 // indirect github.com/fatih/structs v1.1.0 // indirect github.com/fsnotify/fsnotify v1.7.0 // indirect - github.com/go-logr/logr v1.4.1 // indirect + github.com/go-logr/logr v1.4.2 // indirect github.com/go-logr/stdr v1.2.2 // indirect github.com/go-viper/mapstructure/v2 v2.0.0-alpha.1 // indirect github.com/gofiber/adaptor/v2 v2.2.1 // indirect github.com/google/uuid v1.6.0 // indirect github.com/grpc-ecosystem/grpc-gateway/v2 v2.20.0 // indirect github.com/inconshreveable/mousetrap v1.1.0 // indirect - github.com/klauspost/compress v1.17.7 // indirect + github.com/klauspost/compress v1.17.8 // indirect github.com/mattn/go-colorable v0.1.13 // indirect github.com/mattn/go-isatty v0.0.20 // indirect github.com/mattn/go-runewidth v0.0.15 // indirect github.com/mitchellh/copystructure v1.2.0 // indirect github.com/mitchellh/reflectwalk v1.0.2 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect - github.com/prometheus/client_golang v1.19.0 // indirect + github.com/prometheus/client_golang v1.19.1 // indirect github.com/prometheus/client_model v0.6.1 // indirect - github.com/prometheus/common v0.52.2 // indirect - github.com/prometheus/procfs v0.13.0 // indirect + github.com/prometheus/common v0.53.0 // indirect + github.com/prometheus/procfs v0.15.0 // indirect github.com/rivo/uniseg v0.4.7 // indirect github.com/spf13/pflag v1.0.5 // indirect github.com/valyala/bytebufferpool v1.0.0 // indirect - github.com/valyala/fasthttp v1.52.0 // indirect + github.com/valyala/fasthttp v1.54.0 // indirect github.com/valyala/tcplisten v1.0.0 // indirect go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.27.0 // indirect go.opentelemetry.io/otel/metric v1.27.0 // indirect @@ -59,8 +59,8 @@ require ( golang.org/x/net v0.25.0 // indirect golang.org/x/sys v0.20.0 // indirect golang.org/x/text v0.15.0 // indirect - google.golang.org/genproto/googleapis/api v0.0.0-20240520151616-dc85e6b867a5 // indirect - google.golang.org/genproto/googleapis/rpc v0.0.0-20240515191416-fc5f0ca64291 // indirect + google.golang.org/genproto/googleapis/api v0.0.0-20240521202816-d264139d666e // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20240521202816-d264139d666e // indirect google.golang.org/grpc v1.64.0 // indirect google.golang.org/protobuf v1.34.1 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect diff --git a/go.sum b/go.sum index 66c00bcc..c8908f45 100644 --- a/go.sum +++ b/go.sum @@ -69,6 +69,8 @@ github.com/go-logfmt/logfmt v0.5.0/go.mod h1:wCYkCAKZfumFQihp8CzCvQ3paCTfi41vtzG github.com/go-logr/logr v1.2.2/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= github.com/go-logr/logr v1.4.1 h1:pKouT5E8xu9zeFC39JXRDukb6JFQPXM5p5I91188VAQ= github.com/go-logr/logr v1.4.1/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY= +github.com/go-logr/logr v1.4.2 h1:6pFjapn8bFcIbiKo3XT4j/BhANplGihG6tvd+8rYgrY= +github.com/go-logr/logr v1.4.2/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY= github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag= github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE= github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= @@ -120,6 +122,7 @@ github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+ 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/grpc-ecosystem/go-grpc-prometheus v1.2.0/go.mod h1:8NvIoxWQoOIhqOTXgfV/d3M/q6VIi02HzZEHgUlZvzk= +github.com/grpc-ecosystem/grpc-gateway v1.16.0 h1:gmcG1KaJ57LophUzW0Hy8NmPhnMZb4M0+kPpLofRdBo= github.com/grpc-ecosystem/grpc-gateway v1.16.0/go.mod h1:BDjrQk3hbvj6Nolgz8mAMFbcEtjT1g+wF4CSlocrBnw= github.com/grpc-ecosystem/grpc-gateway/v2 v2.20.0 h1:bkypFPDjIYGfCYD5mRBvpqxfYX1YCS1PXdKYWi8FsN0= github.com/grpc-ecosystem/grpc-gateway/v2 v2.20.0/go.mod h1:P+Lt/0by1T8bfcF3z737NnSbmxQAppXMRziHUxPOC8k= @@ -172,8 +175,11 @@ github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= github.com/klauspost/compress v1.17.7 h1:ehO88t2UGzQK66LMdE8tibEd1ErmzZjNEqWkjLAKQQg= github.com/klauspost/compress v1.17.7/go.mod h1:Di0epgTjJY877eYKx5yC51cX2A2Vl2ibi7bDH9ttBbw= +github.com/klauspost/compress v1.17.8 h1:YcnTYrq7MikUT7k0Yb5eceMmALQPYBW/Xltxn0NAMnU= +github.com/klauspost/compress v1.17.8/go.mod h1:Di0epgTjJY877eYKx5yC51cX2A2Vl2ibi7bDH9ttBbw= github.com/knadh/koanf v1.5.0 h1:q2TSd/3Pyc/5yP9ldIrSdIz26MCcyNQzW0pEAugLPNs= github.com/knadh/koanf v1.5.0/go.mod h1:Hgyjp4y8v44hpZtPzs7JZfRAW5AhN7KfZcwv1RYggDs= +github.com/knadh/koanf/maps v0.1.1 h1:G5TjmUh2D7G2YWf5SQQqSiHRJEjaicvU0KpypqB3NIs= github.com/knadh/koanf/v2 v2.1.1 h1:/R8eXqasSTsmDCsAyYj+81Wteg8AqrV9CP6gvsTsOmM= github.com/knadh/koanf/v2 v2.1.1/go.mod h1:4mnTRbZCK+ALuBXHZMjDfG9y714L7TykVnZkXbMU3Es= github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= @@ -247,6 +253,8 @@ github.com/prometheus/client_golang v1.7.1/go.mod h1:PY5Wy2awLA44sXw4AOSfFBetzPP github.com/prometheus/client_golang v1.11.1/go.mod h1:Z6t4BnS23TR94PD6BsDNk8yVqroYurpAkEiz0P2BEV0= github.com/prometheus/client_golang v1.19.0 h1:ygXvpU1AoN1MhdzckN+PyD9QJOSD4x7kmXYlnfbA6JU= github.com/prometheus/client_golang v1.19.0/go.mod h1:ZRM9uEAypZakd+q/x7+gmsvXdURP+DABIEIjnmDdp+k= +github.com/prometheus/client_golang v1.19.1 h1:wZWJDwK+NameRJuPGDhlnFgx8e8HN3XHQeLaYJFJBOE= +github.com/prometheus/client_golang v1.19.1/go.mod h1:mP78NwGzrVks5S2H6ab8+ZZGJLZUq1hoULYBAYBw1Ho= github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= @@ -258,12 +266,16 @@ github.com/prometheus/common v0.10.0/go.mod h1:Tlit/dnDKsSWFlCLTWaA1cyBgKHSMdTB8 github.com/prometheus/common v0.26.0/go.mod h1:M7rCNAaPfAosfx8veZJCuw84e35h3Cfd9VFqTh1DIvc= github.com/prometheus/common v0.52.2 h1:LW8Vk7BccEdONfrJBDffQGRtpSzi5CQaRZGtboOO2ck= github.com/prometheus/common v0.52.2/go.mod h1:lrWtQx+iDfn2mbH5GUzlH9TSHyfZpHkSiG1W7y3sF2Q= +github.com/prometheus/common v0.53.0 h1:U2pL9w9nmJwJDa4qqLQ3ZaePJ6ZTwt7cMD3AG3+aLCE= +github.com/prometheus/common v0.53.0/go.mod h1:BrxBKv3FWBIGXw89Mg1AeBq7FSyRzXWI3l3e7W3RN5U= github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= github.com/prometheus/procfs v0.1.3/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU= github.com/prometheus/procfs v0.6.0/go.mod h1:cz+aTbrPOrUb4q7XlbU9ygM+/jj0fzG6c1xBZuNvfVA= github.com/prometheus/procfs v0.13.0 h1:GqzLlQyfsPbaEHaQkO7tbDlriv/4o5Hudv6OXHGKX7o= github.com/prometheus/procfs v0.13.0/go.mod h1:cd4PFCR54QLnGKPaKGA6l+cfuNXtht43ZKY6tow0Y1g= +github.com/prometheus/procfs v0.15.0 h1:A82kmvXJq2jTu5YUhSGNlYoxh85zLnKgPz4bMZgI5Ek= +github.com/prometheus/procfs v0.15.0/go.mod h1:Y0RJ/Y5g5wJpkTisOtqwDSo4HwhGmLB4VQSw2sQJLHk= github.com/rhnvrm/simples3 v0.6.1/go.mod h1:Y+3vYm2V7Y4VijFoJHHTrja6OgPrJ2cBti8dPGkC3sA= github.com/rivo/uniseg v0.2.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc= github.com/rivo/uniseg v0.4.7 h1:WUdvkW8uEhrYfLC4ZzdpI2ztxP1I582+49Oc5Mq64VQ= @@ -300,6 +312,8 @@ github.com/valyala/bytebufferpool v1.0.0 h1:GqA5TC/0021Y/b9FG4Oi9Mr3q7XYx6Kllzaw github.com/valyala/bytebufferpool v1.0.0/go.mod h1:6bBcMArwyJ5K/AmCkWv1jt77kVWyCJ6HpOuEn7z0Csc= github.com/valyala/fasthttp v1.52.0 h1:wqBQpxH71XW0e2g+Og4dzQM8pk34aFYlA1Ga8db7gU0= github.com/valyala/fasthttp v1.52.0/go.mod h1:hf5C4QnVMkNXMspnsUlfM3WitlgYflyhHYoKol/szxQ= +github.com/valyala/fasthttp v1.54.0 h1:cCL+ZZR3z3HPLMVfEYVUMtJqVaui0+gu7Lx63unHwS0= +github.com/valyala/fasthttp v1.54.0/go.mod h1:6dt4/8olwq9QARP/TDuPmWyWcl4byhpvTJ4AAtcz+QM= github.com/valyala/tcplisten v1.0.0 h1:rBHj/Xf+E1tRGZyWIWwJDiRY0zc1Js+CV5DqwacVSA8= github.com/valyala/tcplisten v1.0.0/go.mod h1:T0xQ8SeCZGxckz9qRXTfG43PvQ/mcWh7FwZEA7Ioqkc= github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= @@ -447,8 +461,12 @@ google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEY google.golang.org/genproto v0.0.0-20210602131652-f16073e35f0c/go.mod h1:UODoCrxHCcBojKKwX1terBiRUaqAsFqJiF615XL43r0= google.golang.org/genproto/googleapis/api v0.0.0-20240520151616-dc85e6b867a5 h1:P8OJ/WCl/Xo4E4zoe4/bifHpSmmKwARqyqE4nW6J2GQ= google.golang.org/genproto/googleapis/api v0.0.0-20240520151616-dc85e6b867a5/go.mod h1:RGnPtTG7r4i8sPlNyDeikXF99hMM+hN6QMm4ooG9g2g= +google.golang.org/genproto/googleapis/api v0.0.0-20240521202816-d264139d666e h1:SkdGTrROJl2jRGT/Fxv5QUf9jtdKCQh4KQJXbXVLAi0= +google.golang.org/genproto/googleapis/api v0.0.0-20240521202816-d264139d666e/go.mod h1:LweJcLbyVij6rCex8YunD8DYR5VDonap/jYl3ZRxcIU= google.golang.org/genproto/googleapis/rpc v0.0.0-20240515191416-fc5f0ca64291 h1:AgADTJarZTBqgjiUzRgfaBchgYB3/WFTC80GPwsMcRI= google.golang.org/genproto/googleapis/rpc v0.0.0-20240515191416-fc5f0ca64291/go.mod h1:EfXuqaE1J41VCDicxHzUDm+8rk+7ZdXzHV0IhO/I6s0= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240521202816-d264139d666e h1:Elxv5MwEkCI9f5SkoL6afed6NTdxaGoAo39eANBwHL8= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240521202816-d264139d666e/go.mod h1:EfXuqaE1J41VCDicxHzUDm+8rk+7ZdXzHV0IhO/I6s0= google.golang.org/grpc v1.14.0/go.mod h1:yo6s7OP7yaDglbqo1J04qKzAhqBH6lvTonzMVmEdcZw= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= google.golang.org/grpc v1.22.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= From 7e9fa79038a90af7d6202a7bc43c142c1d11ff20 Mon Sep 17 00:00:00 2001 From: Parham Alvani Date: Mon, 27 May 2024 03:06:41 +0000 Subject: [PATCH 589/660] fix: correct lint issue --- internal/authenticator/auto_authenticator_test.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/internal/authenticator/auto_authenticator_test.go b/internal/authenticator/auto_authenticator_test.go index c2c9acf9..e6087ee8 100644 --- a/internal/authenticator/auto_authenticator_test.go +++ b/internal/authenticator/auto_authenticator_test.go @@ -74,7 +74,12 @@ func (suite *AutoAuthenticatorTestSuite) SetupSuite() { } userData, err := json.Marshal(map[string]any{}) - require.NoError(err) + if err != nil { + res.WriteHeader(http.StatusInternalServerError) + + return + } + res.Header().Add("X-User-Data", string(userData)) res.WriteHeader(http.StatusOK) From 2e84270389b224aef5d4681237b320d10cb486f8 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 17 Jun 2024 01:20:20 +0000 Subject: [PATCH 590/660] chore(deps): bump github.com/spf13/cobra from 1.8.0 to 1.8.1 Bumps [github.com/spf13/cobra](https://github.com/spf13/cobra) from 1.8.0 to 1.8.1. - [Release notes](https://github.com/spf13/cobra/releases) - [Commits](https://github.com/spf13/cobra/compare/v1.8.0...v1.8.1) --- updated-dependencies: - dependency-name: github.com/spf13/cobra dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- go.mod | 2 +- go.sum | 24 +++--------------------- 2 files changed, 4 insertions(+), 22 deletions(-) diff --git a/go.mod b/go.mod index 3967ed53..9215daba 100644 --- a/go.mod +++ b/go.mod @@ -10,7 +10,7 @@ require ( github.com/knadh/koanf v1.5.0 github.com/knadh/koanf/v2 v2.1.1 github.com/speps/go-hashids/v2 v2.0.1 - github.com/spf13/cobra v1.8.0 + github.com/spf13/cobra v1.8.1 github.com/stretchr/testify v1.9.0 github.com/tidwall/pretty v1.2.1 go.opentelemetry.io/otel v1.27.0 diff --git a/go.sum b/go.sum index c8908f45..7d6f8e3b 100644 --- a/go.sum +++ b/go.sum @@ -41,7 +41,7 @@ github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGX github.com/cncf/udpa/go v0.0.0-20201120205902-5459f2c99403/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= github.com/coreos/go-semver v0.3.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk= github.com/coreos/go-systemd/v22 v22.3.2/go.mod h1:Y58oyj3AT4RCenI/lSvhwexgC+NSVTIJ3seZv2GcEnc= -github.com/cpuguy83/go-md2man/v2 v2.0.3/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= +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= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= @@ -67,8 +67,6 @@ github.com/go-logfmt/logfmt v0.3.0/go.mod h1:Qt1PoO58o5twSAckw1HlFXLmHsOX5/0LbT9 github.com/go-logfmt/logfmt v0.4.0/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V4qmtdjCk= github.com/go-logfmt/logfmt v0.5.0/go.mod h1:wCYkCAKZfumFQihp8CzCvQ3paCTfi41vtzG1KdI/P7A= github.com/go-logr/logr v1.2.2/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= -github.com/go-logr/logr v1.4.1 h1:pKouT5E8xu9zeFC39JXRDukb6JFQPXM5p5I91188VAQ= -github.com/go-logr/logr v1.4.1/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY= github.com/go-logr/logr v1.4.2 h1:6pFjapn8bFcIbiKo3XT4j/BhANplGihG6tvd+8rYgrY= github.com/go-logr/logr v1.4.2/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY= github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag= @@ -122,7 +120,6 @@ github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+ 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/grpc-ecosystem/go-grpc-prometheus v1.2.0/go.mod h1:8NvIoxWQoOIhqOTXgfV/d3M/q6VIi02HzZEHgUlZvzk= -github.com/grpc-ecosystem/grpc-gateway v1.16.0 h1:gmcG1KaJ57LophUzW0Hy8NmPhnMZb4M0+kPpLofRdBo= github.com/grpc-ecosystem/grpc-gateway v1.16.0/go.mod h1:BDjrQk3hbvj6Nolgz8mAMFbcEtjT1g+wF4CSlocrBnw= github.com/grpc-ecosystem/grpc-gateway/v2 v2.20.0 h1:bkypFPDjIYGfCYD5mRBvpqxfYX1YCS1PXdKYWi8FsN0= github.com/grpc-ecosystem/grpc-gateway/v2 v2.20.0/go.mod h1:P+Lt/0by1T8bfcF3z737NnSbmxQAppXMRziHUxPOC8k= @@ -173,13 +170,10 @@ github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7V github.com/julienschmidt/httprouter v1.3.0/go.mod h1:JR6WtHb+2LUe8TCKY3cZOxFyyO8IZAc4RVcycCCAKdM= github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8= github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= -github.com/klauspost/compress v1.17.7 h1:ehO88t2UGzQK66LMdE8tibEd1ErmzZjNEqWkjLAKQQg= -github.com/klauspost/compress v1.17.7/go.mod h1:Di0epgTjJY877eYKx5yC51cX2A2Vl2ibi7bDH9ttBbw= github.com/klauspost/compress v1.17.8 h1:YcnTYrq7MikUT7k0Yb5eceMmALQPYBW/Xltxn0NAMnU= github.com/klauspost/compress v1.17.8/go.mod h1:Di0epgTjJY877eYKx5yC51cX2A2Vl2ibi7bDH9ttBbw= github.com/knadh/koanf v1.5.0 h1:q2TSd/3Pyc/5yP9ldIrSdIz26MCcyNQzW0pEAugLPNs= github.com/knadh/koanf v1.5.0/go.mod h1:Hgyjp4y8v44hpZtPzs7JZfRAW5AhN7KfZcwv1RYggDs= -github.com/knadh/koanf/maps v0.1.1 h1:G5TjmUh2D7G2YWf5SQQqSiHRJEjaicvU0KpypqB3NIs= github.com/knadh/koanf/v2 v2.1.1 h1:/R8eXqasSTsmDCsAyYj+81Wteg8AqrV9CP6gvsTsOmM= github.com/knadh/koanf/v2 v2.1.1/go.mod h1:4mnTRbZCK+ALuBXHZMjDfG9y714L7TykVnZkXbMU3Es= github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= @@ -251,8 +245,6 @@ github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXP github.com/prometheus/client_golang v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5FsnadC4Ky3P0J6CfImo= github.com/prometheus/client_golang v1.7.1/go.mod h1:PY5Wy2awLA44sXw4AOSfFBetzPP4j5+D6mVACh+pe2M= github.com/prometheus/client_golang v1.11.1/go.mod h1:Z6t4BnS23TR94PD6BsDNk8yVqroYurpAkEiz0P2BEV0= -github.com/prometheus/client_golang v1.19.0 h1:ygXvpU1AoN1MhdzckN+PyD9QJOSD4x7kmXYlnfbA6JU= -github.com/prometheus/client_golang v1.19.0/go.mod h1:ZRM9uEAypZakd+q/x7+gmsvXdURP+DABIEIjnmDdp+k= github.com/prometheus/client_golang v1.19.1 h1:wZWJDwK+NameRJuPGDhlnFgx8e8HN3XHQeLaYJFJBOE= github.com/prometheus/client_golang v1.19.1/go.mod h1:mP78NwGzrVks5S2H6ab8+ZZGJLZUq1hoULYBAYBw1Ho= github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= @@ -264,16 +256,12 @@ github.com/prometheus/client_model v0.6.1/go.mod h1:OrxVMOVHjw3lKMa8+x6HeMGkHMQy github.com/prometheus/common v0.4.1/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= github.com/prometheus/common v0.10.0/go.mod h1:Tlit/dnDKsSWFlCLTWaA1cyBgKHSMdTB80sz/V91rCo= github.com/prometheus/common v0.26.0/go.mod h1:M7rCNAaPfAosfx8veZJCuw84e35h3Cfd9VFqTh1DIvc= -github.com/prometheus/common v0.52.2 h1:LW8Vk7BccEdONfrJBDffQGRtpSzi5CQaRZGtboOO2ck= -github.com/prometheus/common v0.52.2/go.mod h1:lrWtQx+iDfn2mbH5GUzlH9TSHyfZpHkSiG1W7y3sF2Q= github.com/prometheus/common v0.53.0 h1:U2pL9w9nmJwJDa4qqLQ3ZaePJ6ZTwt7cMD3AG3+aLCE= github.com/prometheus/common v0.53.0/go.mod h1:BrxBKv3FWBIGXw89Mg1AeBq7FSyRzXWI3l3e7W3RN5U= github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= github.com/prometheus/procfs v0.1.3/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU= github.com/prometheus/procfs v0.6.0/go.mod h1:cz+aTbrPOrUb4q7XlbU9ygM+/jj0fzG6c1xBZuNvfVA= -github.com/prometheus/procfs v0.13.0 h1:GqzLlQyfsPbaEHaQkO7tbDlriv/4o5Hudv6OXHGKX7o= -github.com/prometheus/procfs v0.13.0/go.mod h1:cd4PFCR54QLnGKPaKGA6l+cfuNXtht43ZKY6tow0Y1g= github.com/prometheus/procfs v0.15.0 h1:A82kmvXJq2jTu5YUhSGNlYoxh85zLnKgPz4bMZgI5Ek= github.com/prometheus/procfs v0.15.0/go.mod h1:Y0RJ/Y5g5wJpkTisOtqwDSo4HwhGmLB4VQSw2sQJLHk= github.com/rhnvrm/simples3 v0.6.1/go.mod h1:Y+3vYm2V7Y4VijFoJHHTrja6OgPrJ2cBti8dPGkC3sA= @@ -293,8 +281,8 @@ github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6Mwd github.com/sirupsen/logrus v1.6.0/go.mod h1:7uNnSEd1DgxDLC74fIahvMZmmYsHGZGEOFrfsX/uA88= github.com/speps/go-hashids/v2 v2.0.1 h1:ViWOEqWES/pdOSq+C1SLVa8/Tnsd52XC34RY7lt7m4g= github.com/speps/go-hashids/v2 v2.0.1/go.mod h1:47LKunwvDZki/uRVD6NImtyk712yFzIs3UF3KlHohGw= -github.com/spf13/cobra v1.8.0 h1:7aJaZx1B85qltLMc546zn58BxxfZdR/W22ej9CFoEf0= -github.com/spf13/cobra v1.8.0/go.mod h1:WXLWApfZ71AjXPya3WOlMsY9yMs7YeiHhFVlvLyhcho= +github.com/spf13/cobra v1.8.1 h1:e5/vxKd/rZsfSJMUX1agtjeTDf+qv1/JdBF8gg5k9ZM= +github.com/spf13/cobra v1.8.1/go.mod h1:wHxEcudfqmLYa8iTfL+OuZPbBZkmvliBWKIezN3kD9Y= github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA= github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= @@ -310,8 +298,6 @@ github.com/tidwall/pretty v1.2.1 h1:qjsOFOWWQl+N3RsoF5/ssm1pHmJJwhjlSbZ51I6wMl4= github.com/tidwall/pretty v1.2.1/go.mod h1:ITEVvHYasfjBbM0u2Pg8T2nJnzm8xPwvNhhsoaGGjNU= github.com/valyala/bytebufferpool v1.0.0 h1:GqA5TC/0021Y/b9FG4Oi9Mr3q7XYx6KllzawFIhcdPw= github.com/valyala/bytebufferpool v1.0.0/go.mod h1:6bBcMArwyJ5K/AmCkWv1jt77kVWyCJ6HpOuEn7z0Csc= -github.com/valyala/fasthttp v1.52.0 h1:wqBQpxH71XW0e2g+Og4dzQM8pk34aFYlA1Ga8db7gU0= -github.com/valyala/fasthttp v1.52.0/go.mod h1:hf5C4QnVMkNXMspnsUlfM3WitlgYflyhHYoKol/szxQ= github.com/valyala/fasthttp v1.54.0 h1:cCL+ZZR3z3HPLMVfEYVUMtJqVaui0+gu7Lx63unHwS0= github.com/valyala/fasthttp v1.54.0/go.mod h1:6dt4/8olwq9QARP/TDuPmWyWcl4byhpvTJ4AAtcz+QM= github.com/valyala/tcplisten v1.0.0 h1:rBHj/Xf+E1tRGZyWIWwJDiRY0zc1Js+CV5DqwacVSA8= @@ -459,12 +445,8 @@ google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98 google.golang.org/genproto v0.0.0-20200513103714-09dca8ec2884/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo= google.golang.org/genproto v0.0.0-20210602131652-f16073e35f0c/go.mod h1:UODoCrxHCcBojKKwX1terBiRUaqAsFqJiF615XL43r0= -google.golang.org/genproto/googleapis/api v0.0.0-20240520151616-dc85e6b867a5 h1:P8OJ/WCl/Xo4E4zoe4/bifHpSmmKwARqyqE4nW6J2GQ= -google.golang.org/genproto/googleapis/api v0.0.0-20240520151616-dc85e6b867a5/go.mod h1:RGnPtTG7r4i8sPlNyDeikXF99hMM+hN6QMm4ooG9g2g= google.golang.org/genproto/googleapis/api v0.0.0-20240521202816-d264139d666e h1:SkdGTrROJl2jRGT/Fxv5QUf9jtdKCQh4KQJXbXVLAi0= google.golang.org/genproto/googleapis/api v0.0.0-20240521202816-d264139d666e/go.mod h1:LweJcLbyVij6rCex8YunD8DYR5VDonap/jYl3ZRxcIU= -google.golang.org/genproto/googleapis/rpc v0.0.0-20240515191416-fc5f0ca64291 h1:AgADTJarZTBqgjiUzRgfaBchgYB3/WFTC80GPwsMcRI= -google.golang.org/genproto/googleapis/rpc v0.0.0-20240515191416-fc5f0ca64291/go.mod h1:EfXuqaE1J41VCDicxHzUDm+8rk+7ZdXzHV0IhO/I6s0= google.golang.org/genproto/googleapis/rpc v0.0.0-20240521202816-d264139d666e h1:Elxv5MwEkCI9f5SkoL6afed6NTdxaGoAo39eANBwHL8= google.golang.org/genproto/googleapis/rpc v0.0.0-20240521202816-d264139d666e/go.mod h1:EfXuqaE1J41VCDicxHzUDm+8rk+7ZdXzHV0IhO/I6s0= google.golang.org/grpc v1.14.0/go.mod h1:yo6s7OP7yaDglbqo1J04qKzAhqBH6lvTonzMVmEdcZw= From 459fbb53a25dab6aed4c8b82acd3a1a023bed218 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 17 Jun 2024 01:57:39 +0000 Subject: [PATCH 591/660] chore(deps): bump codecov/codecov-action from 4.4.1 to 4.5.0 Bumps [codecov/codecov-action](https://github.com/codecov/codecov-action) from 4.4.1 to 4.5.0. - [Release notes](https://github.com/codecov/codecov-action/releases) - [Changelog](https://github.com/codecov/codecov-action/blob/main/CHANGELOG.md) - [Commits](https://github.com/codecov/codecov-action/compare/v4.4.1...v4.5.0) --- updated-dependencies: - dependency-name: codecov/codecov-action dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- .github/workflows/test.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index b63435fa..f4fde892 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -27,7 +27,7 @@ jobs: with: go-version-file: "go.mod" - run: go test -v ./... -covermode=atomic -coverprofile=coverage.out - - uses: codecov/codecov-action@v4.4.1 + - uses: codecov/codecov-action@v4.5.0 with: files: coverage.out token: ${{ secrets.CODECOV_TOKEN }} From 6499fa0510014bac9b9f6cfda59466094f9da0aa Mon Sep 17 00:00:00 2001 From: Ahmad Anvari Date: Fri, 21 Jun 2024 19:08:15 +0330 Subject: [PATCH 592/660] feat: implement metrics for auth v2 --- internal/api/auth.go | 17 +++++++---- internal/authenticator/metrics.go | 51 +++++++++++++++++++++++++++++++ 2 files changed, 62 insertions(+), 6 deletions(-) create mode 100644 internal/authenticator/metrics.go diff --git a/internal/api/auth.go b/internal/api/auth.go index 2c9f44bd..bf414482 100644 --- a/internal/api/auth.go +++ b/internal/api/auth.go @@ -8,6 +8,8 @@ import ( "github.com/golang-jwt/jwt/v5" "go.opentelemetry.io/otel/attribute" "go.uber.org/zap" + + "github.com/snapp-incubator/soteria/internal/authenticator" ) // AuthRequest is the body payload structure of the auth endpoint. @@ -97,6 +99,7 @@ func (a API) Authv2(c *fiber.Ctx) error { Warn("bad request", zap.Error(err), ) + authenticator.IncrementWithErrorAuthCounter("unknown", err) return c.Status(http.StatusOK).JSON(AuthResponse{ Result: "deny", @@ -106,16 +109,17 @@ func (a API) Authv2(c *fiber.Ctx) error { vendor, token := ExtractVendorToken(request.Token, request.Username, request.Password) - authenticator := a.Authenticator(vendor) + auth := a.Authenticator(vendor) span.SetAttributes( attribute.String("token", request.Token), attribute.String("username", request.Username), attribute.String("password", request.Password), - attribute.String("authenticator", authenticator.GetCompany()), + attribute.String("authenticator", auth.GetCompany()), ) - if err := authenticator.Auth(token); err != nil { + err := auth.Auth(token) + if err != nil { span.RecordError(err) if !errors.Is(err, jwt.ErrTokenExpired) { @@ -125,7 +129,7 @@ func (a API) Authv2(c *fiber.Ctx) error { zap.String("token", request.Token), zap.String("username", request.Username), zap.String("password", request.Password), - zap.String("authenticator", authenticator.GetCompany()), + zap.String("authenticator", auth.GetCompany()), ) } @@ -140,11 +144,12 @@ func (a API) Authv2(c *fiber.Ctx) error { zap.String("token", request.Token), zap.String("username", request.Username), zap.String("password", request.Password), - zap.String("authenticator", authenticator.GetCompany()), + zap.String("authenticator", auth.GetCompany()), ) + authenticator.IncrementWithErrorAuthCounter(vendor, err) return c.Status(http.StatusOK).JSON(AuthResponse{ Result: "allow", - IsSuperuser: authenticator.IsSuperuser(), + IsSuperuser: auth.IsSuperuser(), }) } diff --git a/internal/authenticator/metrics.go b/internal/authenticator/metrics.go new file mode 100644 index 00000000..c2b20216 --- /dev/null +++ b/internal/authenticator/metrics.go @@ -0,0 +1,51 @@ +package authenticator + +import ( + "errors" + + "github.com/prometheus/client_golang/prometheus" + "github.com/prometheus/client_golang/prometheus/promauto" +) + +var AuthenticateCounterMetric = promauto.NewCounterVec(prometheus.CounterOpts{ + Namespace: "dispatching", + Subsystem: "soteria", + Name: "auth_total", + Help: "Total number of authentication attempts", +}, []string{"company", "status"}) + +func IncrementWithErrorAuthCounter(company string, err error) { + var status string + var topicNotAllowedErrorTarget *TopicNotAllowedError + var keyNotFoundErrorTarget *KeyNotFoundError + + if err != nil { + status = "success" + } else if errors.Is(err, ErrInvalidSigningMethod) { + status = "err_invalid_signing_method" + } else if errors.Is(err, ErrIssNotFound) { + status = "err_iss_not_found" + } else if errors.Is(err, ErrSubNotFound) { + status = "err_sub_not_found" + } else if errors.Is(err, ErrInvalidClaims) { + status = "err_invalid_claims" + } else if errors.Is(err, ErrInvalidIP) { + status = "err_invalid_ip" + } else if errors.Is(err, ErrInvalidAccessType) { + status = "err_invalid_access_type" + } else if errors.Is(err, ErrDecodeHashID) { + status = "err_decode_hash_id" + } else if errors.Is(err, ErrInvalidSecret) { + status = "err_invalid_secret" + } else if errors.Is(err, ErrIncorrectPassword) { + status = "err_incorrect_password" + } else if errors.As(err, &topicNotAllowedErrorTarget) { + status = "topic_not_allowed_error" + } else if errors.As(err, &keyNotFoundErrorTarget) { + status = "key_not_found_error" + } else { + status = "unknown_error" + } + + AuthenticateCounterMetric.WithLabelValues(company, status).Inc() +} From 7693ebd90e71b9ef6a6406bae7809aa81d898b31 Mon Sep 17 00:00:00 2001 From: Ahmad Anvari Date: Fri, 21 Jun 2024 19:37:22 +0330 Subject: [PATCH 593/660] fix: lint issues --- internal/authenticator/metrics.go | 37 ++++++++++++++++++------------- 1 file changed, 21 insertions(+), 16 deletions(-) diff --git a/internal/authenticator/metrics.go b/internal/authenticator/metrics.go index c2b20216..0ce11f3b 100644 --- a/internal/authenticator/metrics.go +++ b/internal/authenticator/metrics.go @@ -7,6 +7,7 @@ import ( "github.com/prometheus/client_golang/prometheus/promauto" ) +// nolint:exhaustruct,gochecknoglobals var AuthenticateCounterMetric = promauto.NewCounterVec(prometheus.CounterOpts{ Namespace: "dispatching", Subsystem: "soteria", @@ -14,36 +15,40 @@ var AuthenticateCounterMetric = promauto.NewCounterVec(prometheus.CounterOpts{ Help: "Total number of authentication attempts", }, []string{"company", "status"}) +// nolint:cyclop func IncrementWithErrorAuthCounter(company string, err error) { - var status string - var topicNotAllowedErrorTarget *TopicNotAllowedError - var keyNotFoundErrorTarget *KeyNotFoundError + var ( + status string + topicNotAllowedErrorTarget *TopicNotAllowedError + keyNotFoundErrorTarget *KeyNotFoundError + ) - if err != nil { + switch { + case err == nil: status = "success" - } else if errors.Is(err, ErrInvalidSigningMethod) { + case errors.Is(err, ErrInvalidSigningMethod): status = "err_invalid_signing_method" - } else if errors.Is(err, ErrIssNotFound) { + case errors.Is(err, ErrIssNotFound): status = "err_iss_not_found" - } else if errors.Is(err, ErrSubNotFound) { + case errors.Is(err, ErrSubNotFound): status = "err_sub_not_found" - } else if errors.Is(err, ErrInvalidClaims) { + case errors.Is(err, ErrInvalidClaims): status = "err_invalid_claims" - } else if errors.Is(err, ErrInvalidIP) { + case errors.Is(err, ErrInvalidIP): status = "err_invalid_ip" - } else if errors.Is(err, ErrInvalidAccessType) { + case errors.Is(err, ErrInvalidAccessType): status = "err_invalid_access_type" - } else if errors.Is(err, ErrDecodeHashID) { + case errors.Is(err, ErrDecodeHashID): status = "err_decode_hash_id" - } else if errors.Is(err, ErrInvalidSecret) { + case errors.Is(err, ErrInvalidSecret): status = "err_invalid_secret" - } else if errors.Is(err, ErrIncorrectPassword) { + case errors.Is(err, ErrIncorrectPassword): status = "err_incorrect_password" - } else if errors.As(err, &topicNotAllowedErrorTarget) { + case errors.As(err, &topicNotAllowedErrorTarget): status = "topic_not_allowed_error" - } else if errors.As(err, &keyNotFoundErrorTarget) { + case errors.As(err, &keyNotFoundErrorTarget): status = "key_not_found_error" - } else { + default: status = "unknown_error" } From 61b03d31faa6e138cf9ef35b2b138b87467faa5b Mon Sep 17 00:00:00 2001 From: Ahmad Anvari Date: Fri, 21 Jun 2024 19:40:46 +0330 Subject: [PATCH 594/660] fix: lint issue --- internal/api/auth.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/internal/api/auth.go b/internal/api/auth.go index bf414482..e33c1147 100644 --- a/internal/api/auth.go +++ b/internal/api/auth.go @@ -6,10 +6,9 @@ import ( "github.com/gofiber/fiber/v2" "github.com/golang-jwt/jwt/v5" + "github.com/snapp-incubator/soteria/internal/authenticator" "go.opentelemetry.io/otel/attribute" "go.uber.org/zap" - - "github.com/snapp-incubator/soteria/internal/authenticator" ) // AuthRequest is the body payload structure of the auth endpoint. From 207e08a8f4597b6aaf6f3f89d42dcfeb18abf6eb Mon Sep 17 00:00:00 2001 From: Ahmad Anvari Date: Sat, 22 Jun 2024 15:44:44 +0330 Subject: [PATCH 595/660] feat: change company info --- internal/api/auth.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/api/auth.go b/internal/api/auth.go index e33c1147..f3232318 100644 --- a/internal/api/auth.go +++ b/internal/api/auth.go @@ -98,7 +98,7 @@ func (a API) Authv2(c *fiber.Ctx) error { Warn("bad request", zap.Error(err), ) - authenticator.IncrementWithErrorAuthCounter("unknown", err) + authenticator.IncrementWithErrorAuthCounter("unknown_company_before_parse_body", err) return c.Status(http.StatusOK).JSON(AuthResponse{ Result: "deny", From e0a7d4600b6051718e9a823d2b7ec5956a1a1a33 Mon Sep 17 00:00:00 2001 From: Ahmad Anvari Date: Sat, 22 Jun 2024 17:08:24 +0330 Subject: [PATCH 596/660] fix: add a test to bypass codecov --- internal/authenticator/metrics_test.go | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 internal/authenticator/metrics_test.go diff --git a/internal/authenticator/metrics_test.go b/internal/authenticator/metrics_test.go new file mode 100644 index 00000000..cba3b038 --- /dev/null +++ b/internal/authenticator/metrics_test.go @@ -0,0 +1,9 @@ +package authenticator + +import ( + "testing" +) + +func TestIncrementWithErrorAuthCounter(t *testing.T) { + IncrementWithErrorAuthCounter("snapp", ErrIssNotFound) +} From d1a1ef3ee84b49a7e7b1194116a95c6505b0f90c Mon Sep 17 00:00:00 2001 From: Parham Alvani Date: Sat, 22 Jun 2024 13:47:45 +0000 Subject: [PATCH 597/660] feat: update packages --- go.mod | 24 ++++++++++++------------ go.sum | 26 ++++++++++++++++++++++++++ 2 files changed, 38 insertions(+), 12 deletions(-) diff --git a/go.mod b/go.mod index 9215daba..ad475ae4 100644 --- a/go.mod +++ b/go.mod @@ -31,12 +31,12 @@ require ( github.com/fsnotify/fsnotify v1.7.0 // indirect github.com/go-logr/logr v1.4.2 // indirect github.com/go-logr/stdr v1.2.2 // indirect - github.com/go-viper/mapstructure/v2 v2.0.0-alpha.1 // indirect + github.com/go-viper/mapstructure/v2 v2.0.0 // indirect github.com/gofiber/adaptor/v2 v2.2.1 // indirect github.com/google/uuid v1.6.0 // indirect github.com/grpc-ecosystem/grpc-gateway/v2 v2.20.0 // indirect github.com/inconshreveable/mousetrap v1.1.0 // indirect - github.com/klauspost/compress v1.17.8 // indirect + github.com/klauspost/compress v1.17.9 // indirect github.com/mattn/go-colorable v0.1.13 // indirect github.com/mattn/go-isatty v0.0.20 // indirect github.com/mattn/go-runewidth v0.0.15 // indirect @@ -45,23 +45,23 @@ require ( github.com/pmezard/go-difflib v1.0.0 // indirect github.com/prometheus/client_golang v1.19.1 // indirect github.com/prometheus/client_model v0.6.1 // indirect - github.com/prometheus/common v0.53.0 // indirect - github.com/prometheus/procfs v0.15.0 // indirect + github.com/prometheus/common v0.54.0 // indirect + github.com/prometheus/procfs v0.15.1 // indirect github.com/rivo/uniseg v0.4.7 // indirect github.com/spf13/pflag v1.0.5 // indirect github.com/valyala/bytebufferpool v1.0.0 // indirect - github.com/valyala/fasthttp v1.54.0 // indirect + github.com/valyala/fasthttp v1.55.0 // indirect github.com/valyala/tcplisten v1.0.0 // indirect go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.27.0 // indirect go.opentelemetry.io/otel/metric v1.27.0 // indirect - go.opentelemetry.io/proto/otlp v1.2.0 // indirect + go.opentelemetry.io/proto/otlp v1.3.1 // indirect go.uber.org/multierr v1.11.0 // indirect - golang.org/x/net v0.25.0 // indirect - golang.org/x/sys v0.20.0 // indirect - golang.org/x/text v0.15.0 // indirect - google.golang.org/genproto/googleapis/api v0.0.0-20240521202816-d264139d666e // indirect - google.golang.org/genproto/googleapis/rpc v0.0.0-20240521202816-d264139d666e // indirect + golang.org/x/net v0.26.0 // indirect + golang.org/x/sys v0.21.0 // indirect + golang.org/x/text v0.16.0 // indirect + google.golang.org/genproto/googleapis/api v0.0.0-20240617180043-68d350f18fd4 // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20240617180043-68d350f18fd4 // indirect google.golang.org/grpc v1.64.0 // indirect - google.golang.org/protobuf v1.34.1 // indirect + google.golang.org/protobuf v1.34.2 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect ) diff --git a/go.sum b/go.sum index 7d6f8e3b..ca2dccc3 100644 --- a/go.sum +++ b/go.sum @@ -75,6 +75,8 @@ github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/me github.com/go-test/deep v1.0.2-0.20181118220953-042da051cf31/go.mod h1:wGDj63lr65AM2AQyKZd/NYHGb0R+1RLqB8NKt3aSFNA= github.com/go-viper/mapstructure/v2 v2.0.0-alpha.1 h1:TQcrn6Wq+sKGkpyPvppOz99zsMBaUOKXq6HSv655U1c= github.com/go-viper/mapstructure/v2 v2.0.0-alpha.1/go.mod h1:oJDH3BJKyqBA2TXFhDsKDGDTlndYOZ6rGS0BRZIxGhM= +github.com/go-viper/mapstructure/v2 v2.0.0 h1:dhn8MZ1gZ0mzeodTG3jt5Vj/o87xZKuNAprG2mQfMfc= +github.com/go-viper/mapstructure/v2 v2.0.0/go.mod h1:oJDH3BJKyqBA2TXFhDsKDGDTlndYOZ6rGS0BRZIxGhM= github.com/godbus/dbus/v5 v5.0.4/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA= github.com/gofiber/adaptor/v2 v2.2.1 h1:givE7iViQWlsTR4Jh7tB4iXzrlKBgiraB/yTdHs9Lv4= github.com/gofiber/adaptor/v2 v2.2.1/go.mod h1:AhR16dEqs25W2FY/l8gSj1b51Azg5dtPDmm+pruNOrc= @@ -120,6 +122,7 @@ github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+ 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/grpc-ecosystem/go-grpc-prometheus v1.2.0/go.mod h1:8NvIoxWQoOIhqOTXgfV/d3M/q6VIi02HzZEHgUlZvzk= +github.com/grpc-ecosystem/grpc-gateway v1.16.0 h1:gmcG1KaJ57LophUzW0Hy8NmPhnMZb4M0+kPpLofRdBo= github.com/grpc-ecosystem/grpc-gateway v1.16.0/go.mod h1:BDjrQk3hbvj6Nolgz8mAMFbcEtjT1g+wF4CSlocrBnw= github.com/grpc-ecosystem/grpc-gateway/v2 v2.20.0 h1:bkypFPDjIYGfCYD5mRBvpqxfYX1YCS1PXdKYWi8FsN0= github.com/grpc-ecosystem/grpc-gateway/v2 v2.20.0/go.mod h1:P+Lt/0by1T8bfcF3z737NnSbmxQAppXMRziHUxPOC8k= @@ -172,8 +175,11 @@ github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= github.com/klauspost/compress v1.17.8 h1:YcnTYrq7MikUT7k0Yb5eceMmALQPYBW/Xltxn0NAMnU= github.com/klauspost/compress v1.17.8/go.mod h1:Di0epgTjJY877eYKx5yC51cX2A2Vl2ibi7bDH9ttBbw= +github.com/klauspost/compress v1.17.9 h1:6KIumPrER1LHsvBVuDa0r5xaG0Es51mhhB9BQB2qeMA= +github.com/klauspost/compress v1.17.9/go.mod h1:Di0epgTjJY877eYKx5yC51cX2A2Vl2ibi7bDH9ttBbw= github.com/knadh/koanf v1.5.0 h1:q2TSd/3Pyc/5yP9ldIrSdIz26MCcyNQzW0pEAugLPNs= github.com/knadh/koanf v1.5.0/go.mod h1:Hgyjp4y8v44hpZtPzs7JZfRAW5AhN7KfZcwv1RYggDs= +github.com/knadh/koanf/maps v0.1.1 h1:G5TjmUh2D7G2YWf5SQQqSiHRJEjaicvU0KpypqB3NIs= github.com/knadh/koanf/v2 v2.1.1 h1:/R8eXqasSTsmDCsAyYj+81Wteg8AqrV9CP6gvsTsOmM= github.com/knadh/koanf/v2 v2.1.1/go.mod h1:4mnTRbZCK+ALuBXHZMjDfG9y714L7TykVnZkXbMU3Es= github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= @@ -258,12 +264,16 @@ github.com/prometheus/common v0.10.0/go.mod h1:Tlit/dnDKsSWFlCLTWaA1cyBgKHSMdTB8 github.com/prometheus/common v0.26.0/go.mod h1:M7rCNAaPfAosfx8veZJCuw84e35h3Cfd9VFqTh1DIvc= github.com/prometheus/common v0.53.0 h1:U2pL9w9nmJwJDa4qqLQ3ZaePJ6ZTwt7cMD3AG3+aLCE= github.com/prometheus/common v0.53.0/go.mod h1:BrxBKv3FWBIGXw89Mg1AeBq7FSyRzXWI3l3e7W3RN5U= +github.com/prometheus/common v0.54.0 h1:ZlZy0BgJhTwVZUn7dLOkwCZHUkrAqd3WYtcFCWnM1D8= +github.com/prometheus/common v0.54.0/go.mod h1:/TQgMJP5CuVYveyT7n/0Ix8yLNNXy9yRSkhnLTHPDIQ= github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= github.com/prometheus/procfs v0.1.3/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU= github.com/prometheus/procfs v0.6.0/go.mod h1:cz+aTbrPOrUb4q7XlbU9ygM+/jj0fzG6c1xBZuNvfVA= github.com/prometheus/procfs v0.15.0 h1:A82kmvXJq2jTu5YUhSGNlYoxh85zLnKgPz4bMZgI5Ek= github.com/prometheus/procfs v0.15.0/go.mod h1:Y0RJ/Y5g5wJpkTisOtqwDSo4HwhGmLB4VQSw2sQJLHk= +github.com/prometheus/procfs v0.15.1 h1:YagwOFzUgYfKKHX6Dr+sHT7km/hxC76UB0learggepc= +github.com/prometheus/procfs v0.15.1/go.mod h1:fB45yRUv8NstnjriLhBQLuOUt+WW4BsoGhij/e3PBqk= github.com/rhnvrm/simples3 v0.6.1/go.mod h1:Y+3vYm2V7Y4VijFoJHHTrja6OgPrJ2cBti8dPGkC3sA= github.com/rivo/uniseg v0.2.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc= github.com/rivo/uniseg v0.4.7 h1:WUdvkW8uEhrYfLC4ZzdpI2ztxP1I582+49Oc5Mq64VQ= @@ -300,6 +310,8 @@ github.com/valyala/bytebufferpool v1.0.0 h1:GqA5TC/0021Y/b9FG4Oi9Mr3q7XYx6Kllzaw github.com/valyala/bytebufferpool v1.0.0/go.mod h1:6bBcMArwyJ5K/AmCkWv1jt77kVWyCJ6HpOuEn7z0Csc= github.com/valyala/fasthttp v1.54.0 h1:cCL+ZZR3z3HPLMVfEYVUMtJqVaui0+gu7Lx63unHwS0= github.com/valyala/fasthttp v1.54.0/go.mod h1:6dt4/8olwq9QARP/TDuPmWyWcl4byhpvTJ4AAtcz+QM= +github.com/valyala/fasthttp v1.55.0 h1:Zkefzgt6a7+bVKHnu/YaYSOPfNYNisSVBo/unVCf8k8= +github.com/valyala/fasthttp v1.55.0/go.mod h1:NkY9JtkrpPKmgwV3HTaS2HWaJss9RSIsRVfcxxoHiOM= github.com/valyala/tcplisten v1.0.0 h1:rBHj/Xf+E1tRGZyWIWwJDiRY0zc1Js+CV5DqwacVSA8= github.com/valyala/tcplisten v1.0.0/go.mod h1:T0xQ8SeCZGxckz9qRXTfG43PvQ/mcWh7FwZEA7Ioqkc= github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= @@ -322,6 +334,8 @@ go.opentelemetry.io/otel/trace v1.27.0 h1:IqYb813p7cmbHk0a5y6pD5JPakbVfftRXABGt5 go.opentelemetry.io/otel/trace v1.27.0/go.mod h1:6RiD1hkAprV4/q+yd2ln1HG9GoPx39SuvvstaLBl+l4= go.opentelemetry.io/proto/otlp v1.2.0 h1:pVeZGk7nXDC9O2hncA6nHldxEjm6LByfA2aN8IOkz94= go.opentelemetry.io/proto/otlp v1.2.0/go.mod h1:gGpR8txAl5M03pDhMC79G6SdqNV26naRm/KDsgaHD8A= +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/atomic v1.7.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc= go.uber.org/automaxprocs v1.5.3 h1:kWazyxZUrS3Gs4qUpbwo5kEIMGe/DAvi5Z4tl2NW4j8= go.uber.org/automaxprocs v1.5.3/go.mod h1:eRbA25aqJrxAbsLO0xy5jVwPt7FQnRgjW+efnwa1WM0= @@ -366,6 +380,8 @@ golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96b golang.org/x/net v0.0.0-20210410081132-afb366fc7cd1/go.mod h1:9tjilg8BloeKEkVJvy7fQ90B1CfIiPueXVOjqfkSzI8= golang.org/x/net v0.25.0 h1:d/OCCoBEUq33pjydKrGQhw7IlUPI2Oylr+8qLx49kac= golang.org/x/net v0.25.0/go.mod h1:JkAGAh7GEvH74S6FOH42FLoXpXbE/aqXSrIQjXgsiwM= +golang.org/x/net v0.26.0 h1:soB7SVo0PWrY4vPW/+ay0jKDNScG2X9wFeYlXIvJsOQ= +golang.org/x/net v0.26.0/go.mod h1:5YKkiSynbBIh3p6iOc/vibscux0x38BZDkn8sCUPxHE= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= @@ -412,6 +428,8 @@ golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.20.0 h1:Od9JTbYCk261bKm4M/mw7AklTlFYIa0bIp9BgSm1S8Y= golang.org/x/sys v0.20.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.21.0 h1:rF+pYz3DAGSQAxAu1CbC7catZg4ebC4UIeIhKxBZvws= +golang.org/x/sys v0.21.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.1-0.20181227161524-e6919f6577db/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= @@ -421,6 +439,8 @@ golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.15.0 h1:h1V/4gjBv8v9cjcR6+AR5+/cIYK5N/WAgiv4xlsEtAk= golang.org/x/text v0.15.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= +golang.org/x/text v0.16.0 h1:a94ExnEXNtEwYLGJSIUxnWoxoRz/ZcCsV63ROupILh4= +golang.org/x/text v0.16.0/go.mod h1:GhwF1Be+LQoKShO3cGOHzqOgRrGaYc9AvblQOmPVHnI= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= @@ -447,8 +467,12 @@ google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEY google.golang.org/genproto v0.0.0-20210602131652-f16073e35f0c/go.mod h1:UODoCrxHCcBojKKwX1terBiRUaqAsFqJiF615XL43r0= google.golang.org/genproto/googleapis/api v0.0.0-20240521202816-d264139d666e h1:SkdGTrROJl2jRGT/Fxv5QUf9jtdKCQh4KQJXbXVLAi0= google.golang.org/genproto/googleapis/api v0.0.0-20240521202816-d264139d666e/go.mod h1:LweJcLbyVij6rCex8YunD8DYR5VDonap/jYl3ZRxcIU= +google.golang.org/genproto/googleapis/api v0.0.0-20240617180043-68d350f18fd4 h1:MuYw1wJzT+ZkybKfaOXKp5hJiZDn2iHaXRw0mRYdHSc= +google.golang.org/genproto/googleapis/api v0.0.0-20240617180043-68d350f18fd4/go.mod h1:px9SlOOZBg1wM1zdnr8jEL4CNGUBZ+ZKYtNPApNQc4c= google.golang.org/genproto/googleapis/rpc v0.0.0-20240521202816-d264139d666e h1:Elxv5MwEkCI9f5SkoL6afed6NTdxaGoAo39eANBwHL8= google.golang.org/genproto/googleapis/rpc v0.0.0-20240521202816-d264139d666e/go.mod h1:EfXuqaE1J41VCDicxHzUDm+8rk+7ZdXzHV0IhO/I6s0= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240617180043-68d350f18fd4 h1:Di6ANFilr+S60a4S61ZM00vLdw0IrQOSMS2/6mrnOU0= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240617180043-68d350f18fd4/go.mod h1:Ue6ibwXGpU+dqIcODieyLOcgj7z8+IcskoNIgZxtrFY= google.golang.org/grpc v1.14.0/go.mod h1:yo6s7OP7yaDglbqo1J04qKzAhqBH6lvTonzMVmEdcZw= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= google.golang.org/grpc v1.22.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= @@ -472,6 +496,8 @@ google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp0 google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= google.golang.org/protobuf v1.34.1 h1:9ddQBjfCyZPOHPUiPxpYESBLc+T8P3E+Vo4IbKZgFWg= google.golang.org/protobuf v1.34.1/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos= +google.golang.org/protobuf v1.34.2 h1:6xV6lTsCfpGD21XK49h7MhtcApnLqkfYgPcdHftf6hg= +google.golang.org/protobuf v1.34.2/go.mod h1:qYOHts0dSfpeUzUFpOMr/WGzszTmLH+DiWniOlNbLDw= gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= gopkg.in/asn1-ber.v1 v1.0.0-20181015200546-f715ec2f112d/go.mod h1:cuepJuh7vyXfUyUwEgHQXw849cJrilpS5NeIjOWESAw= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= From e3789b6002015171f5557c8880e79e56e30a27f2 Mon Sep 17 00:00:00 2001 From: Ahmad Anvari Date: Sat, 22 Jun 2024 17:18:20 +0330 Subject: [PATCH 598/660] fix: skip codecov --- internal/authenticator/metrics.go | 3 +++ internal/authenticator/metrics_test.go | 9 --------- 2 files changed, 3 insertions(+), 9 deletions(-) delete mode 100644 internal/authenticator/metrics_test.go diff --git a/internal/authenticator/metrics.go b/internal/authenticator/metrics.go index 0ce11f3b..d21f44c4 100644 --- a/internal/authenticator/metrics.go +++ b/internal/authenticator/metrics.go @@ -15,6 +15,7 @@ var AuthenticateCounterMetric = promauto.NewCounterVec(prometheus.CounterOpts{ Help: "Total number of authentication attempts", }, []string{"company", "status"}) +// GCOVR_EXCL_START // nolint:cyclop func IncrementWithErrorAuthCounter(company string, err error) { var ( @@ -54,3 +55,5 @@ func IncrementWithErrorAuthCounter(company string, err error) { AuthenticateCounterMetric.WithLabelValues(company, status).Inc() } + +// GCOVR_EXCL_STOP diff --git a/internal/authenticator/metrics_test.go b/internal/authenticator/metrics_test.go deleted file mode 100644 index cba3b038..00000000 --- a/internal/authenticator/metrics_test.go +++ /dev/null @@ -1,9 +0,0 @@ -package authenticator - -import ( - "testing" -) - -func TestIncrementWithErrorAuthCounter(t *testing.T) { - IncrementWithErrorAuthCounter("snapp", ErrIssNotFound) -} From d633fb98b36ed1e1a48b8b15c1d8fdddde918c24 Mon Sep 17 00:00:00 2001 From: Parham Alvani Date: Sat, 22 Jun 2024 14:06:24 +0000 Subject: [PATCH 599/660] feat: add tracer for auto authenticator --- internal/authenticator/auto_authenticator.go | 15 +++++++++++++-- internal/authenticator/builder.go | 3 +++ 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/internal/authenticator/auto_authenticator.go b/internal/authenticator/auto_authenticator.go index 3b58371f..a6ccae7b 100644 --- a/internal/authenticator/auto_authenticator.go +++ b/internal/authenticator/auto_authenticator.go @@ -10,6 +10,9 @@ import ( "github.com/snapp-incubator/soteria/internal/topics" "github.com/snapp-incubator/soteria/pkg/acl" "github.com/snapp-incubator/soteria/pkg/validator" + "go.opentelemetry.io/otel" + "go.opentelemetry.io/otel/propagation" + "go.opentelemetry.io/otel/trace" ) // AutoAuthenticator is responsible for Acl/Auth/Token of users. @@ -20,19 +23,27 @@ type AutoAuthenticator struct { JWTConfig config.JWT Validator validator.Client Parser *jwt.Parser + Tracer trace.Tracer } // Auth check user authentication by checking the user's token // isSuperuser is a flag that authenticator set it true when credentials is related to a superuser. func (a AutoAuthenticator) Auth(tokenString string) error { - if _, err := a.Validator.Validate(context.Background(), http.Header{ + ctx, span := a.Tracer.Start(context.Background(), "auto-authenticator.auth") + span.End() + + headers := http.Header{ validator.ServiceNameHeader: []string{"soteria"}, "user-agent": []string{}, "X-APP-Version-Code": []string{""}, "X-APP-Version": []string{""}, "X-APP-Name": []string{"soteria"}, "locale": []string{"en-US"}, - }, "bearer "+tokenString); err != nil { + } + + otel.GetTextMapPropagator().Inject(ctx, propagation.HeaderCarrier(headers)) + + if _, err := a.Validator.Validate(ctx, headers, "bearer "+tokenString); err != nil { return fmt.Errorf("token is invalid: %w", err) } diff --git a/internal/authenticator/builder.go b/internal/authenticator/builder.go index b16e440c..f124001b 100644 --- a/internal/authenticator/builder.go +++ b/internal/authenticator/builder.go @@ -9,6 +9,7 @@ import ( "github.com/snapp-incubator/soteria/internal/topics" "github.com/snapp-incubator/soteria/pkg/acl" "github.com/snapp-incubator/soteria/pkg/validator" + "go.opentelemetry.io/otel/trace" "go.uber.org/zap" ) @@ -24,6 +25,7 @@ type Builder struct { Vendors []config.Vendor Logger *zap.Logger ValidatorConfig config.Validator + Tracer trace.Tracer } func (b Builder) Authenticators() (map[string]Authenticator, error) { @@ -144,6 +146,7 @@ func (b Builder) autoAuthenticator(vendor config.Vendor) (*AutoAuthenticator, er vendor.IssPeerMap, b.Logger.Named("topic-manager"), ), + Tracer: b.Tracer, JWTConfig: vendor.Jwt, Validator: client, Parser: jwt.NewParser(), From 80534088e92ba104ae8f357091eb7f5cdf578add Mon Sep 17 00:00:00 2001 From: Parham Alvani Date: Sat, 22 Jun 2024 14:11:14 +0000 Subject: [PATCH 600/660] fix: use noop tracer for tests --- internal/authenticator/builder_test.go | 10 ++++++++++ internal/cmd/serve/main.go | 1 + 2 files changed, 11 insertions(+) diff --git a/internal/authenticator/builder_test.go b/internal/authenticator/builder_test.go index 25b13471..b5227b7f 100644 --- a/internal/authenticator/builder_test.go +++ b/internal/authenticator/builder_test.go @@ -7,6 +7,7 @@ import ( "github.com/snapp-incubator/soteria/internal/config" "github.com/snapp-incubator/soteria/internal/topics" "github.com/stretchr/testify/require" + "go.opentelemetry.io/otel/trace/noop" "go.uber.org/zap" ) @@ -18,6 +19,7 @@ func TestBuilderWithoutAuthenticator(t *testing.T) { b := authenticator.Builder{ Vendors: []config.Vendor{}, Logger: zap.NewNop(), + Tracer: noop.NewTracerProvider().Tracer(""), ValidatorConfig: config.Validator{ URL: "", Timeout: 0, @@ -34,6 +36,7 @@ func TestBuilderInvalidAuthenticator(t *testing.T) { require := require.New(t) b := authenticator.Builder{ + Tracer: noop.NewTracerProvider().Tracer(""), Vendors: []config.Vendor{ { Company: "internal", @@ -70,6 +73,7 @@ func TestBuilderInternalAuthenticator(t *testing.T) { require := require.New(t) b := authenticator.Builder{ + Tracer: noop.NewTracerProvider().Tracer(""), Vendors: []config.Vendor{ { Company: "internal", @@ -108,6 +112,7 @@ func TestBuilderInternalAuthenticatorWithInvalidKey(t *testing.T) { require := require.New(t) b := authenticator.Builder{ + Tracer: noop.NewTracerProvider().Tracer(""), Vendors: []config.Vendor{ { Company: "admin", @@ -144,6 +149,7 @@ func TestBuilderManualAuthenticatorWithoutKey(t *testing.T) { require := require.New(t) b := authenticator.Builder{ + Tracer: noop.NewTracerProvider().Tracer(""), Vendors: []config.Vendor{ { Company: "snapp", @@ -198,6 +204,7 @@ func TestBuilderManualAuthenticator(t *testing.T) { require := require.New(t) b := authenticator.Builder{ + Tracer: noop.NewTracerProvider().Tracer(""), Vendors: []config.Vendor{ { Company: "snapp", @@ -274,6 +281,7 @@ func TestBuilderManualAuthenticatorInvalidMapping_1(t *testing.T) { require := require.New(t) b := authenticator.Builder{ + Tracer: noop.NewTracerProvider().Tracer(""), Vendors: []config.Vendor{ { Company: "snapp", @@ -344,6 +352,7 @@ func TestBuilderManualAuthenticatorInvalidMapping_2(t *testing.T) { require := require.New(t) b := authenticator.Builder{ + Tracer: noop.NewTracerProvider().Tracer(""), Vendors: []config.Vendor{ { Company: "snapp", @@ -417,6 +426,7 @@ func TestBuilderManualAuthenticatorInvalidAccess(t *testing.T) { require := require.New(t) b := authenticator.Builder{ + Tracer: noop.NewTracerProvider().Tracer(""), Vendors: []config.Vendor{ { Company: "snapp", diff --git a/internal/cmd/serve/main.go b/internal/cmd/serve/main.go index 73583520..4729d9ff 100644 --- a/internal/cmd/serve/main.go +++ b/internal/cmd/serve/main.go @@ -26,6 +26,7 @@ func (s Serve) main() { Vendors: s.Cfg.Vendors, Logger: s.Logger, ValidatorConfig: s.Cfg.Validator, + Tracer: s.Tracer, }.Authenticators() if err != nil { s.Logger.Fatal("authenticator building failed", zap.Error(err)) From c2d04989aea24e1eecd47174166eb34e12334f85 Mon Sep 17 00:00:00 2001 From: Parham Alvani Date: Sat, 22 Jun 2024 14:13:22 +0000 Subject: [PATCH 601/660] fix: use noop tracer for tests --- internal/authenticator/auto_authenticator_test.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/internal/authenticator/auto_authenticator_test.go b/internal/authenticator/auto_authenticator_test.go index e6087ee8..d76d9d3c 100644 --- a/internal/authenticator/auto_authenticator_test.go +++ b/internal/authenticator/auto_authenticator_test.go @@ -17,6 +17,7 @@ import ( "github.com/snapp-incubator/soteria/pkg/validator" "github.com/stretchr/testify/require" "github.com/stretchr/testify/suite" + "go.opentelemetry.io/otel/trace/noop" "go.uber.org/zap" ) @@ -37,6 +38,7 @@ func TestAutoAuthenticator_suite(t *testing.T) { suite.Run(t, new(AutoAuthenticatorTestSuite)) } +// nolint: funlen func (suite *AutoAuthenticatorTestSuite) SetupSuite() { cfg := config.SnappVendor() @@ -89,6 +91,7 @@ func (suite *AutoAuthenticatorTestSuite) SetupSuite() { suite.Authenticator = authenticator.AutoAuthenticator{ Validator: validator.New(testServer.URL, time.Second), AllowedAccessTypes: []acl.AccessType{acl.Pub, acl.Sub, acl.PubSub}, + Tracer: noop.NewTracerProvider().Tracer(""), Company: "snapp", Parser: jwt.NewParser(), TopicManager: topics.NewTopicManager(cfg.Topics, hid, "snapp", cfg.IssEntityMap, cfg.IssPeerMap, zap.NewNop()), From 15c5e34417bc30614ec9e95a62b52a36c3224590 Mon Sep 17 00:00:00 2001 From: Ahmad Anvari Date: Sat, 22 Jun 2024 19:13:33 +0330 Subject: [PATCH 602/660] fix: codecav issue --- internal/authenticator/metrics.go | 3 --- internal/authenticator/metrics_test.go | 9 +++++++++ 2 files changed, 9 insertions(+), 3 deletions(-) create mode 100644 internal/authenticator/metrics_test.go diff --git a/internal/authenticator/metrics.go b/internal/authenticator/metrics.go index d21f44c4..0ce11f3b 100644 --- a/internal/authenticator/metrics.go +++ b/internal/authenticator/metrics.go @@ -15,7 +15,6 @@ var AuthenticateCounterMetric = promauto.NewCounterVec(prometheus.CounterOpts{ Help: "Total number of authentication attempts", }, []string{"company", "status"}) -// GCOVR_EXCL_START // nolint:cyclop func IncrementWithErrorAuthCounter(company string, err error) { var ( @@ -55,5 +54,3 @@ func IncrementWithErrorAuthCounter(company string, err error) { AuthenticateCounterMetric.WithLabelValues(company, status).Inc() } - -// GCOVR_EXCL_STOP diff --git a/internal/authenticator/metrics_test.go b/internal/authenticator/metrics_test.go new file mode 100644 index 00000000..cba3b038 --- /dev/null +++ b/internal/authenticator/metrics_test.go @@ -0,0 +1,9 @@ +package authenticator + +import ( + "testing" +) + +func TestIncrementWithErrorAuthCounter(t *testing.T) { + IncrementWithErrorAuthCounter("snapp", ErrIssNotFound) +} From d565001eb4d1d670fe1d440515a183148df3ec84 Mon Sep 17 00:00:00 2001 From: Ahmad Anvari Date: Sat, 22 Jun 2024 19:15:30 +0330 Subject: [PATCH 603/660] fix: lint issue --- internal/authenticator/metrics_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/authenticator/metrics_test.go b/internal/authenticator/metrics_test.go index cba3b038..9cebd26c 100644 --- a/internal/authenticator/metrics_test.go +++ b/internal/authenticator/metrics_test.go @@ -4,6 +4,6 @@ import ( "testing" ) -func TestIncrementWithErrorAuthCounter(t *testing.T) { +func TestIncrementWithErrorAuthCounter(_ *testing.T) { IncrementWithErrorAuthCounter("snapp", ErrIssNotFound) } From 1170a40a6510d44ef667b625a50fc09843e81b6e Mon Sep 17 00:00:00 2001 From: Ahmad Anvari Date: Sat, 22 Jun 2024 19:17:54 +0330 Subject: [PATCH 604/660] fix: lint issue --- internal/authenticator/metrics_test.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/internal/authenticator/metrics_test.go b/internal/authenticator/metrics_test.go index 9cebd26c..7cca838a 100644 --- a/internal/authenticator/metrics_test.go +++ b/internal/authenticator/metrics_test.go @@ -1,9 +1,11 @@ +//nolint:testpackage package authenticator import ( "testing" ) +//nolint:paralleltest func TestIncrementWithErrorAuthCounter(_ *testing.T) { IncrementWithErrorAuthCounter("snapp", ErrIssNotFound) } From 0bd103dcfef6bd2438f7b1d2e0414c1e0c7fc93c Mon Sep 17 00:00:00 2001 From: Ahmad Anvari Date: Sat, 22 Jun 2024 19:28:34 +0330 Subject: [PATCH 605/660] fix: code coverage --- internal/authenticator/metrics_test.go | 69 +++++++++++++++++++++++++- 1 file changed, 68 insertions(+), 1 deletion(-) diff --git a/internal/authenticator/metrics_test.go b/internal/authenticator/metrics_test.go index 7cca838a..08687c95 100644 --- a/internal/authenticator/metrics_test.go +++ b/internal/authenticator/metrics_test.go @@ -2,10 +2,77 @@ package authenticator import ( + "errors" "testing" ) //nolint:paralleltest -func TestIncrementWithErrorAuthCounter(_ *testing.T) { +func TestIncrementWithErrorAuthCounter_NoError(_ *testing.T) { + IncrementWithErrorAuthCounter("snapp", nil) +} + +//nolint:paralleltest +func TestIncrementWithErrorAuthCounter_ErrInvalidSigningMethod(_ *testing.T) { + IncrementWithErrorAuthCounter("snapp", ErrInvalidSigningMethod) +} + +//nolint:paralleltest +func TestIncrementWithErrorAuthCounter_ErrIssNotFound(_ *testing.T) { IncrementWithErrorAuthCounter("snapp", ErrIssNotFound) } + +//nolint:paralleltest +func TestIncrementWithErrorAuthCounter_ErrSubNotFound(_ *testing.T) { + IncrementWithErrorAuthCounter("snapp", ErrSubNotFound) +} + +//nolint:paralleltest +func TestIncrementWithErrorAuthCounter_ErrInvalidClaims(_ *testing.T) { + IncrementWithErrorAuthCounter("snapp", ErrInvalidClaims) +} + +//nolint:paralleltest +func TestIncrementWithErrorAuthCounter_ErrInvalidIP(_ *testing.T) { + IncrementWithErrorAuthCounter("snapp", ErrInvalidIP) +} + +//nolint:paralleltest +func TestIncrementWithErrorAuthCounter_ErrInvalidAccessType(_ *testing.T) { + IncrementWithErrorAuthCounter("snapp", ErrInvalidAccessType) +} + +//nolint:paralleltest +func TestIncrementWithErrorAuthCounter_ErrDecodeHashID(_ *testing.T) { + IncrementWithErrorAuthCounter("snapp", ErrDecodeHashID) +} + +//nolint:paralleltest +func TestIncrementWithErrorAuthCounter_ErrInvalidSecret(_ *testing.T) { + IncrementWithErrorAuthCounter("snapp", ErrInvalidSecret) +} + +//nolint:paralleltest +func TestIncrementWithErrorAuthCounter_ErrIncorrectPassword(_ *testing.T) { + IncrementWithErrorAuthCounter("snapp", ErrIncorrectPassword) +} + +//nolint:paralleltest +func TestIncrementWithErrorAuthCounter_ErrTopicNotAllowed(_ *testing.T) { + IncrementWithErrorAuthCounter("snapp", &TopicNotAllowedError{ + Issuer: "issuer", + Sub: "subject", + AccessType: "1", + Topic: "topic", + TopicType: "pub", + }) +} + +//nolint:paralleltest +func TestIncrementWithErrorAuthCounter_ErrKeyNotFound(_ *testing.T) { + IncrementWithErrorAuthCounter("snapp", &KeyNotFoundError{Issuer: "iss"}) +} + +//nolint:paralleltest +func TestIncrementWithErrorAuthCounter_UnknowError(_ *testing.T) { + IncrementWithErrorAuthCounter("snapp", errors.ErrUnsupported) +} From 54363fcc86467c92f1f7ff55cdea518cf3fb4373 Mon Sep 17 00:00:00 2001 From: Ahmad Anvari Date: Sat, 22 Jun 2024 19:33:45 +0330 Subject: [PATCH 606/660] feat: use in auth v1 --- internal/api/auth.go | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/internal/api/auth.go b/internal/api/auth.go index f3232318..34f6e1cb 100644 --- a/internal/api/auth.go +++ b/internal/api/auth.go @@ -38,22 +38,24 @@ func (a API) Authv1(c *fiber.Ctx) error { Warn("bad request", zap.Error(err), ) + authenticator.IncrementWithErrorAuthCounter("unknown_company_before_parse_body", err) return c.Status(http.StatusBadRequest).SendString("bad request") } vendor, token := ExtractVendorToken(request.Token, request.Username, request.Password) - authenticator := a.Authenticator(vendor) + auth := a.Authenticator(vendor) span.SetAttributes( attribute.String("token", request.Token), attribute.String("username", request.Username), attribute.String("password", request.Password), - attribute.String("authenticator", authenticator.GetCompany()), + attribute.String("authenticator", auth.GetCompany()), ) - if err := authenticator.Auth(token); err != nil { + err := auth.Auth(token) + if err != nil { span.RecordError(err) if !errors.Is(err, jwt.ErrTokenExpired) { @@ -63,7 +65,7 @@ func (a API) Authv1(c *fiber.Ctx) error { zap.String("token", request.Token), zap.String("username", request.Username), zap.String("password", request.Password), - zap.String("authenticator", authenticator.GetCompany()), + zap.String("authenticator", auth.GetCompany()), ) } @@ -75,8 +77,9 @@ func (a API) Authv1(c *fiber.Ctx) error { zap.String("token", request.Token), zap.String("username", request.Username), zap.String("password", request.Password), - zap.String("authenticator", authenticator.GetCompany()), + zap.String("authenticator", auth.GetCompany()), ) + authenticator.IncrementWithErrorAuthCounter(vendor, err) return c.Status(http.StatusOK).SendString("ok") } From 94833633664a5248de65b5c0ba116e82006f2667 Mon Sep 17 00:00:00 2001 From: Ahmad Anvari Date: Sat, 22 Jun 2024 19:46:24 +0330 Subject: [PATCH 607/660] feat: add metrics to acl request --- internal/api/acl.go | 8 ++++++++ internal/api/auth.go | 5 ++++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/internal/api/acl.go b/internal/api/acl.go index b3b68708..222bc177 100644 --- a/internal/api/acl.go +++ b/internal/api/acl.go @@ -42,6 +42,7 @@ func (a API) ACLv1(c *fiber.Ctx) error { zap.String("username", request.Username), zap.String("password", request.Password), ) + authenticator.IncrementWithErrorAuthCounter("unknown_company_before_parse_body", err) return c.Status(http.StatusBadRequest).SendString("bad request") } @@ -66,6 +67,8 @@ func (a API) ACLv1(c *fiber.Ctx) error { span.RecordError(err) } + authenticator.IncrementWithErrorAuthCounter(vendor, err) + var tnaErr authenticator.TopicNotAllowedError if errors.As(err, &tnaErr) { @@ -102,6 +105,7 @@ func (a API) ACLv1(c *fiber.Ctx) error { zap.String("password", request.Password), zap.String("authenticator", auth.GetCompany()), ) + authenticator.IncrementWithErrorAuthCounter(vendor, err) return c.Status(http.StatusOK).SendString("ok") } @@ -133,6 +137,7 @@ func (a API) ACLv2(c *fiber.Ctx) error { zap.String("username", request.Username), zap.String("password", request.Password), ) + authenticator.IncrementWithErrorAuthCounter("unknown_company_before_parse_body", err) return c.Status(http.StatusOK).JSON(ACLResponse{ Result: "deny", @@ -168,6 +173,8 @@ func (a API) ACLv2(c *fiber.Ctx) error { span.RecordError(err) } + authenticator.IncrementWithErrorAuthCounter(vendor, err) + var tnaErr authenticator.TopicNotAllowedError if errors.As(err, &tnaErr) { @@ -206,6 +213,7 @@ func (a API) ACLv2(c *fiber.Ctx) error { zap.String("password", request.Password), zap.String("authenticator", auth.GetCompany()), ) + authenticator.IncrementWithErrorAuthCounter(vendor, err) return c.Status(http.StatusOK).JSON(ACLResponse{ Result: "allow", diff --git a/internal/api/auth.go b/internal/api/auth.go index 34f6e1cb..e5bdebe5 100644 --- a/internal/api/auth.go +++ b/internal/api/auth.go @@ -6,9 +6,10 @@ import ( "github.com/gofiber/fiber/v2" "github.com/golang-jwt/jwt/v5" - "github.com/snapp-incubator/soteria/internal/authenticator" "go.opentelemetry.io/otel/attribute" "go.uber.org/zap" + + "github.com/snapp-incubator/soteria/internal/authenticator" ) // AuthRequest is the body payload structure of the auth endpoint. @@ -56,6 +57,7 @@ func (a API) Authv1(c *fiber.Ctx) error { err := auth.Auth(token) if err != nil { + authenticator.IncrementWithErrorAuthCounter(vendor, err) span.RecordError(err) if !errors.Is(err, jwt.ErrTokenExpired) { @@ -123,6 +125,7 @@ func (a API) Authv2(c *fiber.Ctx) error { err := auth.Auth(token) if err != nil { span.RecordError(err) + authenticator.IncrementWithErrorAuthCounter(vendor, err) if !errors.Is(err, jwt.ErrTokenExpired) { a.Logger. From 2c8f390f4641869f93866d5408758b3bd5e66575 Mon Sep 17 00:00:00 2001 From: Ahmad Anvari Date: Sat, 22 Jun 2024 19:49:27 +0330 Subject: [PATCH 608/660] fix: gci the file --- internal/api/auth.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/internal/api/auth.go b/internal/api/auth.go index e5bdebe5..3bd75798 100644 --- a/internal/api/auth.go +++ b/internal/api/auth.go @@ -6,10 +6,9 @@ import ( "github.com/gofiber/fiber/v2" "github.com/golang-jwt/jwt/v5" + "github.com/snapp-incubator/soteria/internal/authenticator" "go.opentelemetry.io/otel/attribute" "go.uber.org/zap" - - "github.com/snapp-incubator/soteria/internal/authenticator" ) // AuthRequest is the body payload structure of the auth endpoint. From 3434202e1122721fd813a80510d9a560aca9fa49 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 24 Jun 2024 01:49:50 +0000 Subject: [PATCH 609/660] chore(deps): bump docker/bake-action from 4 to 5 Bumps [docker/bake-action](https://github.com/docker/bake-action) from 4 to 5. - [Release notes](https://github.com/docker/bake-action/releases) - [Commits](https://github.com/docker/bake-action/compare/v4...v5) --- updated-dependencies: - dependency-name: docker/bake-action dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- .github/workflows/test.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index f4fde892..4e1ca3ac 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -47,14 +47,14 @@ jobs: registry: ghcr.io username: ${{ github.repository_owner }} password: ${{ secrets.GITHUB_TOKEN }} - - uses: docker/bake-action@v4 + - uses: docker/bake-action@v5 if: ${{ startsWith(github.ref, 'refs/tags/v') }} env: TAG: ${{ github.ref_name }} with: push: true files: 'build/package/docker-bake.json' - - uses: docker/bake-action@v4 + - uses: docker/bake-action@v5 if: ${{ !startsWith(github.ref, 'refs/tags/v') }} with: push: true From b6d4e8aee92cba92c5b01784e90415f0cd3f8261 Mon Sep 17 00:00:00 2001 From: Parham Alvani Date: Sat, 29 Jun 2024 20:06:55 +0000 Subject: [PATCH 610/660] feat: update packages --- go.mod | 9 +++++---- go.sum | 8 ++++++++ 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/go.mod b/go.mod index ad475ae4..c9acc9d2 100644 --- a/go.mod +++ b/go.mod @@ -9,6 +9,7 @@ require ( github.com/golang-jwt/jwt/v5 v5.2.1 github.com/knadh/koanf v1.5.0 github.com/knadh/koanf/v2 v2.1.1 + github.com/prometheus/client_golang v1.19.1 github.com/speps/go-hashids/v2 v2.0.1 github.com/spf13/cobra v1.8.1 github.com/stretchr/testify v1.9.0 @@ -42,10 +43,10 @@ require ( github.com/mattn/go-runewidth v0.0.15 // indirect github.com/mitchellh/copystructure v1.2.0 // indirect github.com/mitchellh/reflectwalk v1.0.2 // indirect + github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect - github.com/prometheus/client_golang v1.19.1 // indirect github.com/prometheus/client_model v0.6.1 // indirect - github.com/prometheus/common v0.54.0 // indirect + github.com/prometheus/common v0.55.0 // indirect github.com/prometheus/procfs v0.15.1 // indirect github.com/rivo/uniseg v0.4.7 // indirect github.com/spf13/pflag v1.0.5 // indirect @@ -59,8 +60,8 @@ require ( golang.org/x/net v0.26.0 // indirect golang.org/x/sys v0.21.0 // indirect golang.org/x/text v0.16.0 // indirect - google.golang.org/genproto/googleapis/api v0.0.0-20240617180043-68d350f18fd4 // indirect - google.golang.org/genproto/googleapis/rpc v0.0.0-20240617180043-68d350f18fd4 // 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 google.golang.org/grpc v1.64.0 // indirect google.golang.org/protobuf v1.34.2 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect diff --git a/go.sum b/go.sum index ca2dccc3..8cef45ee 100644 --- a/go.sum +++ b/go.sum @@ -230,6 +230,8 @@ github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJ github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= +github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 h1:C3w9PqII01/Oq1c1nUAm88MOHcQC9l5mIlSMApZMrHA= +github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ= github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= github.com/npillmayer/nestext v0.1.3/go.mod h1:h2lrijH8jpicr25dFY+oAJLyzlya6jhnuG+zWp9L0Uk= @@ -266,6 +268,8 @@ github.com/prometheus/common v0.53.0 h1:U2pL9w9nmJwJDa4qqLQ3ZaePJ6ZTwt7cMD3AG3+a github.com/prometheus/common v0.53.0/go.mod h1:BrxBKv3FWBIGXw89Mg1AeBq7FSyRzXWI3l3e7W3RN5U= github.com/prometheus/common v0.54.0 h1:ZlZy0BgJhTwVZUn7dLOkwCZHUkrAqd3WYtcFCWnM1D8= github.com/prometheus/common v0.54.0/go.mod h1:/TQgMJP5CuVYveyT7n/0Ix8yLNNXy9yRSkhnLTHPDIQ= +github.com/prometheus/common v0.55.0 h1:KEi6DK7lXW/m7Ig5i47x0vRzuBsHuvJdi5ee6Y3G1dc= +github.com/prometheus/common v0.55.0/go.mod h1:2SECS4xJG1kd8XF9IcM1gMX6510RAEL65zxzNImwdc8= github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= github.com/prometheus/procfs v0.1.3/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU= @@ -469,10 +473,14 @@ google.golang.org/genproto/googleapis/api v0.0.0-20240521202816-d264139d666e h1: google.golang.org/genproto/googleapis/api v0.0.0-20240521202816-d264139d666e/go.mod h1:LweJcLbyVij6rCex8YunD8DYR5VDonap/jYl3ZRxcIU= google.golang.org/genproto/googleapis/api v0.0.0-20240617180043-68d350f18fd4 h1:MuYw1wJzT+ZkybKfaOXKp5hJiZDn2iHaXRw0mRYdHSc= google.golang.org/genproto/googleapis/api v0.0.0-20240617180043-68d350f18fd4/go.mod h1:px9SlOOZBg1wM1zdnr8jEL4CNGUBZ+ZKYtNPApNQc4c= +google.golang.org/genproto/googleapis/api v0.0.0-20240624140628-dc46fd24d27d h1:Aqf0fiIdUQEj0Gn9mKFFXoQfTTEaNopWpfVyYADxiSg= +google.golang.org/genproto/googleapis/api v0.0.0-20240624140628-dc46fd24d27d/go.mod h1:Od4k8V1LQSizPRUK4OzZ7TBE/20k+jPczUDAEyvn69Y= google.golang.org/genproto/googleapis/rpc v0.0.0-20240521202816-d264139d666e h1:Elxv5MwEkCI9f5SkoL6afed6NTdxaGoAo39eANBwHL8= google.golang.org/genproto/googleapis/rpc v0.0.0-20240521202816-d264139d666e/go.mod h1:EfXuqaE1J41VCDicxHzUDm+8rk+7ZdXzHV0IhO/I6s0= google.golang.org/genproto/googleapis/rpc v0.0.0-20240617180043-68d350f18fd4 h1:Di6ANFilr+S60a4S61ZM00vLdw0IrQOSMS2/6mrnOU0= google.golang.org/genproto/googleapis/rpc v0.0.0-20240617180043-68d350f18fd4/go.mod h1:Ue6ibwXGpU+dqIcODieyLOcgj7z8+IcskoNIgZxtrFY= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240624140628-dc46fd24d27d h1:k3zyW3BYYR30e8v3x0bTDdE9vpYFjZHK+HcyqkrppWk= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240624140628-dc46fd24d27d/go.mod h1:Ue6ibwXGpU+dqIcODieyLOcgj7z8+IcskoNIgZxtrFY= google.golang.org/grpc v1.14.0/go.mod h1:yo6s7OP7yaDglbqo1J04qKzAhqBH6lvTonzMVmEdcZw= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= google.golang.org/grpc v1.22.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= From fa49ed2314bac87c1b430e9538a2e91652c7c653 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 1 Jul 2024 01:52:46 +0000 Subject: [PATCH 611/660] chore(deps): bump github.com/gofiber/fiber/v2 from 2.52.4 to 2.52.5 Bumps [github.com/gofiber/fiber/v2](https://github.com/gofiber/fiber) from 2.52.4 to 2.52.5. - [Release notes](https://github.com/gofiber/fiber/releases) - [Commits](https://github.com/gofiber/fiber/compare/v2.52.4...v2.52.5) --- updated-dependencies: - dependency-name: github.com/gofiber/fiber/v2 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- go.mod | 2 +- go.sum | 36 ++---------------------------------- 2 files changed, 3 insertions(+), 35 deletions(-) diff --git a/go.mod b/go.mod index c9acc9d2..a2e7d6c4 100644 --- a/go.mod +++ b/go.mod @@ -5,7 +5,7 @@ go 1.22 require ( github.com/ansrivas/fiberprometheus/v2 v2.6.1 github.com/gofiber/contrib/fiberzap v1.0.2 - github.com/gofiber/fiber/v2 v2.52.4 + github.com/gofiber/fiber/v2 v2.52.5 github.com/golang-jwt/jwt/v5 v5.2.1 github.com/knadh/koanf v1.5.0 github.com/knadh/koanf/v2 v2.1.1 diff --git a/go.sum b/go.sum index 8cef45ee..6659bc54 100644 --- a/go.sum +++ b/go.sum @@ -73,8 +73,6 @@ github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag= github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE= github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= github.com/go-test/deep v1.0.2-0.20181118220953-042da051cf31/go.mod h1:wGDj63lr65AM2AQyKZd/NYHGb0R+1RLqB8NKt3aSFNA= -github.com/go-viper/mapstructure/v2 v2.0.0-alpha.1 h1:TQcrn6Wq+sKGkpyPvppOz99zsMBaUOKXq6HSv655U1c= -github.com/go-viper/mapstructure/v2 v2.0.0-alpha.1/go.mod h1:oJDH3BJKyqBA2TXFhDsKDGDTlndYOZ6rGS0BRZIxGhM= github.com/go-viper/mapstructure/v2 v2.0.0 h1:dhn8MZ1gZ0mzeodTG3jt5Vj/o87xZKuNAprG2mQfMfc= github.com/go-viper/mapstructure/v2 v2.0.0/go.mod h1:oJDH3BJKyqBA2TXFhDsKDGDTlndYOZ6rGS0BRZIxGhM= github.com/godbus/dbus/v5 v5.0.4/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA= @@ -82,8 +80,8 @@ github.com/gofiber/adaptor/v2 v2.2.1 h1:givE7iViQWlsTR4Jh7tB4iXzrlKBgiraB/yTdHs9 github.com/gofiber/adaptor/v2 v2.2.1/go.mod h1:AhR16dEqs25W2FY/l8gSj1b51Azg5dtPDmm+pruNOrc= github.com/gofiber/contrib/fiberzap v1.0.2 h1:EQwhggtszVfIdBeXxN9Xrmld71es34Ufs+ef8VMqZxc= github.com/gofiber/contrib/fiberzap v1.0.2/go.mod h1:jGO8BHU4gRI9U0JtM6zj2CIhYfgVmW5JxziN8NTgVwE= -github.com/gofiber/fiber/v2 v2.52.4 h1:P+T+4iK7VaqUsq2PALYEfBBo6bJZ4q3FP8cZ84EggTM= -github.com/gofiber/fiber/v2 v2.52.4/go.mod h1:KEOE+cXMhXG0zHc9d8+E38hoX+ZN7bhOtgeF2oT6jrQ= +github.com/gofiber/fiber/v2 v2.52.5 h1:tWoP1MJQjGEe4GB5TUGOi7P2E0ZMMRx5ZTG4rT+yGMo= +github.com/gofiber/fiber/v2 v2.52.5/go.mod h1:KEOE+cXMhXG0zHc9d8+E38hoX+ZN7bhOtgeF2oT6jrQ= github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q= github.com/golang-jwt/jwt/v5 v5.2.1 h1:OuVbFODueb089Lh128TAcimifWaLhJwVflnrgM17wHk= @@ -122,7 +120,6 @@ github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+ 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/grpc-ecosystem/go-grpc-prometheus v1.2.0/go.mod h1:8NvIoxWQoOIhqOTXgfV/d3M/q6VIi02HzZEHgUlZvzk= -github.com/grpc-ecosystem/grpc-gateway v1.16.0 h1:gmcG1KaJ57LophUzW0Hy8NmPhnMZb4M0+kPpLofRdBo= github.com/grpc-ecosystem/grpc-gateway v1.16.0/go.mod h1:BDjrQk3hbvj6Nolgz8mAMFbcEtjT1g+wF4CSlocrBnw= github.com/grpc-ecosystem/grpc-gateway/v2 v2.20.0 h1:bkypFPDjIYGfCYD5mRBvpqxfYX1YCS1PXdKYWi8FsN0= github.com/grpc-ecosystem/grpc-gateway/v2 v2.20.0/go.mod h1:P+Lt/0by1T8bfcF3z737NnSbmxQAppXMRziHUxPOC8k= @@ -173,13 +170,10 @@ github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7V github.com/julienschmidt/httprouter v1.3.0/go.mod h1:JR6WtHb+2LUe8TCKY3cZOxFyyO8IZAc4RVcycCCAKdM= github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8= github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= -github.com/klauspost/compress v1.17.8 h1:YcnTYrq7MikUT7k0Yb5eceMmALQPYBW/Xltxn0NAMnU= -github.com/klauspost/compress v1.17.8/go.mod h1:Di0epgTjJY877eYKx5yC51cX2A2Vl2ibi7bDH9ttBbw= github.com/klauspost/compress v1.17.9 h1:6KIumPrER1LHsvBVuDa0r5xaG0Es51mhhB9BQB2qeMA= github.com/klauspost/compress v1.17.9/go.mod h1:Di0epgTjJY877eYKx5yC51cX2A2Vl2ibi7bDH9ttBbw= github.com/knadh/koanf v1.5.0 h1:q2TSd/3Pyc/5yP9ldIrSdIz26MCcyNQzW0pEAugLPNs= github.com/knadh/koanf v1.5.0/go.mod h1:Hgyjp4y8v44hpZtPzs7JZfRAW5AhN7KfZcwv1RYggDs= -github.com/knadh/koanf/maps v0.1.1 h1:G5TjmUh2D7G2YWf5SQQqSiHRJEjaicvU0KpypqB3NIs= github.com/knadh/koanf/v2 v2.1.1 h1:/R8eXqasSTsmDCsAyYj+81Wteg8AqrV9CP6gvsTsOmM= github.com/knadh/koanf/v2 v2.1.1/go.mod h1:4mnTRbZCK+ALuBXHZMjDfG9y714L7TykVnZkXbMU3Es= github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= @@ -264,18 +258,12 @@ github.com/prometheus/client_model v0.6.1/go.mod h1:OrxVMOVHjw3lKMa8+x6HeMGkHMQy github.com/prometheus/common v0.4.1/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= github.com/prometheus/common v0.10.0/go.mod h1:Tlit/dnDKsSWFlCLTWaA1cyBgKHSMdTB80sz/V91rCo= github.com/prometheus/common v0.26.0/go.mod h1:M7rCNAaPfAosfx8veZJCuw84e35h3Cfd9VFqTh1DIvc= -github.com/prometheus/common v0.53.0 h1:U2pL9w9nmJwJDa4qqLQ3ZaePJ6ZTwt7cMD3AG3+aLCE= -github.com/prometheus/common v0.53.0/go.mod h1:BrxBKv3FWBIGXw89Mg1AeBq7FSyRzXWI3l3e7W3RN5U= -github.com/prometheus/common v0.54.0 h1:ZlZy0BgJhTwVZUn7dLOkwCZHUkrAqd3WYtcFCWnM1D8= -github.com/prometheus/common v0.54.0/go.mod h1:/TQgMJP5CuVYveyT7n/0Ix8yLNNXy9yRSkhnLTHPDIQ= github.com/prometheus/common v0.55.0 h1:KEi6DK7lXW/m7Ig5i47x0vRzuBsHuvJdi5ee6Y3G1dc= github.com/prometheus/common v0.55.0/go.mod h1:2SECS4xJG1kd8XF9IcM1gMX6510RAEL65zxzNImwdc8= github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= github.com/prometheus/procfs v0.1.3/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU= github.com/prometheus/procfs v0.6.0/go.mod h1:cz+aTbrPOrUb4q7XlbU9ygM+/jj0fzG6c1xBZuNvfVA= -github.com/prometheus/procfs v0.15.0 h1:A82kmvXJq2jTu5YUhSGNlYoxh85zLnKgPz4bMZgI5Ek= -github.com/prometheus/procfs v0.15.0/go.mod h1:Y0RJ/Y5g5wJpkTisOtqwDSo4HwhGmLB4VQSw2sQJLHk= github.com/prometheus/procfs v0.15.1 h1:YagwOFzUgYfKKHX6Dr+sHT7km/hxC76UB0learggepc= github.com/prometheus/procfs v0.15.1/go.mod h1:fB45yRUv8NstnjriLhBQLuOUt+WW4BsoGhij/e3PBqk= github.com/rhnvrm/simples3 v0.6.1/go.mod h1:Y+3vYm2V7Y4VijFoJHHTrja6OgPrJ2cBti8dPGkC3sA= @@ -312,8 +300,6 @@ github.com/tidwall/pretty v1.2.1 h1:qjsOFOWWQl+N3RsoF5/ssm1pHmJJwhjlSbZ51I6wMl4= github.com/tidwall/pretty v1.2.1/go.mod h1:ITEVvHYasfjBbM0u2Pg8T2nJnzm8xPwvNhhsoaGGjNU= github.com/valyala/bytebufferpool v1.0.0 h1:GqA5TC/0021Y/b9FG4Oi9Mr3q7XYx6KllzawFIhcdPw= github.com/valyala/bytebufferpool v1.0.0/go.mod h1:6bBcMArwyJ5K/AmCkWv1jt77kVWyCJ6HpOuEn7z0Csc= -github.com/valyala/fasthttp v1.54.0 h1:cCL+ZZR3z3HPLMVfEYVUMtJqVaui0+gu7Lx63unHwS0= -github.com/valyala/fasthttp v1.54.0/go.mod h1:6dt4/8olwq9QARP/TDuPmWyWcl4byhpvTJ4AAtcz+QM= github.com/valyala/fasthttp v1.55.0 h1:Zkefzgt6a7+bVKHnu/YaYSOPfNYNisSVBo/unVCf8k8= github.com/valyala/fasthttp v1.55.0/go.mod h1:NkY9JtkrpPKmgwV3HTaS2HWaJss9RSIsRVfcxxoHiOM= github.com/valyala/tcplisten v1.0.0 h1:rBHj/Xf+E1tRGZyWIWwJDiRY0zc1Js+CV5DqwacVSA8= @@ -336,8 +322,6 @@ go.opentelemetry.io/otel/sdk v1.27.0 h1:mlk+/Y1gLPLn84U4tI8d3GNJmGT/eXe3ZuOXN9kT go.opentelemetry.io/otel/sdk v1.27.0/go.mod h1:Ha9vbLwJE6W86YstIywK2xFfPjbWlCuwPtMkKdz/Y4A= go.opentelemetry.io/otel/trace v1.27.0 h1:IqYb813p7cmbHk0a5y6pD5JPakbVfftRXABGt5/Rscw= go.opentelemetry.io/otel/trace v1.27.0/go.mod h1:6RiD1hkAprV4/q+yd2ln1HG9GoPx39SuvvstaLBl+l4= -go.opentelemetry.io/proto/otlp v1.2.0 h1:pVeZGk7nXDC9O2hncA6nHldxEjm6LByfA2aN8IOkz94= -go.opentelemetry.io/proto/otlp v1.2.0/go.mod h1:gGpR8txAl5M03pDhMC79G6SdqNV26naRm/KDsgaHD8A= 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/atomic v1.7.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc= @@ -382,8 +366,6 @@ golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwY golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM= golang.org/x/net v0.0.0-20210410081132-afb366fc7cd1/go.mod h1:9tjilg8BloeKEkVJvy7fQ90B1CfIiPueXVOjqfkSzI8= -golang.org/x/net v0.25.0 h1:d/OCCoBEUq33pjydKrGQhw7IlUPI2Oylr+8qLx49kac= -golang.org/x/net v0.25.0/go.mod h1:JkAGAh7GEvH74S6FOH42FLoXpXbE/aqXSrIQjXgsiwM= golang.org/x/net v0.26.0 h1:soB7SVo0PWrY4vPW/+ay0jKDNScG2X9wFeYlXIvJsOQ= golang.org/x/net v0.26.0/go.mod h1:5YKkiSynbBIh3p6iOc/vibscux0x38BZDkn8sCUPxHE= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= @@ -430,8 +412,6 @@ golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20210603081109-ebe580a85c40/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.20.0 h1:Od9JTbYCk261bKm4M/mw7AklTlFYIa0bIp9BgSm1S8Y= -golang.org/x/sys v0.20.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/sys v0.21.0 h1:rF+pYz3DAGSQAxAu1CbC7catZg4ebC4UIeIhKxBZvws= golang.org/x/sys v0.21.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= @@ -441,8 +421,6 @@ golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/text v0.15.0 h1:h1V/4gjBv8v9cjcR6+AR5+/cIYK5N/WAgiv4xlsEtAk= -golang.org/x/text v0.15.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= golang.org/x/text v0.16.0 h1:a94ExnEXNtEwYLGJSIUxnWoxoRz/ZcCsV63ROupILh4= golang.org/x/text v0.16.0/go.mod h1:GhwF1Be+LQoKShO3cGOHzqOgRrGaYc9AvblQOmPVHnI= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= @@ -469,16 +447,8 @@ google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98 google.golang.org/genproto v0.0.0-20200513103714-09dca8ec2884/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo= google.golang.org/genproto v0.0.0-20210602131652-f16073e35f0c/go.mod h1:UODoCrxHCcBojKKwX1terBiRUaqAsFqJiF615XL43r0= -google.golang.org/genproto/googleapis/api v0.0.0-20240521202816-d264139d666e h1:SkdGTrROJl2jRGT/Fxv5QUf9jtdKCQh4KQJXbXVLAi0= -google.golang.org/genproto/googleapis/api v0.0.0-20240521202816-d264139d666e/go.mod h1:LweJcLbyVij6rCex8YunD8DYR5VDonap/jYl3ZRxcIU= -google.golang.org/genproto/googleapis/api v0.0.0-20240617180043-68d350f18fd4 h1:MuYw1wJzT+ZkybKfaOXKp5hJiZDn2iHaXRw0mRYdHSc= -google.golang.org/genproto/googleapis/api v0.0.0-20240617180043-68d350f18fd4/go.mod h1:px9SlOOZBg1wM1zdnr8jEL4CNGUBZ+ZKYtNPApNQc4c= google.golang.org/genproto/googleapis/api v0.0.0-20240624140628-dc46fd24d27d h1:Aqf0fiIdUQEj0Gn9mKFFXoQfTTEaNopWpfVyYADxiSg= google.golang.org/genproto/googleapis/api v0.0.0-20240624140628-dc46fd24d27d/go.mod h1:Od4k8V1LQSizPRUK4OzZ7TBE/20k+jPczUDAEyvn69Y= -google.golang.org/genproto/googleapis/rpc v0.0.0-20240521202816-d264139d666e h1:Elxv5MwEkCI9f5SkoL6afed6NTdxaGoAo39eANBwHL8= -google.golang.org/genproto/googleapis/rpc v0.0.0-20240521202816-d264139d666e/go.mod h1:EfXuqaE1J41VCDicxHzUDm+8rk+7ZdXzHV0IhO/I6s0= -google.golang.org/genproto/googleapis/rpc v0.0.0-20240617180043-68d350f18fd4 h1:Di6ANFilr+S60a4S61ZM00vLdw0IrQOSMS2/6mrnOU0= -google.golang.org/genproto/googleapis/rpc v0.0.0-20240617180043-68d350f18fd4/go.mod h1:Ue6ibwXGpU+dqIcODieyLOcgj7z8+IcskoNIgZxtrFY= google.golang.org/genproto/googleapis/rpc v0.0.0-20240624140628-dc46fd24d27d h1:k3zyW3BYYR30e8v3x0bTDdE9vpYFjZHK+HcyqkrppWk= google.golang.org/genproto/googleapis/rpc v0.0.0-20240624140628-dc46fd24d27d/go.mod h1:Ue6ibwXGpU+dqIcODieyLOcgj7z8+IcskoNIgZxtrFY= google.golang.org/grpc v1.14.0/go.mod h1:yo6s7OP7yaDglbqo1J04qKzAhqBH6lvTonzMVmEdcZw= @@ -502,8 +472,6 @@ google.golang.org/protobuf v1.23.1-0.20200526195155-81db48ad09cc/go.mod h1:EGpAD google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c= google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= -google.golang.org/protobuf v1.34.1 h1:9ddQBjfCyZPOHPUiPxpYESBLc+T8P3E+Vo4IbKZgFWg= -google.golang.org/protobuf v1.34.1/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos= google.golang.org/protobuf v1.34.2 h1:6xV6lTsCfpGD21XK49h7MhtcApnLqkfYgPcdHftf6hg= google.golang.org/protobuf v1.34.2/go.mod h1:qYOHts0dSfpeUzUFpOMr/WGzszTmLH+DiWniOlNbLDw= gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= From d562c3e2730067a8c197b01ed751586dd3f36c19 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 8 Jul 2024 01:39:55 +0000 Subject: [PATCH 612/660] chore(deps): bump go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc Bumps [go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc](https://github.com/open-telemetry/opentelemetry-go) from 1.27.0 to 1.28.0. - [Release notes](https://github.com/open-telemetry/opentelemetry-go/releases) - [Changelog](https://github.com/open-telemetry/opentelemetry-go/blob/main/CHANGELOG.md) - [Commits](https://github.com/open-telemetry/opentelemetry-go/compare/v1.27.0...v1.28.0) --- updated-dependencies: - dependency-name: go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- go.mod | 16 ++++++++-------- go.sum | 32 ++++++++++++++++---------------- 2 files changed, 24 insertions(+), 24 deletions(-) diff --git a/go.mod b/go.mod index a2e7d6c4..cc57eb46 100644 --- a/go.mod +++ b/go.mod @@ -14,10 +14,10 @@ require ( github.com/spf13/cobra v1.8.1 github.com/stretchr/testify v1.9.0 github.com/tidwall/pretty v1.2.1 - go.opentelemetry.io/otel v1.27.0 - go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.27.0 - go.opentelemetry.io/otel/sdk v1.27.0 - go.opentelemetry.io/otel/trace v1.27.0 + go.opentelemetry.io/otel v1.28.0 + go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.28.0 + go.opentelemetry.io/otel/sdk v1.28.0 + go.opentelemetry.io/otel/trace v1.28.0 go.uber.org/automaxprocs v1.5.3 go.uber.org/zap v1.27.0 ) @@ -53,15 +53,15 @@ require ( github.com/valyala/bytebufferpool v1.0.0 // indirect github.com/valyala/fasthttp v1.55.0 // indirect github.com/valyala/tcplisten v1.0.0 // indirect - go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.27.0 // indirect - go.opentelemetry.io/otel/metric v1.27.0 // indirect + go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.28.0 // indirect + go.opentelemetry.io/otel/metric v1.28.0 // indirect go.opentelemetry.io/proto/otlp v1.3.1 // indirect go.uber.org/multierr v1.11.0 // indirect golang.org/x/net v0.26.0 // indirect golang.org/x/sys v0.21.0 // indirect golang.org/x/text v0.16.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 + google.golang.org/genproto/googleapis/api v0.0.0-20240701130421-f6361c86f094 // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20240701130421-f6361c86f094 // indirect google.golang.org/grpc v1.64.0 // indirect google.golang.org/protobuf v1.34.2 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect diff --git a/go.sum b/go.sum index 6659bc54..0a286945 100644 --- a/go.sum +++ b/go.sum @@ -310,18 +310,18 @@ github.com/yuin/goldmark v1.3.5/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1 go.etcd.io/etcd/api/v3 v3.5.4/go.mod h1:5GB2vv4A4AOn3yk7MftYGHkUfGtDHnEraIjym4dYz5A= go.etcd.io/etcd/client/pkg/v3 v3.5.4/go.mod h1:IJHfcCEKxYu1Os13ZdwCwIUTUVGYTSAM3YSwc9/Ac1g= go.etcd.io/etcd/client/v3 v3.5.4/go.mod h1:ZaRkVgBZC+L+dLCjTcF1hRXpgZXQPOvnA/Ak/gq3kiY= -go.opentelemetry.io/otel v1.27.0 h1:9BZoF3yMK/O1AafMiQTVu0YDj5Ea4hPhxCs7sGva+cg= -go.opentelemetry.io/otel v1.27.0/go.mod h1:DMpAK8fzYRzs+bi3rS5REupisuqTheUlSZJ1WnZaPAQ= -go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.27.0 h1:R9DE4kQ4k+YtfLI2ULwX82VtNQ2J8yZmA7ZIF/D+7Mc= -go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.27.0/go.mod h1:OQFyQVrDlbe+R7xrEyDr/2Wr67Ol0hRUgsfA+V5A95s= -go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.27.0 h1:qFffATk0X+HD+f1Z8lswGiOQYKHRlzfmdJm0wEaVrFA= -go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.27.0/go.mod h1:MOiCmryaYtc+V0Ei+Tx9o5S1ZjA7kzLucuVuyzBZloQ= -go.opentelemetry.io/otel/metric v1.27.0 h1:hvj3vdEKyeCi4YaYfNjv2NUje8FqKqUY8IlF0FxV/ik= -go.opentelemetry.io/otel/metric v1.27.0/go.mod h1:mVFgmRlhljgBiuk/MP/oKylr4hs85GZAylncepAX/ak= -go.opentelemetry.io/otel/sdk v1.27.0 h1:mlk+/Y1gLPLn84U4tI8d3GNJmGT/eXe3ZuOXN9kTWmI= -go.opentelemetry.io/otel/sdk v1.27.0/go.mod h1:Ha9vbLwJE6W86YstIywK2xFfPjbWlCuwPtMkKdz/Y4A= -go.opentelemetry.io/otel/trace v1.27.0 h1:IqYb813p7cmbHk0a5y6pD5JPakbVfftRXABGt5/Rscw= -go.opentelemetry.io/otel/trace v1.27.0/go.mod h1:6RiD1hkAprV4/q+yd2ln1HG9GoPx39SuvvstaLBl+l4= +go.opentelemetry.io/otel v1.28.0 h1:/SqNcYk+idO0CxKEUOtKQClMK/MimZihKYMruSMViUo= +go.opentelemetry.io/otel v1.28.0/go.mod h1:q68ijF8Fc8CnMHKyzqL6akLO46ePnjkgfIMIjUIX9z4= +go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.28.0 h1:3Q/xZUyC1BBkualc9ROb4G8qkH90LXEIICcs5zv1OYY= +go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.28.0/go.mod h1:s75jGIWA9OfCMzF0xr+ZgfrB5FEbbV7UuYo32ahUiFI= +go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.28.0 h1:R3X6ZXmNPRR8ul6i3WgFURCHzaXjHdm0karRG/+dj3s= +go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.28.0/go.mod h1:QWFXnDavXWwMx2EEcZsf3yxgEKAqsxQ+Syjp+seyInw= +go.opentelemetry.io/otel/metric v1.28.0 h1:f0HGvSl1KRAU1DLgLGFjrwVyismPlnuU6JD6bOeuA5Q= +go.opentelemetry.io/otel/metric v1.28.0/go.mod h1:Fb1eVBFZmLVTMb6PPohq3TO9IIhUisDsbJoL/+uQW4s= +go.opentelemetry.io/otel/sdk v1.28.0 h1:b9d7hIry8yZsgtbmM0DKyPWMMUMlK9NEKuIG4aBqWyE= +go.opentelemetry.io/otel/sdk v1.28.0/go.mod h1:oYj7ClPUA7Iw3m+r7GeEjz0qckQRJK2B8zjcZEfu7Pg= +go.opentelemetry.io/otel/trace v1.28.0 h1:GhQ9cUuQGmNDd5BTCP2dAvv75RdMxEfTmYejp+lkx9g= +go.opentelemetry.io/otel/trace v1.28.0/go.mod h1:jPyXzNPg6da9+38HEwElrQiHlVMTnVfM3/yv2OlIHaI= 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/atomic v1.7.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc= @@ -447,10 +447,10 @@ google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98 google.golang.org/genproto v0.0.0-20200513103714-09dca8ec2884/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo= google.golang.org/genproto v0.0.0-20210602131652-f16073e35f0c/go.mod h1:UODoCrxHCcBojKKwX1terBiRUaqAsFqJiF615XL43r0= -google.golang.org/genproto/googleapis/api v0.0.0-20240624140628-dc46fd24d27d h1:Aqf0fiIdUQEj0Gn9mKFFXoQfTTEaNopWpfVyYADxiSg= -google.golang.org/genproto/googleapis/api v0.0.0-20240624140628-dc46fd24d27d/go.mod h1:Od4k8V1LQSizPRUK4OzZ7TBE/20k+jPczUDAEyvn69Y= -google.golang.org/genproto/googleapis/rpc v0.0.0-20240624140628-dc46fd24d27d h1:k3zyW3BYYR30e8v3x0bTDdE9vpYFjZHK+HcyqkrppWk= -google.golang.org/genproto/googleapis/rpc v0.0.0-20240624140628-dc46fd24d27d/go.mod h1:Ue6ibwXGpU+dqIcODieyLOcgj7z8+IcskoNIgZxtrFY= +google.golang.org/genproto/googleapis/api v0.0.0-20240701130421-f6361c86f094 h1:0+ozOGcrp+Y8Aq8TLNN2Aliibms5LEzsq99ZZmAGYm0= +google.golang.org/genproto/googleapis/api v0.0.0-20240701130421-f6361c86f094/go.mod h1:fJ/e3If/Q67Mj99hin0hMhiNyCRmt6BQ2aWIJshUSJw= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240701130421-f6361c86f094 h1:BwIjyKYGsK9dMCBOorzRri8MQwmi7mT9rGHsCEinZkA= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240701130421-f6361c86f094/go.mod h1:Ue6ibwXGpU+dqIcODieyLOcgj7z8+IcskoNIgZxtrFY= google.golang.org/grpc v1.14.0/go.mod h1:yo6s7OP7yaDglbqo1J04qKzAhqBH6lvTonzMVmEdcZw= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= google.golang.org/grpc v1.22.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= From a664754674e6edf8f867ec8972c62b646fa362a1 Mon Sep 17 00:00:00 2001 From: Ahmad Anvari Date: Thu, 18 Jul 2024 19:11:22 +0330 Subject: [PATCH 613/660] feat: add target memory utilization --- charts/soteria/values.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/charts/soteria/values.yaml b/charts/soteria/values.yaml index 1a792e97..167fec68 100644 --- a/charts/soteria/values.yaml +++ b/charts/soteria/values.yaml @@ -32,6 +32,7 @@ autoscaling: minReplicas: 3 maxReplicas: 20 targetCPUUtilizationPercentage: 65 + targetMemoryUtilizationPercentage: 80 rollingParams: maxSurge: 5 From 46fcef95971a2434cb64a6f3d586ca81d1f095d8 Mon Sep 17 00:00:00 2001 From: Ahmad Anvari Date: Thu, 18 Jul 2024 19:11:54 +0330 Subject: [PATCH 614/660] fix: remove unwanted fields from the resource --- charts/soteria/templates/hpa.yaml | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/charts/soteria/templates/hpa.yaml b/charts/soteria/templates/hpa.yaml index cb7e6848..51123ec8 100644 --- a/charts/soteria/templates/hpa.yaml +++ b/charts/soteria/templates/hpa.yaml @@ -1,9 +1,8 @@ {{- if .Values.autoscaling.enabled }} -apiVersion: autoscaling/v2beta1 +apiVersion: autoscaling/v2 kind: HorizontalPodAutoscaler metadata: name: {{ include "soteria.fullname" . }} - namespace: {{ $.Release.Namespace }} labels: {{- include "soteria.labels" . | nindent 4 }} spec: @@ -11,7 +10,6 @@ spec: apiVersion: apps/v1 kind: Deployment name: {{ include "soteria.fullname" . }} - namespace: {{ $.Release.Namespace }} minReplicas: {{ .Values.autoscaling.minReplicas }} maxReplicas: {{ .Values.autoscaling.maxReplicas }} metrics: @@ -19,6 +17,16 @@ spec: - type: Resource resource: name: cpu - targetAverageUtilization: {{ .Values.autoscaling.targetCPUUtilizationPercentage }} + target: + type: Utilization + averageUtilization: {{ .Values.autoscaling.targetCPUUtilizationPercentage }} + {{- end }} + {{- if .Values.autoscaling.targetMemoryUtilizationPercentage }} + - type: Resource + resource: + name: memory + target: + type: Utilization + averageUtilization: {{ .Values.autoscaling.targetMemoryUtilizationPercentage }} {{- end }} {{- end }} From 768b2f7da62cbd89704b59c1bbaf721ff38ac1c0 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 29 Jul 2024 02:02:43 +0000 Subject: [PATCH 615/660] chore(deps): bump github.com/ansrivas/fiberprometheus/v2 Bumps [github.com/ansrivas/fiberprometheus/v2](https://github.com/ansrivas/fiberprometheus) from 2.6.1 to 2.7.0. - [Release notes](https://github.com/ansrivas/fiberprometheus/releases) - [Changelog](https://github.com/ansrivas/fiberprometheus/blob/master/CHANGELOG.md) - [Commits](https://github.com/ansrivas/fiberprometheus/compare/v2.6.1...v2.7.0) --- updated-dependencies: - dependency-name: github.com/ansrivas/fiberprometheus/v2 dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- go.mod | 3 +-- go.sum | 10 ++++++---- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/go.mod b/go.mod index cc57eb46..6682db8f 100644 --- a/go.mod +++ b/go.mod @@ -3,7 +3,7 @@ module github.com/snapp-incubator/soteria go 1.22 require ( - github.com/ansrivas/fiberprometheus/v2 v2.6.1 + github.com/ansrivas/fiberprometheus/v2 v2.7.0 github.com/gofiber/contrib/fiberzap v1.0.2 github.com/gofiber/fiber/v2 v2.52.5 github.com/golang-jwt/jwt/v5 v5.2.1 @@ -33,7 +33,6 @@ require ( github.com/go-logr/logr v1.4.2 // indirect github.com/go-logr/stdr v1.2.2 // indirect github.com/go-viper/mapstructure/v2 v2.0.0 // indirect - github.com/gofiber/adaptor/v2 v2.2.1 // indirect github.com/google/uuid v1.6.0 // indirect github.com/grpc-ecosystem/grpc-gateway/v2 v2.20.0 // indirect github.com/inconshreveable/mousetrap v1.1.0 // indirect diff --git a/go.sum b/go.sum index 0a286945..4bd15b3f 100644 --- a/go.sum +++ b/go.sum @@ -8,8 +8,8 @@ github.com/alecthomas/units v0.0.0-20190717042225-c3de453c63f4/go.mod h1:ybxpYRF github.com/alecthomas/units v0.0.0-20190924025748-f65c72e2690d/go.mod h1:rBZYJk541a8SKzHPHnH3zbiI+7dagKZ0cgpgrD7Fyho= github.com/andybalholm/brotli v1.1.0 h1:eLKJA0d02Lf0mVpIDgYnqXcUn0GqVmEFny3VuID1U3M= github.com/andybalholm/brotli v1.1.0/go.mod h1:sms7XGricyQI9K10gOSf56VKKWS4oLer58Q+mhRPtnY= -github.com/ansrivas/fiberprometheus/v2 v2.6.1 h1:wac3pXaE6BYYTF04AC6K0ktk6vCD+MnDOJZ3SK66kXM= -github.com/ansrivas/fiberprometheus/v2 v2.6.1/go.mod h1:MloIKvy4yN6hVqlRpJ/jDiR244YnWJaQC0FIqS8A+MY= +github.com/ansrivas/fiberprometheus/v2 v2.7.0 h1:09XiSzG0J7aZp7RviklngdWdDbSybKjhuWAstp003Gg= +github.com/ansrivas/fiberprometheus/v2 v2.7.0/go.mod h1:hSJdO65lfnWW70Qn9uGdXXsUUSkckbhuw5r/KesygpU= github.com/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kdvxnR2qWY= github.com/armon/circbuf v0.0.0-20150827004946-bbbad097214e/go.mod h1:3U/XgcO3hCbHZ8TKRvWD2dDTCfh9M9ya+I9JpbB7O8o= github.com/armon/go-metrics v0.0.0-20180917152333-f0300d1749da/go.mod h1:Q73ZrmVTwzkszR9V5SSuryQ31EELlFMUz1kKyl939pY= @@ -76,8 +76,6 @@ github.com/go-test/deep v1.0.2-0.20181118220953-042da051cf31/go.mod h1:wGDj63lr6 github.com/go-viper/mapstructure/v2 v2.0.0 h1:dhn8MZ1gZ0mzeodTG3jt5Vj/o87xZKuNAprG2mQfMfc= github.com/go-viper/mapstructure/v2 v2.0.0/go.mod h1:oJDH3BJKyqBA2TXFhDsKDGDTlndYOZ6rGS0BRZIxGhM= github.com/godbus/dbus/v5 v5.0.4/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA= -github.com/gofiber/adaptor/v2 v2.2.1 h1:givE7iViQWlsTR4Jh7tB4iXzrlKBgiraB/yTdHs9Lv4= -github.com/gofiber/adaptor/v2 v2.2.1/go.mod h1:AhR16dEqs25W2FY/l8gSj1b51Azg5dtPDmm+pruNOrc= github.com/gofiber/contrib/fiberzap v1.0.2 h1:EQwhggtszVfIdBeXxN9Xrmld71es34Ufs+ef8VMqZxc= github.com/gofiber/contrib/fiberzap v1.0.2/go.mod h1:jGO8BHU4gRI9U0JtM6zj2CIhYfgVmW5JxziN8NTgVwE= github.com/gofiber/fiber/v2 v2.52.5 h1:tWoP1MJQjGEe4GB5TUGOi7P2E0ZMMRx5ZTG4rT+yGMo= @@ -233,6 +231,8 @@ github.com/oklog/run v1.0.0/go.mod h1:dlhp/R75TPv97u0XWUtDeV/lRKWPKSdTuV0TZvrmrQ github.com/pascaldekloe/goe v0.0.0-20180627143212-57f6aae5913c/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc= github.com/pascaldekloe/goe v0.1.0/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc= github.com/pelletier/go-toml v1.7.0/go.mod h1:vwGMzjaWMwyfHwgIBhI2YUM4fB6nL6lVAvS1LBMMhTE= +github.com/philhofer/fwd v1.1.2 h1:bnDivRJ1EWPjUIRXV5KfORO897HTbpFAQddBdE8t7Gw= +github.com/philhofer/fwd v1.1.2/go.mod h1:qkPdfjR2SIEbspLqpe1tO4n5yICnr2DY7mqEx2tUTP0= github.com/pierrec/lz4 v2.0.5+incompatible/go.mod h1:pdkljMzZIN41W+lC3N2tnIh5sFi+IEE17M5jbnwPHcY= github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= @@ -298,6 +298,8 @@ github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsT github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= github.com/tidwall/pretty v1.2.1 h1:qjsOFOWWQl+N3RsoF5/ssm1pHmJJwhjlSbZ51I6wMl4= github.com/tidwall/pretty v1.2.1/go.mod h1:ITEVvHYasfjBbM0u2Pg8T2nJnzm8xPwvNhhsoaGGjNU= +github.com/tinylib/msgp v1.1.9 h1:SHf3yoO2sGA0veCJeCBYLHuttAVFHGm2RHgNodW7wQU= +github.com/tinylib/msgp v1.1.9/go.mod h1:BCXGB54lDD8qUEPmiG0cQQUANC4IUQyB2ItS2UDlO/k= github.com/valyala/bytebufferpool v1.0.0 h1:GqA5TC/0021Y/b9FG4Oi9Mr3q7XYx6KllzawFIhcdPw= github.com/valyala/bytebufferpool v1.0.0/go.mod h1:6bBcMArwyJ5K/AmCkWv1jt77kVWyCJ6HpOuEn7z0Csc= github.com/valyala/fasthttp v1.55.0 h1:Zkefzgt6a7+bVKHnu/YaYSOPfNYNisSVBo/unVCf8k8= From ab70f417b9e40363516f4eee465d7883b54635a6 Mon Sep 17 00:00:00 2001 From: Ahmad Anvari Date: Thu, 8 Aug 2024 14:37:31 +0330 Subject: [PATCH 616/660] fix: change the order of HPA metrics. --- charts/soteria/templates/hpa.yaml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/charts/soteria/templates/hpa.yaml b/charts/soteria/templates/hpa.yaml index 51123ec8..198acd6e 100644 --- a/charts/soteria/templates/hpa.yaml +++ b/charts/soteria/templates/hpa.yaml @@ -13,20 +13,20 @@ spec: minReplicas: {{ .Values.autoscaling.minReplicas }} maxReplicas: {{ .Values.autoscaling.maxReplicas }} metrics: - {{- if .Values.autoscaling.targetCPUUtilizationPercentage }} + {{- if .Values.autoscaling.targetMemoryUtilizationPercentage }} - type: Resource resource: - name: cpu + name: memory target: type: Utilization - averageUtilization: {{ .Values.autoscaling.targetCPUUtilizationPercentage }} + averageUtilization: {{ .Values.autoscaling.targetMemoryUtilizationPercentage }} {{- end }} - {{- if .Values.autoscaling.targetMemoryUtilizationPercentage }} + {{- if .Values.autoscaling.targetCPUUtilizationPercentage }} - type: Resource resource: - name: memory + name: cpu target: type: Utilization - averageUtilization: {{ .Values.autoscaling.targetMemoryUtilizationPercentage }} + averageUtilization: {{ .Values.autoscaling.targetCPUUtilizationPercentage }} {{- end }} {{- end }} From 7a162ec17a6022040709267923f2aef713517ac9 Mon Sep 17 00:00:00 2001 From: Ahmad Anvari Date: Thu, 8 Aug 2024 15:17:30 +0330 Subject: [PATCH 617/660] fix: not setting replicaCount when HPA is enabled --- charts/soteria/templates/deployment.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/charts/soteria/templates/deployment.yaml b/charts/soteria/templates/deployment.yaml index 664005e3..f3ddfb9c 100644 --- a/charts/soteria/templates/deployment.yaml +++ b/charts/soteria/templates/deployment.yaml @@ -5,7 +5,9 @@ metadata: namespace: {{ $.Release.Namespace }} labels: {{- include "soteria.labels" . | nindent 4 }} spec: + {{- if not .Values.autoscaling.enabled }} replicas: {{ .Values.replicaCount }} + {{- end }} selector: matchLabels: {{- include "soteria.selectorLabels" . | nindent 6 }} From 1fdd808b568873749c2183a6c23b6a0d28e62fdb Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 19 Aug 2024 01:22:13 +0000 Subject: [PATCH 618/660] chore(deps): bump github.com/prometheus/client_golang Bumps [github.com/prometheus/client_golang](https://github.com/prometheus/client_golang) from 1.19.1 to 1.20.0. - [Release notes](https://github.com/prometheus/client_golang/releases) - [Changelog](https://github.com/prometheus/client_golang/blob/main/CHANGELOG.md) - [Commits](https://github.com/prometheus/client_golang/compare/v1.19.1...v1.20.0) --- updated-dependencies: - dependency-name: github.com/prometheus/client_golang dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- go.mod | 4 ++-- go.sum | 10 ++++++---- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/go.mod b/go.mod index 6682db8f..d937826a 100644 --- a/go.mod +++ b/go.mod @@ -9,7 +9,7 @@ require ( github.com/golang-jwt/jwt/v5 v5.2.1 github.com/knadh/koanf v1.5.0 github.com/knadh/koanf/v2 v2.1.1 - github.com/prometheus/client_golang v1.19.1 + github.com/prometheus/client_golang v1.20.0 github.com/speps/go-hashids/v2 v2.0.1 github.com/spf13/cobra v1.8.1 github.com/stretchr/testify v1.9.0 @@ -57,7 +57,7 @@ require ( go.opentelemetry.io/proto/otlp v1.3.1 // indirect go.uber.org/multierr v1.11.0 // indirect golang.org/x/net v0.26.0 // indirect - golang.org/x/sys v0.21.0 // indirect + golang.org/x/sys v0.22.0 // indirect golang.org/x/text v0.16.0 // indirect google.golang.org/genproto/googleapis/api v0.0.0-20240701130421-f6361c86f094 // indirect google.golang.org/genproto/googleapis/rpc v0.0.0-20240701130421-f6361c86f094 // indirect diff --git a/go.sum b/go.sum index 4bd15b3f..450df899 100644 --- a/go.sum +++ b/go.sum @@ -185,6 +185,8 @@ github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= +github.com/kylelemons/godebug v1.1.0 h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0SNc= +github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw= github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU= github.com/mattn/go-colorable v0.1.4/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE= github.com/mattn/go-colorable v0.1.6/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= @@ -247,8 +249,8 @@ github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXP github.com/prometheus/client_golang v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5FsnadC4Ky3P0J6CfImo= github.com/prometheus/client_golang v1.7.1/go.mod h1:PY5Wy2awLA44sXw4AOSfFBetzPP4j5+D6mVACh+pe2M= github.com/prometheus/client_golang v1.11.1/go.mod h1:Z6t4BnS23TR94PD6BsDNk8yVqroYurpAkEiz0P2BEV0= -github.com/prometheus/client_golang v1.19.1 h1:wZWJDwK+NameRJuPGDhlnFgx8e8HN3XHQeLaYJFJBOE= -github.com/prometheus/client_golang v1.19.1/go.mod h1:mP78NwGzrVks5S2H6ab8+ZZGJLZUq1hoULYBAYBw1Ho= +github.com/prometheus/client_golang v1.20.0 h1:jBzTZ7B099Rg24tny+qngoynol8LtVYlA2bqx3vEloI= +github.com/prometheus/client_golang v1.20.0/go.mod h1:PIEt8X02hGcP8JWbeHyeZ53Y/jReSnHgO035n//V5WE= github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= @@ -414,8 +416,8 @@ golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20210603081109-ebe580a85c40/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.21.0 h1:rF+pYz3DAGSQAxAu1CbC7catZg4ebC4UIeIhKxBZvws= -golang.org/x/sys v0.21.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.22.0 h1:RI27ohtqKCnwULzJLqkv897zojh5/DwS/ENaMzUOaWI= +golang.org/x/sys v0.22.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.1-0.20181227161524-e6919f6577db/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= From e3183575f370effa23cc8ea270da64fa6f3a5109 Mon Sep 17 00:00:00 2001 From: Parham Alvani Date: Mon, 26 Aug 2024 07:56:19 +0000 Subject: [PATCH 619/660] feat: update go version to 1.23 --- build/package/Dockerfile | 4 ++-- go.mod | 34 +++++++++++++++++----------------- go.sum | 34 ++++++++++++++++++++++++++++++++++ 3 files changed, 53 insertions(+), 19 deletions(-) diff --git a/build/package/Dockerfile b/build/package/Dockerfile index 0976edc5..1f0cfa16 100644 --- a/build/package/Dockerfile +++ b/build/package/Dockerfile @@ -1,4 +1,4 @@ -FROM golang:1.22-alpine3.19 as builder +FROM golang:1.23-alpine3.20 as builder # hadolint ignore=DL3018 RUN apk --no-cache add git @@ -14,7 +14,7 @@ COPY . . WORKDIR /app/cmd/soteria RUN go build -o /soteria -FROM alpine:3.19 +FROM alpine:3.20 # hadolint ignore=DL3018 RUN apk --no-cache add ca-certificates tzdata && \ diff --git a/go.mod b/go.mod index d937826a..9286e2ee 100644 --- a/go.mod +++ b/go.mod @@ -1,6 +1,6 @@ module github.com/snapp-incubator/soteria -go 1.22 +go 1.23 require ( github.com/ansrivas/fiberprometheus/v2 v2.7.0 @@ -9,15 +9,15 @@ require ( github.com/golang-jwt/jwt/v5 v5.2.1 github.com/knadh/koanf v1.5.0 github.com/knadh/koanf/v2 v2.1.1 - github.com/prometheus/client_golang v1.20.0 + github.com/prometheus/client_golang v1.20.2 github.com/speps/go-hashids/v2 v2.0.1 github.com/spf13/cobra v1.8.1 github.com/stretchr/testify v1.9.0 github.com/tidwall/pretty v1.2.1 - go.opentelemetry.io/otel v1.28.0 - go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.28.0 - go.opentelemetry.io/otel/sdk v1.28.0 - go.opentelemetry.io/otel/trace v1.28.0 + go.opentelemetry.io/otel v1.29.0 + go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.29.0 + go.opentelemetry.io/otel/sdk v1.29.0 + go.opentelemetry.io/otel/trace v1.29.0 go.uber.org/automaxprocs v1.5.3 go.uber.org/zap v1.27.0 ) @@ -32,14 +32,14 @@ require ( github.com/fsnotify/fsnotify v1.7.0 // indirect github.com/go-logr/logr v1.4.2 // indirect github.com/go-logr/stdr v1.2.2 // indirect - github.com/go-viper/mapstructure/v2 v2.0.0 // indirect + github.com/go-viper/mapstructure/v2 v2.1.0 // indirect github.com/google/uuid v1.6.0 // indirect - github.com/grpc-ecosystem/grpc-gateway/v2 v2.20.0 // indirect + github.com/grpc-ecosystem/grpc-gateway/v2 v2.22.0 // indirect github.com/inconshreveable/mousetrap v1.1.0 // indirect github.com/klauspost/compress v1.17.9 // indirect github.com/mattn/go-colorable v0.1.13 // indirect github.com/mattn/go-isatty v0.0.20 // indirect - github.com/mattn/go-runewidth v0.0.15 // indirect + github.com/mattn/go-runewidth v0.0.16 // indirect github.com/mitchellh/copystructure v1.2.0 // indirect github.com/mitchellh/reflectwalk v1.0.2 // indirect github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect @@ -52,16 +52,16 @@ require ( github.com/valyala/bytebufferpool v1.0.0 // indirect github.com/valyala/fasthttp v1.55.0 // indirect github.com/valyala/tcplisten v1.0.0 // indirect - go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.28.0 // indirect - go.opentelemetry.io/otel/metric v1.28.0 // indirect + go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.29.0 // indirect + go.opentelemetry.io/otel/metric v1.29.0 // indirect go.opentelemetry.io/proto/otlp v1.3.1 // indirect go.uber.org/multierr v1.11.0 // indirect - golang.org/x/net v0.26.0 // indirect - golang.org/x/sys v0.22.0 // indirect - golang.org/x/text v0.16.0 // indirect - google.golang.org/genproto/googleapis/api v0.0.0-20240701130421-f6361c86f094 // indirect - google.golang.org/genproto/googleapis/rpc v0.0.0-20240701130421-f6361c86f094 // indirect - google.golang.org/grpc v1.64.0 // indirect + golang.org/x/net v0.28.0 // indirect + golang.org/x/sys v0.24.0 // indirect + golang.org/x/text v0.17.0 // indirect + google.golang.org/genproto/googleapis/api v0.0.0-20240823204242-4ba0660f739c // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20240823204242-4ba0660f739c // indirect + google.golang.org/grpc v1.65.0 // indirect google.golang.org/protobuf v1.34.2 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect ) diff --git a/go.sum b/go.sum index 450df899..2c4cf0cb 100644 --- a/go.sum +++ b/go.sum @@ -75,6 +75,8 @@ github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/me github.com/go-test/deep v1.0.2-0.20181118220953-042da051cf31/go.mod h1:wGDj63lr65AM2AQyKZd/NYHGb0R+1RLqB8NKt3aSFNA= github.com/go-viper/mapstructure/v2 v2.0.0 h1:dhn8MZ1gZ0mzeodTG3jt5Vj/o87xZKuNAprG2mQfMfc= github.com/go-viper/mapstructure/v2 v2.0.0/go.mod h1:oJDH3BJKyqBA2TXFhDsKDGDTlndYOZ6rGS0BRZIxGhM= +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/godbus/dbus/v5 v5.0.4/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA= github.com/gofiber/contrib/fiberzap v1.0.2 h1:EQwhggtszVfIdBeXxN9Xrmld71es34Ufs+ef8VMqZxc= github.com/gofiber/contrib/fiberzap v1.0.2/go.mod h1:jGO8BHU4gRI9U0JtM6zj2CIhYfgVmW5JxziN8NTgVwE= @@ -118,9 +120,12 @@ github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+ 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/grpc-ecosystem/go-grpc-prometheus v1.2.0/go.mod h1:8NvIoxWQoOIhqOTXgfV/d3M/q6VIi02HzZEHgUlZvzk= +github.com/grpc-ecosystem/grpc-gateway v1.16.0 h1:gmcG1KaJ57LophUzW0Hy8NmPhnMZb4M0+kPpLofRdBo= github.com/grpc-ecosystem/grpc-gateway v1.16.0/go.mod h1:BDjrQk3hbvj6Nolgz8mAMFbcEtjT1g+wF4CSlocrBnw= github.com/grpc-ecosystem/grpc-gateway/v2 v2.20.0 h1:bkypFPDjIYGfCYD5mRBvpqxfYX1YCS1PXdKYWi8FsN0= github.com/grpc-ecosystem/grpc-gateway/v2 v2.20.0/go.mod h1:P+Lt/0by1T8bfcF3z737NnSbmxQAppXMRziHUxPOC8k= +github.com/grpc-ecosystem/grpc-gateway/v2 v2.22.0 h1:asbCHRVmodnJTuQ3qamDwqVOIjwqUPTYmYuemVOx+Ys= +github.com/grpc-ecosystem/grpc-gateway/v2 v2.22.0/go.mod h1:ggCgvZ2r7uOoQjOyu2Y1NhHmEPPzzuhWgcza5M1Ji1I= github.com/hashicorp/consul/api v1.13.0/go.mod h1:ZlVrynguJKcYr54zGaDbaL3fOvKC9m72FhPvA8T35KQ= github.com/hashicorp/consul/sdk v0.8.0/go.mod h1:GBvyrGALthsZObzUGsfgHZQDXjg4lOjagTIwIR1vPms= github.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= @@ -172,6 +177,7 @@ github.com/klauspost/compress v1.17.9 h1:6KIumPrER1LHsvBVuDa0r5xaG0Es51mhhB9BQB2 github.com/klauspost/compress v1.17.9/go.mod h1:Di0epgTjJY877eYKx5yC51cX2A2Vl2ibi7bDH9ttBbw= github.com/knadh/koanf v1.5.0 h1:q2TSd/3Pyc/5yP9ldIrSdIz26MCcyNQzW0pEAugLPNs= github.com/knadh/koanf v1.5.0/go.mod h1:Hgyjp4y8v44hpZtPzs7JZfRAW5AhN7KfZcwv1RYggDs= +github.com/knadh/koanf/maps v0.1.1 h1:G5TjmUh2D7G2YWf5SQQqSiHRJEjaicvU0KpypqB3NIs= github.com/knadh/koanf/v2 v2.1.1 h1:/R8eXqasSTsmDCsAyYj+81Wteg8AqrV9CP6gvsTsOmM= github.com/knadh/koanf/v2 v2.1.1/go.mod h1:4mnTRbZCK+ALuBXHZMjDfG9y714L7TykVnZkXbMU3Es= github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= @@ -202,6 +208,8 @@ github.com/mattn/go-isatty v0.0.20 h1:xfD0iDuEKnDkl03q4limB+vH+GxLEtL/jb4xVJSWWE github.com/mattn/go-isatty v0.0.20/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y= github.com/mattn/go-runewidth v0.0.15 h1:UNAjwbU9l54TA3KzvqLGxwWjHmMgBUVhBiTjelZgg3U= github.com/mattn/go-runewidth v0.0.15/go.mod h1:Jdepj2loyihRzMpdS35Xk/zdY8IAYHsh153qUoGf23w= +github.com/mattn/go-runewidth v0.0.16 h1:E5ScNMtiwvlvB5paMFdw9p4kSQzbXFikJ5SQO6TULQc= +github.com/mattn/go-runewidth v0.0.16/go.mod h1:Jdepj2loyihRzMpdS35Xk/zdY8IAYHsh153qUoGf23w= github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= github.com/miekg/dns v1.1.26/go.mod h1:bPDLeHnStXmXAq1m/Ch/hvfNHr14JKNPMBo3VZKjuso= github.com/miekg/dns v1.1.41/go.mod h1:p6aan82bvRIyn+zDIv9xYNUpwa73JcSh9BKwknJysuI= @@ -251,6 +259,8 @@ github.com/prometheus/client_golang v1.7.1/go.mod h1:PY5Wy2awLA44sXw4AOSfFBetzPP github.com/prometheus/client_golang v1.11.1/go.mod h1:Z6t4BnS23TR94PD6BsDNk8yVqroYurpAkEiz0P2BEV0= github.com/prometheus/client_golang v1.20.0 h1:jBzTZ7B099Rg24tny+qngoynol8LtVYlA2bqx3vEloI= github.com/prometheus/client_golang v1.20.0/go.mod h1:PIEt8X02hGcP8JWbeHyeZ53Y/jReSnHgO035n//V5WE= +github.com/prometheus/client_golang v1.20.2 h1:5ctymQzZlyOON1666svgwn3s6IKWgfbjsejTMiXIyjg= +github.com/prometheus/client_golang v1.20.2/go.mod h1:PIEt8X02hGcP8JWbeHyeZ53Y/jReSnHgO035n//V5WE= github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= @@ -316,16 +326,28 @@ go.etcd.io/etcd/client/pkg/v3 v3.5.4/go.mod h1:IJHfcCEKxYu1Os13ZdwCwIUTUVGYTSAM3 go.etcd.io/etcd/client/v3 v3.5.4/go.mod h1:ZaRkVgBZC+L+dLCjTcF1hRXpgZXQPOvnA/Ak/gq3kiY= go.opentelemetry.io/otel v1.28.0 h1:/SqNcYk+idO0CxKEUOtKQClMK/MimZihKYMruSMViUo= go.opentelemetry.io/otel v1.28.0/go.mod h1:q68ijF8Fc8CnMHKyzqL6akLO46ePnjkgfIMIjUIX9z4= +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/exporters/otlp/otlptrace v1.28.0 h1:3Q/xZUyC1BBkualc9ROb4G8qkH90LXEIICcs5zv1OYY= go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.28.0/go.mod h1:s75jGIWA9OfCMzF0xr+ZgfrB5FEbbV7UuYo32ahUiFI= +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.28.0 h1:R3X6ZXmNPRR8ul6i3WgFURCHzaXjHdm0karRG/+dj3s= go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.28.0/go.mod h1:QWFXnDavXWwMx2EEcZsf3yxgEKAqsxQ+Syjp+seyInw= +go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.29.0 h1:nSiV3s7wiCam610XcLbYOmMfJxB9gO4uK3Xgv5gmTgg= +go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.29.0/go.mod h1:hKn/e/Nmd19/x1gvIHwtOwVWM+VhuITSWip3JUDghj0= go.opentelemetry.io/otel/metric v1.28.0 h1:f0HGvSl1KRAU1DLgLGFjrwVyismPlnuU6JD6bOeuA5Q= go.opentelemetry.io/otel/metric v1.28.0/go.mod h1:Fb1eVBFZmLVTMb6PPohq3TO9IIhUisDsbJoL/+uQW4s= +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/sdk v1.28.0 h1:b9d7hIry8yZsgtbmM0DKyPWMMUMlK9NEKuIG4aBqWyE= go.opentelemetry.io/otel/sdk v1.28.0/go.mod h1:oYj7ClPUA7Iw3m+r7GeEjz0qckQRJK2B8zjcZEfu7Pg= +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/trace v1.28.0 h1:GhQ9cUuQGmNDd5BTCP2dAvv75RdMxEfTmYejp+lkx9g= go.opentelemetry.io/otel/trace v1.28.0/go.mod h1:jPyXzNPg6da9+38HEwElrQiHlVMTnVfM3/yv2OlIHaI= +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/proto/otlp v1.3.1 h1:TrMUixzpM0yuc/znrFTP9MMRh8trP93mkCiDVeXrui0= go.opentelemetry.io/proto/otlp v1.3.1/go.mod h1:0X1WI4de4ZsLrrJNLAQbFeLCm3T7yBkR0XqQ7niQU+8= go.uber.org/atomic v1.7.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc= @@ -372,6 +394,8 @@ golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96b golang.org/x/net v0.0.0-20210410081132-afb366fc7cd1/go.mod h1:9tjilg8BloeKEkVJvy7fQ90B1CfIiPueXVOjqfkSzI8= golang.org/x/net v0.26.0 h1:soB7SVo0PWrY4vPW/+ay0jKDNScG2X9wFeYlXIvJsOQ= golang.org/x/net v0.26.0/go.mod h1:5YKkiSynbBIh3p6iOc/vibscux0x38BZDkn8sCUPxHE= +golang.org/x/net v0.28.0 h1:a9JDOJc5GMUJ0+UDqmLT86WiEy7iWyIhz8gz8E4e5hE= +golang.org/x/net v0.28.0/go.mod h1:yqtgsTWOOnlGLG9GFRrK3++bGOUEkNBoHZc8MEDWPNg= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= @@ -418,6 +442,8 @@ golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.22.0 h1:RI27ohtqKCnwULzJLqkv897zojh5/DwS/ENaMzUOaWI= golang.org/x/sys v0.22.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.24.0 h1:Twjiwq9dn6R1fQcyiK+wQyHWfaz/BJB+YIpzU/Cv3Xg= +golang.org/x/sys v0.24.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.1-0.20181227161524-e6919f6577db/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= @@ -427,6 +453,8 @@ golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.16.0 h1:a94ExnEXNtEwYLGJSIUxnWoxoRz/ZcCsV63ROupILh4= golang.org/x/text v0.16.0/go.mod h1:GhwF1Be+LQoKShO3cGOHzqOgRrGaYc9AvblQOmPVHnI= +golang.org/x/text v0.17.0 h1:XtiM5bkSOt+ewxlOE/aE/AKEHibwj/6gvWMl9Rsh0Qc= +golang.org/x/text v0.17.0/go.mod h1:BuEKDfySbSR4drPmRPG/7iBdf8hvFMuRexcpahXilzY= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= @@ -453,8 +481,12 @@ google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEY google.golang.org/genproto v0.0.0-20210602131652-f16073e35f0c/go.mod h1:UODoCrxHCcBojKKwX1terBiRUaqAsFqJiF615XL43r0= google.golang.org/genproto/googleapis/api v0.0.0-20240701130421-f6361c86f094 h1:0+ozOGcrp+Y8Aq8TLNN2Aliibms5LEzsq99ZZmAGYm0= google.golang.org/genproto/googleapis/api v0.0.0-20240701130421-f6361c86f094/go.mod h1:fJ/e3If/Q67Mj99hin0hMhiNyCRmt6BQ2aWIJshUSJw= +google.golang.org/genproto/googleapis/api v0.0.0-20240823204242-4ba0660f739c h1:e0zB268kOca6FbuJkYUGxfwG4DKFZG/8DLyv9Zv66cE= +google.golang.org/genproto/googleapis/api v0.0.0-20240823204242-4ba0660f739c/go.mod h1:fO8wJzT2zbQbAjbIoos1285VfEIYKDDY+Dt+WpTkh6g= google.golang.org/genproto/googleapis/rpc v0.0.0-20240701130421-f6361c86f094 h1:BwIjyKYGsK9dMCBOorzRri8MQwmi7mT9rGHsCEinZkA= google.golang.org/genproto/googleapis/rpc v0.0.0-20240701130421-f6361c86f094/go.mod h1:Ue6ibwXGpU+dqIcODieyLOcgj7z8+IcskoNIgZxtrFY= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240823204242-4ba0660f739c h1:Kqjm4WpoWvwhMPcrAczoTyMySQmYa9Wy2iL6Con4zn8= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240823204242-4ba0660f739c/go.mod h1:UqMtugtsSgubUsoxbuAoiCXvqvErP7Gf0so0mK9tHxU= google.golang.org/grpc v1.14.0/go.mod h1:yo6s7OP7yaDglbqo1J04qKzAhqBH6lvTonzMVmEdcZw= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= google.golang.org/grpc v1.22.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= @@ -465,6 +497,8 @@ google.golang.org/grpc v1.33.1/go.mod h1:fr5YgcSWrqhRRxogOsw7RzIpsmvOZ6IcH4kBYTp google.golang.org/grpc v1.38.0/go.mod h1:NREThFqKR1f3iQ6oBuvc5LadQuXVGo9rkm5ZGrQdJfM= google.golang.org/grpc v1.64.0 h1:KH3VH9y/MgNQg1dE7b3XfVK0GsPSIzJwdF617gUSbvY= google.golang.org/grpc v1.64.0/go.mod h1:oxjF8E3FBnjp+/gVFYdWacaLDx9na1aqy9oovLpxQYg= +google.golang.org/grpc v1.65.0 h1:bs/cUb4lp1G5iImFFd3u5ixQzweKizoZJAwBNLR42lc= +google.golang.org/grpc v1.65.0/go.mod h1:WgYC2ypjlB0EiQi6wdKixMqukr6lBc0Vo+oOgjrM5ZQ= 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= From c1ad56d840d2a0dc84cef2c1a38a119831280bc6 Mon Sep 17 00:00:00 2001 From: Parham Alvani Date: Mon, 2 Sep 2024 06:51:21 +0000 Subject: [PATCH 620/660] feat: update packages --- go.mod | 8 ++++---- go.sum | 8 ++++++++ 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/go.mod b/go.mod index 9286e2ee..e1866b72 100644 --- a/go.mod +++ b/go.mod @@ -45,7 +45,7 @@ require ( github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect github.com/prometheus/client_model v0.6.1 // indirect - github.com/prometheus/common v0.55.0 // indirect + github.com/prometheus/common v0.57.0 // indirect github.com/prometheus/procfs v0.15.1 // indirect github.com/rivo/uniseg v0.4.7 // indirect github.com/spf13/pflag v1.0.5 // indirect @@ -59,9 +59,9 @@ require ( golang.org/x/net v0.28.0 // indirect golang.org/x/sys v0.24.0 // indirect golang.org/x/text v0.17.0 // indirect - google.golang.org/genproto/googleapis/api v0.0.0-20240823204242-4ba0660f739c // indirect - google.golang.org/genproto/googleapis/rpc v0.0.0-20240823204242-4ba0660f739c // indirect - google.golang.org/grpc v1.65.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/protobuf v1.34.2 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect ) diff --git a/go.sum b/go.sum index 2c4cf0cb..9c1baa66 100644 --- a/go.sum +++ b/go.sum @@ -272,6 +272,8 @@ github.com/prometheus/common v0.10.0/go.mod h1:Tlit/dnDKsSWFlCLTWaA1cyBgKHSMdTB8 github.com/prometheus/common v0.26.0/go.mod h1:M7rCNAaPfAosfx8veZJCuw84e35h3Cfd9VFqTh1DIvc= github.com/prometheus/common v0.55.0 h1:KEi6DK7lXW/m7Ig5i47x0vRzuBsHuvJdi5ee6Y3G1dc= github.com/prometheus/common v0.55.0/go.mod h1:2SECS4xJG1kd8XF9IcM1gMX6510RAEL65zxzNImwdc8= +github.com/prometheus/common v0.57.0 h1:Ro/rKjwdq9mZn1K5QPctzh+MA4Lp0BuYk5ZZEVhoNcY= +github.com/prometheus/common v0.57.0/go.mod h1:7uRPFSUTbfZWsJ7MHY56sqt7hLQu3bxXHDnNhl8E9qI= github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= github.com/prometheus/procfs v0.1.3/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU= @@ -483,10 +485,14 @@ google.golang.org/genproto/googleapis/api v0.0.0-20240701130421-f6361c86f094 h1: google.golang.org/genproto/googleapis/api v0.0.0-20240701130421-f6361c86f094/go.mod h1:fJ/e3If/Q67Mj99hin0hMhiNyCRmt6BQ2aWIJshUSJw= google.golang.org/genproto/googleapis/api v0.0.0-20240823204242-4ba0660f739c h1:e0zB268kOca6FbuJkYUGxfwG4DKFZG/8DLyv9Zv66cE= google.golang.org/genproto/googleapis/api v0.0.0-20240823204242-4ba0660f739c/go.mod h1:fO8wJzT2zbQbAjbIoos1285VfEIYKDDY+Dt+WpTkh6g= +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-20240701130421-f6361c86f094 h1:BwIjyKYGsK9dMCBOorzRri8MQwmi7mT9rGHsCEinZkA= google.golang.org/genproto/googleapis/rpc v0.0.0-20240701130421-f6361c86f094/go.mod h1:Ue6ibwXGpU+dqIcODieyLOcgj7z8+IcskoNIgZxtrFY= google.golang.org/genproto/googleapis/rpc v0.0.0-20240823204242-4ba0660f739c h1:Kqjm4WpoWvwhMPcrAczoTyMySQmYa9Wy2iL6Con4zn8= google.golang.org/genproto/googleapis/rpc v0.0.0-20240823204242-4ba0660f739c/go.mod h1:UqMtugtsSgubUsoxbuAoiCXvqvErP7Gf0so0mK9tHxU= +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/grpc v1.14.0/go.mod h1:yo6s7OP7yaDglbqo1J04qKzAhqBH6lvTonzMVmEdcZw= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= google.golang.org/grpc v1.22.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= @@ -499,6 +505,8 @@ google.golang.org/grpc v1.64.0 h1:KH3VH9y/MgNQg1dE7b3XfVK0GsPSIzJwdF617gUSbvY= google.golang.org/grpc v1.64.0/go.mod h1:oxjF8E3FBnjp+/gVFYdWacaLDx9na1aqy9oovLpxQYg= google.golang.org/grpc v1.65.0 h1:bs/cUb4lp1G5iImFFd3u5ixQzweKizoZJAwBNLR42lc= google.golang.org/grpc v1.65.0/go.mod h1:WgYC2ypjlB0EiQi6wdKixMqukr6lBc0Vo+oOgjrM5ZQ= +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/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= From 9753d886671149e5093408f263fc1df30b321034 Mon Sep 17 00:00:00 2001 From: Parham Alvani Date: Mon, 2 Sep 2024 07:00:25 +0000 Subject: [PATCH 621/660] feat: provide other parts of the claim into the topic template --- internal/authenticator/auto_authenticator.go | 2 +- internal/authenticator/manual_authenticator.go | 2 +- internal/topics/manager.go | 7 ++++++- internal/topics/topic.go | 3 +-- 4 files changed, 9 insertions(+), 5 deletions(-) diff --git a/internal/authenticator/auto_authenticator.go b/internal/authenticator/auto_authenticator.go index a6ccae7b..50ce0bf8 100644 --- a/internal/authenticator/auto_authenticator.go +++ b/internal/authenticator/auto_authenticator.go @@ -79,7 +79,7 @@ func (a AutoAuthenticator) ACL( sub, _ := claims[a.JWTConfig.SubName].(string) - topicTemplate := a.TopicManager.ParseTopic(topic, issuer, sub) + topicTemplate := a.TopicManager.ParseTopic(topic, issuer, sub, map[string]any(claims)) if topicTemplate == nil { return false, InvalidTopicError{Topic: topic} } diff --git a/internal/authenticator/manual_authenticator.go b/internal/authenticator/manual_authenticator.go index 28f46ee5..07afd915 100644 --- a/internal/authenticator/manual_authenticator.go +++ b/internal/authenticator/manual_authenticator.go @@ -105,7 +105,7 @@ func (a ManualAuthenticator) ACL( sub, _ := claims[a.JWTConfig.SubName].(string) - topicTemplate := a.TopicManager.ParseTopic(topic, issuer, sub) + topicTemplate := a.TopicManager.ParseTopic(topic, issuer, sub, map[string]any(claims)) if topicTemplate == nil { return false, InvalidTopicError{Topic: topic} } diff --git a/internal/topics/manager.go b/internal/topics/manager.go index 03d841c8..e8c3ea0f 100644 --- a/internal/topics/manager.go +++ b/internal/topics/manager.go @@ -96,8 +96,13 @@ func NewTopicManager( } // ParseTopic checks if a topic is valid based on the given parameters. -func (t *Manager) ParseTopic(topic, iss, sub string) *Template { +func (t *Manager) ParseTopic(topic, iss, sub string, claims map[string]any) *Template { fields := make(map[string]any) + + for k, v := range claims { + fields[k] = v + } + fields["iss"] = iss fields["company"] = t.Company fields["sub"] = sub diff --git a/internal/topics/topic.go b/internal/topics/topic.go index 9ad8ffed..22ea5e36 100644 --- a/internal/topics/topic.go +++ b/internal/topics/topic.go @@ -22,8 +22,7 @@ type Template struct { func (t Template) Parse(fields map[string]string) string { writer := new(strings.Builder) - err := t.Template.Execute(writer, fields) - if err != nil { + if err := t.Template.Execute(writer, fields); err != nil { return "" } From e1c41654c9416fa689afe0c11cd6ba99a2d33646 Mon Sep 17 00:00:00 2001 From: Parham Alvani Date: Mon, 2 Sep 2024 07:10:01 +0000 Subject: [PATCH 622/660] feat: add encode hashid --- internal/topics/manager.go | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/internal/topics/manager.go b/internal/topics/manager.go index e8c3ea0f..b9d3eb5c 100644 --- a/internal/topics/manager.go +++ b/internal/topics/manager.go @@ -75,6 +75,7 @@ func NewTopicManager( manager.Functions = template.FuncMap{ "IssToEntity": manager.IssEntityMapper, "DecodeHashID": manager.DecodeHashID, + "EncodeHashID": manager.EncodeHashID, "EncodeMD5": manager.EncodeMD5, "IssToPeer": manager.IssPeerMapper, } @@ -148,6 +149,24 @@ func (t *Manager) DecodeHashID(sub, iss string) string { return strconv.Itoa(id[0]) } +func (t *Manager) EncodeHashID(sub, iss string) string { + subInt, err := strconv.Atoi(sub) + if err != nil { + t.Logger.Error("encoding sub failed", zap.Error(err), zap.String("sub", sub)) + + return "" + } + + id, err := t.HashIDSManager[iss].Encode([]int{subInt}) + if err != nil { + t.Logger.Error("encoding sub failed", zap.Error(err), zap.String("sub", sub)) + + return "" + } + + return id +} + func (t *Manager) IssEntityMapper(iss string) string { result, ok := t.IssEntityMap[iss] if ok { From 50da13f63b31a51f717b9cad6a83113c9dd2b510 Mon Sep 17 00:00:00 2001 From: Parham Alvani Date: Mon, 2 Sep 2024 07:21:57 +0000 Subject: [PATCH 623/660] feat: update tests with new claims --- internal/authenticator/auto_authenticator_test.go | 7 ++++++- internal/authenticator/manual_authenticator_test.go | 7 ++++++- internal/topics/manager_test.go | 2 +- 3 files changed, 13 insertions(+), 3 deletions(-) diff --git a/internal/authenticator/auto_authenticator_test.go b/internal/authenticator/auto_authenticator_test.go index d76d9d3c..422041d4 100644 --- a/internal/authenticator/auto_authenticator_test.go +++ b/internal/authenticator/auto_authenticator_test.go @@ -137,7 +137,12 @@ func TestAutoAuthenticator_ValidateTopicBySender(t *testing.T) { t.Run("testing valid driver cab event", func(t *testing.T) { t.Parallel() - topicTemplate := authenticator.TopicManager.ParseTopic(validDriverCabEventTopic, topics.DriverIss, "DXKgaNQa7N5Y7bo") + topicTemplate := authenticator.TopicManager.ParseTopic( + validDriverCabEventTopic, + topics.DriverIss, + "DXKgaNQa7N5Y7bo", + nil, + ) require.NotNil(t, topicTemplate) }) } diff --git a/internal/authenticator/manual_authenticator_test.go b/internal/authenticator/manual_authenticator_test.go index dee45a00..cbd40bc9 100644 --- a/internal/authenticator/manual_authenticator_test.go +++ b/internal/authenticator/manual_authenticator_test.go @@ -337,7 +337,12 @@ func TestManualAuthenticator_ValidateTopicBySender(t *testing.T) { t.Run("testing valid driver cab event", func(t *testing.T) { t.Parallel() - topicTemplate := authenticator.TopicManager.ParseTopic(validDriverCabEventTopic, topics.DriverIss, "DXKgaNQa7N5Y7bo") + topicTemplate := authenticator.TopicManager.ParseTopic( + validDriverCabEventTopic, + topics.DriverIss, + "DXKgaNQa7N5Y7bo", + nil, + ) require.NotNil(t, topicTemplate) }) } diff --git a/internal/topics/manager_test.go b/internal/topics/manager_test.go index 8ef7313e..dd390f47 100644 --- a/internal/topics/manager_test.go +++ b/internal/topics/manager_test.go @@ -146,7 +146,7 @@ func TestTopicManager(t *testing.T) { topic := tc.arg - topicTemplate := topicManager.ParseTopic(topic, tc.issuer, sub) + topicTemplate := topicManager.ParseTopic(topic, tc.issuer, sub, nil) if topicTemplate != nil { if len(tc.want) == 0 { t.Errorf("topic %s is invalid, must throw error.", tc.arg) From 2f3b8f11db074697a44ca9ce38dc9fc78fd6d42b Mon Sep 17 00:00:00 2001 From: Parham Alvani Date: Mon, 2 Sep 2024 07:31:37 +0000 Subject: [PATCH 624/660] feat: increase test coverage --- .../manual_authenticator_test.go | 42 +++++++++++++++++++ 1 file changed, 42 insertions(+) diff --git a/internal/authenticator/manual_authenticator_test.go b/internal/authenticator/manual_authenticator_test.go index cbd40bc9..c3795963 100644 --- a/internal/authenticator/manual_authenticator_test.go +++ b/internal/authenticator/manual_authenticator_test.go @@ -347,6 +347,48 @@ func TestManualAuthenticator_ValidateTopicBySender(t *testing.T) { }) } +// Provide a topic which we don't have at snapp to test functions and fields that +// are used during the templating. +func TestManualAuthenticator_ValidateTopicBySenderAndClaims(t *testing.T) { + t.Parallel() + + cfg := config.SnappVendor() + + cfg.Topics = append(cfg.Topics, topics.Topic{ + Type: topics.SharedLocation, + Template: "^{{.company}}/{{IssToEntity .iss}}/{{.sub}}/{{.uid}}/{{DecodeHashID (EncodeHashID .sub .iss) .iss}}$", + Accesses: map[string]acl.AccessType{ + topics.DriverIss: acl.Sub, + topics.PassengerIss: acl.Sub, + }, + }, + ) + + hid, err := topics.NewHashIDManager(cfg.HashIDMap) + require.NoError(t, err) + + // nolint: exhaustruct + authenticator := authenticator.ManualAuthenticator{ + AllowedAccessTypes: []acl.AccessType{acl.Pub, acl.Sub}, + Company: "snapp", + TopicManager: topics.NewTopicManager(cfg.Topics, hid, "snapp", cfg.IssEntityMap, cfg.IssPeerMap, zap.NewNop()), + } + + t.Run("testing valid driver cab event", func(t *testing.T) { + t.Parallel() + + topicTemplate := authenticator.TopicManager.ParseTopic( + "snapp/driver/123/456/123", + topics.DriverIss, + "123", + map[string]any{ + "uid": "456", + }, + ) + require.NotNil(t, topicTemplate) + }) +} + // nolint: funlen func TestManualAuthenticator_validateAccessType(t *testing.T) { t.Parallel() From dc4655f4a0716979800e2be8857efceaf3a905a7 Mon Sep 17 00:00:00 2001 From: Parham Alvani Date: Tue, 3 Sep 2024 21:31:36 +0000 Subject: [PATCH 625/660] fix: convert jwt fields to string --- internal/topics/manager.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/internal/topics/manager.go b/internal/topics/manager.go index b9d3eb5c..092dd3ae 100644 --- a/internal/topics/manager.go +++ b/internal/topics/manager.go @@ -98,10 +98,10 @@ func NewTopicManager( // ParseTopic checks if a topic is valid based on the given parameters. func (t *Manager) ParseTopic(topic, iss, sub string, claims map[string]any) *Template { - fields := make(map[string]any) + fields := make(map[string]string) for k, v := range claims { - fields[k] = v + fields[k] = fmt.Sprintf("%v", v) } fields["iss"] = iss From c16fed2890b802a8e7e442d5e20c7335aa448b40 Mon Sep 17 00:00:00 2001 From: Parham Alvani Date: Mon, 9 Sep 2024 04:17:24 +0000 Subject: [PATCH 626/660] feat: update packages --- go.mod | 14 +++++++------- go.sum | 14 ++++++++++++++ 2 files changed, 21 insertions(+), 7 deletions(-) diff --git a/go.mod b/go.mod index e1866b72..794a1df8 100644 --- a/go.mod +++ b/go.mod @@ -9,7 +9,7 @@ require ( github.com/golang-jwt/jwt/v5 v5.2.1 github.com/knadh/koanf v1.5.0 github.com/knadh/koanf/v2 v2.1.1 - github.com/prometheus/client_golang v1.20.2 + github.com/prometheus/client_golang v1.20.3 github.com/speps/go-hashids/v2 v2.0.1 github.com/spf13/cobra v1.8.1 github.com/stretchr/testify v1.9.0 @@ -45,7 +45,7 @@ require ( github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect github.com/prometheus/client_model v0.6.1 // indirect - github.com/prometheus/common v0.57.0 // indirect + github.com/prometheus/common v0.59.1 // indirect github.com/prometheus/procfs v0.15.1 // indirect github.com/rivo/uniseg v0.4.7 // indirect github.com/spf13/pflag v1.0.5 // indirect @@ -56,11 +56,11 @@ require ( go.opentelemetry.io/otel/metric v1.29.0 // indirect go.opentelemetry.io/proto/otlp v1.3.1 // indirect go.uber.org/multierr v1.11.0 // indirect - golang.org/x/net v0.28.0 // indirect - golang.org/x/sys v0.24.0 // indirect - golang.org/x/text v0.17.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 + golang.org/x/net v0.29.0 // indirect + golang.org/x/sys v0.25.0 // indirect + golang.org/x/text v0.18.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.0 // indirect google.golang.org/protobuf v1.34.2 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect diff --git a/go.sum b/go.sum index 9c1baa66..955908f7 100644 --- a/go.sum +++ b/go.sum @@ -261,6 +261,8 @@ github.com/prometheus/client_golang v1.20.0 h1:jBzTZ7B099Rg24tny+qngoynol8LtVYlA github.com/prometheus/client_golang v1.20.0/go.mod h1:PIEt8X02hGcP8JWbeHyeZ53Y/jReSnHgO035n//V5WE= github.com/prometheus/client_golang v1.20.2 h1:5ctymQzZlyOON1666svgwn3s6IKWgfbjsejTMiXIyjg= github.com/prometheus/client_golang v1.20.2/go.mod h1:PIEt8X02hGcP8JWbeHyeZ53Y/jReSnHgO035n//V5WE= +github.com/prometheus/client_golang v1.20.3 h1:oPksm4K8B+Vt35tUhw6GbSNSgVlVSBH0qELP/7u83l4= +github.com/prometheus/client_golang v1.20.3/go.mod h1:PIEt8X02hGcP8JWbeHyeZ53Y/jReSnHgO035n//V5WE= github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= @@ -274,6 +276,8 @@ github.com/prometheus/common v0.55.0 h1:KEi6DK7lXW/m7Ig5i47x0vRzuBsHuvJdi5ee6Y3G github.com/prometheus/common v0.55.0/go.mod h1:2SECS4xJG1kd8XF9IcM1gMX6510RAEL65zxzNImwdc8= github.com/prometheus/common v0.57.0 h1:Ro/rKjwdq9mZn1K5QPctzh+MA4Lp0BuYk5ZZEVhoNcY= github.com/prometheus/common v0.57.0/go.mod h1:7uRPFSUTbfZWsJ7MHY56sqt7hLQu3bxXHDnNhl8E9qI= +github.com/prometheus/common v0.59.1 h1:LXb1quJHWm1P6wq/U824uxYi4Sg0oGvNeUm1z5dJoX0= +github.com/prometheus/common v0.59.1/go.mod h1:GpWM7dewqmVYcd7SmRaiWVe9SSqjf0UrwnYnpEZNuT0= github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= github.com/prometheus/procfs v0.1.3/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU= @@ -398,6 +402,8 @@ golang.org/x/net v0.26.0 h1:soB7SVo0PWrY4vPW/+ay0jKDNScG2X9wFeYlXIvJsOQ= golang.org/x/net v0.26.0/go.mod h1:5YKkiSynbBIh3p6iOc/vibscux0x38BZDkn8sCUPxHE= golang.org/x/net v0.28.0 h1:a9JDOJc5GMUJ0+UDqmLT86WiEy7iWyIhz8gz8E4e5hE= golang.org/x/net v0.28.0/go.mod h1:yqtgsTWOOnlGLG9GFRrK3++bGOUEkNBoHZc8MEDWPNg= +golang.org/x/net v0.29.0 h1:5ORfpBpCs4HzDYoodCDBbwHzdR5UrLBZ3sOnUJmFoHo= +golang.org/x/net v0.29.0/go.mod h1:gLkgy8jTGERgjzMic6DS9+SP0ajcu6Xu3Orq/SpETg0= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= @@ -446,6 +452,8 @@ golang.org/x/sys v0.22.0 h1:RI27ohtqKCnwULzJLqkv897zojh5/DwS/ENaMzUOaWI= golang.org/x/sys v0.22.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/sys v0.24.0 h1:Twjiwq9dn6R1fQcyiK+wQyHWfaz/BJB+YIpzU/Cv3Xg= golang.org/x/sys v0.24.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +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/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.1-0.20181227161524-e6919f6577db/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= @@ -457,6 +465,8 @@ golang.org/x/text v0.16.0 h1:a94ExnEXNtEwYLGJSIUxnWoxoRz/ZcCsV63ROupILh4= golang.org/x/text v0.16.0/go.mod h1:GhwF1Be+LQoKShO3cGOHzqOgRrGaYc9AvblQOmPVHnI= golang.org/x/text v0.17.0 h1:XtiM5bkSOt+ewxlOE/aE/AKEHibwj/6gvWMl9Rsh0Qc= golang.org/x/text v0.17.0/go.mod h1:BuEKDfySbSR4drPmRPG/7iBdf8hvFMuRexcpahXilzY= +golang.org/x/text v0.18.0 h1:XvMDiNzPAl0jr17s6W9lcaIhGUfUORdGCNsuLmPG224= +golang.org/x/text v0.18.0/go.mod h1:BuEKDfySbSR4drPmRPG/7iBdf8hvFMuRexcpahXilzY= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= @@ -487,12 +497,16 @@ google.golang.org/genproto/googleapis/api v0.0.0-20240823204242-4ba0660f739c h1: google.golang.org/genproto/googleapis/api v0.0.0-20240823204242-4ba0660f739c/go.mod h1:fO8wJzT2zbQbAjbIoos1285VfEIYKDDY+Dt+WpTkh6g= 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/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-20240701130421-f6361c86f094 h1:BwIjyKYGsK9dMCBOorzRri8MQwmi7mT9rGHsCEinZkA= google.golang.org/genproto/googleapis/rpc v0.0.0-20240701130421-f6361c86f094/go.mod h1:Ue6ibwXGpU+dqIcODieyLOcgj7z8+IcskoNIgZxtrFY= google.golang.org/genproto/googleapis/rpc v0.0.0-20240823204242-4ba0660f739c h1:Kqjm4WpoWvwhMPcrAczoTyMySQmYa9Wy2iL6Con4zn8= google.golang.org/genproto/googleapis/rpc v0.0.0-20240823204242-4ba0660f739c/go.mod h1:UqMtugtsSgubUsoxbuAoiCXvqvErP7Gf0so0mK9tHxU= 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/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.14.0/go.mod h1:yo6s7OP7yaDglbqo1J04qKzAhqBH6lvTonzMVmEdcZw= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= google.golang.org/grpc v1.22.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= From 06da692dfb097b7237c2aa5c587e0e19674e98a5 Mon Sep 17 00:00:00 2001 From: Ahmad Anvari Date: Tue, 10 Sep 2024 15:34:25 +0330 Subject: [PATCH 627/660] feat: make stacktrace of the logger configurable --- internal/logger/logger.go | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/internal/logger/logger.go b/internal/logger/logger.go index adca4007..a9dc10eb 100644 --- a/internal/logger/logger.go +++ b/internal/logger/logger.go @@ -9,7 +9,8 @@ import ( ) type Config struct { - Level string `json:"level,omitempty" koanf:"level"` + Level string `json:"level,omitempty" koanf:"level"` + Stacktrace bool `json:"stacktrace,omitempty" koanf:"stacktrace"` } // New creates a zap logger for console. @@ -28,7 +29,12 @@ func New(cfg Config) *zap.Logger { } core := zapcore.NewTee(cores...) - logger := zap.New(core, zap.AddCaller(), zap.AddStacktrace(zap.ErrorLevel)) + var zapOpts = make([]zap.Option, 0, 2) + zapOpts = append(zapOpts, zap.AddCaller()) + if cfg.Stacktrace { + zapOpts = append(zapOpts, zap.AddStacktrace(zap.ErrorLevel)) + } + logger := zap.New(core, zapOpts...) return logger } From c61729ecbd9b87662491666401b5dd733fd65a68 Mon Sep 17 00:00:00 2001 From: Ahmad Anvari Date: Tue, 10 Sep 2024 15:35:11 +0330 Subject: [PATCH 628/660] chore: set default stacktrace true --- internal/config/default.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/internal/config/default.go b/internal/config/default.go index 24bf6ee2..3b8aeb62 100644 --- a/internal/config/default.go +++ b/internal/config/default.go @@ -24,7 +24,8 @@ func Default() Config { SnappVendor(), }, Logger: logger.Config{ - Level: "debug", + Level: "debug", + Stacktrace: true, }, HTTPPort: DefaultHTTPPort, Tracer: tracing.Config{ From c6b878e931d77c41cbabe4ee38dba101248a46e3 Mon Sep 17 00:00:00 2001 From: Ahmad Anvari Date: Tue, 10 Sep 2024 15:39:12 +0330 Subject: [PATCH 629/660] feat: set default config for stacktrace --- charts/soteria/values.yaml | 1 + config.example.yml | 1 + 2 files changed, 2 insertions(+) diff --git a/charts/soteria/values.yaml b/charts/soteria/values.yaml index 167fec68..60ef7ec1 100644 --- a/charts/soteria/values.yaml +++ b/charts/soteria/values.yaml @@ -46,6 +46,7 @@ config: http_port: 9999 logger: level: "debug" + stacktrace: true tracer: enabled: false diff --git a/config.example.yml b/config.example.yml index e6a661cc..01f90f2e 100644 --- a/config.example.yml +++ b/config.example.yml @@ -5,6 +5,7 @@ http_port: 9999 # Application logger config: logger: level: debug + stacktrace: true # Validator is the upstream backend service that can validate the tokens: validator: url: http://validator-lb From fac7a4b3de29ed25dad8a22779bd6f481b2b0b87 Mon Sep 17 00:00:00 2001 From: Ahmad Anvari Date: Tue, 10 Sep 2024 15:48:43 +0330 Subject: [PATCH 630/660] fix: lint issues --- internal/logger/logger.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/internal/logger/logger.go b/internal/logger/logger.go index a9dc10eb..e6f3bce9 100644 --- a/internal/logger/logger.go +++ b/internal/logger/logger.go @@ -9,7 +9,7 @@ import ( ) type Config struct { - Level string `json:"level,omitempty" koanf:"level"` + Level string `json:"level,omitempty" koanf:"level"` Stacktrace bool `json:"stacktrace,omitempty" koanf:"stacktrace"` } @@ -31,9 +31,11 @@ func New(cfg Config) *zap.Logger { core := zapcore.NewTee(cores...) var zapOpts = make([]zap.Option, 0, 2) zapOpts = append(zapOpts, zap.AddCaller()) + if cfg.Stacktrace { zapOpts = append(zapOpts, zap.AddStacktrace(zap.ErrorLevel)) } + logger := zap.New(core, zapOpts...) return logger From f0d66f0e135fbe7cd0efcbf13ac9b33533c48ad0 Mon Sep 17 00:00:00 2001 From: Ahmad Anvari Date: Tue, 10 Sep 2024 16:29:50 +0330 Subject: [PATCH 631/660] gofumpt --- internal/logger/logger.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/logger/logger.go b/internal/logger/logger.go index e6f3bce9..646e5885 100644 --- a/internal/logger/logger.go +++ b/internal/logger/logger.go @@ -29,7 +29,7 @@ func New(cfg Config) *zap.Logger { } core := zapcore.NewTee(cores...) - var zapOpts = make([]zap.Option, 0, 2) + zapOpts := make([]zap.Option, 0, 2) zapOpts = append(zapOpts, zap.AddCaller()) if cfg.Stacktrace { From 40d9519629e0260926ddac7c231975373afe7bc0 Mon Sep 17 00:00:00 2001 From: Ahmad Anvari Date: Tue, 10 Sep 2024 16:39:15 +0330 Subject: [PATCH 632/660] chore: notlint mnd --- internal/logger/logger.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/logger/logger.go b/internal/logger/logger.go index 646e5885..e474b220 100644 --- a/internal/logger/logger.go +++ b/internal/logger/logger.go @@ -29,7 +29,7 @@ func New(cfg Config) *zap.Logger { } core := zapcore.NewTee(cores...) - zapOpts := make([]zap.Option, 0, 2) + zapOpts := make([]zap.Option, 0, 2) // nolint:mnd zapOpts = append(zapOpts, zap.AddCaller()) if cfg.Stacktrace { From e971027a372119d4f6b9a7909fd803d13ded505f Mon Sep 17 00:00:00 2001 From: Ahmad Anvari Date: Tue, 10 Sep 2024 17:23:30 +0330 Subject: [PATCH 633/660] feat: implement everything --- internal/authenticator/auto_authenticator.go | 54 +++++++++++++++++-- .../authenticator/auto_authenticator_test.go | 11 ++-- internal/authenticator/builder.go | 34 ++++++------ .../authenticator/manual_authenticator.go | 1 + .../manual_authenticator_test.go | 7 +-- internal/config/config.go | 8 ++- pkg/validator/client.go | 5 ++ 7 files changed, 93 insertions(+), 27 deletions(-) diff --git a/internal/authenticator/auto_authenticator.go b/internal/authenticator/auto_authenticator.go index 50ce0bf8..7a00f223 100644 --- a/internal/authenticator/auto_authenticator.go +++ b/internal/authenticator/auto_authenticator.go @@ -6,13 +6,15 @@ import ( "net/http" "github.com/golang-jwt/jwt/v5" + "go.opentelemetry.io/otel" + "go.opentelemetry.io/otel/propagation" + "go.opentelemetry.io/otel/trace" + "go.uber.org/zap" + "github.com/snapp-incubator/soteria/internal/config" "github.com/snapp-incubator/soteria/internal/topics" "github.com/snapp-incubator/soteria/pkg/acl" "github.com/snapp-incubator/soteria/pkg/validator" - "go.opentelemetry.io/otel" - "go.opentelemetry.io/otel/propagation" - "go.opentelemetry.io/otel/trace" ) // AutoAuthenticator is responsible for Acl/Auth/Token of users. @@ -24,6 +26,8 @@ type AutoAuthenticator struct { Validator validator.Client Parser *jwt.Parser Tracer trace.Tracer + Logger *zap.Logger + blackList autoBlackListChecker } // Auth check user authentication by checking the user's token @@ -43,10 +47,25 @@ func (a AutoAuthenticator) Auth(tokenString string) error { otel.GetTextMapPropagator().Inject(ctx, propagation.HeaderCarrier(headers)) - if _, err := a.Validator.Validate(ctx, headers, "bearer "+tokenString); err != nil { + payload, err := a.Validator.Validate(ctx, headers, "bearer "+tokenString) + if err != nil { return fmt.Errorf("token is invalid: %w", err) } + if a.blackList.isBlackList(payload.UserID, payload.Iss) { + a.Logger.Warn("blacklisted user is requesting!", + zap.Int("iat", payload.IAT), + zap.String("aud", payload.Aud), + zap.Int("iss", payload.Iss), + zap.String("sub", payload.Sub), + zap.Int("user_id", payload.UserID), + zap.String("email", payload.Email), + zap.Int("exp", payload.Exp), + zap.String("locale", payload.Locale), + zap.String("sid", payload.Sid), + ) + } + return nil } @@ -114,3 +133,30 @@ func (a AutoAuthenticator) GetCompany() string { func (a AutoAuthenticator) IsSuperuser() bool { return false } + +type autoBlackListChecker struct { + users map[int]struct{} + iss int +} + +func NewAutoBlackListChecker(cfg config.BlackListUserLogging) autoBlackListChecker { + users := make(map[int]struct{}) + for _, userID := range cfg.UserIDs { + users[userID] = struct{}{} + } + + return autoBlackListChecker{ + users: users, + iss: cfg.Iss, + } +} + +func (a autoBlackListChecker) isBlackList(userID, iss int) bool { + if iss != a.iss { + return false + } + + _, ok := a.users[userID] + + return ok +} diff --git a/internal/authenticator/auto_authenticator_test.go b/internal/authenticator/auto_authenticator_test.go index 422041d4..fd027793 100644 --- a/internal/authenticator/auto_authenticator_test.go +++ b/internal/authenticator/auto_authenticator_test.go @@ -10,15 +10,16 @@ import ( "time" "github.com/golang-jwt/jwt/v5" + "github.com/stretchr/testify/require" + "github.com/stretchr/testify/suite" + "go.opentelemetry.io/otel/trace/noop" + "go.uber.org/zap" + "github.com/snapp-incubator/soteria/internal/authenticator" "github.com/snapp-incubator/soteria/internal/config" "github.com/snapp-incubator/soteria/internal/topics" "github.com/snapp-incubator/soteria/pkg/acl" "github.com/snapp-incubator/soteria/pkg/validator" - "github.com/stretchr/testify/require" - "github.com/stretchr/testify/suite" - "go.opentelemetry.io/otel/trace/noop" - "go.uber.org/zap" ) type AutoAuthenticatorTestSuite struct { @@ -100,6 +101,7 @@ func (suite *AutoAuthenticatorTestSuite) SetupSuite() { SubName: "sub", SigningMethod: "rsa256", }, + Logger: zap.NewNop(), } } @@ -132,6 +134,7 @@ func TestAutoAuthenticator_ValidateTopicBySender(t *testing.T) { AllowedAccessTypes: []acl.AccessType{acl.Pub, acl.Sub}, Company: "snapp", TopicManager: topics.NewTopicManager(cfg.Topics, hid, "snapp", cfg.IssEntityMap, cfg.IssPeerMap, zap.NewNop()), + Logger: zap.NewNop(), } t.Run("testing valid driver cab event", func(t *testing.T) { diff --git a/internal/authenticator/builder.go b/internal/authenticator/builder.go index f124001b..73b244fa 100644 --- a/internal/authenticator/builder.go +++ b/internal/authenticator/builder.go @@ -5,12 +5,13 @@ import ( "fmt" "github.com/golang-jwt/jwt/v5" + "go.opentelemetry.io/otel/trace" + "go.uber.org/zap" + "github.com/snapp-incubator/soteria/internal/config" "github.com/snapp-incubator/soteria/internal/topics" "github.com/snapp-incubator/soteria/pkg/acl" "github.com/snapp-incubator/soteria/pkg/validator" - "go.opentelemetry.io/otel/trace" - "go.uber.org/zap" ) var ( @@ -22,10 +23,11 @@ var ( ) type Builder struct { - Vendors []config.Vendor - Logger *zap.Logger - ValidatorConfig config.Validator - Tracer trace.Tracer + Vendors []config.Vendor + Logger *zap.Logger + ValidatorConfig config.Validator + Tracer trace.Tracer + BlackListUserLoggingConfig config.BlackListUserLogging } func (b Builder) Authenticators() (map[string]Authenticator, error) { @@ -122,13 +124,13 @@ func (b Builder) manualAuthenticator(vendor config.Vendor) (*ManualAuthenticator }, nil } -func (b Builder) autoAuthenticator(vendor config.Vendor) (*AutoAuthenticator, error) { - allowedAccessTypes, err := b.GetAllowedAccessTypes(vendor.AllowedAccessTypes) +func (b Builder) autoAuthenticator(vendorCfg config.Vendor, blackListUserLoggingCfg config.BlackListUserLogging) (*AutoAuthenticator, error) { + allowedAccessTypes, err := b.GetAllowedAccessTypes(vendorCfg.AllowedAccessTypes) if err != nil { return nil, fmt.Errorf("cannot parse allowed access types %w", err) } - hid, err := topics.NewHashIDManager(vendor.HashIDMap) + hid, err := topics.NewHashIDManager(vendorCfg.HashIDMap) if err != nil { return nil, fmt.Errorf("cannot create hash-id manager %w", err) } @@ -137,19 +139,21 @@ func (b Builder) autoAuthenticator(vendor config.Vendor) (*AutoAuthenticator, er return &AutoAuthenticator{ AllowedAccessTypes: allowedAccessTypes, - Company: vendor.Company, + Company: vendorCfg.Company, TopicManager: topics.NewTopicManager( - vendor.Topics, + vendorCfg.Topics, hid, - vendor.Company, - vendor.IssEntityMap, - vendor.IssPeerMap, + vendorCfg.Company, + vendorCfg.IssEntityMap, + vendorCfg.IssPeerMap, b.Logger.Named("topic-manager"), ), Tracer: b.Tracer, - JWTConfig: vendor.Jwt, + JWTConfig: vendorCfg.Jwt, Validator: client, Parser: jwt.NewParser(), + Logger: b.Logger.Named("auto-authenticator"), + blackList: NewAutoBlackListChecker(blackListUserLoggingCfg), }, nil } diff --git a/internal/authenticator/manual_authenticator.go b/internal/authenticator/manual_authenticator.go index 07afd915..a7224658 100644 --- a/internal/authenticator/manual_authenticator.go +++ b/internal/authenticator/manual_authenticator.go @@ -4,6 +4,7 @@ import ( "fmt" "github.com/golang-jwt/jwt/v5" + "github.com/snapp-incubator/soteria/internal/config" "github.com/snapp-incubator/soteria/internal/topics" "github.com/snapp-incubator/soteria/pkg/acl" diff --git a/internal/authenticator/manual_authenticator_test.go b/internal/authenticator/manual_authenticator_test.go index c3795963..34d547cf 100644 --- a/internal/authenticator/manual_authenticator_test.go +++ b/internal/authenticator/manual_authenticator_test.go @@ -5,13 +5,14 @@ import ( "testing" "github.com/golang-jwt/jwt/v5" + "github.com/stretchr/testify/require" + "github.com/stretchr/testify/suite" + "go.uber.org/zap" + "github.com/snapp-incubator/soteria/internal/authenticator" "github.com/snapp-incubator/soteria/internal/config" "github.com/snapp-incubator/soteria/internal/topics" "github.com/snapp-incubator/soteria/pkg/acl" - "github.com/stretchr/testify/require" - "github.com/stretchr/testify/suite" - "go.uber.org/zap" ) type ManualAuthenticatorSnappTestSuite struct { diff --git a/internal/config/config.go b/internal/config/config.go index 1b7de39f..f74eff6e 100644 --- a/internal/config/config.go +++ b/internal/config/config.go @@ -11,10 +11,11 @@ import ( "github.com/knadh/koanf/providers/file" "github.com/knadh/koanf/providers/structs" "github.com/knadh/koanf/v2" + "github.com/tidwall/pretty" + "github.com/snapp-incubator/soteria/internal/logger" "github.com/snapp-incubator/soteria/internal/topics" "github.com/snapp-incubator/soteria/internal/tracing" - "github.com/tidwall/pretty" ) const ( @@ -55,6 +56,11 @@ type ( URL string `json:"url,omitempty" koanf:"url"` Timeout time.Duration `json:"timeout,omitempty" koanf:"timeout"` } + + BlackListUserLogging struct { + Iss int `json:"iss,omitempty" koanf:"iss"` + UserIDs []int `json:"user_ids,omitempty" koanf:"user_ids"` + } ) // New reads configuration with koanf. diff --git a/pkg/validator/client.go b/pkg/validator/client.go index c60b6bd5..b8980711 100644 --- a/pkg/validator/client.go +++ b/pkg/validator/client.go @@ -43,6 +43,7 @@ type Payload struct { Email string `json:"email"` Exp int `json:"exp"` Locale string `json:"locale"` + Sid string `json:"sid"` } // New creates a new Client with default attributes. @@ -159,6 +160,10 @@ func (c *Client) Validate(parentCtx context.Context, headers http.Header, bearer payload.Locale = locale } + if sid, ok := userData["sid"].(string); ok { + payload.Sid = sid + } + return payload, nil } From 9ce17567c8591664c29c7508102b7d2f25d74e43 Mon Sep 17 00:00:00 2001 From: Ahmad Anvari Date: Tue, 10 Sep 2024 17:26:22 +0330 Subject: [PATCH 634/660] fix: init from the main config --- internal/authenticator/builder.go | 2 +- internal/cmd/serve/main.go | 16 +++++++++------- internal/config/config.go | 13 +++++++------ 3 files changed, 17 insertions(+), 14 deletions(-) diff --git a/internal/authenticator/builder.go b/internal/authenticator/builder.go index 73b244fa..98885db8 100644 --- a/internal/authenticator/builder.go +++ b/internal/authenticator/builder.go @@ -41,7 +41,7 @@ func (b Builder) Authenticators() (map[string]Authenticator, error) { switch vendor.Type { case "auto", "validator", "validator-based", "using-validator": - auth, err = b.autoAuthenticator(vendor) + auth, err = b.autoAuthenticator(vendor, b.BlackListUserLoggingConfig) if err != nil { return nil, fmt.Errorf("cannot build auto authenticator %w", err) } diff --git a/internal/cmd/serve/main.go b/internal/cmd/serve/main.go index 4729d9ff..65b3df01 100644 --- a/internal/cmd/serve/main.go +++ b/internal/cmd/serve/main.go @@ -7,12 +7,13 @@ import ( "os" "os/signal" - "github.com/snapp-incubator/soteria/internal/api" - "github.com/snapp-incubator/soteria/internal/authenticator" - "github.com/snapp-incubator/soteria/internal/config" "github.com/spf13/cobra" "go.opentelemetry.io/otel/trace" "go.uber.org/zap" + + "github.com/snapp-incubator/soteria/internal/api" + "github.com/snapp-incubator/soteria/internal/authenticator" + "github.com/snapp-incubator/soteria/internal/config" ) type Serve struct { @@ -23,10 +24,11 @@ type Serve struct { func (s Serve) main() { auth, err := authenticator.Builder{ - Vendors: s.Cfg.Vendors, - Logger: s.Logger, - ValidatorConfig: s.Cfg.Validator, - Tracer: s.Tracer, + Vendors: s.Cfg.Vendors, + Logger: s.Logger, + ValidatorConfig: s.Cfg.Validator, + Tracer: s.Tracer, + BlackListUserLoggingConfig: s.Cfg.BlackListUserLogging, }.Authenticators() if err != nil { s.Logger.Fatal("authenticator building failed", zap.Error(err)) diff --git a/internal/config/config.go b/internal/config/config.go index f74eff6e..6b4a8114 100644 --- a/internal/config/config.go +++ b/internal/config/config.go @@ -26,12 +26,13 @@ const ( type ( // Config is the main container of Soteria's config. Config struct { - Vendors []Vendor `json:"vendors,omitempty" koanf:"vendors"` - Logger logger.Config `json:"logger,omitempty" koanf:"logger"` - HTTPPort int `json:"http_port,omitempty" koanf:"http_port"` - Tracer tracing.Config `json:"tracer,omitempty" koanf:"tracer"` - DefaultVendor string `json:"default_vendor,omitempty" koanf:"default_vendor"` - Validator Validator `json:"validator,omitempty" koanf:"validator"` + Vendors []Vendor `json:"vendors,omitempty" koanf:"vendors"` + Logger logger.Config `json:"logger,omitempty" koanf:"logger"` + HTTPPort int `json:"http_port,omitempty" koanf:"http_port"` + Tracer tracing.Config `json:"tracer,omitempty" koanf:"tracer"` + DefaultVendor string `json:"default_vendor,omitempty" koanf:"default_vendor"` + Validator Validator `json:"validator,omitempty" koanf:"validator"` + BlackListUserLogging BlackListUserLogging `json:"black_list_user_logging,omitempty" koanf:"black_list_user_logging"` } Vendor struct { From 435b1e10f3be15226fced753e55ab28822dde2d6 Mon Sep 17 00:00:00 2001 From: Ahmad Anvari Date: Tue, 10 Sep 2024 17:30:12 +0330 Subject: [PATCH 635/660] feat: add default configs --- charts/soteria/values.yaml | 1 + config.example.yml | 4 ++++ internal/config/default.go | 4 ++++ 3 files changed, 9 insertions(+) diff --git a/charts/soteria/values.yaml b/charts/soteria/values.yaml index 60ef7ec1..a64497c3 100644 --- a/charts/soteria/values.yaml +++ b/charts/soteria/values.yaml @@ -50,6 +50,7 @@ config: tracer: enabled: false + vendors: snapp: company: "snapp" diff --git a/config.example.yml b/config.example.yml index 01f90f2e..7e23900a 100644 --- a/config.example.yml +++ b/config.example.yml @@ -6,6 +6,10 @@ http_port: 9999 logger: level: debug stacktrace: true +black_list_user_logging: + iss: 0 + user_ids: [] + # Validator is the upstream backend service that can validate the tokens: validator: url: http://validator-lb diff --git a/internal/config/default.go b/internal/config/default.go index 3b8aeb62..111cd2e5 100644 --- a/internal/config/default.go +++ b/internal/config/default.go @@ -37,6 +37,10 @@ func Default() Config { URL: "http://validator-lb", Timeout: 5 * time.Second, }, + BlackListUserLogging: BlackListUserLogging{ + Iss: 0, + UserIDs: []int{}, + }, } } From b2fbd233d20af96f77eeaf60db2b8599f1412d8f Mon Sep 17 00:00:00 2001 From: Ahmad Anvari Date: Tue, 10 Sep 2024 17:34:56 +0330 Subject: [PATCH 636/660] fix: lint issue --- internal/authenticator/auto_authenticator.go | 2 +- internal/authenticator/builder.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/internal/authenticator/auto_authenticator.go b/internal/authenticator/auto_authenticator.go index 7a00f223..47209e8b 100644 --- a/internal/authenticator/auto_authenticator.go +++ b/internal/authenticator/auto_authenticator.go @@ -139,7 +139,7 @@ type autoBlackListChecker struct { iss int } -func NewAutoBlackListChecker(cfg config.BlackListUserLogging) autoBlackListChecker { +func newAutoBlackListChecker(cfg config.BlackListUserLogging) autoBlackListChecker { users := make(map[int]struct{}) for _, userID := range cfg.UserIDs { users[userID] = struct{}{} diff --git a/internal/authenticator/builder.go b/internal/authenticator/builder.go index 98885db8..1050a86a 100644 --- a/internal/authenticator/builder.go +++ b/internal/authenticator/builder.go @@ -153,7 +153,7 @@ func (b Builder) autoAuthenticator(vendorCfg config.Vendor, blackListUserLogging Validator: client, Parser: jwt.NewParser(), Logger: b.Logger.Named("auto-authenticator"), - blackList: NewAutoBlackListChecker(blackListUserLoggingCfg), + blackList: newAutoBlackListChecker(blackListUserLoggingCfg), }, nil } From 18c5862eced9cb187a7f096a480d05379fc2cd70 Mon Sep 17 00:00:00 2001 From: Ahmad Anvari Date: Tue, 10 Sep 2024 17:35:07 +0330 Subject: [PATCH 637/660] add default config to helm chart --- charts/soteria/values.yaml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/charts/soteria/values.yaml b/charts/soteria/values.yaml index a64497c3..8e783d57 100644 --- a/charts/soteria/values.yaml +++ b/charts/soteria/values.yaml @@ -50,6 +50,9 @@ config: tracer: enabled: false +black_list_user_logging: + iss: 0 + user_ids: [] vendors: snapp: From a1d23abdac90ceac55e9c6686c131f2b62cc749c Mon Sep 17 00:00:00 2001 From: Ahmad Anvari Date: Tue, 10 Sep 2024 17:40:23 +0330 Subject: [PATCH 638/660] gci file --- internal/authenticator/auto_authenticator.go | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/internal/authenticator/auto_authenticator.go b/internal/authenticator/auto_authenticator.go index 47209e8b..c551d144 100644 --- a/internal/authenticator/auto_authenticator.go +++ b/internal/authenticator/auto_authenticator.go @@ -6,15 +6,14 @@ import ( "net/http" "github.com/golang-jwt/jwt/v5" - "go.opentelemetry.io/otel" - "go.opentelemetry.io/otel/propagation" - "go.opentelemetry.io/otel/trace" - "go.uber.org/zap" - "github.com/snapp-incubator/soteria/internal/config" "github.com/snapp-incubator/soteria/internal/topics" "github.com/snapp-incubator/soteria/pkg/acl" "github.com/snapp-incubator/soteria/pkg/validator" + "go.opentelemetry.io/otel" + "go.opentelemetry.io/otel/propagation" + "go.opentelemetry.io/otel/trace" + "go.uber.org/zap" ) // AutoAuthenticator is responsible for Acl/Auth/Token of users. From 4a51ecdd869066a8bf697bdc16deb1f3f05b45cd Mon Sep 17 00:00:00 2001 From: Ahmad Anvari Date: Tue, 10 Sep 2024 17:43:51 +0330 Subject: [PATCH 639/660] gci file config --- internal/config/config.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/internal/config/config.go b/internal/config/config.go index 6b4a8114..e782858d 100644 --- a/internal/config/config.go +++ b/internal/config/config.go @@ -11,11 +11,10 @@ import ( "github.com/knadh/koanf/providers/file" "github.com/knadh/koanf/providers/structs" "github.com/knadh/koanf/v2" - "github.com/tidwall/pretty" - "github.com/snapp-incubator/soteria/internal/logger" "github.com/snapp-incubator/soteria/internal/topics" "github.com/snapp-incubator/soteria/internal/tracing" + "github.com/tidwall/pretty" ) const ( From 73b19a3c8b83dc65289deff226a28cf9aec6ac77 Mon Sep 17 00:00:00 2001 From: Ahmad Anvari Date: Tue, 10 Sep 2024 17:44:57 +0330 Subject: [PATCH 640/660] fix: line len --- internal/authenticator/builder.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/internal/authenticator/builder.go b/internal/authenticator/builder.go index 1050a86a..2cb6ab99 100644 --- a/internal/authenticator/builder.go +++ b/internal/authenticator/builder.go @@ -124,7 +124,8 @@ func (b Builder) manualAuthenticator(vendor config.Vendor) (*ManualAuthenticator }, nil } -func (b Builder) autoAuthenticator(vendorCfg config.Vendor, blackListUserLoggingCfg config.BlackListUserLogging) (*AutoAuthenticator, error) { +func (b Builder) autoAuthenticator(vendorCfg config.Vendor, blackListUserLoggingCfg config.BlackListUserLogging) ( + *AutoAuthenticator, error) { allowedAccessTypes, err := b.GetAllowedAccessTypes(vendorCfg.AllowedAccessTypes) if err != nil { return nil, fmt.Errorf("cannot parse allowed access types %w", err) From e54dcfdea5529c564a7c249c4ba7a93deb65d752 Mon Sep 17 00:00:00 2001 From: Ahmad Anvari Date: Tue, 10 Sep 2024 17:46:30 +0330 Subject: [PATCH 641/660] fix: tag aline --- internal/config/config.go | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/internal/config/config.go b/internal/config/config.go index e782858d..2bfb69ca 100644 --- a/internal/config/config.go +++ b/internal/config/config.go @@ -25,12 +25,12 @@ const ( type ( // Config is the main container of Soteria's config. Config struct { - Vendors []Vendor `json:"vendors,omitempty" koanf:"vendors"` - Logger logger.Config `json:"logger,omitempty" koanf:"logger"` - HTTPPort int `json:"http_port,omitempty" koanf:"http_port"` - Tracer tracing.Config `json:"tracer,omitempty" koanf:"tracer"` - DefaultVendor string `json:"default_vendor,omitempty" koanf:"default_vendor"` - Validator Validator `json:"validator,omitempty" koanf:"validator"` + Vendors []Vendor `json:"vendors,omitempty" koanf:"vendors"` + Logger logger.Config `json:"logger,omitempty" koanf:"logger"` + HTTPPort int `json:"http_port,omitempty" koanf:"http_port"` + Tracer tracing.Config `json:"tracer,omitempty" koanf:"tracer"` + DefaultVendor string `json:"default_vendor,omitempty" koanf:"default_vendor"` + Validator Validator `json:"validator,omitempty" koanf:"validator"` BlackListUserLogging BlackListUserLogging `json:"black_list_user_logging,omitempty" koanf:"black_list_user_logging"` } From b993beded411072f658f8a2e28db3516f2aadc6c Mon Sep 17 00:00:00 2001 From: Ahmad Anvari Date: Tue, 10 Sep 2024 17:47:16 +0330 Subject: [PATCH 642/660] fix: tag aline --- internal/config/config.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/internal/config/config.go b/internal/config/config.go index 2bfb69ca..708be159 100644 --- a/internal/config/config.go +++ b/internal/config/config.go @@ -14,7 +14,6 @@ import ( "github.com/snapp-incubator/soteria/internal/logger" "github.com/snapp-incubator/soteria/internal/topics" "github.com/snapp-incubator/soteria/internal/tracing" - "github.com/tidwall/pretty" ) const ( @@ -58,7 +57,7 @@ type ( } BlackListUserLogging struct { - Iss int `json:"iss,omitempty" koanf:"iss"` + Iss int `json:"iss,omitempty" koanf:"iss"` UserIDs []int `json:"user_ids,omitempty" koanf:"user_ids"` } ) From 5954decd2fb4ad9b26546b5c117a269a6ad11c1f Mon Sep 17 00:00:00 2001 From: Ahmad Anvari Date: Tue, 10 Sep 2024 17:50:29 +0330 Subject: [PATCH 643/660] gci file config --- internal/authenticator/auto_authenticator_test.go | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/internal/authenticator/auto_authenticator_test.go b/internal/authenticator/auto_authenticator_test.go index fd027793..71c78801 100644 --- a/internal/authenticator/auto_authenticator_test.go +++ b/internal/authenticator/auto_authenticator_test.go @@ -10,16 +10,15 @@ import ( "time" "github.com/golang-jwt/jwt/v5" - "github.com/stretchr/testify/require" - "github.com/stretchr/testify/suite" - "go.opentelemetry.io/otel/trace/noop" - "go.uber.org/zap" - "github.com/snapp-incubator/soteria/internal/authenticator" "github.com/snapp-incubator/soteria/internal/config" "github.com/snapp-incubator/soteria/internal/topics" "github.com/snapp-incubator/soteria/pkg/acl" "github.com/snapp-incubator/soteria/pkg/validator" + "github.com/stretchr/testify/require" + "github.com/stretchr/testify/suite" + "go.opentelemetry.io/otel/trace/noop" + "go.uber.org/zap" ) type AutoAuthenticatorTestSuite struct { From 610e2d3a7ddde65262adaa1eaac4f9e114569057 Mon Sep 17 00:00:00 2001 From: Ahmad Anvari Date: Tue, 10 Sep 2024 17:51:20 +0330 Subject: [PATCH 644/660] gci file config --- internal/config/config.go | 1 + 1 file changed, 1 insertion(+) diff --git a/internal/config/config.go b/internal/config/config.go index 708be159..9ab4272f 100644 --- a/internal/config/config.go +++ b/internal/config/config.go @@ -14,6 +14,7 @@ import ( "github.com/snapp-incubator/soteria/internal/logger" "github.com/snapp-incubator/soteria/internal/topics" "github.com/snapp-incubator/soteria/internal/tracing" + "github.com/tidwall/pretty" ) const ( From 15fb039a5deee5e0ced62bb5cb726550b155fc5e Mon Sep 17 00:00:00 2001 From: Ahmad Anvari Date: Tue, 10 Sep 2024 18:04:23 +0330 Subject: [PATCH 645/660] gci file config --- internal/config/config.go | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/internal/config/config.go b/internal/config/config.go index 9ab4272f..8fd847ed 100644 --- a/internal/config/config.go +++ b/internal/config/config.go @@ -25,13 +25,13 @@ const ( type ( // Config is the main container of Soteria's config. Config struct { - Vendors []Vendor `json:"vendors,omitempty" koanf:"vendors"` - Logger logger.Config `json:"logger,omitempty" koanf:"logger"` - HTTPPort int `json:"http_port,omitempty" koanf:"http_port"` - Tracer tracing.Config `json:"tracer,omitempty" koanf:"tracer"` - DefaultVendor string `json:"default_vendor,omitempty" koanf:"default_vendor"` - Validator Validator `json:"validator,omitempty" koanf:"validator"` - BlackListUserLogging BlackListUserLogging `json:"black_list_user_logging,omitempty" koanf:"black_list_user_logging"` + Vendors []Vendor `json:"vendors,omitempty" koanf:"vendors"` + Logger logger.Config `json:"logger,omitempty" koanf:"logger"` + HTTPPort int `json:"http_port,omitempty" koanf:"http_port"` + Tracer tracing.Config `json:"tracer,omitempty" koanf:"tracer"` + DefaultVendor string `json:"default_vendor,omitempty" koanf:"default_vendor"` + Validator Validator `json:"validator,omitempty" koanf:"validator"` + BlackListUserLogging BlackListUserLogging `json:"black_list_user_logging,omitempty" koanf:"black_list_user_logging"` } Vendor struct { @@ -58,8 +58,8 @@ type ( } BlackListUserLogging struct { - Iss int `json:"iss,omitempty" koanf:"iss"` - UserIDs []int `json:"user_ids,omitempty" koanf:"user_ids"` + Iss int `json:"iss,omitempty" koanf:"iss"` + UserIDs []int `json:"user_ids,omitempty" koanf:"user_ids"` } ) From 9815e47790e1a244b9e2227388ff0ca0c3db141a Mon Sep 17 00:00:00 2001 From: Ahmad Anvari Date: Tue, 10 Sep 2024 18:05:21 +0330 Subject: [PATCH 646/660] gci file --- internal/authenticator/manual_authenticator.go | 1 - 1 file changed, 1 deletion(-) diff --git a/internal/authenticator/manual_authenticator.go b/internal/authenticator/manual_authenticator.go index a7224658..07afd915 100644 --- a/internal/authenticator/manual_authenticator.go +++ b/internal/authenticator/manual_authenticator.go @@ -4,7 +4,6 @@ import ( "fmt" "github.com/golang-jwt/jwt/v5" - "github.com/snapp-incubator/soteria/internal/config" "github.com/snapp-incubator/soteria/internal/topics" "github.com/snapp-incubator/soteria/pkg/acl" From 0b2e5d25c0c19ce7c8e4c4e668c2506e2fc1986e Mon Sep 17 00:00:00 2001 From: Ahmad Anvari Date: Tue, 10 Sep 2024 18:05:59 +0330 Subject: [PATCH 647/660] gci file --- internal/authenticator/builder.go | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/internal/authenticator/builder.go b/internal/authenticator/builder.go index 2cb6ab99..0ea7c9fd 100644 --- a/internal/authenticator/builder.go +++ b/internal/authenticator/builder.go @@ -5,13 +5,12 @@ import ( "fmt" "github.com/golang-jwt/jwt/v5" - "go.opentelemetry.io/otel/trace" - "go.uber.org/zap" - "github.com/snapp-incubator/soteria/internal/config" "github.com/snapp-incubator/soteria/internal/topics" "github.com/snapp-incubator/soteria/pkg/acl" "github.com/snapp-incubator/soteria/pkg/validator" + "go.opentelemetry.io/otel/trace" + "go.uber.org/zap" ) var ( From 32593f9adeaf54694d0cb73c885cead01cdedcfd Mon Sep 17 00:00:00 2001 From: Ahmad Anvari Date: Tue, 10 Sep 2024 18:07:59 +0330 Subject: [PATCH 648/660] fix gci --- internal/authenticator/builder_test.go | 36 ++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/internal/authenticator/builder_test.go b/internal/authenticator/builder_test.go index b5227b7f..9280f650 100644 --- a/internal/authenticator/builder_test.go +++ b/internal/authenticator/builder_test.go @@ -24,6 +24,10 @@ func TestBuilderWithoutAuthenticator(t *testing.T) { URL: "", Timeout: 0, }, + BlackListUserLoggingConfig: config.BlackListUserLogging{ + Iss: 0, + UserIDs: []int{}, + }, } _, err := b.Authenticators() @@ -61,6 +65,10 @@ func TestBuilderInvalidAuthenticator(t *testing.T) { URL: "", Timeout: 0, }, + BlackListUserLoggingConfig: config.BlackListUserLogging{ + Iss: 0, + UserIDs: []int{}, + }, } _, err := b.Authenticators() @@ -98,6 +106,10 @@ func TestBuilderInternalAuthenticator(t *testing.T) { URL: "", Timeout: 0, }, + BlackListUserLoggingConfig: config.BlackListUserLogging{ + Iss: 0, + UserIDs: []int{}, + }, } vendors, err := b.Authenticators() @@ -137,6 +149,10 @@ func TestBuilderInternalAuthenticatorWithInvalidKey(t *testing.T) { URL: "", Timeout: 0, }, + BlackListUserLoggingConfig: config.BlackListUserLogging{ + Iss: 0, + UserIDs: []int{}, + }, } _, err := b.Authenticators() @@ -191,6 +207,10 @@ func TestBuilderManualAuthenticatorWithoutKey(t *testing.T) { URL: "", Timeout: 0, }, + BlackListUserLoggingConfig: config.BlackListUserLogging{ + Iss: 0, + UserIDs: []int{}, + }, } _, err := b.Authenticators() @@ -266,6 +286,10 @@ func TestBuilderManualAuthenticator(t *testing.T) { URL: "", Timeout: 0, }, + BlackListUserLoggingConfig: config.BlackListUserLogging{ + Iss: 0, + UserIDs: []int{}, + }, } vendors, err := b.Authenticators() @@ -339,6 +363,10 @@ func TestBuilderManualAuthenticatorInvalidMapping_1(t *testing.T) { URL: "", Timeout: 0, }, + BlackListUserLoggingConfig: config.BlackListUserLogging{ + Iss: 0, + UserIDs: []int{}, + }, } _, err := b.Authenticators() @@ -413,6 +441,10 @@ func TestBuilderManualAuthenticatorInvalidMapping_2(t *testing.T) { URL: "", Timeout: 0, }, + BlackListUserLoggingConfig: config.BlackListUserLogging{ + Iss: 0, + UserIDs: []int{}, + }, } _, err := b.Authenticators() @@ -488,6 +520,10 @@ func TestBuilderManualAuthenticatorInvalidAccess(t *testing.T) { URL: "", Timeout: 0, }, + BlackListUserLoggingConfig: config.BlackListUserLogging{ + Iss: 0, + UserIDs: []int{}, + }, } _, err := b.Authenticators() From 18d216e2a62cd5a93a61df5af794d704aa155c27 Mon Sep 17 00:00:00 2001 From: Ahmad Anvari Date: Tue, 10 Sep 2024 18:11:00 +0330 Subject: [PATCH 649/660] fix: manual --- internal/authenticator/manual_authenticator_test.go | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/internal/authenticator/manual_authenticator_test.go b/internal/authenticator/manual_authenticator_test.go index 34d547cf..c3795963 100644 --- a/internal/authenticator/manual_authenticator_test.go +++ b/internal/authenticator/manual_authenticator_test.go @@ -5,14 +5,13 @@ import ( "testing" "github.com/golang-jwt/jwt/v5" - "github.com/stretchr/testify/require" - "github.com/stretchr/testify/suite" - "go.uber.org/zap" - "github.com/snapp-incubator/soteria/internal/authenticator" "github.com/snapp-incubator/soteria/internal/config" "github.com/snapp-incubator/soteria/internal/topics" "github.com/snapp-incubator/soteria/pkg/acl" + "github.com/stretchr/testify/require" + "github.com/stretchr/testify/suite" + "go.uber.org/zap" ) type ManualAuthenticatorSnappTestSuite struct { From 0090b1ef19cfbf03ebaa0779ecde000e863f7202 Mon Sep 17 00:00:00 2001 From: Ahmad Anvari Date: Tue, 10 Sep 2024 18:11:40 +0330 Subject: [PATCH 650/660] fix: manual --- internal/authenticator/builder_test.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/internal/authenticator/builder_test.go b/internal/authenticator/builder_test.go index 9280f650..3c351cc8 100644 --- a/internal/authenticator/builder_test.go +++ b/internal/authenticator/builder_test.go @@ -223,6 +223,7 @@ func TestBuilderManualAuthenticator(t *testing.T) { require := require.New(t) + // nolint: dupl b := authenticator.Builder{ Tracer: noop.NewTracerProvider().Tracer(""), Vendors: []config.Vendor{ @@ -457,6 +458,7 @@ func TestBuilderManualAuthenticatorInvalidAccess(t *testing.T) { require := require.New(t) + // nolint: dupl b := authenticator.Builder{ Tracer: noop.NewTracerProvider().Tracer(""), Vendors: []config.Vendor{ From 0261c3e00ffa541eaa6e51da83bca3976f72031b Mon Sep 17 00:00:00 2001 From: Ahmad Anvari Date: Tue, 10 Sep 2024 19:21:23 +0330 Subject: [PATCH 651/660] fix gci --- internal/cmd/serve/main.go | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/internal/cmd/serve/main.go b/internal/cmd/serve/main.go index 65b3df01..747b0d9f 100644 --- a/internal/cmd/serve/main.go +++ b/internal/cmd/serve/main.go @@ -7,13 +7,12 @@ import ( "os" "os/signal" - "github.com/spf13/cobra" - "go.opentelemetry.io/otel/trace" - "go.uber.org/zap" - "github.com/snapp-incubator/soteria/internal/api" "github.com/snapp-incubator/soteria/internal/authenticator" "github.com/snapp-incubator/soteria/internal/config" + "github.com/spf13/cobra" + "go.opentelemetry.io/otel/trace" + "go.uber.org/zap" ) type Serve struct { From d5de92a1f544479b89f057372f1c4e2bfec5da9a Mon Sep 17 00:00:00 2001 From: Ahmad Anvari Date: Tue, 10 Sep 2024 19:22:15 +0330 Subject: [PATCH 652/660] fix gofumpt --- internal/authenticator/builder.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/internal/authenticator/builder.go b/internal/authenticator/builder.go index 0ea7c9fd..dc1c2f8c 100644 --- a/internal/authenticator/builder.go +++ b/internal/authenticator/builder.go @@ -124,7 +124,8 @@ func (b Builder) manualAuthenticator(vendor config.Vendor) (*ManualAuthenticator } func (b Builder) autoAuthenticator(vendorCfg config.Vendor, blackListUserLoggingCfg config.BlackListUserLogging) ( - *AutoAuthenticator, error) { + *AutoAuthenticator, error, +) { allowedAccessTypes, err := b.GetAllowedAccessTypes(vendorCfg.AllowedAccessTypes) if err != nil { return nil, fmt.Errorf("cannot parse allowed access types %w", err) From 27871ba6a39c960a822aa711899817873e108b56 Mon Sep 17 00:00:00 2001 From: Ahmad Anvari Date: Tue, 10 Sep 2024 20:45:10 +0330 Subject: [PATCH 653/660] change log leve --- internal/api/auth.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/api/auth.go b/internal/api/auth.go index 3bd75798..9ed56b04 100644 --- a/internal/api/auth.go +++ b/internal/api/auth.go @@ -61,7 +61,7 @@ func (a API) Authv1(c *fiber.Ctx) error { if !errors.Is(err, jwt.ErrTokenExpired) { a.Logger. - Error("auth request is not authorized", + Debug("auth request is not authorized", zap.Error(err), zap.String("token", request.Token), zap.String("username", request.Username), From da1f4ce0c123efcabe537ebc07e9aed8720412c6 Mon Sep 17 00:00:00 2001 From: Ahmad Anvari Date: Tue, 10 Sep 2024 20:58:35 +0330 Subject: [PATCH 654/660] change log leve --- internal/api/auth.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/api/auth.go b/internal/api/auth.go index 9ed56b04..d85f88d6 100644 --- a/internal/api/auth.go +++ b/internal/api/auth.go @@ -128,7 +128,7 @@ func (a API) Authv2(c *fiber.Ctx) error { if !errors.Is(err, jwt.ErrTokenExpired) { a.Logger. - Error("auth request is not authorized", + Debug("auth request is not authorized", zap.Error(err), zap.String("token", request.Token), zap.String("username", request.Username), From a75f8b5b6a2e5afd8ea90cef17c0f9b2b3a17c08 Mon Sep 17 00:00:00 2001 From: Ahmad Anvari Date: Tue, 10 Sep 2024 21:58:52 +0330 Subject: [PATCH 655/660] implement everything --- config.example.yml | 105 +++++++++++++++++- internal/authenticator/admin_authenticator.go | 5 +- internal/authenticator/auto_authenticator.go | 50 +++++++-- .../authenticator/manual_authenticator.go | 3 +- internal/config/config.go | 5 +- 5 files changed, 149 insertions(+), 19 deletions(-) diff --git a/config.example.yml b/config.example.yml index 7e23900a..7e6f74a4 100644 --- a/config.example.yml +++ b/config.example.yml @@ -7,8 +7,109 @@ logger: level: debug stacktrace: true black_list_user_logging: - iss: 0 - user_ids: [] + iss: 1 + user_ids: [ + 1450774, + 1458174, + 1465974, + 1470674, + 1478230, + 1505930, + 1508730, + 1513330, + 1527130, + 1532230, + 1543730, + 1556874, + 1558930, + 1567674, + 1585230, + 1600674, + 1603874, + 1616574, + 1633830, + 1639530, + 1662430, + 1665274, + 1673174, + 1674230, + 1675174, + 1702374, + 2726774, + 2752630, + 2764374, + 2790430, + 2821630, + 2889674, + 341174, + 347174, + 347830, + 349574, + 354330, + 360974, + 363974, + 367274, + 378874, + 386574, + 388774, + 393530, + 397674, + 402874, + 403074, + 411330, + 414230, + 422874, + 424874, + 432274, + 433530, + 447774, + 449330, + 451730, + 458674, + 464774, + 472730, + 473474, + 480974, + 484474, + 492174, + 494474, + 500230, + 501830, + 510330, + 600930, + 611074, + 613230, + 613774, + 614874, + 621574, + 622774, + 628774, + 636330, + 637030, + 638030, + 648030, + 651674, + 651930, + 654030, + 659030, + 853130, + 857730, + 858330, + 859130, + 863074, + 866374, + 870430, + 878074, + 886274, + 900630, + 902430, + 903130, + 915774, + 923830, + 926330, + 928330, + 933074, + ] # Validator is the upstream backend service that can validate the tokens: validator: diff --git a/internal/authenticator/admin_authenticator.go b/internal/authenticator/admin_authenticator.go index f7212771..a42496c6 100644 --- a/internal/authenticator/admin_authenticator.go +++ b/internal/authenticator/admin_authenticator.go @@ -4,12 +4,13 @@ import ( "fmt" "github.com/golang-jwt/jwt/v5" + "github.com/snapp-incubator/soteria/internal/config" "github.com/snapp-incubator/soteria/pkg/acl" ) -// AdminAuthenticator is responsible for Acl/Auth/Token of the internal system users, -// these users have admin access. +// AdminAuthenticator is responsible for Acl/Auth/Token of the internal system userIDs, +// these userIDs have admin access. type AdminAuthenticator struct { Key any Company string diff --git a/internal/authenticator/auto_authenticator.go b/internal/authenticator/auto_authenticator.go index c551d144..48b72acb 100644 --- a/internal/authenticator/auto_authenticator.go +++ b/internal/authenticator/auto_authenticator.go @@ -4,19 +4,21 @@ import ( "context" "fmt" "net/http" + "strconv" "github.com/golang-jwt/jwt/v5" - "github.com/snapp-incubator/soteria/internal/config" - "github.com/snapp-incubator/soteria/internal/topics" - "github.com/snapp-incubator/soteria/pkg/acl" - "github.com/snapp-incubator/soteria/pkg/validator" "go.opentelemetry.io/otel" "go.opentelemetry.io/otel/propagation" "go.opentelemetry.io/otel/trace" "go.uber.org/zap" + + "github.com/snapp-incubator/soteria/internal/config" + "github.com/snapp-incubator/soteria/internal/topics" + "github.com/snapp-incubator/soteria/pkg/acl" + "github.com/snapp-incubator/soteria/pkg/validator" ) -// AutoAuthenticator is responsible for Acl/Auth/Token of users. +// AutoAuthenticator is responsible for Acl/Auth/Token of userIDs. type AutoAuthenticator struct { AllowedAccessTypes []acl.AccessType TopicManager *topics.Manager @@ -51,7 +53,7 @@ func (a AutoAuthenticator) Auth(tokenString string) error { return fmt.Errorf("token is invalid: %w", err) } - if a.blackList.isBlackList(payload.UserID, payload.Iss) { + if a.blackList.isBlackListByUserID(payload.UserID, payload.Iss) { a.Logger.Warn("blacklisted user is requesting!", zap.Int("iat", payload.IAT), zap.String("aud", payload.Aud), @@ -95,7 +97,14 @@ func (a AutoAuthenticator) ACL( return false, ErrSubNotFound } + issInt, _ := strconv.Atoi(issuer) + sub, _ := claims[a.JWTConfig.SubName].(string) + if a.blackList.isBlackListByHashedUserID(sub, issInt) { + a.Logger.Warn("blacklisted user is requesting!", + zap.Any("claims", claims), + ) + } topicTemplate := a.TopicManager.ParseTopic(topic, issuer, sub, map[string]any(claims)) if topicTemplate == nil { @@ -134,8 +143,9 @@ func (a AutoAuthenticator) IsSuperuser() bool { } type autoBlackListChecker struct { - users map[int]struct{} - iss int + userIDs map[int]struct{} + userHashedIDs map[string]struct{} + iss int } func newAutoBlackListChecker(cfg config.BlackListUserLogging) autoBlackListChecker { @@ -144,18 +154,34 @@ func newAutoBlackListChecker(cfg config.BlackListUserLogging) autoBlackListCheck users[userID] = struct{}{} } + userHashedIDs := make(map[string]struct{}) + for _, userHashID := range cfg.UserHashedIDs { + userHashedIDs[userHashID] = struct{}{} + } + return autoBlackListChecker{ - users: users, - iss: cfg.Iss, + userIDs: users, + userHashedIDs: userHashedIDs, + iss: cfg.Iss, } } -func (a autoBlackListChecker) isBlackList(userID, iss int) bool { +func (a autoBlackListChecker) isBlackListByUserID(userID, iss int) bool { + if iss != a.iss { + return false + } + + _, ok := a.userIDs[userID] + + return ok +} + +func (a autoBlackListChecker) isBlackListByHashedUserID(hashedUserID string, iss int) bool { if iss != a.iss { return false } - _, ok := a.users[userID] + _, ok := a.userHashedIDs[hashedUserID] return ok } diff --git a/internal/authenticator/manual_authenticator.go b/internal/authenticator/manual_authenticator.go index 07afd915..9a459005 100644 --- a/internal/authenticator/manual_authenticator.go +++ b/internal/authenticator/manual_authenticator.go @@ -4,12 +4,13 @@ import ( "fmt" "github.com/golang-jwt/jwt/v5" + "github.com/snapp-incubator/soteria/internal/config" "github.com/snapp-incubator/soteria/internal/topics" "github.com/snapp-incubator/soteria/pkg/acl" ) -// ManualAuthenticator is responsible for Acl/Auth/Token of users without calling +// ManualAuthenticator is responsible for Acl/Auth/Token of userIDs without calling // any http client, etc. type ManualAuthenticator struct { Keys map[string]any diff --git a/internal/config/config.go b/internal/config/config.go index 8fd847ed..73eba7ff 100644 --- a/internal/config/config.go +++ b/internal/config/config.go @@ -58,8 +58,9 @@ type ( } BlackListUserLogging struct { - Iss int `json:"iss,omitempty" koanf:"iss"` - UserIDs []int `json:"user_ids,omitempty" koanf:"user_ids"` + Iss int `json:"iss,omitempty" koanf:"iss"` + UserIDs []int `json:"user_ids,omitempty" koanf:"user_ids"` + UserHashedIDs []string `json:"user_hashed_ids,omitempty" koanf:"user_hashed_ids"` } ) From 571fbd72a7603834ffe051ec7bb20e5ca8567c7a Mon Sep 17 00:00:00 2001 From: Ahmad Anvari Date: Tue, 10 Sep 2024 22:01:22 +0330 Subject: [PATCH 656/660] Revert "implement everything" This reverts commit a75f8b5b6a2e5afd8ea90cef17c0f9b2b3a17c08. --- config.example.yml | 105 +----------------- internal/authenticator/admin_authenticator.go | 5 +- internal/authenticator/auto_authenticator.go | 50 ++------- .../authenticator/manual_authenticator.go | 3 +- internal/config/config.go | 5 +- 5 files changed, 19 insertions(+), 149 deletions(-) diff --git a/config.example.yml b/config.example.yml index 7e6f74a4..7e23900a 100644 --- a/config.example.yml +++ b/config.example.yml @@ -7,109 +7,8 @@ logger: level: debug stacktrace: true black_list_user_logging: - iss: 1 - user_ids: [ - 1450774, - 1458174, - 1465974, - 1470674, - 1478230, - 1505930, - 1508730, - 1513330, - 1527130, - 1532230, - 1543730, - 1556874, - 1558930, - 1567674, - 1585230, - 1600674, - 1603874, - 1616574, - 1633830, - 1639530, - 1662430, - 1665274, - 1673174, - 1674230, - 1675174, - 1702374, - 2726774, - 2752630, - 2764374, - 2790430, - 2821630, - 2889674, - 341174, - 347174, - 347830, - 349574, - 354330, - 360974, - 363974, - 367274, - 378874, - 386574, - 388774, - 393530, - 397674, - 402874, - 403074, - 411330, - 414230, - 422874, - 424874, - 432274, - 433530, - 447774, - 449330, - 451730, - 458674, - 464774, - 472730, - 473474, - 480974, - 484474, - 492174, - 494474, - 500230, - 501830, - 510330, - 600930, - 611074, - 613230, - 613774, - 614874, - 621574, - 622774, - 628774, - 636330, - 637030, - 638030, - 648030, - 651674, - 651930, - 654030, - 659030, - 853130, - 857730, - 858330, - 859130, - 863074, - 866374, - 870430, - 878074, - 886274, - 900630, - 902430, - 903130, - 915774, - 923830, - 926330, - 928330, - 933074, - ] + iss: 0 + user_ids: [] # Validator is the upstream backend service that can validate the tokens: validator: diff --git a/internal/authenticator/admin_authenticator.go b/internal/authenticator/admin_authenticator.go index a42496c6..f7212771 100644 --- a/internal/authenticator/admin_authenticator.go +++ b/internal/authenticator/admin_authenticator.go @@ -4,13 +4,12 @@ import ( "fmt" "github.com/golang-jwt/jwt/v5" - "github.com/snapp-incubator/soteria/internal/config" "github.com/snapp-incubator/soteria/pkg/acl" ) -// AdminAuthenticator is responsible for Acl/Auth/Token of the internal system userIDs, -// these userIDs have admin access. +// AdminAuthenticator is responsible for Acl/Auth/Token of the internal system users, +// these users have admin access. type AdminAuthenticator struct { Key any Company string diff --git a/internal/authenticator/auto_authenticator.go b/internal/authenticator/auto_authenticator.go index 48b72acb..c551d144 100644 --- a/internal/authenticator/auto_authenticator.go +++ b/internal/authenticator/auto_authenticator.go @@ -4,21 +4,19 @@ import ( "context" "fmt" "net/http" - "strconv" "github.com/golang-jwt/jwt/v5" - "go.opentelemetry.io/otel" - "go.opentelemetry.io/otel/propagation" - "go.opentelemetry.io/otel/trace" - "go.uber.org/zap" - "github.com/snapp-incubator/soteria/internal/config" "github.com/snapp-incubator/soteria/internal/topics" "github.com/snapp-incubator/soteria/pkg/acl" "github.com/snapp-incubator/soteria/pkg/validator" + "go.opentelemetry.io/otel" + "go.opentelemetry.io/otel/propagation" + "go.opentelemetry.io/otel/trace" + "go.uber.org/zap" ) -// AutoAuthenticator is responsible for Acl/Auth/Token of userIDs. +// AutoAuthenticator is responsible for Acl/Auth/Token of users. type AutoAuthenticator struct { AllowedAccessTypes []acl.AccessType TopicManager *topics.Manager @@ -53,7 +51,7 @@ func (a AutoAuthenticator) Auth(tokenString string) error { return fmt.Errorf("token is invalid: %w", err) } - if a.blackList.isBlackListByUserID(payload.UserID, payload.Iss) { + if a.blackList.isBlackList(payload.UserID, payload.Iss) { a.Logger.Warn("blacklisted user is requesting!", zap.Int("iat", payload.IAT), zap.String("aud", payload.Aud), @@ -97,14 +95,7 @@ func (a AutoAuthenticator) ACL( return false, ErrSubNotFound } - issInt, _ := strconv.Atoi(issuer) - sub, _ := claims[a.JWTConfig.SubName].(string) - if a.blackList.isBlackListByHashedUserID(sub, issInt) { - a.Logger.Warn("blacklisted user is requesting!", - zap.Any("claims", claims), - ) - } topicTemplate := a.TopicManager.ParseTopic(topic, issuer, sub, map[string]any(claims)) if topicTemplate == nil { @@ -143,9 +134,8 @@ func (a AutoAuthenticator) IsSuperuser() bool { } type autoBlackListChecker struct { - userIDs map[int]struct{} - userHashedIDs map[string]struct{} - iss int + users map[int]struct{} + iss int } func newAutoBlackListChecker(cfg config.BlackListUserLogging) autoBlackListChecker { @@ -154,34 +144,18 @@ func newAutoBlackListChecker(cfg config.BlackListUserLogging) autoBlackListCheck users[userID] = struct{}{} } - userHashedIDs := make(map[string]struct{}) - for _, userHashID := range cfg.UserHashedIDs { - userHashedIDs[userHashID] = struct{}{} - } - return autoBlackListChecker{ - userIDs: users, - userHashedIDs: userHashedIDs, - iss: cfg.Iss, + users: users, + iss: cfg.Iss, } } -func (a autoBlackListChecker) isBlackListByUserID(userID, iss int) bool { - if iss != a.iss { - return false - } - - _, ok := a.userIDs[userID] - - return ok -} - -func (a autoBlackListChecker) isBlackListByHashedUserID(hashedUserID string, iss int) bool { +func (a autoBlackListChecker) isBlackList(userID, iss int) bool { if iss != a.iss { return false } - _, ok := a.userHashedIDs[hashedUserID] + _, ok := a.users[userID] return ok } diff --git a/internal/authenticator/manual_authenticator.go b/internal/authenticator/manual_authenticator.go index 9a459005..07afd915 100644 --- a/internal/authenticator/manual_authenticator.go +++ b/internal/authenticator/manual_authenticator.go @@ -4,13 +4,12 @@ import ( "fmt" "github.com/golang-jwt/jwt/v5" - "github.com/snapp-incubator/soteria/internal/config" "github.com/snapp-incubator/soteria/internal/topics" "github.com/snapp-incubator/soteria/pkg/acl" ) -// ManualAuthenticator is responsible for Acl/Auth/Token of userIDs without calling +// ManualAuthenticator is responsible for Acl/Auth/Token of users without calling // any http client, etc. type ManualAuthenticator struct { Keys map[string]any diff --git a/internal/config/config.go b/internal/config/config.go index 73eba7ff..8fd847ed 100644 --- a/internal/config/config.go +++ b/internal/config/config.go @@ -58,9 +58,8 @@ type ( } BlackListUserLogging struct { - Iss int `json:"iss,omitempty" koanf:"iss"` - UserIDs []int `json:"user_ids,omitempty" koanf:"user_ids"` - UserHashedIDs []string `json:"user_hashed_ids,omitempty" koanf:"user_hashed_ids"` + Iss int `json:"iss,omitempty" koanf:"iss"` + UserIDs []int `json:"user_ids,omitempty" koanf:"user_ids"` } ) From 5e8234849937499dcc274117910495444e96ed71 Mon Sep 17 00:00:00 2001 From: Ahmad Anvari Date: Tue, 10 Sep 2024 22:08:01 +0330 Subject: [PATCH 657/660] feat: implement everything for the second time --- config.example.yml | 1 + internal/authenticator/admin_authenticator.go | 5 +- internal/authenticator/auto_authenticator.go | 48 ++++++++++++++----- .../authenticator/manual_authenticator.go | 3 +- internal/config/config.go | 8 ++-- 5 files changed, 47 insertions(+), 18 deletions(-) diff --git a/config.example.yml b/config.example.yml index 7e23900a..0529b832 100644 --- a/config.example.yml +++ b/config.example.yml @@ -9,6 +9,7 @@ logger: black_list_user_logging: iss: 0 user_ids: [] + user_hashed_ids: [] # Validator is the upstream backend service that can validate the tokens: validator: diff --git a/internal/authenticator/admin_authenticator.go b/internal/authenticator/admin_authenticator.go index f7212771..a42496c6 100644 --- a/internal/authenticator/admin_authenticator.go +++ b/internal/authenticator/admin_authenticator.go @@ -4,12 +4,13 @@ import ( "fmt" "github.com/golang-jwt/jwt/v5" + "github.com/snapp-incubator/soteria/internal/config" "github.com/snapp-incubator/soteria/pkg/acl" ) -// AdminAuthenticator is responsible for Acl/Auth/Token of the internal system users, -// these users have admin access. +// AdminAuthenticator is responsible for Acl/Auth/Token of the internal system userIDs, +// these userIDs have admin access. type AdminAuthenticator struct { Key any Company string diff --git a/internal/authenticator/auto_authenticator.go b/internal/authenticator/auto_authenticator.go index c551d144..de0ac517 100644 --- a/internal/authenticator/auto_authenticator.go +++ b/internal/authenticator/auto_authenticator.go @@ -4,19 +4,21 @@ import ( "context" "fmt" "net/http" + "strconv" "github.com/golang-jwt/jwt/v5" - "github.com/snapp-incubator/soteria/internal/config" - "github.com/snapp-incubator/soteria/internal/topics" - "github.com/snapp-incubator/soteria/pkg/acl" - "github.com/snapp-incubator/soteria/pkg/validator" "go.opentelemetry.io/otel" "go.opentelemetry.io/otel/propagation" "go.opentelemetry.io/otel/trace" "go.uber.org/zap" + + "github.com/snapp-incubator/soteria/internal/config" + "github.com/snapp-incubator/soteria/internal/topics" + "github.com/snapp-incubator/soteria/pkg/acl" + "github.com/snapp-incubator/soteria/pkg/validator" ) -// AutoAuthenticator is responsible for Acl/Auth/Token of users. +// AutoAuthenticator is responsible for Acl/Auth/Token of userIDs. type AutoAuthenticator struct { AllowedAccessTypes []acl.AccessType TopicManager *topics.Manager @@ -51,7 +53,7 @@ func (a AutoAuthenticator) Auth(tokenString string) error { return fmt.Errorf("token is invalid: %w", err) } - if a.blackList.isBlackList(payload.UserID, payload.Iss) { + if a.blackList.isBlackListByUserID(payload.UserID, payload.Iss) { a.Logger.Warn("blacklisted user is requesting!", zap.Int("iat", payload.IAT), zap.String("aud", payload.Aud), @@ -95,8 +97,13 @@ func (a AutoAuthenticator) ACL( return false, ErrSubNotFound } + issuerInt, _ := strconv.Atoi(issuer) sub, _ := claims[a.JWTConfig.SubName].(string) + if a.blackList.isBlackListByUserHashedID(sub, issuerInt) { + a.Logger.Warn("blacklisted user is requesting!", zap.Any("claims", claims)) + } + topicTemplate := a.TopicManager.ParseTopic(topic, issuer, sub, map[string]any(claims)) if topicTemplate == nil { return false, InvalidTopicError{Topic: topic} @@ -134,8 +141,9 @@ func (a AutoAuthenticator) IsSuperuser() bool { } type autoBlackListChecker struct { - users map[int]struct{} - iss int + userIDs map[int]struct{} + userHashedIDs map[string]struct{} + iss int } func newAutoBlackListChecker(cfg config.BlackListUserLogging) autoBlackListChecker { @@ -144,18 +152,34 @@ func newAutoBlackListChecker(cfg config.BlackListUserLogging) autoBlackListCheck users[userID] = struct{}{} } + userHashedIDs := make(map[string]struct{}) + for _, u := range cfg.UserHashedIDs { + userHashedIDs[u] = struct{}{} + } + return autoBlackListChecker{ - users: users, - iss: cfg.Iss, + userIDs: users, + userHashedIDs: userHashedIDs, + iss: cfg.Iss, + } +} + +func (a autoBlackListChecker) isBlackListByUserID(userID, iss int) bool { + if iss != a.iss { + return false } + + _, ok := a.userIDs[userID] + + return ok } -func (a autoBlackListChecker) isBlackList(userID, iss int) bool { +func (a autoBlackListChecker) isBlackListByUserHashedID(userHashedID string, iss int) bool { if iss != a.iss { return false } - _, ok := a.users[userID] + _, ok := a.userHashedIDs[userHashedID] return ok } diff --git a/internal/authenticator/manual_authenticator.go b/internal/authenticator/manual_authenticator.go index 07afd915..9a459005 100644 --- a/internal/authenticator/manual_authenticator.go +++ b/internal/authenticator/manual_authenticator.go @@ -4,12 +4,13 @@ import ( "fmt" "github.com/golang-jwt/jwt/v5" + "github.com/snapp-incubator/soteria/internal/config" "github.com/snapp-incubator/soteria/internal/topics" "github.com/snapp-incubator/soteria/pkg/acl" ) -// ManualAuthenticator is responsible for Acl/Auth/Token of users without calling +// ManualAuthenticator is responsible for Acl/Auth/Token of userIDs without calling // any http client, etc. type ManualAuthenticator struct { Keys map[string]any diff --git a/internal/config/config.go b/internal/config/config.go index 8fd847ed..d4f80c25 100644 --- a/internal/config/config.go +++ b/internal/config/config.go @@ -11,10 +11,11 @@ import ( "github.com/knadh/koanf/providers/file" "github.com/knadh/koanf/providers/structs" "github.com/knadh/koanf/v2" + "github.com/tidwall/pretty" + "github.com/snapp-incubator/soteria/internal/logger" "github.com/snapp-incubator/soteria/internal/topics" "github.com/snapp-incubator/soteria/internal/tracing" - "github.com/tidwall/pretty" ) const ( @@ -58,8 +59,9 @@ type ( } BlackListUserLogging struct { - Iss int `json:"iss,omitempty" koanf:"iss"` - UserIDs []int `json:"user_ids,omitempty" koanf:"user_ids"` + Iss int `json:"iss,omitempty" koanf:"iss"` + UserIDs []int `json:"user_ids,omitempty" koanf:"user_ids"` + UserHashedIDs []string `json:"user_hashed_ids,omitempty" koanf:"user_hashed_ids"` } ) From 9dcdc857b2ad2d1849eeafd66b89ba3635b32a21 Mon Sep 17 00:00:00 2001 From: Roozbeh Sharifnasab Date: Tue, 10 Sep 2024 22:14:06 +0330 Subject: [PATCH 658/660] chore(golangcilint): refine linters list --- .golangci.yml | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/.golangci.yml b/.golangci.yml index e76e34b6..b2bc0bd4 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -10,18 +10,9 @@ linters: - varnamelen - ireturn # deprecated linters - - maligned - - scopelint - - golint - - ifshort - - interfacer - - exhaustivestruct - - nosnakecase - - varcheck - - deadcode - - structcheck - gomnd - execinquery + - exportloopref linters-settings: wrapcheck: From 8809828930933e86b39e2becd23ba27a9f182a0e Mon Sep 17 00:00:00 2001 From: Roozbeh Sharifnasab Date: Tue, 10 Sep 2024 22:14:29 +0330 Subject: [PATCH 659/660] style: gci all files --- internal/authenticator/admin_authenticator.go | 1 - internal/authenticator/auto_authenticator.go | 9 ++++----- internal/authenticator/manual_authenticator.go | 1 - internal/config/config.go | 3 +-- 4 files changed, 5 insertions(+), 9 deletions(-) diff --git a/internal/authenticator/admin_authenticator.go b/internal/authenticator/admin_authenticator.go index a42496c6..8b606c26 100644 --- a/internal/authenticator/admin_authenticator.go +++ b/internal/authenticator/admin_authenticator.go @@ -4,7 +4,6 @@ import ( "fmt" "github.com/golang-jwt/jwt/v5" - "github.com/snapp-incubator/soteria/internal/config" "github.com/snapp-incubator/soteria/pkg/acl" ) diff --git a/internal/authenticator/auto_authenticator.go b/internal/authenticator/auto_authenticator.go index de0ac517..41a668c7 100644 --- a/internal/authenticator/auto_authenticator.go +++ b/internal/authenticator/auto_authenticator.go @@ -7,15 +7,14 @@ import ( "strconv" "github.com/golang-jwt/jwt/v5" - "go.opentelemetry.io/otel" - "go.opentelemetry.io/otel/propagation" - "go.opentelemetry.io/otel/trace" - "go.uber.org/zap" - "github.com/snapp-incubator/soteria/internal/config" "github.com/snapp-incubator/soteria/internal/topics" "github.com/snapp-incubator/soteria/pkg/acl" "github.com/snapp-incubator/soteria/pkg/validator" + "go.opentelemetry.io/otel" + "go.opentelemetry.io/otel/propagation" + "go.opentelemetry.io/otel/trace" + "go.uber.org/zap" ) // AutoAuthenticator is responsible for Acl/Auth/Token of userIDs. diff --git a/internal/authenticator/manual_authenticator.go b/internal/authenticator/manual_authenticator.go index 9a459005..2babb003 100644 --- a/internal/authenticator/manual_authenticator.go +++ b/internal/authenticator/manual_authenticator.go @@ -4,7 +4,6 @@ import ( "fmt" "github.com/golang-jwt/jwt/v5" - "github.com/snapp-incubator/soteria/internal/config" "github.com/snapp-incubator/soteria/internal/topics" "github.com/snapp-incubator/soteria/pkg/acl" diff --git a/internal/config/config.go b/internal/config/config.go index d4f80c25..73eba7ff 100644 --- a/internal/config/config.go +++ b/internal/config/config.go @@ -11,11 +11,10 @@ import ( "github.com/knadh/koanf/providers/file" "github.com/knadh/koanf/providers/structs" "github.com/knadh/koanf/v2" - "github.com/tidwall/pretty" - "github.com/snapp-incubator/soteria/internal/logger" "github.com/snapp-incubator/soteria/internal/topics" "github.com/snapp-incubator/soteria/internal/tracing" + "github.com/tidwall/pretty" ) const ( From b922e6b6f16b817fe707310162e106387da475b1 Mon Sep 17 00:00:00 2001 From: Roozbeh Sharifnasab Date: Tue, 10 Sep 2024 22:17:23 +0330 Subject: [PATCH 660/660] fix(lint) --- internal/authenticator/builder_test.go | 45 +++++++++++++++----------- internal/config/default.go | 5 +-- 2 files changed, 30 insertions(+), 20 deletions(-) diff --git a/internal/authenticator/builder_test.go b/internal/authenticator/builder_test.go index 3c351cc8..142fea1c 100644 --- a/internal/authenticator/builder_test.go +++ b/internal/authenticator/builder_test.go @@ -25,8 +25,9 @@ func TestBuilderWithoutAuthenticator(t *testing.T) { Timeout: 0, }, BlackListUserLoggingConfig: config.BlackListUserLogging{ - Iss: 0, - UserIDs: []int{}, + Iss: 0, + UserIDs: []int{}, + UserHashedIDs: []string{}, }, } @@ -66,8 +67,9 @@ func TestBuilderInvalidAuthenticator(t *testing.T) { Timeout: 0, }, BlackListUserLoggingConfig: config.BlackListUserLogging{ - Iss: 0, - UserIDs: []int{}, + Iss: 0, + UserIDs: []int{}, + UserHashedIDs: []string{}, }, } @@ -107,8 +109,9 @@ func TestBuilderInternalAuthenticator(t *testing.T) { Timeout: 0, }, BlackListUserLoggingConfig: config.BlackListUserLogging{ - Iss: 0, - UserIDs: []int{}, + Iss: 0, + UserIDs: []int{}, + UserHashedIDs: []string{}, }, } @@ -150,8 +153,9 @@ func TestBuilderInternalAuthenticatorWithInvalidKey(t *testing.T) { Timeout: 0, }, BlackListUserLoggingConfig: config.BlackListUserLogging{ - Iss: 0, - UserIDs: []int{}, + Iss: 0, + UserIDs: []int{}, + UserHashedIDs: []string{}, }, } @@ -208,8 +212,9 @@ func TestBuilderManualAuthenticatorWithoutKey(t *testing.T) { Timeout: 0, }, BlackListUserLoggingConfig: config.BlackListUserLogging{ - Iss: 0, - UserIDs: []int{}, + Iss: 0, + UserIDs: []int{}, + UserHashedIDs: []string{}, }, } @@ -288,8 +293,9 @@ func TestBuilderManualAuthenticator(t *testing.T) { Timeout: 0, }, BlackListUserLoggingConfig: config.BlackListUserLogging{ - Iss: 0, - UserIDs: []int{}, + Iss: 0, + UserIDs: []int{}, + UserHashedIDs: []string{}, }, } @@ -365,8 +371,9 @@ func TestBuilderManualAuthenticatorInvalidMapping_1(t *testing.T) { Timeout: 0, }, BlackListUserLoggingConfig: config.BlackListUserLogging{ - Iss: 0, - UserIDs: []int{}, + Iss: 0, + UserIDs: []int{}, + UserHashedIDs: []string{}, }, } @@ -443,8 +450,9 @@ func TestBuilderManualAuthenticatorInvalidMapping_2(t *testing.T) { Timeout: 0, }, BlackListUserLoggingConfig: config.BlackListUserLogging{ - Iss: 0, - UserIDs: []int{}, + Iss: 0, + UserIDs: []int{}, + UserHashedIDs: []string{}, }, } @@ -523,8 +531,9 @@ func TestBuilderManualAuthenticatorInvalidAccess(t *testing.T) { Timeout: 0, }, BlackListUserLoggingConfig: config.BlackListUserLogging{ - Iss: 0, - UserIDs: []int{}, + Iss: 0, + UserIDs: []int{}, + UserHashedIDs: []string{}, }, } diff --git a/internal/config/default.go b/internal/config/default.go index 111cd2e5..6ab7774a 100644 --- a/internal/config/default.go +++ b/internal/config/default.go @@ -38,8 +38,9 @@ func Default() Config { Timeout: 5 * time.Second, }, BlackListUserLogging: BlackListUserLogging{ - Iss: 0, - UserIDs: []int{}, + Iss: 0, + UserIDs: []int{}, + UserHashedIDs: []string{}, }, } }