RFR: 7820: Add validations for master password [v2]
Christoph Langer
clanger at openjdk.org
Wed Jul 20 21:29:11 UTC 2022
On Wed, 13 Jul 2022 11:49:20 GMT, Suchita Chaturvedi <schaturvedi at openjdk.org> wrote:
>> This PR adds password validations for master password field.
>
> Suchita Chaturvedi has updated the pull request incrementally with one additional commit since the last revision:
>
> Added Junit test cases and moved the logic to common util file
Overall looks good. Thanks for adding a unit test. I've added some minor review points.
application/org.openjdk.jmc.ui.common/src/main/java/org/openjdk/jmc/ui/common/security/PersistentCredentials.java line 86:
> 84:
> 85: public static boolean isPasswordValid(final String password) {
> 86: Pattern PASSWORD_PATTERN = Pattern
Maybe you want to have PASSWORD_PATTERN as a static field with lazy initialization?
application/org.openjdk.jmc.ui/src/main/java/org/openjdk/jmc/ui/security/MasterPasswordWizardPage.java line 37:
> 35: import java.util.regex.Matcher;
> 36: import java.util.regex.Pattern;
> 37:
Not needed any more
application/org.openjdk.jmc.ui/src/main/java/org/openjdk/jmc/ui/security/MasterPasswordWizardPage.java line 40:
> 38: import org.eclipse.jface.resource.JFaceResources;
> 39: import org.eclipse.jface.wizard.WizardPage;
> 40: import org.eclipse.osgi.util.NLS;
the import org.eclipse.osgi.util.NLS is unnecessary now
application/org.openjdk.jmc.ui/src/main/resources/org/openjdk/jmc/ui/security/messages.properties line 43:
> 41: MasterPasswordWizardPage_ERROR_PASSWORD_EMPTY_TEXT=Password can not be empty!
> 42: # {0} is a number
> 43: MasterPasswordWizardPage_ERROR_MESSAGE_PASSWORD_VALIDATION_FAILED=Password must contain at least one lowercase character, one uppercase character, one digit, one special character, and a length between 8 to 20.
Wording: ... and have a length ...
-------------
Changes requested by clanger (Committer).
PR: https://git.openjdk.org/jmc/pull/406
More information about the jmc-dev
mailing list