fix(admin): list the anonymous user in snapshot views

The auth snapshot built users from the key digest map only. The keyless
principal never appeared in usage, catalog, metrics or fleet views, and
its rejection counter was pruned on a users-file reload. The snapshot now
adds the anonymous principal once, with source anonymous.
This commit is contained in:
2026-11-29 00:23:08 +00:00
parent f1633666ff
commit e9fce98bab
3 changed files with 119 additions and 2 deletions
+13
View File
@@ -1462,6 +1462,19 @@ func (a *authStore) snapshot() ([]userSummary, []groupSummary) {
memberCounts[name]++
}
}
if anon := a.anonymous; anon != nil {
users = append(users, userSummary{
limits: anon.user.limits,
limitSources: anon.user.limitSources,
name: anon.user.name,
groupName: anon.user.groupName,
groups: cloneStringSlice(anon.user.groupNames),
source: "anonymous",
})
for _, name := range anon.user.groupNames {
memberCounts[name]++
}
}
a.mu.RUnlock()
sort.Slice(users, func(i, j int) bool { return users[i].name < users[j].name })