feat(audit): auditing token addition and removal (#6649)

* auditing tokens

* adding diffs for token auditing

* added test

* generating docs

* auditing owner field
This commit is contained in:
Kira Pilot
2023-03-17 10:41:44 -07:00
committed by GitHub
parent 5b07f1e2a3
commit 090e37fc46
7 changed files with 75 additions and 32 deletions
+3 -2
View File
@@ -254,9 +254,10 @@ func auditLogDescription(alog database.GetAuditLogsOffsetRow) string {
codersdk.AuditAction(alog.Action).Friendly(),
)
// API Key resources do not have targets and follow the below format:
// API Key resources (used for authentication) do not have targets and follow the below format:
// "User {logged in | logged out}"
if alog.ResourceType == database.ResourceTypeApiKey {
if alog.ResourceType == database.ResourceTypeApiKey &&
(alog.Action == database.AuditActionLogin || alog.Action == database.AuditActionLogout) {
return str
}