Skip to content
This repository has been archived by the owner on Jul 21, 2021. It is now read-only.

Create a new endpoint for syllabus upload #13

Open
wants to merge 21 commits into
base: master
Choose a base branch
from

Conversation

ssantichaivekin
Copy link
Contributor

Install Firebase Admin and create a new endpoint for syllabus upload. The firebase private json file which includes the private key is with me. It might be a good idea to move Firebase initialization, all authentication logic, and all syllabi logic to a new worker.

ssantichaivekin and others added 21 commits March 7, 2020 16:42
Install firebase_admin and add the admin initialization to hyperschedule app.
Create upload syllabus endpoint that reads token from post request and get the user corresponding to the token from Firebase.
Install firebase_admin and add the admin initialization to hyperschedule app.
Create upload syllabus endpoint that reads token from post request and get the user corresponding to the token from Firebase.
Add input sanitization to syllabus upload endpoint. Clean up syllabus upload endpoint in general.
This solves the fetch API cannot load due to access control error.
Add OPTIONS to /upload-syllabus methods to fix access control problem
Update syllabus links at the start of the server by looking at metadata of all files in storage bucket. Update syllabus link of a course when its course syllabus is uploaded. Merge syllabus links with json data after scraping.
@@ -90,6 +92,33 @@ def view_api_v3():
raise APIError("data not available yet")
return api_response({"data": diff, "until": until, "full": full})

@app.route("/upload-syllabus", methods = ['PUT', 'POST', 'OPTIONS'])
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should only include PUT and OPTIONS. Remove POST from the list of methods.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants