@pnpm/deps.compliance.sbom 1100.4.1 → 1101.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +35 -0
- package/lib/collectComponents.d.ts +3 -3
- package/lib/collectComponents.js +5 -5
- package/lib/purl.js +2 -2
- package/package.json +17 -17
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,40 @@
|
|
|
1
1
|
# @pnpm/deps.compliance.sbom
|
|
2
2
|
|
|
3
|
+
## 1101.0.0
|
|
4
|
+
|
|
5
|
+
### Major Changes
|
|
6
|
+
|
|
7
|
+
- The three registry lookups are now named for what they are keyed by, so that none of them is called `registries` — a name the `registries` setting itself has taken:
|
|
8
|
+
|
|
9
|
+
| before | after |
|
|
10
|
+
|---|---|
|
|
11
|
+
| `Config.registries` | `Config.registriesByScope` |
|
|
12
|
+
| `Config.namedRegistries` | `Config.registriesByPrefix` |
|
|
13
|
+
| `Config.registryOptions` | `Config.registryOptionsByUrl` |
|
|
14
|
+
|
|
15
|
+
The same rename applies to the `RegistryContext` fields, the `Registries` and `NamedRegistries` types (now `RegistriesByScope` and `RegistriesByPrefix`), `normalizeRegistries` / `normalizeNamedRegistries` (now `normalizeRegistriesByScope` / `normalizeRegistriesByPrefix`), and the `BUILTIN_NAMED_REGISTRIES` constant (now `BUILTIN_REGISTRIES_BY_PREFIX`).
|
|
16
|
+
|
|
17
|
+
This is an internal rename: no setting, error code, lockfile field, or `.pnpmfile.cjs` hook field changes. A `preResolution` hook still reads `ctx.registries`, which is the name pacquet passes as well. The `registries` and `namedRegistries` settings are read under the names users write them.
|
|
18
|
+
|
|
19
|
+
The pnpr resolve request sends `registriesByPrefix` where it sent `namedRegistries`. A pnpr server and its clients must be on matching versions, which is already the case for an experimental server.
|
|
20
|
+
|
|
21
|
+
### Patch Changes
|
|
22
|
+
|
|
23
|
+
- Updated dependencies:
|
|
24
|
+
- @pnpm/config.normalize-registries@1101.0.0
|
|
25
|
+
- @pnpm/config.package-is-installable@1100.1.4
|
|
26
|
+
- @pnpm/constants@1102.0.0
|
|
27
|
+
- @pnpm/error@1100.1.3
|
|
28
|
+
- @pnpm/lockfile.detect-dep-types@1100.0.20
|
|
29
|
+
- @pnpm/lockfile.types@1100.0.20
|
|
30
|
+
- @pnpm/lockfile.utils@1102.0.0
|
|
31
|
+
- @pnpm/lockfile.walker@1100.0.20
|
|
32
|
+
- @pnpm/pkg-manifest.reader@1100.0.17
|
|
33
|
+
- @pnpm/resolving.resolver-base@1101.1.1
|
|
34
|
+
- @pnpm/store.index@1100.2.5
|
|
35
|
+
- @pnpm/store.pkg-finder@1100.0.30
|
|
36
|
+
- @pnpm/types@1102.0.0
|
|
37
|
+
|
|
3
38
|
## 1100.4.1
|
|
4
39
|
|
|
5
40
|
### Patch Changes
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { LockfileObject } from '@pnpm/lockfile.types';
|
|
2
2
|
import type { Resolution } from '@pnpm/resolving.resolver-base';
|
|
3
|
-
import type { DependenciesField, ProjectId,
|
|
3
|
+
import type { DependenciesField, ProjectId, RegistriesByScope, SupportedArchitectures } from '@pnpm/types';
|
|
4
4
|
import type { SbomComponentType, SbomResult } from './types.js';
|
|
5
5
|
export interface WorkspacePackageInfo {
|
|
6
6
|
name: string;
|
|
@@ -23,8 +23,8 @@ export interface CollectSbomComponentsOptions {
|
|
|
23
23
|
include?: {
|
|
24
24
|
[dependenciesField in DependenciesField]: boolean;
|
|
25
25
|
};
|
|
26
|
-
|
|
27
|
-
|
|
26
|
+
registriesByScope: RegistriesByScope;
|
|
27
|
+
registriesByPrefix?: Record<string, string>;
|
|
28
28
|
lockfileDir: string;
|
|
29
29
|
includedImporterIds?: ProjectId[];
|
|
30
30
|
supportedArchitectures?: SupportedArchitectures;
|
package/lib/collectComponents.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import path from 'node:path';
|
|
2
|
-
import {
|
|
2
|
+
import { normalizeRegistriesByPrefix } from '@pnpm/config.normalize-registries';
|
|
3
3
|
import { checkPackageInstallability } from '@pnpm/config.package-is-installable';
|
|
4
4
|
import { PnpmError } from '@pnpm/error';
|
|
5
5
|
import { DepType, detectDepTypes } from '@pnpm/lockfile.detect-dep-types';
|
|
@@ -158,9 +158,9 @@ async function walkStep(step, parentPurl, depTypes, componentsMap, relationships
|
|
|
158
158
|
// artifact from a compliance document.
|
|
159
159
|
const registryUrl = registryName == null
|
|
160
160
|
? undefined
|
|
161
|
-
:
|
|
161
|
+
: normalizeRegistriesByPrefix(opts.registriesByPrefix)[registryName];
|
|
162
162
|
if (registryName != null && registryUrl == null) {
|
|
163
|
-
throw new PnpmError('MISSING_NAMED_REGISTRY', `Cannot describe package "${depPath}": it was resolved from the named registry '${registryName}:', which is not present in the
|
|
163
|
+
throw new PnpmError('MISSING_NAMED_REGISTRY', `Cannot describe package "${depPath}": it was resolved from the named registry '${registryName}:', which is not present in the registriesByPrefix setting.`, { hint: `Add '${registryName}' to the registriesByPrefix setting in pnpm-workspace.yaml.` });
|
|
164
164
|
}
|
|
165
165
|
const purl = buildPurl({
|
|
166
166
|
name,
|
|
@@ -172,11 +172,11 @@ async function walkStep(step, parentPurl, depTypes, componentsMap, relationships
|
|
|
172
172
|
if (componentsMap.has(purl))
|
|
173
173
|
return;
|
|
174
174
|
const integrity = verifiedIntegrity(pkgSnapshot.resolution);
|
|
175
|
-
const resolution = pkgSnapshotToResolution(depPath, pkgSnapshot, {
|
|
175
|
+
const resolution = pkgSnapshotToResolution(depPath, pkgSnapshot, { registriesByScope: opts.registriesByScope, registriesByPrefix: opts.registriesByPrefix });
|
|
176
176
|
const tarballUrl = resolution.tarball ?? gitDownloadUrl(resolution);
|
|
177
177
|
let metadata = {};
|
|
178
178
|
if (metadataOpts) {
|
|
179
|
-
metadata = await getPkgMetadata(depPath, pkgSnapshot, {
|
|
179
|
+
metadata = await getPkgMetadata(depPath, pkgSnapshot, { registriesByScope: opts.registriesByScope, registriesByPrefix: opts.registriesByPrefix }, metadataOpts);
|
|
180
180
|
}
|
|
181
181
|
const component = {
|
|
182
182
|
name,
|
package/lib/purl.js
CHANGED
|
@@ -28,7 +28,7 @@ export function buildPurl(opts) {
|
|
|
28
28
|
* Reduce a registry URL to the parts that identify the registry, dropping
|
|
29
29
|
* anything that could carry a secret.
|
|
30
30
|
*
|
|
31
|
-
* An SBOM is meant to be published, and a `
|
|
31
|
+
* An SBOM is meant to be published, and a `registriesByPrefix` entry may
|
|
32
32
|
* legitimately embed credentials — as userinfo
|
|
33
33
|
* (`https://user:token@npm.example.com/`) or in a query string
|
|
34
34
|
* (`?api_key=…`). Origin and path are kept because two registries can
|
|
@@ -37,7 +37,7 @@ export function buildPurl(opts) {
|
|
|
37
37
|
* qualifier exists to prevent.
|
|
38
38
|
*
|
|
39
39
|
* A URL that doesn't parse is returned unchanged: it has no userinfo to
|
|
40
|
-
* strip, and `
|
|
40
|
+
* strip, and `registriesByPrefix` values are validated as http(s) URLs when
|
|
41
41
|
* the resolver is constructed, so this is unreachable in practice.
|
|
42
42
|
*/
|
|
43
43
|
function sanitizeRegistryUrl(url) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pnpm/deps.compliance.sbom",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "1101.0.0",
|
|
4
4
|
"description": "Generate SBOM from pnpm lockfile",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"pnpm",
|
|
@@ -30,21 +30,21 @@
|
|
|
30
30
|
"!*.map"
|
|
31
31
|
],
|
|
32
32
|
"dependencies": {
|
|
33
|
-
"@cyclonedx/cyclonedx-library": "10.
|
|
34
|
-
"@pnpm/config.normalize-registries": "
|
|
35
|
-
"@pnpm/config.package-is-installable": "1100.1.
|
|
36
|
-
"@pnpm/constants": "
|
|
33
|
+
"@cyclonedx/cyclonedx-library": "10.2.0",
|
|
34
|
+
"@pnpm/config.normalize-registries": "1101.0.0",
|
|
35
|
+
"@pnpm/config.package-is-installable": "1100.1.4",
|
|
36
|
+
"@pnpm/constants": "1102.0.0",
|
|
37
37
|
"@pnpm/deps.compliance.license-resolver": "1100.0.1",
|
|
38
|
-
"@pnpm/error": "1100.1.
|
|
39
|
-
"@pnpm/lockfile.detect-dep-types": "1100.0.
|
|
40
|
-
"@pnpm/lockfile.types": "1100.0.
|
|
41
|
-
"@pnpm/lockfile.utils": "
|
|
42
|
-
"@pnpm/lockfile.walker": "1100.0.
|
|
43
|
-
"@pnpm/pkg-manifest.reader": "1100.0.
|
|
44
|
-
"@pnpm/resolving.resolver-base": "1101.1.
|
|
45
|
-
"@pnpm/store.index": "1100.2.
|
|
46
|
-
"@pnpm/store.pkg-finder": "1100.0.
|
|
47
|
-
"@pnpm/types": "
|
|
38
|
+
"@pnpm/error": "1100.1.3",
|
|
39
|
+
"@pnpm/lockfile.detect-dep-types": "1100.0.20",
|
|
40
|
+
"@pnpm/lockfile.types": "1100.0.20",
|
|
41
|
+
"@pnpm/lockfile.utils": "1102.0.0",
|
|
42
|
+
"@pnpm/lockfile.walker": "1100.0.20",
|
|
43
|
+
"@pnpm/pkg-manifest.reader": "1100.0.17",
|
|
44
|
+
"@pnpm/resolving.resolver-base": "1101.1.1",
|
|
45
|
+
"@pnpm/store.index": "1100.2.5",
|
|
46
|
+
"@pnpm/store.pkg-finder": "1100.0.30",
|
|
47
|
+
"@pnpm/types": "1102.0.0",
|
|
48
48
|
"p-limit": "^7.3.1",
|
|
49
49
|
"ssri": "13.0.1"
|
|
50
50
|
},
|
|
@@ -53,9 +53,9 @@
|
|
|
53
53
|
},
|
|
54
54
|
"devDependencies": {
|
|
55
55
|
"@jest/globals": "30.4.1",
|
|
56
|
-
"@pnpm/deps.compliance.sbom": "
|
|
56
|
+
"@pnpm/deps.compliance.sbom": "1101.0.0",
|
|
57
57
|
"@pnpm/logger": "1100.0.0",
|
|
58
|
-
"@pnpm/store.cafs": "1100.
|
|
58
|
+
"@pnpm/store.cafs": "1100.2.0",
|
|
59
59
|
"@types/ssri": "^7.1.5"
|
|
60
60
|
},
|
|
61
61
|
"engines": {
|