mirror of
https://github.com/anchore/syft.git
synced 2026-11-01 15:06:36 +01:00
add java cataloger
This commit is contained in:
@@ -2,7 +2,7 @@ package pkg
|
||||
|
||||
const (
|
||||
UnknownLanguage Language = iota
|
||||
//Java
|
||||
Java
|
||||
//JavaScript
|
||||
Python
|
||||
Ruby
|
||||
@@ -12,14 +12,14 @@ type Language uint
|
||||
|
||||
var languageStr = []string{
|
||||
"UnknownLanguage",
|
||||
//"java",
|
||||
"java",
|
||||
//"javascript",
|
||||
"python",
|
||||
"ruby",
|
||||
}
|
||||
|
||||
var AllLanguages = []Language{
|
||||
//Java,
|
||||
Java,
|
||||
//JavaScript,
|
||||
Python,
|
||||
Ruby,
|
||||
|
||||
@@ -14,3 +14,30 @@ type RpmMetadata struct {
|
||||
Arch string `mapstructure:"Arch"`
|
||||
Release string `mapstructure:"Release"`
|
||||
}
|
||||
|
||||
type JavaManifest struct {
|
||||
Name string `mapstructure:"Name"`
|
||||
ManifestVersion string `mapstructure:"Manifest-Version"`
|
||||
SpecTitle string `mapstructure:"Specification-Title"`
|
||||
SpecVersion string `mapstructure:"Specification-Version"`
|
||||
SpecVendor string `mapstructure:"Specification-Vendor"`
|
||||
ImplTitle string `mapstructure:"Implementation-Title"`
|
||||
ImplVersion string `mapstructure:"Implementation-Version"`
|
||||
ImplVendor string `mapstructure:"Implementation-Vendor"`
|
||||
Extra map[string]string `mapstructure:",remain"`
|
||||
}
|
||||
|
||||
type PomProperties struct {
|
||||
Path string
|
||||
Name string `mapstructure:"name"`
|
||||
GroupID string `mapstructure:"groupId"`
|
||||
ArtifactID string `mapstructure:"artifactId"`
|
||||
Version string `mapstructure:"version"`
|
||||
Extra map[string]string `mapstructure:",remain"`
|
||||
}
|
||||
|
||||
type JavaMetadata struct {
|
||||
Manifest *JavaManifest `mapstructure:"Manifest"`
|
||||
PomProperties *PomProperties `mapstructure:"PomProperties"`
|
||||
Parent *Package
|
||||
}
|
||||
|
||||
@@ -9,8 +9,10 @@ import (
|
||||
type ID int64
|
||||
|
||||
// TODO: add field to trace which cataloger detected this
|
||||
|
||||
// Package represents an application or library that has been bundled into a distributable format
|
||||
type Package struct {
|
||||
id ID
|
||||
id ID // this is set when a package is added to the catalog
|
||||
Name string
|
||||
Version string
|
||||
FoundBy string
|
||||
|
||||
@@ -9,6 +9,11 @@ const (
|
||||
//PacmanPkg
|
||||
RpmPkg
|
||||
WheelPkg
|
||||
JarPkg
|
||||
WarPkg
|
||||
EarPkg
|
||||
JpiPkg
|
||||
HpiPkg
|
||||
)
|
||||
|
||||
type Type uint
|
||||
@@ -22,6 +27,11 @@ var typeStr = []string{
|
||||
//"pacman",
|
||||
"rpm",
|
||||
"wheel",
|
||||
"jar",
|
||||
"war",
|
||||
"ear",
|
||||
"jpi",
|
||||
"hpi",
|
||||
}
|
||||
|
||||
var AllPkgs = []Type{
|
||||
@@ -32,6 +42,11 @@ var AllPkgs = []Type{
|
||||
//PacmanPkg,
|
||||
RpmPkg,
|
||||
WheelPkg,
|
||||
JarPkg,
|
||||
WarPkg,
|
||||
EarPkg,
|
||||
JpiPkg,
|
||||
HpiPkg,
|
||||
}
|
||||
|
||||
func (t Type) String() string {
|
||||
|
||||
Reference in New Issue
Block a user