Hi,
I'm using this script to validate the webhook signatures.
https://confluence.atlassian.com/bbkb/bitbucket-cloud-python-sample-code-to-verify-webhook-signature-1346243949.html-1346243949.html
When there is a colon : in the commit message (i.e., Test Commit : #1), script returns a mismatch in signature. Any suggestions to overcome this scenario?
Hi @cm devops
The issue arises because the script removes whitespaces after the colon, causing the problem. To address this, I've modified the script to convert the payload data back to a single-line JSON string with separators ',' and ':', and to pretty print the original payload with payload_data, indent=2). This adjustment should resolve the issue.
Furthermore, I want to highlight that there may be a discrepancy in how Bitbucket Cloud calculates HMAC signature compared to how the script calculates it. You may need to modify the script accordingly. The ultimate goal is to convert JSON to a single line while removing whitespaces.
You can find the modified script at the following link: https://confluence.atlassian.com/display/BBKB/Bitbucket+Cloud+-+Python+sample+code+to+verify+webhook+signature
I hope this helps.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.