Add activity logs, sidebar badges, and logout with working alert colors.

Record auth audits and surface them in Activity, poll sidebar counts without resetting idle, and add a profile logout path plus theme red/green/blue tokens so failure badges render.
This commit is contained in:
2026-07-18 21:43:44 +02:00
parent e3793f380c
commit 463aa9a7a3
32 changed files with 3282 additions and 171 deletions
+23
View File
@@ -34,6 +34,7 @@ var allowedPermissions = map[string]struct{}{
"users.manage": {},
"secrets.manage": {},
"roles.manage": {},
"logs.read": {},
}
func groupsGetHandler(configDir string) http.HandlerFunc {
@@ -89,6 +90,19 @@ func groupsUpsertHandler(configDir string) http.HandlerFunc {
return
}
action := "group_create"
if updated {
action = "group_update"
}
appendAuthAudit(
configDir,
action,
settings.AuthAuditOutcomeSuccess,
settings.AuthAuditCategoryGroup,
actorUsernameFromRequest(request),
payload.Group.Name,
"",
)
writeJSON(writer, http.StatusOK, groupsResponse{Groups: settingsPayload.Groups})
}
}
@@ -137,6 +151,15 @@ func groupsDeleteHandler(configDir string) http.HandlerFunc {
return
}
appendAuthAudit(
configDir,
"group_delete",
settings.AuthAuditOutcomeSuccess,
settings.AuthAuditCategoryGroup,
actorUsernameFromRequest(request),
name,
"",
)
writeJSON(writer, http.StatusOK, groupsResponse{Groups: settingsPayload.Groups})
}
}