From d99f4ab0035631aacc44739af0a936e59daf83b7 Mon Sep 17 00:00:00 2001 From: Antoine GIRARD Date: Tue, 28 Nov 2017 21:58:37 +0100 Subject: Git LFS lock api (#2938) * Implement routes * move to api/sdk and create model * Implement add + list * List return 200 empty list no 404 * Add verify lfs lock api * Add delete and start implementing auth control * Revert to code.gitea.io/sdk/gitea vendor * Apply needed check for all lfs locks route * Add simple tests * fix lint * Improve tests * Add delete test + fix * Add lfs ascii header * Various fixes from review + remove useless code + add more corner case testing * Remove repo link since only id is needed. Save a little of memory and cpu time. * Improve tests * Use TEXT column format for path + test * fix mispell * Use NewRequestWithJSON for POST tests * Clean path * Improve DB format * Revert uniquess repoid+path * (Re)-setup uniqueness + max path length * Fixed TEXT in place of VARCHAR * Settle back to maximum VARCHAR(3072) * Let place for repoid in key * Let place for repoid in key * Let place for repoid in key * Revert back --- routers/routes/routes.go | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'routers/routes') diff --git a/routers/routes/routes.go b/routers/routes/routes.go index 9a42ef68d3..2945c31476 100644 --- a/routers/routes/routes.go +++ b/routers/routes/routes.go @@ -685,6 +685,12 @@ func RegisterRoutes(m *macaron.Macaron) { m.Any("/objects/:oid", lfs.ObjectOidHandler) m.Post("/objects", lfs.PostHandler) m.Post("/verify", lfs.VerifyHandler) + m.Group("/locks", func() { + m.Get("/", lfs.GetListLockHandler) + m.Post("/", lfs.PostLockHandler) + m.Post("/verify", lfs.VerifyLockHandler) + m.Post("/:lid/unlock", lfs.UnLockHandler) + }, context.RepoAssignment()) m.Any("/*", func(ctx *context.Context) { ctx.Handle(404, "", nil) }) -- cgit v1.2.3