From 77f2d6775be11b90ee478765a88814fc08c00cf2 Mon Sep 17 00:00:00 2001 From: Niklas Ye Date: Wed, 7 Oct 2026 22:31:27 +0200 Subject: [PATCH] Mirror terdut-server's new API key expires_at field MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- internal/api/types.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/internal/api/types.go b/internal/api/types.go index 6e4ba7b..a00da91 100644 --- a/internal/api/types.go +++ b/internal/api/types.go @@ -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