CodeGrade / bottlenose

CS assignment / grade mangement system
GNU Affero General Public License v3.0
40 stars 21 forks source link

Separate Route for Public Resource Files #273

Open williams-jack opened 1 year ago

williams-jack commented 1 year ago
  1. Add a route get "resources/*path* that routes to FilesController#resource
  2. Add a class-wide dictionary to FilesController for the resources it can serve
  3. Each grader (CheckerGrader, JunitGrader, etc) can install its relevant files in that dictionary: the key is the path to be used, and the value is the absolute path to the resource in the filesystem
  4. FilesController#resource will use the dictionary as an allow-list of what resources to serve, and reject all other paths

Example usage: A CheckerGrader would send a job to Orca containing resources/tester.jar, resources/javalib.jar, files/...the instructor test files... and files/...the student submission.... The resources paths are static, and do not live in the same namespace (filesystem directory) as other uploaded files, hence the need for the new route.