-
-
Notifications
You must be signed in to change notification settings - Fork 50
User refactor + remove fastapi_users dependency + update fastapi #1290
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
Implements a forked custom user router to make the change, since overriding fastapi endpoints is not straightforward.
update model to contain 'password' and 'newPassword' frontend: match model
update tests
…tion + decoding move auth functionality to auth.py
- move relevant functions from fastapi_user manager to users - update modules - remove fastapi_users, update to latest fastapi! - still more cleanup needed, simplification where possible
- keep pydantic at 1.x for now (made some model changes that are forward compatible with 2.0) - ensure users uses _id not id similar to all other objects (will need migration) - remove userdb, move db functions into users - remove generic _update, add update_verified, update_password, update_email - webhooks: add webhooks for openapi!
- remove references to 'user_db' - unify 'get_id' / 'get_user_by_id' to just 'get_by_id' - fix 'id' -> '_id' reference
remove is_active from model, check for 'id' on frontend instead of unused 'is_active'
…for backwards compatibility
tw4l
reviewed
Oct 17, 2023
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.
Initial comments, testing locally now
Manually tested:
Aside from the comment about using |
tw4l
approved these changes
Oct 17, 2023
- fix doc strings - add user.update_invites() when removing an invite - fix logic for printing when superuser password has changed
ikreymer
added a commit
that referenced
this pull request
Oct 27, 2023
… with fastapi-users follow up to #1290
ikreymer
added a commit
that referenced
this pull request
Oct 27, 2023
… with fastapi-users (#1319) follow up to #1290 Based on implementation in: https://github.com/fastapi-users/fastapi-users-db-mongodb/blob/main/fastapi_users_db_mongodb/__init__.py
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.
Fixes #1050
Major refactor of the user/auth system to remove fastapi_users dependency. Refactors users.py to be standalone
and adds new auth.py module for handling auth. UserManager now works similar to other ops classes.
Also includes:
Branch based off #1272 work, and may supersede it fully.
The auth should be fully backwards compatible with fastapi_users auth, including accepting previous JWT tokens w/o having to re-login. The User data model in mongodb is also unchanged.
API changes:
GET, PATCH, DELETE /users/<id>
endpoints, which were not in used before, as users are scoped to orgs. For deletion, probably auto-delete when user is removed from last org (to be implemented)./users/me-with-orgs
is renamed to just/users/me/