-
Notifications
You must be signed in to change notification settings - Fork 225
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add json exp #699
Add json exp #699
Conversation
fileserver/utils/utils.go
Outdated
return nil | ||
} | ||
|
||
func GenJWTToken(repoID, user string, isInternal bool) (string, error) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
从逻辑上说,seahub internal API 的 jwt 和 notification server 的 jwt 是没有关系的。所以应该分为两个函数比较清晰。Claims 数据结构也应该分开。
fileserver/option/option.go
Outdated
|
||
// seahub | ||
SeahubURL string | ||
PrivateKey string |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这个改为 JWTPrivateKey
fileserver/utils/utils.go
Outdated
|
||
func GenNotifJWTToken(repoID, user string) (string, error) { | ||
claims := new(MyClaims) | ||
claims.Exp = time.Now().Add(time.Hour * 72).Unix() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这个超时应该可以用 300 秒吧。C 部分的也改一下。
fileserver/utils/utils.go
Outdated
|
||
func GenNotifJWTToken(repoID, user string, exp int64) (string, error) { | ||
claims := new(MyClaims) | ||
claims.Exp = time.Now().Add(time.Hour * 72).Unix() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这一行应该是多余的吧?
No description provided.