mirror of
https://github.com/escalante29/WealthySmart.git
synced 2026-07-17 12:08:47 +02:00
Consistency sweep: enum members, keyword status codes, SimpleCookie
analytics.py filters by TransactionType.COMPRA instead of the string literal; budget.py uses keyword HTTPException args; the agent middleware parses cookies with stdlib SimpleCookie instead of a regex (ARCH-10); auth.py's lazy imports are hoisted — there was never an actual auth/db cycle (ARCH-20); transactions.py hoists or_/and_. Verified: dev container boots, agent auth paths return 401 for missing/garbage cookies. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
@@ -12,6 +12,8 @@ from jose import JWTError, jwt
|
||||
from sqlmodel import Session, select
|
||||
|
||||
from app.config import settings
|
||||
from app.db import get_session
|
||||
from app.models.models import APIToken
|
||||
from app.timeutil import utcnow
|
||||
|
||||
oauth2_scheme = OAuth2PasswordBearer(tokenUrl="/api/v1/auth/login")
|
||||
@@ -91,9 +93,6 @@ def _validate_token(token: str) -> str:
|
||||
pass
|
||||
|
||||
# Fallback: check API token
|
||||
from app.db import get_session
|
||||
from app.models.models import APIToken
|
||||
|
||||
token_hash = hash_token(token)
|
||||
with next(get_session()) as session:
|
||||
api_token = session.exec(
|
||||
|
||||
Reference in New Issue
Block a user