backend: expand bookmark API with bulk ops and metadata fetcher

- bulk create/delete/move, reorder, rename-category endpoints
- /bookmarks/meta with SSRF-safe fetcher (blocks private/loopback IPs,
  8s timeout, 1 MiB body cap)

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
root
2026-05-02 22:52:43 +00:00
parent 487b4c42c4
commit 832512469a
6 changed files with 474 additions and 52 deletions

View File

@@ -41,6 +41,12 @@ func Setup(cfg *config.Config) *gin.Engine {
{
auth.GET("/bookmarks", bookmarkHandler.List)
auth.POST("/bookmarks", bookmarkHandler.Create)
auth.POST("/bookmarks/meta", bookmarkHandler.FetchMeta)
auth.POST("/bookmarks/bulk", bookmarkHandler.BulkCreate)
auth.POST("/bookmarks/bulk-delete", bookmarkHandler.BulkDelete)
auth.POST("/bookmarks/bulk-move", bookmarkHandler.BulkMove)
auth.POST("/bookmarks/reorder", bookmarkHandler.Reorder)
auth.POST("/bookmarks/rename-category", bookmarkHandler.RenameCategory)
auth.PUT("/bookmarks/:id", bookmarkHandler.Update)
auth.DELETE("/bookmarks/:id", bookmarkHandler.Delete)
}