#38: Ingest an instrument from a URL #75
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
util/url_loader.py
includes back-end functionality for securely downloading and validating files (PDF, .xlsx, .txt, CSV, and .docx) from user-provided URLs. Implementation ensures that all downloads adhere to security, compliance, and performance standards. It includes URL validation, rate limiting, SSL validation, and content & file size checks to prevent abuse and maintain system integrity.Fixes #38
Type of change
Testing
I added tests in
test_url_loader.py
and utilized Mock objects to simulate responses and test edge cases effectively.Since the Harmony Python package is used by the Harmony API (which is itself used by the R library and the web app), we need to avoid making any changes that break the Harmony API. Please also run the Harmony API unit tests and check that the API still runs with your changes to the Python package: https://github.com/harmonydata/harmonyapi
Test Configuration
Checklist
requirements.txt
,pyproject.toml
and also in therequirements.txt
in the API repo