feat(admin): add super admin initialization endpoint
All checks were successful
Build Backend / build (push) Successful in 2m42s
Build Backend / build-docker (push) Successful in 2m52s

Add POST /api/v1/admin/setup-super-admin endpoint to initialize the first super admin.
The endpoint can only be used once - after a super admin exists, subsequent requests
are rejected. Requires valid setup_secret configured via APP_SETUP_SECRET environment
variable or setup_secret in config file.
This commit is contained in:
lafay
2026-04-24 15:14:44 +08:00
parent 05c7f8a5eb
commit 813e54e5b2
12 changed files with 153 additions and 3 deletions

View File

@@ -43,6 +43,7 @@ var HandlerSet = wire.NewSet(
ProvideScheduleHandler,
ProvideWSHandler,
ProvideAdminVerificationHandler,
ProvideSetupHandler,
)
func ProvideUserHandler(
@@ -108,3 +109,9 @@ func ProvideAdminVerificationHandler(
) *handler.AdminVerificationHandler {
return handler.NewAdminVerificationHandler(adminVerificationService, userRepo)
}
func ProvideSetupHandler(
setupService service.SetupService,
) *handler.SetupHandler {
return handler.NewSetupHandler(setupService)
}