Skip to content

Commit

Permalink
feat: Change downloads to only work when logged in (#919)
Browse files Browse the repository at this point in the history
  • Loading branch information
canihavesomecoffee authored Nov 3, 2024
1 parent 410ae4a commit 1e3a9ac
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 0 deletions.
2 changes: 2 additions & 0 deletions mod_regression/controllers.py
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,7 @@ def toggle_active_status(regression_id):


@mod_regression.route('/test/<regression_test_output_id>/download', methods=['GET'])
@login_required
def test_result_file(regression_test_output_id):
"""View the output files of the regression test."""
rto = RegressionTestOutput.query.filter(RegressionTestOutput.id == regression_test_output_id).first()
Expand All @@ -213,6 +214,7 @@ def test_result_file(regression_test_output_id):


@mod_regression.route('/test/<regression_test_output_id>/download/variant', methods=['GET'])
@login_required
def multiple_test_result_file(regression_test_output_id):
"""View the output files of the regression test (variants)."""
rtof = RegressionTestOutputFiles.query.filter(RegressionTestOutputFiles.id == regression_test_output_id).first()
Expand Down
3 changes: 3 additions & 0 deletions mod_sample/controllers.py
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,7 @@ def sample_by_hash(sample_hash):


@mod_sample.route('/download/<sample_id>')
@login_required
def download_sample(sample_id):
"""
Download sample file.
Expand All @@ -190,6 +191,7 @@ def download_sample(sample_id):


@mod_sample.route('/download/<sample_id>/media-info')
@login_required
def download_sample_media_info(sample_id):
"""
Download sample file's media information as XML.
Expand All @@ -216,6 +218,7 @@ def download_sample_media_info(sample_id):


@mod_sample.route('/download/<sample_id>/additional/<additional_id>')
@login_required
def download_sample_additional(sample_id, additional_id):
"""
Download sample file's additional files and information.
Expand Down
1 change: 1 addition & 0 deletions mod_test/controllers.py
Original file line number Diff line number Diff line change
Expand Up @@ -371,6 +371,7 @@ def generate_diff(test_id: int, regression_test_id: int, output_id: int, to_view


@mod_test.route('/log-files/<test_id>')
@login_required
def download_build_log_file(test_id):
"""
Serve download of build log.
Expand Down

0 comments on commit 1e3a9ac

Please sign in to comment.