Update to github.com/golang-jwt/jwt/v5 (#24208)

* Update to github.com/golang-jwt/jwt/v5

* Update server/channels/app/platform/license.go

Co-authored-by: Juho Nurminen <juhonurm@gmail.com>

---------

Co-authored-by: Juho Nurminen <juhonurm@gmail.com>
Этот коммит содержится в:
Jian Lim
2023-08-10 04:09:01 +09:00
коммит произвёл GitHub
родитель 7818d5a348
Коммит ace88288f0
4 изменённых файлов: 9 добавлений и 9 удалений

Просмотреть файл

@@ -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 {

Просмотреть файл

@@ -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),
},
}