github.com/anchore/syft@v1.38.2/syft/cataloging/license.go (about) 1 package cataloging 2 3 import ( 4 "github.com/anchore/syft/internal/licenses" 5 ) 6 7 // LicenseContent controls when license content should be included in the SBOM. 8 type LicenseContent string 9 10 const ( 11 LicenseContentIncludeAll LicenseContent = "all" 12 LicenseContentIncludeUnknown LicenseContent = "unknown" 13 LicenseContentExcludeAll LicenseContent = "none" 14 ) 15 16 type LicenseConfig struct { 17 // IncludeContent controls whether license copy discovered should be included in the SBOM. 18 IncludeContent LicenseContent `json:"include-content" yaml:"include-content" mapstructure:"include-content"` 19 20 // Coverage is the percentage of text that must match a license for it to be considered a match. 21 Coverage float64 `json:"coverage" yaml:"coverage" mapstructure:"coverage"` 22 } 23 24 func DefaultLicenseConfig() LicenseConfig { 25 return LicenseConfig{ 26 IncludeContent: LicenseContentExcludeAll, 27 Coverage: licenses.DefaultCoverageThreshold, 28 } 29 }