From b89006035bafe86581cbee13b311a5792d2b76ab Mon Sep 17 00:00:00 2001 From: marysieek Date: Mon, 18 Jan 2021 15:51:26 +0100 Subject: [PATCH 1/5] Add webhooks docs --- README.rst | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/README.rst b/README.rst index 45891d0..791c9a7 100644 --- a/README.rst +++ b/README.rst @@ -209,6 +209,20 @@ Exceptions level HTTP response. You can also choose to catch a more `finegrained error `__. +Webhooks +-------- + +Castle uses webhooks to notify about ``$inident.confirmed`` or `$review.opened` events. +Each webhook has ``X-Castle-Signature`` header that allows verifying webhook's source. + +.. code:: python + + from castle.webhooks.verify import WebhooksVerify + + # WebhookVerificationError is raised when the signature is not matching + WebhooksVerify.call(webhook) + + Documentation ------------- From 43f9c6e0fd76cfac9b2abd4d8cc6a55ec5ae01c8 Mon Sep 17 00:00:00 2001 From: Maria Korlotian Date: Mon, 18 Jan 2021 16:11:40 +0100 Subject: [PATCH 2/5] Update README.rst --- README.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.rst b/README.rst index 791c9a7..480c6a0 100644 --- a/README.rst +++ b/README.rst @@ -17,7 +17,7 @@ Installation Configuration ------------- -import and configure the library with your Castle API secret. +Import and configure the library with your Castle API secret. .. code:: python From e168f0a0c0addaad4a98e48da3069e98dce683df Mon Sep 17 00:00:00 2001 From: marysieek Date: Tue, 19 Jan 2021 11:39:30 +0100 Subject: [PATCH 3/5] Update readme --- README.rst | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/README.rst b/README.rst index 480c6a0..c6fde92 100644 --- a/README.rst +++ b/README.rst @@ -212,15 +212,16 @@ error `__. Webhooks -------- -Castle uses webhooks to notify about ``$inident.confirmed`` or `$review.opened` events. +Castle uses webhooks to notify about ``$incident.confirmed`` or `$review.opened` events. Each webhook has ``X-Castle-Signature`` header that allows verifying webhook's source. .. code:: python from castle.webhooks.verify import WebhooksVerify - # WebhookVerificationError is raised when the signature is not matching + # Verify the webhook, passed as a Request object WebhooksVerify.call(webhook) + # WebhookVerificationError is raised when the signature is not matching Documentation From 28ed1d041b2d74ca7cafe82be9e1db0d311fa428 Mon Sep 17 00:00:00 2001 From: marysieek Date: Tue, 19 Jan 2021 11:41:55 +0100 Subject: [PATCH 4/5] Remove spacing --- README.rst | 1 - 1 file changed, 1 deletion(-) diff --git a/README.rst b/README.rst index c6fde92..5ca1613 100644 --- a/README.rst +++ b/README.rst @@ -223,7 +223,6 @@ Each webhook has ``X-Castle-Signature`` header that allows verifying webhook's s WebhooksVerify.call(webhook) # WebhookVerificationError is raised when the signature is not matching - Documentation ------------- From f22def3487e08f9cfccfa80a5f8da856e34a545f Mon Sep 17 00:00:00 2001 From: marysieek Date: Tue, 19 Jan 2021 11:47:15 +0100 Subject: [PATCH 5/5] Pass webhook_request --- README.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.rst b/README.rst index 5ca1613..2b3bfff 100644 --- a/README.rst +++ b/README.rst @@ -220,7 +220,7 @@ Each webhook has ``X-Castle-Signature`` header that allows verifying webhook's s from castle.webhooks.verify import WebhooksVerify # Verify the webhook, passed as a Request object - WebhooksVerify.call(webhook) + WebhooksVerify.call(webhook_request) # WebhookVerificationError is raised when the signature is not matching Documentation