Ignore aborted signatures when checking auth

This commit is contained in:
Jon Staab
2025-11-04 09:34:07 -08:00
parent b62b1bc063
commit fe626218ea
3 changed files with 17 additions and 16 deletions
+3 -7
View File
@@ -1,5 +1,4 @@
import {on, call, dissoc, assoc, uniq} from "@welshman/lib"
import type {StampedEvent} from "@welshman/util"
import {on, always, call, dissoc, assoc, uniq} from "@welshman/lib"
import type {Socket, RelayMessage, ClientMessage} from "@welshman/net"
import {
makeSocketPolicyAuth,
@@ -11,7 +10,7 @@ import {
isClientEvent,
isClientClose,
} from "@welshman/net"
import {signer} from "@welshman/app"
import {sign} from "@welshman/app"
import {
userSettingsValues,
getSetting,
@@ -19,10 +18,7 @@ import {
relaysMostlyRestricted,
} from "@app/core/state"
export const authPolicy = makeSocketPolicyAuth({
sign: (event: StampedEvent) => signer.get()?.sign(event),
shouldAuth: (socket: Socket) => true,
})
export const authPolicy = makeSocketPolicyAuth({sign, shouldAuth: always(true)})
export const trustPolicy = (socket: Socket) => {
const buffer: RelayMessage[] = []