feat: add binary classifier for hashicorp vault (#4121)

* add binary classifier for hashicorp vault

The Go Binary Cataloger isn't able to parse the version out of the
binary shipped in the DockerHub images of hashicorp/vault because the
version of the main module isn't set in the binary. Therefore, add a
binary classifier cataloger for this binary.

Signed-off-by: Will Murphy <willmurphyscode@users.noreply.github.com>

* chore: add test fixtures, update vault

Signed-off-by: Keith Zantow <kzantow@gmail.com>

* chore: set binary classifier package type based on PURL

Signed-off-by: Keith Zantow <kzantow@gmail.com>

* chore: use github.com/hashicorp/vault as package name

Signed-off-by: Keith Zantow <kzantow@gmail.com>

* chore: update tests

Signed-off-by: Keith Zantow <kzantow@gmail.com>

---------

Signed-off-by: Will Murphy <willmurphyscode@users.noreply.github.com>
Signed-off-by: Keith Zantow <kzantow@gmail.com>
Co-authored-by: Keith Zantow <kzantow@gmail.com>
This commit is contained in:
Will Murphy
2025-08-08 13:26:15 -04:00
committed by GitHub
co-authored by Keith Zantow
parent 8c6a2bcbb6
commit 594b309cdf
6 changed files with 75 additions and 0 deletions
@@ -1007,6 +1007,28 @@ func Test_Cataloger_PositiveCases(t *testing.T) {
Metadata: metadata("consul-binary"),
},
},
{
logicalFixture: "vault/1.20.2/linux-amd64",
expected: pkg.Package{
Name: "github.com/hashicorp/vault",
Version: "1.20.2",
Type: "golang",
PURL: "pkg:golang/github.com/hashicorp/vault@1.20.2",
Locations: locations("vault"),
Metadata: metadata("hashicorp-vault-binary"),
},
},
{
logicalFixture: "vault/1.19.4/linux-arm64",
expected: pkg.Package{
Name: "github.com/hashicorp/vault",
Version: "1.19.4",
Type: "golang",
PURL: "pkg:golang/github.com/hashicorp/vault@1.19.4",
Locations: locations("vault"),
Metadata: metadata("hashicorp-vault-binary"),
},
},
{
logicalFixture: "erlang/25.3.2.6/linux-amd64",
expected: pkg.Package{