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

Skip to content

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

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


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