Skip to content

Commit d0e752c

Browse files
committed
More descriptive web hook secret name in config
1 parent f1f81af commit d0e752c

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

gitconsensusservice/routes/webhooks.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@ def githook():
2626
abort(403)
2727

2828
# If secret is set use it to validate message.
29-
if 'webhook_secret' in app.config:
30-
secret = app.config.get['webhook_secret']
29+
if 'GITHUB_WEBHOOK_SECRET' in app.config and app.config['GITHUB_WEBHOOK_SECRET']:
30+
secret = app.config.get['GITHUB_WEBHOOK_SECRET']
3131
header_signature = request.headers.get('X-Hub-Signature')
3232
if header_signature is None:
3333
logging.warning('Github webhook received without expected authentication signature')

settings.dist.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
DEBUG: false
22
GITHUB_PRIVATE_KEY: '/absolute/path/to/private-key.pem'
33
GITHUB_APP_ID: 0
4+
GITHUB_WEBHOOK_SECRET:

0 commit comments

Comments
 (0)