socketsecurity 2.11.12__tar.gz → 2.11.14__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 (176) hide show
  1. {socketsecurity-2.11.12 → socketsecurity-2.11.14}/CHANGELOG.md +39 -0
  2. {socketsecurity-2.11.12 → socketsecurity-2.11.14}/PKG-INFO +6 -6
  3. {socketsecurity-2.11.12 → socketsecurity-2.11.14}/docs/cli-reference.md +24 -11
  4. {socketsecurity-2.11.12 → socketsecurity-2.11.14}/docs/troubleshooting.md +6 -0
  5. {socketsecurity-2.11.12 → socketsecurity-2.11.14}/pyproject.toml +7 -7
  6. {socketsecurity-2.11.12 → socketsecurity-2.11.14}/socketsecurity/__init__.py +1 -1
  7. {socketsecurity-2.11.12 → socketsecurity-2.11.14}/socketsecurity/config.py +25 -3
  8. {socketsecurity-2.11.12 → socketsecurity-2.11.14}/socketsecurity/core/git_interface.py +2 -0
  9. {socketsecurity-2.11.12 → socketsecurity-2.11.14}/socketsecurity/core/messages.py +6 -25
  10. {socketsecurity-2.11.12 → socketsecurity-2.11.14}/socketsecurity/core/pull_request.py +69 -5
  11. {socketsecurity-2.11.12 → socketsecurity-2.11.14}/socketsecurity/core/tools/reachability.py +1 -1
  12. {socketsecurity-2.11.12 → socketsecurity-2.11.14}/socketsecurity/socketcli.py +10 -2
  13. {socketsecurity-2.11.12 → socketsecurity-2.11.14}/tests/unit/test_config.py +28 -0
  14. {socketsecurity-2.11.12 → socketsecurity-2.11.14}/tests/unit/test_fossa_compat.py +7 -7
  15. {socketsecurity-2.11.12 → socketsecurity-2.11.14}/tests/unit/test_messages.py +23 -0
  16. {socketsecurity-2.11.12 → socketsecurity-2.11.14}/tests/unit/test_pr_comment_rendering.py +4 -4
  17. {socketsecurity-2.11.12 → socketsecurity-2.11.14}/tests/unit/test_pull_request_context.py +43 -0
  18. {socketsecurity-2.11.12 → socketsecurity-2.11.14}/uv.lock +58 -58
  19. {socketsecurity-2.11.12 → socketsecurity-2.11.14}/.github/CODEOWNERS +0 -0
  20. {socketsecurity-2.11.12 → socketsecurity-2.11.14}/.github/PULL_REQUEST_TEMPLATE/bug-fix.md +0 -0
  21. {socketsecurity-2.11.12 → socketsecurity-2.11.14}/.github/PULL_REQUEST_TEMPLATE/feature.md +0 -0
  22. {socketsecurity-2.11.12 → socketsecurity-2.11.14}/.github/PULL_REQUEST_TEMPLATE/improvement.md +0 -0
  23. {socketsecurity-2.11.12 → socketsecurity-2.11.14}/.github/PULL_REQUEST_TEMPLATE.md +0 -0
  24. {socketsecurity-2.11.12 → socketsecurity-2.11.14}/.github/actions/setup-docker/action.yml +0 -0
  25. {socketsecurity-2.11.12 → socketsecurity-2.11.14}/.github/actions/setup-hatch/action.yml +0 -0
  26. {socketsecurity-2.11.12 → socketsecurity-2.11.14}/.github/actions/setup-sfw/action.yml +0 -0
  27. {socketsecurity-2.11.12 → socketsecurity-2.11.14}/.github/dependabot.yml +0 -0
  28. {socketsecurity-2.11.12 → socketsecurity-2.11.14}/.github/workflows/dependency-audit.yml +0 -0
  29. {socketsecurity-2.11.12 → socketsecurity-2.11.14}/.github/workflows/dependency-review.yml +0 -0
  30. {socketsecurity-2.11.12 → socketsecurity-2.11.14}/.github/workflows/docker-stable.yml +0 -0
  31. {socketsecurity-2.11.12 → socketsecurity-2.11.14}/.github/workflows/e2e-test.yml +0 -0
  32. {socketsecurity-2.11.12 → socketsecurity-2.11.14}/.github/workflows/package-check.yml +0 -0
  33. {socketsecurity-2.11.12 → socketsecurity-2.11.14}/.github/workflows/pr-preview.yml +0 -0
  34. {socketsecurity-2.11.12 → socketsecurity-2.11.14}/.github/workflows/python-tests.yml +0 -0
  35. {socketsecurity-2.11.12 → socketsecurity-2.11.14}/.github/workflows/release.yml +0 -0
  36. {socketsecurity-2.11.12 → socketsecurity-2.11.14}/.github/workflows/version-check.yml +0 -0
  37. {socketsecurity-2.11.12 → socketsecurity-2.11.14}/.github/zizmor.yml +0 -0
  38. {socketsecurity-2.11.12 → socketsecurity-2.11.14}/.gitignore +0 -0
  39. {socketsecurity-2.11.12 → socketsecurity-2.11.14}/.hooks/sync_version.py +0 -0
  40. {socketsecurity-2.11.12 → socketsecurity-2.11.14}/.pre-commit-config.yaml +0 -0
  41. {socketsecurity-2.11.12 → socketsecurity-2.11.14}/.python-version +0 -0
  42. {socketsecurity-2.11.12 → socketsecurity-2.11.14}/CONTRIBUTING.md +0 -0
  43. {socketsecurity-2.11.12 → socketsecurity-2.11.14}/Dockerfile +0 -0
  44. {socketsecurity-2.11.12 → socketsecurity-2.11.14}/Dockerfile.preview +0 -0
  45. {socketsecurity-2.11.12 → socketsecurity-2.11.14}/LICENSE +0 -0
  46. {socketsecurity-2.11.12 → socketsecurity-2.11.14}/Makefile +0 -0
  47. {socketsecurity-2.11.12 → socketsecurity-2.11.14}/README.md +0 -0
  48. {socketsecurity-2.11.12 → socketsecurity-2.11.14}/benchmarks/manifest_discovery.py +0 -0
  49. {socketsecurity-2.11.12 → socketsecurity-2.11.14}/docs/ci-cd.md +0 -0
  50. {socketsecurity-2.11.12 → socketsecurity-2.11.14}/docs/development.md +0 -0
  51. {socketsecurity-2.11.12 → socketsecurity-2.11.14}/examples/config/sarif-dashboard-parity.json +0 -0
  52. {socketsecurity-2.11.12 → socketsecurity-2.11.14}/examples/config/sarif-dashboard-parity.toml +0 -0
  53. {socketsecurity-2.11.12 → socketsecurity-2.11.14}/examples/config/sarif-diff-ci-cd.json +0 -0
  54. {socketsecurity-2.11.12 → socketsecurity-2.11.14}/examples/config/sarif-diff-ci-cd.toml +0 -0
  55. {socketsecurity-2.11.12 → socketsecurity-2.11.14}/examples/config/sarif-instance-detail.json +0 -0
  56. {socketsecurity-2.11.12 → socketsecurity-2.11.14}/examples/config/sarif-instance-detail.toml +0 -0
  57. {socketsecurity-2.11.12 → socketsecurity-2.11.14}/instructions/gitlab-commit-status/uat.md +0 -0
  58. {socketsecurity-2.11.12 → socketsecurity-2.11.14}/pytest.ini +0 -0
  59. {socketsecurity-2.11.12 → socketsecurity-2.11.14}/scripts/build_container.sh +0 -0
  60. {socketsecurity-2.11.12 → socketsecurity-2.11.14}/scripts/build_container_flexible.sh +0 -0
  61. {socketsecurity-2.11.12 → socketsecurity-2.11.14}/scripts/deploy-test-docker.sh +0 -0
  62. {socketsecurity-2.11.12 → socketsecurity-2.11.14}/scripts/deploy-test-pypi.sh +0 -0
  63. {socketsecurity-2.11.12 → socketsecurity-2.11.14}/scripts/docker-entrypoint.sh +0 -0
  64. {socketsecurity-2.11.12 → socketsecurity-2.11.14}/scripts/run.sh +0 -0
  65. {socketsecurity-2.11.12 → socketsecurity-2.11.14}/session.md +0 -0
  66. {socketsecurity-2.11.12 → socketsecurity-2.11.14}/socket.yml +0 -0
  67. {socketsecurity-2.11.12 → socketsecurity-2.11.14}/socketsecurity/core/__init__.py +0 -0
  68. {socketsecurity-2.11.12 → socketsecurity-2.11.14}/socketsecurity/core/alert_selection.py +0 -0
  69. {socketsecurity-2.11.12 → socketsecurity-2.11.14}/socketsecurity/core/classes.py +0 -0
  70. {socketsecurity-2.11.12 → socketsecurity-2.11.14}/socketsecurity/core/cli_client.py +0 -0
  71. {socketsecurity-2.11.12 → socketsecurity-2.11.14}/socketsecurity/core/cli_run.py +0 -0
  72. {socketsecurity-2.11.12 → socketsecurity-2.11.14}/socketsecurity/core/exceptions.py +0 -0
  73. {socketsecurity-2.11.12 → socketsecurity-2.11.14}/socketsecurity/core/git_remote.py +0 -0
  74. {socketsecurity-2.11.12 → socketsecurity-2.11.14}/socketsecurity/core/helper/__init__.py +0 -0
  75. {socketsecurity-2.11.12 → socketsecurity-2.11.14}/socketsecurity/core/helper/socket_facts_loader.py +0 -0
  76. {socketsecurity-2.11.12 → socketsecurity-2.11.14}/socketsecurity/core/lazy_file_loader.py +0 -0
  77. {socketsecurity-2.11.12 → socketsecurity-2.11.14}/socketsecurity/core/log_uploader.py +0 -0
  78. {socketsecurity-2.11.12 → socketsecurity-2.11.14}/socketsecurity/core/logging.py +0 -0
  79. {socketsecurity-2.11.12 → socketsecurity-2.11.14}/socketsecurity/core/resource_utils.py +0 -0
  80. {socketsecurity-2.11.12 → socketsecurity-2.11.14}/socketsecurity/core/scm/__init__.py +0 -0
  81. {socketsecurity-2.11.12 → socketsecurity-2.11.14}/socketsecurity/core/scm/base.py +0 -0
  82. {socketsecurity-2.11.12 → socketsecurity-2.11.14}/socketsecurity/core/scm/client.py +0 -0
  83. {socketsecurity-2.11.12 → socketsecurity-2.11.14}/socketsecurity/core/scm/github.py +0 -0
  84. {socketsecurity-2.11.12 → socketsecurity-2.11.14}/socketsecurity/core/scm/gitlab.py +0 -0
  85. {socketsecurity-2.11.12 → socketsecurity-2.11.14}/socketsecurity/core/scm_comments.py +0 -0
  86. {socketsecurity-2.11.12 → socketsecurity-2.11.14}/socketsecurity/core/socket_config.py +0 -0
  87. {socketsecurity-2.11.12 → socketsecurity-2.11.14}/socketsecurity/core/streaming.py +0 -0
  88. {socketsecurity-2.11.12 → socketsecurity-2.11.14}/socketsecurity/core/tools/coana-cache.mjs +0 -0
  89. {socketsecurity-2.11.12 → socketsecurity-2.11.14}/socketsecurity/core/utils.py +0 -0
  90. {socketsecurity-2.11.12 → socketsecurity-2.11.14}/socketsecurity/fossa_compat.py +0 -0
  91. {socketsecurity-2.11.12 → socketsecurity-2.11.14}/socketsecurity/output.py +0 -0
  92. {socketsecurity-2.11.12 → socketsecurity-2.11.14}/socketsecurity/plugins/__init__.py +0 -0
  93. {socketsecurity-2.11.12 → socketsecurity-2.11.14}/socketsecurity/plugins/base.py +0 -0
  94. {socketsecurity-2.11.12 → socketsecurity-2.11.14}/socketsecurity/plugins/formatters/__init__.py +0 -0
  95. {socketsecurity-2.11.12 → socketsecurity-2.11.14}/socketsecurity/plugins/formatters/slack.py +0 -0
  96. {socketsecurity-2.11.12 → socketsecurity-2.11.14}/socketsecurity/plugins/jira.py +0 -0
  97. {socketsecurity-2.11.12 → socketsecurity-2.11.14}/socketsecurity/plugins/manager.py +0 -0
  98. {socketsecurity-2.11.12 → socketsecurity-2.11.14}/socketsecurity/plugins/slack.py +0 -0
  99. {socketsecurity-2.11.12 → socketsecurity-2.11.14}/socketsecurity/plugins/teams.py +0 -0
  100. {socketsecurity-2.11.12 → socketsecurity-2.11.14}/socketsecurity/plugins/webhook.py +0 -0
  101. {socketsecurity-2.11.12 → socketsecurity-2.11.14}/tests/__init__.py +0 -0
  102. {socketsecurity-2.11.12 → socketsecurity-2.11.14}/tests/core/conftest.py +0 -0
  103. {socketsecurity-2.11.12 → socketsecurity-2.11.14}/tests/core/create_diff_input.json +0 -0
  104. {socketsecurity-2.11.12 → socketsecurity-2.11.14}/tests/core/test_diff_alerts.py +0 -0
  105. {socketsecurity-2.11.12 → socketsecurity-2.11.14}/tests/core/test_diff_generation.py +0 -0
  106. {socketsecurity-2.11.12 → socketsecurity-2.11.14}/tests/core/test_diff_scan_polling.py +0 -0
  107. {socketsecurity-2.11.12 → socketsecurity-2.11.14}/tests/core/test_facts_compression.py +0 -0
  108. {socketsecurity-2.11.12 → socketsecurity-2.11.14}/tests/core/test_full_scan_outputs.py +0 -0
  109. {socketsecurity-2.11.12 → socketsecurity-2.11.14}/tests/core/test_has_manifest_files.py +0 -0
  110. {socketsecurity-2.11.12 → socketsecurity-2.11.14}/tests/core/test_invalid_facts_marker.py +0 -0
  111. {socketsecurity-2.11.12 → socketsecurity-2.11.14}/tests/core/test_package_and_alerts.py +0 -0
  112. {socketsecurity-2.11.12 → socketsecurity-2.11.14}/tests/core/test_sdk_methods.py +0 -0
  113. {socketsecurity-2.11.12 → socketsecurity-2.11.14}/tests/core/test_supporting_methods.py +0 -0
  114. {socketsecurity-2.11.12 → socketsecurity-2.11.14}/tests/data/fullscans/create_response.json +0 -0
  115. {socketsecurity-2.11.12 → socketsecurity-2.11.14}/tests/data/fullscans/diff/stream_diff.json +0 -0
  116. {socketsecurity-2.11.12 → socketsecurity-2.11.14}/tests/data/fullscans/diff/stream_diff_full.json +0 -0
  117. {socketsecurity-2.11.12 → socketsecurity-2.11.14}/tests/data/fullscans/head_scan/metadata.json +0 -0
  118. {socketsecurity-2.11.12 → socketsecurity-2.11.14}/tests/data/fullscans/head_scan/stream_scan.json +0 -0
  119. {socketsecurity-2.11.12 → socketsecurity-2.11.14}/tests/data/fullscans/head_scan/stream_scan_full.json +0 -0
  120. {socketsecurity-2.11.12 → socketsecurity-2.11.14}/tests/data/fullscans/new_scan/metadata.json +0 -0
  121. {socketsecurity-2.11.12 → socketsecurity-2.11.14}/tests/data/fullscans/new_scan/stream_scan.json +0 -0
  122. {socketsecurity-2.11.12 → socketsecurity-2.11.14}/tests/data/repos/repo_info_error.json +0 -0
  123. {socketsecurity-2.11.12 → socketsecurity-2.11.14}/tests/data/repos/repo_info_no_head.json +0 -0
  124. {socketsecurity-2.11.12 → socketsecurity-2.11.14}/tests/data/repos/repo_info_success.json +0 -0
  125. {socketsecurity-2.11.12 → socketsecurity-2.11.14}/tests/data/settings/security-policy.json +0 -0
  126. {socketsecurity-2.11.12 → socketsecurity-2.11.14}/tests/e2e/fixtures/simple-npm/index.js +0 -0
  127. {socketsecurity-2.11.12 → socketsecurity-2.11.14}/tests/e2e/fixtures/simple-npm/package.json +0 -0
  128. {socketsecurity-2.11.12 → socketsecurity-2.11.14}/tests/e2e/fixtures/simple-pypi/requirements.txt +0 -0
  129. {socketsecurity-2.11.12 → socketsecurity-2.11.14}/tests/e2e/reach-facts-probe.sh +0 -0
  130. {socketsecurity-2.11.12 → socketsecurity-2.11.14}/tests/e2e/validate-gitlab.sh +0 -0
  131. {socketsecurity-2.11.12 → socketsecurity-2.11.14}/tests/e2e/validate-json.sh +0 -0
  132. {socketsecurity-2.11.12 → socketsecurity-2.11.14}/tests/e2e/validate-reachability.sh +0 -0
  133. {socketsecurity-2.11.12 → socketsecurity-2.11.14}/tests/e2e/validate-sarif.sh +0 -0
  134. {socketsecurity-2.11.12 → socketsecurity-2.11.14}/tests/e2e/validate-scan.sh +0 -0
  135. {socketsecurity-2.11.12 → socketsecurity-2.11.14}/tests/fixtures/fossa/README.md +0 -0
  136. {socketsecurity-2.11.12 → socketsecurity-2.11.14}/tests/fixtures/fossa/fossa-analyze-empty.json +0 -0
  137. {socketsecurity-2.11.12 → socketsecurity-2.11.14}/tests/fixtures/fossa/fossa-analyze-populated.json +0 -0
  138. {socketsecurity-2.11.12 → socketsecurity-2.11.14}/tests/fixtures/fossa/fossa-sbom-empty-deep.json +0 -0
  139. {socketsecurity-2.11.12 → socketsecurity-2.11.14}/tests/fixtures/fossa/fossa-sbom-populated.json +0 -0
  140. {socketsecurity-2.11.12 → socketsecurity-2.11.14}/tests/unit/__init__.py +0 -0
  141. {socketsecurity-2.11.12 → socketsecurity-2.11.14}/tests/unit/test_alert_selection.py +0 -0
  142. {socketsecurity-2.11.12 → socketsecurity-2.11.14}/tests/unit/test_cli_config.py +0 -0
  143. {socketsecurity-2.11.12 → socketsecurity-2.11.14}/tests/unit/test_cli_run.py +0 -0
  144. {socketsecurity-2.11.12 → socketsecurity-2.11.14}/tests/unit/test_client.py +0 -0
  145. {socketsecurity-2.11.12 → socketsecurity-2.11.14}/tests/unit/test_commit_message_truncation.py +0 -0
  146. {socketsecurity-2.11.12 → socketsecurity-2.11.14}/tests/unit/test_dependency_overview.py +0 -0
  147. {socketsecurity-2.11.12 → socketsecurity-2.11.14}/tests/unit/test_disable_ignore.py +0 -0
  148. {socketsecurity-2.11.12 → socketsecurity-2.11.14}/tests/unit/test_exclude_paths.py +0 -0
  149. {socketsecurity-2.11.12 → socketsecurity-2.11.14}/tests/unit/test_fossa_parity.py +0 -0
  150. {socketsecurity-2.11.12 → socketsecurity-2.11.14}/tests/unit/test_full_scan_retry.py +0 -0
  151. {socketsecurity-2.11.12 → socketsecurity-2.11.14}/tests/unit/test_git_interface.py +0 -0
  152. {socketsecurity-2.11.12 → socketsecurity-2.11.14}/tests/unit/test_git_remote.py +0 -0
  153. {socketsecurity-2.11.12 → socketsecurity-2.11.14}/tests/unit/test_github_buildkite_config.py +0 -0
  154. {socketsecurity-2.11.12 → socketsecurity-2.11.14}/tests/unit/test_gitlab_auth.py +0 -0
  155. {socketsecurity-2.11.12 → socketsecurity-2.11.14}/tests/unit/test_gitlab_auth_fallback.py +0 -0
  156. {socketsecurity-2.11.12 → socketsecurity-2.11.14}/tests/unit/test_gitlab_commit_status.py +0 -0
  157. {socketsecurity-2.11.12 → socketsecurity-2.11.14}/tests/unit/test_gitlab_format.py +0 -0
  158. {socketsecurity-2.11.12 → socketsecurity-2.11.14}/tests/unit/test_ignore_authorization.py +0 -0
  159. {socketsecurity-2.11.12 → socketsecurity-2.11.14}/tests/unit/test_ignore_telemetry_filtering.py +0 -0
  160. {socketsecurity-2.11.12 → socketsecurity-2.11.14}/tests/unit/test_include_dirs.py +0 -0
  161. {socketsecurity-2.11.12 → socketsecurity-2.11.14}/tests/unit/test_log_uploader.py +0 -0
  162. {socketsecurity-2.11.12 → socketsecurity-2.11.14}/tests/unit/test_manifest_discovery.py +0 -0
  163. {socketsecurity-2.11.12 → socketsecurity-2.11.14}/tests/unit/test_output.py +0 -0
  164. {socketsecurity-2.11.12 → socketsecurity-2.11.14}/tests/unit/test_reachability.py +0 -0
  165. {socketsecurity-2.11.12 → socketsecurity-2.11.14}/tests/unit/test_scan_scope.py +0 -0
  166. {socketsecurity-2.11.12 → socketsecurity-2.11.14}/tests/unit/test_slack_plugin.py +0 -0
  167. {socketsecurity-2.11.12 → socketsecurity-2.11.14}/tests/unit/test_slack_severity_normalization.py +0 -0
  168. {socketsecurity-2.11.12 → socketsecurity-2.11.14}/tests/unit/test_socketcli.py +0 -0
  169. {socketsecurity-2.11.12 → socketsecurity-2.11.14}/tests/unit/test_streaming.py +0 -0
  170. {socketsecurity-2.11.12 → socketsecurity-2.11.14}/tests/unit/test_summary_text.py +0 -0
  171. {socketsecurity-2.11.12 → socketsecurity-2.11.14}/tests/unit/test_tier1_finalize.py +0 -0
  172. {socketsecurity-2.11.12 → socketsecurity-2.11.14}/tests/unit/test_user_agent.py +0 -0
  173. {socketsecurity-2.11.12 → socketsecurity-2.11.14}/workflows/bitbucket-pipelines.yml +0 -0
  174. {socketsecurity-2.11.12 → socketsecurity-2.11.14}/workflows/buildkite.yml +0 -0
  175. {socketsecurity-2.11.12 → socketsecurity-2.11.14}/workflows/github-actions.yml +0 -0
  176. {socketsecurity-2.11.12 → socketsecurity-2.11.14}/workflows/gitlab-ci.yml +0 -0
@@ -1,5 +1,41 @@
1
1
  # Changelog
2
2
 
3
+ ## 2.11.14
4
+
5
+ ### Changed: bump pinned Coana CLI to 15.15.0
6
+
7
+ - Bumped the pinned reachability engine (the Coana CLI) from `15.14.2` to
8
+ `15.15.0`. See the
9
+ [reachability analysis changelog](https://docs.socket.dev/docs/reachability-analysis-changelog)
10
+ for engine changes.
11
+
12
+ ## 2.11.13
13
+
14
+ ### Changed: `--repo` takes a repository slug
15
+
16
+ - `--repo` takes the repository slug without its owner (`my-repo`, not
17
+ `my-org/my-repo`). A value containing `/` now exits `1` and names the slug to
18
+ use. Pass the owner with `--workspace`.
19
+
20
+ ### Fixed: manifest links in pull request comments
21
+
22
+ - Manifest links in GitHub, GitLab and Bitbucket comments now include the
23
+ repository owner. When the CLI can't determine the owner, they link to the
24
+ Socket report instead.
25
+
26
+ ### Deprecated: `--pending-head`
27
+
28
+ - `--pending-head` has no effect and logs a deprecation warning. Use
29
+ `--default-branch`.
30
+
31
+ ### Docs: reachability network access
32
+
33
+ - Documented the hosts `--reach` needs: `api.socket.dev`,
34
+ `storage.googleapis.com` for the analysis engine download, and each scanned
35
+ ecosystem's package registry for dependency installs. Covers what fails when
36
+ each is blocked, including dependencies reported as `INSTALL ERROR` while the
37
+ scan still completes, and that the CLI and engine honor `HTTPS_PROXY`.
38
+
3
39
  ## 2.11.12
4
40
 
5
41
  ### Changed: bump pinned Coana CLI to 15.14.2
@@ -132,6 +168,9 @@ their changes ship here.
132
168
 
133
169
  ## 2.11.1
134
170
 
171
+ Version 2.11.0 was never published to PyPI or Docker Hub; its changes ship
172
+ here.
173
+
135
174
  ### Changed: bump pinned Coana CLI to 15.12.10
136
175
 
137
176
  - Bumped the pinned reachability engine (the Coana CLI) from `15.12.8` to
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.5
2
2
  Name: socketsecurity
3
- Version: 2.11.12
3
+ Version: 2.11.14
4
4
  Summary: Socket Security CLI for CI/CD
5
5
  Project-URL: Homepage, https://socket.dev
6
6
  Author-email: Douglas Coburn <douglas@socket.dev>
@@ -46,17 +46,17 @@ Requires-Dist: python-dotenv==1.2.4
46
46
  Requires-Dist: requests==2.34.2
47
47
  Requires-Dist: socketdev==3.6.2
48
48
  Provides-Extra: dev
49
- Requires-Dist: hatch==1.18.1; extra == 'dev'
49
+ Requires-Dist: hatch==1.18.2; extra == 'dev'
50
50
  Requires-Dist: pre-commit==4.7.0; extra == 'dev'
51
- Requires-Dist: ruff==0.17.2; extra == 'dev'
51
+ Requires-Dist: ruff==0.17.3; extra == 'dev'
52
52
  Requires-Dist: twine==7.0.0; extra == 'dev'
53
- Requires-Dist: uv==0.13.5; extra == 'dev'
53
+ Requires-Dist: uv==0.13.6; extra == 'dev'
54
54
  Provides-Extra: test
55
- Requires-Dist: pytest-asyncio==1.4.0; extra == 'test'
55
+ Requires-Dist: pytest-asyncio==1.4.1; extra == 'test'
56
56
  Requires-Dist: pytest-cov==7.1.0; extra == 'test'
57
57
  Requires-Dist: pytest-mock==3.17.0; extra == 'test'
58
58
  Requires-Dist: pytest-watch==4.2.0; extra == 'test'
59
- Requires-Dist: pytest==9.1.1; extra == 'test'
59
+ Requires-Dist: pytest==9.2.0; extra == 'test'
60
60
  Description-Content-Type: text/markdown
61
61
 
62
62
  # Socket Security CLI
@@ -154,7 +154,7 @@ These are two full-scan uploads, two server-side graphs, and two repository head
154
154
  **Generate GitLab Security Dashboard report:**
155
155
  ```bash
156
156
  socketcli --enable-gitlab-security \
157
- --repo owner/repo \
157
+ --repo my-repo \
158
158
  --target-path .
159
159
  ```
160
160
 
@@ -167,7 +167,7 @@ This will:
167
167
  **Save SARIF report to file (e.g. for GitHub Code Scanning, SonarQube, or VS Code):**
168
168
  ```bash
169
169
  socketcli --sarif-file results.sarif \
170
- --repo owner/repo \
170
+ --repo my-repo \
171
171
  --target-path .
172
172
  ```
173
173
 
@@ -176,7 +176,7 @@ socketcli --sarif-file results.sarif \
176
176
  socketcli --enable-json \
177
177
  --sarif-file results.sarif \
178
178
  --enable-gitlab-security \
179
- --repo owner/repo
179
+ --repo my-repo
180
180
  ```
181
181
 
182
182
  This will simultaneously generate:
@@ -212,7 +212,7 @@ socketcli [-h] [--api-token API_TOKEN] [--repo REPO] [--workspace WORKSPACE] [--
212
212
  [--base-scan-id BASE_SCAN_ID | --base-commit-sha BASE_COMMIT_SHA]
213
213
  [--target-path TARGET_PATH] [--sbom-file SBOM_FILE] [--license-file-name LICENSE_FILE_NAME] [--save-submitted-files-list SAVE_SUBMITTED_FILES_LIST]
214
214
  [--save-manifest-tar SAVE_MANIFEST_TAR] [--files FILES] [--sub-path SUB_PATH] [--workspace-name WORKSPACE_NAME]
215
- [--excluded-ecosystems EXCLUDED_ECOSYSTEMS] [--exclude-paths EXCLUDE_PATHS] [--include-dirs INCLUDE_DIRS] [--default-branch] [--pending-head] [--generate-license] [--enable-debug]
215
+ [--excluded-ecosystems EXCLUDED_ECOSYSTEMS] [--exclude-paths EXCLUDE_PATHS] [--include-dirs INCLUDE_DIRS] [--default-branch] [--generate-license] [--enable-debug]
216
216
  [--enable-json] [--enable-sarif] [--sarif-file <path>] [--sarif-scope {diff,full}] [--sarif-grouping {instance,alert}] [--sarif-reachability {all,reachable,potentially,reachable-or-potentially}] [--enable-gitlab-security] [--gitlab-security-file <path>]
217
217
  [--disable-overview] [--exclude-license-details] [--allow-unverified] [--disable-security-issue]
218
218
  [--ignore-commit-files] [--disable-blocking] [--disable-ignore] [--enable-diff] [--scm SCM] [--timeout TIMEOUT] [--include-module-folders]
@@ -235,7 +235,7 @@ If you don't want to provide the Socket API Token every time then you can use th
235
235
  #### Repository
236
236
  | Parameter | Required | Default | Description |
237
237
  |:-----------------|:---------|:--------|:------------------------------------------------------------------------------------------------------------------|
238
- | `--repo` | False | *auto* | Repository name in owner/repo format (auto-detected from git remote) |
238
+ | `--repo` | False | *auto* | Repository slug in Socket, without the owner: `my-repo`, not `my-org/my-repo`. Auto-detected from the git remote. A value containing `/` is rejected; use `--workspace` for the owner. |
239
239
  | `--workspace` | False | | The Socket workspace to associate the scan with (e.g. `my-org` in `my-org/my-repo`). See note below. |
240
240
  | `--repo-is-public` | False | False | If set, flags a new repository creation as public. Defaults to false. |
241
241
  | `--integration` | False | api | Integration type (api, github, gitlab, azure, bitbucket). When omitted, `--scm github` or `--scm gitlab` implies the matching integration. |
@@ -308,7 +308,6 @@ If you don't want to provide the Socket API Token every time then you can use th
308
308
  | Parameter | Required | Default | Description |
309
309
  |:-------------------------|:---------|:--------|:------------------------------------------------------------------------------------------------------|
310
310
  | `--default-branch` | False | *auto* | Make this branch the default branch (auto-detected from git and CI environment when not specified) |
311
- | `--pending-head` | False | *auto* | If true, the new scan will be set as the branch's head scan (automatically synced with default-branch) |
312
311
  | `--include-module-folders` | False | False | If enabled, re-includes the JS/TS module folders (`node_modules`, `bower_components`, `jspm_packages`) in manifest discovery. For other excluded directories, use `--include-dirs`. |
313
312
 
314
313
  #### Output Configuration
@@ -338,7 +337,7 @@ If you don't want to provide the Socket API Token every time then you can use th
338
337
  | Parameter | Required | Default | Description |
339
338
  |:---------------------------------|:---------|:--------|:---------------------------------------------------------------------------------------------------------------------------|
340
339
  | `--reach` | False | False | Enable reachability analysis to identify which vulnerable functions are actually called by your code. Creates a full application reachability scan (`scan_type=socket_tier1`). |
341
- | `--reach-version` | False | 15.14.2 | Version of the Coana CLI to use. Defaults to the pinned version that ships with this CLI release, so the engine only changes when you upgrade the Socket CLI. Pass `latest` to always use the newest published version (opt-in auto-update), or an explicit version (e.g. `1.2.3`) to pin it. |
340
+ | `--reach-version` | False | 15.15.0 | Version of the Coana CLI to use. Defaults to the pinned version that ships with this CLI release, so the engine only changes when you upgrade the Socket CLI. Pass `latest` to always use the newest published version (opt-in auto-update), or an explicit version (e.g. `1.2.3`) to pin it. |
342
341
  | `--reach-analysis-timeout` | False | 10m | Timeout for each reachability analysis run, e.g. `90s`, `10m` or `1h`. Omitted by default, so coana applies its own default (`10m`). Alias: `--reach-timeout` |
343
342
  | `--reach-analysis-memory-limit` | False | 8GB | Memory limit for each reachability analysis run, e.g. `512MB` or `8GB`. Omitted by default, so coana applies its own default (`8GB`). Alias: `--reach-memory-limit` |
344
343
  | `--reach-concurrency` | False | 1 | Control parallel analysis execution (must be >= 1). Omitted by default, so coana applies its own default. |
@@ -366,6 +365,20 @@ The Python CLI verifies the following **up front** (before invoking the analysis
366
365
 
367
366
  Separately, the analysis engine (coana) needs the **per-ecosystem build toolchain** for whatever languages your project uses — e.g. a compatible Python interpreter (3.11+, or PyPy) for Python, a JDK for Java/Kotlin/Scala, .NET 6+ for C#, the matching Go toolchain for Go, etc. These are validated by the engine **at analysis time** (the CLI does not pre-check them) and that validation can be skipped with `--reach-disable-external-tool-checks`.
368
367
 
368
+ **Reachability network access:**
369
+
370
+ `--reach` downloads the analysis engine on first use and installs your project's dependencies to analyze them. On a restricted network, allow:
371
+
372
+ | Host | Used for | If blocked |
373
+ |---|---|---|
374
+ | `api.socket.dev` | Socket API calls, and a signed URL for the engine download | The CLI fails |
375
+ | `storage.googleapis.com` | Downloading the engine and its analyzers (about 120 MB) | The CLI exits with code **3**: `Failed to run reachability analysis: HTTPSConnectionPool(host='storage.googleapis.com', ...)` |
376
+ | The package registry of each scanned ecosystem, for example `registry.npmjs.org` | Installing your project's dependencies for analysis | The scan still completes, but the affected vulnerabilities are reported as `INSTALL ERROR` with no reachability result |
377
+
378
+ The engine comes from Socket, not npm, so an npm mirror or registry proxy does not cover the engine download. The registry row does not apply when your dependencies are already installed in the target path, for example a `node_modules` directory from an earlier `npm ci`. The engine is cached as described below; with a warm cache, `storage.googleapis.com` is not contacted.
379
+
380
+ Behind an HTTP(S) proxy, set `HTTPS_PROXY`. The CLI, the engine download and the engine itself all send their requests through it.
381
+
369
382
  **Reachability analysis types:**
370
383
 
371
384
  Socket's reachability analysis comes in three forms, referred to by their full names rather than the older "Tier" numbering:
@@ -551,7 +564,7 @@ export SOCKET_SLACK_BOT_TOKEN="xoxb-your-bot-token-here"
551
564
 
552
565
  Webhook mode (`url_configs`):
553
566
  - `reachability_alerts_only` (boolean, default: false): When `--reach` is enabled, only send reachable vulnerabilities from the selected diff alert set (uses reachability facts when available; otherwise falls back to blocking-status behavior)
554
- - `repos` (array): Only send alerts for specific repositories (e.g., `["owner/repo1", "owner/repo2"]`)
567
+ - `repos` (array): Only send alerts for specific repositories, matched against the `--repo` slug without the owner (e.g., `["my-repo1", "my-repo2"]`)
555
568
  - `alert_types` (array): Only send specific alert types (e.g., `["malware", "typosquat"]`)
556
569
  - `severities` (array): Only send alerts with specific severities (e.g., `["high", "critical"]`)
557
570
 
@@ -683,7 +696,7 @@ The CLI uses intelligent default branch detection with the following priority:
683
696
  3. **Git repository analysis**: Compares current branch with repository's default branch
684
697
  4. **Fallback**: Defaults to `false` if none of the above methods succeed
685
698
 
686
- Both `--default-branch` and `--pending-head` parameters are automatically synchronized to ensure consistent behavior.
699
+ A scan on the default branch also becomes that branch's head scan. `--pending-head` is deprecated and has no effect: it is still accepted so existing pipelines keep working, but it logs a warning. Use `--default-branch` instead.
687
700
 
688
701
  ## Who can ignore an alert
689
702
 
@@ -763,7 +776,7 @@ Socket CLI can generate reports compatible with GitLab's Security Dashboard, all
763
776
  To generate a GitLab-compatible security report:
764
777
 
765
778
  ```bash
766
- socketcli --enable-gitlab-security --repo owner/repo
779
+ socketcli --enable-gitlab-security --repo my-repo
767
780
  ```
768
781
 
769
782
  This creates a `gl-dependency-scanning-report.json` file following GitLab's Dependency Scanning report schema.
@@ -782,7 +795,7 @@ socket_security_scan:
782
795
  script:
783
796
  - socketcli
784
797
  --api-token $SOCKET_API_TOKEN
785
- --repo $CI_PROJECT_PATH
798
+ --repo $CI_PROJECT_NAME
786
799
  --branch $CI_COMMIT_REF_NAME
787
800
  --commit-sha $CI_COMMIT_SHA
788
801
  --enable-gitlab-security
@@ -36,6 +36,12 @@ total before assuming either path is at fault.
36
36
  - In `--sarif-scope full` with `--sarif-file`, SARIF JSON is written to file and stdout JSON is suppressed.
37
37
  - `--sarif-grouping alert` currently applies to `--sarif-scope full`.
38
38
 
39
+ ## Reachability on a restricted network
40
+
41
+ - `Failed to run reachability analysis: HTTPSConnectionPool(host='storage.googleapis.com', ...)`: the engine download is blocked. Allow `storage.googleapis.com`, or set `HTTPS_PROXY`. An npm mirror does not cover it.
42
+ - Every vulnerability reported as `INSTALL ERROR`: the engine could not install your dependencies. Allow the ecosystem's package registry, or install dependencies in the target path before running `--reach`.
43
+ - See **Reachability network access** in the [CLI reference](cli-reference.md) for the full list of hosts.
44
+
39
45
  ## Dashboard vs CLI result counts
40
46
 
41
47
  Differences in result counts can be valid, even when filtering appears similar.
@@ -1,12 +1,12 @@
1
1
  [build-system]
2
2
  requires = [
3
- "hatchling==1.32.4"
3
+ "hatchling==1.33.0"
4
4
  ]
5
5
  build-backend = "hatchling.build"
6
6
 
7
7
  [project]
8
8
  name = "socketsecurity"
9
- version = "2.11.12"
9
+ version = "2.11.14"
10
10
  requires-python = ">= 3.11"
11
11
  license = {"file" = "LICENSE"}
12
12
  dependencies = [
@@ -44,18 +44,18 @@ classifiers = [
44
44
 
45
45
  [project.optional-dependencies]
46
46
  test = [
47
- "pytest==9.1.1",
47
+ "pytest==9.2.0",
48
48
  "pytest-cov==7.1.0",
49
49
  "pytest-mock==3.17.0",
50
- "pytest-asyncio==1.4.0",
50
+ "pytest-asyncio==1.4.1",
51
51
  "pytest-watch==4.2.0"
52
52
  ]
53
53
  dev = [
54
- "ruff==0.17.2",
54
+ "ruff==0.17.3",
55
55
  "twine==7.0.0", # for building
56
- "uv==0.13.5", # for dependency management
56
+ "uv==0.13.6", # for dependency management
57
57
  "pre-commit==4.7.0",
58
- "hatch==1.18.1"
58
+ "hatch==1.18.2"
59
59
  ]
60
60
 
61
61
  [project.scripts]
@@ -1,4 +1,4 @@
1
1
  __author__ = 'socket.dev'
2
- __version__ = '2.11.12'
2
+ __version__ = '2.11.14'
3
3
  USER_AGENT_NAME = 'socket-python-cli'
4
4
  USER_AGENT = f'{USER_AGENT_NAME}/{__version__}'
@@ -197,6 +197,8 @@ class CliConfig:
197
197
  sub_paths: List[str] = field(default_factory=list)
198
198
  workspace_name: Optional[str] = None
199
199
  workspace: Optional[str] = None
200
+ # Web URL of the scanned repository, resolved at runtime; see resolve_repository_url.
201
+ repository_url: Optional[str] = None
200
202
  # Reachability Flags
201
203
  reach: bool = False
202
204
  reach_version: Optional[str] = None
@@ -448,6 +450,22 @@ class CliConfig:
448
450
  logging.error("--workspace-name requires --sub-path to be specified")
449
451
  exit(1)
450
452
 
453
+ # The API validates the repo as a slug, which can't contain "/", so an
454
+ # owner/repo value would otherwise fail later at repository creation.
455
+ if args.repo and "/" in args.repo:
456
+ suggested = args.repo.rstrip("/").rsplit("/", 1)[-1]
457
+ logging.error(
458
+ f"--repo takes the repository slug without its owner, but got '{args.repo}'. "
459
+ f"Use --repo {suggested}, and --workspace for the owner if your repositories use one."
460
+ )
461
+ exit(1)
462
+
463
+ if args.pending_head:
464
+ logging.warning(
465
+ "--pending-head is deprecated and has no effect. A scan becomes the head scan "
466
+ "when it runs on the default branch; use --default-branch to mark it as such."
467
+ )
468
+
451
469
  # argparse only enforces the mutually exclusive group for real CLI args;
452
470
  # this also catches both values arriving via a --config file.
453
471
  if args.base_scan_id and args.base_commit_sha:
@@ -527,8 +545,11 @@ def create_argument_parser() -> argparse.ArgumentParser:
527
545
  repo_group = parser.add_argument_group('Repository')
528
546
  repo_group.add_argument(
529
547
  "--repo",
530
- metavar="<owner/repo>",
531
- help="Repository name in owner/repo format",
548
+ metavar="<repo>",
549
+ help=(
550
+ "Repository slug in Socket, without the owner (e.g. my-repo, not my-org/my-repo). "
551
+ "Defaults to the git remote's repository name. Use --workspace for the owner."
552
+ ),
532
553
  required=False
533
554
  )
534
555
  repo_group.add_argument(
@@ -743,11 +764,12 @@ def create_argument_parser() -> argparse.ArgumentParser:
743
764
  action="store_true",
744
765
  help=argparse.SUPPRESS
745
766
  )
767
+ # Deprecated no-op, still accepted so existing pipelines don't fail to parse.
746
768
  config_group.add_argument(
747
769
  "--pending-head",
748
770
  dest="pending_head",
749
771
  action="store_true",
750
- help="If true, the new scan will be set as the branch's head scan"
772
+ help=argparse.SUPPRESS
751
773
  )
752
774
  config_group.add_argument(
753
775
  "--ignore-authorization",
@@ -74,8 +74,10 @@ class Git:
74
74
  log.debug(f"Commit committer: {self.commit.committer.name} <{self.commit.committer.email}>")
75
75
 
76
76
  # Extract repository name from git remote, with fallback to default
77
+ self.remote_url: str | None = None
77
78
  try:
78
79
  remote_url = self.repo.remotes.origin.url
80
+ self.remote_url = remote_url
79
81
  self.repo_name = remote_url.split('.git')[0].split('/')[-1]
80
82
  log.debug(f"Repository name detected from git remote: {self.repo_name}")
81
83
  except Exception as error:
@@ -1,6 +1,5 @@
1
1
  import json
2
2
  import logging
3
- import os
4
3
  import re
5
4
  import uuid
6
5
  from datetime import datetime, timezone
@@ -94,30 +93,12 @@ class Messages:
94
93
 
95
94
  # Generate URL based on SCM type using config information
96
95
  # NEVER use diff.diff_url for SCM URLs - those are Socket URLs for "View report" links
97
- if scm_type == "github":
98
- if config and hasattr(config, 'repo') and config.repo:
99
- # Get branch from config, default to main
100
- branch = getattr(config, 'branch', 'main') if hasattr(config, 'branch') and config.branch else 'main'
101
- # Construct GitHub URL from repo info (could be github.com or GitHub Enterprise)
102
- github_server = os.getenv('GITHUB_SERVER_URL', 'https://github.com')
103
- return f"{github_server}/{config.repo}/blob/{branch}/{clean_path}"
104
-
105
- elif scm_type == "gitlab":
106
- if config and hasattr(config, 'repo') and config.repo:
107
- # Get branch from config, default to main
108
- branch = getattr(config, 'branch', 'main') if hasattr(config, 'branch') and config.branch else 'main'
109
- # Construct GitLab URL from repo info (could be gitlab.com or self-hosted GitLab)
110
- gitlab_server = os.getenv('CI_SERVER_URL', 'https://gitlab.com')
111
- return f"{gitlab_server}/{config.repo}/-/blob/{branch}/{clean_path}"
112
-
113
- elif scm_type == "bitbucket":
114
- if config and hasattr(config, 'repo') and config.repo:
115
- # Get branch from config, default to main
116
- branch = getattr(config, 'branch', 'main') if hasattr(config, 'branch') and config.branch else 'main'
117
- # Construct Bitbucket URL from repo info (could be bitbucket.org or Bitbucket Server)
118
- bitbucket_server = os.getenv('BITBUCKET_SERVER_URL', 'https://bitbucket.org')
119
- return f"{bitbucket_server}/{config.repo}/src/{branch}/{clean_path}"
120
-
96
+ repository_url = getattr(config, 'repository_url', None) if config else None
97
+ if repository_url and scm_type in ("github", "gitlab", "bitbucket"):
98
+ branch = getattr(config, 'branch', None) or 'main'
99
+ blob_path = {"github": "blob", "gitlab": "-/blob", "bitbucket": "src"}[scm_type]
100
+ return f"{repository_url}/{blob_path}/{branch}/{clean_path}"
101
+
121
102
  # Fallback to Socket file view for API or unknown repository types
122
103
  if hasattr(diff, 'report_url') and diff.report_url:
123
104
  # Strip leading slash and URL encode for Socket dashboard
@@ -59,8 +59,10 @@ def _github_number(env: Mapping[str, str]) -> int:
59
59
  return parse_pull_request_number(match.group(1)) if match else 0
60
60
 
61
61
 
62
- def _github_url(number: int, repo: Optional[str], env: Mapping[str, str]) -> Optional[str]:
63
- remote_host, remote_path = parse_git_remote(env.get("BUILDKITE_REPO"))
62
+ def _github_repository_url(
63
+ repo: Optional[str], env: Mapping[str, str], remote_url: Optional[str] = None
64
+ ) -> Optional[str]:
65
+ remote_host, remote_path = parse_git_remote(env.get("BUILDKITE_REPO") or remote_url)
64
66
  # config.repo is only ever a bare repository name, so it cannot produce a
65
67
  # slug on its own; it is kept last for callers that pass a full owner/repo.
66
68
  repository = env.get("GITHUB_REPOSITORY") or remote_path or repo
@@ -71,13 +73,15 @@ def _github_url(number: int, repo: Optional[str], env: Mapping[str, str]) -> Opt
71
73
  or (_http_url(f"https://{remote_host}") if remote_host else None)
72
74
  or "https://github.com"
73
75
  )
74
- return f"{server}/{repository.strip('/')}/pull/{number}"
76
+ return f"{server}/{repository.strip('/')}"
75
77
 
76
78
 
77
- def _gitlab_url(number: int, repo: Optional[str], env: Mapping[str, str]) -> Optional[str]:
79
+ def _gitlab_project_url(
80
+ repo: Optional[str], env: Mapping[str, str], remote_url: Optional[str] = None
81
+ ) -> Optional[str]:
78
82
  project_url = _repository_url(env.get("CI_PROJECT_URL"))
79
83
  if not project_url:
80
- remote_host, remote_path = parse_git_remote(env.get("BUILDKITE_REPO"))
84
+ remote_host, remote_path = parse_git_remote(env.get("BUILDKITE_REPO") or remote_url)
81
85
  project_path = env.get("CI_PROJECT_PATH") or remote_path or repo
82
86
  server = (
83
87
  _http_url(env.get("CI_SERVER_URL"))
@@ -85,6 +89,66 @@ def _gitlab_url(number: int, repo: Optional[str], env: Mapping[str, str]) -> Opt
85
89
  )
86
90
  if server and project_path and "/" in project_path:
87
91
  project_url = f"{server}/{project_path.strip('/')}"
92
+ return project_url
93
+
94
+
95
+ def _bitbucket_repository_url(
96
+ repo: Optional[str], env: Mapping[str, str], remote_url: Optional[str] = None
97
+ ) -> Optional[str]:
98
+ remote_host, remote_path = parse_git_remote(remote_url)
99
+ repository = env.get("BITBUCKET_REPO_FULL_NAME") or remote_path or repo
100
+ if not repository or "/" not in repository:
101
+ return None
102
+ server = (
103
+ _http_url(env.get("BITBUCKET_SERVER_URL"))
104
+ or (_http_url(f"https://{remote_host}") if remote_host else None)
105
+ or "https://bitbucket.org"
106
+ )
107
+ return f"{server}/{repository.strip('/')}"
108
+
109
+
110
+ def resolve_repository_url(
111
+ scm: Optional[str],
112
+ repo: Optional[str] = None,
113
+ env: Optional[Mapping[str, str]] = None,
114
+ remote_url: Optional[str] = None,
115
+ ) -> Optional[str]:
116
+ """Return the web URL of the scanned repository, such as ``https://github.com/owner/repo``.
117
+
118
+ The CI environment wins, then the checkout's ``origin`` remote. ``None`` means the
119
+ owner could not be determined: ``config.repo`` is the Socket repository slug,
120
+ which has no owner, so a link built from it alone would point nowhere.
121
+ """
122
+ environment = env or {}
123
+ provider = str(scm or "").lower()
124
+ if provider == "github":
125
+ return _github_repository_url(repo, environment, remote_url)
126
+ if provider == "gitlab":
127
+ return _gitlab_project_url(repo, environment, remote_url)
128
+ if provider == "bitbucket":
129
+ return _bitbucket_repository_url(repo, environment, remote_url)
130
+ return None
131
+
132
+
133
+ def repository_owner(repository_url: Optional[str]) -> str:
134
+ """Return everything before the repository name in ``repository_url``'s path.
135
+
136
+ That is the owner on GitHub and Bitbucket, and the full group path on GitLab,
137
+ where projects can be nested under subgroups.
138
+ """
139
+ if not repository_url:
140
+ return ""
141
+ path = urlparse(repository_url).path.strip("/")
142
+ return path.rsplit("/", 1)[0] if "/" in path else ""
143
+
144
+
145
+ def _github_url(number: int, repo: Optional[str], env: Mapping[str, str]) -> Optional[str]:
146
+ repository_url = _github_repository_url(repo, env)
147
+ return f"{repository_url}/pull/{number}" if repository_url else None
148
+
149
+
150
+ def _gitlab_url(number: int, repo: Optional[str], env: Mapping[str, str]) -> Optional[str]:
151
+ project_url = _gitlab_project_url(repo, env)
88
152
  return f"{project_url}/-/merge_requests/{number}" if project_url else None
89
153
 
90
154
 
@@ -22,7 +22,7 @@ log = logging.getLogger(__name__)
22
22
  # Pinned Coana CLI version. Bumped deliberately per Python CLI release so the
23
23
  # reachability engine version only changes through a standard pip upgrade (advance notice).
24
24
  # Pass --reach-version latest to opt into the newest published version instead.
25
- DEFAULT_COANA_CLI_VERSION: Final = "15.14.2"
25
+ DEFAULT_COANA_CLI_VERSION: Final = "15.15.0"
26
26
 
27
27
  # Vendored from coana-package-manager, where it is generated; the only code that may read or
28
28
  # write the cache Coana shares with the Socket CLIs. See "Launching Coana" in that repo's
@@ -22,7 +22,9 @@ from socketsecurity.core.logging import initialize_logging, set_debug_mode
22
22
  from socketsecurity.core.messages import Messages
23
23
  from socketsecurity.core.pull_request import (
24
24
  parse_pull_request_number,
25
+ repository_owner,
25
26
  resolve_pull_request_context,
27
+ resolve_repository_url,
26
28
  )
27
29
  from socketsecurity.core.scm_comments import Comments
28
30
  from socketsecurity.core.socket_config import SocketConfig, module_folder_dirs
@@ -601,6 +603,12 @@ def main_code():
601
603
  from socketsecurity.core.scm.gitlab import Gitlab, GitlabConfig
602
604
  gitlab_config = GitlabConfig.from_env()
603
605
  scm = Gitlab(client=client, config=gitlab_config, ignore_authorization=config.ignore_authorization)
606
+ config.repository_url = resolve_repository_url(
607
+ config.scm,
608
+ config.repo,
609
+ os.environ,
610
+ remote_url=getattr(git_repo, "remote_url", None) if is_repo else None,
611
+ )
604
612
  # Don't override config.default_branch if it was explicitly set via --default-branch flag
605
613
  # Only use SCM detection if --default-branch wasn't provided
606
614
  if scm is not None and not config.default_branch:
@@ -806,7 +814,7 @@ def main_code():
806
814
  "alert_action": "error",
807
815
  "event_sender_created_at": now,
808
816
  "vcs_provider": integration_type,
809
- "owner": config.repo.split("/")[0] if "/" in config.repo else "",
817
+ "owner": repository_owner(config.repository_url),
810
818
  "repo": config.repo,
811
819
  "pr_number": pr_number,
812
820
  "ignore_all": ignore_all,
@@ -881,7 +889,7 @@ def main_code():
881
889
  "client_action": "ignore",
882
890
  "event_sender_created_at": now,
883
891
  "vcs_provider": integration_type,
884
- "owner": config.repo.split("/")[0] if "/" in config.repo else "",
892
+ "owner": repository_owner(config.repository_url),
885
893
  "repo": config.repo,
886
894
  "pr_number": pr_number,
887
895
  "ignore_all": c_ignore_all,
@@ -168,6 +168,34 @@ class TestCliConfigValidation:
168
168
  assert config.sarif_reachability == "reachable"
169
169
 
170
170
 
171
+ class TestRepoAndPendingHeadFlags:
172
+ """--repo takes a bare slug, and --pending-head is a deprecated no-op"""
173
+
174
+ @pytest.mark.parametrize("repo", ["my-org/my-repo", "group/sub/my-repo", "my-org/my-repo/"])
175
+ def test_repo_with_owner_exits_with_suggestion(self, repo, caplog):
176
+ with pytest.raises(SystemExit) as exc_info:
177
+ CliConfig.from_args(["--api-token", "test-token", "--repo", repo])
178
+ assert exc_info.value.code == 1
179
+ assert "Use --repo my-repo" in caplog.text
180
+
181
+ def test_repo_slug_is_accepted(self):
182
+ config = CliConfig.from_args(["--api-token", "test-token", "--repo", "my-repo"])
183
+ assert config.repo == "my-repo"
184
+
185
+ @pytest.mark.parametrize("flag", ["--pending-head", "--pending_head"])
186
+ def test_pending_head_is_accepted_with_a_deprecation_warning(self, flag, caplog):
187
+ config = CliConfig.from_args(["--api-token", "test-token", flag])
188
+ assert config.pending_head is True
189
+ assert "--pending-head is deprecated" in caplog.text
190
+
191
+ def test_help_hides_pending_head_and_shows_repo_slug(self, capsys):
192
+ with pytest.raises(SystemExit):
193
+ CliConfig.from_args(["--help"])
194
+ help_text = capsys.readouterr().out
195
+ assert "--pending-head" not in help_text
196
+ assert "--repo <repo>" in help_text
197
+
198
+
171
199
  class TestBaseScanFlags:
172
200
  """Tests for the --base-scan-id / --base-commit-sha diff baseline overrides."""
173
201
 
@@ -66,7 +66,7 @@ def test_fossa_report_payload_vulnerability_shape_is_stable():
66
66
  config = CliConfig.from_args([
67
67
  "--api-token", "test",
68
68
  "--legal-format", "fossa",
69
- "--repo", "owner/repo",
69
+ "--repo", "widgets",
70
70
  "--branch", "refs/heads/main",
71
71
  ])
72
72
  diff = Diff(id="scan-123", report_url="https://socket.dev/report/123")
@@ -147,14 +147,14 @@ def test_fossa_report_payload_vulnerability_shape_is_stable():
147
147
  def test_project_metadata_uses_dollar_revision_separator():
148
148
  """The composed FOSSA `project.id` is `<projectLocator>$<revision>`."""
149
149
  from socketsecurity.fossa_compat import _build_project_metadata
150
- config = CliConfig.from_args(["--api-token", "test", "--legal-format", "fossa", "--repo", "acme/widgets", "--branch", "refs/heads/main"])
150
+ config = CliConfig.from_args(["--api-token", "test", "--legal-format", "fossa", "--repo", "widgets", "--branch", "refs/heads/main"])
151
151
  diff = Diff(id="scan-abc123", report_url="https://socket.dev/x")
152
152
  project = _build_project_metadata(diff, config)
153
153
  assert project == {
154
154
  "branch": "refs/heads/main",
155
- "id": "acme/widgets$scan-abc123",
156
- "project": "acme/widgets",
157
- "projectId": "acme/widgets",
155
+ "id": "widgets$scan-abc123",
156
+ "project": "widgets",
157
+ "projectId": "widgets",
158
158
  "revision": "scan-abc123",
159
159
  "url": "https://socket.dev/x",
160
160
  }
@@ -311,10 +311,10 @@ def test_attribution_payload_top_level_is_5_keys():
311
311
 
312
312
  def test_attribution_project_has_only_name_and_revision():
313
313
  """SBOM `project` is the 2-key subset, not the 6-key analyze project."""
314
- config = CliConfig.from_args(["--api-token", "test", "--legal-format", "fossa", "--repo", "acme/widgets"])
314
+ config = CliConfig.from_args(["--api-token", "test", "--legal-format", "fossa", "--repo", "widgets"])
315
315
  diff = Diff(id="rev-x")
316
316
  payload = build_fossa_attribution_payload(diff, config)
317
- assert payload["project"] == {"name": "acme/widgets", "revision": "rev-x"}
317
+ assert payload["project"] == {"name": "widgets", "revision": "rev-x"}
318
318
 
319
319
 
320
320
  def test_attribution_empty_diff_yields_empty_collections():
@@ -79,3 +79,26 @@ def test_security_comment_omits_missing_patched_version():
79
79
  comment = Messages.security_comment_template(diff)
80
80
 
81
81
  assert "Patched version:" not in comment
82
+
83
+
84
+ class _LinkConfig:
85
+ scm = "github"
86
+ branch = "main"
87
+ repository_url = "https://github.com/acme/widgets"
88
+
89
+
90
+ def test_manifest_link_uses_the_full_repository_url():
91
+ url = Messages.get_manifest_file_url(Diff(), "app/package.json", _LinkConfig())
92
+
93
+ assert url == "https://github.com/acme/widgets/blob/main/app/package.json"
94
+
95
+
96
+ def test_manifest_link_falls_back_to_the_report_without_a_repository_url():
97
+ """A bare slug has no owner, so the link goes to the Socket report instead."""
98
+ config = _LinkConfig()
99
+ config.repository_url = None
100
+ diff = Diff(report_url="https://socket.dev/report/123")
101
+
102
+ url = Messages.get_manifest_file_url(diff, "app/package.json", config)
103
+
104
+ assert url == "https://socket.dev/report/123?tab=files&file=app%2Fpackage.json"