Thanks to visit codestin.com
Credit goes to github.com

Skip to content

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

Merged
merged 1 commit into from
Jan 3, 2025
Merged

chore: replace github.com/go-jose/go-jose/v3 with v4 #16031

merged 1 commit into from
Jan 3, 2025

Conversation

Juneezee
Copy link
Contributor

@Juneezee Juneezee commented Jan 3, 2025

coder/go.mod

Lines 125 to 126 in 4495db8

github.com/go-jose/go-jose/v3 v3.0.3
github.com/go-jose/go-jose/v4 v4.0.2

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.

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]>
@cdr-bot cdr-bot bot added the community Pull Requests and issues created by the community. label Jan 3, 2025
Copy link

github-actions bot commented Jan 3, 2025

All contributors have signed the CLA ✍️ ✅
Posted by the CLA Assistant Lite bot.

@Juneezee
Copy link
Contributor Author

Juneezee commented Jan 3, 2025

I have read the CLA Document and I hereby sign the CLA

cdrci2 added a commit to coder/cla that referenced this pull request Jan 3, 2025
Copy link
Contributor Author

@Juneezee Juneezee left a 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})
Copy link
Contributor Author

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
Copy link
Contributor Author

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.

@Juneezee Juneezee marked this pull request as ready for review January 3, 2025 17:02
Copy link
Member

@Emyrk Emyrk left a 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.

@Emyrk Emyrk merged commit d788223 into coder:main Jan 3, 2025
34 of 36 checks passed
@github-actions github-actions bot locked and limited conversation to collaborators Jan 3, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
community Pull Requests and issues created by the community.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants