diff --git a/api/api.go b/api/api.go index ada23c61..c40593c6 100644 --- a/api/api.go +++ b/api/api.go @@ -13,10 +13,10 @@ import ( "path" "time" + "github.com/google/uuid" "github.com/graymeta/stow" "github.com/graymeta/stow/local" "github.com/graymeta/stow/s3" - uuid "github.com/satori/go.uuid" "github.com/TykTechnologies/mserv/bundle" config "github.com/TykTechnologies/mserv/conf" @@ -238,7 +238,7 @@ func (a *API) HandleNewBundle(ctx context.Context, filePath, apiID, bundleName s for _, f := range bdl.Manifest.CustomMiddleware.Pre { p := &storage.Plugin{ - UID: uuid.NewV4().String(), + UID: uuid.NewString(), FileName: fName, FileRef: ref, Name: f.Name, @@ -250,7 +250,7 @@ func (a *API) HandleNewBundle(ctx context.Context, filePath, apiID, bundleName s for _, f := range bdl.Manifest.CustomMiddleware.Post { p := &storage.Plugin{ - UID: uuid.NewV4().String(), + UID: uuid.NewString(), FileName: fName, FileRef: ref, Name: f.Name, @@ -262,7 +262,7 @@ func (a *API) HandleNewBundle(ctx context.Context, filePath, apiID, bundleName s for _, f := range bdl.Manifest.CustomMiddleware.PostKeyAuth { p := &storage.Plugin{ - UID: uuid.NewV4().String(), + UID: uuid.NewString(), FileName: fName, FileRef: ref, Name: f.Name, @@ -274,7 +274,7 @@ func (a *API) HandleNewBundle(ctx context.Context, filePath, apiID, bundleName s if bdl.Manifest.CustomMiddleware.AuthCheck.Name != "" { p := &storage.Plugin{ - UID: uuid.NewV4().String(), + UID: uuid.NewString(), FileName: fName, FileRef: ref, Name: bdl.Manifest.CustomMiddleware.AuthCheck.Name, diff --git a/go.mod b/go.mod index f9901d3a..fea8807c 100644 --- a/go.mod +++ b/go.mod @@ -22,7 +22,6 @@ require ( github.com/olekukonko/tablewriter v0.0.4 github.com/patrickmn/go-cache v2.1.0+incompatible github.com/rs/cors v1.10.1 - github.com/satori/go.uuid v1.2.0 github.com/sirupsen/logrus v1.9.3 github.com/spf13/cobra v1.8.0 github.com/spf13/viper v1.6.2 diff --git a/go.sum b/go.sum index fd5ec629..fc8316e3 100644 --- a/go.sum +++ b/go.sum @@ -460,7 +460,6 @@ github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFR github.com/rs/cors v1.10.1 h1:L0uuZVXIKlI1SShY2nhFfo44TYvDPQ1w4oFkUJNfhyo= github.com/rs/cors v1.10.1/go.mod h1:XyqrcTp5zjWr1wsJ8PIRZssZ8b/WMcMf71DJnit4EMU= github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= -github.com/satori/go.uuid v1.2.0 h1:0uYX9dsZ2yD7q2RtLRtPSdGDWzjeM3TbMJP9utgA0ww= github.com/satori/go.uuid v1.2.0/go.mod h1:dA0hQrYB0VpLJoorglMZABFdXlWrHn1NEOzdhQKdks0= github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529/go.mod h1:DxrIzT+xaE7yg65j358z/aeFdxmN0P9QXhEzd20vsDc= github.com/sergi/go-diff v1.0.0/go.mod h1:0CfEIISq7TuYL3j771MWULgwwjU+GofnZX9QAmXWZgo= diff --git a/http_funcs/api_handlers.go b/http_funcs/api_handlers.go index 07a5df9f..cf1e8be3 100644 --- a/http_funcs/api_handlers.go +++ b/http_funcs/api_handlers.go @@ -10,9 +10,9 @@ import ( "path" "strings" + "github.com/google/uuid" "github.com/gorilla/mux" "github.com/jpillora/overseer" - uuid "github.com/satori/go.uuid" ) // UploadFormField is the name of the field/multi-part section which contains the file bytes. @@ -102,7 +102,7 @@ func (h *HttpServ) AddMW(w http.ResponseWriter, r *http.Request) { restartNeeded = false } - mw, err := processor(r.Context(), tmpFileLoc, apiID, uuid.NewV4().String()) + mw, err := processor(r.Context(), tmpFileLoc, apiID, uuid.NewString()) if err != nil { h.HandleError(err, w, r) return diff --git a/main.go b/main.go index 10755d02..7e6ed7f5 100644 --- a/main.go +++ b/main.go @@ -13,8 +13,8 @@ import ( "sync" "time" + "github.com/google/uuid" "github.com/jpillora/overseer" - uuid "github.com/satori/go.uuid" "github.com/sirupsen/logrus" "google.golang.org/grpc" @@ -198,7 +198,7 @@ func processPlugins(pls []*storage.MW) error { defer location.Close() iLog.Info("fetching plugin") - tmpDir := path.Join(config.GetConf().Mserv.PluginDir, uuid.NewV4().String()) + tmpDir := path.Join(config.GetConf().Mserv.PluginDir, uuid.NewString()) err = os.MkdirAll(tmpDir, os.ModePerm) if err != nil {