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.
Add SMP encoders service and environment-driven Django settings with security defaults #913
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Uh oh!
There was an error while loading. Please reload this page.
Add SMP encoders service and environment-driven Django settings with security defaults #913
Changes from all commits
678f259File filter
Filter by extension
Conversations
Uh oh!
There was an error while loading. Please reload this page.
Jump to
Uh oh!
There was an error while loading. Please reload this page.
There are no files selected for viewing
Check warning on line 45 in FARM/FARM/settings.py
FARM/FARM/settings.py#L45
Check notice
Code scanning / Bandit
Possible hardcoded password: 'dev-insecure-key-change-me' Note
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The
SECURE_BROWSER_XSS_FILTERsetting was deprecated in Django 3.0 and removed in Django 4.0. Since this project is using Django 6.0.1 (as indicated in the file header), this setting is obsolete and has no effect. It should be removed to avoid configuration clutter.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Turning
SECURE_SSL_REDIRECTon by default in non-debug mode can break deployments behind a TLS-terminating reverse proxy, because Django will see backend traffic as HTTP unlessSECURE_PROXY_SSL_HEADERis configured. In that setup, every request is treated as insecure and redirected again, causing redirect loops and an effectively unavailable app; this change introduces that risk for any non-debug environment that doesn’t explicitly override the new default.Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Importing a heavy library like
segmentation_models_pytorchinside anasyncrequest handler is inefficient and can block the FastAPI event loop, especially during the first call when the module is actually loaded. Since the list of encoders is static for a given installation, it should be imported and computed once at the module level or cached. Additionally, catching a genericExceptionis too broad; it's better to specifically catchImportErrororAttributeErrorto handle missing optional dependencies.Check notice on line 77 in MAGE/tests/test_main.py
MAGE/tests/test_main.py#L77
Uh oh!
There was an error while loading. Please reload this page.