Hide physical keepass paths in token and approval UX

This commit is contained in:
Joe Julian
2026-04-13 07:18:33 -07:00
parent 9882d3fc04
commit 6790399e24
7 changed files with 140 additions and 14 deletions
+15 -1
View File
@@ -71,7 +71,7 @@ func AuditEventSearchTerms(event apiaudit.Event) string {
event.ClientName,
string(event.Operation),
AuditOperationLabel(event.Operation),
strings.Join(event.Resource.Path, " / "),
FormatResourcePath(event.Resource.Path),
event.Resource.EntryID,
event.Message,
}
@@ -91,3 +91,17 @@ func AuditEventSearchTerms(event apiaudit.Event) string {
}
return strings.ToLower(strings.Join(parts, " "))
}
func DisplayResourcePath(path []string) []string {
if len(path) == 0 {
return nil
}
if path[0] == "keepass" {
return append([]string{"Root"}, append([]string(nil), path[1:]...)...)
}
return append([]string(nil), path...)
}
func FormatResourcePath(path []string) string {
return strings.Join(DisplayResourcePath(path), " / ")
}