Mock auth

This commit is contained in:
Jacob Windsor
2025-02-19 13:55:42 +01:00
parent 851906a029
commit e0f8112d13
7 changed files with 66 additions and 18 deletions
+9
View File
@@ -0,0 +1,9 @@
from fastapi import HTTPException, status
class BaseError(HTTPException):
status_code: int = status.HTTP_500_INTERNAL_SERVER_ERROR
def __init__(self, detail: str):
self.detail = detail
super().__init__(status_code=self.status_code, detail=self.detail)
+10
View File
@@ -0,0 +1,10 @@
from fastapi import status
from .base_error import BaseError
class NotAuthenticatedError(BaseError):
status_code: int = status.HTTP_401_UNAUTHORIZED
def __init__(self):
super().__init__("Not authenticated")