Skip to content

Commit

Permalink
Update the microsoft PURL to be generic/microsoft.
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 641244710
  • Loading branch information
tooryx authored and copybara-github committed Jun 7, 2024
1 parent 6f5766c commit 81c01e8
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 12 deletions.
7 changes: 4 additions & 3 deletions extractor/standalone/windows/dismpatch/extractor_windows.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,10 @@ func (e *Extractor) Extract(ctx context.Context, input *standalone.ScanInput) ([
// ToPURL converts an inventory created by this extractor into a PURL.
func (e Extractor) ToPURL(i *extractor.Inventory) (*purl.PackageURL, error) {
return &purl.PackageURL{
Type: purl.TypeMicrosoft,
Name: i.Name,
Version: i.Version,
Type: purl.TypeGeneric,
Namespace: "microsoft",
Name: i.Name,
Version: i.Version,
}, nil
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -120,9 +120,10 @@ func (e Extractor) windowsRevision(key registry.Key) (uint64, error) {
// ToPURL converts an inventory created by this extractor into a PURL.
func (e Extractor) ToPURL(i *extractor.Inventory) (*purl.PackageURL, error) {
return &purl.PackageURL{
Type: purl.TypeMicrosoft,
Name: i.Name,
Version: i.Version,
Type: purl.TypeGeneric,
Namespace: "microsoft",
Name: i.Name,
Version: i.Version,
}, nil
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -120,9 +120,10 @@ func (e *Extractor) handleKey(registryPath, keyName string) (*extractor.Inventor
// ToPURL converts an inventory created by this extractor into a PURL.
func (e Extractor) ToPURL(i *extractor.Inventory) (*purl.PackageURL, error) {
return &purl.PackageURL{
Type: purl.TypeMicrosoft,
Name: i.Name,
Version: i.Version,
Type: purl.TypeGeneric,
Namespace: "microsoft",
Name: i.Name,
Version: i.Version,
}, nil
}

Expand Down
3 changes: 0 additions & 3 deletions purl/purl.go
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,6 @@ const (
TypeRPM = "rpm"
// TypeSwift is pkg:swift purl
TypeSwift = "swift"
// TypeMicrosoft is pkg:microsoft purl
TypeMicrosoft = "microsoft"
// TypeGooget is pkg:googet purl
TypeGooget = "googet"
)
Expand Down Expand Up @@ -168,7 +166,6 @@ func validType(t string) bool {
TypePyPi: true,
TypeRPM: true,
TypeSwift: true,
TypeMicrosoft: true,
TypeGooget: true,
}

Expand Down

0 comments on commit 81c01e8

Please sign in to comment.