summaryrefslogtreecommitdiffstats
path: root/services/lfs/locks.go
diff options
context:
space:
mode:
Diffstat (limited to 'services/lfs/locks.go')
-rw-r--r--services/lfs/locks.go20
1 files changed, 20 insertions, 0 deletions
diff --git a/services/lfs/locks.go b/services/lfs/locks.go
index d963d9ab57..1e5db6bd20 100644
--- a/services/lfs/locks.go
+++ b/services/lfs/locks.go
@@ -58,6 +58,11 @@ func GetListLockHandler(ctx *context.Context) {
}
repository.MustOwner(ctx)
+ context.CheckRepoScopedToken(ctx, repository)
+ if ctx.Written() {
+ return
+ }
+
authenticated := authenticate(ctx, repository, rv.Authorization, true, false)
if !authenticated {
ctx.Resp.Header().Set("WWW-Authenticate", "Basic realm=gitea-lfs")
@@ -145,6 +150,11 @@ func PostLockHandler(ctx *context.Context) {
}
repository.MustOwner(ctx)
+ context.CheckRepoScopedToken(ctx, repository)
+ if ctx.Written() {
+ return
+ }
+
authenticated := authenticate(ctx, repository, authorization, true, true)
if !authenticated {
ctx.Resp.Header().Set("WWW-Authenticate", "Basic realm=gitea-lfs")
@@ -212,6 +222,11 @@ func VerifyLockHandler(ctx *context.Context) {
}
repository.MustOwner(ctx)
+ context.CheckRepoScopedToken(ctx, repository)
+ if ctx.Written() {
+ return
+ }
+
authenticated := authenticate(ctx, repository, authorization, true, true)
if !authenticated {
ctx.Resp.Header().Set("WWW-Authenticate", "Basic realm=gitea-lfs")
@@ -278,6 +293,11 @@ func UnLockHandler(ctx *context.Context) {
}
repository.MustOwner(ctx)
+ context.CheckRepoScopedToken(ctx, repository)
+ if ctx.Written() {
+ return
+ }
+
authenticated := authenticate(ctx, repository, authorization, true, true)
if !authenticated {
ctx.Resp.Header().Set("WWW-Authenticate", "Basic realm=gitea-lfs")