fix(security): synchronize report lifecycle and current roles

Revalidate admin roles from the database and serialize report generation registration with owner-scoped deletion.

Refs #9

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
2026-11-20 21:35:38 +01:00
parent 0ebc531124
commit 609dbff7c1
16 changed files with 668 additions and 35 deletions

View File

@ -20,7 +20,7 @@ import (
// covered separately when a disposable PostgreSQL test database is available.
func accountRouter() *gin.Engine {
gin.SetMode(gin.TestMode)
return api.SetupRouter(handlers.New(nil, &config.Config{JWTSecret: "test-secret"}, nil, nil, nil, nil), "test-secret")
return api.SetupRouter(handlers.New(currentRoleRepository(), &config.Config{JWTSecret: "test-secret"}, nil, nil, nil, nil), "test-secret")
}
func TestPublicRegistrationIsUnavailable(t *testing.T) {