fix(cli): accept npub on --pubkey identity flags - #5174
Open
nawazish2 wants to merge 1 commit into
Open
Conversation
Desktop and chat show npubs, but flags like channels add-member only took hex and failed with a vague error. --mention already accepted both. Add normalize_pubkey (hex or npub -> lowercase hex) and use it for user-identity commands: channels, users, dms, moderation, agents. Git-protocol fields stay hex-only. Signed-off-by: Nawazish Khan <175596916+nawazish2@users.noreply.github.com>
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
--mentionalready accepts hex ornpub, but every--pubkeyflag only took 64-char hex viavalidate_hex64. That bites when you copy an npub out of the desktop UI (the usual onboarding path forchannels add-member).Fixes #5167
What changed
normalize_pubkeyinbuzz-cli— parses withnostr::PublicKey::parse, returns lowercase hexchannels add-member/remove-memberusers get/presencedms open/add-membermoderation ban/unban/timeout/untimeoutagents archive/unarchive(and--replaced-by)Test plan
cargo test -p buzz-cli --lib validate::(includes hex, uppercase hex, npub, trim, bad input)cargo clippy -p buzz-cli --all-targets -- -D warningsbuzz channels add-member --channel <uuid> --pubkey npub1... --role membershould no longer reject the npub at validation