Closed valentijnscholten closed 4 months ago
thanks for reporting, @valentijnscholten .
could you elaborate on how to reproduce? Maybe add a zip file with a complete project setup, or link to a github repo with a setup?
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 schemairi-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