socketsecurity 2.2.88__tar.gz → 2.2.90__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.
- {socketsecurity-2.2.88 → socketsecurity-2.2.90}/.github/workflows/version-check.yml +13 -1
- {socketsecurity-2.2.88 → socketsecurity-2.2.90}/.gitignore +2 -0
- {socketsecurity-2.2.88 → socketsecurity-2.2.90}/.hooks/sync_version.py +28 -3
- {socketsecurity-2.2.88 → socketsecurity-2.2.90}/CHANGELOG.md +39 -0
- {socketsecurity-2.2.88 → socketsecurity-2.2.90}/PKG-INFO +3 -3
- {socketsecurity-2.2.88 → socketsecurity-2.2.90}/docs/cli-reference.md +1 -1
- {socketsecurity-2.2.88 → socketsecurity-2.2.90}/pyproject.toml +3 -3
- {socketsecurity-2.2.88 → socketsecurity-2.2.90}/socketsecurity/__init__.py +1 -1
- {socketsecurity-2.2.88 → socketsecurity-2.2.90}/socketsecurity/config.py +5 -1
- {socketsecurity-2.2.88 → socketsecurity-2.2.90}/socketsecurity/core/__init__.py +5 -0
- {socketsecurity-2.2.88 → socketsecurity-2.2.90}/tests/core/test_package_and_alerts.py +38 -1
- {socketsecurity-2.2.88 → socketsecurity-2.2.90}/tests/e2e/validate-reachability.sh +35 -19
- {socketsecurity-2.2.88 → socketsecurity-2.2.90}/uv.lock +5 -5
- {socketsecurity-2.2.88 → socketsecurity-2.2.90}/.github/CODEOWNERS +0 -0
- {socketsecurity-2.2.88 → socketsecurity-2.2.90}/.github/PULL_REQUEST_TEMPLATE/bug-fix.md +0 -0
- {socketsecurity-2.2.88 → socketsecurity-2.2.90}/.github/PULL_REQUEST_TEMPLATE/feature.md +0 -0
- {socketsecurity-2.2.88 → socketsecurity-2.2.90}/.github/PULL_REQUEST_TEMPLATE/improvement.md +0 -0
- {socketsecurity-2.2.88 → socketsecurity-2.2.90}/.github/PULL_REQUEST_TEMPLATE.md +0 -0
- {socketsecurity-2.2.88 → socketsecurity-2.2.90}/.github/workflows/docker-stable.yml +0 -0
- {socketsecurity-2.2.88 → socketsecurity-2.2.90}/.github/workflows/e2e-test.yml +0 -0
- {socketsecurity-2.2.88 → socketsecurity-2.2.90}/.github/workflows/pr-preview.yml +0 -0
- {socketsecurity-2.2.88 → socketsecurity-2.2.90}/.github/workflows/python-tests.yml +0 -0
- {socketsecurity-2.2.88 → socketsecurity-2.2.90}/.github/workflows/release.yml +0 -0
- {socketsecurity-2.2.88 → socketsecurity-2.2.90}/.github/zizmor.yml +0 -0
- {socketsecurity-2.2.88 → socketsecurity-2.2.90}/.pre-commit-config.yaml +0 -0
- {socketsecurity-2.2.88 → socketsecurity-2.2.90}/.python-version +0 -0
- {socketsecurity-2.2.88 → socketsecurity-2.2.90}/Dockerfile +0 -0
- {socketsecurity-2.2.88 → socketsecurity-2.2.90}/LICENSE +0 -0
- {socketsecurity-2.2.88 → socketsecurity-2.2.90}/Makefile +0 -0
- {socketsecurity-2.2.88 → socketsecurity-2.2.90}/README.md +0 -0
- {socketsecurity-2.2.88 → socketsecurity-2.2.90}/docs/ci-cd.md +0 -0
- {socketsecurity-2.2.88 → socketsecurity-2.2.90}/docs/development.md +0 -0
- {socketsecurity-2.2.88 → socketsecurity-2.2.90}/docs/troubleshooting.md +0 -0
- {socketsecurity-2.2.88 → socketsecurity-2.2.90}/examples/config/sarif-dashboard-parity.json +0 -0
- {socketsecurity-2.2.88 → socketsecurity-2.2.90}/examples/config/sarif-dashboard-parity.toml +0 -0
- {socketsecurity-2.2.88 → socketsecurity-2.2.90}/examples/config/sarif-diff-ci-cd.json +0 -0
- {socketsecurity-2.2.88 → socketsecurity-2.2.90}/examples/config/sarif-diff-ci-cd.toml +0 -0
- {socketsecurity-2.2.88 → socketsecurity-2.2.90}/examples/config/sarif-instance-detail.json +0 -0
- {socketsecurity-2.2.88 → socketsecurity-2.2.90}/examples/config/sarif-instance-detail.toml +0 -0
- {socketsecurity-2.2.88 → socketsecurity-2.2.90}/instructions/gitlab-commit-status/uat.md +0 -0
- {socketsecurity-2.2.88 → socketsecurity-2.2.90}/pytest.ini +0 -0
- {socketsecurity-2.2.88 → socketsecurity-2.2.90}/scripts/build_container.sh +0 -0
- {socketsecurity-2.2.88 → socketsecurity-2.2.90}/scripts/build_container_flexible.sh +0 -0
- {socketsecurity-2.2.88 → socketsecurity-2.2.90}/scripts/deploy-test-docker.sh +0 -0
- {socketsecurity-2.2.88 → socketsecurity-2.2.90}/scripts/deploy-test-pypi.sh +0 -0
- {socketsecurity-2.2.88 → socketsecurity-2.2.90}/scripts/docker-entrypoint.sh +0 -0
- {socketsecurity-2.2.88 → socketsecurity-2.2.90}/scripts/run.sh +0 -0
- {socketsecurity-2.2.88 → socketsecurity-2.2.90}/session.md +0 -0
- {socketsecurity-2.2.88 → socketsecurity-2.2.90}/socket.yml +0 -0
- {socketsecurity-2.2.88 → socketsecurity-2.2.90}/socketsecurity/core/alert_selection.py +0 -0
- {socketsecurity-2.2.88 → socketsecurity-2.2.90}/socketsecurity/core/classes.py +0 -0
- {socketsecurity-2.2.88 → socketsecurity-2.2.90}/socketsecurity/core/cli_client.py +0 -0
- {socketsecurity-2.2.88 → socketsecurity-2.2.90}/socketsecurity/core/exceptions.py +0 -0
- {socketsecurity-2.2.88 → socketsecurity-2.2.90}/socketsecurity/core/git_interface.py +0 -0
- {socketsecurity-2.2.88 → socketsecurity-2.2.90}/socketsecurity/core/helper/__init__.py +0 -0
- {socketsecurity-2.2.88 → socketsecurity-2.2.90}/socketsecurity/core/helper/socket_facts_loader.py +0 -0
- {socketsecurity-2.2.88 → socketsecurity-2.2.90}/socketsecurity/core/lazy_file_loader.py +0 -0
- {socketsecurity-2.2.88 → socketsecurity-2.2.90}/socketsecurity/core/logging.py +0 -0
- {socketsecurity-2.2.88 → socketsecurity-2.2.90}/socketsecurity/core/messages.py +0 -0
- {socketsecurity-2.2.88 → socketsecurity-2.2.90}/socketsecurity/core/resource_utils.py +0 -0
- {socketsecurity-2.2.88 → socketsecurity-2.2.90}/socketsecurity/core/scm/__init__.py +0 -0
- {socketsecurity-2.2.88 → socketsecurity-2.2.90}/socketsecurity/core/scm/base.py +0 -0
- {socketsecurity-2.2.88 → socketsecurity-2.2.90}/socketsecurity/core/scm/client.py +0 -0
- {socketsecurity-2.2.88 → socketsecurity-2.2.90}/socketsecurity/core/scm/github.py +0 -0
- {socketsecurity-2.2.88 → socketsecurity-2.2.90}/socketsecurity/core/scm/gitlab.py +0 -0
- {socketsecurity-2.2.88 → socketsecurity-2.2.90}/socketsecurity/core/scm_comments.py +0 -0
- {socketsecurity-2.2.88 → socketsecurity-2.2.90}/socketsecurity/core/socket_config.py +0 -0
- {socketsecurity-2.2.88 → socketsecurity-2.2.90}/socketsecurity/core/tools/reachability.py +0 -0
- {socketsecurity-2.2.88 → socketsecurity-2.2.90}/socketsecurity/core/utils.py +0 -0
- {socketsecurity-2.2.88 → socketsecurity-2.2.90}/socketsecurity/output.py +0 -0
- {socketsecurity-2.2.88 → socketsecurity-2.2.90}/socketsecurity/plugins/__init__.py +0 -0
- {socketsecurity-2.2.88 → socketsecurity-2.2.90}/socketsecurity/plugins/base.py +0 -0
- {socketsecurity-2.2.88 → socketsecurity-2.2.90}/socketsecurity/plugins/formatters/__init__.py +0 -0
- {socketsecurity-2.2.88 → socketsecurity-2.2.90}/socketsecurity/plugins/formatters/slack.py +0 -0
- {socketsecurity-2.2.88 → socketsecurity-2.2.90}/socketsecurity/plugins/jira.py +0 -0
- {socketsecurity-2.2.88 → socketsecurity-2.2.90}/socketsecurity/plugins/manager.py +0 -0
- {socketsecurity-2.2.88 → socketsecurity-2.2.90}/socketsecurity/plugins/slack.py +0 -0
- {socketsecurity-2.2.88 → socketsecurity-2.2.90}/socketsecurity/plugins/teams.py +0 -0
- {socketsecurity-2.2.88 → socketsecurity-2.2.90}/socketsecurity/plugins/webhook.py +0 -0
- {socketsecurity-2.2.88 → socketsecurity-2.2.90}/socketsecurity/socketcli.py +0 -0
- {socketsecurity-2.2.88 → socketsecurity-2.2.90}/tests/__init__.py +0 -0
- {socketsecurity-2.2.88 → socketsecurity-2.2.90}/tests/core/conftest.py +0 -0
- {socketsecurity-2.2.88 → socketsecurity-2.2.90}/tests/core/create_diff_input.json +0 -0
- {socketsecurity-2.2.88 → socketsecurity-2.2.90}/tests/core/test_diff_alerts.py +0 -0
- {socketsecurity-2.2.88 → socketsecurity-2.2.90}/tests/core/test_diff_generation.py +0 -0
- {socketsecurity-2.2.88 → socketsecurity-2.2.90}/tests/core/test_has_manifest_files.py +0 -0
- {socketsecurity-2.2.88 → socketsecurity-2.2.90}/tests/core/test_sdk_methods.py +0 -0
- {socketsecurity-2.2.88 → socketsecurity-2.2.90}/tests/core/test_supporting_methods.py +0 -0
- {socketsecurity-2.2.88 → socketsecurity-2.2.90}/tests/data/fullscans/create_response.json +0 -0
- {socketsecurity-2.2.88 → socketsecurity-2.2.90}/tests/data/fullscans/diff/stream_diff.json +0 -0
- {socketsecurity-2.2.88 → socketsecurity-2.2.90}/tests/data/fullscans/diff/stream_diff_full.json +0 -0
- {socketsecurity-2.2.88 → socketsecurity-2.2.90}/tests/data/fullscans/head_scan/metadata.json +0 -0
- {socketsecurity-2.2.88 → socketsecurity-2.2.90}/tests/data/fullscans/head_scan/stream_scan.json +0 -0
- {socketsecurity-2.2.88 → socketsecurity-2.2.90}/tests/data/fullscans/head_scan/stream_scan_full.json +0 -0
- {socketsecurity-2.2.88 → socketsecurity-2.2.90}/tests/data/fullscans/new_scan/metadata.json +0 -0
- {socketsecurity-2.2.88 → socketsecurity-2.2.90}/tests/data/fullscans/new_scan/stream_scan.json +0 -0
- {socketsecurity-2.2.88 → socketsecurity-2.2.90}/tests/data/repos/repo_info_error.json +0 -0
- {socketsecurity-2.2.88 → socketsecurity-2.2.90}/tests/data/repos/repo_info_no_head.json +0 -0
- {socketsecurity-2.2.88 → socketsecurity-2.2.90}/tests/data/repos/repo_info_success.json +0 -0
- {socketsecurity-2.2.88 → socketsecurity-2.2.90}/tests/data/settings/security-policy.json +0 -0
- {socketsecurity-2.2.88 → socketsecurity-2.2.90}/tests/e2e/fixtures/simple-npm/index.js +0 -0
- {socketsecurity-2.2.88 → socketsecurity-2.2.90}/tests/e2e/fixtures/simple-npm/package.json +0 -0
- {socketsecurity-2.2.88 → socketsecurity-2.2.90}/tests/e2e/fixtures/simple-pypi/requirements.txt +0 -0
- {socketsecurity-2.2.88 → socketsecurity-2.2.90}/tests/e2e/validate-gitlab.sh +0 -0
- {socketsecurity-2.2.88 → socketsecurity-2.2.90}/tests/e2e/validate-json.sh +0 -0
- {socketsecurity-2.2.88 → socketsecurity-2.2.90}/tests/e2e/validate-sarif.sh +0 -0
- {socketsecurity-2.2.88 → socketsecurity-2.2.90}/tests/e2e/validate-scan.sh +0 -0
- {socketsecurity-2.2.88 → socketsecurity-2.2.90}/tests/unit/__init__.py +0 -0
- {socketsecurity-2.2.88 → socketsecurity-2.2.90}/tests/unit/test_alert_selection.py +0 -0
- {socketsecurity-2.2.88 → socketsecurity-2.2.90}/tests/unit/test_cli_config.py +0 -0
- {socketsecurity-2.2.88 → socketsecurity-2.2.90}/tests/unit/test_client.py +0 -0
- {socketsecurity-2.2.88 → socketsecurity-2.2.90}/tests/unit/test_config.py +0 -0
- {socketsecurity-2.2.88 → socketsecurity-2.2.90}/tests/unit/test_dependency_overview.py +0 -0
- {socketsecurity-2.2.88 → socketsecurity-2.2.90}/tests/unit/test_disable_ignore.py +0 -0
- {socketsecurity-2.2.88 → socketsecurity-2.2.90}/tests/unit/test_gitlab_auth.py +0 -0
- {socketsecurity-2.2.88 → socketsecurity-2.2.90}/tests/unit/test_gitlab_auth_fallback.py +0 -0
- {socketsecurity-2.2.88 → socketsecurity-2.2.90}/tests/unit/test_gitlab_commit_status.py +0 -0
- {socketsecurity-2.2.88 → socketsecurity-2.2.90}/tests/unit/test_gitlab_format.py +0 -0
- {socketsecurity-2.2.88 → socketsecurity-2.2.90}/tests/unit/test_ignore_telemetry_filtering.py +0 -0
- {socketsecurity-2.2.88 → socketsecurity-2.2.90}/tests/unit/test_output.py +0 -0
- {socketsecurity-2.2.88 → socketsecurity-2.2.90}/tests/unit/test_slack_plugin.py +0 -0
- {socketsecurity-2.2.88 → socketsecurity-2.2.90}/workflows/bitbucket-pipelines.yml +0 -0
- {socketsecurity-2.2.88 → socketsecurity-2.2.90}/workflows/buildkite.yml +0 -0
- {socketsecurity-2.2.88 → socketsecurity-2.2.90}/workflows/github-actions.yml +0 -0
- {socketsecurity-2.2.88 → socketsecurity-2.2.90}/workflows/gitlab-ci.yml +0 -0
|
@@ -4,8 +4,8 @@ on:
|
|
|
4
4
|
types: [opened, synchronize, ready_for_review]
|
|
5
5
|
paths:
|
|
6
6
|
- 'socketsecurity/**'
|
|
7
|
-
- 'setup.py'
|
|
8
7
|
- 'pyproject.toml'
|
|
8
|
+
- 'uv.lock'
|
|
9
9
|
|
|
10
10
|
permissions:
|
|
11
11
|
contents: read
|
|
@@ -46,6 +46,18 @@ jobs:
|
|
|
46
46
|
print(f'✅ Version properly incremented from {main_ver} to {pr_ver}')
|
|
47
47
|
"
|
|
48
48
|
|
|
49
|
+
- name: Require uv.lock update when pyproject changes
|
|
50
|
+
run: |
|
|
51
|
+
CHANGED_FILES="$(git diff --name-only origin/main...HEAD)"
|
|
52
|
+
|
|
53
|
+
if echo "$CHANGED_FILES" | grep -qx 'pyproject.toml'; then
|
|
54
|
+
if ! echo "$CHANGED_FILES" | grep -qx 'uv.lock'; then
|
|
55
|
+
echo "❌ pyproject.toml changed, but uv.lock was not updated."
|
|
56
|
+
echo "Run 'uv lock' and commit uv.lock with the version bump."
|
|
57
|
+
exit 1
|
|
58
|
+
fi
|
|
59
|
+
fi
|
|
60
|
+
|
|
49
61
|
- name: Manage PR Comment
|
|
50
62
|
uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea
|
|
51
63
|
if: always() && github.event.pull_request.head.repo.full_name == github.repository
|
|
@@ -8,6 +8,7 @@ import json
|
|
|
8
8
|
|
|
9
9
|
INIT_FILE = pathlib.Path("socketsecurity/__init__.py")
|
|
10
10
|
PYPROJECT_FILE = pathlib.Path("pyproject.toml")
|
|
11
|
+
UV_LOCK_FILE = pathlib.Path("uv.lock")
|
|
11
12
|
|
|
12
13
|
VERSION_PATTERN = re.compile(r"__version__\s*=\s*['\"]([^'\"]+)['\"]")
|
|
13
14
|
PYPROJECT_PATTERN = re.compile(r'^version\s*=\s*".*"$', re.MULTILINE)
|
|
@@ -72,6 +73,21 @@ def inject_version(version: str):
|
|
|
72
73
|
new_pyproject = re.sub(r"(\[project\])", rf"\1\nversion = \"{version}\"", pyproject)
|
|
73
74
|
PYPROJECT_FILE.write_text(new_pyproject)
|
|
74
75
|
|
|
76
|
+
|
|
77
|
+
def run_uv_lock() -> bool:
|
|
78
|
+
before = UV_LOCK_FILE.read_bytes() if UV_LOCK_FILE.exists() else b""
|
|
79
|
+
try:
|
|
80
|
+
subprocess.run(["uv", "lock"], check=True, text=True)
|
|
81
|
+
except FileNotFoundError:
|
|
82
|
+
print("❌ `uv` is required but was not found in PATH.")
|
|
83
|
+
sys.exit(1)
|
|
84
|
+
except subprocess.CalledProcessError:
|
|
85
|
+
print("❌ `uv lock` failed. Please run it manually and fix any errors.")
|
|
86
|
+
sys.exit(1)
|
|
87
|
+
|
|
88
|
+
after = UV_LOCK_FILE.read_bytes() if UV_LOCK_FILE.exists() else b""
|
|
89
|
+
return before != after
|
|
90
|
+
|
|
75
91
|
def main():
|
|
76
92
|
dev_mode = "--dev" in sys.argv
|
|
77
93
|
current_version = read_version_from_init(INIT_FILE)
|
|
@@ -84,15 +100,24 @@ def main():
|
|
|
84
100
|
base_version = current_version.split(".dev")[0] if ".dev" in current_version else current_version
|
|
85
101
|
new_version = find_next_available_dev_version(base_version)
|
|
86
102
|
inject_version(new_version)
|
|
87
|
-
|
|
103
|
+
uv_lock_changed = run_uv_lock()
|
|
104
|
+
lock_hint = " and uv.lock" if uv_lock_changed else ""
|
|
105
|
+
print(f"⚠️ Version was unchanged — auto-bumped. Please git add{lock_hint} + commit again.")
|
|
88
106
|
sys.exit(0)
|
|
89
107
|
else:
|
|
90
108
|
new_version = bump_patch_version(current_version)
|
|
91
109
|
inject_version(new_version)
|
|
92
|
-
|
|
110
|
+
uv_lock_changed = run_uv_lock()
|
|
111
|
+
lock_hint = " and uv.lock" if uv_lock_changed else ""
|
|
112
|
+
print(f"⚠️ Version was unchanged — auto-bumped. Please git add{lock_hint} + commit again.")
|
|
93
113
|
sys.exit(1)
|
|
94
114
|
else:
|
|
95
|
-
|
|
115
|
+
uv_lock_changed = run_uv_lock()
|
|
116
|
+
if uv_lock_changed:
|
|
117
|
+
print("⚠️ Version already bumped, but uv.lock was out of date and has been updated. Please git add uv.lock + commit again.")
|
|
118
|
+
sys.exit(1)
|
|
119
|
+
|
|
120
|
+
print("✅ Version already bumped and uv.lock is up to date — proceeding.")
|
|
96
121
|
sys.exit(0)
|
|
97
122
|
|
|
98
123
|
if __name__ == "__main__":
|
|
@@ -1,9 +1,48 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 2.2.90
|
|
4
|
+
|
|
5
|
+
- Migrated license enrichment PURL lookup to the org-scoped endpoint (`POST /v0/orgs/{slug}/purl`) from the deprecated global endpoint (`POST /v0/purl`).
|
|
6
|
+
|
|
3
7
|
## 2.2.83
|
|
4
8
|
|
|
5
9
|
- Fixed branch detection in detached-HEAD CI checkouts. When `git name-rev --name-only HEAD` returned an output with a suffix operator (e.g. `remotes/origin/master~1`, `master^0`), the `~N`/`^N` was previously passed through as the branch name and rejected by the Socket API as an invalid Git ref. The suffix is now stripped before the prefix split, producing the bare branch name.
|
|
6
10
|
|
|
11
|
+
## 2.2.80
|
|
12
|
+
|
|
13
|
+
- Hardened GitHub Actions workflows.
|
|
14
|
+
- Fixed broken links on PyPI page.
|
|
15
|
+
|
|
16
|
+
## 2.2.79
|
|
17
|
+
|
|
18
|
+
- Updated minimum required Python version.
|
|
19
|
+
- Tweaked CI checks.
|
|
20
|
+
|
|
21
|
+
## 2.2.78
|
|
22
|
+
|
|
23
|
+
- Fixed reachability filtering.
|
|
24
|
+
- Added config file support.
|
|
25
|
+
|
|
26
|
+
## 2.2.77
|
|
27
|
+
|
|
28
|
+
- Fixed `has_manifest_files` failing to match root-level manifest files.
|
|
29
|
+
|
|
30
|
+
## 2.2.76
|
|
31
|
+
|
|
32
|
+
- Added SARIF file output support.
|
|
33
|
+
- Improved reachability filtering.
|
|
34
|
+
|
|
35
|
+
## 2.2.75
|
|
36
|
+
|
|
37
|
+
- Fixed `workspace` flag regression by updating SDK dependency.
|
|
38
|
+
|
|
39
|
+
## 2.2.74
|
|
40
|
+
|
|
41
|
+
- Added `--workspace` flag to CLI args.
|
|
42
|
+
- Added GitLab branch protection flag.
|
|
43
|
+
- Added e2e tests for full scans and full scans with reachability.
|
|
44
|
+
- Bumped dependencies: `cryptography`, `virtualenv`, `filelock`, `urllib3`.
|
|
45
|
+
|
|
7
46
|
## 2.2.71
|
|
8
47
|
|
|
9
48
|
- Added `strace` to the Docker image for debugging purposes.
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: socketsecurity
|
|
3
|
-
Version: 2.2.
|
|
3
|
+
Version: 2.2.90
|
|
4
4
|
Summary: Socket Security CLI for CI/CD
|
|
5
|
-
Project-URL: Homepage, https://socket
|
|
5
|
+
Project-URL: Homepage, https://github.com/SocketDev/socket-python-cli
|
|
6
6
|
Author-email: Douglas Coburn <douglas@socket.dev>
|
|
7
7
|
Maintainer-email: Douglas Coburn <douglas@socket.dev>
|
|
8
8
|
License: MIT License
|
|
@@ -41,7 +41,7 @@ Requires-Dist: packaging
|
|
|
41
41
|
Requires-Dist: prettytable
|
|
42
42
|
Requires-Dist: python-dotenv
|
|
43
43
|
Requires-Dist: requests
|
|
44
|
-
Requires-Dist: socketdev<4.0.0,>=3.0
|
|
44
|
+
Requires-Dist: socketdev<4.0.0,>=3.1.0
|
|
45
45
|
Provides-Extra: dev
|
|
46
46
|
Requires-Dist: hatch; extra == 'dev'
|
|
47
47
|
Requires-Dist: pre-commit; extra == 'dev'
|
|
@@ -305,7 +305,7 @@ The CLI will automatically install `@coana-tech/cli` if not present. Use `--reac
|
|
|
305
305
|
| Parameter | Required | Default | Description |
|
|
306
306
|
|:-------------------------|:---------|:--------|:----------------------------------------------------------------------|
|
|
307
307
|
| `--ignore-commit-files` | False | False | Ignore commit files |
|
|
308
|
-
| `--disable-blocking` | False | False |
|
|
308
|
+
| `--disable-blocking` | False | False | Non-blocking CI mode: the CLI always exits **0**, even when blocking alerts are present (including with `--strict-blocking`). Also exits 0 on uncaught runtime errors and Socket API failures, so the job is treated as successful while findings and errors are still logged. Takes precedence over `--strict-blocking`. |
|
|
309
309
|
| `--disable-ignore` | False | False | Disable support for `@SocketSecurity ignore` commands in PR comments. When set, alerts cannot be suppressed via comments and ignore instructions are hidden from comment output. |
|
|
310
310
|
| `--strict-blocking` | False | False | Fail on ANY security policy violations (blocking severity), not just new ones. Only works in diff mode. See [Strict Blocking Mode](#strict-blocking-mode) for details. |
|
|
311
311
|
| `--enable-diff` | False | False | Enable diff mode even when using `--integration api` (forces diff mode without SCM integration) |
|
|
@@ -6,7 +6,7 @@ build-backend = "hatchling.build"
|
|
|
6
6
|
|
|
7
7
|
[project]
|
|
8
8
|
name = "socketsecurity"
|
|
9
|
-
version = "2.2.
|
|
9
|
+
version = "2.2.90"
|
|
10
10
|
requires-python = ">= 3.11"
|
|
11
11
|
license = {"file" = "LICENSE"}
|
|
12
12
|
dependencies = [
|
|
@@ -16,7 +16,7 @@ dependencies = [
|
|
|
16
16
|
'GitPython',
|
|
17
17
|
'packaging',
|
|
18
18
|
'python-dotenv',
|
|
19
|
-
"socketdev>=3.0
|
|
19
|
+
"socketdev>=3.1.0,<4.0.0",
|
|
20
20
|
"bs4>=0.0.2",
|
|
21
21
|
"markdown>=3.10",
|
|
22
22
|
]
|
|
@@ -57,7 +57,7 @@ socketcli = "socketsecurity.socketcli:cli"
|
|
|
57
57
|
socketclidev = "socketsecurity.socketcli:cli"
|
|
58
58
|
|
|
59
59
|
[project.urls]
|
|
60
|
-
Homepage = "https://socket
|
|
60
|
+
Homepage = "https://github.com/SocketDev/socket-python-cli"
|
|
61
61
|
|
|
62
62
|
[tool.coverage.run]
|
|
63
63
|
source = ["socketsecurity"]
|
|
@@ -695,7 +695,11 @@ def create_argument_parser() -> argparse.ArgumentParser:
|
|
|
695
695
|
"--disable-blocking",
|
|
696
696
|
dest="disable_blocking",
|
|
697
697
|
action="store_true",
|
|
698
|
-
help=
|
|
698
|
+
help=(
|
|
699
|
+
"Non-blocking CI mode: always exit 0, even when blocking alerts are present "
|
|
700
|
+
"(including with --strict-blocking), on uncaught errors, or on Socket API failures. "
|
|
701
|
+
"Findings and errors are still logged. Overrides --strict-blocking."
|
|
702
|
+
),
|
|
699
703
|
)
|
|
700
704
|
advanced_group.add_argument(
|
|
701
705
|
"--disable_blocking",
|
|
@@ -898,6 +898,7 @@ class Core:
|
|
|
898
898
|
results = self.sdk.purl.post(
|
|
899
899
|
license=True,
|
|
900
900
|
components=batch_components,
|
|
901
|
+
org_slug=self.config.org_slug,
|
|
901
902
|
licenseattrib=True,
|
|
902
903
|
licensedetails=True
|
|
903
904
|
)
|
|
@@ -946,6 +947,8 @@ class Core:
|
|
|
946
947
|
)
|
|
947
948
|
except APIFailure as e:
|
|
948
949
|
log.error(f"API Error: {e}")
|
|
950
|
+
if self.cli_config and self.cli_config.disable_blocking:
|
|
951
|
+
sys.exit(0)
|
|
949
952
|
sys.exit(1)
|
|
950
953
|
except Exception as e:
|
|
951
954
|
import traceback
|
|
@@ -1123,6 +1126,8 @@ class Core:
|
|
|
1123
1126
|
os.unlink(temp_file)
|
|
1124
1127
|
except OSError:
|
|
1125
1128
|
pass
|
|
1129
|
+
if self.cli_config and self.cli_config.disable_blocking:
|
|
1130
|
+
sys.exit(0)
|
|
1126
1131
|
sys.exit(1)
|
|
1127
1132
|
except Exception as e:
|
|
1128
1133
|
import traceback
|
|
@@ -228,4 +228,41 @@ class TestPackageAndAlerts:
|
|
|
228
228
|
|
|
229
229
|
# With ignore_readded=False
|
|
230
230
|
new_alerts = Core.get_new_alerts(added_alerts, removed_alerts, ignore_readded=False)
|
|
231
|
-
assert len(new_alerts) == 1
|
|
231
|
+
assert len(new_alerts) == 1
|
|
232
|
+
|
|
233
|
+
def test_get_license_text_via_purl_uses_org_scoped_endpoint(self, core, mock_sdk):
|
|
234
|
+
"""Test license enrichment calls the org-scoped PURL SDK method."""
|
|
235
|
+
core.sdk.purl = Mock()
|
|
236
|
+
core.sdk.purl.post.return_value = [
|
|
237
|
+
{
|
|
238
|
+
"type": "npm",
|
|
239
|
+
"name": "lodash",
|
|
240
|
+
"version": "4.18.1",
|
|
241
|
+
"licenseAttrib": [{"name": "MIT"}],
|
|
242
|
+
"licenseDetails": [{"license": "MIT"}],
|
|
243
|
+
}
|
|
244
|
+
]
|
|
245
|
+
|
|
246
|
+
packages = {
|
|
247
|
+
"npm/lodash@4.18.1": Package(
|
|
248
|
+
id="pkg:npm/lodash@4.18.1",
|
|
249
|
+
type="npm",
|
|
250
|
+
name="lodash",
|
|
251
|
+
version="4.18.1",
|
|
252
|
+
score={},
|
|
253
|
+
alerts=[],
|
|
254
|
+
topLevelAncestors=[],
|
|
255
|
+
)
|
|
256
|
+
}
|
|
257
|
+
|
|
258
|
+
result = core.get_license_text_via_purl(packages)
|
|
259
|
+
|
|
260
|
+
core.sdk.purl.post.assert_called_once_with(
|
|
261
|
+
license=True,
|
|
262
|
+
components=[{"purl": "pkg:/npm/lodash@4.18.1"}],
|
|
263
|
+
org_slug="test-org",
|
|
264
|
+
licenseattrib=True,
|
|
265
|
+
licensedetails=True,
|
|
266
|
+
)
|
|
267
|
+
assert result["npm/lodash@4.18.1"].licenseAttrib == [{"name": "MIT"}]
|
|
268
|
+
assert result["npm/lodash@4.18.1"].licenseDetails == [{"license": "MIT"}]
|
|
@@ -27,31 +27,47 @@ else
|
|
|
27
27
|
exit 1
|
|
28
28
|
fi
|
|
29
29
|
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
30
|
+
FACTS_PATH="tests/e2e/fixtures/simple-npm/.socket.facts.json"
|
|
31
|
+
if [ ! -f "$FACTS_PATH" ]; then
|
|
32
|
+
echo "FAIL: Expected reachability facts at $FACTS_PATH after initial scan"
|
|
33
|
+
exit 1
|
|
34
|
+
fi
|
|
35
|
+
echo "PASS: Reachability facts file present at $FACTS_PATH"
|
|
36
|
+
|
|
37
|
+
# 3-4. Build SARIF from the facts file produced by the initial --reach run.
|
|
38
|
+
# Avoid re-running reach + full scan here; duplicate API scans are slow and flaky in CI.
|
|
39
|
+
uv run python -c "
|
|
40
|
+
import json
|
|
41
|
+
from pathlib import Path
|
|
39
42
|
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
43
|
+
from socketsecurity.core.alert_selection import load_components_with_alerts
|
|
44
|
+
from socketsecurity.core.messages import Messages
|
|
45
|
+
|
|
46
|
+
target = 'tests/e2e/fixtures/simple-npm'
|
|
47
|
+
facts_file = '.socket.facts.json'
|
|
48
|
+
components = load_components_with_alerts(target, facts_file)
|
|
49
|
+
if not components:
|
|
50
|
+
raise SystemExit('FAIL: no components with alerts in .socket.facts.json')
|
|
51
|
+
|
|
52
|
+
for outfile, reach_filter in [
|
|
53
|
+
('/tmp/sarif-all.sarif', 'all'),
|
|
54
|
+
('/tmp/sarif-reachable.sarif', 'reachable'),
|
|
55
|
+
]:
|
|
56
|
+
sarif = Messages.create_security_comment_sarif_from_facts(
|
|
57
|
+
components,
|
|
58
|
+
reachability_filter=reach_filter,
|
|
59
|
+
grouping='instance',
|
|
60
|
+
)
|
|
61
|
+
Path(outfile).write_text(json.dumps(sarif, indent=2))
|
|
62
|
+
count = len(sarif['runs'][0]['results'])
|
|
63
|
+
print(f'PASS: Wrote {outfile} ({count} results, filter={reach_filter})')
|
|
64
|
+
"
|
|
49
65
|
|
|
50
66
|
# 5. Verify reachable-only results are a subset of all results
|
|
51
67
|
test -f /tmp/sarif-all.sarif
|
|
52
68
|
test -f /tmp/sarif-reachable.sarif
|
|
53
69
|
|
|
54
|
-
|
|
70
|
+
uv run python -c "
|
|
55
71
|
import json
|
|
56
72
|
with open('/tmp/sarif-all.sarif') as f:
|
|
57
73
|
all_data = json.load(f)
|
|
@@ -1155,20 +1155,20 @@ wheels = [
|
|
|
1155
1155
|
|
|
1156
1156
|
[[package]]
|
|
1157
1157
|
name = "socketdev"
|
|
1158
|
-
version = "3.0
|
|
1158
|
+
version = "3.1.0"
|
|
1159
1159
|
source = { registry = "https://pypi.org/simple" }
|
|
1160
1160
|
dependencies = [
|
|
1161
1161
|
{ name = "requests" },
|
|
1162
1162
|
{ name = "typing-extensions" },
|
|
1163
1163
|
]
|
|
1164
|
-
sdist = { url = "https://files.pythonhosted.org/packages/
|
|
1164
|
+
sdist = { url = "https://files.pythonhosted.org/packages/95/3e/50f05942e23d12043028d71c0e502c0d02c470686afc3dfbab0d1931e5c1/socketdev-3.1.0.tar.gz", hash = "sha256:a9534189d50c9f6c39e802280cc2317f830dd0c9970677e8cde843a69daa84ed", size = 172581, upload-time = "2026-05-21T17:14:03.607Z" }
|
|
1165
1165
|
wheels = [
|
|
1166
|
-
{ url = "https://files.pythonhosted.org/packages/
|
|
1166
|
+
{ url = "https://files.pythonhosted.org/packages/df/76/4fb37245468dd9c67137059ce6833db97d76c808bf0d10397f1b5a2943d1/socketdev-3.1.0-py3-none-any.whl", hash = "sha256:e9245916d423952aba4f0018bea2bca28740530ec30308089c48dddb2133e38a", size = 67255, upload-time = "2026-05-21T17:14:01.873Z" },
|
|
1167
1167
|
]
|
|
1168
1168
|
|
|
1169
1169
|
[[package]]
|
|
1170
1170
|
name = "socketsecurity"
|
|
1171
|
-
version = "2.2.
|
|
1171
|
+
version = "2.2.90"
|
|
1172
1172
|
source = { editable = "." }
|
|
1173
1173
|
dependencies = [
|
|
1174
1174
|
{ name = "bs4" },
|
|
@@ -1221,7 +1221,7 @@ requires-dist = [
|
|
|
1221
1221
|
{ name = "python-dotenv" },
|
|
1222
1222
|
{ name = "requests" },
|
|
1223
1223
|
{ name = "ruff", marker = "extra == 'dev'", specifier = ">=0.3.0" },
|
|
1224
|
-
{ name = "socketdev", specifier = ">=3.0
|
|
1224
|
+
{ name = "socketdev", specifier = ">=3.1.0,<4.0.0" },
|
|
1225
1225
|
{ name = "twine", marker = "extra == 'dev'" },
|
|
1226
1226
|
{ name = "uv", marker = "extra == 'dev'", specifier = ">=0.1.0" },
|
|
1227
1227
|
]
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{socketsecurity-2.2.88 → socketsecurity-2.2.90}/.github/PULL_REQUEST_TEMPLATE/improvement.md
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{socketsecurity-2.2.88 → socketsecurity-2.2.90}/socketsecurity/core/helper/socket_facts_loader.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{socketsecurity-2.2.88 → socketsecurity-2.2.90}/socketsecurity/plugins/formatters/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{socketsecurity-2.2.88 → socketsecurity-2.2.90}/tests/data/fullscans/diff/stream_diff_full.json
RENAMED
|
File without changes
|
{socketsecurity-2.2.88 → socketsecurity-2.2.90}/tests/data/fullscans/head_scan/metadata.json
RENAMED
|
File without changes
|
{socketsecurity-2.2.88 → socketsecurity-2.2.90}/tests/data/fullscans/head_scan/stream_scan.json
RENAMED
|
File without changes
|
{socketsecurity-2.2.88 → socketsecurity-2.2.90}/tests/data/fullscans/head_scan/stream_scan_full.json
RENAMED
|
File without changes
|
|
File without changes
|
{socketsecurity-2.2.88 → socketsecurity-2.2.90}/tests/data/fullscans/new_scan/stream_scan.json
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{socketsecurity-2.2.88 → socketsecurity-2.2.90}/tests/e2e/fixtures/simple-pypi/requirements.txt
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{socketsecurity-2.2.88 → socketsecurity-2.2.90}/tests/unit/test_ignore_telemetry_filtering.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|