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

Protect endpoints #891

Open
wants to merge 28 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,6 @@ courses20.xml
compose-dev.yaml
rpi_data/get-summer-2023-2.sh
rpi_data/summer-20232.csv
.venv/
bin/
lib/
2 changes: 1 addition & 1 deletion conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
from src.api.db.classinfo import ClassInfo
from src.api.db.courses import Courses
from src.api.db.admin import Admin
from src.api.db.semester_info import semester_info as SemesterInfo
from src.api.db.SemesterInfo import semester_info as SemesterInfo
from src.api.db.semester_date_mapping import semester_date_mapping as SemesterDateMapping
# from src.api.db.student_course_selection import student_course_selection
# from src.api.db.user import User
Expand Down
3 changes: 3 additions & 0 deletions pyvenv.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
home = /Library/Developer/CommandLineTools/usr/bin
include-system-site-packages = false
version = 3.9.6
24 changes: 24 additions & 0 deletions rpi_data/modules/post_test.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
import requests
import base64
import os

url = os.environ.get('yacs_url')
url = "http://localhost:5000"
api_location = url + "/api/bulkCourseUpload"
__location__ = os.path.realpath(os.path.join(
os.getcwd(), os.path.dirname(__file__)))


def csvUpload(fileName):
endpath = os.path.join(__location__, fileName)
endpath = os.path.dirname(os.path.dirname(endpath)) + "\\" + fileName
print(endpath)
uploadFile = {'file': open(endpath, 'rb')}
data = {'isPubliclyVisible': 'on'}

r = requests.post(api_location, files=uploadFile, data=data)
print(r.reason, r.status_code)


if __name__ == "__main__":
csvUpload("spring-2022.csv")
1 change: 1 addition & 0 deletions src/api/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
RUN mkdir -p /usr/src
WORKDIR /usr/src
COPY ./requirements.txt /usr/src/
RUN apt-get update && apt-get install -y libpq-dev build-essential

Check notice on line 6 in src/api/Dockerfile

View check run for this annotation

codefactor.io / CodeFactor

src/api/Dockerfile#L6

Delete the apt-get lists after installing something. (DL3009)
RUN pip install --no-cache-dir -r requirements.txt
COPY . /usr/src/

Expand Down
Loading