Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TT-10430: migrate to google/uuid #53

Merged
merged 1 commit into from
Nov 15, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions api/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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,
Expand All @@ -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,
Expand All @@ -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,
Expand All @@ -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,
Expand Down
1 change: 0 additions & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 0 additions & 1 deletion go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -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=
Expand Down
4 changes: 2 additions & 2 deletions http_funcs/api_handlers.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down Expand Up @@ -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 {
Expand Down