Skip to content
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

Expanded user coverage #22

Merged
merged 2 commits into from
Jul 1, 2022
Merged

Expanded user coverage #22

merged 2 commits into from
Jul 1, 2022

Conversation

webbpinner
Copy link
Contributor

I'm just learning about FastAPI and this project was incredibly useful!

PR Summary:

Expanded tests of user routes to increase coverage
Moved "/user/me" route to "/profile"
Added check to avoid 500 error when adding a username already in the db
Added refresh_token mechanism and associated tests

Found the same bugs listed on a previous PR. While expanding the tests for the user route I found the ordering bug listed in another PR. I started by re-ordering the functions but ultimately decided the "/user/me" route was too risky (for me) i.e. a user is created with the username of "me"... thus I elected to move the route from /user/me to /profile.

Added a JWT refresh_token mechanism that I'm going to need for my next project. This includes the new /refesh_token POST route for updating the the access_token. The access_token now includes a boolean "fresh" value in the JWT to indicated if it was issued based on a /token request or by the refresh_token request. Added a new depends (AuthenticatedFreshUser) to require that the user must have a "fresh" access_token or be a superuser.

Expanded tests of user routes to increase coverage
Moved "/user/me" route to /profile
Added check to avoid 500 error when adding a username already in the db
Added refresh_token mechanism and associated tests
@rochacbruno rochacbruno merged commit 755d70f into rochacbruno:main Jul 1, 2022
@webbpinner webbpinner deleted the expanded_user_converage branch July 18, 2022 10:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants