diff --git a/syft/format/internal/spdxutil/helpers/originator_supplier_test.go b/syft/format/internal/spdxutil/helpers/originator_supplier_test.go index 3979b79fc2cc..a3d48790029c 100644 --- a/syft/format/internal/spdxutil/helpers/originator_supplier_test.go +++ b/syft/format/internal/spdxutil/helpers/originator_supplier_test.go @@ -374,7 +374,7 @@ func Test_OriginatorSupplier(t *testing.T) { { name: "from terraform lock", input: pkg.Package{ - Metadata: pkg.TerraformLockEntry{}, + Metadata: pkg.TerraformLockProviderEntry{}, }, originator: "", supplier: "", diff --git a/syft/internal/packagemetadata/generated.go b/syft/internal/packagemetadata/generated.go index f4734968ff33..f49268001009 100644 --- a/syft/internal/packagemetadata/generated.go +++ b/syft/internal/packagemetadata/generated.go @@ -52,7 +52,7 @@ func AllTypes() []any { pkg.RustCargoLockEntry{}, pkg.SwiftPackageManagerResolvedEntry{}, pkg.SwiplPackEntry{}, - pkg.TerraformLockEntry{}, + pkg.TerraformLockProviderEntry{}, pkg.WordpressPluginEntry{}, pkg.YarnLockEntry{}, } diff --git a/syft/internal/packagemetadata/names.go b/syft/internal/packagemetadata/names.go index 7f433ab12dcf..d7587fa98a2d 100644 --- a/syft/internal/packagemetadata/names.go +++ b/syft/internal/packagemetadata/names.go @@ -109,7 +109,7 @@ var jsonTypes = makeJSONTypes( jsonNamesWithoutLookup(pkg.RustBinaryAuditEntry{}, "rust-cargo-audit-entry", "RustCargoPackageMetadata"), // the legacy value is split into two types, where the other is preferred jsonNames(pkg.WordpressPluginEntry{}, "wordpress-plugin-entry", "WordpressMetadata"), jsonNames(pkg.LuaRocksPackage{}, "luarocks-package"), - jsonNames(pkg.TerraformLockEntry{}, "terraform-lock-entry"), + jsonNames(pkg.TerraformLockProviderEntry{}, "terraform-lock-provider-entry"), ) func expandLegacyNameVariants(names ...string) []string { diff --git a/syft/pkg/cataloger/terraform/cataloger_test.go b/syft/pkg/cataloger/terraform/cataloger_test.go index 1a03f489369b..f3a7a22d6408 100644 --- a/syft/pkg/cataloger/terraform/cataloger_test.go +++ b/syft/pkg/cataloger/terraform/cataloger_test.go @@ -24,7 +24,7 @@ func TestTerraformCataloger(t *testing.T) { Type: pkg.TerraformPkg, Language: pkg.Go, PURL: "pkg:terraform/registry.terraform.io/hashicorp/aws@5.72.1", - Metadata: pkg.TerraformLockEntry{ + Metadata: pkg.TerraformLockProviderEntry{ URL: "registry.terraform.io/hashicorp/aws", Version: "5.72.1", Constraints: "> 5.72.0", @@ -58,7 +58,7 @@ func TestTerraformCataloger(t *testing.T) { Type: pkg.TerraformPkg, Language: pkg.Go, PURL: "pkg:terraform/registry.terraform.io/hashicorp/google@6.8.0", - Metadata: pkg.TerraformLockEntry{ + Metadata: pkg.TerraformLockProviderEntry{ URL: "registry.terraform.io/hashicorp/google", Version: "6.8.0", Constraints: "6.8.0", diff --git a/syft/pkg/cataloger/terraform/parse_tf_lock.go b/syft/pkg/cataloger/terraform/parse_tf_lock.go index cde3ac9907d6..573c3fa93a58 100644 --- a/syft/pkg/cataloger/terraform/parse_tf_lock.go +++ b/syft/pkg/cataloger/terraform/parse_tf_lock.go @@ -15,7 +15,7 @@ import ( ) type terraformLockFile struct { - Providers []pkg.TerraformLockEntry `hcl:"provider,block"` + Providers []pkg.TerraformLockProviderEntry `hcl:"provider,block"` } func parseTerraformLock(_ context.Context, _ file.Resolver, _ *generic.Environment, reader file.LocationReadCloser) ([]pkg.Package, []artifact.Relationship, error) { diff --git a/syft/pkg/terraform.go b/syft/pkg/terraform.go index 9e4b1b9db1e7..3db50bcbee0d 100644 --- a/syft/pkg/terraform.go +++ b/syft/pkg/terraform.go @@ -1,7 +1,7 @@ package pkg -// TerraformLockEntry represents a single entry in a Terraform dependency lock file (.terraform.lock.hcl). -type TerraformLockEntry struct { +// TerraformLockProviderEntry represents a single provider entry in a Terraform dependency lock file (.terraform.lock.hcl). +type TerraformLockProviderEntry struct { URL string `hcl:",label" json:"url"` Constraints string `hcl:"constraints" json:"constraints"` Version string `hcl:"version" json:"version"`