From 1bebd7ad34be49993102739945cbc6e636c044d3 Mon Sep 17 00:00:00 2001 From: John Rowley Date: Fri, 6 Oct 2023 05:51:19 +0000 Subject: [PATCH] chore: upgraded to golang-jwt v5 --- client.go | 2 +- client_test.go | 2 +- go.mod | 2 +- go.sum | 4 ++-- models.go | 4 ++-- pkg/jwx/jwx.go | 2 +- pkg/jwx/jwx_test.go | 2 +- pkg/jwx/models.go | 4 ++-- 8 files changed, 11 insertions(+), 11 deletions(-) diff --git a/client.go b/client.go index 5c8bc50d..96790969 100644 --- a/client.go +++ b/client.go @@ -13,7 +13,7 @@ import ( "time" "github.com/go-resty/resty/v2" - "github.com/golang-jwt/jwt/v4" + "github.com/golang-jwt/jwt/v5" "github.com/opentracing/opentracing-go" "github.com/pkg/errors" "github.com/segmentio/ksuid" diff --git a/client_test.go b/client_test.go index 9ceebeab..8cf2972b 100644 --- a/client_test.go +++ b/client_test.go @@ -22,7 +22,7 @@ import ( "time" "github.com/go-resty/resty/v2" - "github.com/golang-jwt/jwt/v4" + "github.com/golang-jwt/jwt/v5" "github.com/stretchr/testify/require" "golang.org/x/crypto/pkcs12" diff --git a/go.mod b/go.mod index 90f78f02..1e8fc75a 100644 --- a/go.mod +++ b/go.mod @@ -4,7 +4,7 @@ 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 diff --git a/go.sum b/go.sum index a8aaf844..ad0933f2 100644 --- a/go.sum +++ b/go.sum @@ -3,8 +3,8 @@ github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/go-resty/resty/v2 v2.7.0 h1:me+K9p3uhSmXtrBZ4k9jcEAfJmuC8IivWHwaLZwPrFY= github.com/go-resty/resty/v2 v2.7.0/go.mod h1:9PWDzw47qPphMRFfhsyk0NnSgvluHcljSMVIq3w7q0I= -github.com/golang-jwt/jwt/v4 v4.5.0 h1:7cYmW1XlMY7h7ii7UhUyChSgS5wUJEnm9uZVTGqOWzg= -github.com/golang-jwt/jwt/v4 v4.5.0/go.mod h1:m21LjoU+eqJr34lmDMbreY2eSTRJ1cv77w39/MY0Ch0= +github.com/golang-jwt/jwt/v5 v5.0.0 h1:1n1XNM9hk7O9mnQoNBGolZvzebBQ7p93ULHRc28XJUE= +github.com/golang-jwt/jwt/v5 v5.0.0/go.mod h1:pqrtFR0X4osieyHYxtmOUWsAWrfe1Q5UVIyoH402zdk= github.com/opentracing/opentracing-go v1.2.0 h1:uEJPy/1a5RIPAJ0Ov+OIO8OxWu77jEv+1B0VhjKrZUs= github.com/opentracing/opentracing-go v1.2.0/go.mod h1:GxEUsuufX4nBwe+T+Wl9TAgYrxe9dPLANfrWvHYVTgc= github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= diff --git a/models.go b/models.go index ee051217..fc26d208 100644 --- a/models.go +++ b/models.go @@ -5,7 +5,7 @@ import ( "encoding/json" "strings" - "github.com/golang-jwt/jwt/v4" + "github.com/golang-jwt/jwt/v5" ) // GetQueryParams converts the struct to map[string]string @@ -1258,7 +1258,7 @@ type PermissionTicketRepresentation struct { AZP *string `json:"azp,omitempty"` Claims *map[string][]string `json:"claims,omitempty"` Permissions *[]PermissionTicketPermissionRepresentation `json:"permissions,omitempty"` - jwt.StandardClaims + jwt.RegisteredClaims } // PermissionTicketPermissionRepresentation represents the individual permissions in a permission ticket diff --git a/pkg/jwx/jwx.go b/pkg/jwx/jwx.go index ccf000f5..8eeefada 100644 --- a/pkg/jwx/jwx.go +++ b/pkg/jwx/jwx.go @@ -12,7 +12,7 @@ import ( "math/big" "strings" - "github.com/golang-jwt/jwt/v4" + "github.com/golang-jwt/jwt/v5" "github.com/pkg/errors" ) diff --git a/pkg/jwx/jwx_test.go b/pkg/jwx/jwx_test.go index 97a6ba98..4862d746 100644 --- a/pkg/jwx/jwx_test.go +++ b/pkg/jwx/jwx_test.go @@ -10,7 +10,7 @@ import ( "github.com/stretchr/testify/require" - "github.com/golang-jwt/jwt/v4" + "github.com/golang-jwt/jwt/v5" ) var claims = jwt.MapClaims{ diff --git a/pkg/jwx/models.go b/pkg/jwx/models.go index 48b7449a..c5ccfb7d 100644 --- a/pkg/jwx/models.go +++ b/pkg/jwx/models.go @@ -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 { - jwt.StandardClaims + jwt.RegisteredClaims Typ string `json:"typ,omitempty"` Azp string `json:"azp,omitempty"` AuthTime int `json:"auth_time,omitempty"`