Skip to content

Commit

Permalink
feat: Generic Binary Cataloger (#1336)
Browse files Browse the repository at this point in the history
  • Loading branch information
kzantow committed Nov 29, 2022
1 parent 7a69e21 commit 4f39287
Show file tree
Hide file tree
Showing 36 changed files with 579 additions and 740 deletions.
29 changes: 0 additions & 29 deletions cmd/syft/cli/eventloop/tasks.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ func Tasks(app *config.Application) ([]Task, error) {
generateCatalogFileMetadataTask,
generateCatalogFileDigestsTask,
generateCatalogSecretsTask,
generateCatalogFileClassificationsTask,
generateCatalogContentsTask,
}

Expand Down Expand Up @@ -162,34 +161,6 @@ func generateCatalogSecretsTask(app *config.Application) (Task, error) {
return task, nil
}

func generateCatalogFileClassificationsTask(app *config.Application) (Task, error) {
if !app.FileClassification.Cataloger.Enabled {
return nil, nil
}

// TODO: in the future we could expose out the classifiers via configuration
classifierCataloger, err := file.NewClassificationCataloger(file.DefaultClassifiers)
if err != nil {
return nil, err
}

task := func(results *sbom.Artifacts, src *source.Source) ([]artifact.Relationship, error) {
resolver, err := src.FileResolver(app.FileClassification.Cataloger.ScopeOpt)
if err != nil {
return nil, err
}

result, err := classifierCataloger.Catalog(resolver)
if err != nil {
return nil, err
}
results.FileClassifications = result
return nil, nil
}

return task, nil
}

func generateCatalogContentsTask(app *config.Application) (Task, error) {
if !app.FileContents.Cataloger.Enabled {
return nil, nil
Expand Down
38 changes: 0 additions & 38 deletions syft/file/classification_cataloger.go

This file was deleted.

210 changes: 0 additions & 210 deletions syft/file/classification_cataloger_test.go

This file was deleted.

Loading

0 comments on commit 4f39287

Please sign in to comment.