-
Notifications
You must be signed in to change notification settings - Fork 587
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add deprecation notices and split old and new cataloging config
Signed-off-by: Alex Goodman <alex.goodman@anchore.com>
- Loading branch information
Showing
24 changed files
with
209 additions
and
144 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
package cataloger | ||
|
||
import ( | ||
"crypto" | ||
|
||
"github.com/anchore/syft/syft/pkg/cataloger/java" | ||
"github.com/anchore/syft/syft/source" | ||
) | ||
|
||
const ( | ||
NoFilesSelection FileCatalogingSelection = "no-files" | ||
OwnedFilesSelection FileCatalogingSelection = "owned-files" | ||
AllFilesSelection FileCatalogingSelection = "all-files" | ||
) | ||
|
||
type FileCatalogingSelection string | ||
|
||
type Config struct { | ||
Search SearchConfig | ||
Relationships RelationshipsConfig | ||
SyntheticData SyntheticConfig | ||
FileCatalogingSelection FileCatalogingSelection | ||
FileHashers []crypto.Hash | ||
} | ||
|
||
type RelationshipsConfig struct { | ||
FileOwnership bool | ||
FileOwnershipOverlap bool | ||
} | ||
|
||
type SyntheticConfig struct { | ||
GenerateCPEs bool | ||
GuessLanguageFromPURL bool | ||
} | ||
|
||
type SearchConfig struct { | ||
IncludeIndexedArchives bool | ||
IncludeUnindexedArchives bool | ||
Scope source.Scope | ||
} | ||
|
||
func DefaultConfig() Config { | ||
return Config{ | ||
Search: DefaultSearchConfig(), | ||
Relationships: DefaultRelationshipsConfig(), | ||
SyntheticData: DefaultSyntheticConfig(), | ||
FileCatalogingSelection: OwnedFilesSelection, | ||
} | ||
} | ||
|
||
func DefaultSearchConfig() SearchConfig { | ||
return SearchConfig{ | ||
IncludeIndexedArchives: true, | ||
IncludeUnindexedArchives: false, | ||
Scope: source.SquashedScope, | ||
} | ||
} | ||
|
||
func DefaultSyntheticConfig() SyntheticConfig { | ||
return SyntheticConfig{ | ||
GenerateCPEs: true, | ||
GuessLanguageFromPURL: true, | ||
} | ||
} | ||
|
||
func DefaultRelationshipsConfig() RelationshipsConfig { | ||
return RelationshipsConfig{ | ||
FileOwnership: true, | ||
FileOwnershipOverlap: true, | ||
} | ||
} | ||
|
||
func (c Config) Java() java.Config { | ||
return java.Config{ | ||
SearchUnindexedArchives: c.Search.IncludeUnindexedArchives, | ||
SearchIndexedArchives: c.Search.IncludeIndexedArchives, | ||
} | ||
} |
Oops, something went wrong.