socketsecurity 2.0.13__tar.gz → 2.0.14__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.13/socketsecurity.egg-info → socketsecurity-2.0.14}/PKG-INFO +1 -1
- {socketsecurity-2.0.13 → socketsecurity-2.0.14}/socketsecurity/__init__.py +1 -1
- {socketsecurity-2.0.13 → socketsecurity-2.0.14}/socketsecurity/config.py +1 -1
- {socketsecurity-2.0.13 → socketsecurity-2.0.14}/socketsecurity/core/__init__.py +50 -27
- {socketsecurity-2.0.13 → socketsecurity-2.0.14/socketsecurity.egg-info}/PKG-INFO +1 -1
- {socketsecurity-2.0.13 → socketsecurity-2.0.14}/LICENSE +0 -0
- {socketsecurity-2.0.13 → socketsecurity-2.0.14}/README.md +0 -0
- {socketsecurity-2.0.13 → socketsecurity-2.0.14}/pyproject.toml +0 -0
- {socketsecurity-2.0.13 → socketsecurity-2.0.14}/setup.cfg +0 -0
- {socketsecurity-2.0.13 → socketsecurity-2.0.14}/socketsecurity/core/classes.py +0 -0
- {socketsecurity-2.0.13 → socketsecurity-2.0.14}/socketsecurity/core/cli_client.py +0 -0
- {socketsecurity-2.0.13 → socketsecurity-2.0.14}/socketsecurity/core/exceptions.py +0 -0
- {socketsecurity-2.0.13 → socketsecurity-2.0.14}/socketsecurity/core/git_interface.py +0 -0
- {socketsecurity-2.0.13 → socketsecurity-2.0.14}/socketsecurity/core/issues.py +0 -0
- {socketsecurity-2.0.13 → socketsecurity-2.0.14}/socketsecurity/core/licenses.py +0 -0
- {socketsecurity-2.0.13 → socketsecurity-2.0.14}/socketsecurity/core/logging.py +0 -0
- {socketsecurity-2.0.13 → socketsecurity-2.0.14}/socketsecurity/core/messages.py +0 -0
- {socketsecurity-2.0.13 → socketsecurity-2.0.14}/socketsecurity/core/scm/__init__.py +0 -0
- {socketsecurity-2.0.13 → socketsecurity-2.0.14}/socketsecurity/core/scm/base.py +0 -0
- {socketsecurity-2.0.13 → socketsecurity-2.0.14}/socketsecurity/core/scm/client.py +0 -0
- {socketsecurity-2.0.13 → socketsecurity-2.0.14}/socketsecurity/core/scm/github.py +0 -0
- {socketsecurity-2.0.13 → socketsecurity-2.0.14}/socketsecurity/core/scm/gitlab.py +0 -0
- {socketsecurity-2.0.13 → socketsecurity-2.0.14}/socketsecurity/core/scm_comments.py +0 -0
- {socketsecurity-2.0.13 → socketsecurity-2.0.14}/socketsecurity/core/socket_config.py +0 -0
- {socketsecurity-2.0.13 → socketsecurity-2.0.14}/socketsecurity/core/utils.py +0 -0
- {socketsecurity-2.0.13 → socketsecurity-2.0.14}/socketsecurity/output.py +0 -0
- {socketsecurity-2.0.13 → socketsecurity-2.0.14}/socketsecurity/socketcli.py +0 -0
- {socketsecurity-2.0.13 → socketsecurity-2.0.14}/socketsecurity.egg-info/SOURCES.txt +0 -0
- {socketsecurity-2.0.13 → socketsecurity-2.0.14}/socketsecurity.egg-info/dependency_links.txt +0 -0
- {socketsecurity-2.0.13 → socketsecurity-2.0.14}/socketsecurity.egg-info/entry_points.txt +0 -0
- {socketsecurity-2.0.13 → socketsecurity-2.0.14}/socketsecurity.egg-info/requires.txt +0 -0
- {socketsecurity-2.0.13 → socketsecurity-2.0.14}/socketsecurity.egg-info/top_level.txt +0 -0
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
__author__ = 'socket.dev'
|
|
2
|
-
__version__ = '2.0.
|
|
2
|
+
__version__ = '2.0.14'
|
|
@@ -55,7 +55,7 @@ class CliConfig:
|
|
|
55
55
|
'pr_number': args.pr_number,
|
|
56
56
|
'commit_message': commit_message,
|
|
57
57
|
'default_branch': args.default_branch,
|
|
58
|
-
'target_path': args.target_path,
|
|
58
|
+
'target_path': os.path.expanduser(args.target_path),
|
|
59
59
|
'scm': args.scm,
|
|
60
60
|
'sbom_file': args.sbom_file,
|
|
61
61
|
'commit_sha': args.commit_sha,
|
|
@@ -5,8 +5,8 @@ import time
|
|
|
5
5
|
from dataclasses import asdict
|
|
6
6
|
from glob import glob
|
|
7
7
|
from pathlib import PurePath
|
|
8
|
-
from typing import BinaryIO, Dict, List, Tuple
|
|
9
|
-
|
|
8
|
+
from typing import BinaryIO, Dict, List, Tuple, Set
|
|
9
|
+
import re
|
|
10
10
|
from socketdev import socketdev
|
|
11
11
|
from socketdev.exceptions import APIFailure
|
|
12
12
|
from socketdev.fullscans import FullScanParams, SocketArtifact
|
|
@@ -123,19 +123,42 @@ class Core:
|
|
|
123
123
|
log.error(result.get("message", "No error message provided"))
|
|
124
124
|
return {}
|
|
125
125
|
|
|
126
|
+
@staticmethod
|
|
127
|
+
def expand_brace_pattern(pattern: str) -> List[str]:
|
|
128
|
+
"""
|
|
129
|
+
Expands brace expressions (e.g., {a,b,c}) into separate patterns.
|
|
130
|
+
"""
|
|
131
|
+
brace_regex = re.compile(r"\{([^{}]+)\}")
|
|
132
|
+
|
|
133
|
+
# Expand all brace groups
|
|
134
|
+
expanded_patterns = [pattern]
|
|
135
|
+
while any("{" in p for p in expanded_patterns):
|
|
136
|
+
new_patterns = []
|
|
137
|
+
for pat in expanded_patterns:
|
|
138
|
+
match = brace_regex.search(pat)
|
|
139
|
+
if match:
|
|
140
|
+
options = match.group(1).split(",") # Extract values inside {}
|
|
141
|
+
prefix, suffix = pat[:match.start()], pat[match.end():]
|
|
142
|
+
new_patterns.extend([prefix + opt + suffix for opt in options])
|
|
143
|
+
else:
|
|
144
|
+
new_patterns.append(pat)
|
|
145
|
+
expanded_patterns = new_patterns
|
|
146
|
+
|
|
147
|
+
return expanded_patterns
|
|
148
|
+
|
|
126
149
|
def find_files(self, path: str) -> List[str]:
|
|
127
150
|
"""
|
|
128
151
|
Finds supported manifest files in the given path.
|
|
129
152
|
|
|
130
153
|
Args:
|
|
131
|
-
path: Path to search for manifest files
|
|
154
|
+
path: Path to search for manifest files.
|
|
132
155
|
|
|
133
156
|
Returns:
|
|
134
|
-
List of found manifest file paths
|
|
157
|
+
List of found manifest file paths.
|
|
135
158
|
"""
|
|
136
159
|
log.debug("Starting Find Files")
|
|
137
160
|
start_time = time.time()
|
|
138
|
-
files = set()
|
|
161
|
+
files: Set[str] = set()
|
|
139
162
|
|
|
140
163
|
# Get supported patterns from the API
|
|
141
164
|
try:
|
|
@@ -149,28 +172,28 @@ class Core:
|
|
|
149
172
|
for ecosystem in patterns:
|
|
150
173
|
ecosystem_patterns = patterns[ecosystem]
|
|
151
174
|
for file_name in ecosystem_patterns:
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
#
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
for
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
return
|
|
175
|
+
original_pattern = ecosystem_patterns[file_name]["pattern"]
|
|
176
|
+
|
|
177
|
+
# Expand brace patterns
|
|
178
|
+
expanded_patterns = Core.expand_brace_pattern(original_pattern)
|
|
179
|
+
|
|
180
|
+
for pattern in expanded_patterns:
|
|
181
|
+
case_insensitive_pattern = Core.to_case_insensitive_regex(pattern)
|
|
182
|
+
file_path = os.path.join(path, "**", case_insensitive_pattern)
|
|
183
|
+
|
|
184
|
+
log.debug(f"Globbing {file_path}")
|
|
185
|
+
glob_start = time.time()
|
|
186
|
+
glob_files = glob(file_path, recursive=True)
|
|
187
|
+
|
|
188
|
+
for glob_file in glob_files:
|
|
189
|
+
if os.path.isfile(glob_file):
|
|
190
|
+
files.add(glob_file)
|
|
191
|
+
|
|
192
|
+
glob_end = time.time()
|
|
193
|
+
log.debug(f"Globbing took {glob_end - glob_start:.4f} seconds")
|
|
194
|
+
|
|
195
|
+
log.debug(f"Total files found: {len(files)}")
|
|
196
|
+
return sorted(files)
|
|
174
197
|
|
|
175
198
|
def get_supported_patterns(self) -> Dict:
|
|
176
199
|
"""
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
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.13 → socketsecurity-2.0.14}/socketsecurity.egg-info/dependency_links.txt
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|