socketsecurity 2.2.85__tar.gz → 2.2.88__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.85 → socketsecurity-2.2.88}/PKG-INFO +2 -2
- {socketsecurity-2.2.85 → socketsecurity-2.2.88}/pyproject.toml +2 -2
- {socketsecurity-2.2.85 → socketsecurity-2.2.88}/socketsecurity/__init__.py +1 -1
- {socketsecurity-2.2.85 → socketsecurity-2.2.88}/socketsecurity/core/classes.py +4 -2
- {socketsecurity-2.2.85 → socketsecurity-2.2.88}/socketsecurity/core/messages.py +20 -5
- {socketsecurity-2.2.85 → socketsecurity-2.2.88}/socketsecurity/core/utils.py +10 -1
- {socketsecurity-2.2.85 → socketsecurity-2.2.88}/tests/core/test_has_manifest_files.py +43 -0
- socketsecurity-2.2.88/tests/unit/test_dependency_overview.py +67 -0
- {socketsecurity-2.2.85 → socketsecurity-2.2.88}/uv.lock +5 -5
- {socketsecurity-2.2.85 → socketsecurity-2.2.88}/.github/CODEOWNERS +0 -0
- {socketsecurity-2.2.85 → socketsecurity-2.2.88}/.github/PULL_REQUEST_TEMPLATE/bug-fix.md +0 -0
- {socketsecurity-2.2.85 → socketsecurity-2.2.88}/.github/PULL_REQUEST_TEMPLATE/feature.md +0 -0
- {socketsecurity-2.2.85 → socketsecurity-2.2.88}/.github/PULL_REQUEST_TEMPLATE/improvement.md +0 -0
- {socketsecurity-2.2.85 → socketsecurity-2.2.88}/.github/PULL_REQUEST_TEMPLATE.md +0 -0
- {socketsecurity-2.2.85 → socketsecurity-2.2.88}/.github/workflows/docker-stable.yml +0 -0
- {socketsecurity-2.2.85 → socketsecurity-2.2.88}/.github/workflows/e2e-test.yml +0 -0
- {socketsecurity-2.2.85 → socketsecurity-2.2.88}/.github/workflows/pr-preview.yml +0 -0
- {socketsecurity-2.2.85 → socketsecurity-2.2.88}/.github/workflows/python-tests.yml +0 -0
- {socketsecurity-2.2.85 → socketsecurity-2.2.88}/.github/workflows/release.yml +0 -0
- {socketsecurity-2.2.85 → socketsecurity-2.2.88}/.github/workflows/version-check.yml +0 -0
- {socketsecurity-2.2.85 → socketsecurity-2.2.88}/.github/zizmor.yml +0 -0
- {socketsecurity-2.2.85 → socketsecurity-2.2.88}/.gitignore +0 -0
- {socketsecurity-2.2.85 → socketsecurity-2.2.88}/.hooks/sync_version.py +0 -0
- {socketsecurity-2.2.85 → socketsecurity-2.2.88}/.pre-commit-config.yaml +0 -0
- {socketsecurity-2.2.85 → socketsecurity-2.2.88}/.python-version +0 -0
- {socketsecurity-2.2.85 → socketsecurity-2.2.88}/CHANGELOG.md +0 -0
- {socketsecurity-2.2.85 → socketsecurity-2.2.88}/Dockerfile +0 -0
- {socketsecurity-2.2.85 → socketsecurity-2.2.88}/LICENSE +0 -0
- {socketsecurity-2.2.85 → socketsecurity-2.2.88}/Makefile +0 -0
- {socketsecurity-2.2.85 → socketsecurity-2.2.88}/README.md +0 -0
- {socketsecurity-2.2.85 → socketsecurity-2.2.88}/docs/ci-cd.md +0 -0
- {socketsecurity-2.2.85 → socketsecurity-2.2.88}/docs/cli-reference.md +0 -0
- {socketsecurity-2.2.85 → socketsecurity-2.2.88}/docs/development.md +0 -0
- {socketsecurity-2.2.85 → socketsecurity-2.2.88}/docs/troubleshooting.md +0 -0
- {socketsecurity-2.2.85 → socketsecurity-2.2.88}/examples/config/sarif-dashboard-parity.json +0 -0
- {socketsecurity-2.2.85 → socketsecurity-2.2.88}/examples/config/sarif-dashboard-parity.toml +0 -0
- {socketsecurity-2.2.85 → socketsecurity-2.2.88}/examples/config/sarif-diff-ci-cd.json +0 -0
- {socketsecurity-2.2.85 → socketsecurity-2.2.88}/examples/config/sarif-diff-ci-cd.toml +0 -0
- {socketsecurity-2.2.85 → socketsecurity-2.2.88}/examples/config/sarif-instance-detail.json +0 -0
- {socketsecurity-2.2.85 → socketsecurity-2.2.88}/examples/config/sarif-instance-detail.toml +0 -0
- {socketsecurity-2.2.85 → socketsecurity-2.2.88}/instructions/gitlab-commit-status/uat.md +0 -0
- {socketsecurity-2.2.85 → socketsecurity-2.2.88}/pytest.ini +0 -0
- {socketsecurity-2.2.85 → socketsecurity-2.2.88}/scripts/build_container.sh +0 -0
- {socketsecurity-2.2.85 → socketsecurity-2.2.88}/scripts/build_container_flexible.sh +0 -0
- {socketsecurity-2.2.85 → socketsecurity-2.2.88}/scripts/deploy-test-docker.sh +0 -0
- {socketsecurity-2.2.85 → socketsecurity-2.2.88}/scripts/deploy-test-pypi.sh +0 -0
- {socketsecurity-2.2.85 → socketsecurity-2.2.88}/scripts/docker-entrypoint.sh +0 -0
- {socketsecurity-2.2.85 → socketsecurity-2.2.88}/scripts/run.sh +0 -0
- {socketsecurity-2.2.85 → socketsecurity-2.2.88}/session.md +0 -0
- {socketsecurity-2.2.85 → socketsecurity-2.2.88}/socket.yml +0 -0
- {socketsecurity-2.2.85 → socketsecurity-2.2.88}/socketsecurity/config.py +0 -0
- {socketsecurity-2.2.85 → socketsecurity-2.2.88}/socketsecurity/core/__init__.py +0 -0
- {socketsecurity-2.2.85 → socketsecurity-2.2.88}/socketsecurity/core/alert_selection.py +0 -0
- {socketsecurity-2.2.85 → socketsecurity-2.2.88}/socketsecurity/core/cli_client.py +0 -0
- {socketsecurity-2.2.85 → socketsecurity-2.2.88}/socketsecurity/core/exceptions.py +0 -0
- {socketsecurity-2.2.85 → socketsecurity-2.2.88}/socketsecurity/core/git_interface.py +0 -0
- {socketsecurity-2.2.85 → socketsecurity-2.2.88}/socketsecurity/core/helper/__init__.py +0 -0
- {socketsecurity-2.2.85 → socketsecurity-2.2.88}/socketsecurity/core/helper/socket_facts_loader.py +0 -0
- {socketsecurity-2.2.85 → socketsecurity-2.2.88}/socketsecurity/core/lazy_file_loader.py +0 -0
- {socketsecurity-2.2.85 → socketsecurity-2.2.88}/socketsecurity/core/logging.py +0 -0
- {socketsecurity-2.2.85 → socketsecurity-2.2.88}/socketsecurity/core/resource_utils.py +0 -0
- {socketsecurity-2.2.85 → socketsecurity-2.2.88}/socketsecurity/core/scm/__init__.py +0 -0
- {socketsecurity-2.2.85 → socketsecurity-2.2.88}/socketsecurity/core/scm/base.py +0 -0
- {socketsecurity-2.2.85 → socketsecurity-2.2.88}/socketsecurity/core/scm/client.py +0 -0
- {socketsecurity-2.2.85 → socketsecurity-2.2.88}/socketsecurity/core/scm/github.py +0 -0
- {socketsecurity-2.2.85 → socketsecurity-2.2.88}/socketsecurity/core/scm/gitlab.py +0 -0
- {socketsecurity-2.2.85 → socketsecurity-2.2.88}/socketsecurity/core/scm_comments.py +0 -0
- {socketsecurity-2.2.85 → socketsecurity-2.2.88}/socketsecurity/core/socket_config.py +0 -0
- {socketsecurity-2.2.85 → socketsecurity-2.2.88}/socketsecurity/core/tools/reachability.py +0 -0
- {socketsecurity-2.2.85 → socketsecurity-2.2.88}/socketsecurity/output.py +0 -0
- {socketsecurity-2.2.85 → socketsecurity-2.2.88}/socketsecurity/plugins/__init__.py +0 -0
- {socketsecurity-2.2.85 → socketsecurity-2.2.88}/socketsecurity/plugins/base.py +0 -0
- {socketsecurity-2.2.85 → socketsecurity-2.2.88}/socketsecurity/plugins/formatters/__init__.py +0 -0
- {socketsecurity-2.2.85 → socketsecurity-2.2.88}/socketsecurity/plugins/formatters/slack.py +0 -0
- {socketsecurity-2.2.85 → socketsecurity-2.2.88}/socketsecurity/plugins/jira.py +0 -0
- {socketsecurity-2.2.85 → socketsecurity-2.2.88}/socketsecurity/plugins/manager.py +0 -0
- {socketsecurity-2.2.85 → socketsecurity-2.2.88}/socketsecurity/plugins/slack.py +0 -0
- {socketsecurity-2.2.85 → socketsecurity-2.2.88}/socketsecurity/plugins/teams.py +0 -0
- {socketsecurity-2.2.85 → socketsecurity-2.2.88}/socketsecurity/plugins/webhook.py +0 -0
- {socketsecurity-2.2.85 → socketsecurity-2.2.88}/socketsecurity/socketcli.py +0 -0
- {socketsecurity-2.2.85 → socketsecurity-2.2.88}/tests/__init__.py +0 -0
- {socketsecurity-2.2.85 → socketsecurity-2.2.88}/tests/core/conftest.py +0 -0
- {socketsecurity-2.2.85 → socketsecurity-2.2.88}/tests/core/create_diff_input.json +0 -0
- {socketsecurity-2.2.85 → socketsecurity-2.2.88}/tests/core/test_diff_alerts.py +0 -0
- {socketsecurity-2.2.85 → socketsecurity-2.2.88}/tests/core/test_diff_generation.py +0 -0
- {socketsecurity-2.2.85 → socketsecurity-2.2.88}/tests/core/test_package_and_alerts.py +0 -0
- {socketsecurity-2.2.85 → socketsecurity-2.2.88}/tests/core/test_sdk_methods.py +0 -0
- {socketsecurity-2.2.85 → socketsecurity-2.2.88}/tests/core/test_supporting_methods.py +0 -0
- {socketsecurity-2.2.85 → socketsecurity-2.2.88}/tests/data/fullscans/create_response.json +0 -0
- {socketsecurity-2.2.85 → socketsecurity-2.2.88}/tests/data/fullscans/diff/stream_diff.json +0 -0
- {socketsecurity-2.2.85 → socketsecurity-2.2.88}/tests/data/fullscans/diff/stream_diff_full.json +0 -0
- {socketsecurity-2.2.85 → socketsecurity-2.2.88}/tests/data/fullscans/head_scan/metadata.json +0 -0
- {socketsecurity-2.2.85 → socketsecurity-2.2.88}/tests/data/fullscans/head_scan/stream_scan.json +0 -0
- {socketsecurity-2.2.85 → socketsecurity-2.2.88}/tests/data/fullscans/head_scan/stream_scan_full.json +0 -0
- {socketsecurity-2.2.85 → socketsecurity-2.2.88}/tests/data/fullscans/new_scan/metadata.json +0 -0
- {socketsecurity-2.2.85 → socketsecurity-2.2.88}/tests/data/fullscans/new_scan/stream_scan.json +0 -0
- {socketsecurity-2.2.85 → socketsecurity-2.2.88}/tests/data/repos/repo_info_error.json +0 -0
- {socketsecurity-2.2.85 → socketsecurity-2.2.88}/tests/data/repos/repo_info_no_head.json +0 -0
- {socketsecurity-2.2.85 → socketsecurity-2.2.88}/tests/data/repos/repo_info_success.json +0 -0
- {socketsecurity-2.2.85 → socketsecurity-2.2.88}/tests/data/settings/security-policy.json +0 -0
- {socketsecurity-2.2.85 → socketsecurity-2.2.88}/tests/e2e/fixtures/simple-npm/index.js +0 -0
- {socketsecurity-2.2.85 → socketsecurity-2.2.88}/tests/e2e/fixtures/simple-npm/package.json +0 -0
- {socketsecurity-2.2.85 → socketsecurity-2.2.88}/tests/e2e/fixtures/simple-pypi/requirements.txt +0 -0
- {socketsecurity-2.2.85 → socketsecurity-2.2.88}/tests/e2e/validate-gitlab.sh +0 -0
- {socketsecurity-2.2.85 → socketsecurity-2.2.88}/tests/e2e/validate-json.sh +0 -0
- {socketsecurity-2.2.85 → socketsecurity-2.2.88}/tests/e2e/validate-reachability.sh +0 -0
- {socketsecurity-2.2.85 → socketsecurity-2.2.88}/tests/e2e/validate-sarif.sh +0 -0
- {socketsecurity-2.2.85 → socketsecurity-2.2.88}/tests/e2e/validate-scan.sh +0 -0
- {socketsecurity-2.2.85 → socketsecurity-2.2.88}/tests/unit/__init__.py +0 -0
- {socketsecurity-2.2.85 → socketsecurity-2.2.88}/tests/unit/test_alert_selection.py +0 -0
- {socketsecurity-2.2.85 → socketsecurity-2.2.88}/tests/unit/test_cli_config.py +0 -0
- {socketsecurity-2.2.85 → socketsecurity-2.2.88}/tests/unit/test_client.py +0 -0
- {socketsecurity-2.2.85 → socketsecurity-2.2.88}/tests/unit/test_config.py +0 -0
- {socketsecurity-2.2.85 → socketsecurity-2.2.88}/tests/unit/test_disable_ignore.py +0 -0
- {socketsecurity-2.2.85 → socketsecurity-2.2.88}/tests/unit/test_gitlab_auth.py +0 -0
- {socketsecurity-2.2.85 → socketsecurity-2.2.88}/tests/unit/test_gitlab_auth_fallback.py +0 -0
- {socketsecurity-2.2.85 → socketsecurity-2.2.88}/tests/unit/test_gitlab_commit_status.py +0 -0
- {socketsecurity-2.2.85 → socketsecurity-2.2.88}/tests/unit/test_gitlab_format.py +0 -0
- {socketsecurity-2.2.85 → socketsecurity-2.2.88}/tests/unit/test_ignore_telemetry_filtering.py +0 -0
- {socketsecurity-2.2.85 → socketsecurity-2.2.88}/tests/unit/test_output.py +0 -0
- {socketsecurity-2.2.85 → socketsecurity-2.2.88}/tests/unit/test_slack_plugin.py +0 -0
- {socketsecurity-2.2.85 → socketsecurity-2.2.88}/workflows/bitbucket-pipelines.yml +0 -0
- {socketsecurity-2.2.85 → socketsecurity-2.2.88}/workflows/buildkite.yml +0 -0
- {socketsecurity-2.2.85 → socketsecurity-2.2.88}/workflows/github-actions.yml +0 -0
- {socketsecurity-2.2.85 → socketsecurity-2.2.88}/workflows/gitlab-ci.yml +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: socketsecurity
|
|
3
|
-
Version: 2.2.
|
|
3
|
+
Version: 2.2.88
|
|
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>
|
|
@@ -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.0.33
|
|
45
45
|
Provides-Extra: dev
|
|
46
46
|
Requires-Dist: hatch; extra == 'dev'
|
|
47
47
|
Requires-Dist: pre-commit; extra == 'dev'
|
|
@@ -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.88"
|
|
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.0.33,<4.0.0",
|
|
20
20
|
"bs4>=0.0.2",
|
|
21
21
|
"markdown>=3.10",
|
|
22
22
|
]
|
|
@@ -207,7 +207,7 @@ class Package():
|
|
|
207
207
|
name=data["name"],
|
|
208
208
|
version=data["version"],
|
|
209
209
|
type=data["type"],
|
|
210
|
-
score=data.get("score"
|
|
210
|
+
score=data.get("score") or data.get("scores") or {},
|
|
211
211
|
alerts=data.get("alerts", []),
|
|
212
212
|
author=data.get("author", []),
|
|
213
213
|
size=data.get("size"),
|
|
@@ -236,7 +236,7 @@ class Package():
|
|
|
236
236
|
name=data["name"],
|
|
237
237
|
version=data["version"],
|
|
238
238
|
type=data["type"],
|
|
239
|
-
score=data.get("score"
|
|
239
|
+
score=data.get("score") or data.get("scores") or {},
|
|
240
240
|
alerts=data.get("alerts", []),
|
|
241
241
|
author=data.get("author", []),
|
|
242
242
|
size=data.get("size"),
|
|
@@ -448,6 +448,8 @@ class Purl:
|
|
|
448
448
|
self.capabilities = []
|
|
449
449
|
if not hasattr(self, "is_new"):
|
|
450
450
|
self.is_new = False
|
|
451
|
+
if not hasattr(self, "scores") or self.scores is None:
|
|
452
|
+
self.scores = {}
|
|
451
453
|
self.author_url = Purl.generate_author_data(self.author, self.ecosystem)
|
|
452
454
|
|
|
453
455
|
@staticmethod
|
|
@@ -1179,12 +1179,27 @@ class Messages:
|
|
|
1179
1179
|
score_percent = int(score * 100) # Convert to integer percentage
|
|
1180
1180
|
return f"[]({added.url})"
|
|
1181
1181
|
|
|
1182
|
+
def get_score_for_badge(score_name: str) -> float:
|
|
1183
|
+
scores = getattr(added, "scores", None)
|
|
1184
|
+
if isinstance(scores, dict):
|
|
1185
|
+
raw_score = scores.get(score_name)
|
|
1186
|
+
else:
|
|
1187
|
+
raw_score = getattr(scores, score_name, None) if scores is not None else None
|
|
1188
|
+
|
|
1189
|
+
if raw_score is None:
|
|
1190
|
+
return 1.0
|
|
1191
|
+
|
|
1192
|
+
score = float(raw_score)
|
|
1193
|
+
if score > 1:
|
|
1194
|
+
score = score / 100
|
|
1195
|
+
return max(0.0, min(score, 1.0))
|
|
1196
|
+
|
|
1182
1197
|
# Generate badges for each score type
|
|
1183
|
-
supply_chain_risk_badge = score_to_badge(
|
|
1184
|
-
vulnerability_badge = score_to_badge(
|
|
1185
|
-
quality_badge = score_to_badge(
|
|
1186
|
-
maintenance_badge = score_to_badge(
|
|
1187
|
-
license_badge = score_to_badge(
|
|
1198
|
+
supply_chain_risk_badge = score_to_badge(get_score_for_badge("supplyChain"))
|
|
1199
|
+
vulnerability_badge = score_to_badge(get_score_for_badge("vulnerability"))
|
|
1200
|
+
quality_badge = score_to_badge(get_score_for_badge("quality"))
|
|
1201
|
+
maintenance_badge = score_to_badge(get_score_for_badge("maintenance"))
|
|
1202
|
+
license_badge = score_to_badge(get_score_for_badge("license"))
|
|
1188
1203
|
|
|
1189
1204
|
# Add the row for this package
|
|
1190
1205
|
row = [
|
|
@@ -38,6 +38,15 @@ socket_globs = {
|
|
|
38
38
|
},
|
|
39
39
|
"pnpm-workspace.yml": {
|
|
40
40
|
"pattern": "pnpm-workspace.yml"
|
|
41
|
+
},
|
|
42
|
+
"bun.lock": {
|
|
43
|
+
"pattern": "bun.lock"
|
|
44
|
+
},
|
|
45
|
+
"bun.lockb": {
|
|
46
|
+
"pattern": "bun.lockb"
|
|
47
|
+
},
|
|
48
|
+
"vlt-lock.json": {
|
|
49
|
+
"pattern": "vlt-lock.json"
|
|
41
50
|
}
|
|
42
51
|
},
|
|
43
52
|
"pypi": {
|
|
@@ -105,4 +114,4 @@ socket_globs = {
|
|
|
105
114
|
"pattern": "packages.lock.json"
|
|
106
115
|
}
|
|
107
116
|
}
|
|
108
|
-
}
|
|
117
|
+
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
from unittest.mock import patch
|
|
2
2
|
|
|
3
3
|
from socketsecurity.core import Core
|
|
4
|
+
from socketsecurity.core.utils import socket_globs
|
|
4
5
|
|
|
5
6
|
# Minimal patterns matching what the Socket API returns
|
|
6
7
|
MOCK_PATTERNS = {
|
|
@@ -8,6 +9,9 @@ MOCK_PATTERNS = {
|
|
|
8
9
|
"packagejson": {"pattern": "package.json"},
|
|
9
10
|
"packagelockjson": {"pattern": "package-lock.json"},
|
|
10
11
|
"yarnlock": {"pattern": "yarn.lock"},
|
|
12
|
+
"bunlock": {"pattern": "bun.lock"},
|
|
13
|
+
"bunlockb": {"pattern": "bun.lockb"},
|
|
14
|
+
"vltlockjson": {"pattern": "vlt-lock.json"},
|
|
11
15
|
},
|
|
12
16
|
"pypi": {
|
|
13
17
|
"requirements": {"pattern": "*requirements.txt"},
|
|
@@ -66,3 +70,42 @@ class TestHasManifestFiles:
|
|
|
66
70
|
def test_pom_xml_root(self, mock_patterns):
|
|
67
71
|
core = Core.__new__(Core)
|
|
68
72
|
assert core.has_manifest_files(["pom.xml"]) is True
|
|
73
|
+
|
|
74
|
+
def test_bun_lock_root(self, mock_patterns):
|
|
75
|
+
core = Core.__new__(Core)
|
|
76
|
+
assert core.has_manifest_files(["bun.lock"]) is True
|
|
77
|
+
|
|
78
|
+
def test_bun_lockb_root(self, mock_patterns):
|
|
79
|
+
core = Core.__new__(Core)
|
|
80
|
+
assert core.has_manifest_files(["bun.lockb"]) is True
|
|
81
|
+
|
|
82
|
+
def test_vlt_lock_json_root(self, mock_patterns):
|
|
83
|
+
core = Core.__new__(Core)
|
|
84
|
+
assert core.has_manifest_files(["vlt-lock.json"]) is True
|
|
85
|
+
|
|
86
|
+
def test_bun_lock_subdirectory(self, mock_patterns):
|
|
87
|
+
core = Core.__new__(Core)
|
|
88
|
+
assert core.has_manifest_files(["apps/web/bun.lock"]) is True
|
|
89
|
+
|
|
90
|
+
|
|
91
|
+
@patch.object(Core, "get_supported_patterns", side_effect=RuntimeError("API unreachable"))
|
|
92
|
+
@patch.object(Core, "__init__", lambda self, *a, **kw: None)
|
|
93
|
+
class TestHasManifestFilesFallback:
|
|
94
|
+
"""Exercises the socket_globs fallback path used when the Socket API is unreachable."""
|
|
95
|
+
|
|
96
|
+
def test_fallback_matches_bun_lock(self, mock_patterns):
|
|
97
|
+
core = Core.__new__(Core)
|
|
98
|
+
assert core.has_manifest_files(["bun.lock"]) is True
|
|
99
|
+
|
|
100
|
+
def test_fallback_matches_bun_lockb(self, mock_patterns):
|
|
101
|
+
core = Core.__new__(Core)
|
|
102
|
+
assert core.has_manifest_files(["bun.lockb"]) is True
|
|
103
|
+
|
|
104
|
+
def test_fallback_matches_vlt_lock_json(self, mock_patterns):
|
|
105
|
+
core = Core.__new__(Core)
|
|
106
|
+
assert core.has_manifest_files(["vlt-lock.json"]) is True
|
|
107
|
+
|
|
108
|
+
def test_fallback_patterns_dict_contains_new_entries(self, mock_patterns):
|
|
109
|
+
assert "bun.lock" in socket_globs["npm"]
|
|
110
|
+
assert "bun.lockb" in socket_globs["npm"]
|
|
111
|
+
assert "vlt-lock.json" in socket_globs["npm"]
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
from socketsecurity.core.classes import Diff, Package, Purl
|
|
2
|
+
from socketsecurity.core.messages import Messages
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
def _make_purl(name: str, scores) -> Purl:
|
|
6
|
+
return Purl(
|
|
7
|
+
id=f"pkg:npm/{name}@1.0.0",
|
|
8
|
+
name=name,
|
|
9
|
+
version="1.0.0",
|
|
10
|
+
ecosystem="npm",
|
|
11
|
+
direct=True,
|
|
12
|
+
introduced_by=[("direct", "package.json")],
|
|
13
|
+
author=["test-author"],
|
|
14
|
+
size=1000,
|
|
15
|
+
transitives=0,
|
|
16
|
+
url=f"https://socket.dev/npm/package/{name}/overview/1.0.0",
|
|
17
|
+
purl=f"pkg:npm/{name}@1.0.0",
|
|
18
|
+
scores=scores,
|
|
19
|
+
)
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
def test_package_from_diff_artifact_normalizes_null_score():
|
|
23
|
+
package = Package.from_diff_artifact(
|
|
24
|
+
{
|
|
25
|
+
"id": "pkg:npm/example@1.0.0",
|
|
26
|
+
"name": "example",
|
|
27
|
+
"version": "1.0.0",
|
|
28
|
+
"type": "npm",
|
|
29
|
+
"diffType": "added",
|
|
30
|
+
"score": None,
|
|
31
|
+
"alerts": [],
|
|
32
|
+
"author": [],
|
|
33
|
+
"topLevelAncestors": [],
|
|
34
|
+
"direct": True,
|
|
35
|
+
"manifestFiles": [],
|
|
36
|
+
}
|
|
37
|
+
)
|
|
38
|
+
|
|
39
|
+
assert package.score == {}
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
def test_dependency_overview_template_defaults_missing_or_null_scores(tmp_path, monkeypatch):
|
|
43
|
+
monkeypatch.chdir(tmp_path)
|
|
44
|
+
|
|
45
|
+
diff = Diff(
|
|
46
|
+
id="test-diff",
|
|
47
|
+
diff_url="https://socket.dev/test-diff",
|
|
48
|
+
new_packages=[
|
|
49
|
+
_make_purl("missing-scores", None),
|
|
50
|
+
_make_purl(
|
|
51
|
+
"partial-scores",
|
|
52
|
+
{
|
|
53
|
+
"supplyChain": 0.42,
|
|
54
|
+
"vulnerability": None,
|
|
55
|
+
},
|
|
56
|
+
),
|
|
57
|
+
],
|
|
58
|
+
removed_packages=[],
|
|
59
|
+
new_alerts=[],
|
|
60
|
+
)
|
|
61
|
+
|
|
62
|
+
comment = Messages.dependency_overview_template(diff)
|
|
63
|
+
|
|
64
|
+
assert "Socket Security: Dependency Overview" in comment
|
|
65
|
+
assert "score-42.svg" in comment
|
|
66
|
+
assert "score-100.svg" in comment
|
|
67
|
+
assert "score-10000.svg" not in comment
|
|
@@ -1155,20 +1155,20 @@ wheels = [
|
|
|
1155
1155
|
|
|
1156
1156
|
[[package]]
|
|
1157
1157
|
name = "socketdev"
|
|
1158
|
-
version = "3.0.
|
|
1158
|
+
version = "3.0.33"
|
|
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/19/8c/b4608637bda66dd32cf9a421cee66e93d429f7445c8bd709032772e0f4ca/socketdev-3.0.33.tar.gz", hash = "sha256:704d672649f27390733cef4cbdad9ce8dc994794a4af56f77d2f2dc815bfe762", size = 172013, upload-time = "2026-04-24T17:02:48.616Z" }
|
|
1165
1165
|
wheels = [
|
|
1166
|
-
{ url = "https://files.pythonhosted.org/packages/
|
|
1166
|
+
{ url = "https://files.pythonhosted.org/packages/07/78/4408ba21724ce0648e39bd17854b19186ab77f6baedbb8b98721d6dd287a/socketdev-3.0.33-py3-none-any.whl", hash = "sha256:642eebd0b01b884c6aba8b5264e749ff71310147104e8e8de02ab24e4eab5837", size = 66975, upload-time = "2026-04-24T17:02:46.439Z" },
|
|
1167
1167
|
]
|
|
1168
1168
|
|
|
1169
1169
|
[[package]]
|
|
1170
1170
|
name = "socketsecurity"
|
|
1171
|
-
version = "2.2.
|
|
1171
|
+
version = "2.2.86"
|
|
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.0.33,<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.85 → socketsecurity-2.2.88}/.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
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{socketsecurity-2.2.85 → socketsecurity-2.2.88}/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
|
{socketsecurity-2.2.85 → socketsecurity-2.2.88}/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.85 → socketsecurity-2.2.88}/tests/data/fullscans/diff/stream_diff_full.json
RENAMED
|
File without changes
|
{socketsecurity-2.2.85 → socketsecurity-2.2.88}/tests/data/fullscans/head_scan/metadata.json
RENAMED
|
File without changes
|
{socketsecurity-2.2.85 → socketsecurity-2.2.88}/tests/data/fullscans/head_scan/stream_scan.json
RENAMED
|
File without changes
|
{socketsecurity-2.2.85 → socketsecurity-2.2.88}/tests/data/fullscans/head_scan/stream_scan_full.json
RENAMED
|
File without changes
|
|
File without changes
|
{socketsecurity-2.2.85 → socketsecurity-2.2.88}/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.85 → socketsecurity-2.2.88}/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.85 → socketsecurity-2.2.88}/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
|