fix: CPE generation for django (#2068)

Signed-off-by: witchcraze <witchcraze@gmail.com>
This commit is contained in:
witchcraze 2023-08-28 21:28:01 +09:00 committed by GitHub
parent dd09e0362e
commit cedfa05e93
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 13 additions and 0 deletions

View File

@ -183,6 +183,11 @@ var defaultCandidateAdditions = buildCandidateLookup(
candidateKey{PkgName: "pip"}, candidateKey{PkgName: "pip"},
candidateAddition{AdditionalVendors: []string{"pypa"}}, candidateAddition{AdditionalVendors: []string{"pypa"}},
}, },
{
pkg.PythonPkg,
candidateKey{PkgName: "Django"},
candidateAddition{AdditionalVendors: []string{"djangoproject"}},
},
// Alpine packages // Alpine packages
{ {
pkg.ApkPkg, pkg.ApkPkg,

View File

@ -896,6 +896,14 @@ func TestCandidateVendor(t *testing.T) {
}, },
expected: []string{"apache"}, expected: []string{"apache"},
}, },
{
name: "Django",
p: pkg.Package{
Name: "Django",
Type: pkg.PythonPkg,
},
expected: []string{"djangoproject" /* <-- known good names | default guess --> */, "Django"},
},
} }
for _, test := range tests { for _, test := range tests {