mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2024-01-19 02:48:24 +00:00
fix compilation problem due to API changes
This commit is contained in:
parent
18cf59c375
commit
356b8048c5
|
@ -19,8 +19,10 @@ func GenJwt(secret Secret, fileId string) EncodedJwt {
|
||||||
}
|
}
|
||||||
|
|
||||||
t := jwt.New(jwt.GetSigningMethod("HS256"))
|
t := jwt.New(jwt.GetSigningMethod("HS256"))
|
||||||
t.Claims["exp"] = time.Now().Unix() + 10
|
t.Claims = &jwt.StandardClaims{
|
||||||
t.Claims["sub"] = fileId
|
ExpiresAt: time.Now().Add(time.Second * 10).Unix(),
|
||||||
|
Subject: fileId,
|
||||||
|
}
|
||||||
encoded, e := t.SignedString(secret)
|
encoded, e := t.SignedString(secret)
|
||||||
if e != nil {
|
if e != nil {
|
||||||
glog.V(0).Infof("Failed to sign claims: %v", t.Claims)
|
glog.V(0).Infof("Failed to sign claims: %v", t.Claims)
|
||||||
|
@ -53,7 +55,7 @@ func GetJwt(r *http.Request) EncodedJwt {
|
||||||
return EncodedJwt(tokenStr)
|
return EncodedJwt(tokenStr)
|
||||||
}
|
}
|
||||||
|
|
||||||
func EncodeJwt(secret Secret, claims map[string]interface{}) (EncodedJwt, error) {
|
func EncodeJwt(secret Secret, claims *jwt.StandardClaims) (EncodedJwt, error) {
|
||||||
if secret == "" {
|
if secret == "" {
|
||||||
return "", nil
|
return "", nil
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue