database: Add affected feature type
Affected feature type is for determining either the source feature or the binary feature that an vulnerability affects.
This commit is contained in:
parent
17539bda60
commit
00fadfc3e3
26
database/affected_feature_type.go
Normal file
26
database/affected_feature_type.go
Normal file
@ -0,0 +1,26 @@
|
|||||||
|
// Copyright 2018 clair authors
|
||||||
|
//
|
||||||
|
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
// you may not use this file except in compliance with the License.
|
||||||
|
// You may obtain a copy of the License at
|
||||||
|
//
|
||||||
|
// http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
//
|
||||||
|
// Unless required by applicable law or agreed to in writing, software
|
||||||
|
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
// See the License for the specific language governing permissions and
|
||||||
|
// limitations under the License.
|
||||||
|
|
||||||
|
package database
|
||||||
|
|
||||||
|
// AffectedFeatureType indicates the type of feature that a vulnerability
|
||||||
|
// affects.
|
||||||
|
type AffectedFeatureType string
|
||||||
|
|
||||||
|
const (
|
||||||
|
// AffectSourcePackage indicates the vulnerability affects a source package.
|
||||||
|
AffectSourcePackage AffectedFeatureType = "source"
|
||||||
|
// AffectBinaryPackage indicates the vulnerability affects a binary package.
|
||||||
|
AffectBinaryPackage AffectedFeatureType = "binary"
|
||||||
|
)
|
@ -199,8 +199,10 @@ type VulnerabilityWithFixedIn struct {
|
|||||||
// by a Vulnerability. Namespace and Feature Name is unique. Affected Feature is
|
// by a Vulnerability. Namespace and Feature Name is unique. Affected Feature is
|
||||||
// bound to vulnerability.
|
// bound to vulnerability.
|
||||||
type AffectedFeature struct {
|
type AffectedFeature struct {
|
||||||
Namespace Namespace
|
// AffectedType determines which type of package it affects.
|
||||||
FeatureName string
|
AffectedType AffectedFeatureType
|
||||||
|
Namespace Namespace
|
||||||
|
FeatureName string
|
||||||
// FixedInVersion is known next feature version that's not affected by the
|
// FixedInVersion is known next feature version that's not affected by the
|
||||||
// vulnerability. Empty FixedInVersion means the unaffected version is
|
// vulnerability. Empty FixedInVersion means the unaffected version is
|
||||||
// unknown.
|
// unknown.
|
||||||
@ -229,7 +231,7 @@ type Vulnerability struct {
|
|||||||
Metadata MetadataMap
|
Metadata MetadataMap
|
||||||
}
|
}
|
||||||
|
|
||||||
// VulnerabilityWithAffected is an vulnerability with all known affected
|
// VulnerabilityWithAffected is a vulnerability with all known affected
|
||||||
// features.
|
// features.
|
||||||
type VulnerabilityWithAffected struct {
|
type VulnerabilityWithAffected struct {
|
||||||
Vulnerability
|
Vulnerability
|
||||||
|
Loading…
Reference in New Issue
Block a user