From 6514ddd76b5e234b1af8b534527d101903ada672 Mon Sep 17 00:00:00 2001 From: Keegan Campbell Date: Tue, 21 May 2024 14:17:11 -0700 Subject: [PATCH] JWT deprecations --- appsTransport_test.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/appsTransport_test.go b/appsTransport_test.go index d0c193d..37a2b2c 100644 --- a/appsTransport_test.go +++ b/appsTransport_test.go @@ -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") } @@ -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