mirror of
https://github.com/ansible/awx.git
synced 2026-01-11 01:57:35 -03:30
Update logic in send method to recognize password field in upgraded webhook notifications
This commit is contained in:
parent
2b74b6f9b6
commit
0a0b09b394
@ -118,9 +118,10 @@ class NotificationTemplate(CommonModelNameNotUnique):
|
||||
def send(self, subject, body):
|
||||
for field in filter(lambda x: self.notification_class.init_parameters[x]['type'] == "password",
|
||||
self.notification_class.init_parameters):
|
||||
self.notification_configuration[field] = decrypt_field(self,
|
||||
'notification_configuration',
|
||||
subfield=field)
|
||||
if field in self.notification_configuration:
|
||||
self.notification_configuration[field] = decrypt_field(self,
|
||||
'notification_configuration',
|
||||
subfield=field)
|
||||
recipients = self.notification_configuration.pop(self.notification_class.recipient_parameter)
|
||||
if not isinstance(recipients, list):
|
||||
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:
|
||||
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
|
||||
```
|
||||
|
||||
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
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user