mirror of
https://github.com/PR0M3TH3AN/bitvid.git
synced 2026-11-01 02:12:26 +00:00
connectRemoteSigner and useStoredRemoteSigner accepted but never used the `validator` the auth provider passes (accessControl.canAccess) -- so NIP-46 logins bypassed the block/allow gate that nsec/NIP-07 logins enforce. (The validation lived only on the unused Nip46Connector.) Both paths now run the validator against the remote signer's resolved user pubkey BEFORE activating the signer (via _enforceRemoteSignerValidator): the validator throws on a blocked/non-permitted pubkey, or returning false rejects with code remote-signer-access-denied. A stored session rejected by the validator is forgotten so a blocked pubkey can't keep retrying. Residual (noted in TODO): the silent startup auto-restore (scheduleStoredRemoteSignerRestore) still reconnects without a validator. Test: tests/nostr/nip46-prepare-handshake.test.mjs (validator throws / false / true / absent). Full suite green. Co-Authored-By: Claude Opus 4.8 <[email protected]>