Skip to content

Commit 52fdc56

Browse files
authored
Scan SBOM test scenarios (#772)
Signed-off-by: mrrajan <[email protected].>
1 parent 16c0fc2 commit 52fdc56

File tree

61 files changed

+88206
-66
lines changed

Some content is hidden

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

61 files changed

+88206
-66
lines changed

biome.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,8 @@
4040
"!**/dist",
4141
"!**/node_modules",
4242
"!client/coverage",
43-
"!client/src/app/client"
43+
"!client/src/app/client",
44+
"!**/common/assets"
4445
]
4546
}
4647
}

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.

0 commit comments

Comments
 (0)