[PATCH 0/6] input validation for dialogs

Brian C. Lane bcl at redhat.com
Tue Apr 1 00:16:43 UTC 2014


On Mon, Mar 31, 2014 at 04:05:29PM -0400, David Shea wrote:
> These patches add a new InputCheckHandler subclass to set error tooltips on
> dialog entries in the same way that we currently display the error messages for
> LUKS passphrase input. The dialogs for NTP configuration, HTTP proxy and
> advanced user settings have been modified to use this subclass.
> 
> Aaaaaaand then there's that first patch that combines the nastiness of URL
> validation with the Python's unfortunate re syntax. PROXY_URL_PARSE rejected a
> lot of actually-valid URLs and lacked IPv6 support, so this change corrects
> those deficiencies and expands the parsing to the query and fragment portions
> of URLs, which may be useful in the future for handling the URLs elsewhere in
> the source spoke.
> 
> David Shea (6):
>   Generalized and improved the proxy URL parsing regex
>   Add an InputCheckHandler subclass for dialogs.
>   Add a new InputCheck status for silent failures.
>   Use GUIDialogInputCheckHandler in the advanced user dialog
>   Provide feedback for invalid NTP hostnames.
>   Validate proxy URLs
> 
>  pyanaconda/iutil.py                          |  48 +++----
>  pyanaconda/network.py                        |  18 +--
>  pyanaconda/regexes.py                        |  59 ++++++++-
>  pyanaconda/ui/gui/spokes/advanced_user.glade |  12 --
>  pyanaconda/ui/gui/spokes/datetime_spoke.py   |  45 +++++--
>  pyanaconda/ui/gui/spokes/source.py           |  55 +++++---
>  pyanaconda/ui/gui/spokes/user.py             |  21 +--
>  pyanaconda/ui/helpers.py                     |  39 +++++-
>  tests/regex_tests/hostname_test.py           | 190 +++++++++++++++++++++++++++
>  tests/regex_tests/proxy_test.py              | 119 -----------------
>  tests/regex_tests/url_test.py                | 183 ++++++++++++++++++++++++++
>  11 files changed, 580 insertions(+), 209 deletions(-)
>  create mode 100644 tests/regex_tests/hostname_test.py
>  delete mode 100644 tests/regex_tests/proxy_test.py
>  create mode 100644 tests/regex_tests/url_test.py
> 
> -- 
> 1.9.0

These, as far as I can read that gigantic regex, look ok to me. Looks
like it will also fix the bug about including slashes in the username
that has been around for a while.

-- 
Brian C. Lane | Anaconda Team | IRC: bcl #anaconda | Port Orchard, WA (PST8PDT)


More information about the anaconda-patches mailing list