When using http basic authentication, the endpoints receive the user as a parameter. This needed to be added to all password secured endpoints.
@@ -15,5 +15,5 @@ class ListJobs(View):
# pylint: disable=invalid-name
self.jobs = jobs
- def dispatch_request(self):
+ def dispatch_request(self, user: str):
return jsonify(self.jobs.list())
@@ -12,5 +12,5 @@ class ListLabelProviders(View):
methods = ['GET']
return jsonify(LabelProvider.query.all())
@@ -12,5 +12,5 @@ class ListModels(View):
return jsonify(Model.query.all())
@@ -12,5 +12,5 @@ class ListProjects(View):
return jsonify(Project.query.all())
@@ -14,7 +14,7 @@ class FolderInformation(View):
"""
methods = ['POST']
# extract request data
data = request.get_json(force=True)
@@ -19,7 +19,7 @@ class GetCroppedFile(View):
- def dispatch_request(self, file_id: int, resolution: str, crop_box: str):
+ def dispatch_request(self, user: str, file_id: int, resolution: str, crop_box: str):
# get file from database
file = File.get_or_404(file_id)
@@ -13,7 +13,7 @@ class GetFile(View):
# pylint: disable=arguments-differ
- def dispatch_request(self, file_id: int):
+ def dispatch_request(self, user: str, file_id: int):
abs_file_path = file.absolute_path
@@ -12,7 +12,7 @@ class GetPreviousAndNextFile(View):
@@ -18,7 +18,7 @@ class GetResizedFile(View):
- def dispatch_request(self, file_id: int, resolution: str):
+ def dispatch_request(self, user: str, file_id: int, resolution: str):
@@ -17,7 +17,7 @@ class RemoveFile(View):
self.nm = nm
@@ -28,7 +28,7 @@ class UploadFile(View):
self.extension = None
self.size = None
- def dispatch_request(self, project_id: int):
+ def dispatch_request(self, user: str, project_id: int):
# find project
project = Project.get_or_404(project_id)
@@ -17,7 +17,7 @@ class RemoveJob(View):
- def dispatch_request(self, job_id):
+ def dispatch_request(self, user: str, job_id):
@@ -20,7 +20,7 @@ class CreateLabel(View):
- def dispatch_request(self, project_id):
+ def dispatch_request(self, user: str, project_id):
name = data.get('name')
@@ -19,7 +19,7 @@ class EditLabelName(View):
- def dispatch_request(self, project_id: int, label_id: int):
+ def dispatch_request(self, user: str, project_id: int, label_id: int):
@@ -19,7 +19,7 @@ class EditLabelParent(View):
parent = data.get('parent')
@@ -12,7 +12,7 @@ class ListLabelTree(View):
@@ -12,7 +12,7 @@ class ListLabels(View):
@@ -19,7 +19,7 @@ class RemoveLabel(View):
@@ -22,7 +22,7 @@ class FitModel(View):
self.pipelines = pipelines
@@ -26,7 +26,7 @@ class PredictBoundingBox(View):
- def dispatch_request(self, file_id, bbox_id):
+ def dispatch_request(self, user: str, file_id, bbox_id):
# find file and result (=bounding box)
# We need the result to get (x,y,w,h)
@@ -25,7 +25,7 @@ class PredictFile(View):
- def dispatch_request(self, file_id):
+ def dispatch_request(self, user: str, file_id):
# find file
@@ -32,7 +32,7 @@ class PredictModel(View):
@@ -33,7 +33,7 @@ class CreateProject(View):
@@ -19,7 +19,7 @@ class EditProjectDescription(View):
description = data.get('description')
@@ -19,7 +19,7 @@ class EditProjectName(View):
@@ -27,7 +27,7 @@ class ExecuteExternalStorage(View):
@@ -25,7 +25,7 @@ class ExecuteLabelProvider(View):
@@ -12,7 +12,7 @@ class GetProjectModel(View):
@@ -13,7 +13,7 @@ class ListProjectCollections(View):
@@ -14,6 +14,7 @@ class ListProjectFiles(View):
def dispatch_request(self,
+ user: str,
project_id: int,
start: int = 0,
length: int = -1,
@@ -18,7 +18,7 @@ class RemoveProject(View):
@@ -16,7 +16,7 @@ class ConfirmResult(View):
- def dispatch_request(self, result_id: int):
+ def dispatch_request(self, user: str, result_id: int):
# find result
result = Result.get_or_404(result_id)
@@ -47,7 +47,7 @@ class CreateResult(View):
return result_type, label, data
@@ -18,7 +18,7 @@ class EditResultData(View):
@@ -18,7 +18,7 @@ class EditResultLabel(View):
@@ -13,7 +13,7 @@ class GetProjectResults(View):
# get project from database
@@ -12,7 +12,7 @@ class GetResults(View):
@@ -18,7 +18,7 @@ class RemoveResult(View):
@@ -18,7 +18,7 @@ class ResetResults(View):