<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Recent changes to Webhooks</title><link>https://forge-allura.apache.org/p/allura/wiki/Webhooks/</link><description>Recent changes to Webhooks</description><atom:link href="http://forge-allura.apache.org/p/allura/wiki/Webhooks/feed" rel="self"/><language>en</language><lastBuildDate>Tue, 21 Jul 2015 17:08:08 -0000</lastBuildDate><atom:link href="http://forge-allura.apache.org/p/allura/wiki/Webhooks/feed" rel="self" type="application/rss+xml"/><item><title>Webhooks modified by Heith Seewald</title><link>https://forge-allura.apache.org/p/allura/wiki/Webhooks/</link><description>&lt;div class="markdown_content"&gt;&lt;pre&gt;--- v8
+++ v9
@@ -150,7 +150,7 @@
 The signature is obtained by hashing the webhook payload with `secret` using HMAC algorithm. You can do something like this to verify it:

     :::python
-    def verify(payload, signature, secret)
+    def verify(payload, signature, secret):
         actual_signature = hmac.new(secret.encode('utf-8'), payload.encode('utf-8'), hashlib.sha1)
         actual_signature = 'sha1=' + actual_signature.hexdigest()
         return hmac.compare_digest(actual_signature, signature)
&lt;/pre&gt;
&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Heith Seewald</dc:creator><pubDate>Tue, 21 Jul 2015 17:08:08 -0000</pubDate><guid>https://forge-allura.apache.orgc849446eeaa9a5692250a25c5b4a5e9dd14a418b</guid></item><item><title>Webhooks modified by Dave Brondsema</title><link>https://forge-allura.apache.org/p/allura/wiki/Webhooks/</link><description>&lt;div class="markdown_content"&gt;&lt;pre&gt;--- v7
+++ v8
@@ -50,7 +50,7 @@
     "repository": {
       "full_name": "/p/test/git/", 
       "name": "Git", 
-      "url": "sourceforge.net/p/test/git/"
+      "url": "http://sourceforge.net/p/test/git/"
     }
 }
 ~~~~~
&lt;/pre&gt;
&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Dave Brondsema</dc:creator><pubDate>Tue, 10 Mar 2015 19:27:37 -0000</pubDate><guid>https://forge-allura.apache.org2c12a85dea3a5d39227476e35c11c98ba0710f4f</guid></item><item><title>Webhooks modified by Igor Bondarenko</title><link>https://forge-allura.apache.org/p/allura/wiki/Webhooks/</link><description>&lt;div class="markdown_content"&gt;&lt;pre&gt;--- v6
+++ v7
@@ -140,7 +140,7 @@

 ## Receiving webhooks

-If you want to make sure that requests are coming Allura and not from someone else, you need to:
+If you want to make sure that requests are coming from Allura and not from someone else, you need to:

 - Set up `secret` when configuring the webhook (you can leave it blank and Allura will automatically generate one for you).
 - On every request validate the signature from the `X-Allura-Signature` header.
