Add support for included credentials in webhook targets.

Review Request #8916 — Created April 27, 2017 and submitted — Latest diff uploaded

Information

Review Board
release-2.5.x
427b75d...

Reviewers

Sometimes, a user may need to dispatch a webhook to an authenticated endpoint.
Django (somewhat sensibly) does not allow inline credentials in URLFields, both
in forms and models, but in this case we want to allow it.

This change makes use of a new backport of Django 1.8's URLValidator, which
supports credentials. The URL is then split and credentials (if included) are
pulled out and added to a HTTPBasicAuthHandler for the url open.

  • Verified that I was able to save webhook targets that included credentials
    in the URL.
  • Checked that things that definitely weren't URLs were still rejected.
  • Ran unit tests.