Changeset 0.28.4 (#190)

This commit is contained in:
2026-03-14 19:36:33 +00:00
parent fa6b04434a
commit 85d5e3cc13
54 changed files with 7355 additions and 102 deletions

View File

@@ -44,11 +44,12 @@ func setupProjectHarness(t *testing.T) *projectHarness {
} else {
stores = postgres.NewStores(database.TestDB)
}
userCache := middleware.NewUserStatusCache()
r := gin.New()
api := r.Group("/api/v1")
protected := api.Group("")
protected.Use(middleware.Auth(cfg))
protected.Use(middleware.Auth(cfg, stores.Users, userCache))
projH := NewProjectHandler(stores)
protected.GET("/projects", projH.List)
@@ -69,7 +70,7 @@ func setupProjectHarness(t *testing.T) *projectHarness {
// Admin routes
admin := api.Group("/admin")
admin.Use(middleware.Auth(cfg))
admin.Use(middleware.Auth(cfg, stores.Users, userCache))
admin.Use(middleware.RequireAdmin())
admin.GET("/projects", projH.AdminList)
admin.DELETE("/projects/:id", projH.Delete)