feat: admin endpoints to reset username sync flags

Add POST /v1/admin/users/{pubkey}/reset-username and
POST /v1/admin/users/reset-usernames to clear manual_username
and last_synced_at so nostr profile sync re-evaluates users.
Includes OpenAPI docs, audit actions, and tests.
This commit is contained in:
2026-05-06 19:31:13 +00:00
parent c6bdb7f825
commit fe2b95258d
7 changed files with 290 additions and 0 deletions

View File

@@ -79,9 +79,11 @@ func NewServer(d Deps) *http.Server {
r.Use(middleware.AdminAuth(d.Cfg.AdminAPIKey))
r.Post("/users", adminUsers.Add)
r.Get("/users", adminUsers.List)
r.Post("/users/reset-usernames", adminUsers.ResetAllUsernames)
r.Put("/users/{pubkey}", adminUsers.Update)
r.Delete("/users/{pubkey}", adminUsers.Delete)
r.Post("/users/{pubkey}/extend", adminExtend.Handle)
r.Post("/users/{pubkey}/reset-username", adminUsers.ResetUsername)
})
})