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>
Этот коммит содержится в:
@@ -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),
|
||||
},
|
||||
}
|
||||
|
||||
|
||||
Ссылка в новой задаче
Block a user