Repository navigation
Make shadow-API file-extension matching case-insensitive - #320
Merged
Merged
Conversation
Fixes #317. Both auto_discover_swagger's suffix check and map_physical_codebase's per-framework extension check compared Path.suffix directly against lowercase literals, so files like Routes.JS, api.PY, or Config.YAML were silently skipped by Swagger/ OpenAPI discovery and route-signature scanning -- letting real endpoints slip past the shadow-API diff. parse_official_swagger already did suffix.lower() correctly; applied the same pattern here. Co-Authored-By: Claude Sonnet 5 <[email protected]>
Contributor
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.
Summary
auto_discover_swagger(line 133) andmap_physical_codebase(line 205) infull_api_network_map.pyboth comparedPath.suffixdirectly against lowercase literal lists, with no.lower().Routes.JS,api.PY, orConfig.YAMLwere silently excluded from both Swagger/OpenAPI spec discovery and the physical-codebase API-endpoint extraction that the shadow-API diff depends on — a real endpoint could go undetected purely because of filename casing.parse_official_swaggeralready did this correctly (swagger_path.suffix.lower()at line 168), confirming the two unguarded sites were an oversight. Applied the same.lower()pattern at both.Fixes #317
Test plan
python -m pytest tests/security_auditing/test_api_network_map.py -q— 16 passed