-
-
Notifications
You must be signed in to change notification settings - Fork 22
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
[BUG] repository with git ssh url end up violating CycloneDX json schema #1198
Comments
thanks for reporting, @valentijnscholten . could you elaborate on how to reproduce? The current information is just not enough to craft a reproducible (regression) test from. |
some details on current sanitizing: there is none for unknown hosts... see https://runkit.com/jkowalleck/667edd7d89e6c1000878b965 const hostedGitInfo = require("hosted-git-info")
const info1 = hostedGitInfo.fromUrl("git@github.com:group/repo.git", {})
console.log('info1', info1, info1.toString())
const info2 = hostedGitInfo.fromUrl("git@gitlab.example.com:group/repo.git", {})
console.log('info2', info2) |
@valentijnscholten , would you be willing to work on a solution to your problem? |
this might work, ... https://runkit.com/jkowalleck/667ee45ffa67ee0008c5f152 const GitUrlParse = require("git-url-parse");
const x1= GitUrlParse("http://github.com/IonicaBizau/node-git-url-parse.git");
console.log(x1);
console.log(x1.toString(x1.protocols == ['ssh'] ? 'git+ssh' : undefined));
const x2 = GitUrlParse("git@gitlab.example.com:IonicaBizau/node-git-url-parse.git");
console.log(x2);
console.log(x2.toString(x2.protocols == ['ssh'] ? 'git+ssh' : undefined)); |
i will work on this very soon |
Thanks! I'll give it a go soon. |
v1.19.2 includes the fix |
Describe the bug
For projects that have a git SSH url in the
repository
section, this url ends up asexternalReference
in the generated SBOM.This is URL violates the JSON schema
iri-reference
. We ran into this in DependencyTrackTo Reproduce
Add a git ssh url to your
repository
section in thepackage.json
Expected behavior
Although the input URL doesn't adhere to the
iri-reference
spec, it might be possible to convert these urls into agit+ssh://...
style url. Similar to what is already done for known saas hosting platforms via https://www.npmjs.com/package/hosted-git-infoScreenshots or output-paste
Generated bom output:
Environment
The text was updated successfully, but these errors were encountered: