-
Notifications
You must be signed in to change notification settings - Fork 13
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
Flask login #68
Flask login #68
Conversation
TheoLechemia
commented
Jun 12, 2023
•
edited
Loading
edited
- Utilisation de flask-login : corrige une faille de sécurité sur les cookie (#2574)
- Ajout de la possibilité de passer le token d'authentification via le header HTTP Authorization Bearer
- La route /login renvoie le token dans le body pour qu'il puisse être récupérer en frontend
- Le support de l'authentification via cookie est maintenu (pour UsersHub)
- Suppression de la fonctionnalité de renouvellement automatique du cookie (qui était non fonctionnelle depuis plusieurs versions)
Codecov ReportAttention:
... and 2 files with indirect coverage changes 📢 Thoughts on this report? Let us know!. |
4ac6c53
to
008ed5b
Compare
@@ -15,6 +17,12 @@ | |||
} | |||
|
|||
|
|||
@pytest.fixture(autouse=True) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👌
src/pypnusershub/decorators.py
Outdated
def decorated_view(*args, **kwargs): | ||
if not current_user.is_authenticated: | ||
raise Unauthorized | ||
if current_user.max_level_profil < level: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
dépend de current_app
src/pypnusershub/routes.py
Outdated
value=token, | ||
expires=cookie_exp, | ||
return Response(msg, status=400) | ||
user = models.User.query.filter(models.User.identifiant == login).one() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cool de plus utiliser AppUser
, mais il me semble encore nécessaire de checker l’app et le profile associé non ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oui
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
2ba8bfe
to
1040edb
Compare
- remove home made cookie management - support of HTTP Header JWT for authentification
1040edb
to
3238be3
Compare