Input validation checks, but only for usernames so far

David Shea dshea at redhat.com
Tue Aug 20 19:38:33 UTC 2013


This is a more general version of what I was trying to do with that fix to the
group list in the advanced user dialog. Patches 1-3 are just some housekeeping
to set things up: move regular expressions we already had into constants.py,
allow validatePassword to be used the way that the user spoke thinks it's using
it, move the get_object() calls in the advanced user dialog into a _grabObjects
function.

The meat is in patch #4: this adds a framework for attaching validation checks
to Editables, and an implementation in NormalSpoke that calls set_warning()
with the message from the first failed check.  Patch #5 adds validation checks
to the user spoke and redoes the password strength and validity checks in terms
of add_check(). Patch #6 adds a check for the group list in the advanced user
dialog.

These patches do not fix the problem with creating groups with a specific GID.
I thought I'd get these changes out there first and then try to unravel what I
did in that previous patch set.

Changing validatePassword makes me want to change it further so that the
user spoke (and root password spoke) isn't duplicating the pwquality work, but
that seemed like something for another time.

Changing the function signature of on_back_clicked makes pylint unhappy, but I
wanted some feedback on that before trying to change it everywhere. I changed
it to handle the case in the user spoke where clicking Done will exit the spoke
regardless of whatever garbage might be in the password field or elsewhere, but
I'm not sure that changing the behavior in NormalSpoke is the best way to
handle that.


More information about the anaconda-patches mailing list