-
Notifications
You must be signed in to change notification settings - Fork 809
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
[Merged by Bors] - Interactive account passwords #1623
[Merged by Bors] - Interactive account passwords #1623
Conversation
…ractive-account-passwords
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.
Looks great! I ran it with and without the interactive prompts without issue. I think it's going to be easier for beginners.
I've just left a few nits, happy to merge after that!
It would be cool to update the docs, since I think this interactive password flow is easier. Perhaps we could just do 4.1 and 4.2 in the validator guide here now and do the rest later?
use crate::{common::ensure_dir_exists, SECRETS_DIR_FLAG, VALIDATOR_DIR_FLAG}; | ||
use account_utils::{random_password, strip_off_newlines, validator_definitions}; | ||
|
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.
I think it would be nice to delete this line.
use clap::{App, Arg, ArgMatches}; | ||
use environment::Environment; | ||
use eth2_wallet::PlainText; | ||
|
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.
And this one :)
account_manager/src/wallet/create.rs
Outdated
@@ -126,30 +139,84 @@ pub fn create_wallet_from_mnemonic( | |||
.map_err(|e| format!("Unable to open --{}: {:?}", BASE_DIR_FLAG, e))?; | |||
|
|||
// Create a random password if the file does not exist. |
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.
We might want to move the comment down a few lines, it's not completely accurate here.
common/account_utils/src/lib.rs
Outdated
/// Takes a string password and checks that it meets minimum requirements. | ||
/// | ||
/// The current minimum password requirement is a 12 character length character length. | ||
pub fn is_password_sufficiently_complex(password: &[u8]) -> bool { |
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.
It's not very important, but if this returned Result<(), String>
you could avoid repeating "Please use at least {} characters for your password."
in downstream functions by passing that message via the Result::Err(String)
.
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.
That's smart, easier to update error messages if the password requirements change too.
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.
Great!
bors r+
## Issue Addressed #1437 ## Proposed Changes - Make the `--wallet-password` flag optional and creates an interactive prompt if not provided. - Make the `--wallet-name` flag optional and creates an interactive prompt if not provided. - Add a minimum password requirement of a 12 character length. - Update the `--stdin-passwords` flag to `--stdin-inputs` because we have non-password user inputs ## Additional Info
Pull request successfully merged into master. Build succeeded: |
Issue Addressed
#1437
Proposed Changes
--wallet-password
flag optional and creates an interactive prompt if not provided.--wallet-name
flag optional and creates an interactive prompt if not provided.--stdin-passwords
flag to--stdin-inputs
because we have non-password user inputsAdditional Info