From 8c249cff837f22eb5c04a175945ab50dd38f4a31 Mon Sep 17 00:00:00 2001 From: highperfocused Date: Mon, 7 Sep 2026 22:05:06 +0200 Subject: [PATCH] Address review feedback on Relay Admin app - sanitizeIconUrl() now only allows http:// for local relay hostnames (localhost/127.0.0.1/::1/*.local), matching its docstring and error message instead of accepting arbitrary http:// URLs. - Scope the discovery-time cache clear to the previous session's own relay URL instead of removing every ['nip86'] query, so connecting in one Relay Admin window no longer disrupts other open windows. - Use the AllowedPubkey type (not BannedPubkey) when mapping allowed- pubkey entries, since the structural overlap today made a real type mismatch invisible. Co-Authored-By: Claude Sonnet 5 Claude-Session: https://claude.ai/code/session_01BYiUtZMQeA5RHggQw73wto --- src/apps/relay-admin/PolicySections.tsx | 3 ++- src/hooks/useNip86.ts | 10 +++++++--- src/lib/nip86.test.ts | 6 ++++++ src/lib/nip86.ts | 10 ++++++++-- 4 files changed, 23 insertions(+), 6 deletions(-) diff --git a/src/apps/relay-admin/PolicySections.tsx b/src/apps/relay-admin/PolicySections.tsx index d79fff5..1f71367 100644 --- a/src/apps/relay-admin/PolicySections.tsx +++ b/src/apps/relay-admin/PolicySections.tsx @@ -18,6 +18,7 @@ import { parsePubkeyInput, validateIpInput, validateReason, + type AllowedPubkey, type BannedPubkey, type BlockedIp, type Nip86CoreMethod, @@ -400,7 +401,7 @@ export function AllowedPubkeysSection({ /> ) : (