Move tribute webhook route to service

This commit is contained in:
Machka Pasla
2025-06-24 19:12:17 +03:00
parent 891f9354ac
commit 7a90e24427
4 changed files with 10 additions and 12 deletions
+8
View File
@@ -146,3 +146,11 @@ class TributeService:
else:
await session.commit()
return web.Response(status=200, text="ok")
async def tribute_webhook_route(request: web.Request):
"""AIOHTTP route handler for Tribute webhook calls."""
tribute_service: TributeService = request.app['tribute_service']
raw_body = await request.read()
signature_header = request.headers.get('trbt-signature')
return await tribute_service.handle_webhook(raw_body, signature_header)