aspnet / WebHooks

[Archived] Libraries to create and consume web hooks on ASP.NET Core. Project moved to https://github.com/aspnet/AspLabs
Apache License 2.0
627 stars 439 forks source link

`X-Hook-UUID` does not exist for Bitbucket Server, but is required for the webhook receiver #249

Closed forrestab closed 5 years ago

forrestab commented 6 years ago

Functional impact

Because the X-Hook-UUID does not exist in webhook requests from Bitbucket Server, the error "A 'bitbucket' WebHook request must contain a 'X-Hook-UUID' HTTP header." is thrown and the webhook handler is never executed.

Minimal repro steps

  1. Run a local Bitbucket Server 5.7.1 (I am using docker)
  2. Create a test repo and add a webhook (for me I am trying to hook into pr:opened)
  3. Make sure your handler is started
  4. Perform action in Bitbucket server that executes the webhook (in my case opening/re-opening a pull request)
  5. Go to the webhook event log to see the response (test repo -> Repository settings -> WebHooks -> View details (next to your webhook)) in the "Last failure" column

If it helps here is the code I am using as the receiver, https://github.com/forrestab/bitbucket-server-webhooks.

Expected result

Expected the handler to be called with the correct hook data.

Actual result

Exception is thrown and the handler is never called.

Further technical details

I don't understand the reasoning, but webhook requests from Bitbucket Server contain slightly different headers than Bitbucket Cloud.

Also, based on the HTTP headers listed for Bitbucket Server, there does not appear to be a matching X-Hook-UUID. Would it be possible to disable this check?

mkArtakMSFT commented 6 years ago

Thank you for reporting this issue. @dougbu, can you please look into this? Thanks!

dougbu commented 6 years ago

@forrestab we've moved this issue is in the Backlog milestone. This means that it is not going to happen for the coming release.

Have also marked this issue as up-for-grabs. This means we will review a PR filling this gap if someone submits one.

By "this gap" I mean interoperability with Bitbucket Server, not just a new option to disable the X-Hook-UUID requirement. We do not have a Bitbucket Server instance to test against. Nor do we have any confidence the missing X-Hook-UUID header is the only Bitbucket Cloud / Server difference.

aspnet-hello commented 5 years ago

This issue was moved to aspnet/AspLabs#44