mirror of
https://github.com/anchore/syft.git
synced 2026-10-31 14:36:33 +01:00
Add poetry cataloger (#121)
* Minor cleanup Signed-off-by: Dan Luhring <dan.luhring@anchore.com> * Update pkg Type definition to string Signed-off-by: Dan Luhring <dan.luhring@anchore.com> * Implement poetry.lock parsing Signed-off-by: Dan Luhring <dan.luhring@anchore.com> * Address CI issues Signed-off-by: Dan Luhring <dan.luhring@anchore.com> * Integrate Alex's changes Signed-off-by: Dan Luhring <dan.luhring@anchore.com>
This commit is contained in:
+1
-1
@@ -15,7 +15,7 @@ type Package struct {
|
||||
id ID // this is set when a package is added to the catalog
|
||||
Name string `json:"manifest"`
|
||||
Version string `json:"version"`
|
||||
FoundBy string `json:"found-by"`
|
||||
FoundBy string `json:"found-by"` // FoundBy is the cataloger that discovered this package
|
||||
Source []file.Reference `json:"sources"`
|
||||
Licenses []string `json:"licenses"` // TODO: should we move this into metadata?
|
||||
Language Language `json:"language"` // TODO: should this support multiple languages as a slice?
|
||||
|
||||
+18
-41
@@ -1,47 +1,31 @@
|
||||
package pkg
|
||||
|
||||
type Type string
|
||||
|
||||
const (
|
||||
UnknownPkg Type = iota
|
||||
ApkPkg
|
||||
BundlerPkg
|
||||
DebPkg
|
||||
EggPkg
|
||||
//PacmanPkg
|
||||
RpmPkg
|
||||
WheelPkg
|
||||
NpmPkg
|
||||
YarnPkg
|
||||
PythonRequirementsPkg
|
||||
JavaPkg
|
||||
JenkinsPluginPkg
|
||||
GoModulePkg
|
||||
UnknownPkg Type = "UnknownPackage"
|
||||
ApkPkg Type = "apk"
|
||||
BundlerPkg Type = "bundle"
|
||||
DebPkg Type = "deb"
|
||||
EggPkg Type = "egg"
|
||||
// PacmanPkg Type = "pacman"
|
||||
RpmPkg Type = "rpm"
|
||||
WheelPkg Type = "wheel"
|
||||
PoetryPkg Type = "poetry"
|
||||
NpmPkg Type = "npm"
|
||||
YarnPkg Type = "yarn"
|
||||
PythonRequirementsPkg Type = "python-requirements"
|
||||
JavaPkg Type = "java-archive"
|
||||
JenkinsPluginPkg Type = "jenkins-plugin"
|
||||
GoModulePkg Type = "go-module"
|
||||
)
|
||||
|
||||
type Type uint
|
||||
|
||||
var typeStr = []string{
|
||||
"UnknownPackage",
|
||||
"apk",
|
||||
"bundle",
|
||||
"deb",
|
||||
"egg",
|
||||
//"pacman",
|
||||
"rpm",
|
||||
"wheel",
|
||||
"npm",
|
||||
"yarn",
|
||||
"python-requirements",
|
||||
"java-archive",
|
||||
"jenkins-plugin",
|
||||
"go-module",
|
||||
}
|
||||
|
||||
var AllPkgs = []Type{
|
||||
ApkPkg,
|
||||
BundlerPkg,
|
||||
DebPkg,
|
||||
EggPkg,
|
||||
//PacmanPkg,
|
||||
// PacmanPkg,
|
||||
RpmPkg,
|
||||
WheelPkg,
|
||||
NpmPkg,
|
||||
@@ -51,10 +35,3 @@ var AllPkgs = []Type{
|
||||
JenkinsPluginPkg,
|
||||
GoModulePkg,
|
||||
}
|
||||
|
||||
func (t Type) String() string {
|
||||
if int(t) >= len(typeStr) {
|
||||
return typeStr[0]
|
||||
}
|
||||
return typeStr[t]
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user