feat: Enhance logging and error handling for job streaming and photo uploads
CI / skip-ci-check (pull_request) Successful in 8s
CI / lint-and-type-check (pull_request) Successful in 1m12s
CI / python-lint (pull_request) Successful in 36s
CI / test-backend (pull_request) Successful in 3m47s
CI / build (pull_request) Successful in 3m28s
CI / secret-scanning (pull_request) Successful in 14s
CI / dependency-scan (pull_request) Successful in 13s
CI / sast-scan (pull_request) Successful in 1m33s
CI / workflow-summary (pull_request) Successful in 5s

- Added new logging scripts for quick access to service logs and troubleshooting.
- Updated job streaming API to support authentication via query parameters for EventSource.
- Improved photo upload process to capture and validate EXIF dates and original modification times.
- Enhanced error handling for file uploads and EXIF extraction failures.
- Introduced new configuration options in ecosystem.config.js to prevent infinite crash loops.
This commit is contained in:
tanyar09
2026-02-04 19:30:05 +00:00
parent 46dffc6ade
commit 7a981b069a
16 changed files with 648 additions and 89 deletions
+22
View File
@@ -100,6 +100,28 @@ def create_refresh_token(data: dict) -> str:
return jwt.encode(to_encode, SECRET_KEY, algorithm=ALGORITHM)
def get_current_user_from_token(token: str) -> dict:
"""Get current user from JWT token string (for query parameter auth).
Used for endpoints that need authentication but can't use headers
(e.g., EventSource/SSE endpoints).
"""
try:
payload = jwt.decode(token, SECRET_KEY, algorithms=[ALGORITHM])
username: str = payload.get("sub")
if username is None:
raise HTTPException(
status_code=status.HTTP_401_UNAUTHORIZED,
detail="Invalid authentication credentials",
)
return {"username": username}
except JWTError:
raise HTTPException(
status_code=status.HTTP_401_UNAUTHORIZED,
detail="Invalid authentication credentials",
)
def get_current_user(
credentials: Annotated[HTTPAuthorizationCredentials, Depends(get_bearer_token)]
) -> dict: