Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature Request: read SBOM from stdin #172

Open
kzantow opened this issue Oct 29, 2024 · 0 comments
Open

Feature Request: read SBOM from stdin #172

kzantow opened this issue Oct 29, 2024 · 0 comments

Comments

@kzantow
Copy link

kzantow commented Oct 29, 2024

It would be great if the CLI functions which read SBOMs support reading from piped standard input.

There are some cases where it is much more convenient to pipe output of one tool into another one instead of requiring files. For example: using the tools to validate a SBOM in a container requires: saving the SBOM to a file, run the container with a mounted filesystem containing the SBOM, referencing the same SBOM using a path matching how the container mount was specified, etc. whereas doing something like cat <sbom> | docker run --rm -i spdx-java-tools-validator:latest could be much simpler and could prevent needing an intermediary file altogether in certain circumstances.

A suggestion: one reasonably simple way to do this is just check the file input being just a single dash, - (like implemented in vim: vi -), which causes the system to explicitly read from stdin instead of attempting to load a file. This would allow something like the aforementioned cat <sbom> | docker run --rm -i spdx-java-tools-validator:latest Verify - to work for the example.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant