@@ -11,6 +11,7 @@ import (
|
||||
// key: BlobPath
|
||||
type DependencyGraphManifests map[string]DependencyGraphManifest
|
||||
|
||||
// DependencyGraphManifest has filename, repository, dependencies
|
||||
type DependencyGraphManifest struct {
|
||||
BlobPath string `json:"blobPath"`
|
||||
Filename string `json:"filename"`
|
||||
@@ -76,6 +77,7 @@ func (m DependencyGraphManifest) Ecosystem() string {
|
||||
}
|
||||
}
|
||||
|
||||
// Dependency has dependency package information
|
||||
type Dependency struct {
|
||||
PackageName string `json:"packageName"`
|
||||
PackageManager string `json:"packageManager"`
|
||||
@@ -83,6 +85,7 @@ type Dependency struct {
|
||||
Requirements string `json:"requirements"`
|
||||
}
|
||||
|
||||
// Version returns version
|
||||
func (d Dependency) Version() string {
|
||||
s := strings.Split(d.Requirements, " ")
|
||||
if len(s) == 2 && s[0] == "=" {
|
||||
|
||||
@@ -310,6 +310,7 @@ type GitHubSecurityAlert struct {
|
||||
DismissReason string `json:"dismissReason"`
|
||||
}
|
||||
|
||||
// RepoURLPackageName returns a string connecting the repository and package name
|
||||
func (a GitHubSecurityAlert) RepoURLPackageName() string {
|
||||
return fmt.Sprintf("%s %s", a.Repository, a.Package.Name)
|
||||
}
|
||||
@@ -319,6 +320,7 @@ func (a GitHubSecurityAlert) RepoURLManifestPath() string {
|
||||
return fmt.Sprintf("%s/%s", a.Repository, a.Package.ManifestPath)
|
||||
}
|
||||
|
||||
// GSAVulnerablePackage has vulnerable package information
|
||||
type GSAVulnerablePackage struct {
|
||||
Name string `json:"name"`
|
||||
Ecosystem string `json:"ecosystem"`
|
||||
|
||||
Reference in New Issue
Block a user