apisec-surface 0.1.13__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (414) hide show
  1. apisec_surface-0.1.13/.gitignore +54 -0
  2. apisec_surface-0.1.13/PKG-INFO +541 -0
  3. apisec_surface-0.1.13/README.md +490 -0
  4. apisec_surface-0.1.13/pyproject.toml +164 -0
  5. apisec_surface-0.1.13/src/apisec_code_bolt/__init__.py +48 -0
  6. apisec_surface-0.1.13/src/apisec_code_bolt/__main__.py +11 -0
  7. apisec_surface-0.1.13/src/apisec_code_bolt/analysis/__init__.py +96 -0
  8. apisec_surface-0.1.13/src/apisec_code_bolt/analysis/analyzer.py +3518 -0
  9. apisec_surface-0.1.13/src/apisec_code_bolt/analysis/binding_tracker.py +384 -0
  10. apisec_surface-0.1.13/src/apisec_code_bolt/analysis/boundary_detection.py +809 -0
  11. apisec_surface-0.1.13/src/apisec_code_bolt/analysis/call_graph.py +1397 -0
  12. apisec_surface-0.1.13/src/apisec_code_bolt/analysis/call_graph_types.py +332 -0
  13. apisec_surface-0.1.13/src/apisec_code_bolt/analysis/call_resolver.py +1155 -0
  14. apisec_surface-0.1.13/src/apisec_code_bolt/analysis/capability_tagger.py +322 -0
  15. apisec_surface-0.1.13/src/apisec_code_bolt/analysis/config_scanner.py +781 -0
  16. apisec_surface-0.1.13/src/apisec_code_bolt/analysis/container_facts.py +320 -0
  17. apisec_surface-0.1.13/src/apisec_code_bolt/analysis/data_flow.py +1972 -0
  18. apisec_surface-0.1.13/src/apisec_code_bolt/analysis/dependency_extractor.py +3539 -0
  19. apisec_surface-0.1.13/src/apisec_code_bolt/analysis/flow_analysis.py +1406 -0
  20. apisec_surface-0.1.13/src/apisec_code_bolt/analysis/hof_catalog.py +61 -0
  21. apisec_surface-0.1.13/src/apisec_code_bolt/analysis/integration_detector.py +1864 -0
  22. apisec_surface-0.1.13/src/apisec_code_bolt/analysis/js_gradle_locks.py +277 -0
  23. apisec_surface-0.1.13/src/apisec_code_bolt/analysis/legacy_contract.py +210 -0
  24. apisec_surface-0.1.13/src/apisec_code_bolt/analysis/literal_scanner.py +579 -0
  25. apisec_surface-0.1.13/src/apisec_code_bolt/analysis/manifest_partitioner.py +500 -0
  26. apisec_surface-0.1.13/src/apisec_code_bolt/analysis/parse_index.py +87 -0
  27. apisec_surface-0.1.13/src/apisec_code_bolt/analysis/path_normalizer.py +55 -0
  28. apisec_surface-0.1.13/src/apisec_code_bolt/analysis/path_resolution_ladder.py +73 -0
  29. apisec_surface-0.1.13/src/apisec_code_bolt/analysis/read_site_detector.py +326 -0
  30. apisec_surface-0.1.13/src/apisec_code_bolt/analysis/request_patterns.py +168 -0
  31. apisec_surface-0.1.13/src/apisec_code_bolt/analysis/route_like.py +23 -0
  32. apisec_surface-0.1.13/src/apisec_code_bolt/analysis/secret_patterns.py +404 -0
  33. apisec_surface-0.1.13/src/apisec_code_bolt/analysis/secrets_policy.py +246 -0
  34. apisec_surface-0.1.13/src/apisec_code_bolt/analysis/sensitivity_classifier.py +249 -0
  35. apisec_surface-0.1.13/src/apisec_code_bolt/analysis/sink_evidence.py +333 -0
  36. apisec_surface-0.1.13/src/apisec_code_bolt/analysis/surface_enrichment.py +519 -0
  37. apisec_surface-0.1.13/src/apisec_code_bolt/analysis/surface_ledger.py +146 -0
  38. apisec_surface-0.1.13/src/apisec_code_bolt/analysis/surface_reconciliation.py +68 -0
  39. apisec_surface-0.1.13/src/apisec_code_bolt/analysis/template_scanner.py +1020 -0
  40. apisec_surface-0.1.13/src/apisec_code_bolt/analysis/tree_resolver.py +203 -0
  41. apisec_surface-0.1.13/src/apisec_code_bolt/analysis/unsupported_frameworks.py +422 -0
  42. apisec_surface-0.1.13/src/apisec_code_bolt/analysis/url_prefix_resolver.py +985 -0
  43. apisec_surface-0.1.13/src/apisec_code_bolt/analysis/version_resolver.py +366 -0
  44. apisec_surface-0.1.13/src/apisec_code_bolt/cli/__init__.py +5 -0
  45. apisec_surface-0.1.13/src/apisec_code_bolt/cli/exit_codes.py +18 -0
  46. apisec_surface-0.1.13/src/apisec_code_bolt/cli/main.py +1785 -0
  47. apisec_surface-0.1.13/src/apisec_code_bolt/cloud/__init__.py +1 -0
  48. apisec_surface-0.1.13/src/apisec_code_bolt/cloud/apisec_client.py +233 -0
  49. apisec_surface-0.1.13/src/apisec_code_bolt/cloud/client.py +446 -0
  50. apisec_surface-0.1.13/src/apisec_code_bolt/core/__init__.py +81 -0
  51. apisec_surface-0.1.13/src/apisec_code_bolt/core/config.py +624 -0
  52. apisec_surface-0.1.13/src/apisec_code_bolt/core/credentials.py +65 -0
  53. apisec_surface-0.1.13/src/apisec_code_bolt/core/discovery.py +523 -0
  54. apisec_surface-0.1.13/src/apisec_code_bolt/core/log_format.py +133 -0
  55. apisec_surface-0.1.13/src/apisec_code_bolt/core/manifest.py +1390 -0
  56. apisec_surface-0.1.13/src/apisec_code_bolt/core/memory_guard.py +423 -0
  57. apisec_surface-0.1.13/src/apisec_code_bolt/core/repo.py +287 -0
  58. apisec_surface-0.1.13/src/apisec_code_bolt/core/runtime_entry_points.py +45 -0
  59. apisec_surface-0.1.13/src/apisec_code_bolt/core/state.py +75 -0
  60. apisec_surface-0.1.13/src/apisec_code_bolt/core/telemetry.py +485 -0
  61. apisec_surface-0.1.13/src/apisec_code_bolt/core/types.py +603 -0
  62. apisec_surface-0.1.13/src/apisec_code_bolt/fingerprinting/__init__.py +1 -0
  63. apisec_surface-0.1.13/src/apisec_code_bolt/frameworks/__init__.py +29 -0
  64. apisec_surface-0.1.13/src/apisec_code_bolt/frameworks/_graphql_common.py +45 -0
  65. apisec_surface-0.1.13/src/apisec_code_bolt/frameworks/_jwt_common.py +50 -0
  66. apisec_surface-0.1.13/src/apisec_code_bolt/frameworks/_weak_random_common.py +140 -0
  67. apisec_surface-0.1.13/src/apisec_code_bolt/frameworks/auth_helpers.py +437 -0
  68. apisec_surface-0.1.13/src/apisec_code_bolt/frameworks/base.py +735 -0
  69. apisec_surface-0.1.13/src/apisec_code_bolt/frameworks/dotnet/__init__.py +19 -0
  70. apisec_surface-0.1.13/src/apisec_code_bolt/frameworks/dotnet/_path_helpers.py +43 -0
  71. apisec_surface-0.1.13/src/apisec_code_bolt/frameworks/dotnet/aspnet_plugin.py +3092 -0
  72. apisec_surface-0.1.13/src/apisec_code_bolt/frameworks/dotnet/grpc_plugin.py +559 -0
  73. apisec_surface-0.1.13/src/apisec_code_bolt/frameworks/dotnet/jwt_config_extractor.py +545 -0
  74. apisec_surface-0.1.13/src/apisec_code_bolt/frameworks/dotnet/legacy_aspnet_plugin.py +732 -0
  75. apisec_surface-0.1.13/src/apisec_code_bolt/frameworks/dotnet/refit_plugin.py +374 -0
  76. apisec_surface-0.1.13/src/apisec_code_bolt/frameworks/dotnet/taint_scanner.py +1597 -0
  77. apisec_surface-0.1.13/src/apisec_code_bolt/frameworks/dotnet/wcf_plugin.py +1239 -0
  78. apisec_surface-0.1.13/src/apisec_code_bolt/frameworks/dotnet/webforms_plugin.py +393 -0
  79. apisec_surface-0.1.13/src/apisec_code_bolt/frameworks/java/__init__.py +7 -0
  80. apisec_surface-0.1.13/src/apisec_code_bolt/frameworks/java/_annotations.py +377 -0
  81. apisec_surface-0.1.13/src/apisec_code_bolt/frameworks/java/_constraints.py +128 -0
  82. apisec_surface-0.1.13/src/apisec_code_bolt/frameworks/java/graphql_plugin.py +280 -0
  83. apisec_surface-0.1.13/src/apisec_code_bolt/frameworks/java/jaxrs_plugin.py +813 -0
  84. apisec_surface-0.1.13/src/apisec_code_bolt/frameworks/java/jwt_config_extractor.py +361 -0
  85. apisec_surface-0.1.13/src/apisec_code_bolt/frameworks/java/micronaut_plugin.py +1121 -0
  86. apisec_surface-0.1.13/src/apisec_code_bolt/frameworks/java/servlet_plugin.py +380 -0
  87. apisec_surface-0.1.13/src/apisec_code_bolt/frameworks/java/spring_plugin.py +1491 -0
  88. apisec_surface-0.1.13/src/apisec_code_bolt/frameworks/java/taint_scanner.py +2910 -0
  89. apisec_surface-0.1.13/src/apisec_code_bolt/frameworks/js/__init__.py +9 -0
  90. apisec_surface-0.1.13/src/apisec_code_bolt/frameworks/js/_route_helpers.py +30 -0
  91. apisec_surface-0.1.13/src/apisec_code_bolt/frameworks/js/express_plugin.py +430 -0
  92. apisec_surface-0.1.13/src/apisec_code_bolt/frameworks/js/fastify_plugin.py +421 -0
  93. apisec_surface-0.1.13/src/apisec_code_bolt/frameworks/js/graphql_plugin.py +191 -0
  94. apisec_surface-0.1.13/src/apisec_code_bolt/frameworks/js/koa_plugin.py +283 -0
  95. apisec_surface-0.1.13/src/apisec_code_bolt/frameworks/js/nestjs_plugin.py +410 -0
  96. apisec_surface-0.1.13/src/apisec_code_bolt/frameworks/js/taint_scanner.py +2715 -0
  97. apisec_surface-0.1.13/src/apisec_code_bolt/frameworks/python/__init__.py +19 -0
  98. apisec_surface-0.1.13/src/apisec_code_bolt/frameworks/python/celery_plugin.py +393 -0
  99. apisec_surface-0.1.13/src/apisec_code_bolt/frameworks/python/click_plugin.py +427 -0
  100. apisec_surface-0.1.13/src/apisec_code_bolt/frameworks/python/django_plugin.py +990 -0
  101. apisec_surface-0.1.13/src/apisec_code_bolt/frameworks/python/fastapi/__init__.py +28 -0
  102. apisec_surface-0.1.13/src/apisec_code_bolt/frameworks/python/fastapi/plugin.py +1741 -0
  103. apisec_surface-0.1.13/src/apisec_code_bolt/frameworks/python/flask_plugin.py +748 -0
  104. apisec_surface-0.1.13/src/apisec_code_bolt/frameworks/python/graphql_plugin.py +257 -0
  105. apisec_surface-0.1.13/src/apisec_code_bolt/frameworks/python/prefect_plugin.py +251 -0
  106. apisec_surface-0.1.13/src/apisec_code_bolt/frameworks/python/taint_scanner.py +1953 -0
  107. apisec_surface-0.1.13/src/apisec_code_bolt/frameworks/python/weak_hash_facts.py +159 -0
  108. apisec_surface-0.1.13/src/apisec_code_bolt/frameworks/python/webhook_plugin.py +255 -0
  109. apisec_surface-0.1.13/src/apisec_code_bolt/frameworks/ruby/__init__.py +24 -0
  110. apisec_surface-0.1.13/src/apisec_code_bolt/frameworks/ruby/_ts_helpers.py +16 -0
  111. apisec_surface-0.1.13/src/apisec_code_bolt/frameworks/ruby/action_cable_plugin.py +152 -0
  112. apisec_surface-0.1.13/src/apisec_code_bolt/frameworks/ruby/grape_plugin.py +486 -0
  113. apisec_surface-0.1.13/src/apisec_code_bolt/frameworks/ruby/graphql_plugin.py +358 -0
  114. apisec_surface-0.1.13/src/apisec_code_bolt/frameworks/ruby/hanami_plugin.py +254 -0
  115. apisec_surface-0.1.13/src/apisec_code_bolt/frameworks/ruby/padrino_plugin.py +114 -0
  116. apisec_surface-0.1.13/src/apisec_code_bolt/frameworks/ruby/rails_plugin.py +1098 -0
  117. apisec_surface-0.1.13/src/apisec_code_bolt/frameworks/ruby/roda_plugin.py +260 -0
  118. apisec_surface-0.1.13/src/apisec_code_bolt/frameworks/ruby/sidekiq_plugin.py +208 -0
  119. apisec_surface-0.1.13/src/apisec_code_bolt/frameworks/ruby/sinatra_plugin.py +478 -0
  120. apisec_surface-0.1.13/src/apisec_code_bolt/frameworks/ruby/taint_scanner.py +2772 -0
  121. apisec_surface-0.1.13/src/apisec_code_bolt/frameworks/ruby/weak_hash_facts.py +192 -0
  122. apisec_surface-0.1.13/src/apisec_code_bolt/parsing/__init__.py +62 -0
  123. apisec_surface-0.1.13/src/apisec_code_bolt/parsing/base.py +555 -0
  124. apisec_surface-0.1.13/src/apisec_code_bolt/parsing/csharp/__init__.py +5 -0
  125. apisec_surface-0.1.13/src/apisec_code_bolt/parsing/csharp/language_services.py +203 -0
  126. apisec_surface-0.1.13/src/apisec_code_bolt/parsing/csharp/literals.py +72 -0
  127. apisec_surface-0.1.13/src/apisec_code_bolt/parsing/csharp/parser.py +1158 -0
  128. apisec_surface-0.1.13/src/apisec_code_bolt/parsing/csharp/type_resolver.py +568 -0
  129. apisec_surface-0.1.13/src/apisec_code_bolt/parsing/js/__init__.py +5 -0
  130. apisec_surface-0.1.13/src/apisec_code_bolt/parsing/js/language_services.py +118 -0
  131. apisec_surface-0.1.13/src/apisec_code_bolt/parsing/js/parser.py +677 -0
  132. apisec_surface-0.1.13/src/apisec_code_bolt/parsing/jvm/__init__.py +7 -0
  133. apisec_surface-0.1.13/src/apisec_code_bolt/parsing/jvm/language_services.py +555 -0
  134. apisec_surface-0.1.13/src/apisec_code_bolt/parsing/jvm/member_reference.py +11 -0
  135. apisec_surface-0.1.13/src/apisec_code_bolt/parsing/jvm/parser.py +954 -0
  136. apisec_surface-0.1.13/src/apisec_code_bolt/parsing/jvm/type_resolver.py +422 -0
  137. apisec_surface-0.1.13/src/apisec_code_bolt/parsing/python/__init__.py +150 -0
  138. apisec_surface-0.1.13/src/apisec_code_bolt/parsing/python/cbv_extractor.py +606 -0
  139. apisec_surface-0.1.13/src/apisec_code_bolt/parsing/python/constant_resolver.py +500 -0
  140. apisec_surface-0.1.13/src/apisec_code_bolt/parsing/python/cross_file_resolver.py +1106 -0
  141. apisec_surface-0.1.13/src/apisec_code_bolt/parsing/python/dynamic_route_detector.py +532 -0
  142. apisec_surface-0.1.13/src/apisec_code_bolt/parsing/python/expression_utils.py +221 -0
  143. apisec_surface-0.1.13/src/apisec_code_bolt/parsing/python/extraction_types.py +271 -0
  144. apisec_surface-0.1.13/src/apisec_code_bolt/parsing/python/language_services.py +487 -0
  145. apisec_surface-0.1.13/src/apisec_code_bolt/parsing/python/parameter_analyzer.py +855 -0
  146. apisec_surface-0.1.13/src/apisec_code_bolt/parsing/python/parser.py +751 -0
  147. apisec_surface-0.1.13/src/apisec_code_bolt/parsing/python/path_resolver.py +576 -0
  148. apisec_surface-0.1.13/src/apisec_code_bolt/parsing/python/router_registry.py +964 -0
  149. apisec_surface-0.1.13/src/apisec_code_bolt/parsing/python/type_resolver.py +730 -0
  150. apisec_surface-0.1.13/src/apisec_code_bolt/parsing/python/visitors.py +1581 -0
  151. apisec_surface-0.1.13/src/apisec_code_bolt/parsing/ruby/__init__.py +5 -0
  152. apisec_surface-0.1.13/src/apisec_code_bolt/parsing/ruby/language_services.py +807 -0
  153. apisec_surface-0.1.13/src/apisec_code_bolt/parsing/ruby/parser.py +342 -0
  154. apisec_surface-0.1.13/src/apisec_code_bolt/parsing/services.py +544 -0
  155. apisec_surface-0.1.13/src/apisec_code_bolt/pkgindex/__init__.py +15 -0
  156. apisec_surface-0.1.13/src/apisec_code_bolt/pkgindex/indexer.py +319 -0
  157. apisec_surface-0.1.13/src/apisec_code_bolt/pkgindex/metadata.py +333 -0
  158. apisec_surface-0.1.13/src/apisec_code_bolt/pkgindex/module_graph.py +318 -0
  159. apisec_surface-0.1.13/src/apisec_code_bolt/pkgindex/package_source.py +447 -0
  160. apisec_surface-0.1.13/src/apisec_code_bolt/query/__init__.py +1 -0
  161. apisec_surface-0.1.13/src/apisec_code_bolt/query/ast_cache.py +215 -0
  162. apisec_surface-0.1.13/src/apisec_code_bolt/query/executor.py +481 -0
  163. apisec_surface-0.1.13/src/apisec_code_bolt/query/handlers.py +1232 -0
  164. apisec_surface-0.1.13/src/apisec_code_bolt/query/manifest_context.py +313 -0
  165. apisec_surface-0.1.13/tests/conftest.py +120 -0
  166. apisec_surface-0.1.13/tests/fixtures/dep_files/.gradle/9.2.0/checksums/checksums.lock +0 -0
  167. apisec_surface-0.1.13/tests/fixtures/dep_files/.gradle/9.2.0/checksums/md5-checksums.bin +0 -0
  168. apisec_surface-0.1.13/tests/fixtures/dep_files/.gradle/9.2.0/checksums/sha1-checksums.bin +0 -0
  169. apisec_surface-0.1.13/tests/fixtures/dep_files/.gradle/9.2.0/fileChanges/last-build.bin +0 -0
  170. apisec_surface-0.1.13/tests/fixtures/dep_files/.gradle/9.2.0/fileHashes/fileHashes.bin +0 -0
  171. apisec_surface-0.1.13/tests/fixtures/dep_files/.gradle/9.2.0/fileHashes/fileHashes.lock +0 -0
  172. apisec_surface-0.1.13/tests/fixtures/dep_files/.gradle/9.2.0/gc.properties +0 -0
  173. apisec_surface-0.1.13/tests/fixtures/dep_files/.gradle/buildOutputCleanup/buildOutputCleanup.lock +0 -0
  174. apisec_surface-0.1.13/tests/fixtures/dep_files/.gradle/buildOutputCleanup/cache.properties +2 -0
  175. apisec_surface-0.1.13/tests/fixtures/dep_files/.gradle/vcs-1/gc.properties +0 -0
  176. apisec_surface-0.1.13/tests/fixtures/dep_files/Cargo.toml +12 -0
  177. apisec_surface-0.1.13/tests/fixtures/dep_files/Gemfile.lock +21 -0
  178. apisec_surface-0.1.13/tests/fixtures/dep_files/Pipfile +17 -0
  179. apisec_surface-0.1.13/tests/fixtures/dep_files/build.gradle +21 -0
  180. apisec_surface-0.1.13/tests/fixtures/dep_files/build.gradle.kts +14 -0
  181. apisec_surface-0.1.13/tests/fixtures/dep_files/cyclonedx-agg-all.json +579 -0
  182. apisec_surface-0.1.13/tests/fixtures/dep_files/cyclonedx-agg-runtime.json +446 -0
  183. apisec_surface-0.1.13/tests/fixtures/dep_files/cyclonedx-bom-all.json +477 -0
  184. apisec_surface-0.1.13/tests/fixtures/dep_files/cyclonedx-bom-runtime.json +338 -0
  185. apisec_surface-0.1.13/tests/fixtures/dep_files/go.mod +11 -0
  186. apisec_surface-0.1.13/tests/fixtures/dep_files/package-lock-v1.json +37 -0
  187. apisec_surface-0.1.13/tests/fixtures/dep_files/package-lock.json +52 -0
  188. apisec_surface-0.1.13/tests/fixtures/dep_files/package.json +13 -0
  189. apisec_surface-0.1.13/tests/fixtures/dep_files/packages.lock.json +46 -0
  190. apisec_surface-0.1.13/tests/fixtures/dep_files/pnpm-lock-v5.yaml +25 -0
  191. apisec_surface-0.1.13/tests/fixtures/dep_files/pnpm-lock-v6.yaml +39 -0
  192. apisec_surface-0.1.13/tests/fixtures/dep_files/pnpm-lock.yaml +35 -0
  193. apisec_surface-0.1.13/tests/fixtures/dep_files/pom.xml +59 -0
  194. apisec_surface-0.1.13/tests/fixtures/dep_files/pyproject_pep621.toml +12 -0
  195. apisec_surface-0.1.13/tests/fixtures/dep_files/pyproject_poetry.toml +16 -0
  196. apisec_surface-0.1.13/tests/fixtures/dep_files/requirements-dev.txt +4 -0
  197. apisec_surface-0.1.13/tests/fixtures/dep_files/requirements.txt +9 -0
  198. apisec_surface-0.1.13/tests/fixtures/dep_files/setup.cfg +15 -0
  199. apisec_surface-0.1.13/tests/fixtures/dep_files/setup.py +15 -0
  200. apisec_surface-0.1.13/tests/fixtures/dep_files/yarn-berry.lock +31 -0
  201. apisec_surface-0.1.13/tests/fixtures/dep_files/yarn.lock +25 -0
  202. apisec_surface-0.1.13/tests/fixtures/sample_django/urls.py +14 -0
  203. apisec_surface-0.1.13/tests/fixtures/sample_django/views.py +48 -0
  204. apisec_surface-0.1.13/tests/fixtures/sample_django_cbv_module_alias/urls.py +7 -0
  205. apisec_surface-0.1.13/tests/fixtures/sample_django_cbv_module_alias/views.py +19 -0
  206. apisec_surface-0.1.13/tests/fixtures/sample_django_query_params/models.py +11 -0
  207. apisec_surface-0.1.13/tests/fixtures/sample_django_query_params/urls.py +10 -0
  208. apisec_surface-0.1.13/tests/fixtures/sample_django_query_params/views.py +33 -0
  209. apisec_surface-0.1.13/tests/fixtures/sample_express/app.ts +13 -0
  210. apisec_surface-0.1.13/tests/fixtures/sample_express/middleware/authenticate.ts +15 -0
  211. apisec_surface-0.1.13/tests/fixtures/sample_express/routes/auth.ts +9 -0
  212. apisec_surface-0.1.13/tests/fixtures/sample_express/routes/users.ts +14 -0
  213. apisec_surface-0.1.13/tests/fixtures/sample_fastapi/main.py +228 -0
  214. apisec_surface-0.1.13/tests/fixtures/sample_fastapi/routes/__init__.py +5 -0
  215. apisec_surface-0.1.13/tests/fixtures/sample_fastapi/routes/users.py +119 -0
  216. apisec_surface-0.1.13/tests/fixtures/sample_fastapi/services/__init__.py +5 -0
  217. apisec_surface-0.1.13/tests/fixtures/sample_fastapi/services/user_service.py +52 -0
  218. apisec_surface-0.1.13/tests/fixtures/sample_flask/app.py +44 -0
  219. apisec_surface-0.1.13/tests/fixtures/sample_flask_auth/app.py +64 -0
  220. apisec_surface-0.1.13/tests/fixtures/sample_flask_pydantic/app.py +50 -0
  221. apisec_surface-0.1.13/tests/fixtures/sample_grape/api.rb +68 -0
  222. apisec_surface-0.1.13/tests/fixtures/sample_mixed_transport/app/cli.py +17 -0
  223. apisec_surface-0.1.13/tests/fixtures/sample_mixed_transport/app/tasks.py +15 -0
  224. apisec_surface-0.1.13/tests/fixtures/sample_mixed_transport/app/web.py +19 -0
  225. apisec_surface-0.1.13/tests/fixtures/sample_mixed_transport/requirements.txt +3 -0
  226. apisec_surface-0.1.13/tests/fixtures/sample_monorepo/apps/service-a/app.py +11 -0
  227. apisec_surface-0.1.13/tests/fixtures/sample_monorepo/apps/service-a/pyproject.toml +6 -0
  228. apisec_surface-0.1.13/tests/fixtures/sample_monorepo/apps/service-b/app.py +11 -0
  229. apisec_surface-0.1.13/tests/fixtures/sample_monorepo/apps/service-b/pyproject.toml +6 -0
  230. apisec_surface-0.1.13/tests/fixtures/sample_monorepo/shared_util.py +7 -0
  231. apisec_surface-0.1.13/tests/fixtures/sample_nestjs/auth.controller.ts +23 -0
  232. apisec_surface-0.1.13/tests/fixtures/sample_nestjs/roles.decorator.ts +2 -0
  233. apisec_surface-0.1.13/tests/fixtures/sample_nestjs/roles.guard.ts +14 -0
  234. apisec_surface-0.1.13/tests/fixtures/sample_nestjs/users.controller.ts +49 -0
  235. apisec_surface-0.1.13/tests/fixtures/sample_polyglot_auth_schemes/services/chatbot/chat_api.py +27 -0
  236. apisec_surface-0.1.13/tests/fixtures/sample_polyglot_auth_schemes/services/chatbot/pyproject.toml +4 -0
  237. apisec_surface-0.1.13/tests/fixtures/sample_polyglot_auth_schemes/services/community/pyproject.toml +4 -0
  238. apisec_surface-0.1.13/tests/fixtures/sample_polyglot_auth_schemes/services/community/urls.py +10 -0
  239. apisec_surface-0.1.13/tests/fixtures/sample_polyglot_auth_schemes/services/community/views.py +20 -0
  240. apisec_surface-0.1.13/tests/fixtures/sample_polyglot_auth_schemes/services/identity/pom.xml +7 -0
  241. apisec_surface-0.1.13/tests/fixtures/sample_polyglot_auth_schemes/services/identity/src/main/java/com/crapi/identity/config/WebSecurityConfig.java +21 -0
  242. apisec_surface-0.1.13/tests/fixtures/sample_polyglot_auth_schemes/services/identity/src/main/java/com/crapi/identity/controller/AuthController.java +22 -0
  243. apisec_surface-0.1.13/tests/fixtures/sample_polyglot_auth_schemes/services/portal/portal_api.py +25 -0
  244. apisec_surface-0.1.13/tests/fixtures/sample_polyglot_auth_schemes/services/portal/pyproject.toml +4 -0
  245. apisec_surface-0.1.13/tests/fixtures/sample_polyglot_monorepo/services/api-js/index.js +14 -0
  246. apisec_surface-0.1.13/tests/fixtures/sample_polyglot_monorepo/services/api-js/package.json +7 -0
  247. apisec_surface-0.1.13/tests/fixtures/sample_polyglot_monorepo/services/api-py/main.py +26 -0
  248. apisec_surface-0.1.13/tests/fixtures/sample_polyglot_monorepo/services/api-py/pyproject.toml +4 -0
  249. apisec_surface-0.1.13/tests/fixtures/sample_sinatra/app.rb +38 -0
  250. apisec_surface-0.1.13/tests/fixtures/sample_spring_boot/apisec-code-bolt/state.yaml +1 -0
  251. apisec_surface-0.1.13/tests/fixtures/sample_spring_boot/src/main/java/com/example/demo/config/SecurityConfig.java +41 -0
  252. apisec_surface-0.1.13/tests/fixtures/sample_spring_boot/src/main/java/com/example/demo/controller/UserController.java +47 -0
  253. apisec_surface-0.1.13/tests/fixtures/sample_spring_boot/src/main/java/com/example/demo/model/User.java +29 -0
  254. apisec_surface-0.1.13/tests/fixtures/sample_spring_boot/src/main/java/com/example/demo/service/UserService.java +36 -0
  255. apisec_surface-0.1.13/tests/fixtures/sample_spring_boot/src/main/resources/application.properties +7 -0
  256. apisec_surface-0.1.13/tests/fixtures/surface_accuracy/express-factory/routes/app.js +3 -0
  257. apisec_surface-0.1.13/tests/fixtures/surface_accuracy/spring-mini/demo/BaseController.java +6 -0
  258. apisec_surface-0.1.13/tests/fixtures/surface_accuracy/spring-mini/demo/DisabledController.java +7 -0
  259. apisec_surface-0.1.13/tests/fixtures/surface_accuracy/spring-mini/demo/UserController.java +10 -0
  260. apisec_surface-0.1.13/tests/fixtures/vuln_spring_boot/VULNERABILITIES.md +86 -0
  261. apisec_surface-0.1.13/tests/fixtures/vuln_spring_boot/src/main/java/com/example/vulnapi/config/SecurityConfig.java +61 -0
  262. apisec_surface-0.1.13/tests/fixtures/vuln_spring_boot/src/main/java/com/example/vulnapi/controller/AdminController.java +55 -0
  263. apisec_surface-0.1.13/tests/fixtures/vuln_spring_boot/src/main/java/com/example/vulnapi/controller/OrderController.java +60 -0
  264. apisec_surface-0.1.13/tests/fixtures/vuln_spring_boot/src/main/java/com/example/vulnapi/controller/UserController.java +74 -0
  265. apisec_surface-0.1.13/tests/fixtures/vuln_spring_boot/src/main/java/com/example/vulnapi/model/Order.java +35 -0
  266. apisec_surface-0.1.13/tests/fixtures/vuln_spring_boot/src/main/java/com/example/vulnapi/model/User.java +49 -0
  267. apisec_surface-0.1.13/tests/fixtures/vuln_spring_boot/src/main/java/com/example/vulnapi/service/OrderService.java +38 -0
  268. apisec_surface-0.1.13/tests/fixtures/vuln_spring_boot/src/main/java/com/example/vulnapi/service/UserService.java +54 -0
  269. apisec_surface-0.1.13/tests/fixtures/vuln_spring_boot/src/main/resources/application.properties +6 -0
  270. apisec_surface-0.1.13/tests/fixtures/vulnerable_app/pom.xml +44 -0
  271. apisec_surface-0.1.13/tests/fixtures/vulnerable_app/src/main/java/com/demo/DemoController.java +15 -0
  272. apisec_surface-0.1.13/tests/fixtures/vulnerable_app/target/classes/com/demo/DemoController.class +0 -0
  273. apisec_surface-0.1.13/tests/integration/__init__.py +1 -0
  274. apisec_surface-0.1.13/tests/integration/test_cli.py +357 -0
  275. apisec_surface-0.1.13/tests/integration/test_django_analysis.py +147 -0
  276. apisec_surface-0.1.13/tests/integration/test_django_cbv_decorator_auth.py +51 -0
  277. apisec_surface-0.1.13/tests/integration/test_django_mount_prefix_scan_root.py +219 -0
  278. apisec_surface-0.1.13/tests/integration/test_django_query_param_flow.py +147 -0
  279. apisec_surface-0.1.13/tests/integration/test_erb_template_data_flows.py +81 -0
  280. apisec_surface-0.1.13/tests/integration/test_express_analysis.py +121 -0
  281. apisec_surface-0.1.13/tests/integration/test_fastapi_analysis.py +576 -0
  282. apisec_surface-0.1.13/tests/integration/test_flask_analysis.py +61 -0
  283. apisec_surface-0.1.13/tests/integration/test_flask_auth_integration.py +74 -0
  284. apisec_surface-0.1.13/tests/integration/test_handlebars_stored_data_flows.py +91 -0
  285. apisec_surface-0.1.13/tests/integration/test_jsx_tsx_manifest.py +66 -0
  286. apisec_surface-0.1.13/tests/integration/test_mixed_transport_origin.py +106 -0
  287. apisec_surface-0.1.13/tests/integration/test_monorepo_partitioning.py +71 -0
  288. apisec_surface-0.1.13/tests/integration/test_monorepo_regression.py +76 -0
  289. apisec_surface-0.1.13/tests/integration/test_nestjs_analysis.py +146 -0
  290. apisec_surface-0.1.13/tests/integration/test_polyglot_auth_scheme_fallback.py +413 -0
  291. apisec_surface-0.1.13/tests/integration/test_polyglot_monorepo_auth_boundary.py +270 -0
  292. apisec_surface-0.1.13/tests/integration/test_polyglot_python_prefix_maps.py +151 -0
  293. apisec_surface-0.1.13/tests/integration/test_regression_flask_auth_and_deps.py +210 -0
  294. apisec_surface-0.1.13/tests/integration/test_root_config_autodiscovery.py +243 -0
  295. apisec_surface-0.1.13/tests/integration/test_spring_boot_analysis.py +448 -0
  296. apisec_surface-0.1.13/tests/integration/test_spring_service_impl_flow.py +185 -0
  297. apisec_surface-0.1.13/tests/integration/test_vulnerable_app_reachability_guard.py +57 -0
  298. apisec_surface-0.1.13/tests/test_query/__init__.py +0 -0
  299. apisec_surface-0.1.13/tests/test_query/fixtures/sample_app.py +52 -0
  300. apisec_surface-0.1.13/tests/test_query/test_auth_indicator_matching.py +106 -0
  301. apisec_surface-0.1.13/tests/test_query/test_executor.py +132 -0
  302. apisec_surface-0.1.13/tests/test_query/test_executor_connected.py +518 -0
  303. apisec_surface-0.1.13/tests/test_query/test_handlers.py +402 -0
  304. apisec_surface-0.1.13/tests/test_query/test_read_site_origin_types.py +47 -0
  305. apisec_surface-0.1.13/tests/unit/__init__.py +1 -0
  306. apisec_surface-0.1.13/tests/unit/conftest.py +9 -0
  307. apisec_surface-0.1.13/tests/unit/test_annotations_path_join.py +45 -0
  308. apisec_surface-0.1.13/tests/unit/test_answers_submit_404.py +66 -0
  309. apisec_surface-0.1.13/tests/unit/test_apisec_client.py +201 -0
  310. apisec_surface-0.1.13/tests/unit/test_apisec_client_enrich.py +85 -0
  311. apisec_surface-0.1.13/tests/unit/test_aspnet_plugin.py +2929 -0
  312. apisec_surface-0.1.13/tests/unit/test_benchmark_audit.py +199 -0
  313. apisec_surface-0.1.13/tests/unit/test_benchmark_run.py +397 -0
  314. apisec_surface-0.1.13/tests/unit/test_boundary_detection.py +594 -0
  315. apisec_surface-0.1.13/tests/unit/test_call_graph.py +999 -0
  316. apisec_surface-0.1.13/tests/unit/test_cbv_extractor.py +296 -0
  317. apisec_surface-0.1.13/tests/unit/test_cli_console_url.py +37 -0
  318. apisec_surface-0.1.13/tests/unit/test_config.py +291 -0
  319. apisec_surface-0.1.13/tests/unit/test_config_scanner_framework.py +82 -0
  320. apisec_surface-0.1.13/tests/unit/test_config_scanner_secret_values.py +467 -0
  321. apisec_surface-0.1.13/tests/unit/test_constant_resolver.py +393 -0
  322. apisec_surface-0.1.13/tests/unit/test_container_facts.py +420 -0
  323. apisec_surface-0.1.13/tests/unit/test_cross_file_resolver.py +405 -0
  324. apisec_surface-0.1.13/tests/unit/test_csharp_literals.py +123 -0
  325. apisec_surface-0.1.13/tests/unit/test_csharp_taint_scanner.py +1319 -0
  326. apisec_surface-0.1.13/tests/unit/test_csharp_type_resolver.py +390 -0
  327. apisec_surface-0.1.13/tests/unit/test_data_flow.py +741 -0
  328. apisec_surface-0.1.13/tests/unit/test_dependency_parsing.py +3271 -0
  329. apisec_surface-0.1.13/tests/unit/test_discovery.py +354 -0
  330. apisec_surface-0.1.13/tests/unit/test_django_plugin.py +935 -0
  331. apisec_surface-0.1.13/tests/unit/test_dotnet_object_reference_fact.py +211 -0
  332. apisec_surface-0.1.13/tests/unit/test_dotnet_route_authorization_fact.py +293 -0
  333. apisec_surface-0.1.13/tests/unit/test_dynamic_routes.py +265 -0
  334. apisec_surface-0.1.13/tests/unit/test_entry_point_interface_resolution.py +149 -0
  335. apisec_surface-0.1.13/tests/unit/test_express_nestjs_plugin.py +819 -0
  336. apisec_surface-0.1.13/tests/unit/test_fastapi_plugin.py +907 -0
  337. apisec_surface-0.1.13/tests/unit/test_fastify_passport_auth.py +159 -0
  338. apisec_surface-0.1.13/tests/unit/test_fastify_plugin.py +422 -0
  339. apisec_surface-0.1.13/tests/unit/test_flask_auth_and_deps.py +451 -0
  340. apisec_surface-0.1.13/tests/unit/test_flask_blueprint_prefix.py +420 -0
  341. apisec_surface-0.1.13/tests/unit/test_flask_params.py +119 -0
  342. apisec_surface-0.1.13/tests/unit/test_flask_surface_kind.py +97 -0
  343. apisec_surface-0.1.13/tests/unit/test_flow_analysis.py +308 -0
  344. apisec_surface-0.1.13/tests/unit/test_grape_plugin.py +369 -0
  345. apisec_surface-0.1.13/tests/unit/test_graphql_plugin.py +608 -0
  346. apisec_surface-0.1.13/tests/unit/test_grpc_plugin.py +510 -0
  347. apisec_surface-0.1.13/tests/unit/test_instrumentation.py +435 -0
  348. apisec_surface-0.1.13/tests/unit/test_integration_detection.py +1311 -0
  349. apisec_surface-0.1.13/tests/unit/test_java_autowired_service_flow.py +505 -0
  350. apisec_surface-0.1.13/tests/unit/test_java_constant_resolver.py +39 -0
  351. apisec_surface-0.1.13/tests/unit/test_java_parser.py +551 -0
  352. apisec_surface-0.1.13/tests/unit/test_java_receiver_types.py +150 -0
  353. apisec_surface-0.1.13/tests/unit/test_java_taint_scanner.py +1909 -0
  354. apisec_surface-0.1.13/tests/unit/test_jaxrs_plugin.py +453 -0
  355. apisec_surface-0.1.13/tests/unit/test_jaxrs_secured_auth.py +287 -0
  356. apisec_surface-0.1.13/tests/unit/test_js_gradle_locks.py +300 -0
  357. apisec_surface-0.1.13/tests/unit/test_js_graphql_plugin.py +535 -0
  358. apisec_surface-0.1.13/tests/unit/test_js_parser.py +109 -0
  359. apisec_surface-0.1.13/tests/unit/test_js_taint_scanner.py +2002 -0
  360. apisec_surface-0.1.13/tests/unit/test_jwt_config_extraction.py +450 -0
  361. apisec_surface-0.1.13/tests/unit/test_koa_plugin.py +211 -0
  362. apisec_surface-0.1.13/tests/unit/test_legacy_aspnet_plugin.py +1219 -0
  363. apisec_surface-0.1.13/tests/unit/test_legacy_committed_contract.py +119 -0
  364. apisec_surface-0.1.13/tests/unit/test_manifest_entry_point_gate.py +60 -0
  365. apisec_surface-0.1.13/tests/unit/test_manifest_partitioner.py +592 -0
  366. apisec_surface-0.1.13/tests/unit/test_manifest_upload_gzip.py +73 -0
  367. apisec_surface-0.1.13/tests/unit/test_manifest_upload_refusal.py +619 -0
  368. apisec_surface-0.1.13/tests/unit/test_memory_guard.py +523 -0
  369. apisec_surface-0.1.13/tests/unit/test_micronaut_plugin.py +613 -0
  370. apisec_surface-0.1.13/tests/unit/test_monorepo_upload_cli.py +970 -0
  371. apisec_surface-0.1.13/tests/unit/test_origin_type_contract.py +74 -0
  372. apisec_surface-0.1.13/tests/unit/test_parameter_analyzer.py +464 -0
  373. apisec_surface-0.1.13/tests/unit/test_path_resolution_ladder.py +21 -0
  374. apisec_surface-0.1.13/tests/unit/test_path_resolver.py +185 -0
  375. apisec_surface-0.1.13/tests/unit/test_pkgindex.py +1485 -0
  376. apisec_surface-0.1.13/tests/unit/test_pydantic_body_inference.py +188 -0
  377. apisec_surface-0.1.13/tests/unit/test_python_parser.py +730 -0
  378. apisec_surface-0.1.13/tests/unit/test_python_taint_scanner.py +1910 -0
  379. apisec_surface-0.1.13/tests/unit/test_python_weak_hash_facts.py +155 -0
  380. apisec_surface-0.1.13/tests/unit/test_rails_plugin.py +5643 -0
  381. apisec_surface-0.1.13/tests/unit/test_read_site_detector.py +106 -0
  382. apisec_surface-0.1.13/tests/unit/test_refit_plugin.py +401 -0
  383. apisec_surface-0.1.13/tests/unit/test_repo_canonical.py +71 -0
  384. apisec_surface-0.1.13/tests/unit/test_route_auth_roles.py +60 -0
  385. apisec_surface-0.1.13/tests/unit/test_router_registry.py +1069 -0
  386. apisec_surface-0.1.13/tests/unit/test_ruby_graphql_plugin.py +541 -0
  387. apisec_surface-0.1.13/tests/unit/test_ruby_language_services.py +590 -0
  388. apisec_surface-0.1.13/tests/unit/test_ruby_p6_plugins.py +503 -0
  389. apisec_surface-0.1.13/tests/unit/test_ruby_weak_hash_facts.py +91 -0
  390. apisec_surface-0.1.13/tests/unit/test_secret_detection_coverage.py +342 -0
  391. apisec_surface-0.1.13/tests/unit/test_secret_value_presentation.py +209 -0
  392. apisec_surface-0.1.13/tests/unit/test_secrets_policy.py +316 -0
  393. apisec_surface-0.1.13/tests/unit/test_sensitivity_capability.py +777 -0
  394. apisec_surface-0.1.13/tests/unit/test_servlet_plugin.py +466 -0
  395. apisec_surface-0.1.13/tests/unit/test_sinatra_plugin.py +315 -0
  396. apisec_surface-0.1.13/tests/unit/test_sink_evidence.py +775 -0
  397. apisec_surface-0.1.13/tests/unit/test_spring_plugin.py +1986 -0
  398. apisec_surface-0.1.13/tests/unit/test_static_route_catchup.py +128 -0
  399. apisec_surface-0.1.13/tests/unit/test_surface_accuracy_benchmark.py +28 -0
  400. apisec_surface-0.1.13/tests/unit/test_surface_enrichment.py +196 -0
  401. apisec_surface-0.1.13/tests/unit/test_surface_extraction_client.py +78 -0
  402. apisec_surface-0.1.13/tests/unit/test_surface_ledger.py +74 -0
  403. apisec_surface-0.1.13/tests/unit/test_surface_reconciliation.py +57 -0
  404. apisec_surface-0.1.13/tests/unit/test_telemetry.py +510 -0
  405. apisec_surface-0.1.13/tests/unit/test_template_scanner.py +907 -0
  406. apisec_surface-0.1.13/tests/unit/test_transformation_tracking.py +711 -0
  407. apisec_surface-0.1.13/tests/unit/test_tree_resolver.py +249 -0
  408. apisec_surface-0.1.13/tests/unit/test_types.py +118 -0
  409. apisec_surface-0.1.13/tests/unit/test_unsupported_frameworks.py +474 -0
  410. apisec_surface-0.1.13/tests/unit/test_upload_verify_timeout.py +107 -0
  411. apisec_surface-0.1.13/tests/unit/test_url_prefix_resolver.py +467 -0
  412. apisec_surface-0.1.13/tests/unit/test_version_resolver.py +202 -0
  413. apisec_surface-0.1.13/tests/unit/test_wcf_plugin.py +1803 -0
  414. apisec_surface-0.1.13/tests/unit/test_webforms_plugin.py +345 -0
