Skip to content

Commit

Permalink
Delete jwt-go pkg
Browse files Browse the repository at this point in the history
  • Loading branch information
杨赫然 committed Aug 12, 2024
1 parent c155d06 commit 25e5d39
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
1 change: 0 additions & 1 deletion fileserver/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ go 1.17

require (
github.com/dgraph-io/ristretto v0.1.1
github.com/dgrijalva/jwt-go v3.2.0+incompatible
github.com/go-sql-driver/mysql v1.5.0
github.com/golang-jwt/jwt/v5 v5.2.1
github.com/google/uuid v1.1.1
Expand Down
2 changes: 0 additions & 2 deletions fileserver/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@ 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/dgraph-io/ristretto v0.1.1 h1:6CWw5tJNgpegArSHpNHJKldNeq03FQCwYvfMVWajOK8=
github.com/dgraph-io/ristretto v0.1.1/go.mod h1:S1GPSBCYCIhmVNfcth17y2zZtQT6wzkzgwUve0VDWWA=
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/go-farm v0.0.0-20190423205320-6a90982ecee2 h1:tdlZCpZ/P9DhczCTSixgIKmwPv6+wP5DGjqLYw5SUiA=
github.com/dgryski/go-farm v0.0.0-20190423205320-6a90982ecee2/go.mod h1:SqUrOPUnsFjfmXRMNPybcSiG0BgUW2AuFH8PAnS2iTw=
github.com/dustin/go-humanize v1.0.0 h1:VSnTsYCnlFHaM2/igO1h6X3HA71jcobQuxemgkq4zYo=
Expand Down
8 changes: 6 additions & 2 deletions fileserver/merge.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (
"strings"
"time"

jwt "github.com/dgrijalva/jwt-go"
jwt "github.com/golang-jwt/jwt/v5"
"github.com/haiwen/seafile-server/fileserver/commitmgr"
"github.com/haiwen/seafile-server/fileserver/fsmgr"
"github.com/haiwen/seafile-server/fileserver/utils"
Expand Down Expand Up @@ -233,7 +233,9 @@ func mergeEntries(storeID string, dents []*fsmgr.SeafDirent, baseDir string, opt
mergedDents = append(mergedDents, head)
opt.conflict = true
}
}
} /* else if base != nil && head == nil && remote == nil {
Don't need to add anything to mergeDents.
}*/

return mergedDents, nil
}
Expand Down Expand Up @@ -395,6 +397,7 @@ func getNickNameByModifier(emailToNickname map[string]string, modifier string) s
type SeahubClaims struct {
Exp int64
IsInternal bool `json:"is_internal"`
jwt.RegisteredClaims
}

func (*SeahubClaims) Valid() error {
Expand All @@ -405,6 +408,7 @@ func postGetNickName(modifier string) string {
claims := SeahubClaims{
time.Now().Add(time.Second * 300).Unix(),
true,
jwt.RegisteredClaims{},
}

token := jwt.NewWithClaims(jwt.GetSigningMethod("HS256"), &claims)
Expand Down

0 comments on commit 25e5d39

Please sign in to comment.