diff --git a/.github/issue_template/chore-template.md b/.github/ISSUE_TEMPLATE/chore-template.md similarity index 100% rename from .github/issue_template/chore-template.md rename to .github/ISSUE_TEMPLATE/chore-template.md diff --git a/.github/issue_template/feature-template.md b/.github/ISSUE_TEMPLATE/feature-template.md similarity index 100% rename from .github/issue_template/feature-template.md rename to .github/ISSUE_TEMPLATE/feature-template.md diff --git a/src/main/auth/__init__.py b/src/main/auth/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/src/main/auth/dependencies.py b/src/main/auth/dependencies.py new file mode 100644 index 0000000..4e1d847 --- /dev/null +++ b/src/main/auth/dependencies.py @@ -0,0 +1,17 @@ +from fastapi import Header, HTTPException +from typing import Annotated +import uuid + +async def get_current_user(x_auth_sub: Annotated[str | None, Header()] = None) -> uuid.UUID: + if not x_auth_sub: + raise HTTPException( + status_code=401, + detail="Unauthorized" + ) + try: + return uuid.UUID(x_auth_sub) + except ValueError: + raise HTTPException( + status_code=401, + detail="Unauthorized" + ) \ No newline at end of file