v0.6.0-beta: add local user management, roles, session auth and RBAC protection - #41
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation
SECRET_KEY,COOKIE_SECURE) in system status and provide an initial admin setup flow for first-run deployments.Description
userstable,created_by_user_idonchecksandreports, andaudit_logtable; seebackend/app/models.pyand migrationbackend/alembic/versions/0002_users_and_report_ownership.py.backend/app/core/security.pyand a signed cookie session implementation plus role dependencies inbackend/app/core/auth.py(token payload containsuser_id,username,role,exp).backend/app/api/routes_auth.pyfor setup/login/logout/me and admin user management inbackend/app/api/routes_users.py; protect existing endpoints with role checks inbackend/app/api/routes_checks.py,backend/app/api/routes_reports.py, andbackend/app/api/routes_system.py.SECRET_KEY,SESSION_COOKIE_NAME,SESSION_EXPIRE_HOURS,COOKIE_SECUREinbackend/app/config.pyand.env.example; security warnings extended inbackend/app/core/system_status.py.0.6.0inbackend/pyproject.toml, frontend/user-facing strings tov0.6.0-beta, and frontend build artifacts updated;frontendbuild entry remains compatible.Testing
cd backend && pytest -q; result:64tests passed and13tests failed (these failures relate to adapting the existing API smoke tests to the new protected endpoint behavior and will be addressed in follow-up test updates).cd frontend && npm run buildand the production build completed successfully.0002_users_and_report_ownership.pyexists and is importable in the project; database migration behavior tested for compatibility with SQLite/ PostgreSQL via the migration script structure.Codex Task