From 6f030256f5c246651a59a72a4280ff0df863c3e4 Mon Sep 17 00:00:00 2001 From: beeankha Date: Mon, 17 Jun 2019 11:20:49 -0400 Subject: [PATCH] Add username and password fields to webhook backend --- awx/main/notifications/webhook_backend.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/awx/main/notifications/webhook_backend.py b/awx/main/notifications/webhook_backend.py index 7a68587621..277d82c4b8 100644 --- a/awx/main/notifications/webhook_backend.py +++ b/awx/main/notifications/webhook_backend.py @@ -16,13 +16,17 @@ class WebhookBackend(AWXBaseEmailBackend): init_parameters = {"url": {"label": "Target URL", "type": "string"}, "disable_ssl_verification": {"label": "Verify SSL", "type": "bool", "default": False}, + "username": {"label": "Username", "type": "string"}, + "password": {"label": "Password", "type": "password"}, "headers": {"label": "HTTP Headers", "type": "object"}} recipient_parameter = "url" sender_parameter = None - def __init__(self, headers, disable_ssl_verification=False, fail_silently=False, **kwargs): + def __init__(self, headers, username, password, disable_ssl_verification=False, fail_silently=False, **kwargs): self.disable_ssl_verification = disable_ssl_verification self.headers = headers + self.username = username + self.password = password if password != "" else None super(WebhookBackend, self).__init__(fail_silently=fail_silently) def format_body(self, body):