-
Notifications
You must be signed in to change notification settings - Fork 3.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
refactor(client): check name validation for keys add|import|rename
#18950
Conversation
WalkthroughThe recent changes involve enhancing the validation of user input for key management operations within a CLI application. Specifically, the updates ensure that the "name" variable for keys is not empty after any leading or trailing whitespace is removed. This validation has been added to the addition and import commands, and error handling has been implemented for renaming keys, particularly for private keys stored on a ledger device. The associated tests have been updated to cover these new validation scenarios. Changes
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (invoked as PR comments)
Additionally, you can add CodeRabbit Configration File (
|
keys add|import|rename
keys add|import|rename
keys add|import|rename
keys add|import|rename
keys add|import|rename
keys add|import|rename
@julienrbrt Hi sir, suggestion changes addressed |
Awesome, can we get a changelog? |
Done 😀 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm, ty!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
utACK
Motivation
When I set the $name variable by mistake, and after running
keys add $name
command, it created a key with the empty name.This looks odd when I ran
keys list
to check the created key, see the screenshot below. I'm confused about the name, is it empty or just the""
itself.Also, an unnormal name isn't friendly to
keys delete
,keys show
, andkeys export
subcommand.So I think we should prevent from creating a key with an unnormal name