@@ -0,0 +1,54 @@
1
+ # Byte-compiled / optimized / DLL files
2
+ __pycache__/
3
+ **/__pycache__/
4
+ *.py[cod]
5
+ *$py.class
6
+
7
+ # Distribution / packaging
8
+ build/
9
+ dist/
10
+ wheels/
11
+ *.egg
12
+ *.egg-info/
13
+ .eggs/
14
+
15
+ # Virtual environments
16
+ .venv/
17
+ venv/
18
+ env/
19
+ ENV/
20
+
21
+ # Test / coverage / type-check caches
22
+ .pytest_cache/
23
+ .mypy_cache/
24
+ .ruff_cache/
25
+ .tox/
26
+ .nox/
27
+ .coverage
28
+ .coverage.*
29
+ coverage.xml
30
+ htmlcov/
31
+ .hypothesis/
32
+
33
+ # Environment / secrets
34
+ .env
35
+ .env.*
36
+ !.env.example
37
+
38
+ # Editors / OS
39
+ .idea/
40
+ .vscode/
41
+ *.swp
42
+ *.swo
43
+ .DS_Store
44
+ Thumbs.db
45
+
46
+ # Logs
47
+ *.log
48
+
49
+ # Demo recordings (local-only)
50
+ *.mp4
51
+
52
+ # Benchmark per-run output (clones are cached at ~/.cache/apisec-benchmark,
53
+ # manifests go under benchmark/runs/<suite>-<version>/)
54
+ benchmark/runs/
@@ -0,0 +1,541 @@
1
+ Metadata-Version: 2.5
2
+ Name: apisec-surface
3
+ Version: 0.1.13
4
+ Summary: Static analysis probe for extracting architectural metadata from codebases
5
+ Project-URL: Homepage, https://apisec.ai
6
+ Project-URL: Documentation, https://docs.apisec.ai/code-bolt
7
+ Project-URL: Repository, https://github.com/apisec-inc/ApisecSurfaceCore
8
+ Author-email: APIsec <engineering@apisec.ai>
9
+ License: Proprietary
10
+ Keywords: api,security,static-analysis,vulnerability
11
+ Classifier: Development Status :: 3 - Alpha
12
+ Classifier: Environment :: Console
13
+ Classifier: Intended Audience :: Developers
14
+ Classifier: Operating System :: OS Independent
15
+ Classifier: Programming Language :: Python :: 3
16
+ Classifier: Programming Language :: Python :: 3.11
17
+ Classifier: Programming Language :: Python :: 3.12
18
+ Classifier: Topic :: Security
19
+ Classifier: Topic :: Software Development :: Quality Assurance
20
+ Classifier: Typing :: Typed
21
+ Requires-Python: >=3.11
22
+ Requires-Dist: click>=8.1.0
23
+ Requires-Dist: httpx>=0.26.0
24
+ Requires-Dist: javalang>=0.13.0
25
+ Requires-Dist: libcst>=1.1.0
26
+ Requires-Dist: networkx>=3.2
27
+ Requires-Dist: packaging>=23.0
28
+ Requires-Dist: pathspec>=0.12.0
29
+ Requires-Dist: pydantic-settings>=2.1.0
30
+ Requires-Dist: pydantic>=2.5.0
31
+ Requires-Dist: pyyaml>=6.0
32
+ Requires-Dist: rich>=13.7.0
33
+ Requires-Dist: tree-sitter-c-sharp>=0.23
34
+ Requires-Dist: tree-sitter-java>=0.23
35
+ Requires-Dist: tree-sitter-javascript>=0.23
36
+ Requires-Dist: tree-sitter-python>=0.23
37
+ Requires-Dist: tree-sitter-ruby>=0.23
38
+ Requires-Dist: tree-sitter-typescript>=0.23
39
+ Requires-Dist: tree-sitter>=0.23
40
+ Requires-Dist: typing-extensions>=4.9.0
41
+ Provides-Extra: dev
42
+ Requires-Dist: mypy>=1.8.0; extra == 'dev'
43
+ Requires-Dist: pre-commit>=4.0; extra == 'dev'
44
+ Requires-Dist: pytest-asyncio>=0.23.0; extra == 'dev'
45
+ Requires-Dist: pytest-cov>=4.1.0; extra == 'dev'
46
+ Requires-Dist: pytest>=7.4.0; extra == 'dev'
47
+ Requires-Dist: ruff>=0.6; extra == 'dev'
48
+ Provides-Extra: semgrep
49
+ Requires-Dist: semgrep>=1.50.0; extra == 'semgrep'
50
+ Description-Content-Type: text/markdown
51
+
52
+ # apisec-surface
53
+
54
+ Static analysis probe for extracting architectural metadata from codebases.
55
+
56
+ ## Overview
57
+
58
+ apisec-surface analyzes source code to extract:
59
+
60
+ - **Routes/Endpoints** — HTTP routes, parameters, request/response types
61
+ - **Data Flows** — How data moves from entry points to sinks
62
+ - **Authentication** — Auth schemes, dependencies, role requirements
63
+ - **Integrations** — External services, databases, APIs
64
+ - **Dependencies** — Package dependencies and versions
65
+
66
+ The output is a structured **manifest** that can be uploaded to the APIsec cloud
67
+ for vulnerability analysis. **Raw source code never leaves your environment.**
68
+
69
+ ## Requirements
70
+
71
+ - **Python 3.11 or newer** (3.11 and 3.12 are supported). Check with `python --version`.
72
+ - No JDK, Node, Ruby, or .NET runtime required — all parsers are pure-Python
73
+ (Java via `javalang`, C#/JS/TS/Ruby via tree-sitter grammars). You can analyze
74
+ a Java or Ruby project without those toolchains installed.
75
+
76
+ ## Installation
77
+
78
+ The CLI is published on PyPI as [`apisec-surface`](https://pypi.org/project/apisec-surface/).
79
+
80
+ > **Upgrading from `apisec-code-bolt`?** The package was renamed in 0.1.13; the old
81
+ > PyPI project gets no further releases. Both packages install the same Python
82
+ > module, so remove the old one first:
83
+ >
84
+ > ```bash
85
+ > pipx uninstall apisec-code-bolt && pipx install apisec-surface
86
+ > # or: pip uninstall -y apisec-code-bolt && pip install apisec-surface
87
+ > ```
88
+ >
89
+ > The `apisec-code-bolt` command still works as a deprecated alias, and existing
90
+ > `apisec-code-bolt/state.yaml` files and saved credentials are reused unchanged.
91
+
92
+ ### Recommended: isolated install (pipx or uv)
93
+
94
+ Installing a CLI into an isolated environment avoids dependency conflicts with
95
+ other tools and sidesteps system-Python issues:
96
+
97
+ ```bash
98
+ # Using pipx
99
+ pipx install apisec-surface
100
+
101
+ # Or using uv (also handles the Python version for you)
102
+ uv tool install apisec-surface
103
+ ```
104
+
105
+ ### Plain pip
106
+
107
+ ```bash
108
+ pip install apisec-surface
109
+ ```
110
+
111
+ > **On an older or mismatched Python?** If `pip install` fails with a
112
+ > `requires-python` error, your default `python` is older than 3.11. The
113
+ > simplest fix is [`uv`](https://docs.astral.sh/uv/), which fetches a
114
+ > compatible interpreter automatically:
115
+ >
116
+ > ```bash
117
+ > uv tool install apisec-surface # install the CLI, or
118
+ > uv run --python 3.12 apisec-surface ... # run ad hoc under 3.12
119
+ > ```
120
+
121
+ ### Verify the install
122
+
123
+ ```bash
124
+ apisec-surface --version
125
+ ```
126
+
127
+ ## Getting Started (end to end)
128
+
129
+ A full run is three steps: **register → authenticate → analyze**.
130
+
131
+ ### 1. Register (first run only)
132
+
133
+ The first time you run the CLI it asks for the **registration code** APIsec
134
+ provided during onboarding (format `###-###`):
135
+
136
+ ```bash
137
+ apisec-surface analyze . # prompts: "Please enter code (###-###)"
138
+ ```
139
+
140
+ For non-interactive environments (CI, scripts), supply it via the environment
141
+ instead of typing it at a prompt:
142
+
143
+ ```bash
144
+ export APISEC_REGISTRATION_CODE=123-456
145
+ ```
146
+
147
+ ### 2. Authenticate
148
+
149
+ Store your APIsec API key so uploads are authorized:
150
+
151
+ ```bash
152
+ # Interactive (prompts for the key)
153
+ apisec-surface auth
154
+
155
+ # Or pass the key directly
156
+ apisec-surface auth sk_live_abc123...
157
+
158
+ # Confirm you're authenticated
159
+ apisec-surface auth --check
160
+ ```
161
+
162
+ ### 3. Analyze
163
+
164
+ ```bash
165
+ # Analyze the current project and upload the manifest to the cloud
166
+ apisec-surface analyze .
167
+ ```
168
+
169
+ On a successful upload the CLI prints a **"View Results in APIsec"** panel with a
170
+ direct link to your results in the console.
171
+
172
+ ### Working offline / inspecting the manifest
173
+
174
+ ```bash
175
+ # Analyze and save the manifest locally, no upload
176
+ apisec-surface analyze . --output manifest.json --no-upload
177
+
178
+ # Analyze but write nothing — just print a summary (great for a first look)
179
+ apisec-surface analyze . --dry-run
180
+
181
+ # Emit manifest JSON to stdout for piping into other tools
182
+ apisec-surface analyze . --stdout --no-upload | jq .
183
+
184
+ # Give the extractor framework hints
185
+ apisec-surface analyze . --frameworks fastapi,sqlalchemy
186
+ ```
187
+
188
+ ## Supported Languages & Frameworks
189
+
190
+ | Language | Frameworks |
191
+ |----------|-----------|
192
+ | Python | FastAPI, Flask, Django, GraphQL (Strawberry / Graphene / Ariadne), Celery, Click, Prefect |
193
+ | Java | Spring Boot, Micronaut, JAX-RS (Quarkus), GraphQL (Spring for GraphQL / graphql-java-kickstart) |
194
+ | JavaScript / TypeScript | Express, Fastify, NestJS, GraphQL (NestJS GraphQL / TypeGraphQL) |
195
+ | Ruby | Rails, Grape, Sinatra, GraphQL (graphql-ruby) |
196
+ | C# / .NET | ASP.NET Core, legacy ASP.NET (MVC/Web API), WCF, gRPC, Refit |
197
+
198
+ Framework coverage is validated end-to-end against real-world repositories in
199
+ the benchmark suite (`benchmark/`).
200
+
201
+ ## Configuration
202
+
203
+ Scaffold a config file with sensible defaults:
204
+
205
+ ```bash
206
+ apisec-surface init # writes .surface.yaml
207
+ ```
208
+
209
+ `.surface.yaml` in your project root is picked up automatically:
210
+
211
+ ```yaml
212
+ analysis:
213
+ file_discovery:
214
+ exclude_patterns:
215
+ - "tests/**"
216
+ - "**/migrations/**"
217
+ max_files: 10000
218
+ detect_workspace_boundaries: true # see "Monorepo support" below
219
+
220
+ data_flow:
221
+ mode: inter_procedural
222
+ max_depth: 10
223
+
224
+ cloud:
225
+ enabled: true
226
+ api_url: https://api.apisec.ai
227
+
228
+ output:
229
+ format: json
230
+ ```
231
+
232
+ ## Monorepo support
233
+
234
+ When a scanned tree contains multiple independently-deployed sub-projects
235
+ (a pnpm/npm workspace, a Maven or Gradle multi-module build, a `.sln` with
236
+ several `.csproj`s, a `go.work`, or a uv/Poetry workspace — or, absent any of
237
+ those, any directory with its own recognised dependency manifest file),
238
+ `analyze` automatically detects each one as a separate boundary and uploads
239
+ its own manifest as its own Application, instead of one flat manifest mixing
240
+ every sub-project's routes, dependencies, and secrets together.
241
+
242
+ - **Activation is automatic and safe by default.** Detection only takes
243
+ effect when **2 or more** real boundaries are found; a single-project repo
244
+ is completely unaffected — same manifest, same canonical id, same
245
+ `state.yaml`. Disable it entirely with `--no-detect-monorepo` or
246
+ `detect_workspace_boundaries: false`.
247
+ - **Identity.** Each sub-project uploads under
248
+ `{repo_canonical_id}/{relative/path/to/sub-project}`; code that doesn't
249
+ belong to any detected sub-project (root-level config, CI files, a shared
250
+ library with no manifest of its own) uploads under
251
+ `{repo_canonical_id}/shared`.
252
+ - **Display name.** Each sub-project's Application is named
253
+ `{repo_name}/{relative/path/to/sub-project}` (and `{repo_name}/shared` for
254
+ the catch-all), so sibling services are distinguishable in the APIsec
255
+ console's Applications list instead of all showing up under the identical
256
+ bare repo name. A single-project repo is unaffected — same bare `repo_name`
257
+ as always.
258
+ - **Auth-middleware scoping rides on the same gate — and this one is
259
+ security-material.** A globally-registered auth middleware is attributed
260
+ only to routes inside its own boundary, so one service's middleware can no
261
+ longer mark a sibling service's routes as authenticated (which hides
262
+ genuinely-exposed endpoints). Because it is gated on the same "2 or more
263
+ boundaries" condition, a polyglot repo that presents only a **single**
264
+ boundary — e.g. one root manifest and no per-service marker file or
265
+ workspace config — falls back to the legacy path and gets repo-wide
266
+ attribution. If a repo mixes languages or services, give each one its own
267
+ dependency manifest (or declare a workspace) so boundary detection can see
268
+ them; otherwise auth attribution is repo-wide and may over-report routes as
269
+ protected.
270
+ Scoping covers every auth path that resolves by *name* rather than by file:
271
+ Spring Security filter chains, Rails `before_action` (including
272
+ `ApplicationController`-inherited callbacks), Django view classes and
273
+ decorators, and route-level auth dependencies — so two services that each
274
+ define, say, an `articles` controller no longer share each other's guards.
275
+ - **Known v1 limitations:**
276
+ - A response/request schema referenced by routes in more than one
277
+ sub-project is duplicated into each of them; only one level of nested
278
+ model references is followed.
279
+ - The `shared` partition does not get the LLM-based surface-enrichment
280
+ pass (it has no single directory to scope that scan to).
281
+ - A cross-partition reference (e.g. a route depending on an auth guard
282
+ defined in another sub-project) is preserved as-is and surfaced as a
283
+ warning in that partition's manifest, not silently dropped or rewritten.
284
+
285
+ ## Memory limits
286
+
287
+ A very large repository can need more memory than the machine — or, more often,
288
+ the container the scan runs in — will grant the process. When that happens the
289
+ kernel's OOM killer ends the run with SIGKILL: exit code **-9**, no message, no
290
+ manifest. From the outside that is indistinguishable from a target that simply
291
+ has nothing in it. `analyze` therefore watches its own memory and stops
292
+ *before* the kernel can, with a diagnostic naming the limit it hit:
293
+
294
+ ```text
295
+ Analysis failed: analysis aborted: memory limit 4096 MB exceeded after 8213
296
+ files (stage 'call_graph', resident 4111 MB, repo /src/app). This stop replaces
297
+ the OS kill it preempts (rc=-9, no message, empty result): raise
298
+ APISEC_MEMORY_LIMIT_MB to scan a repository this large, or set
299
+ APISEC_MEMORY_LIMIT_MB=0 to disable the guard.
300
+ ```
301
+
302
+ - **Threshold.** `APISEC_MEMORY_LIMIT_MB` sets the ceiling, in MB (an optional
303
+ `mb` suffix is accepted). Unset, it defaults to **90% of the memory the OS
304
+ would actually grant the process** — the cgroup limit when containerised
305
+ (that is what the OOM killer charges against), otherwise physical RAM. That
306
+ default never interrupts a scan that fits, and a scan that crosses it was
307
+ about to be killed anyway.
308
+ - **Exit code.** A guard stop exits `6` (`RESOURCE_EXCEEDED`) instead of `1`,
309
+ so CI can tell a resource abort apart from a broken manifest, and leaves no
310
+ manifest behind to be mistaken for an empty scan.
311
+ - **`--log-format json`.** The same information arrives as a `scan_failed`
312
+ record with `reason: memory_limit_exceeded` plus the limit, observed RSS,
313
+ stage, file count and repo; the `scan_start` record carries the ceiling the
314
+ run started with, so even a run killed mid-flight leaves its memory state
315
+ behind.
316
+ - **Opt out.** `APISEC_MEMORY_LIMIT_MB=0` (or `off` / `none`) switches the guard
317
+ off, for a runner whose limit is misdetected.
318
+
319
+ ## Commands
320
+
321
+ Global options (before the subcommand): `--version`, `-v/--verbose`,
322
+ `-q/--quiet`, `--debug`, `--log-format [text|json]`.
323
+
324
+ ### analyze
325
+
326
+ Analyze a codebase and generate/upload a manifest.
327
+
328
+ ```bash
329
+ apisec-surface analyze [PATH] [OPTIONS]
330
+
331
+ Options:
332
+ -o, --output FILE Save manifest to file instead of uploading
333
+ --no-upload Skip uploading to cloud (implies --output if not set)
334
+ --api-key TEXT Override stored API key
335
+ --api-url TEXT Applicationsservice base URL (all analysis traffic is proxied here)
336
+ --format [json|yaml] Output format
337
+ --config FILE Path to configuration file
338
+ --frameworks TEXT Comma-separated framework hints
339
+ --exclude TEXT Glob patterns to exclude (repeatable)
340
+ --max-files INTEGER Maximum files to analyze
341
+ --timeout INTEGER Analysis timeout in seconds
342
+ --dry-run Analyze and print a summary; write/upload nothing
343
+ --stdout Write manifest JSON to stdout (for pipelines)
344
+ --detect-monorepo / --no-detect-monorepo
345
+ Detect monorepo sub-project boundaries and upload one
346
+ Application per sub-project (default: on; see
347
+ "Monorepo support" below)
348
+ ```
349
+
350
+ ### auth
351
+
352
+ Authenticate with the APIsec cloud.
353
+
354
+ ```bash
355
+ apisec-surface auth [API_KEY] [OPTIONS]
356
+
357
+ Options:
358
+ --api-url TEXT APIsec API URL
359
+ --check Check if already authenticated
360
+ --logout Remove stored credentials
361
+ ```
362
+
363
+ ### init
364
+
365
+ Scaffold a `.surface.yaml` configuration file.
366
+
367
+ ```bash
368
+ apisec-surface init [OPTIONS]
369
+
370
+ Options:
371
+ -o, --output FILE Output file path (default: .surface.yaml)
372
+ --force Overwrite an existing file
373
+ ```
374
+
375
+ ### validate
376
+
377
+ Validate a manifest file against the schema.
378
+
379
+ ```bash
380
+ apisec-surface validate MANIFEST_FILE
381
+ ```
382
+
383
+ ### answer
384
+
385
+ Answer verification queries (for air-gapped environments where the manifest was
386
+ uploaded separately and the cloud generated questions).
387
+
388
+ ```bash
389
+ apisec-surface answer [OPTIONS]
390
+
391
+ Options:
392
+ -q, --questions FILE Input questions file (JSON) [required]
393
+ -o, --output FILE Output answers file
394
+ -r, --repo DIRECTORY Repository path
395
+ --timeout INTEGER Query timeout in seconds
396
+ ```
397
+
398
+ ### telemetry
399
+
400
+ Manage anonymous usage telemetry (opt-out; on by default, disable any time with
401
+ `telemetry off`; never includes code, paths, or credentials).
402
+
403
+ ```bash
404
+ apisec-surface telemetry on|off|status
405
+ ```
406
+
407
+ ## Architecture
408
+
409
+ ```
410
+ src/apisec_code_bolt/
411
+ ├── cli/ # Command-line interface
412
+ ├── core/ # Types, config, manifest schema
413
+ ├── parsing/ # Language-specific parsers
414
+ │ ├── python/ # LibCST-based Python parser
415
+ │ └── jvm/ # Java via the pure-Python javalang library
416
+ ├── frameworks/ # Framework plugins
417
+ │ ├── python/ # FastAPI, Flask, Django, GraphQL, Celery, Click, Prefect
418
+ │ ├── java/ # Spring Boot, Micronaut, JAX-RS, GraphQL
419
+ │ ├── js/ # Express, Fastify, NestJS, GraphQL
420
+ │ ├── ruby/ # Rails, Grape, Sinatra, GraphQL
421
+ │ └── dotnet/ # ASP.NET Core, legacy ASP.NET, WCF, gRPC, Refit
422
+ ├── analysis/ # Call graph, data flow
423
+ ├── fingerprinting/ # Integration detection
424
+ ├── query/ # Query API executor
425
+ └── cloud/ # Cloud communication
426
+ ```
427
+
428
+ ## Development
429
+
430
+ ### Setup
431
+
432
+ ```bash
433
+ # Clone and install in development mode
434
+ git clone https://github.com/apisec-inc/ApisecSurfaceCore.git
435
+ cd ApisecSurfaceCore
436
+ pip install -e ".[dev]"
437
+ ```
438
+
439
+ ### Running Tests
440
+
441
+ ```bash
442
+ pytest
443
+ ```
444
+
445
+ ### Type Checking
446
+
447
+ ```bash
448
+ mypy src/apisec_code_bolt
449
+ ```
450
+
451
+ ### Linting & Formatting
452
+
453
+ CI runs **`ruff check`** and **`ruff format --check`** as separate steps. Run both
454
+ before you push (formatting alone does not fix lint, and lint fixes do not format).
455
+
456
+ **One command (same as CI):**
457
+
458
+ ```bash
459
+ make ci
460
+ ```
461
+
462
+ **Manual equivalent:**
463
+
464
+ ```bash
465
+ ruff check .
466
+ ruff format --check .
467
+ pytest -x --tb=short
468
+ ```
469
+
470
+ **Auto-fix locally:**
471
+
472
+ ```bash
473
+ make fix # ruff format + ruff check --fix
474
+ ```
475
+
476
+ **Pre-commit (recommended):** hooks run ruff lint + format on every commit.
477
+
478
+ ```bash
479
+ pip install -e ".[dev]"
480
+ make pre-commit-install # or: pre-commit install
481
+ pre-commit run --all-files # once, to verify the repo
482
+ ```
483
+
484
+ Push org PRs to the **`github`** remote (`apisec-inc/ApisecSurfaceCore`), not a
485
+ personal **`origin`** fork, unless you intend to.
486
+
487
+ ### Publishing a release (maintainers)
488
+
489
+ The CLI is published to [PyPI](https://pypi.org/project/apisec-surface/) by the
490
+ **Publish to PyPI** GitHub Action. **Merging to `build` does NOT publish** — the
491
+ workflow only runs on `workflow_dispatch` or a published GitHub Release, and it
492
+ builds from whatever ref it runs on.
493
+
494
+ Prerequisites (one-time): the `PYPI_API_TOKEN` repository secret must be set
495
+ (Settings → Secrets and variables → Actions).
496
+
497
+ 1. **Bump the version.** Edit `version` in `pyproject.toml` (single source of
498
+ truth; `--version` reads it via package metadata). PyPI **rejects re-uploads**
499
+ of an existing version, so the number must be higher than the current PyPI
500
+ release. Open a PR and merge it to `build`.
501
+
502
+ 2. **Publish** — dispatch the workflow (the standard path we use):
503
+ Actions → *Publish to PyPI* → **Run workflow** → select branch **`build`**.
504
+
505
+ ```bash
506
+ gh workflow run "Publish to PyPI" --ref build
507
+ ```
508
+
509
+ <details><summary>Alternative: publish via a GitHub Release</summary>
510
+
511
+ New release → create tag `vX.Y.Z` → set **Target: `build`** (it defaults to
512
+ the default branch; only `build` has the bumped version) → Publish. This
513
+ fires the same workflow via `release: [published]`.
514
+
515
+ ```bash
516
+ gh release create vX.Y.Z --target build --title "vX.Y.Z" --notes "…"
517
+ ```
518
+ </details>
519
+
520
+ 3. **Verify.** Confirm the new version appears on
521
+ [PyPI](https://pypi.org/project/apisec-surface/), then upgrade an install:
522
+ ```bash
523
+ uv tool upgrade apisec-surface # or: pipx upgrade apisec-surface
524
+ ```
525
+
526
+ > Always release from `build` after the version bump has merged there — releasing
527
+ > from a ref that still carries the old version will fail the PyPI upload.
528
+
529
+ ## Privacy
530
+
531
+ apisec-surface is designed with privacy as a core principle:
532
+
533
+ - **No raw code egress** — Source code never leaves your environment
534
+ - **Metadata only** — The manifest contains structural information, not code
535
+ - **Outbound only** — Only makes outbound HTTPS calls to upload manifests
536
+ - **Air-gapped support** — Can run completely offline with file-based workflow
537
+
538
+ ## License
539
+
540
+ Proprietary. Copyright © APIsec.
541
+