Phase 1 Complete by Claude Code

This commit is contained in:
2026-02-16 22:32:28 +02:00
parent 19c069949d
commit 5e2d4b6b1b
20 changed files with 692 additions and 32 deletions

View File

@@ -1 +1,20 @@
# TODO: Custom error handlers
from fastapi import HTTPException
class AuthenticationError(HTTPException):
def __init__(self, detail: str = "Could not validate credentials"):
super().__init__(
status_code=401,
detail=detail,
headers={"WWW-Authenticate": "Bearer"},
)
class AuthorizationError(HTTPException):
def __init__(self, detail: str = "Insufficient permissions"):
super().__init__(status_code=403, detail=detail)
class NotFoundError(HTTPException):
def __init__(self, resource: str = "Resource"):
super().__init__(status_code=404, detail=f"{resource} not found")