feat(peers): settings dialog + hide for revoked peers, pending badge in header

This commit is contained in:
2026-08-21 20:59:42 +01:00
parent 3217dca39f
commit 545338016e
10 changed files with 357 additions and 81 deletions
+9
View File
@@ -66,6 +66,7 @@ type AuthorizedKey struct {
ApprovedBy string `json:"approved_by"`
ApprovedAt string `json:"approved_at"`
RevokedAt *string `json:"revoked_at"`
HiddenAt *string `json:"hidden_at"`
}
// PendingAuthorization is a first-contact request awaiting the owner's
@@ -211,6 +212,14 @@ func (c *Client) Reject(ctx context.Context, service, fingerprint string) error
authzRequest{Service: service, Fingerprint: fingerprint}, nil)
}
// Hide permanently hides a revoked peer from the dashboard: the auth service
// keeps the row (audit trail survives) but marks it hidden_at; a re-approval
// clears the flag and makes the key visible again.
func (c *Client) Hide(ctx context.Context, service, fingerprint string) error {
return c.do(ctx, http.MethodPost, "/internal/hide",
authzRequest{Service: service, Fingerprint: fingerprint}, nil)
}
func (c *Client) do(ctx context.Context, method, path string, body, out any) error {
var payload []byte
if body != nil {