fosslight-source 2.2.8__tar.gz → 2.2.10__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.
- {fosslight_source-2.2.8/src/fosslight_source.egg-info → fosslight_source-2.2.10}/PKG-INFO +1 -1
- {fosslight_source-2.2.8 → fosslight_source-2.2.10}/setup.py +1 -1
- {fosslight_source-2.2.8 → fosslight_source-2.2.10}/src/fosslight_source/_scan_item.py +8 -8
- {fosslight_source-2.2.8 → fosslight_source-2.2.10}/src/fosslight_source/cli.py +10 -7
- {fosslight_source-2.2.8 → fosslight_source-2.2.10/src/fosslight_source.egg-info}/PKG-INFO +1 -1
- {fosslight_source-2.2.8 → fosslight_source-2.2.10}/LICENSE +0 -0
- {fosslight_source-2.2.8 → fosslight_source-2.2.10}/MANIFEST.in +0 -0
- {fosslight_source-2.2.8 → fosslight_source-2.2.10}/README.md +0 -0
- {fosslight_source-2.2.8 → fosslight_source-2.2.10}/requirements.txt +0 -0
- {fosslight_source-2.2.8 → fosslight_source-2.2.10}/setup.cfg +0 -0
- {fosslight_source-2.2.8 → fosslight_source-2.2.10}/src/fosslight_source/__init__.py +0 -0
- {fosslight_source-2.2.8 → fosslight_source-2.2.10}/src/fosslight_source/_help.py +0 -0
- {fosslight_source-2.2.8 → fosslight_source-2.2.10}/src/fosslight_source/_license_matched.py +0 -0
- {fosslight_source-2.2.8 → fosslight_source-2.2.10}/src/fosslight_source/_parsing_scancode_file_item.py +0 -0
- {fosslight_source-2.2.8 → fosslight_source-2.2.10}/src/fosslight_source/_parsing_scanoss_file.py +0 -0
- {fosslight_source-2.2.8 → fosslight_source-2.2.10}/src/fosslight_source/run_manifest_extractor.py +0 -0
- {fosslight_source-2.2.8 → fosslight_source-2.2.10}/src/fosslight_source/run_scancode.py +0 -0
- {fosslight_source-2.2.8 → fosslight_source-2.2.10}/src/fosslight_source/run_scanoss.py +0 -0
- {fosslight_source-2.2.8 → fosslight_source-2.2.10}/src/fosslight_source/run_spdx_extractor.py +0 -0
- {fosslight_source-2.2.8 → fosslight_source-2.2.10}/src/fosslight_source.egg-info/SOURCES.txt +0 -0
- {fosslight_source-2.2.8 → fosslight_source-2.2.10}/src/fosslight_source.egg-info/dependency_links.txt +0 -0
- {fosslight_source-2.2.8 → fosslight_source-2.2.10}/src/fosslight_source.egg-info/entry_points.txt +0 -0
- {fosslight_source-2.2.8 → fosslight_source-2.2.10}/src/fosslight_source.egg-info/requires.txt +0 -0
- {fosslight_source-2.2.8 → fosslight_source-2.2.10}/src/fosslight_source.egg-info/top_level.txt +0 -0
- {fosslight_source-2.2.8 → fosslight_source-2.2.10}/tests/test_tox.py +0 -0
|
@@ -14,7 +14,7 @@ with open('requirements.txt', 'r', 'utf-8') as f:
|
|
|
14
14
|
if __name__ == "__main__":
|
|
15
15
|
setup(
|
|
16
16
|
name='fosslight_source',
|
|
17
|
-
version='2.2.
|
|
17
|
+
version='2.2.10',
|
|
18
18
|
package_dir={"": "src"},
|
|
19
19
|
packages=find_packages(where='src'),
|
|
20
20
|
description='FOSSLight Source Scanner',
|
|
@@ -23,7 +23,7 @@ _manifest_filename = [r'.*\.pom$', r'package\.json$', r'setup\.py$', r'setup\.cf
|
|
|
23
23
|
MAX_LICENSE_LENGTH = 200
|
|
24
24
|
MAX_LICENSE_TOTAL_LENGTH = 600
|
|
25
25
|
SUBSTRING_LICENSE_COMMENT = "Maximum character limit (License)"
|
|
26
|
-
KB_URL = "http://fosslight-kb.lge.com/
|
|
26
|
+
KB_URL = "http://fosslight-kb.lge.com/"
|
|
27
27
|
|
|
28
28
|
|
|
29
29
|
class SourceItem(FileItem):
|
|
@@ -96,11 +96,11 @@ class SourceItem(FileItem):
|
|
|
96
96
|
except Exception as e:
|
|
97
97
|
logger.debug(f"Failed to get WFP for {self.source_name_or_path}: {e}")
|
|
98
98
|
except FileNotFoundError:
|
|
99
|
-
logger.
|
|
99
|
+
logger.debug(f"File not found: {self.source_name_or_path}")
|
|
100
100
|
except PermissionError:
|
|
101
|
-
logger.
|
|
101
|
+
logger.debug(f"Permission denied: {self.source_name_or_path}")
|
|
102
102
|
except Exception as e:
|
|
103
|
-
logger.
|
|
103
|
+
logger.debug(f"Failed to compute MD5 for {self.source_name_or_path}: {e}")
|
|
104
104
|
return md5_hex, wfp
|
|
105
105
|
|
|
106
106
|
def _get_origin_url_from_md5_hash(self, md5_hash: str, wfp: str = "") -> str:
|
|
@@ -108,7 +108,7 @@ class SourceItem(FileItem):
|
|
|
108
108
|
payload = {"file_hash": md5_hash}
|
|
109
109
|
if wfp and wfp.strip():
|
|
110
110
|
payload["wfp_base64"] = base64.b64encode(wfp.strip().encode("utf-8")).decode("ascii")
|
|
111
|
-
request = urllib.request.Request(KB_URL, data=json.dumps(payload).encode('utf-8'), method='POST')
|
|
111
|
+
request = urllib.request.Request(f"{KB_URL}query", data=json.dumps(payload).encode('utf-8'), method='POST')
|
|
112
112
|
request.add_header('Accept', 'application/json')
|
|
113
113
|
request.add_header('Content-Type', 'application/json')
|
|
114
114
|
|
|
@@ -122,11 +122,11 @@ class SourceItem(FileItem):
|
|
|
122
122
|
if output:
|
|
123
123
|
return output
|
|
124
124
|
except urllib.error.URLError as e:
|
|
125
|
-
logger.
|
|
125
|
+
logger.debug(f"Failed to fetch origin_url from API for MD5 hash {md5_hash}: {e}")
|
|
126
126
|
except json.JSONDecodeError as e:
|
|
127
|
-
logger.
|
|
127
|
+
logger.debug(f"Failed to parse API response for MD5 hash {md5_hash}: {e}")
|
|
128
128
|
except Exception as e:
|
|
129
|
-
logger.
|
|
129
|
+
logger.debug(f"Error getting origin_url for MD5 hash {md5_hash}: {e}")
|
|
130
130
|
return ""
|
|
131
131
|
|
|
132
132
|
def _extract_oss_info_from_url(self, url: str) -> tuple:
|
|
@@ -206,14 +206,14 @@ def create_report_file(
|
|
|
206
206
|
if api_limit_exceed:
|
|
207
207
|
scan_item.set_cover_comment("SCANOSS skipped (API limits)")
|
|
208
208
|
|
|
209
|
-
run_kb = True if selected_scanner in ['kb'
|
|
209
|
+
run_kb = True if selected_scanner in ['kb'] else False
|
|
210
210
|
if run_kb:
|
|
211
211
|
scan_item.set_cover_comment("KB Enabled" if check_kb_server_reachable() else "KB Unreachable")
|
|
212
212
|
display_mode = selected_scanner
|
|
213
213
|
if selected_scanner == "kb":
|
|
214
214
|
display_mode += ", scancode"
|
|
215
215
|
elif selected_scanner == "all":
|
|
216
|
-
display_mode = "
|
|
216
|
+
display_mode = "scancode, scanoss"
|
|
217
217
|
scan_item.set_cover_comment(f"Mode : {display_mode}")
|
|
218
218
|
|
|
219
219
|
if merged_result:
|
|
@@ -263,15 +263,18 @@ def create_report_file(
|
|
|
263
263
|
|
|
264
264
|
def check_kb_server_reachable() -> bool:
|
|
265
265
|
try:
|
|
266
|
-
request = urllib.request.Request(KB_URL, method='
|
|
267
|
-
with urllib.request.urlopen(request, timeout=
|
|
266
|
+
request = urllib.request.Request(f"{KB_URL}health", method='GET')
|
|
267
|
+
with urllib.request.urlopen(request, timeout=10) as response:
|
|
268
268
|
logger.debug(f"KB server is reachable. Response status: {response.status}")
|
|
269
269
|
return response.status != 404
|
|
270
270
|
except urllib.error.HTTPError as e:
|
|
271
|
+
logger.debug(f"KB server returned HTTP error: {e.code}")
|
|
271
272
|
return e.code != 404
|
|
272
|
-
except urllib.error.URLError:
|
|
273
|
+
except urllib.error.URLError as e:
|
|
274
|
+
logger.debug(f"KB server is unreachable (timeout or connection error): {e}")
|
|
273
275
|
return False
|
|
274
|
-
except Exception:
|
|
276
|
+
except Exception as e:
|
|
277
|
+
logger.debug(f"Unexpected error checking KB server: {e}")
|
|
275
278
|
return False
|
|
276
279
|
|
|
277
280
|
|
|
@@ -409,7 +412,7 @@ def run_scanners(
|
|
|
409
412
|
write_json_file)
|
|
410
413
|
|
|
411
414
|
if selected_scanner in SCANNER_TYPE:
|
|
412
|
-
run_kb = True if selected_scanner in ['kb'
|
|
415
|
+
run_kb = True if selected_scanner in ['kb'] else False
|
|
413
416
|
spdx_downloads, manifest_licenses = metadata_collector(path_to_scan, excluded_files)
|
|
414
417
|
merged_result = merge_results(scancode_result, scanoss_result, spdx_downloads,
|
|
415
418
|
path_to_scan, run_kb, manifest_licenses)
|
|
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
|
{fosslight_source-2.2.8 → fosslight_source-2.2.10}/src/fosslight_source/_parsing_scanoss_file.py
RENAMED
|
File without changes
|
{fosslight_source-2.2.8 → fosslight_source-2.2.10}/src/fosslight_source/run_manifest_extractor.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{fosslight_source-2.2.8 → fosslight_source-2.2.10}/src/fosslight_source/run_spdx_extractor.py
RENAMED
|
File without changes
|
{fosslight_source-2.2.8 → fosslight_source-2.2.10}/src/fosslight_source.egg-info/SOURCES.txt
RENAMED
|
File without changes
|
|
File without changes
|
{fosslight_source-2.2.8 → fosslight_source-2.2.10}/src/fosslight_source.egg-info/entry_points.txt
RENAMED
|
File without changes
|
{fosslight_source-2.2.8 → fosslight_source-2.2.10}/src/fosslight_source.egg-info/requires.txt
RENAMED
|
File without changes
|
{fosslight_source-2.2.8 → fosslight_source-2.2.10}/src/fosslight_source.egg-info/top_level.txt
RENAMED
|
File without changes
|
|
File without changes
|