mirror of
https://github.com/anchore/syft.git
synced 2026-10-30 14:02:26 +01:00
* Vcpkg cataloger for vcpkg "Manifest Mode" Find and parse vcpkg-lock.json to get HEAD commit hash Signed-off-by: Gabriel Rau <gabetrau@gmail.com> Signed-off-by: Alex Goodman <wagoodman@users.noreply.github.com> * just use local vcpkg git repo if it exists, clone it if it doesn't Signed-off-by: Gabriel Rau <gabetrau@gmail.com> Signed-off-by: Alex Goodman <wagoodman@users.noreply.github.com> * Config opt for git remote clones for vcpkg and README update Signed-off-by: Gabriel Rau <gabetrau@gmail.com> * Look in vcpkg cache git repo for custom git repos Signed-off-by: Gabriel Rau <gabetrau@gmail.com> Signed-off-by: Alex Goodman <wagoodman@users.noreply.github.com> * add triplet to metadata and support overlay-ports from config file Signed-off-by: Gabriel Rau <gabetrau@gmail.com> Signed-off-by: Alex Goodman <wagoodman@users.noreply.github.com> * Add PURL to packages (not sure if this is correct) Signed-off-by: Gabriel Rau <gabetrau@gmail.com> Signed-off-by: Alex Goodman <wagoodman@users.noreply.github.com> * flatten structs in pkg module and move vcpkg structs to resolver Signed-off-by: Gabriel Rau <gabetrau@gmail.com> Signed-off-by: Alex Goodman <wagoodman@users.noreply.github.com> * account for overriden versions in toplevel manifest Signed-off-by: Gabriel Rau <gabetrau@gmail.com> Signed-off-by: Alex Goodman <wagoodman@users.noreply.github.com> * generate json schema for vcpkg metadata Signed-off-by: Gabriel Rau <gabetrau@gmail.com> * test for basic vcpkg project dependencies for vcpkg registry to be pulled in add tree hashes and use correct git hash in builtin-baseline for helloworld test vcpkg-registry for testing that uses object hashes from syft repo fix broken tests Signed-off-by: Gabriel Rau <gabetrau@gmail.com> * formatting Signed-off-by: Gabriel Rau <gabetrau@gmail.com> * fix static-analysis violations Signed-off-by: Gabriel Rau <gabetrau@gmail.com> Signed-off-by: Alex Goodman <wagoodman@users.noreply.github.com> * fix integration test failure Signed-off-by: Gabriel Rau <gabetrau@gmail.com> * remove uneeded files from vcpkg test fixture and use custom registry Signed-off-by: Gabriel Rau <gabetrau@gmail.com> * change vcpkg registry to anchore one Signed-off-by: Gabriel Rau <gabetrau@gmail.com> Signed-off-by: Alex Goodman <wagoodman@users.noreply.github.com> * purl spec based on open PR Signed-off-by: Gabriel Rau <gabetrau@gmail.com> Signed-off-by: Alex Goodman <wagoodman@users.noreply.github.com> * generate-json-schema Signed-off-by: Gabriel Rau <gabetrau@gmail.com> Signed-off-by: Alex Goodman <wagoodman@users.noreply.github.com> * rebased and generate json schema 16.0.40 Signed-off-by: Gabriel Rau <gabetrau@gmail.com> * address low hanging fruit Signed-off-by: Alex Goodman <wagoodman@users.noreply.github.com> * handle additional comments Signed-off-by: Alex Goodman <wagoodman@users.noreply.github.com> * migrate to testdata Signed-off-by: Alex Goodman <wagoodman@users.noreply.github.com> * improve docs and testing Signed-off-by: Alex Goodman <wagoodman@users.noreply.github.com> * fix static analysis Signed-off-by: Alex Goodman <wagoodman@users.noreply.github.com> * remove license from pkg metadata Signed-off-by: Alex Goodman <wagoodman@users.noreply.github.com> * fix capabilities claim Signed-off-by: Alex Goodman <wagoodman@users.noreply.github.com> --------- Signed-off-by: Gabriel Rau <gabetrau@gmail.com> Signed-off-by: Alex Goodman <wagoodman@users.noreply.github.com> Co-authored-by: Alex Goodman <wagoodman@users.noreply.github.com>
84 lines
2.8 KiB
Go
84 lines
2.8 KiB
Go
package pkgcataloging
|
|
|
|
import (
|
|
"github.com/anchore/syft/syft/pkg/cataloger/binary"
|
|
"github.com/anchore/syft/syft/pkg/cataloger/cpp"
|
|
"github.com/anchore/syft/syft/pkg/cataloger/dotnet"
|
|
"github.com/anchore/syft/syft/pkg/cataloger/golang"
|
|
"github.com/anchore/syft/syft/pkg/cataloger/java"
|
|
"github.com/anchore/syft/syft/pkg/cataloger/javascript"
|
|
"github.com/anchore/syft/syft/pkg/cataloger/kernel"
|
|
"github.com/anchore/syft/syft/pkg/cataloger/nix"
|
|
"github.com/anchore/syft/syft/pkg/cataloger/python"
|
|
)
|
|
|
|
type Config struct {
|
|
Binary binary.ClassifierCatalogerConfig `yaml:"binary" json:"binary" mapstructure:"binary"`
|
|
Cpp cpp.CatalogerConfig `yaml:"cpp" json:"cpp" mapstructure:"cpp"`
|
|
Dotnet dotnet.CatalogerConfig `yaml:"dotnet" json:"dotnet" mapstructure:"dotnet"`
|
|
Golang golang.CatalogerConfig `yaml:"golang" json:"golang" mapstructure:"golang"`
|
|
JavaArchive java.ArchiveCatalogerConfig `yaml:"java-archive" json:"java-archive" mapstructure:"java-archive"`
|
|
JavaScript javascript.CatalogerConfig `yaml:"javascript" json:"javascript" mapstructure:"javascript"`
|
|
LinuxKernel kernel.LinuxKernelCatalogerConfig `yaml:"linux-kernel" json:"linux-kernel" mapstructure:"linux-kernel"`
|
|
Nix nix.Config `yaml:"nix" json:"nix" mapstructure:"nix"`
|
|
Python python.CatalogerConfig `yaml:"python" json:"python" mapstructure:"python"`
|
|
}
|
|
|
|
func DefaultConfig() Config {
|
|
return Config{
|
|
Binary: binary.DefaultClassifierCatalogerConfig(),
|
|
Cpp: cpp.DefaultCatalogerConfig(),
|
|
Dotnet: dotnet.DefaultCatalogerConfig(),
|
|
Golang: golang.DefaultCatalogerConfig(),
|
|
JavaArchive: java.DefaultArchiveCatalogerConfig(),
|
|
LinuxKernel: kernel.DefaultLinuxKernelCatalogerConfig(),
|
|
Nix: nix.DefaultConfig(),
|
|
Python: python.DefaultCatalogerConfig(),
|
|
}
|
|
}
|
|
|
|
func (c Config) WithNixConfig(cfg nix.Config) Config {
|
|
c.Nix = cfg
|
|
return c
|
|
}
|
|
|
|
func (c Config) WithBinaryConfig(cfg binary.ClassifierCatalogerConfig) Config {
|
|
c.Binary = cfg
|
|
return c
|
|
}
|
|
|
|
func (c Config) WithCppConfig(cfg cpp.CatalogerConfig) Config {
|
|
c.Cpp = cfg
|
|
return c
|
|
}
|
|
|
|
func (c Config) WithDotnetConfig(cfg dotnet.CatalogerConfig) Config {
|
|
c.Dotnet = cfg
|
|
return c
|
|
}
|
|
|
|
func (c Config) WithGolangConfig(cfg golang.CatalogerConfig) Config {
|
|
c.Golang = cfg
|
|
return c
|
|
}
|
|
|
|
func (c Config) WithJavascriptConfig(cfg javascript.CatalogerConfig) Config {
|
|
c.JavaScript = cfg
|
|
return c
|
|
}
|
|
|
|
func (c Config) WithLinuxKernelConfig(cfg kernel.LinuxKernelCatalogerConfig) Config {
|
|
c.LinuxKernel = cfg
|
|
return c
|
|
}
|
|
|
|
func (c Config) WithPythonConfig(cfg python.CatalogerConfig) Config {
|
|
c.Python = cfg
|
|
return c
|
|
}
|
|
|
|
func (c Config) WithJavaArchiveConfig(cfg java.ArchiveCatalogerConfig) Config {
|
|
c.JavaArchive = cfg
|
|
return c
|
|
}
|