diff --git a/pyproject.toml b/pyproject.toml index c026c59..ef226f5 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -58,6 +58,7 @@ select = [ "T20", # flake8-print "PLE", # pylint errors "RUF", + "FAST", # fastapi ] [tool.ruff.lint.mccabe] diff --git a/src/runboat/webhooks.py b/src/runboat/webhooks.py index ec81d26..f3e5cbc 100644 --- a/src/runboat/webhooks.py +++ b/src/runboat/webhooks.py @@ -1,5 +1,6 @@ import hmac import logging +from typing import Annotated from fastapi import APIRouter, BackgroundTasks, Header, Request @@ -31,8 +32,8 @@ def _verify_github_signature( async def receive_payload( background_tasks: BackgroundTasks, request: Request, - x_github_event: str = Header(...), - x_hub_signature_256: str | None = Header(None), + x_github_event: Annotated[str, Header(...)], + x_hub_signature_256: Annotated[str | None, Header(None)], ) -> None: body = await request.body() if not _verify_github_signature(