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>
This commit is contained in:
@@ -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
|
## [Backend] `re` module imported inside function body
|
||||||
|
|
||||||
**Where found**
|
**Where found**
|
||||||
|
|||||||
@@ -12,6 +12,7 @@ on ``app.state`` throughout the request lifecycle.
|
|||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
import logging
|
import logging
|
||||||
|
import re
|
||||||
import sys
|
import sys
|
||||||
from contextlib import asynccontextmanager
|
from contextlib import asynccontextmanager
|
||||||
from typing import TYPE_CHECKING
|
from typing import TYPE_CHECKING
|
||||||
@@ -196,7 +197,6 @@ def _get_error_code(exc: Exception) -> str:
|
|||||||
return exc.error_code
|
return exc.error_code
|
||||||
|
|
||||||
exc_name = exc.__class__.__name__
|
exc_name = exc.__class__.__name__
|
||||||
import re
|
|
||||||
snake_case = re.sub(r"(?<!^)(?=[A-Z])", "_", exc_name).lower()
|
snake_case = re.sub(r"(?<!^)(?=[A-Z])", "_", exc_name).lower()
|
||||||
return snake_case
|
return snake_case
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user