This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def validate_signature(payload, secret): | |
# Get the signature from the payload | |
signature_header = payload['headers']['X-Hub-Signature'] | |
sha_name, github_signature = signature_header.split('=') | |
if sha_name != 'sha1': | |
print('ERROR: X-Hub-Signature in payload headers was not sha1=****') | |
return False | |
# Create our own signature |