Hi,
I'm currently trying to use vt-password as a password quality checker
in a Spring / SpringSecurity based project. Essentially, I'm trying
to configure the password rules using Spring XML bean wiring, and then
use them in a webapp to check new passwords when a user tries to set /
change his or her password. In doing this, I ran into some problems:
* Aspects of the APIs for the password rule classes make it awkward
to instantiate them using Spring wiring. Specifically, some classes
don't have no-args constructors. Some attributes don't have setters
that are compatible with the Java Beans conventions; e.g. we have
"void ignoreCase()" instead of "void setIgnoreCase(boolean)".
* The rule objects (surprisingly!) have attributes that are updated
when you check a password; the "message" attribute for all
PasswordRule classes and the "word" attribute (IIRC) of a
PasswordDictionaryRule. This means that I cannot instantiate one set
of rule objects at servlet startup and then use them in any request
thread each time a controller needs to check a password.
* The Dictionary class is very memory hungry. It loads the entire
dictionary into memory and constructs a heavy-weight tree structure.
I tried loading an "average" sized dictionary (~500,000 words) and ...
OOME. This may be OK if you are going to check 10's of passwords a
second. But in my use-case, I might see 1 password check an hour, so
tying down lots of memory is ... um ... wasteful.
I've uploaded a patch to the Issues Tracker to address the first two
points. It contains backwards compatible API changes to add
constructors, getters and setters, and a backwards compatible API
change to allow a "clean" copy of a rule to be made. It also extends
the DictionaryPasswordRule to check for exact word matches, and fixes
a bug (IMO) in the way the validate methods handled null Password
arguments.
I've also created an issue for the Dictionary problem, but the (IMO)
best solution ... to support multiple dictionary implementations ...
entails an API breaking change.
-- Steve
P.S. I'm using the code in the Emmet component we are writing for the
Atlas of Living Australia. The component's Maven site is at
http://metadata.net/sites/emmet-0.4-SNAPSHOT/