Blame doc/using_webhooks.rst

Pierre-Yves Chibon b5fb9a
Using web-hooks
Pierre-Yves Chibon b5fb9a
===============
Pierre-Yves Chibon b5fb9a
Pierre-Yves Chibon b5fb9a
Web-hooks are a notification system that could be compared to a callback.
Pierre-Yves Chibon b5fb9a
Basically, pagure will make a HTTP POST request to one or more third party
Pierre-Yves Chibon b5fb9a
server/application with information about what is or just happened.
Pierre-Yves Chibon f694ba
Pierre-Yves Chibon f694ba
To set-up a web-hook, simply go to the settings page of your project and
Pierre-Yves Chibon f694ba
enter the URL to the server that will receive the notifications.
Pierre-Yves Chibon f694ba
Pierre-Yves Chibon f694ba
In the settings page is also present a web-hook key which is used by the
Pierre-Yves Chibon f694ba
server to sign the message sent and which you can use to ensure the
Pierre-Yves Chibon f694ba
notifications received are coming from the right source.
Pierre-Yves Chibon 414e87
Pierre-Yves Chibon 414e87
Each POST request made contains two specific headers:
Pierre-Yves Chibon 414e87
Pierre-Yves Chibon 414e87
::
Pierre-Yves Chibon 414e87
Pierre-Yves Chibon 414e87
    X-Pagure-Topic
Pierre-Yves Chibon 414e87
    X-Pagure-Signature
Pierre-Yves Chibon 414e87
Pierre-Yves Chibon 414e87
Pierre-Yves Chibon 414e87
``X-Pagure-Topic`` is a global header giving a clue about the type of action
Pierre-Yves Chibon 414e87
that just occured. For example ``issue.edit``.
Pierre-Yves Chibon 414e87
Pierre-Yves Chibon 414e87
Pierre-Yves Chibon 414e87
``X-Pagure-Signature`` contains the signature of the message allowing to
Pierre-Yves Chibon 414e87
check that the message comes from pagure.