-
Notifications
You must be signed in to change notification settings - Fork 21
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
sbomqs score directly from git URLs #280
sbomqs score directly from git URLs #280
Conversation
@viveksahu26 not sure cloning the entire repo just to get the files is a good idea. Is there a way just to pull files that are sboms. We can fix what extensions we look at. |
So, yeah @riteshnoronha . It is possible to implement in a different way i.e. apart form cloning whole repo:
|
@viveksahu26 let me know if this is ready for review |
Yeah it's ready for review... |
pkg/source/source.go
Outdated
@@ -0,0 +1,223 @@ | |||
package source |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should not limit ourselves to only GitHub urls. An SBOM could be on any URL, we should just check if this path is a url and download the file and run sbomqs on it. This is adding too much complexity.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I hope you mean downloading the file in memory instead of local storage.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey @riteshnoronha , We can't download file from any general URL in using same steps or method. For each general URL one need to construct download URL of that and it differs from server to server. For Example to download git URL , one need to construct raw content URL of it, i.e. https://raw.githubusercontent.com
.
Normal URL: https://github.com/interlynk-io/sbomqs/blob/main/samples/sbomqs-spdx-syft.json
Download URL: https://raw.githubusercontent.com/interlynk-io/sbomqs/main/samples/sbomqs-spdx-syft.json
Similarly, if url is google drive url, then you need to construct download URL for GDrive.
Normal URL: https://drive.google.com/file/d/1pL6ykrWZAIxck15tz_f2Rv2Xl3jBNSk8/view?usp=sharing
Download URL: https://drive.google.com/uc?export=download&id=1pL6ykrWZAIxck15tz_f2Rv2Xl3jBNSk8
Similalry for GitLab:
Normal URL: https://gitlab.com/viveksahu26/go-url/-/blob/main/other.spdx.txt?ref_type=heads
Download URL: https://gitlab.com/viveksahu26/go-url/-/raw/main/other.spdx.txt?ref_type=heads
So, one need to know the url representing to servers.
So, it's better for now add a support specifically for git URL and later on if raise issue related to any other URLs then we can deal with that.
5e9d1b1
to
ac5118f
Compare
Hey @riteshnoronha , remove complexity which were there due to 2 reasons:
|
If we support urls then this should work. |
Should work in all places we support file names. e.g compliance etc |
Signed-off-by: Vivek Kumar Sahu <[email protected]>
Signed-off-by: Vivek Kumar Sahu <[email protected]>
Signed-off-by: Vivek Kumar Sahu <[email protected]>
Signed-off-by: Vivek Kumar Sahu <[email protected]>
Signed-off-by: Vivek Kumar Sahu <[email protected]>
Signed-off-by: Vivek Kumar Sahu <[email protected]>
Signed-off-by: Vivek Kumar Sahu <[email protected]>
Signed-off-by: Vivek Kumar Sahu <[email protected]>
Signed-off-by: Vivek Kumar Sahu <[email protected]>
Signed-off-by: Vivek Kumar Sahu <[email protected]>
Signed-off-by: Vivek Kumar Sahu <[email protected]>
3f4a555
to
bbeed14
Compare
closes: #266
This PR add support for
sbomqs score
command to score directly from git URLs. Till now it funtionality limited to local files. For example:$ sbomqs score -b <sbom.spdx.json file>
New feature supports:
Example: