diff --git a/go.mod b/go.mod index 80a47419..b08a85ee 100644 --- a/go.mod +++ b/go.mod @@ -6,7 +6,7 @@ require ( github.com/golang/protobuf v1.4.2 // indirect github.com/klauspost/compress v1.11.12 github.com/minio/highwayhash v1.0.1 - github.com/nats-io/jwt/v2 v2.0.2 + github.com/nats-io/jwt/v2 v2.0.3-0.20210715221700-37a10b0187c7 github.com/nats-io/nats.go v1.11.1-0.20210623165838-4b75fc59ae30 github.com/nats-io/nkeys v0.3.0 github.com/nats-io/nuid v1.0.1 diff --git a/go.sum b/go.sum index a376d170..2fa5b495 100644 --- a/go.sum +++ b/go.sum @@ -16,6 +16,8 @@ github.com/nats-io/jwt v1.2.2 h1:w3GMTO969dFg+UOKTmmyuu7IGdusK+7Ytlt//OYH/uU= github.com/nats-io/jwt v1.2.2/go.mod h1:/xX356yQA6LuXI9xWW7mZNpxgF2mBmGecH+Fj34sP5Q= github.com/nats-io/jwt/v2 v2.0.2 h1:ejVCLO8gu6/4bOKIHQpmB5UhhUJfAQw55yvLWpfmKjI= github.com/nats-io/jwt/v2 v2.0.2/go.mod h1:VRP+deawSXyhNjXmxPCHskrR6Mq50BqpEI5SEcNiGlY= +github.com/nats-io/jwt/v2 v2.0.3-0.20210715221700-37a10b0187c7 h1:UG297bO9pMQUnwvv74Z3m0BmvTtf/9VtMmBBDZn3WB4= +github.com/nats-io/jwt/v2 v2.0.3-0.20210715221700-37a10b0187c7/go.mod h1:VRP+deawSXyhNjXmxPCHskrR6Mq50BqpEI5SEcNiGlY= github.com/nats-io/nats.go v1.11.1-0.20210623165838-4b75fc59ae30 h1:9GqilBhZaR3xYis0JgMlJjNw933WIobdjKhilXm+Vls= github.com/nats-io/nats.go v1.11.1-0.20210623165838-4b75fc59ae30/go.mod h1:BPko4oXsySz4aSWeFgOHLZs3G4Jq4ZAyE6/zMCxRT6w= github.com/nats-io/nkeys v0.2.0/go.mod h1:XdZpAbhgyyODYqjTawOnIOI7VlbKSarI9Gfy1tqEu/s= diff --git a/vendor/github.com/nats-io/jwt/v2/exports.go b/vendor/github.com/nats-io/jwt/v2/exports.go index 852ffae3..24715f7c 100644 --- a/vendor/github.com/nats-io/jwt/v2/exports.go +++ b/vendor/github.com/nats-io/jwt/v2/exports.go @@ -42,7 +42,7 @@ const ( // Results is the subject where the latency metrics are published. // A metric will be defined by the nats-server's ServiceLatency. Time durations // are in nanoseconds. -// see https://github.com/nats-io/nats-server/blob/master/server/accounts.go#L524 +// see https://github.com/nats-io/nats-server/blob/main/server/accounts.go#L524 // e.g. // { // "app": "dlc22", diff --git a/vendor/github.com/nats-io/jwt/v2/types.go b/vendor/github.com/nats-io/jwt/v2/types.go index b538b62a..92abcf53 100644 --- a/vendor/github.com/nats-io/jwt/v2/types.go +++ b/vendor/github.com/nats-io/jwt/v2/types.go @@ -188,12 +188,11 @@ func (s Subject) countTokenWildcards() int { if v == "*" { return 1 } - cnt := strings.Count(v, ".*.") - if strings.HasSuffix(v, ".*") { - cnt++ - } - if strings.HasPrefix(v, "*.") { - cnt++ + cnt := 0 + for _, t := range strings.Split(v, ".") { + if t == "*" { + cnt++ + } } return cnt } diff --git a/vendor/modules.txt b/vendor/modules.txt index abd2dd05..d2cb2f59 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -6,7 +6,7 @@ github.com/klauspost/compress/s2 # github.com/minio/highwayhash v1.0.1 ## explicit github.com/minio/highwayhash -# github.com/nats-io/jwt/v2 v2.0.2 +# github.com/nats-io/jwt/v2 v2.0.3-0.20210715221700-37a10b0187c7 ## explicit github.com/nats-io/jwt/v2 # github.com/nats-io/nats.go v1.11.1-0.20210623165838-4b75fc59ae30