socketsecurity 2.0.35__tar.gz → 2.0.36__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.36}/PKG-INFO +1 -1
- {socketsecurity-2.0.35 → socketsecurity-2.0.36}/pyproject.toml +1 -1
- {socketsecurity-2.0.35 → socketsecurity-2.0.36}/socketsecurity/__init__.py +1 -1
- {socketsecurity-2.0.35 → socketsecurity-2.0.36}/socketsecurity/config.py +9 -0
- {socketsecurity-2.0.35 → socketsecurity-2.0.36}/socketsecurity/core/__init__.py +14 -7
- {socketsecurity-2.0.35 → socketsecurity-2.0.36}/.github/CODEOWNERS +0 -0
- {socketsecurity-2.0.35 → socketsecurity-2.0.36}/.github/PULL_REQUEST_TEMPLATE/bug-fix.md +0 -0
- {socketsecurity-2.0.35 → socketsecurity-2.0.36}/.github/PULL_REQUEST_TEMPLATE/feature.md +0 -0
- {socketsecurity-2.0.35 → socketsecurity-2.0.36}/.github/PULL_REQUEST_TEMPLATE/improvement.md +0 -0
- {socketsecurity-2.0.35 → socketsecurity-2.0.36}/.github/PULL_REQUEST_TEMPLATE.md +0 -0
- {socketsecurity-2.0.35 → socketsecurity-2.0.36}/.github/workflows/docker-stable.yml +0 -0
- {socketsecurity-2.0.35 → socketsecurity-2.0.36}/.github/workflows/pr-preview.yml +0 -0
- {socketsecurity-2.0.35 → socketsecurity-2.0.36}/.github/workflows/release.yml +0 -0
- {socketsecurity-2.0.35 → socketsecurity-2.0.36}/.github/workflows/version-check.yml +0 -0
- {socketsecurity-2.0.35 → socketsecurity-2.0.36}/.gitignore +0 -0
- {socketsecurity-2.0.35 → socketsecurity-2.0.36}/.hooks/sync_version.py +0 -0
- {socketsecurity-2.0.35 → socketsecurity-2.0.36}/.pre-commit-config.yaml +0 -0
- {socketsecurity-2.0.35 → socketsecurity-2.0.36}/.python-version +0 -0
- {socketsecurity-2.0.35 → socketsecurity-2.0.36}/Dockerfile +0 -0
- {socketsecurity-2.0.35 → socketsecurity-2.0.36}/LICENSE +0 -0
- {socketsecurity-2.0.35 → socketsecurity-2.0.36}/Makefile +0 -0
- {socketsecurity-2.0.35 → socketsecurity-2.0.36}/Pipfile.lock +0 -0
- {socketsecurity-2.0.35 → socketsecurity-2.0.36}/README.md +0 -0
- {socketsecurity-2.0.35 → socketsecurity-2.0.36}/docs/README.md +0 -0
- {socketsecurity-2.0.35 → socketsecurity-2.0.36}/pytest.ini +0 -0
- {socketsecurity-2.0.35 → socketsecurity-2.0.36}/requirements-dev.lock +0 -0
- {socketsecurity-2.0.35 → socketsecurity-2.0.36}/requirements.lock +0 -0
- {socketsecurity-2.0.35 → socketsecurity-2.0.36}/scripts/build_container.sh +0 -0
- {socketsecurity-2.0.35 → socketsecurity-2.0.36}/scripts/deploy-test-docker.sh +0 -0
- {socketsecurity-2.0.35 → socketsecurity-2.0.36}/scripts/deploy-test-pypi.sh +0 -0
- {socketsecurity-2.0.35 → socketsecurity-2.0.36}/scripts/run.sh +0 -0
- {socketsecurity-2.0.35 → socketsecurity-2.0.36}/socketsecurity/core/classes.py +0 -0
- {socketsecurity-2.0.35 → socketsecurity-2.0.36}/socketsecurity/core/cli_client.py +0 -0
- {socketsecurity-2.0.35 → socketsecurity-2.0.36}/socketsecurity/core/exceptions.py +0 -0
- {socketsecurity-2.0.35 → socketsecurity-2.0.36}/socketsecurity/core/git_interface.py +0 -0
- {socketsecurity-2.0.35 → socketsecurity-2.0.36}/socketsecurity/core/issues.py +0 -0
- {socketsecurity-2.0.35 → socketsecurity-2.0.36}/socketsecurity/core/licenses.py +0 -0
- {socketsecurity-2.0.35 → socketsecurity-2.0.36}/socketsecurity/core/logging.py +0 -0
- {socketsecurity-2.0.35 → socketsecurity-2.0.36}/socketsecurity/core/messages.py +0 -0
- {socketsecurity-2.0.35 → socketsecurity-2.0.36}/socketsecurity/core/scm/__init__.py +0 -0
- {socketsecurity-2.0.35 → socketsecurity-2.0.36}/socketsecurity/core/scm/base.py +0 -0
- {socketsecurity-2.0.35 → socketsecurity-2.0.36}/socketsecurity/core/scm/client.py +0 -0
- {socketsecurity-2.0.35 → socketsecurity-2.0.36}/socketsecurity/core/scm/github.py +0 -0
- {socketsecurity-2.0.35 → socketsecurity-2.0.36}/socketsecurity/core/scm/gitlab.py +0 -0
- {socketsecurity-2.0.35 → socketsecurity-2.0.36}/socketsecurity/core/scm_comments.py +0 -0
- {socketsecurity-2.0.35 → socketsecurity-2.0.36}/socketsecurity/core/socket_config.py +0 -0
- {socketsecurity-2.0.35 → socketsecurity-2.0.36}/socketsecurity/core/utils.py +0 -0
- {socketsecurity-2.0.35 → socketsecurity-2.0.36}/socketsecurity/output.py +0 -0
- {socketsecurity-2.0.35 → socketsecurity-2.0.36}/socketsecurity/socketcli.py +0 -0
- {socketsecurity-2.0.35 → socketsecurity-2.0.36}/tests/__init__.py +0 -0
- {socketsecurity-2.0.35 → socketsecurity-2.0.36}/tests/core/conftest.py +0 -0
- {socketsecurity-2.0.35 → socketsecurity-2.0.36}/tests/core/create_diff_input.json +0 -0
- {socketsecurity-2.0.35 → socketsecurity-2.0.36}/tests/core/test_diff_generation.py +0 -0
- {socketsecurity-2.0.35 → socketsecurity-2.0.36}/tests/core/test_package_and_alerts.py +0 -0
- {socketsecurity-2.0.35 → socketsecurity-2.0.36}/tests/core/test_sdk_methods.py +0 -0
- {socketsecurity-2.0.35 → socketsecurity-2.0.36}/tests/core/test_supporting_methods.py +0 -0
- {socketsecurity-2.0.35 → socketsecurity-2.0.36}/tests/data/fullscans/create_response.json +0 -0
- {socketsecurity-2.0.35 → socketsecurity-2.0.36}/tests/data/fullscans/diff/stream_diff.json +0 -0
- {socketsecurity-2.0.35 → socketsecurity-2.0.36}/tests/data/fullscans/diff/stream_diff_full.json +0 -0
- {socketsecurity-2.0.35 → socketsecurity-2.0.36}/tests/data/fullscans/head_scan/metadata.json +0 -0
- {socketsecurity-2.0.35 → socketsecurity-2.0.36}/tests/data/fullscans/head_scan/stream_scan.json +0 -0
- {socketsecurity-2.0.35 → socketsecurity-2.0.36}/tests/data/fullscans/head_scan/stream_scan_full.json +0 -0
- {socketsecurity-2.0.35 → socketsecurity-2.0.36}/tests/data/fullscans/new_scan/metadata.json +0 -0
- {socketsecurity-2.0.35 → socketsecurity-2.0.36}/tests/data/fullscans/new_scan/stream_scan.json +0 -0
- {socketsecurity-2.0.35 → socketsecurity-2.0.36}/tests/data/repos/repo_info_error.json +0 -0
- {socketsecurity-2.0.35 → socketsecurity-2.0.36}/tests/data/repos/repo_info_no_head.json +0 -0
- {socketsecurity-2.0.35 → socketsecurity-2.0.36}/tests/data/repos/repo_info_success.json +0 -0
- {socketsecurity-2.0.35 → socketsecurity-2.0.36}/tests/data/settings/security-policy.json +0 -0
- {socketsecurity-2.0.35 → socketsecurity-2.0.36}/tests/unit/__init__.py +0 -0
- {socketsecurity-2.0.35 → socketsecurity-2.0.36}/tests/unit/test_cli_config.py +0 -0
- {socketsecurity-2.0.35 → socketsecurity-2.0.36}/tests/unit/test_client.py +0 -0
- {socketsecurity-2.0.35 → socketsecurity-2.0.36}/tests/unit/test_config.py +0 -0
- {socketsecurity-2.0.35 → socketsecurity-2.0.36}/tests/unit/test_output.py +0 -0
|
@@ -2,6 +2,7 @@ import argparse
|
|
|
2
2
|
import os
|
|
3
3
|
from dataclasses import asdict, dataclass
|
|
4
4
|
from typing import List, Optional
|
|
5
|
+
from socketdev import __version__
|
|
5
6
|
|
|
6
7
|
from socketdev import INTEGRATION_TYPES, IntegrationType
|
|
7
8
|
|
|
@@ -35,6 +36,7 @@ class CliConfig:
|
|
|
35
36
|
timeout: Optional[int] = 1200
|
|
36
37
|
exclude_license_details: bool = False
|
|
37
38
|
include_module_folders: bool = False
|
|
39
|
+
version: str = __version__
|
|
38
40
|
@classmethod
|
|
39
41
|
def from_args(cls, args_list: Optional[List[str]] = None) -> 'CliConfig':
|
|
40
42
|
parser = create_argument_parser()
|
|
@@ -75,6 +77,7 @@ class CliConfig:
|
|
|
75
77
|
'timeout': args.timeout,
|
|
76
78
|
'exclude_license_details': args.exclude_license_details,
|
|
77
79
|
'include_module_folders': args.include_module_folders,
|
|
80
|
+
'version': __version__
|
|
78
81
|
}
|
|
79
82
|
|
|
80
83
|
if args.owner:
|
|
@@ -360,4 +363,10 @@ def create_argument_parser() -> argparse.ArgumentParser:
|
|
|
360
363
|
help="Enabling including module folders like node_modules"
|
|
361
364
|
)
|
|
362
365
|
|
|
366
|
+
parser.add_argument(
|
|
367
|
+
'--version',
|
|
368
|
+
action='version',
|
|
369
|
+
version=f'%(prog)s {__version__}'
|
|
370
|
+
)
|
|
371
|
+
|
|
363
372
|
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:
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{socketsecurity-2.0.35 → socketsecurity-2.0.36}/.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
|
{socketsecurity-2.0.35 → socketsecurity-2.0.36}/tests/data/fullscans/diff/stream_diff_full.json
RENAMED
|
File without changes
|
{socketsecurity-2.0.35 → socketsecurity-2.0.36}/tests/data/fullscans/head_scan/metadata.json
RENAMED
|
File without changes
|
{socketsecurity-2.0.35 → socketsecurity-2.0.36}/tests/data/fullscans/head_scan/stream_scan.json
RENAMED
|
File without changes
|
{socketsecurity-2.0.35 → socketsecurity-2.0.36}/tests/data/fullscans/head_scan/stream_scan_full.json
RENAMED
|
File without changes
|
|
File without changes
|
{socketsecurity-2.0.35 → socketsecurity-2.0.36}/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
|