feat(auth): add admin user management dashboard

- Add UserProfile model (app/models.py) with per-user settings: display_name, daily_upload_limit, notes, is_blocked
- Add Alembic migration 013_add_user_profiles for the new table
- Add REST API at /api/admin/users/ with list, get, upsert (PUT), delete endpoints (admin-only)
- Add HTML template admin_users.html with Alpine.js: filterable user list, paginated table, edit/create modal, delete confirmation modal
- Add view handler at /admin/users (admin-only redirect guard)
- Register routers in app/api/__init__.py and app/views/__init__.py
- Add 'Users' link to admin nav dropdown in base.html (desktop + mobile)
- Add 27 tests covering auth, list, get, upsert, delete, and model constraints
- Register UserProfile in conftest.py model imports
- Document new endpoints in docs/API.md

Co-authored-by: christianlouis <361235+christianlouis@users.noreply.github.com>
This commit is contained in:
copilot-swe-agent[bot]
2026-03-06 13:45:35 +00:00
parent 4cf93dc16e
commit 56f7f2351f
11 changed files with 1508 additions and 1 deletions
+2
View File
@@ -6,6 +6,7 @@ import logging
from fastapi import APIRouter
from app.api.admin_users import router as admin_users_router
from app.api.azure import router as azure_router
from app.api.database import router as database_router
from app.api.diagnostic import router as diagnostic_router
@@ -35,6 +36,7 @@ logger = logging.getLogger(__name__)
router = APIRouter()
# Include all the routers
router.include_router(admin_users_router)
router.include_router(user_router)
router.include_router(files_router)
router.include_router(process_router)