diff options
author | Jaime Martinez <jmartinez@gitlab.com> | 2021-11-17 03:34:13 +0300 |
---|---|---|
committer | Jaime Martinez <jmartinez@gitlab.com> | 2021-11-17 03:34:13 +0300 |
commit | dbb496cb31e211a0df7b4a1603a56ba5337a3404 (patch) | |
tree | e5cd6ae33df57131a8ec5465d2a442ccf5b4237d | |
parent | 62c53f8d423c76089bbdcf5559962d7930cf8bd4 (diff) | |
parent | 1d0f0e81ba7db826d42051705e89ba304ad95ce7 (diff) |
Merge branch 'bump/go-jwt' into 'master'
refactor: replace deprecated StandardClaims with RFC7519-compliant RegisteredClaims
See merge request gitlab-org/gitlab-pages!608
-rw-r--r-- | go.mod | 2 | ||||
-rw-r--r-- | go.sum | 4 | ||||
-rw-r--r-- | internal/source/gitlab/client/client.go | 4 |
3 files changed, 5 insertions, 5 deletions
@@ -7,7 +7,7 @@ module gitlab.com/gitlab-org/gitlab-pages go 1.16 require ( - github.com/golang-jwt/jwt/v4 v4.0.0 + github.com/golang-jwt/jwt/v4 v4.1.0 github.com/golang/mock v1.3.1 github.com/gorilla/handlers v1.4.2 github.com/gorilla/mux v1.8.0 @@ -81,8 +81,8 @@ github.com/gobwas/httphead v0.0.0-20180130184737-2c6c146eadee/go.mod h1:L0fX3K22 github.com/gobwas/pool v0.2.0/go.mod h1:q8bcK0KcYlCgd9e7WYLm9LpyS+YeLd8JVDW6WezmKEw= github.com/gobwas/ws v1.0.2/go.mod h1:szmBTxLgaFppYjEmNtny/v3w89xOydFnnZMcgRRu/EM= github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= -github.com/golang-jwt/jwt/v4 v4.0.0 h1:RAqyYixv1p7uEnocuy8P1nru5wprCh/MH2BIlW5z5/o= -github.com/golang-jwt/jwt/v4 v4.0.0/go.mod h1:/xlHOz8bRuivTWchD4jCa+NbatV+wEUSzwAxVc6locg= +github.com/golang-jwt/jwt/v4 v4.1.0 h1:XUgk2Ex5veyVFVeLm0xhusUTQybEbexJXrvPNOKkSY0= +github.com/golang-jwt/jwt/v4 v4.1.0/go.mod h1:/xlHOz8bRuivTWchD4jCa+NbatV+wEUSzwAxVc6locg= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b h1:VKtxabqXZkF25pY9ekfRL6a582T4P37/31XEstQ5p58= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= diff --git a/internal/source/gitlab/client/client.go b/internal/source/gitlab/client/client.go index 92ae0390..9e822e56 100644 --- a/internal/source/gitlab/client/client.go +++ b/internal/source/gitlab/client/client.go @@ -201,9 +201,9 @@ func (gc *Client) request(ctx context.Context, method string, endpoint *url.URL) } func (gc *Client) token() (string, error) { - claims := jwt.StandardClaims{ + claims := jwt.RegisteredClaims{ Issuer: "gitlab-pages", - ExpiresAt: time.Now().UTC().Add(gc.jwtTokenExpiry).Unix(), + ExpiresAt: jwt.NewNumericDate(time.Now().UTC().Add(gc.jwtTokenExpiry)), } token, err := jwt.NewWithClaims(jwt.SigningMethodHS256, claims).SignedString(gc.secretKey) |