Skip to content

Commit 9746b84

Browse files
authored
Merge pull request #3 from scanoss/Fix-bug-sbom-ingestion
CLIS-109 Fixes bug SBOM ingestion
2 parents c87952e + dcfe357 commit 9746b84

File tree

5 files changed

+11
-5
lines changed

5 files changed

+11
-5
lines changed

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1111

1212
- Upcoming changes...
1313

14+
## [0.6.1] - 2024-04-01
15+
### Changed
16+
- Fixed issue with SBOM ingestion
17+
1418
## [0.6.0] - 2024-03-26
1519
### Changed
1620
- Updated free default URL to now point to `https://api.osskb.org`
@@ -69,3 +73,4 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
6973
[0.5.4]: https://github.com/scanoss/scanoss.java/compare/v0.5.3...v0.5.4
7074
[0.5.5]: https://github.com/scanoss/scanoss.java/compare/v0.5.4...v0.5.5
7175
[0.6.0]: https://github.com/scanoss/scanoss.java/compare/v0.5.5...v0.6.0
76+
[0.6.1]: https://github.com/scanoss/scanoss.java/compare/v0.6.0...v0.6.1

src/main/java/com/scanoss/Scanner.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ private Scanner(Boolean skipSnippets, Boolean allExtensions, Boolean obfuscate,
121121
.build());
122122
this.scanApi = Objects.requireNonNullElseGet(scanApi, () ->
123123
ScanApi.builder().url(url).apiKey(apiKey).timeout(timeout).retryLimit(retryLimit).flags(scanFlags)
124-
.scanType(sbomType).sbom(sbom).customCert(customCert).proxy(proxy)
124+
.sbomType(sbomType).sbom(sbom).customCert(customCert).proxy(proxy)
125125
.build());
126126
this.scanFileProcessor = Objects.requireNonNullElseGet(scanFileProcessor, () ->
127127
ScanFileProcessor.builder().winnowing(this.winnowing).scanApi(this.scanApi).build());

src/main/java/com/scanoss/cli/ScanCommandLine.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ public void run() {
123123
sbomType = "identify";
124124
sbom = loadFileToString(identifySbom);
125125
} else if (ignoreSbom != null && !ignoreSbom.isEmpty()) {
126-
sbomType = "ignore";
126+
sbomType = "blacklist";
127127
sbom = loadFileToString(ignoreSbom);
128128
}
129129
String caCertPem = null;

src/main/java/com/scanoss/rest/ScanApi.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,8 @@ public String scan(String wfp, String context, int scanID) throws ScanApiExcepti
153153
}
154154
if (sbom != null && !sbom.isEmpty()) {
155155
String type = sbomType != null ? sbomType : "identify"; // Set SBOM type or default to 'identify'
156-
data.put(type, sbom);
156+
data.put("assets", sbom);
157+
data.put("type", type);
157158
}
158159
Request request; // Create multipart request
159160
try {

src/test/java/com/scanoss/TestScanApi.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ public void TestScanApiScanPositive() {
9595
log.info("<-- Starting {}", methodName);
9696

9797
String sbomIdentify = "pkg:github/scanoss/scanoss.py\n" + "pkg:pypi/scanoss\n";
98-
ScanApi scanApi = ScanApi.builder().flags("8").scanType("identify").sbom(sbomIdentify)
98+
ScanApi scanApi = ScanApi.builder().flags("8").sbomType("identify").sbom(sbomIdentify)
9999
.url(server.url("/api/scan/direct").toString()).build();
100100
server.enqueue(new MockResponse().addHeader("Content-Type", "application/json; charset=utf-8")
101101
.setBody(SCAN_RESP_SUCCESS).setResponseCode(200));
@@ -114,7 +114,7 @@ public void TestScanApiScanCustomCertPositive() {
114114
log.info("<-- Starting {}", methodName);
115115

116116
String sbomIdentify = "pkg:github/scanoss/scanoss.py\n" + "pkg:pypi/scanoss\n";
117-
ScanApi scanApi = ScanApi.builder().flags("8").scanType("identify").sbom(sbomIdentify)
117+
ScanApi scanApi = ScanApi.builder().flags("8").sbomType("identify").sbom(sbomIdentify)
118118
.url(server.url("/api/scan/direct").toString())
119119
.customCert(customSelfSignedCertificate)
120120
.build();

0 commit comments

Comments
 (0)