generated from cs130-w22/template
-
Notifications
You must be signed in to change notification settings - Fork 0
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
Implement POST /user
, POST /login
, JWT-based authorization
#31
Merged
Conversation
This file contains 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
* Move class-related endpoints to /class. * Add docs to README.md. Co-authored-by: pkrish20 <preethask@g.ucla.edu> Co-authored-by: svetly-t <svetly-t@users.noreply.github.com>
krashanoff
added
backend
Concerning the backend
documentation
Concerning documentation
labels
Feb 1, 2022
krashanoff
changed the title
Implement
Implement Feb 3, 2022
POST /user
, scaffold JWT-based authorizationPOST /user
, POST /login
, JWT-based authorization
* Add doc comments throughout. * Improve feedback for login failures, etc. * Reformat SQL queries for readability.
svetly-t
reviewed
Feb 7, 2022
backend/main.py
Outdated
"-s", | ||
"--secret", | ||
type=str, | ||
default="gradbetter", |
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.
Nit this was probably supposed to be "gradebetter"
.
svetly-t
approved these changes
Feb 7, 2022
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.
Besides a minor string nitpick, everything looks good to me.
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.
This PR, based on #30, implements the "create user" endpoint on the backend. Users can create an account in the backend database, and are returned a JSON Web Token, to be included in the
Authorization
header of future transactions. It closes #22. It also adds thePOST /login
endpoint for users to log in, closing #20.The final change in this PR just changes the default RDBMS login string in our main function to reflect the variables used in our
Dockerfile
.Its specification is outlined in our backend documentation as such:
POST /user
Login as an user, returning a JWT for future requests. Please please please only send this on TLS.
Request Body
Response Format
POST /login
Login as an user, returning a JWT for future requests. Please please please only
send this on TLS.
Request Body
Response Format