mirror of
https://github.com/anchore/syft.git
synced 2025-11-18 08:53:15 +01:00
Rename syft-id to package-id (#970)
Co-authored-by: Christopher Phillips <christopher.phillips@anchore.com>
This commit is contained in:
parent
7d8ea39ee5
commit
36973021fa
2
Makefile
2
Makefile
@ -305,7 +305,7 @@ cli: $(SNAPSHOTDIR) ## Run CLI tests
|
|||||||
chmod 755 "$(SNAPSHOT_BIN)"
|
chmod 755 "$(SNAPSHOT_BIN)"
|
||||||
$(SNAPSHOT_BIN) version
|
$(SNAPSHOT_BIN) version
|
||||||
SYFT_BINARY_LOCATION='$(SNAPSHOT_BIN)' \
|
SYFT_BINARY_LOCATION='$(SNAPSHOT_BIN)' \
|
||||||
go test -count=1 -v ./test/cli
|
go test -count=1 -timeout=15m -v ./test/cli
|
||||||
|
|
||||||
.PHONY: changelog
|
.PHONY: changelog
|
||||||
changelog: clean-changelog CHANGELOG.md
|
changelog: clean-changelog CHANGELOG.md
|
||||||
|
|||||||
@ -50,7 +50,7 @@ func deriveBomRef(p pkg.Package) string {
|
|||||||
// TODO: In the future we may want to dedupe by PURL and combine components with
|
// TODO: In the future we may want to dedupe by PURL and combine components with
|
||||||
// the same PURL while preserving their unique metadata.
|
// the same PURL while preserving their unique metadata.
|
||||||
if parsedPURL, err := packageurl.FromString(p.PURL); err == nil {
|
if parsedPURL, err := packageurl.FromString(p.PURL); err == nil {
|
||||||
parsedPURL.Qualifiers = append(parsedPURL.Qualifiers, packageurl.Qualifier{Key: "syft-id", Value: string(p.ID())})
|
parsedPURL.Qualifiers = append(parsedPURL.Qualifiers, packageurl.Qualifier{Key: "package-id", Value: string(p.ID())})
|
||||||
return parsedPURL.ToString()
|
return parsedPURL.ToString()
|
||||||
}
|
}
|
||||||
// fallback is to use strictly the ID if there is no valid pURL
|
// fallback is to use strictly the ID if there is no valid pURL
|
||||||
|
|||||||
@ -171,7 +171,7 @@ func Test_deriveBomRef(t *testing.T) {
|
|||||||
{
|
{
|
||||||
name: "use pURL-id hybrid",
|
name: "use pURL-id hybrid",
|
||||||
pkg: pkgWithPurl,
|
pkg: pkgWithPurl,
|
||||||
want: fmt.Sprintf("pkg:pypi/django@1.11.1?syft-id=%s", pkgWithPurl.ID()),
|
want: fmt.Sprintf("pkg:pypi/django@1.11.1?package-id=%s", pkgWithPurl.ID()),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "fallback to ID when pURL is invalid",
|
name: "fallback to ID when pURL is invalid",
|
||||||
|
|||||||
@ -57,7 +57,7 @@
|
|||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"bom-ref": "pkg:deb/debian/package-2@2.0.1?syft-id=ceda99598967ae8d",
|
"bom-ref": "pkg:deb/debian/package-2@2.0.1?package-id=ceda99598967ae8d",
|
||||||
"type": "library",
|
"type": "library",
|
||||||
"name": "package-2",
|
"name": "package-2",
|
||||||
"version": "2.0.1",
|
"version": "2.0.1",
|
||||||
|
|||||||
@ -62,7 +62,7 @@
|
|||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"bom-ref": "pkg:deb/debian/package-2@2.0.1?syft-id=ae77680e9b1d087e",
|
"bom-ref": "pkg:deb/debian/package-2@2.0.1?package-id=ae77680e9b1d087e",
|
||||||
"type": "library",
|
"type": "library",
|
||||||
"name": "package-2",
|
"name": "package-2",
|
||||||
"version": "2.0.1",
|
"version": "2.0.1",
|
||||||
|
|||||||
@ -32,7 +32,7 @@
|
|||||||
<property name="syft:location:0:path">/some/path/pkg1</property>
|
<property name="syft:location:0:path">/some/path/pkg1</property>
|
||||||
</properties>
|
</properties>
|
||||||
</component>
|
</component>
|
||||||
<component bom-ref="pkg:deb/debian/package-2@2.0.1?syft-id=ceda99598967ae8d" type="library">
|
<component bom-ref="pkg:deb/debian/package-2@2.0.1?package-id=ceda99598967ae8d" type="library">
|
||||||
<name>package-2</name>
|
<name>package-2</name>
|
||||||
<version>2.0.1</version>
|
<version>2.0.1</version>
|
||||||
<cpe>cpe:2.3:*:some:package:2:*:*:*:*:*:*:*</cpe>
|
<cpe>cpe:2.3:*:some:package:2:*:*:*:*:*:*:*</cpe>
|
||||||
|
|||||||
@ -34,7 +34,7 @@
|
|||||||
<property name="syft:location:0:path">/somefile-1.txt</property>
|
<property name="syft:location:0:path">/somefile-1.txt</property>
|
||||||
</properties>
|
</properties>
|
||||||
</component>
|
</component>
|
||||||
<component bom-ref="pkg:deb/debian/package-2@2.0.1?syft-id=ae77680e9b1d087e" type="library">
|
<component bom-ref="pkg:deb/debian/package-2@2.0.1?package-id=ae77680e9b1d087e" type="library">
|
||||||
<name>package-2</name>
|
<name>package-2</name>
|
||||||
<version>2.0.1</version>
|
<version>2.0.1</version>
|
||||||
<cpe>cpe:2.3:*:some:package:2:*:*:*:*:*:*:*</cpe>
|
<cpe>cpe:2.3:*:some:package:2:*:*:*:*:*:*:*</cpe>
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user