mirror of
https://github.com/ansible/awx.git
synced 2026-03-14 23:47:28 -02:30
Update logic in send method to recognize password field in upgraded webhook notifications
This commit is contained in:
@@ -118,9 +118,10 @@ class NotificationTemplate(CommonModelNameNotUnique):
|
|||||||
def send(self, subject, body):
|
def send(self, subject, body):
|
||||||
for field in filter(lambda x: self.notification_class.init_parameters[x]['type'] == "password",
|
for field in filter(lambda x: self.notification_class.init_parameters[x]['type'] == "password",
|
||||||
self.notification_class.init_parameters):
|
self.notification_class.init_parameters):
|
||||||
self.notification_configuration[field] = decrypt_field(self,
|
if field in self.notification_configuration:
|
||||||
'notification_configuration',
|
self.notification_configuration[field] = decrypt_field(self,
|
||||||
subfield=field)
|
'notification_configuration',
|
||||||
|
subfield=field)
|
||||||
recipients = self.notification_configuration.pop(self.notification_class.recipient_parameter)
|
recipients = self.notification_configuration.pop(self.notification_class.recipient_parameter)
|
||||||
if not isinstance(recipients, list):
|
if not isinstance(recipients, list):
|
||||||
recipients = [recipients]
|
recipients = [recipients]
|
||||||
|
|||||||
@@ -218,13 +218,13 @@ https://gist.github.com/matburt/73bfbf85c2443f39d272
|
|||||||
The link below shows how to define an endpoint and parse headers and json content. It doesn't show how to configure Flask for HTTPS, but is fairly straightforward:
|
The link below shows how to define an endpoint and parse headers and json content. It doesn't show how to configure Flask for HTTPS, but is fairly straightforward:
|
||||||
http://flask.pocoo.org/snippets/111/
|
http://flask.pocoo.org/snippets/111/
|
||||||
|
|
||||||
You can also link an httpbin service to the development environment for testing webhooks using:
|
You can also link an `httpbin` service to the development environment for testing webhooks using:
|
||||||
|
|
||||||
```
|
```
|
||||||
make docker-compose-notifications
|
make docker-compose-notifications
|
||||||
```
|
```
|
||||||
|
|
||||||
This will create an `httpbin` service reachable from the awx container at `http://httpbin/post`, `http://httpbin/put`, etc. Outside of the container, you can reach the service at `http://localhost:8204`.
|
This will create an `httpbin` service reachable from the AWX container at `http://httpbin/post`, `http://httpbin/put`, etc. Outside of the container, you can reach the service at `http://localhost:8204`.
|
||||||
|
|
||||||
|
|
||||||
## Grafana
|
## Grafana
|
||||||
|
|||||||
Reference in New Issue
Block a user