Add support for included credentials in webhook targets.
Review Request #8916 — Created April 27, 2017 and submitted — Latest diff uploaded
Sometimes, a user may need to dispatch a webhook to an authenticated endpoint.
Django (somewhat sensibly) does not allow inline credentials inURLFields
, 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 aHTTPBasicAuthHandler
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.
Diff Revision 3
This is not the most recent revision of the diff. The latest diff is revision 4. See what's changed.
orig
1
2
3
4
reviewboard/notifications/forms.py |
---|
reviewboard/notifications/models.py |
---|
reviewboard/notifications/tests.py |
---|
reviewboard/notifications/webhooks.py |
---|