Skip to content

Commit c9ba4ab

Browse files
authored
Logging error (#312)
1 parent cb786e8 commit c9ba4ab

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

app/tc2/views.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,13 @@ async def callback(
2727
"""
2828
expected_sig = hmac.new(settings.tc2_api_key.encode(), (await request.body()), hashlib.sha256).hexdigest()
2929
if not settings.dev_mode and (not webhook_signature or not compare_digest(webhook_signature, expected_sig)):
30+
app_logger.info(
31+
'Unauthorized key, expected %s got %s. Using TC2 key ending with: %s',
32+
expected_sig,
33+
webhook_signature,
34+
settings.tc2_api_key[-4:],
35+
)
36+
app_logger.info('Request body: %s', await request.body())
3037
raise HTTPException(status_code=403, detail='Unauthorized key')
3138
for event in webhook.events:
3239
company, deal = None, None

0 commit comments

Comments
 (0)