Skip to content

Commit

Permalink
Merge pull request #754 from Lunatic-Labs/SKIL-517
Browse files Browse the repository at this point in the history
SKIL-517
  • Loading branch information
aparriaran authored Nov 5, 2024
2 parents 83e13b3 + fe87e07 commit 24684a2
Show file tree
Hide file tree
Showing 10 changed files with 35 additions and 4 deletions.
5 changes: 5 additions & 0 deletions BackEndFlask/controller/Routes/Bulk_upload_routes.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,13 @@
import os
import shutil
from controller.Route_response import create_bad_response, create_good_response
from flask_jwt_extended import jwt_required
from controller.security.CustomDecorators import AuthCheck, bad_token_check

@bp.route('/bulk_upload', methods = ['POST'])
@jwt_required()
@bad_token_check()
@AuthCheck()
def upload_CSV():
try:
file = request.files['csv_file']
Expand Down
6 changes: 6 additions & 0 deletions BackEndFlask/controller/Routes/Checkin_routes.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@
CHECK_IN_REDIS_CHANNEL = "check_in_updated"

@bp.route('/checkin', methods = ['POST'])
@jwt_required()
@bad_token_check()
@AuthCheck()
def checkin_user():
# needs json with AT id, user id, and team id
try:
Expand All @@ -40,6 +43,9 @@ def checkin_user():
return create_bad_response(f"An error occurred checking in user: {e}", "checkin", 400)

@bp.route('/checkin', methods = ['GET'])
@jwt_required()
@bad_token_check()
@AuthCheck()
def get_checked_in():
# given an asessment task id, return checked in information
try:
Expand Down
3 changes: 3 additions & 0 deletions BackEndFlask/controller/Routes/Course_routes.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,9 @@ def get_all_courses():


@bp.route('/course', methods=['GET'])
@jwt_required()
@bad_token_check()
@AuthCheck()
def get_one_course():
try:
course_id = int(request.args.get("course_id"))
Expand Down
5 changes: 5 additions & 0 deletions BackEndFlask/controller/Routes/Feedback_routes.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,14 @@
from controller import bp
from controller.Route_response import *
from datetime import datetime
from flask_jwt_extended import jwt_required
from controller.security.CustomDecorators import AuthCheck, bad_token_check


@bp.route("/feedback", methods=["POST"])
@jwt_required()
@bad_token_check()
@AuthCheck()
def create_new_feedback():
try:
feedback_data = request.json
Expand Down
1 change: 0 additions & 1 deletion BackEndFlask/controller/Routes/Logout_route.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
from controller import bp
from controller.Route_response import *
from controller.security.blacklist import blacklist_token
from controller.security.CustomDecorators import AuthCheck, bad_token_check
from controller.security.utility import(
revoke_tokens,
token_expired,
Expand Down
8 changes: 8 additions & 0 deletions BackEndFlask/controller/Routes/Rating_routes.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,13 @@
from controller.Route_response import *
from models.completed_assessment import *
from models.queries import get_individual_ratings
from flask_jwt_extended import jwt_required
from controller.security.CustomDecorators import AuthCheck, bad_token_check

@bp.route("/rating", methods=["GET"])
@jwt_required()
@bad_token_check()
@AuthCheck()
def get_student_individual_ratings():
"""
Description:
Expand Down Expand Up @@ -45,6 +50,9 @@ def get_student_individual_ratings():


@bp.route("/rating", methods=["POST"])
@jwt_required()
@bad_token_check()
@AuthCheck()
def student_view_feedback():
"""
Description:
Expand Down
1 change: 0 additions & 1 deletion BackEndFlask/controller/Routes/Refresh_route.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
from controller.Route_response import *
from flask_jwt_extended import jwt_required, create_access_token
from controller.security.CustomDecorators import AuthCheck, bad_token_check
from controller.security.CustomDecorators import AuthCheck, bad_token_check

@bp.route('/refresh', methods=['POST'])
@jwt_required(refresh=True)
Expand Down
1 change: 0 additions & 1 deletion BackEndFlask/controller/Routes/Signup_route.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
from models.user import get_user_by_email
from controller.Route_response import *
from controller.Routes.User_routes import UserSchema
from controller.security.CustomDecorators import AuthCheck, bad_token_check

@bp.route('/signup', methods=['POST'])
def register_user():
Expand Down
6 changes: 5 additions & 1 deletion BackEndFlask/controller/Routes/Team_bulk_upload_routes.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,13 @@
from Functions import teamBulkUpload
from Functions import customExceptions
from controller.Route_response import *

from flask_jwt_extended import jwt_required
from controller.security.CustomDecorators import AuthCheck, bad_token_check

@bp.route('/team_bulk_upload', methods=['POST'])
@jwt_required()
@bad_token_check()
@AuthCheck()
def upload_team_csv():
try:
file = request.files['csv_file']
Expand Down
3 changes: 3 additions & 0 deletions BackEndFlask/controller/Routes/Team_routes.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,9 @@ def get_one_team():
return create_bad_response(f"An error occurred fetching a team: {e}", "teams", 400)

@bp.route('/team/nonfull-adhoc', methods = ["GET"])
@jwt_required()
@bad_token_check()
@AuthCheck()
def get_nonfull_adhoc_teams():
# given an assessment task id, return list of team ids that have not reached the max team size
try:
Expand Down

0 comments on commit 24684a2

Please sign in to comment.