JorgeFerrer/liferay-portal — pull request #118 by epgarcia (2012-12-31 15:27:27+00:00)
Title: LPS-32032 Extend Password Syntax Checking to include Regex validation

Hi Jorge,

I've extended PasswordPolicy to include a Regular Expression in the password syntax checking. Nevertheless, I found a problem with the generation of automatic passwords. I don't think there is a way to automatically generate a password that matches any given Regex. Even the RegExpToolkit might generate an automatic password which is not valid for the given pattern.

As far as I've seen, we're only validating autogenerated passwords in the PasswordPolicyToolkitTest. (where I just added a testcase for Regex which will not break other tests). As I said above, if we did and we changed the Password Toolkit to RegExpToolkit, that validation would fail.

Can we assume that with the new regex option, a password generated automatically with a PasswordPolicy might not validate that Policy?

Please confirm so we can send the pull-request forward to Brian, or suggest any better approach.

Thanks!