chore: replace github.com/go-jose/go-jose/v3 with v4#16031
Conversation
Our codebase currently uses both v3 and v4 versions of the `go-jose` dependency. To maintain consistency, we should standardize on using only the latest v4 version. Signed-off-by: Eng Zer Jun <[email protected]>
|
All contributors have signed the CLA ✍️ ✅ |
|
I have read the CLA Document and I hereby sign the CLA |
Juneezee
left a comment
There was a problem hiding this comment.
Explaining my changes
| require.Equal(t, appTokenCookie.Path, u.Path, "incorrect path on app token cookie") | ||
|
|
||
| object, err := jose.ParseSigned(appTokenCookie.Value) | ||
| object, err := jose.ParseSigned(appTokenCookie.Value, []jose.SignatureAlgorithm{jwtutils.SigningAlgo}) |
There was a problem hiding this comment.
This is the only breaking change that affects us. In v4, jose.ParseSigned requires specifying the algorithms used to sign the signature.
https://github.com/go-jose/go-jose/blob/main/CHANGELOG.md#v400
|
|
||
| const ( | ||
| signingAlgo = jose.HS512 | ||
| SigningAlgo = jose.HS512 |
There was a problem hiding this comment.
I exported this constant variable for the jose.ParseSigned function calls in coderd/workspaceapps/apptest/apptest.go. See the previous review comment.
Emyrk
left a comment
There was a problem hiding this comment.
LGTM 👍
We used v4 in prod, and v3 in tests it seems.
coder/go.mod
Lines 125 to 126 in 4495db8
Our codebase currently uses both v3 and v4 versions of the
go-josedependency. To maintain consistency, we should standardize on using only the latest v4 version.