You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@openwhisk.apache.org by GitBox <gi...@apache.org> on 2019/02/25 00:46:34 UTC

[GitHub] alexkli commented on issue #490: Document how to fire a trigger with a webhook

alexkli commented on issue #490: Document how to fire a trigger with a webhook
URL: https://github.com/apache/incubator-openwhisk/issues/490#issuecomment-466836453
 
 
   AFAICS, fully handling [github webhooks](https://developer.github.com/enterprise/2.14/webhooks/) means:
   * access to headers required (e.g. `X-GitHub-Event` including the event type, or `X-Hub-Signature` for validating a custom secret)
   * including the ow api key in the webhook url exposes it to everyone who can see the webhook in the github settings, which would give them write access to the namespace, which isn't always applicable
   * other webhooks (not Github) might require synchronous responses for an initial challenge
   
   Because of this, I don't think exposing the trigger url as webhook as employed in the current [/whisk.system/github](
   https://github.com/apache/incubator-openwhisk-catalog/tree/master/packages/github) is a practical approach. Rather one needs a **web action** in front as the actual webhook:
   
   * Authentication for github would verify the `secret` in the `X-Hub-Signature` (configured as default param on the action, for example).
   * It can respond to challenges etc.
   * The web action would then internally fire a trigger.
   * Also, this web action could then dispatch different event types from the webhook to different triggers, e.g. triggers `github_push`, `github_issue`... :
   
         github -> web action (webhook) -> trigger (event type 1) -> rule 1 -> action 1
                                                                  -> rule 2 -> action 2
                                        -> trigger (event type 2) -> rule 3 -> action 3
                                           ...
   
   Thoughts?

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services