Skip to content

Commit 5870456

Browse files
committed
fixup! feat: audit git ssh key regeneration
1 parent ef05fd8 commit 5870456

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

coderd/audit.go

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -221,10 +221,18 @@ func convertAuditLog(dblog database.GetAuditLogsOffsetRow) codersdk.AuditLog {
221221
}
222222

223223
func auditLogDescription(alog database.GetAuditLogsOffsetRow) string {
224-
return fmt.Sprintf("{user} %s %s {target}",
224+
str := fmt.Sprintf("{user} %s %s",
225225
codersdk.AuditAction(alog.Action).FriendlyString(),
226226
codersdk.ResourceType(alog.ResourceType).FriendlyString(),
227227
)
228+
229+
// We don't display the name for git ssh keys. It's fairly long and doesn't
230+
// make too much sense to display.
231+
if alog.ResourceType != database.ResourceTypeGitSshKey {
232+
str += " {target}"
233+
}
234+
235+
return str
228236
}
229237

230238
// auditSearchQuery takes a query string and returns the auditLog filter.

0 commit comments

Comments
 (0)