summaryrefslogtreecommitdiff
path: root/Hutch/Models
diff options
context:
space:
mode:
authorChristian Cleberg <[email protected]>2026-07-15 23:52:45 -0500
committerChristian Cleberg <[email protected]>2026-07-15 23:52:45 -0500
commitf3627deef0848b95a083d9e16468b0f8484d784e (patch)
treea30ee4dc46bd2e575820316b857dd08cfa9a53c2 /Hutch/Models
parentc4930f31ffc5d7c5de5eeafd3da184c7691f8ab7 (diff)
downloadhutch-f3627deef0848b95a083d9e16468b0f8484d784e.tar.gz
hutch-f3627deef0848b95a083d9e16468b0f8484d784e.tar.bz2
hutch-f3627deef0848b95a083d9e16468b0f8484d784e.zip
feat: show the meta.sr.ht audit log
auditLog existed in the API but was never called, so the record of what has happened to your account — logins, key changes, the addresses they came from — was web-only. Sits under the tokens in Profile and loads on demand for the same reason they do: an audit log is something you go looking for, not something worth a request on every profile view. One page, newest first; the archive stays on meta.sr.ht. Its errors are kept separate from the shared `error` so a failed audit fetch cannot bury a profile save failure, and vice versa.
Diffstat (limited to 'Hutch/Models')
-rw-r--r--Hutch/Models/Meta.swift10
1 files changed, 10 insertions, 0 deletions
diff --git a/Hutch/Models/Meta.swift b/Hutch/Models/Meta.swift
index 91bd7e3..f52fc76 100644
--- a/Hutch/Models/Meta.swift
+++ b/Hutch/Models/Meta.swift
@@ -69,3 +69,13 @@ struct PersonalAccessToken: Codable, Sendable, Identifiable {
let comment: String?
let grants: String?
}
+
+/// One entry in meta.sr.ht's audit log: a security-relevant action on the
+/// account, with the address it came from.
+struct AuditLogEntry: Codable, Sendable, Identifiable {
+ let id: Int
+ let created: Date
+ let ipAddress: String
+ let eventType: String
+ let details: String?
+}