Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
## [1.17.2] - 2024-10-29
### Fixed
- Fixed parsing of dependencies in Policy Checks
### Added
- Added supplier to SPDX packages

## [1.17.1] - 2024-10-24
### Fixed
Expand Down
5 changes: 4 additions & 1 deletion src/scanoss/spdxlite.py
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ def produce_from_json(self, data: json, output_file: str = None) -> bool:
data = {
'spdxVersion': 'SPDX-2.2',
'dataLicense': 'CC0-1.0',
'SPDXID': f'SPDXRef-{md5hex}',
'SPDXID': f'SPDXRef-DOCUMENT',
'name': 'SCANOSS-SBOM',
'creationInfo': {
'created': now.strftime('%Y-%m-%dT%H:%M:%SZ'),
Expand Down Expand Up @@ -214,6 +214,8 @@ def produce_from_json(self, data: json, output_file: str = None) -> bool:
comp_name = comp.get('component')
comp_ver = comp.get('version')
purl_ver = f'{purl}@{comp_ver}'
vendor = comp.get('vendor', 'NOASSERTION')
supplier = f"Organization: {vendor}" if vendor != 'NOASSERTION' else vendor
purl_hash = hashlib.md5(f'{purl_ver}'.encode('utf-8')).hexdigest()
purl_spdx = f'SPDXRef-{purl_hash}'
data['documentDescribes'].append(purl_spdx)
Expand All @@ -227,6 +229,7 @@ def produce_from_json(self, data: json, output_file: str = None) -> bool:
'licenseConcluded': 'NOASSERTION',
'filesAnalyzed': False,
'copyrightText': 'NOASSERTION',
'supplier': supplier,
'externalRefs': [{
'referenceCategory': 'PACKAGE-MANAGER',
'referenceLocator': purl_ver,
Expand Down