socketsecurity 2.2.26__tar.gz → 2.2.27__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.26 → socketsecurity-2.2.27}/PKG-INFO +1 -1
- {socketsecurity-2.2.26 → socketsecurity-2.2.27}/pyproject.toml +1 -1
- {socketsecurity-2.2.26 → socketsecurity-2.2.27}/socketsecurity/__init__.py +1 -1
- {socketsecurity-2.2.26 → socketsecurity-2.2.27}/socketsecurity/core/scm/gitlab.py +13 -9
- {socketsecurity-2.2.26 → socketsecurity-2.2.27}/uv.lock +9 -5
- {socketsecurity-2.2.26 → socketsecurity-2.2.27}/.github/CODEOWNERS +0 -0
- {socketsecurity-2.2.26 → socketsecurity-2.2.27}/.github/PULL_REQUEST_TEMPLATE/bug-fix.md +0 -0
- {socketsecurity-2.2.26 → socketsecurity-2.2.27}/.github/PULL_REQUEST_TEMPLATE/feature.md +0 -0
- {socketsecurity-2.2.26 → socketsecurity-2.2.27}/.github/PULL_REQUEST_TEMPLATE/improvement.md +0 -0
- {socketsecurity-2.2.26 → socketsecurity-2.2.27}/.github/PULL_REQUEST_TEMPLATE.md +0 -0
- {socketsecurity-2.2.26 → socketsecurity-2.2.27}/.github/workflows/docker-stable.yml +0 -0
- {socketsecurity-2.2.26 → socketsecurity-2.2.27}/.github/workflows/pr-preview.yml +0 -0
- {socketsecurity-2.2.26 → socketsecurity-2.2.27}/.github/workflows/release.yml +0 -0
- {socketsecurity-2.2.26 → socketsecurity-2.2.27}/.github/workflows/version-check.yml +0 -0
- {socketsecurity-2.2.26 → socketsecurity-2.2.27}/.gitignore +0 -0
- {socketsecurity-2.2.26 → socketsecurity-2.2.27}/.hooks/sync_version.py +0 -0
- {socketsecurity-2.2.26 → socketsecurity-2.2.27}/.pre-commit-config.yaml +0 -0
- {socketsecurity-2.2.26 → socketsecurity-2.2.27}/.python-version +0 -0
- {socketsecurity-2.2.26 → socketsecurity-2.2.27}/Dockerfile +0 -0
- {socketsecurity-2.2.26 → socketsecurity-2.2.27}/LICENSE +0 -0
- {socketsecurity-2.2.26 → socketsecurity-2.2.27}/Makefile +0 -0
- {socketsecurity-2.2.26 → socketsecurity-2.2.27}/README.md +0 -0
- {socketsecurity-2.2.26 → socketsecurity-2.2.27}/docs/README.md +0 -0
- {socketsecurity-2.2.26 → socketsecurity-2.2.27}/pytest.ini +0 -0
- {socketsecurity-2.2.26 → socketsecurity-2.2.27}/scripts/build_container.sh +0 -0
- {socketsecurity-2.2.26 → socketsecurity-2.2.27}/scripts/deploy-test-docker.sh +0 -0
- {socketsecurity-2.2.26 → socketsecurity-2.2.27}/scripts/deploy-test-pypi.sh +0 -0
- {socketsecurity-2.2.26 → socketsecurity-2.2.27}/scripts/run.sh +0 -0
- {socketsecurity-2.2.26 → socketsecurity-2.2.27}/socketsecurity/config.py +0 -0
- {socketsecurity-2.2.26 → socketsecurity-2.2.27}/socketsecurity/core/__init__.py +0 -0
- {socketsecurity-2.2.26 → socketsecurity-2.2.27}/socketsecurity/core/classes.py +0 -0
- {socketsecurity-2.2.26 → socketsecurity-2.2.27}/socketsecurity/core/cli_client.py +0 -0
- {socketsecurity-2.2.26 → socketsecurity-2.2.27}/socketsecurity/core/exceptions.py +0 -0
- {socketsecurity-2.2.26 → socketsecurity-2.2.27}/socketsecurity/core/git_interface.py +0 -0
- {socketsecurity-2.2.26 → socketsecurity-2.2.27}/socketsecurity/core/helper/__init__.py +0 -0
- {socketsecurity-2.2.26 → socketsecurity-2.2.27}/socketsecurity/core/lazy_file_loader.py +0 -0
- {socketsecurity-2.2.26 → socketsecurity-2.2.27}/socketsecurity/core/logging.py +0 -0
- {socketsecurity-2.2.26 → socketsecurity-2.2.27}/socketsecurity/core/messages.py +0 -0
- {socketsecurity-2.2.26 → socketsecurity-2.2.27}/socketsecurity/core/resource_utils.py +0 -0
- {socketsecurity-2.2.26 → socketsecurity-2.2.27}/socketsecurity/core/scm/__init__.py +0 -0
- {socketsecurity-2.2.26 → socketsecurity-2.2.27}/socketsecurity/core/scm/base.py +0 -0
- {socketsecurity-2.2.26 → socketsecurity-2.2.27}/socketsecurity/core/scm/client.py +0 -0
- {socketsecurity-2.2.26 → socketsecurity-2.2.27}/socketsecurity/core/scm/github.py +0 -0
- {socketsecurity-2.2.26 → socketsecurity-2.2.27}/socketsecurity/core/scm_comments.py +0 -0
- {socketsecurity-2.2.26 → socketsecurity-2.2.27}/socketsecurity/core/socket_config.py +0 -0
- {socketsecurity-2.2.26 → socketsecurity-2.2.27}/socketsecurity/core/tools/reachability.py +0 -0
- {socketsecurity-2.2.26 → socketsecurity-2.2.27}/socketsecurity/core/utils.py +0 -0
- {socketsecurity-2.2.26 → socketsecurity-2.2.27}/socketsecurity/output.py +0 -0
- {socketsecurity-2.2.26 → socketsecurity-2.2.27}/socketsecurity/plugins/__init__.py +0 -0
- {socketsecurity-2.2.26 → socketsecurity-2.2.27}/socketsecurity/plugins/base.py +0 -0
- {socketsecurity-2.2.26 → socketsecurity-2.2.27}/socketsecurity/plugins/jira.py +0 -0
- {socketsecurity-2.2.26 → socketsecurity-2.2.27}/socketsecurity/plugins/manager.py +0 -0
- {socketsecurity-2.2.26 → socketsecurity-2.2.27}/socketsecurity/plugins/slack.py +0 -0
- {socketsecurity-2.2.26 → socketsecurity-2.2.27}/socketsecurity/plugins/teams.py +0 -0
- {socketsecurity-2.2.26 → socketsecurity-2.2.27}/socketsecurity/plugins/webhook.py +0 -0
- {socketsecurity-2.2.26 → socketsecurity-2.2.27}/socketsecurity/socketcli.py +0 -0
- {socketsecurity-2.2.26 → socketsecurity-2.2.27}/tests/__init__.py +0 -0
- {socketsecurity-2.2.26 → socketsecurity-2.2.27}/tests/core/conftest.py +0 -0
- {socketsecurity-2.2.26 → socketsecurity-2.2.27}/tests/core/create_diff_input.json +0 -0
- {socketsecurity-2.2.26 → socketsecurity-2.2.27}/tests/core/test_diff_generation.py +0 -0
- {socketsecurity-2.2.26 → socketsecurity-2.2.27}/tests/core/test_package_and_alerts.py +0 -0
- {socketsecurity-2.2.26 → socketsecurity-2.2.27}/tests/core/test_sdk_methods.py +0 -0
- {socketsecurity-2.2.26 → socketsecurity-2.2.27}/tests/core/test_supporting_methods.py +0 -0
- {socketsecurity-2.2.26 → socketsecurity-2.2.27}/tests/data/fullscans/create_response.json +0 -0
- {socketsecurity-2.2.26 → socketsecurity-2.2.27}/tests/data/fullscans/diff/stream_diff.json +0 -0
- {socketsecurity-2.2.26 → socketsecurity-2.2.27}/tests/data/fullscans/diff/stream_diff_full.json +0 -0
- {socketsecurity-2.2.26 → socketsecurity-2.2.27}/tests/data/fullscans/head_scan/metadata.json +0 -0
- {socketsecurity-2.2.26 → socketsecurity-2.2.27}/tests/data/fullscans/head_scan/stream_scan.json +0 -0
- {socketsecurity-2.2.26 → socketsecurity-2.2.27}/tests/data/fullscans/head_scan/stream_scan_full.json +0 -0
- {socketsecurity-2.2.26 → socketsecurity-2.2.27}/tests/data/fullscans/new_scan/metadata.json +0 -0
- {socketsecurity-2.2.26 → socketsecurity-2.2.27}/tests/data/fullscans/new_scan/stream_scan.json +0 -0
- {socketsecurity-2.2.26 → socketsecurity-2.2.27}/tests/data/repos/repo_info_error.json +0 -0
- {socketsecurity-2.2.26 → socketsecurity-2.2.27}/tests/data/repos/repo_info_no_head.json +0 -0
- {socketsecurity-2.2.26 → socketsecurity-2.2.27}/tests/data/repos/repo_info_success.json +0 -0
- {socketsecurity-2.2.26 → socketsecurity-2.2.27}/tests/data/settings/security-policy.json +0 -0
- {socketsecurity-2.2.26 → socketsecurity-2.2.27}/tests/unit/__init__.py +0 -0
- {socketsecurity-2.2.26 → socketsecurity-2.2.27}/tests/unit/test_cli_config.py +0 -0
- {socketsecurity-2.2.26 → socketsecurity-2.2.27}/tests/unit/test_client.py +0 -0
- {socketsecurity-2.2.26 → socketsecurity-2.2.27}/tests/unit/test_config.py +0 -0
- {socketsecurity-2.2.26 → socketsecurity-2.2.27}/tests/unit/test_gitlab_auth.py +0 -0
- {socketsecurity-2.2.26 → socketsecurity-2.2.27}/tests/unit/test_gitlab_auth_fallback.py +0 -0
- {socketsecurity-2.2.26 → socketsecurity-2.2.27}/tests/unit/test_output.py +0 -0
- {socketsecurity-2.2.26 → socketsecurity-2.2.27}/workflows/bitbucket-pipelines.yml +0 -0
- {socketsecurity-2.2.26 → socketsecurity-2.2.27}/workflows/github-actions.yml +0 -0
- {socketsecurity-2.2.26 → socketsecurity-2.2.27}/workflows/gitlab-ci.yml +0 -0
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import os
|
|
2
2
|
import sys
|
|
3
3
|
from dataclasses import dataclass
|
|
4
|
-
from typing import Optional
|
|
4
|
+
from typing import Optional, Union
|
|
5
5
|
|
|
6
|
+
import requests
|
|
6
7
|
from socketsecurity import USER_AGENT
|
|
7
8
|
from socketsecurity.core import log
|
|
8
9
|
from socketsecurity.core.classes import Comment
|
|
@@ -128,9 +129,9 @@ class Gitlab:
|
|
|
128
129
|
try:
|
|
129
130
|
# Try the initial request with the configured headers
|
|
130
131
|
return self.client.request(**kwargs)
|
|
131
|
-
except
|
|
132
|
+
except requests.exceptions.HTTPError as e:
|
|
132
133
|
# Check if this is an authentication error (401)
|
|
133
|
-
if
|
|
134
|
+
if e.response and e.response.status_code == 401:
|
|
134
135
|
log.debug(f"Authentication failed with initial headers, trying fallback method")
|
|
135
136
|
|
|
136
137
|
# Determine the fallback headers
|
|
@@ -144,6 +145,9 @@ class Gitlab:
|
|
|
144
145
|
|
|
145
146
|
# Re-raise the original exception if it's not an auth error or fallback failed
|
|
146
147
|
raise
|
|
148
|
+
except Exception as e:
|
|
149
|
+
# Handle other types of exceptions that don't have response attribute
|
|
150
|
+
raise
|
|
147
151
|
|
|
148
152
|
def _get_fallback_headers(self, original_headers: dict) -> dict:
|
|
149
153
|
"""
|
|
@@ -235,13 +239,13 @@ class Gitlab:
|
|
|
235
239
|
new_security_comment: bool = True,
|
|
236
240
|
new_overview_comment: bool = True
|
|
237
241
|
) -> None:
|
|
238
|
-
existing_overview_comment = comments.get("overview"
|
|
239
|
-
existing_security_comment = comments.get("security"
|
|
242
|
+
existing_overview_comment = comments.get("overview")
|
|
243
|
+
existing_security_comment = comments.get("security")
|
|
240
244
|
if new_overview_comment:
|
|
241
245
|
log.debug("New Dependency Overview comment")
|
|
242
246
|
if existing_overview_comment is not None:
|
|
243
247
|
log.debug("Previous version of Dependency Overview, updating")
|
|
244
|
-
|
|
248
|
+
# Type narrowing: after None check, mypy knows this is Comment
|
|
245
249
|
self.update_comment(overview_comment, str(existing_overview_comment.id))
|
|
246
250
|
else:
|
|
247
251
|
log.debug("No previous version of Dependency Overview, posting")
|
|
@@ -250,15 +254,15 @@ class Gitlab:
|
|
|
250
254
|
log.debug("New Security Issue Comment")
|
|
251
255
|
if existing_security_comment is not None:
|
|
252
256
|
log.debug("Previous version of Security Issue comment, updating")
|
|
253
|
-
|
|
257
|
+
# Type narrowing: after None check, mypy knows this is Comment
|
|
254
258
|
self.update_comment(security_comment, str(existing_security_comment.id))
|
|
255
259
|
else:
|
|
256
260
|
log.debug("No Previous version of Security Issue comment, posting")
|
|
257
261
|
self.post_comment(security_comment)
|
|
258
262
|
|
|
259
263
|
def remove_comment_alerts(self, comments: dict):
|
|
260
|
-
security_alert = comments.get("security"
|
|
264
|
+
security_alert = comments.get("security")
|
|
261
265
|
if security_alert is not None:
|
|
262
|
-
|
|
266
|
+
# Type narrowing: after None check, mypy knows this is Comment
|
|
263
267
|
new_body = Comments.process_security_comment(security_alert, comments)
|
|
264
268
|
self.update_comment(new_body, str(security_alert.id))
|
|
@@ -1052,26 +1052,28 @@ wheels = [
|
|
|
1052
1052
|
|
|
1053
1053
|
[[package]]
|
|
1054
1054
|
name = "socketdev"
|
|
1055
|
-
version = "3.0.
|
|
1055
|
+
version = "3.0.17"
|
|
1056
1056
|
source = { registry = "https://pypi.org/simple" }
|
|
1057
1057
|
dependencies = [
|
|
1058
1058
|
{ name = "requests" },
|
|
1059
1059
|
{ name = "typing-extensions" },
|
|
1060
1060
|
]
|
|
1061
|
-
sdist = { url = "https://files.pythonhosted.org/packages/
|
|
1061
|
+
sdist = { url = "https://files.pythonhosted.org/packages/47/60/54b56ac179a9c89b2c9f2ab7eb5ba81220de64d11d52cf19249113ff364d/socketdev-3.0.17.tar.gz", hash = "sha256:a4446a84856c637c312d809d5b8deb25dd20ca38ae7d00a4c8104ea5b890c0af", size = 134013, upload-time = "2025-11-07T22:38:34.354Z" }
|
|
1062
1062
|
wheels = [
|
|
1063
|
-
{ url = "https://files.pythonhosted.org/packages/
|
|
1063
|
+
{ url = "https://files.pythonhosted.org/packages/98/56/34ab0e33b5345ca7ada68cd0a9e9d4adcde16051192eb10f8e2c3e0deaa1/socketdev-3.0.17-py3-none-any.whl", hash = "sha256:0986ee0694d5ce879cadb8e06fcfb75a4ca2dfb6f415414593825701593cf991", size = 59317, upload-time = "2025-11-07T22:38:32.704Z" },
|
|
1064
1064
|
]
|
|
1065
1065
|
|
|
1066
1066
|
[[package]]
|
|
1067
1067
|
name = "socketsecurity"
|
|
1068
|
-
version = "2.2.
|
|
1068
|
+
version = "2.2.26"
|
|
1069
1069
|
source = { editable = "." }
|
|
1070
1070
|
dependencies = [
|
|
1071
1071
|
{ name = "bs4" },
|
|
1072
1072
|
{ name = "gitpython" },
|
|
1073
|
+
{ name = "hatch" },
|
|
1073
1074
|
{ name = "mdutils" },
|
|
1074
1075
|
{ name = "packaging" },
|
|
1076
|
+
{ name = "pluggy" },
|
|
1075
1077
|
{ name = "prettytable" },
|
|
1076
1078
|
{ name = "python-dotenv" },
|
|
1077
1079
|
{ name = "requests" },
|
|
@@ -1098,9 +1100,11 @@ test = [
|
|
|
1098
1100
|
requires-dist = [
|
|
1099
1101
|
{ name = "bs4", specifier = ">=0.0.2" },
|
|
1100
1102
|
{ name = "gitpython" },
|
|
1103
|
+
{ name = "hatch", specifier = ">=1.14.1" },
|
|
1101
1104
|
{ name = "hatch", marker = "extra == 'dev'" },
|
|
1102
1105
|
{ name = "mdutils" },
|
|
1103
1106
|
{ name = "packaging" },
|
|
1107
|
+
{ name = "pluggy", specifier = ">=1.6.0" },
|
|
1104
1108
|
{ name = "pre-commit", marker = "extra == 'dev'" },
|
|
1105
1109
|
{ name = "prettytable" },
|
|
1106
1110
|
{ name = "pytest", marker = "extra == 'test'", specifier = ">=7.4.0" },
|
|
@@ -1111,7 +1115,7 @@ requires-dist = [
|
|
|
1111
1115
|
{ name = "python-dotenv" },
|
|
1112
1116
|
{ name = "requests" },
|
|
1113
1117
|
{ name = "ruff", marker = "extra == 'dev'", specifier = ">=0.3.0" },
|
|
1114
|
-
{ name = "socketdev", specifier = ">=3.0.
|
|
1118
|
+
{ name = "socketdev", specifier = ">=3.0.17,<4.0.0" },
|
|
1115
1119
|
{ name = "twine", marker = "extra == 'dev'" },
|
|
1116
1120
|
{ name = "uv", marker = "extra == 'dev'", specifier = ">=0.1.0" },
|
|
1117
1121
|
]
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{socketsecurity-2.2.26 → socketsecurity-2.2.27}/.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
|
|
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.26 → socketsecurity-2.2.27}/tests/data/fullscans/diff/stream_diff_full.json
RENAMED
|
File without changes
|
{socketsecurity-2.2.26 → socketsecurity-2.2.27}/tests/data/fullscans/head_scan/metadata.json
RENAMED
|
File without changes
|
{socketsecurity-2.2.26 → socketsecurity-2.2.27}/tests/data/fullscans/head_scan/stream_scan.json
RENAMED
|
File without changes
|
{socketsecurity-2.2.26 → socketsecurity-2.2.27}/tests/data/fullscans/head_scan/stream_scan_full.json
RENAMED
|
File without changes
|
|
File without changes
|
{socketsecurity-2.2.26 → socketsecurity-2.2.27}/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
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|