Skip to content

Commit a09dd8c

Browse files
authored
chore: Update unsupported v2 of go-jose to supported v4 (#4439)
# Summary We're getting [Dependabot warnings](GHSA-c5q2-7r4c-mv6g) about using go-jose v2 in our repo b/c we import slsa-github-generator. This PR updates the import to use the supported v4 of the library and updates go mod. All go tests pass, it looks like go-jose is only used in one line of the tests for GitHub biz. ... ## Testing Process * ran `make go-test` and everything was clean. This change only affected tests so that feels sufficient. ... ## Checklist - [x] Review the contributing [guidelines](https://github.com/slsa-framework/slsa-github-generator/blob/main/CONTRIBUTING.md) - [x] Add a reference to related issues in the PR description. - [x] Update documentation if applicable. - [x] Add unit tests if applicable. - [x] Add changes to the [CHANGELOG](https://github.com/slsa-framework/slsa-github-generator/blob/main/CHANGELOG.md) if applicable. --------- Signed-off-by: MacRae Linton <[email protected]>
1 parent 4876e96 commit a09dd8c

File tree

4 files changed

+3
-5
lines changed

4 files changed

+3
-5
lines changed

.golangci.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,7 @@ linters-settings:
110110
# Approved packages.
111111
- "github.com/spf13/cobra" # For CLI
112112
- "github.com/coreos/go-oidc" # For verifying OIDC tokens.
113+
- "github.com/go-jose/go-jose/v4" # For testing OIDC tokens
113114

114115
# Allowed packages in container-based builder.
115116
- "github.com/pelletier/go-toml" # For container-based builder config.

github/oidctest.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ import (
2929
"time"
3030

3131
"github.com/coreos/go-oidc/v3/oidc"
32-
"gopkg.in/square/go-jose.v2"
32+
"github.com/go-jose/go-jose/v4"
3333
)
3434

3535
type jsonToken struct {

go.mod

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ go 1.23.1
44

55
require (
66
github.com/coreos/go-oidc/v3 v3.11.0
7+
github.com/go-jose/go-jose/v4 v4.0.4
78
github.com/go-openapi/strfmt v0.23.0
89
github.com/go-openapi/swag v0.23.0
910
github.com/google/go-cmp v0.6.0
@@ -17,7 +18,6 @@ require (
1718
github.com/sigstore/sigstore-go v0.6.1
1819
github.com/spf13/cobra v1.8.1
1920
golang.org/x/oauth2 v0.23.0
20-
gopkg.in/square/go-jose.v2 v2.6.0
2121
gopkg.in/yaml.v3 v3.0.1
2222
)
2323

@@ -91,7 +91,6 @@ require (
9191
github.com/fsnotify/fsnotify v1.7.0 // indirect
9292
github.com/go-chi/chi v4.1.2+incompatible // indirect
9393
github.com/go-jose/go-jose/v3 v3.0.3 // indirect
94-
github.com/go-jose/go-jose/v4 v4.0.4 // indirect
9594
github.com/go-logr/logr v1.4.2 // indirect
9695
github.com/go-logr/stdr v1.2.2 // indirect
9796
github.com/go-openapi/analysis v0.23.0 // indirect

go.sum

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -869,8 +869,6 @@ gopkg.in/inf.v0 v0.9.1/go.mod h1:cWUDdTG/fYaXco+Dcufb5Vnc6Gp2YChqWtbxRZE0mXw=
869869
gopkg.in/ini.v1 v1.56.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k=
870870
gopkg.in/ini.v1 v1.67.0 h1:Dgnx+6+nfE+IfzjUEISNeydPJh9AXNNsWbGP9KzCsOA=
871871
gopkg.in/ini.v1 v1.67.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k=
872-
gopkg.in/square/go-jose.v2 v2.6.0 h1:NGk74WTnPKBNUhNzQX7PYcTLUjoq7mzKk2OKbvwk2iI=
873-
gopkg.in/square/go-jose.v2 v2.6.0/go.mod h1:M9dMgbHiYLoDGQrXy7OpJDJWiKiU//h+vD76mk0e1AI=
874872
gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 h1:uRGJdciOHaEIrze2W8Q3AKkepLTh2hOroT7a+7czfdQ=
875873
gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw=
876874
gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=

0 commit comments

Comments
 (0)