Skip to content

Commit

Permalink
Fix encoding of PURLs in SBOM output
Browse files Browse the repository at this point in the history
  • Loading branch information
eoftedal committed Aug 20, 2024
1 parent 3eeed9c commit 1bef86e
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 13 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# Changelog

## 1.6.3

### Bugfix

* Fix encoding of PURLs in SBOM output

## 1.6.2

### Bugfix
Expand Down
12 changes: 6 additions & 6 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"author": "Erlend Oftedal <[email protected]>",
"name": "retire-site-scanner",
"version": "1.6.2",
"version": "1.6.3",
"license": "Apache-2.0",
"description": "A scanner for checking a web site using retire.js",
"main": "dist/index.js",
Expand All @@ -24,7 +24,7 @@
"dependencies": {
"cacheable-lookup": "^7.0.0",
"puppeteer": "^23.1.0",
"retire": "^5.2.1",
"retire": "^5.2.2",
"source-map": "^0.7.4"
},
"devDependencies": {
Expand Down
6 changes: 1 addition & 5 deletions src/log.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
type LogLevel = "DBG" | "INF" | "ERR" | "WRN" | "TRC";
import crypto, { randomUUID } from "crypto";
import { Component } from "retire/lib/types";
import { generatePURL } from "retire/lib/reporters/utils";
import { unique } from "./utils";
const pjson = require("../package.json");

Expand Down Expand Up @@ -188,11 +189,6 @@ function formatContentTypes(
.join(" ");
}

function generatePURL(component: Component): string {
if (component.basePurl) return component.basePurl + "@" + component.version;
return `pkg:npm/${component.npmname ?? component.component}@${component.version}`;
}

export function convertToCycloneDX(resultToConvert: typeof collectedResults) {
const components = new Map<string, CycloneDXComponent>();
const vulnerabilities: Array<CycloneDXVulnerability> = [];
Expand Down

0 comments on commit 1bef86e

Please sign in to comment.