Spaces:
Sleeping
Sleeping
Commit History
-
feat: per-user OpenAI key + model preferences persisted in DB
Fabio Antonini +1: Claude Sonnet 4.6- UserSettings table stores encrypted OpenAI key (Fernet) and last-selected models (rag, vlm, ocr, embed) per user - ContextVar propagates the user's decrypted key to all core modules without changing function signatures; global OPENAI_API_KEY env var as fallback - set_openai_context FastAPI dependency injected in rag, compliance, agent routers - GET/PUT /users/me/settings and PATCH /users/me/settings/models endpoints - DELETE /users/me/settings/openai-key to revoke personal key - Sidebar restores saved model selections on login and persists changes - Inline DB migration in init_db() adds new columns to existing user_settings table - docker-compose: OPENAI_API_KEY and SETTINGS_ENCRYPTION_KEY passed as env vars - Remove PUT /rag/openai-key (global key is env-only, never written to file) - Sidebar: uppercase removed from section headers; "Configurazione" now title-case Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>413c3b1
-
feat: agent projects with persistent chats and reusable documents
Fabio Antonini +1: Claude Sonnet 4.6- Add AgentChat and AgentMessage models (cascade delete from Project) - Extend /agent/chat to persist messages and save uploads to MinIO - New endpoints: agent projects, chats, documents CRUD - New AgentProjectPage: 3-column layout (chat list / chat / documents) - Sidebar: Agent Projects section with inline project creation - Documents panel: click to reuse without re-uploading - i18n: new keys for agent project UI (EN + IT) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>f9c4034
-
feat: password reset via admin (no SMTP required)
Fabio Antonini +1: Claude Sonnet 4.6Backend: - auth/jwt.py: add TokenType.reset + create_reset_token() (24h) - routers/auth.py: POST /auth/reset-password/generate (admin only) and POST /auth/reset-password/confirm (public) - models/audit.py: add password_reset_generate / password_reset_confirm actions Frontend: - ResetPasswordPage.tsx: new public page at /reset-password?token=xxx - AdminPage.tsx: KeyRound button per user → modal with copyable reset link - App.tsx: add /reset-password route - api.ts: authApi.generateResetToken() + authApi.confirmReset() - i18n/it.json + en.json: all new strings Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>f4fd404
-
feat: immutable audit log for forensic chain-of-custody
Fabio Antonini +1: Claude Sonnet 4.6Backend: - AuditLog model (append-only, no UPDATE/DELETE) with action enum, user snapshot, resource type/id, detail, ip_address - log_event() helper — silently swallows errors so logging never breaks the main request flow - Integrated in all key endpoints: login, project create/delete, document upload/delete, all analysis types, PDF download, clear analyses - GET /audit/ (admin only) with filters by action and user email, pagination (page/page_size) Frontend: - AdminPage with two tabs: Users and Activity Log - Audit tab: filter by action and email, paginated table with color-coded action badges, timestamp, user, resource, detail, IP - auditApi in api.ts - i18n keys for audit log (IT + EN) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>b59af0d
-
fix: resolve local dev issues found during first test run
Fabio Antonini +1: Claude Sonnet 4.6- Replace passlib with bcrypt directly (passlib 1.7 incompatible with bcrypt 4.x) - Fix SQLite engine config: disable pool_pre_ping, add check_same_thread=False - Import all models in __init__.py so SQLAlchemy resolves relationships - Change dev proxy port to 8001 (port 8000 occupied by Wacom service on dev machine) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>3d87cee -
feat: add FastAPI backend (Phase 1 — feature/backend)
Fabio Antonini +1: Claude Sonnet 4.6New backend/ package with 35 REST endpoints: - config.py: pydantic-settings (DB, MinIO, JWT, Ollama, CORS) - database.py: async SQLAlchemy engine + session dependency - models/user.py: User, Organization, Role (admin/examiner/viewer) - models/project.py: Project, Document, Analysis ORM models - auth/password.py: bcrypt hash/verify - auth/jwt.py: access token (30min) + refresh token (7d) - auth/dependencies.py: get_current_user(), require_role() - routers/auth.py: POST /auth/login|refresh|logout - routers/users.py: CRUD /users/ + /users/me - routers/projects.py: CRUD /projects/ + document upload/delete - routers/analysis.py: POST /analysis/{htr,sig,ner,writer,grapho,pipeline,dating} - routers/rag.py: streaming SSE /rag/chat + doc management - storage/minio_client.py: async MinIO wrapper (anyio thread offload) - main.py: FastAPI app with CORS, lifespan, health check - Dockerfile: backend container image - .env.example: environment variable template Also: - requirements-backend.txt: fast…76f414d