-
Notifications
You must be signed in to change notification settings - Fork 1
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
[LLSC-28] Create user endpoint #7
base: main
Are you sure you want to change the base?
Conversation
10bf32c
to
a564d75
Compare
5cd9bf3
to
5f8fb34
Compare
Once we get a llsc@uwblueprint.com email, we can make an actual Firebase project instead of each person making their own for setup/testing |
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.
First round of reviews, mostly naming and understanding.
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.
Another round of reviews, let me know when you can get around to this!
firebase_user = None | ||
try: | ||
# Create user in Firebase | ||
firebase_user = firebase_admin.auth.create_user( |
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.
I think we should eventually create another function or even another service to handle firebase interaction. The firebase error handling makes it hard to read this function.
@@ -83,7 +83,7 @@ def get_users(self): | |||
pass | |||
|
|||
@abstractmethod | |||
def create_user(self, user, auth_id=None, signup_method="PASSWORD"): | |||
def create_user(self, user, auth_id=None): |
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.
I'm assuming they added an option for adding SSO, let's actually keep this because imo SSO is easier and safer.
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.
Or let's aim to add this back in if we decide to add SSO.
Request schema for user creation with conditional password validation | ||
""" | ||
password: Optional[str] = Field(None, min_length=8) | ||
auth_id: Optional[str] = Field(None) |
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.
auth_id: Optional[str] = Field(None) | |
auth_id: Optional[str] = Field(None) # for signup with google sso |
Add a comment for clarity
from firebase_admin import credentials | ||
|
||
|
||
def initialize_firebase(): |
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.
add INFO level logs for starting and successful initialization of firebase.
lint lint
c9fb7f0
to
43228b6
Compare
Notion ticket link
[Create User endpoint (POST)] https://www.notion.so/uwblueprintexecs/Create-User-endpoint-POST-11410f3fb1dc8005b5e3f36238631399?pvs=4
Implementation description
User Creation Flow (app/services/implementations/user_service.py):
Schema and Model Updates (app/schemas/user.py, app/models/User.py)
Setup
To set this up, set up a Firebase console project > project settings > service accounts, generate a certificate and add in the fields used in utilities/firebase_init.py to the env
Checklist