From d55769a159c83b43feeb33965b198191798a00e1 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 18 Dec 2023 16:39:42 +0000 Subject: [PATCH 1/2] Bump github.com/google/uuid from 1.4.0 to 1.5.0 Bumps [github.com/google/uuid](https://github.com/google/uuid) from 1.4.0 to 1.5.0. - [Release notes](https://github.com/google/uuid/releases) - [Changelog](https://github.com/google/uuid/blob/master/CHANGELOG.md) - [Commits](https://github.com/google/uuid/compare/v1.4.0...v1.5.0) --- updated-dependencies: - dependency-name: github.com/google/uuid 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 6a79c2598..28bace0a1 100644 --- a/go.mod +++ b/go.mod @@ -9,7 +9,7 @@ require ( github.com/go-jose/go-jose/v3 v3.0.1 github.com/google/go-cmp v0.6.0 github.com/google/go-tpm v0.9.0 - github.com/google/uuid v1.4.0 + github.com/google/uuid v1.5.0 github.com/icrowley/fake v0.0.0-20221112152111-d7b7e2276db2 github.com/manifoldco/promptui v0.9.0 github.com/pkg/errors v0.9.1 diff --git a/go.sum b/go.sum index a77557684..196cab66a 100644 --- a/go.sum +++ b/go.sum @@ -188,8 +188,8 @@ github.com/google/s2a-go v0.1.7 h1:60BLSyTrOV4/haCDW4zb1guZItoSq8foHCXrAnjBo/o= github.com/google/s2a-go v0.1.7/go.mod h1:50CgR4k1jNlWBu4UfS4AcfhVe1r6pdZPygJ3R8F0Qdw= github.com/google/uuid v1.1.1/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.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/googleapis/enterprise-certificate-proxy v0.3.2 h1:Vie5ybvEvT75RniqhfFxPRy3Bf7vr3h0cechB90XaQs= github.com/googleapis/enterprise-certificate-proxy v0.3.2/go.mod h1:VLSiSSBs/ksPL8kq3OBOQ6WRI2QnaFynd1DCjZ62+V0= github.com/googleapis/gax-go/v2 v2.12.0 h1:A+gCJKdRfqXkr+BIRGtZLibNXf0m1f9E4HG56etFpas= From ac097ff2e96a68a2d4a486df35b6123b7da9b07a Mon Sep 17 00:00:00 2001 From: Herman Slatman Date: Tue, 19 Dec 2023 11:47:02 +0100 Subject: [PATCH 2/2] Use `uuid.Validate` for cases where the UUID isn't used In https://github.com/google/uuid/pull/141 a new `Validate` function was added to the `uuid` package. This can be used when no UUID struct is required, so can be used instead of `Parse`. This takes https://github.com/smallstep/cli/pull/1087, but uses `uuid.Validate` in one location. --- command/api/token/create.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/command/api/token/create.go b/command/api/token/create.go index d7df3bc4d..689c3d980 100644 --- a/command/api/token/create.go +++ b/command/api/token/create.go @@ -94,10 +94,10 @@ func createAction(ctx *cli.Context) (err error) { Bundle: clientCert.Certificate, Audience: ctx.String("audience"), } - if _, err := uuid.Parse(teamID); err == nil { - r.TeamID = teamID - } else { + if err := uuid.Validate(teamID); err != nil { r.TeamSlug = teamID + } else { + r.TeamID = teamID } err = json.NewEncoder(b).Encode(r) if err != nil {