Skip to content

Commit 8dda8ec

Browse files
committed
Added scripts for Scan SBOM feature
Signed-off-by: mrrajan <[email protected].> Assisted-by: Cursor
1 parent c8846cc commit 8dda8ec

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

46 files changed

+88151
-16
lines changed

e2e/tests/api/dependencies/global.setup.ts

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,12 @@ const uploadSboms = async (axios: AxiosInstance, files: string[]) => {
3131
const uploads = files.map((e) => {
3232
const filePath = path.join(__dirname, `../../common/assets/sbom/${e}`);
3333
fs.statSync(filePath); // Verify file exists
34-
3534
const fileStream = fs.createReadStream(filePath);
35+
const contentType = e.endsWith(".bz2")
36+
? "application/json+bzip2"
37+
: "application/json";
3638
return axios.post("/api/v2/sbom", fileStream, {
37-
headers: { "Content-Type": "application/json+bzip2" },
39+
headers: { "Content-Type": contentType },
3840
});
3941
});
4042

@@ -45,10 +47,12 @@ const uploadAdvisories = async (axios: AxiosInstance, files: string[]) => {
4547
const uploads = files.map((e) => {
4648
const filePath = path.join(__dirname, `../../common/assets/csaf/${e}`);
4749
fs.statSync(filePath); // Verify file exists
48-
4950
const fileStream = fs.createReadStream(filePath);
51+
const contentType = e.endsWith(".bz2")
52+
? "application/json+bzip2"
53+
: "application/json";
5054
return axios.post("/api/v2/advisory", fileStream, {
51-
headers: { "Content-Type": "application/json+bzip2" },
55+
headers: { "Content-Type": contentType },
5256
});
5357
});
5458

1.91 KB
Binary file not shown.
2.01 KB
Binary file not shown.
2 KB
Binary file not shown.
2.46 KB
Binary file not shown.
1.75 KB
Binary file not shown.
1.81 KB
Binary file not shown.
1.8 KB
Binary file not shown.
1.62 KB
Binary file not shown.

0 commit comments

Comments
 (0)