Bug 2180760
Summary: | no way to test-fire a webhook when configuring it | ||
---|---|---|---|
Product: | Red Hat Satellite | Reporter: | Evgeni Golov <egolov> |
Component: | Hooks and Webhooks | Assignee: | Oleh Fedorenko <ofedoren> |
Status: | CLOSED ERRATA | QA Contact: | Lukáš Hellebrandt <lhellebr> |
Severity: | medium | Docs Contact: | Adam Lazik <alazik> |
Priority: | unspecified | ||
Version: | 6.13.0 | CC: | ahumbe, aruzicka, lhellebr, ofedoren, pcreech |
Target Milestone: | 6.14.0 | Keywords: | Triaged |
Target Release: | Unused | ||
Hardware: | Unspecified | ||
OS: | Unspecified | ||
Whiteboard: | |||
Fixed In Version: | rubygem-foreman_webhooks-3.2.0 | Doc Type: | Enhancement |
Doc Text: |
.You can now test-fire a webhook
You can now test if a webhook functions correctly by clicking *Test webhook* from the list in the *Actions* column.
After you enter a payload and click *Submit*, the webhook triggers.
|
Story Points: | --- |
Clone Of: | Environment: | ||
Last Closed: | 2023-11-08 14:19:02 UTC | Type: | Bug |
Regression: | --- | Mount Type: | --- |
Documentation: | --- | CRM: | |
Verified Versions: | Category: | --- | |
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
Cloudforms Team: | --- | Target Upstream Version: | |
Embargoed: |
Description
Evgeni Golov
2023-03-22 08:22:45 UTC
Would you consider this an RFE or defect? I would consider a "test this thing" core functionality that is missing. So a defect I guess Moving this bug to POST for triage into Satellite since the upstream issue https://projects.theforeman.org/issues/32363 has been resolved. Verified with Sat 6.14.0 snap 6.0. 1) Create a webhook teplate with some data in Administer -> Webhook Teplates 2) Create a webhook using this template, assigned to some action (I used Content View Created) in Administer -> Webhooks. As a target, use some reachable machine and some usable port. 3) On the reachable machine, listen on the specified port: # echo -e "HTTP/1.1 200 OK\n\n $(date)" | nc -v -l 8042 4) In Administer -> Webhooks, in the webhook's row, in the Actions column, open the dropdown menu and click "Test webhook". 5) A popup will open, warning you that no actual data will be rendered from the template and this just tests communication layer. It allows you to enter data manually. I entered "data=testdata". 6) For test purposes, you need to disable Selinux on the Satellite: # setenforce 0 7) Click Submit RESULT ON THE LISTENING SERVER: $ echo -e "HTTP/1.1 200 OK\n\n $(date)" | nc -v -l 8042 Ncat: Version 7.93 ( https://nmap.org/ncat ) Ncat: Listening on :::8042 Ncat: Listening on 0.0.0.0:8042 Ncat: Connection from <IP>. Ncat: Connection from <IP>:58664. GET /?data=testdate HTTP/1.1 Accept-Encoding: gzip;q=1.0,deflate;q=0.6,identity;q=0.3 Accept: */* User-Agent: Ruby Content-Type: application/json X-Request-Id: 6415e714-600d-499e-a667-994ab48433af X-Session-Id: 4b7da39c-5b85-4f8f-a2d3-6aa4a77968e8 Connection: close Host: <IP2>:8042 Content-Length: 14 data=testdata RESULT ON THE SATELLITE: A green pop-up notification stating: "Webhook Testhook test was successful" WHEN THE LISTENING SERVER IS NOT RUNNING, THEN ON SATELLITE: A red pop-up notification stating: "Error: Webhook test failed: Failed to open TCP connection to <IP>:8042 (Connection refused - connect(2) for "<IP>" port 8042)". Also, a traceback in production.log. Also, I verified that the webhook indeed gets executed on the specified action. Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory (Important: Satellite 6.14 security and bug fix update), and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. https://access.redhat.com/errata/RHSA-2023:6818 The needinfo request[s] on this closed bug have been removed as they have been unresolved for 120 days |