-
Notifications
You must be signed in to change notification settings - Fork 887
chore: replace github.com/go-jose/go-jose/v3
with v4
#16031
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Explaining my changes
@@ -430,7 +431,7 @@ func Run(t *testing.T, appHostIsPrimary bool, factory DeploymentFactory) { | |||
require.NotNil(t, appTokenCookie, "no signed app token cookie in response") | |||
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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
@@ -38,7 +38,7 @@ type Claims interface { | |||
} | |||
|
|||
const ( | |||
signingAlgo = jose.HS512 | |||
SigningAlgo = jose.HS512 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I exported this constant variable for the jose.ParseSigned
function calls in coderd/workspaceapps/apptest/apptest.go
. See the previous review comment.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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-jose
dependency. To maintain consistency, we should standardize on using only the latest v4 version.