webhook trigger works even if V query parameter is not specified

Bug #1759663 reported by Duc Truong on 2018-03-28
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
senlin
High
Duc Truong

Bug Description

According to API documentation, V query parameter for webhook trigger is optional (https://developer.openstack.org/api-ref/clustering/#id250):

V (Optional) query string The webhook implementation version requested.

However, as per discussion with Qiming, the V query parameter should be required:
http://eavesdrop.openstack.org/irclogs/%23senlin/%23senlin.2018-03-29.log.html

When sending a webhook trigger request with a X-Auth-Token header and without the V query parameter, the webhook trigger still succeeds:

(openstack) cluster receiver create --cluster mycluster --action CLUSTER_SCALE_OUT --type webhook test-receiver
+------------+------------------------------------------------------------------------------------------------------+
| Field | Value |
+------------+------------------------------------------------------------------------------------------------------+
| action | CLUSTER_SCALE_OUT |
| actor | { |
| | "trust_id": "d27dfaa97525490b8407822820bbf4e0" |
| | } |
| channel | { |
| | "alarm_url": "http://10.0.20.10:8778/v1/webhooks/30ef5c97-abab-4bfe-b73d-ca226ebf5f7d/trigger?V=1" |
| | } |
| cluster_id | 447efe11-7505-49bb-b264-534523464cdd |
| created_at | 2018-03-28T16:15:20Z |
| domain_id | None |
| id | 30ef5c97-abab-4bfe-b73d-ca226ebf5f7d |
| location | None |
| name | test-receiver |
| params | {} |
| project_id | ce556a7d93c84471a0fc2154d3cbb592 |
| type | webhook |
| updated_at | None |
| user_id | 1d7de07588dc4b08b478fd71e80ec8f2 |
+------------+------------------------------------------------------------------------------------------------------+

stack@sandboxController:~> curl -X POST -H "X-Auth-Token: gAAAAABau9wcXjvwrJ1W-uFSK2T-wrbJSvmT--_6tGW_Dldv0W6-orLwZ5f-JWftvUjjxos2JCbwkxhXHv-2eSeuCAkKL9ps-sPZAaCEUX6gcO6sNH_c7-UAh5D1hgrrC2OkMYQiq9um1cb6wmW-ec-NE7XAXMy8e51lgXwPUVCqWo3pDXGjMbk" http://10.0.20.10:8778/v1/webhooks/30ef5c97-abab-4bfe-b73d-ca226ebf5f7d/trigger
{"action": "fce862ed-aafc-4f3e-9bf5-30a2b14ede18"}

The expected behavior is for the webhook trigger request to return an error when the V query parameter is not specified.

Duc Truong (dtruong) on 2018-03-28
Changed in senlin:
assignee: nobody → Duc Truong (dtruong)
Qiming Teng (tengqim) on 2018-03-29
Changed in senlin:
status: New → Triaged
importance: Undecided → High
Duc Truong (dtruong) on 2018-03-29
summary: - webhook trigger does work if V query parameter is not specified
+ webhook trigger works even if V query parameter is not specified
description: updated

Fix proposed to branch: master
Review: https://review.openstack.org/557798

Changed in senlin:
status: Triaged → In Progress

Reviewed: https://review.openstack.org/557798
Committed: https://git.openstack.org/cgit/openstack/senlin/commit/?id=fbc788c0fc3c34442e26c9c26640fc362236f1d7
Submitter: Zuul
Branch: master

commit fbc788c0fc3c34442e26c9c26640fc362236f1d7
Author: Duc Truong <email address hidden>
Date: Wed Mar 28 21:26:18 2018 +0000

    Fix webhook trigger V query param to be required

    * Raise webob.exc.HTTPBadRequest if webhook trigger URL is missing V
    query param
    * Update API docs to show V query parameter as required

    Closes-Bug: 1759663

    Change-Id: I586df9689585dad8fe461b256ae6a1de084f67f6
    Signed-off-by: Duc Truong <email address hidden>

Changed in senlin:
status: In Progress → Fix Released

This issue was fixed in the openstack/senlin 6.0.0.0b1 development milestone.

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers