Skip to content

Commit

Permalink
JWT deprecations
Browse files Browse the repository at this point in the history
  • Loading branch information
kfcampbell authored and wlynch committed May 29, 2024
1 parent 48c7bda commit 6514ddd
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions appsTransport_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ func TestJWTExpiry(t *testing.T) {
check := RoundTrip{
rt: func(req *http.Request) (*http.Response, error) {
token := strings.Fields(req.Header.Get("Authorization"))[1]
tok, err := jwt.ParseWithClaims(token, &jwt.StandardClaims{}, func(t *jwt.Token) (interface{}, error) {
tok, err := jwt.ParseWithClaims(token, &jwt.RegisteredClaims{}, func(t *jwt.Token) (interface{}, error) {
if t.Header["alg"] != "RS256" {
return nil, fmt.Errorf("unexpected signing method: %v, expected: %v", t.Header["alg"], "RS256")
}
Expand All @@ -93,8 +93,8 @@ func TestJWTExpiry(t *testing.T) {
t.Fatalf("jwt parse: %v", err)
}

c := tok.Claims.(*jwt.StandardClaims)
if c.ExpiresAt == 0 {
c := tok.Claims.(*jwt.RegisteredClaims)
if c.ExpiresAt.IsZero() {
t.Fatalf("missing exp claim")
}
return nil, nil
Expand Down

0 comments on commit 6514ddd

Please sign in to comment.