mirror of
https://github.com/ansible/awx.git
synced 2026-01-14 03:10:42 -03:30
Construct an ID for Gitlab webhooks
by taking the SHA1 of the body of the webhook request.
This commit is contained in:
parent
992c414737
commit
8836ed44ce
@ -138,8 +138,10 @@ class GitlabWebhookReceiver(WebhookReceiverBase):
|
||||
return self.request.META.get('HTTP_X_GITLAB_EVENT')
|
||||
|
||||
def get_event_guid(self):
|
||||
# Gitlab does not provide a unique identifier on events.
|
||||
return ''
|
||||
# Gitlab does not provide a unique identifier on events, so construct one.
|
||||
h = sha1()
|
||||
h.update(force_bytes(self.request.read()))
|
||||
return h.hexdigest()
|
||||
|
||||
def get_signature(self):
|
||||
return force_bytes(self.request.META.get('HTTP_X_GITLAB_TOKEN'))
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user