diff options
author | zeripath <art27@cantab.net> | 2020-03-09 19:56:18 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-03-09 19:56:18 +0000 |
commit | 9269b7f6271e865f2eeda7a68ed8f1afe7431bad (patch) | |
tree | 9b42ddac5ee366a08b9450848b8c40e40846b9b5 /cmd | |
parent | 3fc4f3670cb748e02d786111d2029ef1e23a9640 (diff) | |
download | gitea-9269b7f6271e865f2eeda7a68ed8f1afe7431bad.tar.gz gitea-9269b7f6271e865f2eeda7a68ed8f1afe7431bad.zip |
Multiple LFS improvements (#10667)
* Add more logging in the LFS server
Adds more logging in the LFS server and stops sending internal server
error information to the client
* Add LFS Lock cursor implementation
* Simplify Claims in LFS and remove the float64 casts
Signed-off-by: Andrew Thornton <art27@cantab.net>
Co-authored-by: Lauris BH <lauris@nix.lv>
Diffstat (limited to 'cmd')
-rw-r--r-- | cmd/serv.go | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/cmd/serv.go b/cmd/serv.go index fa1e033391..7c2be5157a 100644 --- a/cmd/serv.go +++ b/cmd/serv.go @@ -18,6 +18,7 @@ import ( "time" "code.gitea.io/gitea/models" + "code.gitea.io/gitea/modules/lfs" "code.gitea.io/gitea/modules/log" "code.gitea.io/gitea/modules/pprof" "code.gitea.io/gitea/modules/private" @@ -213,12 +214,14 @@ func runServ(c *cli.Context) error { url := fmt.Sprintf("%s%s/%s.git/info/lfs", setting.AppURL, url.PathEscape(results.OwnerName), url.PathEscape(results.RepoName)) now := time.Now() - claims := jwt.MapClaims{ - "repo": results.RepoID, - "op": lfsVerb, - "exp": now.Add(setting.LFS.HTTPAuthExpiry).Unix(), - "nbf": now.Unix(), - "user": results.UserID, + claims := lfs.Claims{ + StandardClaims: jwt.StandardClaims{ + ExpiresAt: now.Add(setting.LFS.HTTPAuthExpiry).Unix(), + NotBefore: now.Unix(), + }, + RepoID: results.RepoID, + Op: lfsVerb, + UserID: results.UserID, } token := jwt.NewWithClaims(jwt.SigningMethodHS256, claims) |