refactor(api): rename auth/whoami to users/info and simplify response

Rename endpoint from /auth/whoami to /users/info to align with
ez-contract schema. Simplify WhoamiResponse by removing:
- Realtime stats (requests, tokens, qps, rate_limited)
- Key-specific fields (allow_ips, deny_ips, expires_at, model_limits,
  quota fields, usage stats)

The endpoint now returns only essential identity information as
defined in ez-contract/schemas/auth/auth.yaml.

BREAKING CHANGE: /auth/whoami endpoint moved to /users/info with
reduced response fields
This commit is contained in:
2026-01-13 15:57:52 +08:00
parent c990fa6610
commit 7929b2a872
3 changed files with 49 additions and 173 deletions

View File

@@ -428,10 +428,10 @@ func main() {
masterGroup.GET("/stats", masterHandler.GetSelfStats)
}
// Auth Routes (public, no middleware - self-validates token)
authGroup := r.Group("/auth")
// Users Routes (public, no middleware - self-validates token)
usersGroup := r.Group("/users")
{
authGroup.GET("/whoami", authHandler.Whoami)
usersGroup.GET("/info", authHandler.Whoami)
}
// Public/General Routes (if any)