@dsh-enhanced/plugin-control-plane 0.1.6 → 0.1.12
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/README.md +153 -32
- package/bin/dsh-local-release-adapter.js +1381 -0
- package/cordis.patch.yml +1 -0
- package/lib/approval.d.ts +13 -0
- package/lib/approval.d.ts.map +1 -0
- package/lib/approval.js +79 -0
- package/lib/approval.js.map +1 -0
- package/lib/attestation.d.ts +14 -0
- package/lib/attestation.d.ts.map +1 -0
- package/lib/attestation.js +222 -0
- package/lib/attestation.js.map +1 -0
- package/lib/catalog-interpreter.d.ts +12 -0
- package/lib/catalog-interpreter.d.ts.map +1 -0
- package/lib/catalog-interpreter.js +100 -0
- package/lib/catalog-interpreter.js.map +1 -0
- package/lib/catalog.d.ts +95 -10
- package/lib/catalog.d.ts.map +1 -1
- package/lib/catalog.js +1031 -18
- package/lib/catalog.js.map +1 -1
- package/lib/cli.d.ts +9 -0
- package/lib/cli.d.ts.map +1 -1
- package/lib/cli.js +1160 -162
- package/lib/cli.js.map +1 -1
- package/lib/host-attestor.d.ts +13 -0
- package/lib/host-attestor.d.ts.map +1 -0
- package/lib/host-attestor.js +139 -0
- package/lib/host-attestor.js.map +1 -0
- package/lib/index.d.ts +9 -0
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +9 -0
- package/lib/index.js.map +1 -1
- package/lib/lockfile.d.ts +7 -0
- package/lib/lockfile.d.ts.map +1 -0
- package/lib/lockfile.js +271 -0
- package/lib/lockfile.js.map +1 -0
- package/lib/release.d.ts +51 -0
- package/lib/release.d.ts.map +1 -0
- package/lib/release.js +1188 -0
- package/lib/release.js.map +1 -0
- package/lib/service.d.ts +9 -11
- package/lib/service.d.ts.map +1 -1
- package/lib/service.js +57 -29
- package/lib/service.js.map +1 -1
- package/lib/sqlite.d.ts +9 -0
- package/lib/sqlite.d.ts.map +1 -0
- package/lib/sqlite.js +705 -0
- package/lib/sqlite.js.map +1 -0
- package/lib/store.d.ts +258 -0
- package/lib/store.d.ts.map +1 -0
- package/lib/store.js +1848 -0
- package/lib/store.js.map +1 -0
- package/lib/tools.d.ts.map +1 -1
- package/lib/tools.js +23 -3
- package/lib/tools.js.map +1 -1
- package/lib/trust.d.ts +79 -0
- package/lib/trust.d.ts.map +1 -0
- package/lib/trust.js +477 -0
- package/lib/trust.js.map +1 -0
- package/lib/types.d.ts +740 -0
- package/lib/types.d.ts.map +1 -0
- package/lib/types.js +2 -0
- package/lib/types.js.map +1 -0
- package/lib/version.d.ts +1 -1
- package/lib/version.d.ts.map +1 -1
- package/lib/version.js +1 -1
- package/lib/version.js.map +1 -1
- package/package.json +2 -2
package/lib/lockfile.js
ADDED
|
@@ -0,0 +1,271 @@
|
|
|
1
|
+
import { fileURLToPath } from 'node:url';
|
|
2
|
+
import { isAbsolute, relative, resolve } from 'node:path';
|
|
3
|
+
export class LockfileIntegrityError extends Error {
|
|
4
|
+
constructor(message) { super(message); this.name = 'LockfileIntegrityError'; }
|
|
5
|
+
}
|
|
6
|
+
function scalar(raw) {
|
|
7
|
+
const value = raw.trim();
|
|
8
|
+
if (value === '' || value === 'null' || value === '~' || /^[&*!]|<<:/u.test(value)) {
|
|
9
|
+
throw new LockfileIntegrityError('pnpm lockfile contains an unsupported or unsafe scalar');
|
|
10
|
+
}
|
|
11
|
+
if (value.startsWith("'")) {
|
|
12
|
+
if (!value.endsWith("'"))
|
|
13
|
+
throw new LockfileIntegrityError('pnpm lockfile contains an unterminated quoted scalar');
|
|
14
|
+
return value.slice(1, -1).replace(/''/gu, "'");
|
|
15
|
+
}
|
|
16
|
+
if (value.startsWith('"')) {
|
|
17
|
+
if (!value.endsWith('"'))
|
|
18
|
+
throw new LockfileIntegrityError('pnpm lockfile contains an unterminated quoted scalar');
|
|
19
|
+
try {
|
|
20
|
+
return JSON.parse(value);
|
|
21
|
+
}
|
|
22
|
+
catch {
|
|
23
|
+
throw new LockfileIntegrityError('pnpm lockfile contains an invalid quoted scalar');
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
if ((value.includes(':') && !value.startsWith('file:'))
|
|
27
|
+
|| ['[', ']', '{', '}', ',', '#'].some(character => value.includes(character)) || /\s+#/u.test(value)) {
|
|
28
|
+
throw new LockfileIntegrityError('pnpm lockfile uses unsupported ambiguous YAML syntax');
|
|
29
|
+
}
|
|
30
|
+
return value;
|
|
31
|
+
}
|
|
32
|
+
function pair(line, indent) {
|
|
33
|
+
if (line.trim() === '' || line.trimStart().startsWith('#'))
|
|
34
|
+
return undefined;
|
|
35
|
+
if (line.slice(0, indent) !== ' '.repeat(indent) || line[indent] === ' ')
|
|
36
|
+
return undefined;
|
|
37
|
+
const remainder = line.slice(indent);
|
|
38
|
+
const match = /^((?:'[^']*(?:''[^']*)*'|"(?:[^"\\]|\\.)*"|[^:]+)):(?: +(.*))?$/u.exec(remainder);
|
|
39
|
+
if (match === null)
|
|
40
|
+
return undefined;
|
|
41
|
+
return { key: scalar(match[1]), value: match[2] === undefined ? '' : match[2].trim() };
|
|
42
|
+
}
|
|
43
|
+
function inlineResolution(raw) {
|
|
44
|
+
const match = /^\{(.+)\}$/u.exec(raw);
|
|
45
|
+
if (match === null)
|
|
46
|
+
throw new LockfileIntegrityError('pnpm lockfile resolution mapping is ambiguous');
|
|
47
|
+
const output = {};
|
|
48
|
+
const seen = new Set();
|
|
49
|
+
for (const field of match[1].split(/,\s*/u)) {
|
|
50
|
+
const item = /^(integrity|tarball): +(.*)$/u.exec(field);
|
|
51
|
+
if (item === null || seen.has(item[1]))
|
|
52
|
+
throw new LockfileIntegrityError('pnpm lockfile resolution mapping is ambiguous');
|
|
53
|
+
seen.add(item[1]);
|
|
54
|
+
output[item[1]] = scalar(item[2]);
|
|
55
|
+
}
|
|
56
|
+
return output;
|
|
57
|
+
}
|
|
58
|
+
function setOnce(target, key, raw, label) {
|
|
59
|
+
const fields = target;
|
|
60
|
+
if (fields[key] !== undefined)
|
|
61
|
+
throw new LockfileIntegrityError(`pnpm lockfile repeats ${label}`);
|
|
62
|
+
fields[key] = scalar(raw);
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
65
|
+
* Parse only the pnpm v9 mappings needed to bind an install request. The
|
|
66
|
+
* accepted subset is deliberately strict: duplicate keys, aliases, tags,
|
|
67
|
+
* merge keys, tabs, and ambiguous inline YAML fail closed.
|
|
68
|
+
*/
|
|
69
|
+
function parsePnpmLockfile(source) {
|
|
70
|
+
if (Buffer.byteLength(source) > 8 * 1024 * 1024 || source.includes('\t') || /(^|\s)[&*!][^\s]*/mu.test(source) || /^\s*<<:/mu.test(source)) {
|
|
71
|
+
throw new LockfileIntegrityError('pnpm lockfile exceeds limits or uses aliases/tags/tabs');
|
|
72
|
+
}
|
|
73
|
+
const lines = source.replace(/\r\n?/gu, '\n').split('\n');
|
|
74
|
+
let section;
|
|
75
|
+
let packageKey;
|
|
76
|
+
let inResolution = false;
|
|
77
|
+
let importerKey;
|
|
78
|
+
let dependencyGroup = false;
|
|
79
|
+
let dependencyKey;
|
|
80
|
+
let sawPackages = false;
|
|
81
|
+
let sawImporters = false;
|
|
82
|
+
const packages = new Map();
|
|
83
|
+
const importers = new Map();
|
|
84
|
+
for (const line of lines) {
|
|
85
|
+
const top = pair(line, 0);
|
|
86
|
+
if (top !== undefined) {
|
|
87
|
+
section = top.value === '' && (top.key === 'packages' || top.key === 'importers') ? top.key : undefined;
|
|
88
|
+
if (section === 'packages')
|
|
89
|
+
sawPackages = true;
|
|
90
|
+
if (section === 'importers')
|
|
91
|
+
sawImporters = true;
|
|
92
|
+
packageKey = undefined;
|
|
93
|
+
inResolution = false;
|
|
94
|
+
importerKey = undefined;
|
|
95
|
+
dependencyGroup = false;
|
|
96
|
+
dependencyKey = undefined;
|
|
97
|
+
continue;
|
|
98
|
+
}
|
|
99
|
+
if (section === 'packages') {
|
|
100
|
+
const item = pair(line, 2);
|
|
101
|
+
if (item !== undefined) {
|
|
102
|
+
if (item.value !== '')
|
|
103
|
+
throw new LockfileIntegrityError('pnpm lockfile package entry is ambiguous');
|
|
104
|
+
packageKey = item.key;
|
|
105
|
+
inResolution = false;
|
|
106
|
+
if (packages.has(packageKey))
|
|
107
|
+
throw new LockfileIntegrityError(`pnpm lockfile contains duplicate package key ${packageKey}`);
|
|
108
|
+
packages.set(packageKey, {});
|
|
109
|
+
continue;
|
|
110
|
+
}
|
|
111
|
+
if (packageKey === undefined)
|
|
112
|
+
continue;
|
|
113
|
+
const property = pair(line, 4);
|
|
114
|
+
if (property !== undefined) {
|
|
115
|
+
inResolution = property.key === 'resolution' && property.value === '';
|
|
116
|
+
const target = packages.get(packageKey);
|
|
117
|
+
if (property.key === 'resolution' && property.value.startsWith('{')) {
|
|
118
|
+
const resolution = inlineResolution(property.value);
|
|
119
|
+
if (resolution.integrity !== undefined)
|
|
120
|
+
setOnce(target, 'integrity', resolution.integrity, `integrity for ${packageKey}`);
|
|
121
|
+
if (resolution.tarball !== undefined)
|
|
122
|
+
setOnce(target, 'tarball', resolution.tarball, `tarball for ${packageKey}`);
|
|
123
|
+
}
|
|
124
|
+
else if (property.key === 'version')
|
|
125
|
+
setOnce(target, 'version', property.value, `version for ${packageKey}`);
|
|
126
|
+
continue;
|
|
127
|
+
}
|
|
128
|
+
if (inResolution) {
|
|
129
|
+
const resolution = pair(line, 6);
|
|
130
|
+
const target = packages.get(packageKey);
|
|
131
|
+
if (resolution?.key === 'integrity')
|
|
132
|
+
setOnce(target, 'integrity', resolution.value, `integrity for ${packageKey}`);
|
|
133
|
+
if (resolution?.key === 'tarball')
|
|
134
|
+
setOnce(target, 'tarball', resolution.value, `tarball for ${packageKey}`);
|
|
135
|
+
}
|
|
136
|
+
continue;
|
|
137
|
+
}
|
|
138
|
+
if (section === 'importers') {
|
|
139
|
+
const importer = pair(line, 2);
|
|
140
|
+
if (importer !== undefined) {
|
|
141
|
+
if (importer.value !== '')
|
|
142
|
+
throw new LockfileIntegrityError('pnpm lockfile importer entry is ambiguous');
|
|
143
|
+
importerKey = importer.key;
|
|
144
|
+
dependencyGroup = false;
|
|
145
|
+
dependencyKey = undefined;
|
|
146
|
+
if (importers.has(importerKey))
|
|
147
|
+
throw new LockfileIntegrityError(`pnpm lockfile contains duplicate importer ${importerKey}`);
|
|
148
|
+
importers.set(importerKey, new Map());
|
|
149
|
+
continue;
|
|
150
|
+
}
|
|
151
|
+
if (importerKey === undefined)
|
|
152
|
+
continue;
|
|
153
|
+
const group = pair(line, 4);
|
|
154
|
+
if (group !== undefined) {
|
|
155
|
+
dependencyGroup = group.value === '' && ['dependencies', 'devDependencies', 'optionalDependencies'].includes(group.key);
|
|
156
|
+
dependencyKey = undefined;
|
|
157
|
+
continue;
|
|
158
|
+
}
|
|
159
|
+
if (!dependencyGroup)
|
|
160
|
+
continue;
|
|
161
|
+
const dependency = pair(line, 6);
|
|
162
|
+
if (dependency !== undefined) {
|
|
163
|
+
if (dependency.value !== '')
|
|
164
|
+
throw new LockfileIntegrityError('pnpm lockfile importer dependency is ambiguous');
|
|
165
|
+
dependencyKey = dependency.key;
|
|
166
|
+
const target = importers.get(importerKey);
|
|
167
|
+
if (target.has(dependencyKey))
|
|
168
|
+
throw new LockfileIntegrityError(`pnpm lockfile repeats importer dependency ${dependencyKey}`);
|
|
169
|
+
target.set(dependencyKey, {});
|
|
170
|
+
continue;
|
|
171
|
+
}
|
|
172
|
+
if (dependencyKey !== undefined) {
|
|
173
|
+
const property = pair(line, 8);
|
|
174
|
+
const target = importers.get(importerKey).get(dependencyKey);
|
|
175
|
+
if (property?.key === 'specifier')
|
|
176
|
+
setOnce(target, 'specifier', property.value, `specifier for ${dependencyKey}`);
|
|
177
|
+
if (property?.key === 'version')
|
|
178
|
+
setOnce(target, 'version', property.value, `importer version for ${dependencyKey}`);
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
}
|
|
182
|
+
if (!sawPackages || !sawImporters)
|
|
183
|
+
throw new LockfileIntegrityError('pnpm lockfile has no packages or importers mapping');
|
|
184
|
+
return { packages, importers };
|
|
185
|
+
}
|
|
186
|
+
export function parsePnpmPackageIntegrities(source) {
|
|
187
|
+
const parsed = parsePnpmLockfile(source);
|
|
188
|
+
return new Map([...parsed.packages].flatMap(([key, value]) => value.integrity === undefined ? [] : [[key, value.integrity]]));
|
|
189
|
+
}
|
|
190
|
+
function importerDependency(parsed, packageName) {
|
|
191
|
+
const importer = parsed.importers.get('.');
|
|
192
|
+
const dependency = importer?.get(packageName);
|
|
193
|
+
if (dependency === undefined || dependency.specifier === undefined || dependency.version === undefined) {
|
|
194
|
+
throw new LockfileIntegrityError(`pnpm lockfile does not bind importer dependency ${packageName}`);
|
|
195
|
+
}
|
|
196
|
+
return { specifier: dependency.specifier, version: dependency.version };
|
|
197
|
+
}
|
|
198
|
+
function resolvedFileSpecifier(specifier, lockfileDirectory, requireAbsolute) {
|
|
199
|
+
if (!specifier.startsWith('file:') || specifier.startsWith('file://')) {
|
|
200
|
+
throw new LockfileIntegrityError('pnpm lockfile local artifact specifier is not canonical');
|
|
201
|
+
}
|
|
202
|
+
const raw = specifier.slice('file:'.length);
|
|
203
|
+
if (raw === '' || raw.includes('\0') || raw.includes('\r') || raw.includes('\n') || raw.includes('\\')
|
|
204
|
+
|| (requireAbsolute && !isAbsolute(raw)) || (!requireAbsolute && isAbsolute(raw))) {
|
|
205
|
+
throw new LockfileIntegrityError('pnpm lockfile local artifact specifier is not canonical');
|
|
206
|
+
}
|
|
207
|
+
const path = requireAbsolute ? raw : resolve(lockfileDirectory, raw);
|
|
208
|
+
const normalized = requireAbsolute ? path : relative(lockfileDirectory, path);
|
|
209
|
+
if (resolve(path) !== path || raw !== normalized)
|
|
210
|
+
throw new LockfileIntegrityError('pnpm lockfile local artifact specifier is not normalized');
|
|
211
|
+
return path;
|
|
212
|
+
}
|
|
213
|
+
function normalizedRelativeFileSpecifier(lockfileDirectory, artifactPath) {
|
|
214
|
+
const raw = relative(lockfileDirectory, artifactPath);
|
|
215
|
+
if (raw === '' || raw.includes('\\') || isAbsolute(raw) || resolve(lockfileDirectory, raw) !== artifactPath) {
|
|
216
|
+
throw new LockfileIntegrityError('approved local artifact cannot be represented by a canonical relative lockfile specifier');
|
|
217
|
+
}
|
|
218
|
+
return `file:${raw}`;
|
|
219
|
+
}
|
|
220
|
+
function packageMatches(key, exact) { return key === exact || key.startsWith(`${exact}(`); }
|
|
221
|
+
function peerSuffixed(value, exact) { return value === exact || value.startsWith(`${exact}(`); }
|
|
222
|
+
export function verifyApprovedPackagesInLockfile(source, approved, lockfileDirectory = '.') {
|
|
223
|
+
const parsed = parsePnpmLockfile(source);
|
|
224
|
+
const directory = resolve(lockfileDirectory);
|
|
225
|
+
for (const item of approved) {
|
|
226
|
+
const dependency = importerDependency(parsed, item.package);
|
|
227
|
+
let localReference = false;
|
|
228
|
+
if (item.registry !== undefined) {
|
|
229
|
+
try {
|
|
230
|
+
localReference = new URL(item.registry.reference).protocol === 'file:';
|
|
231
|
+
}
|
|
232
|
+
catch { /* parsed catalog prevents this */ }
|
|
233
|
+
}
|
|
234
|
+
if (!localReference) {
|
|
235
|
+
if (dependency.specifier !== item.version || !(dependency.version === item.version || dependency.version.startsWith(`${item.version}(`))) {
|
|
236
|
+
throw new LockfileIntegrityError(`pnpm lockfile does not bind ${item.package}@${item.version} to its approved registry specifier`);
|
|
237
|
+
}
|
|
238
|
+
const exact = `${item.package}@${item.version}`;
|
|
239
|
+
const matches = [...parsed.packages].filter(([key]) => packageMatches(key, exact));
|
|
240
|
+
if (matches.length !== 1 || matches[0][1].integrity !== item.integrity || matches[0][1].tarball !== undefined) {
|
|
241
|
+
throw new LockfileIntegrityError(`pnpm lockfile does not bind ${exact} to its approved integrity`);
|
|
242
|
+
}
|
|
243
|
+
continue;
|
|
244
|
+
}
|
|
245
|
+
let artifactPath;
|
|
246
|
+
const registry = item.registry;
|
|
247
|
+
if (registry === undefined)
|
|
248
|
+
throw new LockfileIntegrityError(`approved local artifact for ${item.package} is invalid`);
|
|
249
|
+
try {
|
|
250
|
+
artifactPath = fileURLToPath(registry.reference);
|
|
251
|
+
}
|
|
252
|
+
catch {
|
|
253
|
+
throw new LockfileIntegrityError(`approved local artifact for ${item.package} is invalid`);
|
|
254
|
+
}
|
|
255
|
+
const expectedVersion = normalizedRelativeFileSpecifier(directory, artifactPath);
|
|
256
|
+
if (resolvedFileSpecifier(dependency.specifier, directory, true) !== artifactPath
|
|
257
|
+
|| !peerSuffixed(dependency.version, expectedVersion)) {
|
|
258
|
+
throw new LockfileIntegrityError(`pnpm lockfile importer does not bind ${item.package} to its approved local artifact`);
|
|
259
|
+
}
|
|
260
|
+
const exact = `${item.package}@${expectedVersion}`;
|
|
261
|
+
const matches = [...parsed.packages].filter(([key]) => packageMatches(key, exact));
|
|
262
|
+
const resolution = matches.length === 1 ? matches[0][1] : undefined;
|
|
263
|
+
const tarball = resolution?.tarball;
|
|
264
|
+
if (resolution === undefined || resolution.version !== item.version || resolution.integrity !== item.integrity
|
|
265
|
+
|| tarball === undefined || tarball !== expectedVersion
|
|
266
|
+
|| resolvedFileSpecifier(tarball, directory, false) !== artifactPath) {
|
|
267
|
+
throw new LockfileIntegrityError(`pnpm lockfile does not bind ${item.package}@${item.version} to its approved local artifact and integrity`);
|
|
268
|
+
}
|
|
269
|
+
}
|
|
270
|
+
}
|
|
271
|
+
//# sourceMappingURL=lockfile.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"lockfile.js","sourceRoot":"","sources":["../src/lockfile.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAA;AACxC,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AAGzD,MAAM,OAAO,sBAAuB,SAAQ,KAAK;IAC/C,YAAY,OAAe,IAAI,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,GAAG,wBAAwB,CAAA,CAAC,CAAC;CACtF;AAkBD,SAAS,MAAM,CAAC,GAAW;IACzB,MAAM,KAAK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KAAK,YAAY;eAC5E,CAAC,YAAY,CAAC,UAAU,CAAC,OAAO,EAAE,eAAe,CAAC,EAAE,CAAC;YACxD,MAAM,IAAI,sBAAsB,CAAC,wCAAwC,IAAI,CAAC,OAAO,iCAAiC,CAAC,CAAA;QACzH,CAAC;QACD,MAAM,KAAK,GAAG,GAAG,IAAI,CAAC,OAAO,IAAI,eAAe,EAAE,CAAA;QAClD,MAAM,OAAO,GAAG,CAAC,GAAG,MAAM,CAAC,QAAQ,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,GAAG,CAAC,EAAE,EAAE,CAAC,cAAc,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC,CAAA;QAClF,MAAM,UAAU,GAAG,OAAO,CAAC,MAAM,KAAK,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,SAAS,CAAA;QACpE,MAAM,OAAO,GAAG,UAAU,EAAE,OAAO,CAAA;QACnC,IAAI,UAAU,KAAK,SAAS,IAAI,UAAU,CAAC,OAAO,KAAK,IAAI,CAAC,OAAO,IAAI,UAAU,CAAC,SAAS,KAAK,IAAI,CAAC,SAAS;eACzG,OAAO,KAAK,SAAS,IAAI,OAAO,KAAK,eAAe;eACpD,qBAAqB,CAAC,OAAO,EAAE,SAAS,EAAE,KAAK,CAAC,KAAK,YAAY,EAAE,CAAC;YACvE,MAAM,IAAI,sBAAsB,CAAC,+BAA+B,IAAI,CAAC,OAAO,IAAI,IAAI,CAAC,OAAO,+CAA+C,CAAC,CAAA;QAC9I,CAAC;IACH,CAAC;AACH,CAAC"}
|
package/lib/release.d.ts
ADDED
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { type PluginControlTrustConfig } from './trust.js';
|
|
2
|
+
import type { PluginSourcePlan, SourcePublishReconciliationAuthority, SourcePublishReconciliationEvidence, SourcePublishReconciliationReceipt, SourcePublishReconciliationRequest, SourceReleaseArtifact, SourceReleaseAuthorization, SourceReleaseAuthorizationAuthority, SourceReleaseAuthority, SourceReleasePhase, SourceReleaseReceipt, SourceReleaseRequest, VerifiedSourceReleaseAuthorization, VerifiedSourceReleaseReceipt, VerifiedSourcePublishReconciliationReceipt } from './types.js';
|
|
3
|
+
export declare function parseSourceReleaseAuthorization(value: unknown): SourceReleaseAuthorization;
|
|
4
|
+
export declare function parseVerifiedSourceReleaseAuthorization(value: unknown): VerifiedSourceReleaseAuthorization;
|
|
5
|
+
export declare function sourceReleaseAuthorizationSigningPayload(authorization: Omit<SourceReleaseAuthorization, 'signature'>): string;
|
|
6
|
+
export declare class Ed25519SourceReleaseAuthorizationAuthority implements SourceReleaseAuthorizationAuthority {
|
|
7
|
+
readonly publicKey: string | Buffer;
|
|
8
|
+
readonly expectedAuthority: string;
|
|
9
|
+
readonly expectedKeyId: string;
|
|
10
|
+
readonly now: () => number;
|
|
11
|
+
constructor(publicKey: string | Buffer, expectedAuthority: string, expectedKeyId: string, now?: () => number);
|
|
12
|
+
verify(input: SourceReleaseAuthorization, plan: PluginSourcePlan): Promise<VerifiedSourceReleaseAuthorization>;
|
|
13
|
+
}
|
|
14
|
+
export declare function parseSourcePublishReconciliationRequest(value: unknown): SourcePublishReconciliationRequest;
|
|
15
|
+
export declare function sourcePublishReconciliationRequestDigest(value: SourcePublishReconciliationRequest): string;
|
|
16
|
+
export declare function sourcePublishReconciliationEvidenceDigest(value: SourcePublishReconciliationEvidence): string;
|
|
17
|
+
export declare function parseSourcePublishReconciliationReceipt(value: unknown): SourcePublishReconciliationReceipt;
|
|
18
|
+
export declare function sourcePublishReconciliationSigningPayload(receipt: Omit<SourcePublishReconciliationReceipt, 'signature'>): string;
|
|
19
|
+
export declare class Ed25519SourcePublishReconciliationAuthority implements SourcePublishReconciliationAuthority {
|
|
20
|
+
readonly publicKey: string | Buffer;
|
|
21
|
+
readonly expectedAuthority: string;
|
|
22
|
+
readonly expectedKeyId: string;
|
|
23
|
+
readonly now: () => number;
|
|
24
|
+
constructor(publicKey: string | Buffer, expectedAuthority: string, expectedKeyId: string, now?: () => number);
|
|
25
|
+
verify(input: SourcePublishReconciliationReceipt, plan: PluginSourcePlan, rawRequest: SourcePublishReconciliationRequest): Promise<VerifiedSourcePublishReconciliationReceipt>;
|
|
26
|
+
}
|
|
27
|
+
export declare function parseSourceReleaseRequest(value: unknown): SourceReleaseRequest;
|
|
28
|
+
export declare function sourceReleaseEvidenceDigest(value: SourceReleaseReceipt['evidence']): string;
|
|
29
|
+
export declare function sourceReleaseRequestDigest(value: SourceReleaseRequest): string;
|
|
30
|
+
export declare function sourceArtifactStatementDigest(value: SourceReleaseArtifact): string;
|
|
31
|
+
export declare function sourceArtifactSigningPayload(value: SourceReleaseArtifact): string;
|
|
32
|
+
export declare function parseSourceReleaseReceipt(value: unknown): SourceReleaseReceipt;
|
|
33
|
+
export declare function sourceReleaseSigningPayload(receipt: Omit<SourceReleaseReceipt, 'signature'>): string;
|
|
34
|
+
export declare class Ed25519SourceReleaseAuthority implements SourceReleaseAuthority {
|
|
35
|
+
readonly publicKey: string | Buffer;
|
|
36
|
+
readonly expectedAuthority: string;
|
|
37
|
+
readonly expectedKeyId: string;
|
|
38
|
+
readonly now: () => number;
|
|
39
|
+
readonly resolveRegistryVerifier?: ((authority: string, keyId: string) => string | Buffer | undefined) | undefined;
|
|
40
|
+
constructor(publicKey: string | Buffer, expectedAuthority: string, expectedKeyId: string, now?: () => number, resolveRegistryVerifier?: ((authority: string, keyId: string) => string | Buffer | undefined) | undefined);
|
|
41
|
+
verify(input: SourceReleaseReceipt, plan: PluginSourcePlan, request: SourceReleaseRequest): Promise<VerifiedSourceReleaseReceipt>;
|
|
42
|
+
}
|
|
43
|
+
export type ReleaseAdapterErrorCode = 'NOT_CONFIGURED' | 'FAILED' | 'OUTPUT_LIMIT' | 'TIMEOUT' | 'VERSION_MISMATCH' | 'EXECUTABLE_CHANGED';
|
|
44
|
+
export declare class ReleaseAdapterError extends Error {
|
|
45
|
+
readonly code: ReleaseAdapterErrorCode;
|
|
46
|
+
readonly phase: SourceReleasePhase;
|
|
47
|
+
constructor(code: ReleaseAdapterErrorCode, phase: SourceReleasePhase, message: string);
|
|
48
|
+
}
|
|
49
|
+
export declare function invokeSourceReleaseAdapter(trust: PluginControlTrustConfig, request: SourceReleaseRequest): Promise<SourceReleaseReceipt>;
|
|
50
|
+
export declare function invokeSourcePublishReconciliationAdapter(trust: PluginControlTrustConfig, request: SourcePublishReconciliationRequest): Promise<SourcePublishReconciliationReceipt>;
|
|
51
|
+
//# sourceMappingURL=release.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"release.d.ts","sourceRoot":"","sources":["../src/release.ts"],"names":[],"mappings":"AAOA,OAAO,EACuB,KAAK,wBAAwB,EAAE,MAAM,YAAY,CAAA;AAC/E,OAAO,KAAK,EACV,gBAAgB,EAChB,oCAAoC,EACpC,mCAAmC,EACnC,kCAAkC,EAClC,kCAAkC,EAClC,qBAAqB,EACrB,0BAA0B,EAC1B,mCAAmC,EACnC,sBAAsB,EACtB,kBAAkB,EAClB,oBAAoB,EACpB,oBAAoB,EAGpB,kCAAkC,EAClC,4BAA4B,EAC5B,0CAA0C,EAC3C,MAAM,YAAY,CAAA;AAwInB,wBAAgB,+BAA+B,CAAC,KAAK,EAAE,OAAO,GAAG,0BAA0B,CAa1F;AAED,wBAAgB,uCAAuC,CAAC,KAAK,EAAE,OAAO,GAAG,kCAAkC,CAU1G;AAOD,wBAAgB,wCAAwC,CAAC,aAAa,EAAE,IAAI,CAAC,0BAA0B,EAAE,WAAW,CAAC,GAAG,MAAM,CAE7H;AAMD,qBAAa,0CAA2C,YAAW,mCAAmC;IACxF,QAAQ,CAAC,SAAS,EAAE,MAAM,GAAG,MAAM;IAAE,QAAQ,CAAC,iBAAiB,EAAE,MAAM;IAAE,QAAQ,CAAC,aAAa,EAAE,MAAM;IACjH,QAAQ,CAAC,GAAG,EAAE,MAAM,MAAM;gBADP,SAAS,EAAE,MAAM,GAAG,MAAM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