Skip to content
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

Closed

Conversation

realbigsean
Copy link
Member

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

@realbigsean realbigsean added the ready-for-review The code is ready for review label Sep 16, 2020
Copy link
Member

@paulhauner paulhauner left a 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};

Copy link
Member

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;

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And this one :)

@@ -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.
Copy link
Member

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.

/// 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 {
Copy link
Member

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).

Copy link
Member Author

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.

@paulhauner paulhauner added waiting-on-author The reviewer has suggested changes and awaits thier implementation. and removed ready-for-review The code is ready for review labels Sep 22, 2020
@realbigsean realbigsean added ready-for-review The code is ready for review and removed waiting-on-author The reviewer has suggested changes and awaits thier implementation. labels Sep 22, 2020
@paulhauner paulhauner added the A0 label Sep 23, 2020
Copy link
Member

@paulhauner paulhauner left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great!

bors r+

@paulhauner paulhauner added ready-for-merge This PR is ready to merge. and removed ready-for-review The code is ready for review labels Sep 23, 2020
bors bot pushed a commit that referenced this pull request Sep 23, 2020
## 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
@bors bors bot changed the title Interactive account passwords [Merged by Bors] - Interactive account passwords Sep 23, 2020
@bors bors bot closed this Sep 23, 2020
@realbigsean realbigsean deleted the interactive-account-passwords branch November 21, 2023 16:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ready-for-merge This PR is ready to merge.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants