Skip to content

Make shadow-API file-extension matching case-insensitive - #320

Merged
squid-protocol merged 1 commit into
mainfrom
fix/shadow-api-case-insensitive-suffix
Jul 23, 2026
Merged

squid-protocol merged 1 commit into
mainfrom
fix/shadow-api-case-insensitive-suffix

Conversation

@squid-protocol

Copy link
Copy Markdown
Owner

Summary

  • auto_discover_swagger (line 133) and map_physical_codebase (line 205) in full_api_network_map.py both compared Path.suffix directly against lowercase literal lists, with no .lower().
  • Files like Routes.JS, api.PY, or Config.YAML were 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_swagger already 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

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]>
@github-actions

Copy link
Copy Markdown
Contributor

🐦‍⬛ Muninn Security Scan

✅ No security issues found.

🐦‍⬛ Powered by Muninn · Skald Lab

@squid-protocol
squid-protocol merged commit 83c3634 into main Jul 23, 2026
22 checks passed
@squid-protocol
squid-protocol deleted the fix/shadow-api-case-insensitive-suffix branch July 23, 2026 13:04
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.

full_api_network_map.py shadow-API discovery is case-sensitive, silently excludes uppercase-extension files

1 participant