-
Notifications
You must be signed in to change notification settings - Fork 288
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
chore: upgraded to golang-jwt v5 #446
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,17 +4,17 @@ go 1.18 | |
|
||
require ( | ||
github.com/go-resty/resty/v2 v2.7.0 | ||
github.com/golang-jwt/jwt/v4 v4.5.0 | ||
github.com/golang-jwt/jwt/v5 v5.0.0 | ||
github.com/opentracing/opentracing-go v1.2.0 | ||
github.com/pkg/errors v0.9.1 | ||
github.com/segmentio/ksuid v1.0.4 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. crypto needed to be updated in order to bump golang.org/x/net |
||
github.com/stretchr/testify v1.8.2 | ||
golang.org/x/crypto v0.6.0 | ||
golang.org/x/crypto v0.14.0 | ||
) | ||
|
||
require ( | ||
github.com/davecgh/go-spew v1.1.1 // indirect | ||
github.com/pmezard/go-difflib v1.0.0 // indirect | ||
golang.org/x/net v0.7.0 // indirect | ||
golang.org/x/net v0.17.0 // indirect | ||
gopkg.in/yaml.v3 v3.0.1 // indirect | ||
) |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
package jwx | ||
|
||
import jwt "github.com/golang-jwt/jwt/v4" | ||
import jwt "github.com/golang-jwt/jwt/v5" | ||
|
||
// DecodedAccessTokenHeader is the decoded header from the access token | ||
type DecodedAccessTokenHeader struct { | ||
|
@@ -11,7 +11,7 @@ type DecodedAccessTokenHeader struct { | |
|
||
// Claims served by keycloak inside the accessToken | ||
type Claims struct { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. StandardClaims has been deprecated for a while, and was finally removed in v5. RegisteredClaims is the new equivalent. |
||
jwt.StandardClaims | ||
jwt.RegisteredClaims | ||
Typ string `json:"typ,omitempty"` | ||
Azp string `json:"azp,omitempty"` | ||
AuthTime int `json:"auth_time,omitempty"` | ||
|
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 error message changed due to the upgrade, so I just changed the test to check if the returned error is the ErrTokenSignatureInvalid error, instead of comparing the text