Mirror terdut-server's new API key expires_at field

terdut-server's api_keys can now optionally expire (expires_in_days on
creation). The JSON shape change is additive and the TUI doesn't create
or list keys with an expiry yet, so this is a pure decode-compatibility
mirror, not a feature: APIKey gains ExpiresAt, nil for a key that never
expires or when talking to an older server that never sends the field.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
Niklas Ye
2026-10-07 22:31:27 +02:00
parent 024dc095a5
commit 77f2d6775b
+4
View File
@@ -281,6 +281,10 @@ type APIKey struct {
Key string `json:"key,omitempty"` // only present in create response
CreatedAt time.Time `json:"created_at"`
LastUsedAt *time.Time `json:"last_used_at"`
// ExpiresAt is nil for a key that never expires, including on a server
// old enough to not send the field at all — same decoded result either
// way. Not yet surfaced anywhere in the TUI.
ExpiresAt *time.Time `json:"expires_at,omitempty"`
}
// SimilarIncident is an earlier, resolved incident with the same signature