Enable auth for relays we're publishing to

This commit is contained in:
Jon Staab
2026-02-18 15:54:14 -08:00
parent 1030edd322
commit 558d59ce88
+2 -1
View File
@@ -15,7 +15,7 @@ import {
isClientNegOpen, isClientNegOpen,
isClientNegClose, isClientNegClose,
} from "@welshman/net" } from "@welshman/net"
import {sign, pubkey, getPubkeyRelays} from "@welshman/app" import {sign, pubkey, thunks, getPubkeyRelays} from "@welshman/app"
import { import {
BLOCKED_RELAYS, BLOCKED_RELAYS,
userSettingsValues, userSettingsValues,
@@ -36,6 +36,7 @@ export const authPolicy = makeSocketPolicyAuth({
if (mode === RelayAuthMode.Aggressive) return true if (mode === RelayAuthMode.Aggressive) return true
if (get(userSpaceUrls).includes(socket.url)) return true if (get(userSpaceUrls).includes(socket.url)) return true
if (getPubkeyRelays($pubkey).includes(socket.url)) return true if (getPubkeyRelays($pubkey).includes(socket.url)) return true
if (get(thunks).some(t => t.options.relays.includes(socket.url))) return true
if (getPubkeyRelays($pubkey, RelayMode.Messaging).includes(socket.url)) return true if (getPubkeyRelays($pubkey, RelayMode.Messaging).includes(socket.url)) return true
return false return false