aboutcode-org / aboutcode-org/scancode-toolkit

Authenticated Git dependency in package.json parsed as package "git" instead of declared dependency name

Aperta
#4,753 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub
bug
Lingua principale
Python
Stelle
2.6k
Fork
791
Merge medio
1g 12h
PR unite (30g)
5

Descrizione

**Description**
ScanCode reports an incorrect dependency name when a package.json dependency uses an authenticated Git URL.

The dependency key defined in package.json is lost and replaced with "git".

**Steps to reproduce**
1. Create package.json:

{
"name": "example",
"version": "1.0.0",
"dependencies": {
"private-lib": "git+ssh://git@github.com:org/repo.git#v1.0.0"
}
}

2. Run:
./scancode -clip --json result.json .

3. Inspect dependency output

**Observed result**
Dependency is reported as:
pkg:npm/git

The declared dependency name "private-lib" is not preserved.

**Expected result**
Dependency name should remain "private-lib"
and the Git URL should be treated as the requirement for that dependency.

**Why this matters**
Authenticated Git dependencies are commonly used for private repositories.
Incorrect dependency names break dependency tracking and SBOM generation.

Guida per i contributori

Apri la guida per i contributori

Valutazione

Questa issue non è ancora stata valutata.

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.