diff --git a/server/channels/app/license.go b/server/channels/app/license.go index 5952d59f3c..c2f879e475 100644 --- a/server/channels/app/license.go +++ b/server/channels/app/license.go @@ -7,7 +7,7 @@ import ( "net/http" "time" - "github.com/dgrijalva/jwt-go" + "github.com/golang-jwt/jwt/v5" "github.com/pkg/errors" "github.com/mattermost/mattermost/server/public/model" @@ -124,7 +124,7 @@ func (w *licenseWrapper) RequestTrialLicense(requesterID string, users int, term type JWTClaims struct { LicenseID string `json:"license_id"` ActiveUsers int64 `json:"active_users"` - jwt.StandardClaims + jwt.RegisteredClaims } func (s *Server) License() *model.License { diff --git a/server/channels/app/platform/license.go b/server/channels/app/platform/license.go index 5b9f35a7f4..d3a1b0ecb5 100644 --- a/server/channels/app/platform/license.go +++ b/server/channels/app/platform/license.go @@ -11,7 +11,7 @@ import ( "os" "time" - "github.com/dgrijalva/jwt-go" + "github.com/golang-jwt/jwt/v5" "github.com/pkg/errors" "github.com/mattermost/mattermost/server/public/model" @@ -31,7 +31,7 @@ const ( type JWTClaims struct { LicenseID string `json:"license_id"` ActiveUsers int64 `json:"active_users"` - jwt.StandardClaims + jwt.RegisteredClaims } func (ps *PlatformService) LicenseManager() einterfaces.LicenseInterface { @@ -353,8 +353,8 @@ func (ps *PlatformService) GenerateRenewalToken(expiration time.Duration) (strin claims := &JWTClaims{ LicenseID: license.Id, ActiveUsers: activeUsers, - StandardClaims: jwt.StandardClaims{ - ExpiresAt: expirationTime.Unix(), + RegisteredClaims: jwt.RegisteredClaims{ + ExpiresAt: jwt.NewNumericDate(expirationTime), }, } diff --git a/server/go.mod b/server/go.mod index 5239e32d5b..87c84e064d 100644 --- a/server/go.mod +++ b/server/go.mod @@ -10,7 +10,6 @@ require ( github.com/blang/semver v3.5.1+incompatible github.com/blevesearch/bleve/v2 v2.3.8 github.com/cespare/xxhash/v2 v2.2.0 - github.com/dgrijalva/jwt-go v3.2.0+incompatible github.com/dgryski/dgoogauth v0.0.0-20190221195224-5a805980a5f3 github.com/disintegration/imaging v1.6.2 github.com/dyatlov/go-opengraph/opengraph v0.0.0-20220524092352-606d7b1e5f8a @@ -18,6 +17,7 @@ require ( github.com/fsnotify/fsnotify v1.6.0 github.com/getsentry/sentry-go v0.22.0 github.com/go-sql-driver/mysql v1.7.1 + github.com/golang-jwt/jwt/v5 v5.0.0 github.com/golang-migrate/migrate/v4 v4.16.2 github.com/golang/freetype v0.0.0-20170609003504-e2365dfdc4a0 github.com/golang/mock v1.6.0 diff --git a/server/go.sum b/server/go.sum index 20dae34e40..330797fdba 100644 --- a/server/go.sum +++ b/server/go.sum @@ -189,8 +189,6 @@ github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ3 github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= 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/dgrijalva/jwt-go v3.2.0+incompatible h1:7qlOGliEKZXTDg6OTjfoBKDXWrumCAMpl/TFQ4/5kLM= -github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ= github.com/dgryski/dgoogauth v0.0.0-20190221195224-5a805980a5f3 h1:AqeKSZIG/NIC75MNQlPy/LM3LxfpLwahICJBHwSMFNc= github.com/dgryski/dgoogauth v0.0.0-20190221195224-5a805980a5f3/go.mod h1:hEfFauPHz7+NnjR/yHJGhrKo1Za+zStgwUETx3yzqgY= github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f h1:lO4WD4F/rVNCu3HqELle0jiPLLBs70cWOduZpkS1E78= @@ -263,6 +261,8 @@ github.com/go-sql-driver/mysql v1.7.1 h1:lUIinVbN1DY0xBg0eMOzmmtGoHwWBbvnWubQUrt github.com/go-sql-driver/mysql v1.7.1/go.mod h1:OXbVy3sEdcQ2Doequ6Z5BW6fXNQTmx+9S1MCJN5yJMI= github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= +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/golang-migrate/migrate/v4 v4.16.2 h1:8coYbMKUyInrFk1lfGfRovTLAW7PhWp8qQDT2iKfuoA= github.com/golang-migrate/migrate/v4 v4.16.2/go.mod h1:pfcJX4nPHaVdc5nmdCikFBWtm+UBpiZjRNNsyBbp0/o= github.com/golang/freetype v0.0.0-20170609003504-e2365dfdc4a0 h1:DACJavvAHhabrF08vX0COfcOBJRhZ8lUbR+ZWIs0Y5g=