-
Notifications
You must be signed in to change notification settings - Fork 91
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
Add --show-password flag to user reset-password #394
Conversation
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 start!
@dsXLII Still planning to finish this up? |
I'm still here, just distracted by the day job :/ Question about porcelain. For the new app password example, since you can only create one app password at a time the output is unambiguous. But here, since you can reset multiple users' passwords at the same time, it's less clear. (If I do a |
No worries!
Good question! You are correct: we don't yet have prior art within WP-CLI. Let's follow
|
features/user-reset-password.feature
Outdated
Then save STDOUT as {ORIGINAL_PASSWORD} | ||
|
||
When I run `wp user reset-password 1 --skip-email --porcelain` | ||
Then save STDOUT as {NEW_PASSWORD} |
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.
TODO: Learn enough behat to have this check the output (it should be a password, currently "exactly 12 characters, no whitespace, etc")
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.
The check doesn't need to be super accurate. In other cases, we simply confirm that STDOUT
is not empty.
Behat probably doesn't support checking "exactly 12 characters, no whitespace, etc". In order to perform such a check, you'd need to write a standalone PHP file to execute the check, pass the password to the PHP file, and then have the PHP file exit with 0 or 1 depending on whether it passed or failed. But, doing so is probably overkill for this particular test.
Added a --porcelain flag. (If you do something impossible, like The test almost certainly doesn't work - I assume we should check the output to make sure it's a password (exactly 12 characters, all members of the charset used for passwords, etc), but maybe I'm overthinking it and really only need to make sure it doesn't contain "Warning:" ? |
I think this is ready for a more thorough review. (Resolved the phpcs issues, and a merge conflict from the "change passwords to be 24 characters" PR.) |
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.
First go at a PR to address #342 .