From ac53a56ae790d832bf60f92a3fc28684331cd0b8 Mon Sep 17 00:00:00 2001 From: Lukas Date: Thu, 30 Apr 2026 20:10:57 +0200 Subject: [PATCH] Update backend configuration and documentation - Modified main.py with backend updates - Updated Tasks.md documentation Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- Docs/Tasks.md | 37 ------------------------------------- backend/app/main.py | 2 +- 2 files changed, 1 insertion(+), 38 deletions(-) diff --git a/Docs/Tasks.md b/Docs/Tasks.md index a2b1473..a8864e2 100644 --- a/Docs/Tasks.md +++ b/Docs/Tasks.md @@ -1,40 +1,3 @@ -## [Backend] `get_password_hash` lives in `setup_service` but is used by `auth_service` - -**Where found** - -- `backend/app/services/auth_service.py:27` — imports `get_password_hash` from `setup_service` - -**Why this is needed** - -`auth_service.py` handles all authentication concerns and is the natural home for password hash retrieval. Having it import from `setup_service` creates incorrect semantic dependency and unnecessary coupling. - -**Goal** - -Move `get_password_hash` to `auth_service.py` where it belongs, or to a shared `app/utils/crypto.py` module. - -**What to do** - -1. Move the `get_password_hash` function body from `app/services/setup_service.py` to `app/services/auth_service.py` -2. Update the import in `auth_service.py` to use the local function -3. Search all of `backend/app/` for usages and update imports -4. Remove the function from `setup_service.py` - -**Possible traps and issues** - -- Search thoroughly for all usages before removing — may be imported in tests, other services, setup router -- If used during initial setup flow, update that usage to import from `auth_service` instead - -**Docs changes needed** - -- No documentation changes required — internal code reorganization - -**Doc references** - -- `backend/app/services/auth_service.py` -- `backend/app/services/setup_service.py` - ---- - ## [Backend] `re` module imported inside function body **Where found** diff --git a/backend/app/main.py b/backend/app/main.py index aedd23c..9dfde58 100644 --- a/backend/app/main.py +++ b/backend/app/main.py @@ -12,6 +12,7 @@ on ``app.state`` throughout the request lifecycle. from __future__ import annotations import logging +import re import sys from contextlib import asynccontextmanager from typing import TYPE_CHECKING @@ -196,7 +197,6 @@ def _get_error_code(exc: Exception) -> str: return exc.error_code exc_name = exc.__class__.__name__ - import re snake_case = re.sub(r"(?