This is an automated email from the ASF dual-hosted git repository.
alexstocks pushed a commit to branch dapr-support
in repository https://gitbox.apache.org/repos/asf/dubbo-go.git
The following commit(s) were added to refs/heads/dapr-support by this push:
new 4f159a2b3 Security: use google/uuid instead (#2181)
4f159a2b3 is described below
commit 4f159a2b38f30cdd8c8a0afc27714cc86e15dfda
Author: Bernd Verst <[email protected]>
AuthorDate: Tue Jan 17 20:22:53 2023 -0800
Security: use google/uuid instead (#2181)
Signed-off-by: Bernd Verst <[email protected]>
Signed-off-by: Bernd Verst <[email protected]>
---
common/url.go | 16 ++++++----------
go.mod | 2 +-
go.sum | 2 --
3 files changed, 7 insertions(+), 13 deletions(-)
diff --git a/common/url.go b/common/url.go
index c143cb2f1..700ad4c30 100644
--- a/common/url.go
+++ b/common/url.go
@@ -28,22 +28,18 @@ import (
"strings"
"sync"
"time"
-)
-import (
cm "github.com/Workiva/go-datastructures/common"
gxset "github.com/dubbogo/gost/container/set"
"github.com/jinzhu/copier"
- perrors "github.com/pkg/errors"
+ "dubbo.apache.org/dubbo-go/v3/common/constant"
- "github.com/satori/go.uuid"
-)
+ "github.com/google/uuid"
-import (
- "dubbo.apache.org/dubbo-go/v3/common/constant"
+ perrors "github.com/pkg/errors"
)
// dubbo role type constant
@@ -203,7 +199,7 @@ func WithToken(token string) Option {
if len(token) > 0 {
value := token
if strings.ToLower(token) == "true" ||
strings.ToLower(token) == "default" {
- u, _ := uuid.NewV4()
+ u, _ := uuid.NewUUID()
value = u.String()
}
url.SetParam(constant.TokenKey, value)
@@ -356,7 +352,7 @@ func (c *URL) Key() string {
return buildString
}
-//GetCacheInvokerMapKey get directory cacheInvokerMap key
+// GetCacheInvokerMapKey get directory cacheInvokerMap key
func (c *URL) GetCacheInvokerMapKey() string {
urlNew, _ := NewURL(c.PrimitiveURL)
@@ -861,7 +857,7 @@ func GetCompareURLEqualFunc() CompareURLEqualFunc {
return compareURLEqualFunc
}
-//GetParamDuration get duration if param is invalid or missing will return 3s
+// GetParamDuration get duration if param is invalid or missing will return 3s
func (c *URL) GetParamDuration(s string, d string) time.Duration {
if t, err := time.ParseDuration(c.GetParam(s, d)); err == nil {
return t
diff --git a/go.mod b/go.mod
index c3667d90e..2b1e544fe 100644
--- a/go.mod
+++ b/go.mod
@@ -27,6 +27,7 @@ require (
github.com/golang/mock v1.5.0
github.com/golang/protobuf v1.5.2
github.com/google/go-cmp v0.5.8
+ github.com/google/uuid v1.3.0
github.com/gopherjs/gopherjs v0.0.0-20190910122728-9d188e94fb99 //
indirect
github.com/grpc-ecosystem/grpc-opentracing
v0.0.0-20180507213350-8e809c8a8645
github.com/hashicorp/vault/sdk v0.3.0
@@ -41,7 +42,6 @@ require (
github.com/pkg/errors v0.9.1
github.com/polarismesh/polaris-go v1.1.0
github.com/prometheus/client_golang v1.12.2
- github.com/satori/go.uuid v1.2.1-0.20181028125025-b2ce2384e17b
github.com/spf13/afero v1.2.2 // indirect
github.com/stretchr/testify v1.7.1
github.com/zouyx/agollo/v3 v3.4.5
diff --git a/go.sum b/go.sum
index 29c5631e5..92d7bdd9e 100644
--- a/go.sum
+++ b/go.sum
@@ -672,8 +672,6 @@ github.com/ryanuber/columnize
v0.0.0-20160712163229-9b3edd62028f/go.mod h1:sm1tb
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/satori/go.uuid v1.2.1-0.20181028125025-b2ce2384e17b
h1:gQZ0qzfKHQIybLANtM3mBXNUtOfsCFXeTsnBqCsx1KM=
-github.com/satori/go.uuid v1.2.1-0.20181028125025-b2ce2384e17b/go.mod
h1:dA0hQrYB0VpLJoorglMZABFdXlWrHn1NEOzdhQKdks0=
github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529/go.mod
h1:DxrIzT+xaE7yg65j358z/aeFdxmN0P9QXhEzd20vsDc=
github.com/shirou/gopsutil v3.20.11+incompatible
h1:LJr4ZQK4mPpIV5gOa4jCOKOGb4ty4DZO54I4FGqIpto=
github.com/shirou/gopsutil v3.20.11+incompatible/go.mod
h1:5b4v6he4MtMOwMlS0TUMTu2PcXUg8+E1lC7eC3UO/RA=