feat: add tracking for auth request success and failure counts
- Introduced `Success` and `Failed` fields in auth records to track request outcomes. - Updated `/v0/management/auth-files` and `/v0/management/api-key-usage` responses to include success and failure counts. - Enhanced tests to validate tracking logic and API responses.
This commit is contained in:
@@ -388,6 +388,8 @@ func (h *Handler) buildAuthFileEntry(auth *coreauth.Auth) gin.H {
|
||||
"source": "memory",
|
||||
"size": int64(0),
|
||||
}
|
||||
entry["success"] = auth.Success
|
||||
entry["failed"] = auth.Failed
|
||||
entry["recent_requests"] = auth.RecentRequestsSnapshot(time.Now())
|
||||
if email := authEmail(auth); email != "" {
|
||||
entry["email"] = email
|
||||
|
||||
Reference in New Issue
Block a user