feat: audit git ssh key regeneration (#4544)

This commit is contained in:
Colin Adler
2022-10-14 16:25:46 -05:00
committed by GitHub
parent dd8ebf10db
commit 7ec88bf841
8 changed files with 63 additions and 22 deletions
+9 -1
View File
@@ -221,10 +221,18 @@ func convertAuditLog(dblog database.GetAuditLogsOffsetRow) codersdk.AuditLog {
}
func auditLogDescription(alog database.GetAuditLogsOffsetRow) string {
return fmt.Sprintf("{user} %s %s {target}",
str := fmt.Sprintf("{user} %s %s",
codersdk.AuditAction(alog.Action).FriendlyString(),
codersdk.ResourceType(alog.ResourceType).FriendlyString(),
)
// We don't display the name for git ssh keys. It's fairly long and doesn't
// make too much sense to display.
if alog.ResourceType != database.ResourceTypeGitSshKey {
str += " {target}"
}
return str
}
// auditSearchQuery takes a query string and returns the auditLog filter.