mirror of
https://github.com/anchore/syft.git
synced 2026-11-01 23:16:30 +01:00
add file contents cataloger
Signed-off-by: Alex Goodman <alex.goodman@anchore.com>
This commit is contained in:
@@ -38,6 +38,7 @@ type Application struct {
|
||||
Package packages `yaml:"package" json:"package" mapstructure:"package"`
|
||||
FileMetadata FileMetadata `yaml:"file-metadata" json:"file-metadata" mapstructure:"file-metadata"`
|
||||
FileClassification fileClassification `yaml:"file-classification" json:"file-classification" mapstructure:"file-classification"`
|
||||
Contents contents `yaml:"contents" json:"contents" mapstructure:"contents"`
|
||||
Secrets secrets `yaml:"secrets" json:"secrets" mapstructure:"secrets"`
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,24 @@
|
||||
package config
|
||||
|
||||
import (
|
||||
"github.com/anchore/syft/internal/file"
|
||||
"github.com/anchore/syft/syft/source"
|
||||
"github.com/spf13/viper"
|
||||
)
|
||||
|
||||
type contents struct {
|
||||
Cataloger catalogerOptions `yaml:"cataloger" json:"cataloger" mapstructure:"cataloger"`
|
||||
SkipFilesAboveSize int64 `yaml:"skip-files-above-size" json:"skip-files-above-size" mapstructure:"skip-files-above-size"`
|
||||
Globs []string `yaml:"globs" json:"globs" mapstructure:"globs"`
|
||||
}
|
||||
|
||||
func (cfg contents) loadDefaultValues(v *viper.Viper) {
|
||||
v.SetDefault("contents.cataloger.enabled", true)
|
||||
v.SetDefault("contents.cataloger.scope", source.SquashedScope)
|
||||
v.SetDefault("contents.skip-files-above-size", 1*file.MB)
|
||||
v.SetDefault("contents.globs", []string{})
|
||||
}
|
||||
|
||||
func (cfg *contents) parseConfigValues() error {
|
||||
return cfg.Cataloger.parseConfigValues()
|
||||
}
|
||||
Reference in New Issue
Block a user