&lt;/pre&gt;
&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Igor Bondarenko</dc:creator><pubDate>Mon, 23 Feb 2015 20:19:36 -0000</pubDate><guid>https://forge-allura.apache.org276a8a50914be93b3557db8029671da1a1a8c718</guid></item><item><title>Webhooks modified by Dave Brondsema</title><link>https://forge-allura.apache.org/p/allura/wiki/Webhooks/</link><description>&lt;div class="markdown_content"&gt;&lt;pre&gt;--- v5
+++ v6
@@ -63,7 +63,7 @@
 {
     "after": "3f36d4136f4c7151066135335a70d812f7d9251b", 
     "before": "715226c07bcfd410bb655e9290adeb770eb36b1f", 
-    "size": 1
+    "size": 1,
     "commits": [
       {
         "id": "3f36d4136f4c7151066135335a70d812f7d9251b", 
@@ -105,7 +105,7 @@
 {
     "after": "r10", 
     "before": "r9", 
-    "size": 1
+    "size": 1,
     "commits": [
       {
         "id": "r10", 
&lt;/pre&gt;
&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Dave Brondsema</dc:creator><pubDate>Mon, 23 Feb 2015 19:37:24 -0000</pubDate><guid>https://forge-allura.apache.orgcac40af74f2eb390afe10c684b965b4c44fe0ef6</guid></item><item><title>Webhooks modified by Dave Brondsema</title><link>https://forge-allura.apache.org/p/allura/wiki/Webhooks/</link><description>&lt;div class="markdown_content"&gt;&lt;pre&gt;--- v4
+++ v5
@@ -1,6 +1,6 @@
 [TOC]

-Allura supports one type of webhooks for the moment - `repo-push`, triggered when repository receives new commits. It is supported for Git, Mercurial and SVN repositories.
+Allura supports one type of webhook for the moment - `repo-push`, triggered when a repository receives new commits. It is supported for Git, Mercurial and SVN repositories.

 ## Configure webhooks

@@ -9,11 +9,11 @@
 - Click 'Create' under appropriate hook type
 - Provide url and (optional) secret

-You can also manage webhooks through [REST API](https://sourceforge.net/p/forge/documentation/Allura%20API/).
+You can also manage webhooks through the         [REST API](https://sourceforge.net/p/forge/documentation/Allura%20API/).

 ## Payload

-Request payload is JSON.
+The request payload is JSON.  Examples:

 ### Git

@@ -55,7 +55,7 @@
 }
 ~~~~~

-.
+&lt;br /&gt;

 ### Mercurial

@@ -97,7 +97,7 @@
   }
 ~~~~~

-.
+&lt;br /&gt;

 ### SVN

@@ -140,14 +140,14 @@

 ## Receiving webhooks

-If your want to make sure that requests coming Allura and not from someone else you need to:
+If you want to make sure that requests are coming Allura and not from someone else, you need to:

-- Set up `secret` when configuring webhook (you can leave it blank and Allura will automatically generate one for you).
-- On every request validate signature from the `X-Allura-Signature` header.
+- Set up `secret` when configuring the webhook (you can leave it blank and Allura will automatically generate one for you).
+- On every request validate the signature from the `X-Allura-Signature` header.

 Note: **DO NOT** ever expose your `secret`!

-Signature is obtained by hashing webhook payload with `secret` using HMAC algorithm. You can do something like this to verify it:
+The signature is obtained by hashing the webhook payload with `secret` using HMAC algorithm. You can do something like this to verify it:

     :::python
     def verify(payload, signature, secret)
&lt;/pre&gt;
&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Dave Brondsema</dc:creator><pubDate>Mon, 23 Feb 2015 19:36:00 -0000</pubDate><guid>https://forge-allura.apache.org70669ad2c392c7582d8219e996500898e54e4773</guid></item><item><title>Webhooks modified by Igor Bondarenko</title><link>https://forge-allura.apache.org/p/allura/wiki/Webhooks/</link><description>&lt;div class="markdown_content"&gt;&lt;pre&gt;--- v3
+++ v4
@@ -8,6 +8,8 @@
 - Find 'Webhooks' link under particular repository tool
 - Click 'Create' under appropriate hook type
 - Provide url and (optional) secret
+
+You can also manage webhooks through [REST API](https://sourceforge.net/p/forge/documentation/Allura%20API/).

 ## Payload

&lt;/pre&gt;
&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Igor Bondarenko</dc:creator><pubDate>Mon, 23 Feb 2015 15:14:52 -0000</pubDate><guid>https://forge-allura.apache.org8dd50af4976d8e882bd9dd3cfe2586b42b2452f8</guid></item><item><title>Webhooks modified by Igor Bondarenko</title><link>https://forge-allura.apache.org/p/allura/wiki/Webhooks/</link><description>&lt;div class="markdown_content"&gt;&lt;pre&gt;--- v2
+++ v3
@@ -10,6 +10,8 @@
 - Provide url and (optional) secret

 ## Payload
+
+Request payload is JSON.

 ### Git

&lt;/pre&gt;
&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Igor Bondarenko</dc:creator><pubDate>Mon, 23 Feb 2015 15:11:44 -0000</pubDate><guid>https://forge-allura.apache.orgc6df133efeac145ecb67bc79e888be0306d5f7c6</guid></item><item><title>Webhooks modified by Igor Bondarenko</title><link>https://forge-allura.apache.org/p/allura/wiki/Webhooks/</link><description>&lt;div class="markdown_content"&gt;&lt;pre&gt;--- v1
+++ v2
@@ -150,3 +150,6 @@
         actual_signature = hmac.new(secret.encode('utf-8'), payload.encode('utf-8'), hashlib.sha1)
         actual_signature = 'sha1=' + actual_signature.hexdigest()
         return hmac.compare_digest(actual_signature, signature)
+    
+    
+    verify(request.body, request.headers.get('X-Allura-Signature'), secret)
&lt;/pre&gt;
&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Igor Bondarenko</dc:creator><pubDate>Mon, 23 Feb 2015 15:10:37 -0000</pubDate><guid>https://forge-allura.apache.orgd2a7c71aaf83411c363316b4ecfc0cf0bbe2ef92</guid></item><item><title>Webhooks modified by Igor Bondarenko</title><link>https://forge-allura.apache.org/p/allura/wiki/Webhooks/</link><description>&lt;div class="markdown_content"&gt;&lt;div class="toc"&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="#configure-webhooks"&gt;Configure webhooks&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#payload"&gt;Payload&lt;/a&gt;&lt;ul&gt;
&lt;li&gt;&lt;a href="#git"&gt;Git&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#mercurial"&gt;Mercurial&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#svn"&gt;SVN&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;a href="#receiving-webhooks"&gt;Receiving webhooks&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;
&lt;p&gt;Allura supports one type of webhooks for the moment - &lt;code&gt;repo-push&lt;/code&gt;, triggered when repository receives new commits. It is supported for Git, Mercurial and SVN repositories.&lt;/p&gt;
&lt;h2 id="configure-webhooks"&gt;Configure webhooks&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;Go to tools admin page&lt;/li&gt;
&lt;li&gt;Find 'Webhooks' link under particular repository tool&lt;/li&gt;
&lt;li&gt;Click 'Create' under appropriate hook type&lt;/li&gt;
&lt;li&gt;Provide url and (optional) secret&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id="payload"&gt;Payload&lt;/h2&gt;
&lt;h3 id="git"&gt;Git&lt;/h3&gt;
&lt;div class="codehilite"&gt;&lt;pre&gt;&lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="s2"&gt;"after"&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"a72ab8566ed1a81e485a8451868ee9364069ea6b"&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; 
    &lt;span class="s2"&gt;"before"&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"27bc571ceb56beeda796e0069bfba84581f55770"&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt;
    &lt;span class="s2"&gt;"size"&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="m"&gt;1&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt;
    &lt;span class="s2"&gt;"commits"&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="cp"&gt;[&lt;/span&gt;
      &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="s2"&gt;"id"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"a72ab8566ed1a81e485a8451868ee9364069ea6b"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; 
        &lt;span class="s2"&gt;"message"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"Update README"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; 
        &lt;span class="s2"&gt;"added"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="err"&gt;[&lt;/span&gt;&lt;span class="cp"&gt;]&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; 
        &lt;span class="s2"&gt;"copied"&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="cp"&gt;[]&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; 
        &lt;span class="s2"&gt;"removed"&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="cp"&gt;[]&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; 
        &lt;span class="s2"&gt;"modified"&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="cp"&gt;[&lt;/span&gt;
          &lt;span class="s2"&gt;"README.md"&lt;/span&gt;
        &lt;span class="cp"&gt;]&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; 
        &lt;span class="s2"&gt;"author"&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="err"&gt;{&lt;/span&gt;
          &lt;span class="s2"&gt;"email"&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"jetmind@example.com"&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; 
          &lt;span class="s2"&gt;"name"&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"Igor Bondarenko"&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; 
          &lt;span class="s2"&gt;"username"&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"jetmind"&lt;/span&gt;
        &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; 
        &lt;span class="s2"&gt;"committer"&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
          &lt;span class="s2"&gt;"email"&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"jetmind@example.com"&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; 
          &lt;span class="s2"&gt;"name"&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"Igor Bondarenko"&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; 
          &lt;span class="s2"&gt;"username"&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"jetmind"&lt;/span&gt;
        &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; 
        &lt;span class="s2"&gt;"timestamp"&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"2015-02-23T14:30:42Z"&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; 
        &lt;span class="s2"&gt;"url"&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"http://sourceforge.net/p/test/git/ci/a72ab8566ed1a81e485a8451868ee9364069ea6b/"&lt;/span&gt;
      &lt;span class="err"&gt;}&lt;/span&gt;
    &lt;span class="o"&gt;],&lt;/span&gt; 
    &lt;span class="s2"&gt;"ref"&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"refs/heads/master"&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; 
    &lt;span class="s2"&gt;"repository"&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="s2"&gt;"full_name"&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"/p/test/git/"&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; 
      &lt;span class="s2"&gt;"name"&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"Git"&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; 
      &lt;span class="s2"&gt;"url"&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"sourceforge.net/p/test/git/"&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="err"&gt;}&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;.&lt;/p&gt;
&lt;h3 id="mercurial"&gt;Mercurial&lt;/h3&gt;
&lt;div class="codehilite"&gt;&lt;pre&gt;&lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="s2"&gt;"after"&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"3f36d4136f4c7151066135335a70d812f7d9251b"&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; 
    &lt;span class="s2"&gt;"before"&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"715226c07bcfd410bb655e9290adeb770eb36b1f"&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; 
    &lt;span class="s2"&gt;"size"&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="m"&gt;1&lt;/span&gt;
    &lt;span class="s2"&gt;"commits"&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="cp"&gt;[&lt;/span&gt;
      &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="s2"&gt;"id"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"3f36d4136f4c7151066135335a70d812f7d9251b"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; 
        &lt;span class="s2"&gt;"message"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"Update README"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; 
        &lt;span class="s2"&gt;"added"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="err"&gt;[&lt;/span&gt;&lt;span class="cp"&gt;]&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; 
        &lt;span class="s2"&gt;"copied"&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="cp"&gt;[]&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; 
        &lt;span class="s2"&gt;"removed"&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="cp"&gt;[]&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; 
        &lt;span class="s2"&gt;"modified"&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="cp"&gt;[&lt;/span&gt;
          &lt;span class="s2"&gt;"README.markdown"&lt;/span&gt;
        &lt;span class="cp"&gt;]&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; 
        &lt;span class="s2"&gt;"author"&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="err"&gt;{&lt;/span&gt;
          &lt;span class="s2"&gt;"email"&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"jetmind"&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; 
          &lt;span class="s2"&gt;"name"&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"jetmind"&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; 
          &lt;span class="s2"&gt;"username"&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;""&lt;/span&gt;
        &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; 
        &lt;span class="s2"&gt;"committer"&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
          &lt;span class="s2"&gt;"email"&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"jetmind"&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; 
          &lt;span class="s2"&gt;"name"&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"jetmind"&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; 
          &lt;span class="s2"&gt;"username"&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;""&lt;/span&gt;
        &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; 
        &lt;span class="s2"&gt;"timestamp"&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"2015-02-23T14:32:01Z"&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; 
        &lt;span class="s2"&gt;"url"&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"http://sourceforge.net/p/test/mercurial/ci/3f36d4136f4c7151066135335a70d812f7d9251b/"&lt;/span&gt;
      &lt;span class="err"&gt;}&lt;/span&gt;
    &lt;span class="o"&gt;],&lt;/span&gt; 
    &lt;span class="s2"&gt;"ref"&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"refs/tags/tip"&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; 
    &lt;span class="s2"&gt;"repository"&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="s2"&gt;"full_name"&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"/p/test/mercurial/"&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; 
      &lt;span class="s2"&gt;"name"&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"Mercurial"&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; 
      &lt;span class="s2"&gt;"url"&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"http://sourceforge.net/p/test/mercurial/"&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
  &lt;span class="err"&gt;}&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;.&lt;/p&gt;
&lt;h3 id="svn"&gt;SVN&lt;/h3&gt;
&lt;div class="codehilite"&gt;&lt;pre&gt;&lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="s2"&gt;"after"&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"r10"&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; 
    &lt;span class="s2"&gt;"before"&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"r9"&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; 
    &lt;span class="s2"&gt;"size"&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="m"&gt;1&lt;/span&gt;
    &lt;span class="s2"&gt;"commits"&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="cp"&gt;[&lt;/span&gt;
      &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="s2"&gt;"id"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"r10"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; 
        &lt;span class="s2"&gt;"message"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"Update README"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; 
        &lt;span class="s2"&gt;"added"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="err"&gt;[&lt;/span&gt;&lt;span class="cp"&gt;]&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; 
        &lt;span class="s2"&gt;"copied"&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="cp"&gt;[]&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt;
        &lt;span class="s2"&gt;"removed"&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="cp"&gt;[]&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; 
        &lt;span class="s2"&gt;"modified"&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="cp"&gt;[&lt;/span&gt;
          &lt;span class="s2"&gt;"/trunk/README"&lt;/span&gt;
        &lt;span class="cp"&gt;]&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; 
        &lt;span class="s2"&gt;"author"&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="err"&gt;{&lt;/span&gt;
          &lt;span class="s2"&gt;"email"&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;""&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; 
          &lt;span class="s2"&gt;"name"&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"jetmind"&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; 
          &lt;span class="s2"&gt;"username"&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;""&lt;/span&gt;
        &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; 
        &lt;span class="s2"&gt;"committer"&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
          &lt;span class="s2"&gt;"email"&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;""&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; 
          &lt;span class="s2"&gt;"name"&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"jetmind"&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; 
          &lt;span class="s2"&gt;"username"&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;""&lt;/span&gt;
        &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt;  
        &lt;span class="s2"&gt;"timestamp"&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"2015-02-23T14:33:40Z"&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; 
        &lt;span class="s2"&gt;"url"&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"http://sourceforge.net/p/test/svn/10/"&lt;/span&gt;
      &lt;span class="err"&gt;}&lt;/span&gt;
    &lt;span class="o"&gt;],&lt;/span&gt; 
    &lt;span class="s2"&gt;"repository"&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="s2"&gt;"full_name"&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"/p/test/svn/"&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; 
      &lt;span class="s2"&gt;"name"&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"SVN"&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; 
      &lt;span class="s2"&gt;"url"&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"http://sourceforge.net/p/test/svn/"&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
  &lt;span class="err"&gt;}&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;
&lt;h2 id="receiving-webhooks"&gt;Receiving webhooks&lt;/h2&gt;
&lt;p&gt;If your want to make sure that requests coming Allura and not from someone else you need to:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Set up &lt;code&gt;secret&lt;/code&gt; when configuring webhook (you can leave it blank and Allura will automatically generate one for you).&lt;/li&gt;
&lt;li&gt;On every request validate signature from the &lt;code&gt;X-Allura-Signature&lt;/code&gt; header.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Note: &lt;strong&gt;DO NOT&lt;/strong&gt; ever expose your &lt;code&gt;secret&lt;/code&gt;!&lt;/p&gt;
&lt;p&gt;Signature is obtained by hashing webhook payload with &lt;code&gt;secret&lt;/code&gt; using HMAC algorithm. You can do something like this to verify it:&lt;/p&gt;
&lt;div class="codehilite"&gt;&lt;pre&gt;&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;verify&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;payload&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;signature&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;secret&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;actual_signature&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;hmac&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;new&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;secret&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;encode&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;'utf-8'&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt; &lt;span class="n"&gt;payload&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;encode&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;'utf-8'&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt; &lt;span class="n"&gt;hashlib&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;sha1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;actual_signature&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s"&gt;'sha1='&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;actual_signature&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;hexdigest&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;hmac&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;compare_digest&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;actual_signature&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;signature&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;
&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Igor Bondarenko</dc:creator><pubDate>Mon, 23 Feb 2015 15:08:22 -0000</pubDate><guid>https://forge-allura.apache.orgb0768f27f07f66b3c421ec68f03e563cce6d240e</guid></item></channel></rss>