@kanonak-protocol/cli 6.3.0 → 6.4.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.
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import { KanonakParser } from '@kanonak-protocol/sdk';
|
|
2
|
-
import type { AuthenticatedFetchFn } from '@kanonak-protocol/sdk';
|
|
1
|
+
import { KanonakParser, PublisherIndex } from '@kanonak-protocol/sdk';
|
|
3
2
|
import type { LockFile, LockEntry } from '@kanonak-protocol/sdk';
|
|
4
3
|
import { FileCache } from '../cache/FileCache.js';
|
|
5
4
|
/**
|
|
@@ -12,6 +11,12 @@ import { FileCache } from '../cache/FileCache.js';
|
|
|
12
11
|
* sha256 before caching (the `npm ci` model). There is no version-range
|
|
13
12
|
* selection: the publisher's lock IS the resolution.
|
|
14
13
|
*
|
|
14
|
+
* Where the bytes come from is the consumer's choice when it configured
|
|
15
|
+
* package URL templates (#130): a new install records the template's URL in
|
|
16
|
+
* each entry's `resolved`, and an install from the local lock fetches from the
|
|
17
|
+
* template too, leaving the lock as it is. With no template, an install from
|
|
18
|
+
* the lock fetches `resolved` as recorded. The sha256 is checked either way.
|
|
19
|
+
*
|
|
15
20
|
* Usage: kanonak install kanonak.org/core-rdf (install what the lock pins)
|
|
16
21
|
* kanonak install kanonak.org/core-rdf@1.0.1 (must match the pinned version)
|
|
17
22
|
* kanonak install (install from the local kanonak.lock)
|
|
@@ -19,11 +24,12 @@ import { FileCache } from '../cache/FileCache.js';
|
|
|
19
24
|
export declare function installCommand(packageRef?: string): Promise<void>;
|
|
20
25
|
/**
|
|
21
26
|
* Ensure a pinned package is in the cache: a cache hit is verified against the
|
|
22
|
-
* lock's integrity; a miss is fetched
|
|
23
|
-
*
|
|
24
|
-
* disagrees with the lock —
|
|
27
|
+
* lock's integrity; a miss is fetched through `publisherIndex` (the user's
|
|
28
|
+
* template, else the entry's `resolved` URL), verified, identity-checked, then
|
|
29
|
+
* cached. Never caches bytes whose hash or namespace disagrees with the lock —
|
|
30
|
+
* a mismatch throws.
|
|
25
31
|
*/
|
|
26
|
-
export declare function fetchVerifyCache(publisher: string, packageName: string, entry: LockEntry, fileCache: FileCache, parser: KanonakParser,
|
|
32
|
+
export declare function fetchVerifyCache(publisher: string, packageName: string, entry: LockEntry, fileCache: FileCache, parser: KanonakParser, publisherIndex: PublisherIndex): Promise<void>;
|
|
27
33
|
/**
|
|
28
34
|
* The keys of `rootKey` and every package reachable through its (transitive)
|
|
29
35
|
* `dependencies`, all resolved within `lock`. A dependency the lock references
|
|
@@ -4,8 +4,10 @@
|
|
|
4
4
|
* The cache is an untrusted accelerator: this re-hashes each cached package and
|
|
5
5
|
* compares it to the committed `kanonak.lock` (catches local tampering/
|
|
6
6
|
* corruption of the cache). With `--remote` it also re-fetches each package
|
|
7
|
-
* from
|
|
8
|
-
*
|
|
7
|
+
* from where `install` would, the user's package URL template or else its
|
|
8
|
+
* recorded `resolved` URL, through the credentialed transport, and compares to
|
|
9
|
+
* the lock (catches lock↔origin drift: a tampered lock, a republished package,
|
|
10
|
+
* or a MITM). The lock — committed and
|
|
9
11
|
* reviewed in version control — is the trust root; this command makes any
|
|
10
12
|
* divergence from it detectable rather than silent. Exits non-zero on any
|
|
11
13
|
* mismatch, so it can gate a build in CI.
|