MNT: Remove deprecated NB_API_ALLOWED_ORIGINS variable #410#540
Open
AviJxn wants to merge 1 commit intoneurobagel:mainfrom
Open
MNT: Remove deprecated NB_API_ALLOWED_ORIGINS variable #410#540AviJxn wants to merge 1 commit intoneurobagel:mainfrom
AviJxn wants to merge 1 commit intoneurobagel:mainfrom
Conversation
Reviewer's guide (collapsed on small PRs)Reviewer's GuideRemoves all support for the deprecated NB_API_ALLOWED_ORIGINS setting, including configuration, CORS middleware, helper utilities, and associated tests, and cleans up related lint issues. Class diagram for updated Settings model without NB_API_ALLOWED_ORIGINSclassDiagram
class Settings {
<<BaseSettings>>
str api_root_path
str|None graph_username
str|None graph_password
str graph_address
}
File-Level Changes
Assessment against linked issues
Possibly linked issues
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
This PR implements the removal of the deprecated NB_API_ALLOWED_ORIGINS environment variable as discussed in issue #410. Since the API no longer connects to a node API with frontend tools, this configuration is no longer required.
Changes:
Settings: Removed allowed_origins from the Settings model in app/api/env_settings.py.
Middleware: Removed CORSMiddleware and its associated logic from app/main.py.
Utilities: Deleted the orphaned parse_origins_as_list helper function in app/api/utility.py.
Tests: Removed deprecated test cases in tests/test_app_events.py and updated tests/test_settings.py to reflect the change.
Linting: Cleaned up unused imports and verified formatting with pre-commit hooks (Black, Flake8, isort).
Testing:
Successfully ran pytest locally with all 141 tests passing.
Verified that the API starts correctly without the NB_API_ALLOWED_ORIGINS variable.
Fixes: #410
Summary by Sourcery
Remove deprecated configuration and CORS handling related to NB_API_ALLOWED_ORIGINS.
Enhancements:
Tests: