chore(backend): save remaining API and deployment changes

Expose frozen factual review policy, update API descriptions and Swagger settings, and adjust local deployment and embedding connectivity.

Include the requested extraction candidates and review-policy regression coverage. Validation: 31 OCR policy tests passed; staged diff whitespace checks passed.
This commit is contained in:
amirhosein mazaheri
2026-10-10 17:43:17 +03:30
parent a769196bfa
commit 21a0ea076a
18 changed files with 268 additions and 49 deletions
+18 -3
View File
@@ -31,7 +31,12 @@ class AuthResponse(BaseModel):
csrf_token: str
expires_at: str
@router.post('/login', response_model=AuthResponse)
@router.post(
'/login',
response_model=AuthResponse,
summary='User Login',
description='Authenticate with username and password. On success, issues a secure HTTP-only rag_session cookie and returns user context with CSRF token.',
)
def login(req: LoginRequest, request: Request, response: Response,
auth_service: Annotated[AuthService, Depends(get_auth_service)],
config: Annotated[VoiceSettings, Depends(get_voice_settings)]):
@@ -55,7 +60,12 @@ def login(req: LoginRequest, request: Request, response: Response,
samesite='lax', expires=expiry, path='/')
return AuthResponse(user=UserDTO(**user), csrf_token=csrf, expires_at=expiry.isoformat())
@router.post('/logout', status_code=204)
@router.post(
'/logout',
status_code=204,
summary='User Logout',
description='Revoke the active authentication session and clear the session cookie.',
)
def logout(request: Request, response: Response,
auth_service: Annotated[AuthService, Depends(get_auth_service)],
config: Annotated[VoiceSettings, Depends(get_voice_settings)]):
@@ -73,7 +83,12 @@ def logout(request: Request, response: Response,
response.status_code = 204
return response
@identity_router.get('/me', response_model=AuthResponse)
@identity_router.get(
'/me',
response_model=AuthResponse,
summary='Get Current Identity',
description='Retrieve identity and session expiry for the currently authenticated user.',
)
@router.get('/me', response_model=AuthResponse, include_in_schema=False)
def get_me(request: Request, user: Annotated[UserContext, Depends(get_current_user)]):
return AuthResponse(user=UserDTO(id=str(user.id), organization_id=str(user.organization_id),