From 4aed4105aaf386aa67cee10da4ec43378407e6fa Mon Sep 17 00:00:00 2001 From: Hein Date: Sun, 5 Apr 2026 11:59:08 +0200 Subject: [PATCH] fix(auth): add JSON tags to AccessSnapshot fields for proper serialization --- internal/auth/access_tracker.go | 12 ++++++------ ui/src/App.svelte | 5 +++++ 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/internal/auth/access_tracker.go b/internal/auth/access_tracker.go index 5799923..94b2d23 100644 --- a/internal/auth/access_tracker.go +++ b/internal/auth/access_tracker.go @@ -7,12 +7,12 @@ import ( ) type AccessSnapshot struct { - KeyID string - LastPath string - RemoteAddr string - UserAgent string - RequestCount int - LastAccessedAt time.Time + KeyID string `json:"key_id"` + LastPath string `json:"last_path"` + RemoteAddr string `json:"remote_addr"` + UserAgent string `json:"user_agent"` + RequestCount int `json:"request_count"` + LastAccessedAt time.Time `json:"last_accessed_at"` } type AccessTracker struct { diff --git a/ui/src/App.svelte b/ui/src/App.svelte index a5857c5..4bad060 100644 --- a/ui/src/App.svelte +++ b/ui/src/App.svelte @@ -5,6 +5,7 @@ key_id: string; last_accessed_at: string; last_path: string; + user_agent: string; request_count: number; }; @@ -224,6 +225,7 @@ Principal Last accessed Last path + Agent Requests @@ -242,6 +244,9 @@ {entry.last_path} + {entry.user_agent ?? "—"} {entry.request_count}