Auth: Phase 1 — add User model, login/register/change-password, tests and fixes#3
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
This PR implements Phase 1 of authentication for RadioChWeb, introducing user registration, login, logout, and password change functionality. The implementation uses Flask-Login for session management and passlib with pbkdf2_sha256 for password hashing.
Key Changes
- Added complete authentication layer with User model, UserRepository, and AuthService
- Created login, registration, and change-password routes with WTForms validation
- Integrated authentication UI into the main navigation and created dedicated auth templates
- Updated migration system to support pyway CLI with fallback to direct SQL execution
Reviewed changes
Copilot reviewed 22 out of 23 changed files in this pull request and generated 18 comments.
Show a summary per file
| File | Description |
|---|---|
| model/entity/user.py | New User entity with Flask-Login integration and role-based fields |
| model/repository/user_repository.py | Repository for User CRUD operations |
| service/auth_service.py | Authentication service handling password hashing/verification and LoginManager initialization |
| route/auth_route.py | Auth blueprint with login/register/logout/change-password endpoints |
| templates/user/*.html | Login, registration, and change-password forms using Bootstrap |
| templates/index.html | Updated navigation with conditional auth links and flash message display |
| migrate_db/migrations/V8_0__create_users_table.sql | Migration creating users table |
| migrate_db/migrate.py | Enhanced migration runner with pyway CLI support |
| tests/unit/test_auth_service.py | Unit test for password hashing round-trip |
| tests/integration/test_auth_flow.py | Integration test for complete register/login/logout flow |
| tests/integration/test_smoke_auth_pages.py | Smoke test verifying auth pages render correctly |
| tests/unit/test_proposal_update.py | Fixed to support both 'image' and 'image_url' form fields |
| route/proposal_route.py | Updated to accept both 'image' and 'image_url' from forms |
| app.py | Registered auth blueprint and initialized AuthService |
| requirements.txt | Added passlib[bcrypt] dependency |
| ARCHITECTURE.md | Updated documentation reflecting auth implementation and migration approach |
| specs/feature/feat-auth-layer.md | Cleaned up formatting and corrected specification details |
|
@diamond2016 I've opened a new pull request, #4, to work on those changes. Once the pull request is ready, I'll request review from you. |
Co-authored-by: diamond2016 <17258319+diamond2016@users.noreply.github.com>
Fix typo and add missing dependencies for Auth Phase 1
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.
It is ok to merge I call for a code review