Skip to content

Settings: copy a node's public key on plain HTTP; refusals say why - #117

Merged
phornstein merged 3 commits into
mainfrom
fix/sync-key-copy
Nov 2, 2026
Merged

phornstein merged 3 commits into
mainfrom
fix/sync-key-copy

Conversation

@phornstein

Copy link
Copy Markdown
Collaborator

Pinning DUG's key on OTK (8090) was refused with a 422 three times. The pasted text was DUG's fingerprint: Copy public key uses navigator.clipboard, which browsers only offer on HTTPS or localhost. On a node reached by its address (http://192.168.8.223:8090) the button threw and did nothing, and the page showed only the fingerprint, so that was all there was to copy.

  • Settings → Nodes shows the whole public key (the ed25519: line, select-all) above the fingerprint.
  • Copy falls back to copying a selection where the Clipboard API is missing (lib/clipboard.ts, tested). The API token's Copy had the same bug and uses it too.
  • The pin dialog recognises a pasted fingerprint, explains it, and keeps Pin disabled.
  • The audit record: change_refused records now carry the reason the caller was told (up to 300 characters). That's why the 422s didn't explain themselves in the logs; the auth audit test asserts it.

Checked (dev server): tsc -b, oxlint 0 errors, vitest 71/71, vite build; ot-server clippy -D warnings and tests 228/228.

🤖 Generated with Claude Code

Copy public key used the Clipboard API, which exists only on HTTPS or
localhost: on a node reached by its address it threw and did nothing,
and the page showed only the fingerprint, so the fingerprint was pasted
as DUG's key and refused (422) three times. The page now shows the whole
public key to select; copying falls back to a selection where the API is
missing (the API token's Copy too); the pin dialog says so when a
fingerprint is pasted.

change_refused audit records carry the reason the caller was told.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@phornstein
phornstein merged commit a1907ff into main Nov 2, 2026
3 checks passed
@phornstein
phornstein deleted the fix/sync-key-copy branch November 2, 2026 19:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant