Skip to content

Commit

Permalink
resolve language/CPE TODOs
Browse files Browse the repository at this point in the history
  • Loading branch information
ghouscht committed Nov 13, 2024
1 parent 2c97d5d commit 8835e61
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
2 changes: 2 additions & 0 deletions syft/pkg/cataloger/terraform/cataloger_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ func TestTerraformCataloger(t *testing.T) {
FoundBy: "terraform-lock-cataloger",
Locations: file.NewLocationSet(location),
Type: pkg.TerraformPkg,
Language: pkg.Go,
PURL: "pkg:terraform/registry.terraform.io/hashicorp/[email protected]",
Metadata: pkg.TerraformLockEntry{
URL: "registry.terraform.io/hashicorp/aws",
Expand Down Expand Up @@ -55,6 +56,7 @@ func TestTerraformCataloger(t *testing.T) {
FoundBy: "terraform-lock-cataloger",
Locations: file.NewLocationSet(location),
Type: pkg.TerraformPkg,
Language: pkg.Go,
PURL: "pkg:terraform/registry.terraform.io/hashicorp/[email protected]",
Metadata: pkg.TerraformLockEntry{
URL: "registry.terraform.io/hashicorp/google",
Expand Down
9 changes: 4 additions & 5 deletions syft/pkg/cataloger/terraform/parse_tf_lock.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,10 @@ func parseTerraformLock(_ context.Context, _ file.Resolver, _ *generic.Environme
Version: provider.Version,
Locations: file.NewLocationSet(reader.Location.WithAnnotation(pkg.EvidenceAnnotationKey, pkg.PrimaryEvidenceAnnotation)),
Licenses: pkg.NewLicenseSet(), // TODO: license could be found in .terraform/providers/${name}/${version}/${arch}/LICENSE.txt
// TODO: Language?
Type: pkg.TerraformPkg,
// TODO: CPEs?
PURL: packageurl.NewPackageURL(packageurl.TypeTerraform, "", provider.URL, provider.Version, nil, "").String(),
Metadata: provider,
Language: pkg.Go,
Type: pkg.TerraformPkg,
PURL: packageurl.NewPackageURL(packageurl.TypeTerraform, "", provider.URL, provider.Version, nil, "").String(),
Metadata: provider,
}
p.SetID()

Expand Down

0 comments on commit 8835e61

Please sign in to comment.