Peering: generated key never displayed (empty bar), copy copies nothing, no key hint in issued list #136
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Dogfood report (v0.4.6, #131 followup). Generating a key for a peer shows an empty dark bar, clicking it flashes "Copied" near the file list (bottom-left), and the clipboard stays empty. Issued keys also show only the peer name, so an operator cannot tell which credential a row corresponds to.
Root cause (confirmed by code read): the issue handler does
but
api()returns the rawResponseobject — the handler never calls.json().r.keyisundefined: the bar gets no text, and the click copiesundefined. The stray "Copied" bubble appears at the viewport origin becausecopyText(r.key)is called without thebtnargument thatshowBubblepositions against. Being on plain HTTP additionally rules outnavigator.clipboard(insecure context), so only the legacy path could ever work.Fix:
await res.json()) — the one-line root cause.<p>with a labelled one-time-key block: "One-time key for {peer}" + readonly mono input + explicit Copy button. Copy selects the visible input and usesdocument.execCommand("copy")(works in a modal dialog on insecure origins), with async clipboard as the secure-context path; feedback goes to the dialog's own message line, not a global bubble.listKeysreturns the stored non-secretid(derived from the public key); the issued-keys list renders a Paddle-style mono hint next to each peer name so a row is identifiable against the credential the other admin holds.Shipped in v0.4.7 (PR #137), live on the dogfood.
Root cause was one missing
.json(): the issue handler readr.keyoff the rawResponseobjectapi()returns, so the one-time key wasundefined— empty bar, and click-to-copy copied nothing. The mispositioned "Copied" bubble wascopyText(r.key)called without thebtnargumentshowBubblepositions against.What changed:
document.execCommand("copy")first — that path works on insecure origins and inside modal dialogs, wherenavigator.clipboardis undefined. Async clipboard is the HTTPS path. Success/failure feedback goes to the dialog's own message line, not a global bubble.listKeysnow returns the stored non-secretid(derived from the public key — the secret itself isKeyPrefix + b64(priv)and is never stored, so a true prefix-mask of the credential is impossible by design). The list rendersHyrsh 3f2a91c8d1…in faded mono, Paddle-style.Verified green on the branch before merge: gofmt/vet, full
go test ./...,node --checkon both script blocks. Imagecordy/cairn:v0.4.7(sha256:e213440b…) confirmed Running 1/1 on the dogfood.Dogfood caveat noticed while deploying:
/dataincairn-encis anemptyDir, so the peering registry (/data/.cairn/peering.json) — including the key issued for Hyrsh — and the runtime settings file are wiped on every redeploy. That is a deployment-manifest matter, not a code bug; flagged separately.