-
Notifications
You must be signed in to change notification settings - Fork 0
Create login feature with password authentication in the controller #14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
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
… Upgrade SQLAlchemy integration
… Create a login page with username/password authentication, we will improve the code later
… Add comments explaining how to include a file that is not part of the repository
… Correct the lint
…Refactor the code to move variables into configuration_variables.py, also Base from models.py will be used in the new file
… Change the variable name and initialize its value inside if __name__ == "main" to improve readability
… Rename some functions for better readability, fix lint issues and update printed messages to English
… Rename the file and change the blueprint name to be more readable
… Update integration tests by modifying conftest.py and refactoring factories into a dedicated file to prepare for implementing login tests
1430a85 to
cca405d
Compare
… Add PostgreSQL health checks, Poetry cache to improve CI speed and add TEST_SECRET_KEY
… Prevent missing env var errors by providing dummy DATABASE_URL and SECRET_KEY during test runs
… Create a Python configuration to load environment variables from .env and .env.test, placed outside the MVC architecture
… Create a Python file outside the MVC architecture to connect to the production or test database. Add robust detection of pytest execution using PYTEST_CURRENT_TEST or 'pytest' in sys.modules to automatically switch to the test database in database.py and __init__.py.
… Update variables to align with the new changes
raynaldlao
approved these changes
Feb 7, 2026
raynaldlao
added a commit
that referenced
this pull request
Feb 8, 2026
Create login feature with password authentication in the controller
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.
Dans le but de développer une première version de l'authentification, nous avons créé :
un fichier contrôleur "auth.py" qui fait le lien entre les informations de la base de données récupérées via le modèle et les informations entrées dans le formulaire via la vue
un fichier vue "login.html" qui affiche un simple formulaire qui permet à l'utilisateur d'entrer son login et son mot de passe pour se connecter au blog.
un fichier "run.py" qui permet le lancement de l'application dans le navigateur
la version de SQLAlchemy a été mis à jour
le fichier "database.py" permet la connexion à la base de données.
Il faudra ajouter dans le fichier .env et .env.test une clé secrète que nous avons généré avec Python.
Mise à jour du code :
séparation de la DB dans l'application pour le mettre en dehors afin de permettre la connexion en test et en prod
les variables d'environnement sont gérés en dehors de l'application avec le dossier configurations avec configuration_variables
modification du nom des fichiers avec auth.py en login.py et database.py en database_setup.py
modification des tests avec conftest.py et ajout de test_login.py, mais aussi d'un ajout avec fichier factories.py pour permettre de gérer les données tests
Le code du contrôleur va avoir une deuxième version plus tard, l'objectif est surtout de poser une architecture suffisamment solide pour permettre l'ajout d'une prochaine feature.