Skip to content

Comments

Introduce UPLOAD_FILES_WHITELIST#581

Open
MarcelGeo wants to merge 3 commits intomasterfrom
upload-allowed-files
Open

Introduce UPLOAD_FILES_WHITELIST#581
MarcelGeo wants to merge 3 commits intomasterfrom
upload-allowed-files

Conversation

@MarcelGeo
Copy link
Collaborator

  • this file paths will be ignored during files extensions and mime type checks

- this file paths will be ignored during files extensions and mime type checks
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds an upload file-path whitelist intended to bypass forbidden extension and MIME type checks for specific, configured paths.

Changes:

  • Introduces Configuration.UPLOAD_FILES_WHITELIST in sync configuration.
  • Adds check_skip_validation() and integrates it into is_supported_extension() and is_supported_type().
  • Adds tests covering whitelist behavior (extension + intended MIME-type skip).

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.

File Description
server/mergin/sync/config.py Adds UPLOAD_FILES_WHITELIST configuration option.
server/mergin/sync/utils.py Implements whitelist check and uses it to bypass extension/MIME validation.
server/mergin/tests/test_utils.py Adds unit tests for whitelist behavior.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@coveralls
Copy link

coveralls commented Feb 16, 2026

Pull Request Test Coverage Report for Build 22343554432

Details

  • 29 of 29 (100.0%) changed or added relevant lines in 3 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.02%) to 94.417%

Totals Coverage Status
Change from base Build 21908954703: 0.02%
Covered Lines: 8185
Relevant Lines: 8669

💛 - Coveralls

Copy link
Contributor

@harminius harminius left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Clean and concise. 👍

MarcelGeo and others added 2 commits February 24, 2026 09:52
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants