socketsecurity 2.0.35__tar.gz → 2.0.38__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.0.35 → socketsecurity-2.0.38}/PKG-INFO +2 -2
- {socketsecurity-2.0.35 → socketsecurity-2.0.38}/pyproject.toml +2 -2
- {socketsecurity-2.0.35 → socketsecurity-2.0.38}/scripts/build_container.sh +14 -14
- {socketsecurity-2.0.35 → socketsecurity-2.0.38}/socketsecurity/__init__.py +1 -1
- {socketsecurity-2.0.35 → socketsecurity-2.0.38}/socketsecurity/config.py +9 -1
- {socketsecurity-2.0.35 → socketsecurity-2.0.38}/socketsecurity/core/__init__.py +16 -7
- {socketsecurity-2.0.35 → socketsecurity-2.0.38}/socketsecurity/core/socket_config.py +2 -0
- {socketsecurity-2.0.35 → socketsecurity-2.0.38}/socketsecurity/socketcli.py +1 -0
- {socketsecurity-2.0.35 → socketsecurity-2.0.38}/.github/CODEOWNERS +0 -0
- {socketsecurity-2.0.35 → socketsecurity-2.0.38}/.github/PULL_REQUEST_TEMPLATE/bug-fix.md +0 -0
- {socketsecurity-2.0.35 → socketsecurity-2.0.38}/.github/PULL_REQUEST_TEMPLATE/feature.md +0 -0
- {socketsecurity-2.0.35 → socketsecurity-2.0.38}/.github/PULL_REQUEST_TEMPLATE/improvement.md +0 -0
- {socketsecurity-2.0.35 → socketsecurity-2.0.38}/.github/PULL_REQUEST_TEMPLATE.md +0 -0
- {socketsecurity-2.0.35 → socketsecurity-2.0.38}/.github/workflows/docker-stable.yml +0 -0
- {socketsecurity-2.0.35 → socketsecurity-2.0.38}/.github/workflows/pr-preview.yml +0 -0
- {socketsecurity-2.0.35 → socketsecurity-2.0.38}/.github/workflows/release.yml +0 -0
- {socketsecurity-2.0.35 → socketsecurity-2.0.38}/.github/workflows/version-check.yml +0 -0
- {socketsecurity-2.0.35 → socketsecurity-2.0.38}/.gitignore +0 -0
- {socketsecurity-2.0.35 → socketsecurity-2.0.38}/.hooks/sync_version.py +0 -0
- {socketsecurity-2.0.35 → socketsecurity-2.0.38}/.pre-commit-config.yaml +0 -0
- {socketsecurity-2.0.35 → socketsecurity-2.0.38}/.python-version +0 -0
- {socketsecurity-2.0.35 → socketsecurity-2.0.38}/Dockerfile +0 -0
- {socketsecurity-2.0.35 → socketsecurity-2.0.38}/LICENSE +0 -0
- {socketsecurity-2.0.35 → socketsecurity-2.0.38}/Makefile +0 -0
- {socketsecurity-2.0.35 → socketsecurity-2.0.38}/Pipfile.lock +0 -0
- {socketsecurity-2.0.35 → socketsecurity-2.0.38}/README.md +0 -0
- {socketsecurity-2.0.35 → socketsecurity-2.0.38}/docs/README.md +0 -0
- {socketsecurity-2.0.35 → socketsecurity-2.0.38}/pytest.ini +0 -0
- {socketsecurity-2.0.35 → socketsecurity-2.0.38}/requirements-dev.lock +0 -0
- {socketsecurity-2.0.35 → socketsecurity-2.0.38}/requirements.lock +0 -0
- {socketsecurity-2.0.35 → socketsecurity-2.0.38}/scripts/deploy-test-docker.sh +0 -0
- {socketsecurity-2.0.35 → socketsecurity-2.0.38}/scripts/deploy-test-pypi.sh +0 -0
- {socketsecurity-2.0.35 → socketsecurity-2.0.38}/scripts/run.sh +0 -0
- {socketsecurity-2.0.35 → socketsecurity-2.0.38}/socketsecurity/core/classes.py +0 -0
- {socketsecurity-2.0.35 → socketsecurity-2.0.38}/socketsecurity/core/cli_client.py +0 -0
- {socketsecurity-2.0.35 → socketsecurity-2.0.38}/socketsecurity/core/exceptions.py +0 -0
- {socketsecurity-2.0.35 → socketsecurity-2.0.38}/socketsecurity/core/git_interface.py +0 -0
- {socketsecurity-2.0.35 → socketsecurity-2.0.38}/socketsecurity/core/issues.py +0 -0
- {socketsecurity-2.0.35 → socketsecurity-2.0.38}/socketsecurity/core/licenses.py +0 -0
- {socketsecurity-2.0.35 → socketsecurity-2.0.38}/socketsecurity/core/logging.py +0 -0
- {socketsecurity-2.0.35 → socketsecurity-2.0.38}/socketsecurity/core/messages.py +0 -0
- {socketsecurity-2.0.35 → socketsecurity-2.0.38}/socketsecurity/core/scm/__init__.py +0 -0
- {socketsecurity-2.0.35 → socketsecurity-2.0.38}/socketsecurity/core/scm/base.py +0 -0
- {socketsecurity-2.0.35 → socketsecurity-2.0.38}/socketsecurity/core/scm/client.py +0 -0
- {socketsecurity-2.0.35 → socketsecurity-2.0.38}/socketsecurity/core/scm/github.py +0 -0
- {socketsecurity-2.0.35 → socketsecurity-2.0.38}/socketsecurity/core/scm/gitlab.py +0 -0
- {socketsecurity-2.0.35 → socketsecurity-2.0.38}/socketsecurity/core/scm_comments.py +0 -0
- {socketsecurity-2.0.35 → socketsecurity-2.0.38}/socketsecurity/core/utils.py +0 -0
- {socketsecurity-2.0.35 → socketsecurity-2.0.38}/socketsecurity/output.py +0 -0
- {socketsecurity-2.0.35 → socketsecurity-2.0.38}/tests/__init__.py +0 -0
- {socketsecurity-2.0.35 → socketsecurity-2.0.38}/tests/core/conftest.py +0 -0
- {socketsecurity-2.0.35 → socketsecurity-2.0.38}/tests/core/create_diff_input.json +0 -0
- {socketsecurity-2.0.35 → socketsecurity-2.0.38}/tests/core/test_diff_generation.py +0 -0
- {socketsecurity-2.0.35 → socketsecurity-2.0.38}/tests/core/test_package_and_alerts.py +0 -0
- {socketsecurity-2.0.35 → socketsecurity-2.0.38}/tests/core/test_sdk_methods.py +0 -0
- {socketsecurity-2.0.35 → socketsecurity-2.0.38}/tests/core/test_supporting_methods.py +0 -0
- {socketsecurity-2.0.35 → socketsecurity-2.0.38}/tests/data/fullscans/create_response.json +0 -0
- {socketsecurity-2.0.35 → socketsecurity-2.0.38}/tests/data/fullscans/diff/stream_diff.json +0 -0
- {socketsecurity-2.0.35 → socketsecurity-2.0.38}/tests/data/fullscans/diff/stream_diff_full.json +0 -0
- {socketsecurity-2.0.35 → socketsecurity-2.0.38}/tests/data/fullscans/head_scan/metadata.json +0 -0
- {socketsecurity-2.0.35 → socketsecurity-2.0.38}/tests/data/fullscans/head_scan/stream_scan.json +0 -0
- {socketsecurity-2.0.35 → socketsecurity-2.0.38}/tests/data/fullscans/head_scan/stream_scan_full.json +0 -0
- {socketsecurity-2.0.35 → socketsecurity-2.0.38}/tests/data/fullscans/new_scan/metadata.json +0 -0
- {socketsecurity-2.0.35 → socketsecurity-2.0.38}/tests/data/fullscans/new_scan/stream_scan.json +0 -0
- {socketsecurity-2.0.35 → socketsecurity-2.0.38}/tests/data/repos/repo_info_error.json +0 -0
- {socketsecurity-2.0.35 → socketsecurity-2.0.38}/tests/data/repos/repo_info_no_head.json +0 -0
- {socketsecurity-2.0.35 → socketsecurity-2.0.38}/tests/data/repos/repo_info_success.json +0 -0
- {socketsecurity-2.0.35 → socketsecurity-2.0.38}/tests/data/settings/security-policy.json +0 -0
- {socketsecurity-2.0.35 → socketsecurity-2.0.38}/tests/unit/__init__.py +0 -0
- {socketsecurity-2.0.35 → socketsecurity-2.0.38}/tests/unit/test_cli_config.py +0 -0
- {socketsecurity-2.0.35 → socketsecurity-2.0.38}/tests/unit/test_client.py +0 -0
- {socketsecurity-2.0.35 → socketsecurity-2.0.38}/tests/unit/test_config.py +0 -0
- {socketsecurity-2.0.35 → socketsecurity-2.0.38}/tests/unit/test_output.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: socketsecurity
|
|
3
|
-
Version: 2.0.
|
|
3
|
+
Version: 2.0.38
|
|
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>
|
|
@@ -39,7 +39,7 @@ Requires-Dist: packaging
|
|
|
39
39
|
Requires-Dist: prettytable
|
|
40
40
|
Requires-Dist: python-dotenv
|
|
41
41
|
Requires-Dist: requests
|
|
42
|
-
Requires-Dist: socket-sdk-python>=2.0.
|
|
42
|
+
Requires-Dist: socket-sdk-python>=2.0.20
|
|
43
43
|
Provides-Extra: dev
|
|
44
44
|
Requires-Dist: hatch; extra == 'dev'
|
|
45
45
|
Requires-Dist: pip-tools>=7.4.0; extra == 'dev'
|
|
@@ -6,7 +6,7 @@ build-backend = "hatchling.build"
|
|
|
6
6
|
|
|
7
7
|
[project]
|
|
8
8
|
name = "socketsecurity"
|
|
9
|
-
version = "2.0.
|
|
9
|
+
version = "2.0.38"
|
|
10
10
|
requires-python = ">= 3.10"
|
|
11
11
|
license = {"file" = "LICENSE"}
|
|
12
12
|
dependencies = [
|
|
@@ -16,7 +16,7 @@ dependencies = [
|
|
|
16
16
|
'GitPython',
|
|
17
17
|
'packaging',
|
|
18
18
|
'python-dotenv',
|
|
19
|
-
'socket-sdk-python>=2.0.
|
|
19
|
+
'socket-sdk-python>=2.0.20'
|
|
20
20
|
]
|
|
21
21
|
readme = "README.md"
|
|
22
22
|
description = "Socket Security CLI for CI/CD"
|
|
@@ -32,20 +32,20 @@ fi
|
|
|
32
32
|
|
|
33
33
|
if [ $ENABLE_PYPI_BUILD = "pypi-build=prod" ]; then
|
|
34
34
|
echo "Doing production build"
|
|
35
|
-
if ! python -m build --wheel --sdist; then
|
|
36
|
-
echo "Build failed"
|
|
37
|
-
exit 1
|
|
38
|
-
fi
|
|
39
|
-
|
|
40
|
-
if ! twine upload dist/*$VERSION*; then
|
|
41
|
-
echo "Upload to PyPI failed"
|
|
42
|
-
exit 1
|
|
43
|
-
fi
|
|
44
|
-
|
|
45
|
-
if ! verify_package $VERSION "https://pypi.org/simple"; then
|
|
46
|
-
echo "Failed to verify package on PyPI"
|
|
47
|
-
exit 1
|
|
48
|
-
fi
|
|
35
|
+
# if ! python -m build --wheel --sdist; then
|
|
36
|
+
# echo "Build failed"
|
|
37
|
+
# exit 1
|
|
38
|
+
# fi
|
|
39
|
+
#
|
|
40
|
+
# if ! twine upload dist/*$VERSION*; then
|
|
41
|
+
# echo "Upload to PyPI failed"
|
|
42
|
+
# exit 1
|
|
43
|
+
# fi
|
|
44
|
+
#
|
|
45
|
+
# if ! verify_package $VERSION "https://pypi.org/simple"; then
|
|
46
|
+
# echo "Failed to verify package on PyPI"
|
|
47
|
+
# exit 1
|
|
48
|
+
# fi
|
|
49
49
|
|
|
50
50
|
docker build --no-cache --build-arg CLI_VERSION=$VERSION --platform linux/amd64,linux/arm64 -t socketdev/cli:$VERSION . \
|
|
51
51
|
&& docker build --no-cache --build-arg CLI_VERSION=$VERSION --platform linux/amd64,linux/arm64 -t socketdev/cli:latest . \
|
|
@@ -2,7 +2,7 @@ import argparse
|
|
|
2
2
|
import os
|
|
3
3
|
from dataclasses import asdict, dataclass
|
|
4
4
|
from typing import List, Optional
|
|
5
|
-
|
|
5
|
+
from socketsecurity import __version__
|
|
6
6
|
from socketdev import INTEGRATION_TYPES, IntegrationType
|
|
7
7
|
|
|
8
8
|
|
|
@@ -35,6 +35,7 @@ class CliConfig:
|
|
|
35
35
|
timeout: Optional[int] = 1200
|
|
36
36
|
exclude_license_details: bool = False
|
|
37
37
|
include_module_folders: bool = False
|
|
38
|
+
version: str = __version__
|
|
38
39
|
@classmethod
|
|
39
40
|
def from_args(cls, args_list: Optional[List[str]] = None) -> 'CliConfig':
|
|
40
41
|
parser = create_argument_parser()
|
|
@@ -75,6 +76,7 @@ class CliConfig:
|
|
|
75
76
|
'timeout': args.timeout,
|
|
76
77
|
'exclude_license_details': args.exclude_license_details,
|
|
77
78
|
'include_module_folders': args.include_module_folders,
|
|
79
|
+
'version': __version__
|
|
78
80
|
}
|
|
79
81
|
|
|
80
82
|
if args.owner:
|
|
@@ -360,4 +362,10 @@ def create_argument_parser() -> argparse.ArgumentParser:
|
|
|
360
362
|
help="Enabling including module folders like node_modules"
|
|
361
363
|
)
|
|
362
364
|
|
|
365
|
+
parser.add_argument(
|
|
366
|
+
'--version',
|
|
367
|
+
action='version',
|
|
368
|
+
version=f'%(prog)s {__version__}'
|
|
369
|
+
)
|
|
370
|
+
|
|
363
371
|
return parser
|
|
@@ -25,9 +25,11 @@ from socketsecurity.core.classes import (
|
|
|
25
25
|
)
|
|
26
26
|
from socketsecurity.core.exceptions import APIResourceNotFound
|
|
27
27
|
from socketsecurity.core.licenses import Licenses
|
|
28
|
-
|
|
29
28
|
from .socket_config import SocketConfig
|
|
30
29
|
from .utils import socket_globs
|
|
30
|
+
import importlib
|
|
31
|
+
logging_std = importlib.import_module("logging")
|
|
32
|
+
|
|
31
33
|
|
|
32
34
|
__all__ = [
|
|
33
35
|
"Core",
|
|
@@ -375,11 +377,12 @@ class Core:
|
|
|
375
377
|
else:
|
|
376
378
|
package.license_text = self.get_package_license_text(package)
|
|
377
379
|
packages[package.id] = package
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
380
|
+
if package.topLevelAncestors:
|
|
381
|
+
for top_id in package.topLevelAncestors:
|
|
382
|
+
if top_id not in top_level_count:
|
|
383
|
+
top_level_count[top_id] = 1
|
|
384
|
+
else:
|
|
385
|
+
top_level_count[top_id] += 1
|
|
383
386
|
|
|
384
387
|
for package_id, package in packages.items():
|
|
385
388
|
package.transitives = top_level_count.get(package_id, 0)
|
|
@@ -424,10 +427,14 @@ class Core:
|
|
|
424
427
|
Exception: If API request fails
|
|
425
428
|
"""
|
|
426
429
|
try:
|
|
430
|
+
sdk_logger = logging_std.getLogger("socketdev")
|
|
431
|
+
original_level = sdk_logger.level
|
|
432
|
+
sdk_logger.setLevel(logging_std.CRITICAL)
|
|
427
433
|
response = self.sdk.repos.repo(self.config.org_slug, repo_slug, use_types=True)
|
|
434
|
+
sdk_logger.setLevel(original_level)
|
|
428
435
|
if not response.success:
|
|
429
436
|
log.error(f"Failed to get repository: {response.status}")
|
|
430
|
-
log.error(response.message)
|
|
437
|
+
# log.error(response.message)
|
|
431
438
|
except APIFailure:
|
|
432
439
|
log.warning(f"Failed to get repository {repo_slug}, attempting to create it")
|
|
433
440
|
try:
|
|
@@ -729,6 +736,8 @@ class Core:
|
|
|
729
736
|
source = ("direct", manifests)
|
|
730
737
|
introduced_by.append(source)
|
|
731
738
|
else:
|
|
739
|
+
if not package.topLevelAncestors:
|
|
740
|
+
return introduced_by
|
|
732
741
|
for top_id in package.topLevelAncestors:
|
|
733
742
|
top_package = packages.get(top_id)
|
|
734
743
|
if top_package:
|
|
@@ -5,6 +5,7 @@ from typing import Set
|
|
|
5
5
|
import os
|
|
6
6
|
|
|
7
7
|
from socketsecurity.core.issues import AllIssues
|
|
8
|
+
from socketsecurity import __version__
|
|
8
9
|
|
|
9
10
|
|
|
10
11
|
default_exclude_dirs = {
|
|
@@ -27,6 +28,7 @@ class SocketConfig:
|
|
|
27
28
|
security_policy: Dict = None
|
|
28
29
|
all_issues: Optional['AllIssues'] = None
|
|
29
30
|
excluded_dirs: Set[str] = field(default_factory=lambda: default_exclude_dirs)
|
|
31
|
+
version: str = __version__
|
|
30
32
|
|
|
31
33
|
def __post_init__(self):
|
|
32
34
|
"""Validate configuration after initialization"""
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{socketsecurity-2.0.35 → socketsecurity-2.0.38}/.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
|
{socketsecurity-2.0.35 → socketsecurity-2.0.38}/tests/data/fullscans/diff/stream_diff_full.json
RENAMED
|
File without changes
|
{socketsecurity-2.0.35 → socketsecurity-2.0.38}/tests/data/fullscans/head_scan/metadata.json
RENAMED
|
File without changes
|
{socketsecurity-2.0.35 → socketsecurity-2.0.38}/tests/data/fullscans/head_scan/stream_scan.json
RENAMED
|
File without changes
|
{socketsecurity-2.0.35 → socketsecurity-2.0.38}/tests/data/fullscans/head_scan/stream_scan_full.json
RENAMED
|
File without changes
|
|
File without changes
|
{socketsecurity-2.0.35 → socketsecurity-2.0.38}/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
|