lab132 / buildbot-gitea

Buildbot plugin for integration with gitea.
MIT License
62 stars 21 forks source link

'Invalid secret' is returned but secret is not wrong #17

Closed nkohlmeier closed 3 years ago

nkohlmeier commented 3 years ago

Hello. I get 'Invalid secret' when a Webhook Request is sent. After a bit of debugging I found that the HTTP header that is used for the signature validation is wrong. The header in question is set in webhook.py in line 12. This header is not sent by Gitea which causes the header to be None. I changed the line to _HEADER_SIGNATURE = 'X-Gitea-Signature' which fixes the issue.

This may be a configuration issue on my side. I'm not entirely sure. I can test this further on the weekend and send a pull request.

pampersrocker commented 3 years ago

Thank you, I've changed the implementation yesterday to tackle the deprecation in #15. The documentation is a bit lacking for the webhooks, but you are right, X-Gitea-Signature should be the correct one, HTTP_X_GITEA_SIGNATURE is the PHP wording for the same.

pampersrocker commented 3 years ago

This has been fixed in v1.4.1