Fix update webhook and use secret for webhook authentication (#42)

* Fix update repository webhooks and extend webhook tests

* Use secret to authenticate the webhook payload and extend the tests with the secret

Co-authored-by: Raul Barreto <raul.barreto@redbull.com>
This commit is contained in:
raulbarreto-delivion
2021-12-15 01:52:58 +01:00
committed by GitHub
parent bee3f62908
commit 1323abe664
3 changed files with 98 additions and 12 deletions

View File

@@ -20,6 +20,7 @@ resource "bitbucketserver_repository_webhook" "main" {
repository = bitbucketserver_repository.test.slug
name = "google"
webhook_url = "https://www.google.com/"
secret = "abc"
events = ["repo:refs_changed"]
active = true
}
@@ -31,6 +32,7 @@ resource "bitbucketserver_repository_webhook" "main" {
* `repository` - Required. Repository slug to enable hook for.
* `name` - Required. Name of the webhook.
* `webhook_url` - Required. The URL of the webhook.
* `secret` - Optional. Secret used to authenticate the payload.
* `events` - Required. A list of events to trigger the webhook url.
* `active` - Optional. Enable or disable the webhook. Default: true