fix(auth): add JSON tags to AccessSnapshot fields for proper serialization
Some checks failed
CI / build-and-test (push) Failing after -30m35s

This commit is contained in:
2026-04-05 11:59:08 +02:00
parent 8af4956951
commit 4aed4105aa
2 changed files with 11 additions and 6 deletions

View File

@@ -7,12 +7,12 @@ import (
) )
type AccessSnapshot struct { type AccessSnapshot struct {
KeyID string KeyID string `json:"key_id"`
LastPath string LastPath string `json:"last_path"`
RemoteAddr string RemoteAddr string `json:"remote_addr"`
UserAgent string UserAgent string `json:"user_agent"`
RequestCount int RequestCount int `json:"request_count"`
LastAccessedAt time.Time LastAccessedAt time.Time `json:"last_accessed_at"`
} }
type AccessTracker struct { type AccessTracker struct {

View File

@@ -5,6 +5,7 @@
key_id: string; key_id: string;
last_accessed_at: string; last_accessed_at: string;
last_path: string; last_path: string;
user_agent: string;
request_count: number; request_count: number;
}; };
@@ -224,6 +225,7 @@
<th class="px-4 py-3 font-medium">Principal</th> <th class="px-4 py-3 font-medium">Principal</th>
<th class="px-4 py-3 font-medium">Last accessed</th> <th class="px-4 py-3 font-medium">Last accessed</th>
<th class="px-4 py-3 font-medium">Last path</th> <th class="px-4 py-3 font-medium">Last path</th>
<th class="px-4 py-3 font-medium">Agent</th>
<th class="px-4 py-3 font-medium">Requests</th> <th class="px-4 py-3 font-medium">Requests</th>
</tr> </tr>
</thead> </thead>
@@ -242,6 +244,9 @@
<td class="px-4 py-3 align-top" <td class="px-4 py-3 align-top"
><code class="text-slate-100">{entry.last_path}</code></td ><code class="text-slate-100">{entry.last_path}</code></td
> >
<td class="px-4 py-3 align-top text-slate-400 text-xs max-w-[16rem] truncate"
>{entry.user_agent ?? "—"}</td
>
<td class="px-4 py-3 align-top font-semibold text-white" <td class="px-4 py-3 align-top font-semibold text-white"
>{entry.request_count}</td >{entry.request_count}</td
> >