Repository navigation
fix: accept buzz-admin hex secrets in desktop key import (#2815) - #4504
Chessing234 wants to merge 6 commits into
Conversation
buzz-admin was only emitting a hex secret, so operators following the bootstrap hint could not paste into desktop onboarding (block#2815). Signed-off-by: Taksh <takshkothari09@gmail.com>
Match Keys::parse / BUZZ_PRIVATE_KEY so buzz-admin generate-key output enables Next instead of sitting on 'waiting for nsec1' (block#2815, block#3880). Signed-off-by: Taksh <takshkothari09@gmail.com>
Lock buzz-admin hex secrets through classify/submit and npub preview. Signed-off-by: Taksh <takshkothari09@gmail.com>
|
hex import for buzz-admin secrets — pairs with the #3880/#2815 confusion. @wesbillman if hosted/onboarding is on your plate. |
|
@jurgenhaas @ashbrener small desktop fix for buzz-admin hex secrets on key import (#2815). easy review if you're in that area. |
ashbrener
left a comment
There was a problem hiding this comment.
Read this closely because it fixes a papercut I hit yesterday: buzz-admin generate-key prints hex, the import form gated on startsWith("nsec1"), so the key it just gave me was rejected by the app. Frontend stricter than the backend for no reason. Adding npub to the generate-key output is a nice extra — I spent real time yesterday converting a hex pubkey by hand to find which identity a relay was configured with.
Two things I checked specifically, since they are where this kind of change tends to break, and both are fine:
The new "hex" kind cannot fall into a wrong branch. KeyImportKind is only ever branched on at keyImportInput.ts:123 (kind === "ncryptsec") and NostrKeyImportForm.tsx:66. Everything else routes through nsecToNpub, which now normalizes hex. No exhaustive switch to update.
Hex cannot leak into the keyring. The form submits the raw input, so I expected to find hex being persisted where the rest of the system assumes bech32 — but import_identity (commands/identity.rs:336) passes the parsed Keys object to persist_imported_identity, not the string. Storage stays normalized.
One inconsistency worth a look, inline below.
Align pubkey/secret hex tolerance and stop duplicating the pattern in keyImportInput. Signed-off-by: Taksh <takshkothari09@gmail.com>
|
good catch — tip now exports a shared case-insensitive |
|
@ashbrener tip exports the shared case-insensitive HEX_64_REGEX now. still good to merge from your side? |
Signed-off-by: Taksh <takshkothari09@gmail.com>
🔐 Codex Security Review
|
keep hex nsec import and main's event-id parser. Signed-off-by: Taksh <takshkothari09@gmail.com>
Summary
buzz-admin generate-keynow prints both hex andnsec1forms (plus npub)Keys::parse/BUZZ_PRIVATE_KEYalready dobuzz-admin generate-keyemits a hex secret that desktop onboarding rejects (expectsnsec1) #2815 and the hex-paste ask on Unable to make different identity key on Windows desktop #3880Test plan
buzz-admin generate-keyshows hex + nseccd desktop && npm test -- src/shared/lib/nostrUtils.test.mjs src/features/onboarding/lib/keyImportInput.test.mjs