Skip to content

Conversation

prabhu
Copy link
Collaborator

@prabhu prabhu commented Jun 19, 2025

Upgraded protobuf dependencies and made proto-related cli arguments public, so people can start using. Attached zip includes the cdxgen BOM is json and .proto format. 410 KB vs 107 KB.

bom.zip

Might need some effort to make things compatible with protobuf libraries in other languages, but its time to try this.

.fromJsonString(stringifyIfNeeded(bomJson), {
toBinary(
bomSchema,
fromJsonString(bomSchema, stringifyIfNeeded(bomJson), {
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am not particularly proud of this snippet, but things do not always directly translate between jsonschema and protobuf correctly. On occasions, there could be bugs in the spec.

@@ -110,7 +110,8 @@
},
"optionalDependencies": {
"@appthreat/atom": "2.2.5",
"@appthreat/cdx-proto": "1.0.1",
"@appthreat/cdx-proto": "1.1.0",
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe we should create a mono-repo structure and move this library to within cdxgen?

prabhu added 4 commits June 19, 2025 14:28
Signed-off-by: Prabhu Subramanian <prabhu@appthreat.com>
Signed-off-by: Prabhu Subramanian <prabhu@appthreat.com>
Signed-off-by: Prabhu Subramanian <prabhu@appthreat.com>
Signed-off-by: Prabhu Subramanian <prabhu@appthreat.com>
@prabhu prabhu force-pushed the feature/proto-upgrade branch from d0ae201 to 0fc4d3f Compare June 19, 2025 13:29
@@ -58,7 +58,7 @@
"cdx-verify": "bin/verify.js"
},
"scripts": {
"test": "node --experimental-vm-modules node_modules/jest/bin/jest.js --inject-globals false lib/managers/docker.test.js lib/helpers/utils.test.js lib/helpers/display.test.js lib/stages/postgen/postgen.test.js lib/evinser/swiftsem.test.js lib/server/server.test.js",
"test": "node --experimental-vm-modules node_modules/jest/bin/jest.js --inject-globals false lib/managers/docker.test.js lib/helpers/protobom.test.js lib/helpers/utils.test.js lib/helpers/display.test.js lib/stages/postgen/postgen.test.js lib/evinser/swiftsem.test.js lib/server/server.test.js",
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have a feeling the protobom.test.js may not work in all os and node combinations. let's find out what works and what doesn't.

@prabhu prabhu merged commit 29bce13 into master Jun 19, 2025
72 checks passed
@prabhu prabhu deleted the feature/proto-upgrade branch June 19, 2025 14:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant