@mago-foundation/mago-ski 0.0.0-stage → 0.1.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/LICENSE +202 -0
- package/NOTICE +4 -0
- package/README.md +121 -2
- package/action.yml +58 -0
- package/dist/hosts/github/run.d.ts +21 -0
- package/dist/hosts/github/run.js +119 -0
- package/dist/hosts/pi/index.d.ts +11 -0
- package/dist/hosts/pi/index.js +388 -0
- package/dist/hosts/pi/paths.d.ts +9 -0
- package/dist/hosts/pi/paths.js +55 -0
- package/dist/src/admin.d.ts +70 -0
- package/dist/src/admin.js +115 -0
- package/dist/src/canonical-json.d.ts +12 -0
- package/dist/src/canonical-json.js +104 -0
- package/dist/src/certificate.d.ts +34 -0
- package/dist/src/certificate.js +104 -0
- package/dist/src/cli.d.ts +2 -0
- package/dist/src/cli.js +419 -0
- package/dist/src/diff.d.ts +30 -0
- package/dist/src/diff.js +148 -0
- package/dist/src/dsse.d.ts +23 -0
- package/dist/src/dsse.js +55 -0
- package/dist/src/experimental/sigstore.d.ts +26 -0
- package/dist/src/experimental/sigstore.js +153 -0
- package/dist/src/fs-safe.d.ts +11 -0
- package/dist/src/fs-safe.js +96 -0
- package/dist/src/index.d.ts +14 -0
- package/dist/src/index.js +14 -0
- package/dist/src/keys.d.ts +21 -0
- package/dist/src/keys.js +108 -0
- package/dist/src/main-module.d.ts +5 -0
- package/dist/src/main-module.js +19 -0
- package/dist/src/names.d.ts +7 -0
- package/dist/src/names.js +40 -0
- package/dist/src/policy.d.ts +59 -0
- package/dist/src/policy.js +237 -0
- package/dist/src/revocations.d.ts +28 -0
- package/dist/src/revocations.js +91 -0
- package/dist/src/time.d.ts +9 -0
- package/dist/src/time.js +32 -0
- package/dist/src/tree-digest.d.ts +43 -0
- package/dist/src/tree-digest.js +243 -0
- package/dist/src/trust-root.d.ts +33 -0
- package/dist/src/trust-root.js +115 -0
- package/dist/src/verify.d.ts +73 -0
- package/dist/src/verify.js +134 -0
- package/docs/hosts/adapter-interface.md +33 -0
- package/docs/hosts/github-action.md +45 -0
- package/docs/hosts/pi.md +36 -0
- package/docs/spec/skill-certificate-v1.md +60 -0
- package/docs/spec/skill-tree-v2.md +59 -0
- package/docs/spec/trust-documents-v1.md +103 -0
- package/docs/spec/verification.md +46 -0
- package/docs/threat-model.md +44 -0
- package/package.json +74 -4
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
export declare const TREE_PROFILE = "mago.skill-tree/v2";
|
|
2
|
+
export declare const CERTIFICATE_FILENAME = ".mago-ski-cert.json";
|
|
3
|
+
export declare const IGNORE_FILENAME = ".skilldigestignore";
|
|
4
|
+
/** Always covered: it holds the instructions and the description hosts show the model. */
|
|
5
|
+
export declare const SKILL_FILENAME = "SKILL.md";
|
|
6
|
+
export declare const MAX_TREE_FILES = 20000;
|
|
7
|
+
export declare const MAX_TREE_ENTRIES = 50000;
|
|
8
|
+
export declare const MAX_FILE_BYTES: number;
|
|
9
|
+
export declare const MAX_TREE_BYTES: number;
|
|
10
|
+
export declare const MAX_RELATIVE_PATH_BYTES = 4096;
|
|
11
|
+
export interface TreeFile {
|
|
12
|
+
path: string;
|
|
13
|
+
size: number;
|
|
14
|
+
sha256: string;
|
|
15
|
+
exec: boolean;
|
|
16
|
+
}
|
|
17
|
+
export interface SkillTree {
|
|
18
|
+
profile: typeof TREE_PROFILE;
|
|
19
|
+
digest: string;
|
|
20
|
+
root: string;
|
|
21
|
+
files: TreeFile[];
|
|
22
|
+
totalBytes: number;
|
|
23
|
+
/** Paths left out of the digest: the root `.git`, the in-tree certificate, and `.skilldigestignore` entries. */
|
|
24
|
+
excluded: string[];
|
|
25
|
+
}
|
|
26
|
+
/** Executable bit of a regular file. Windows has no POSIX mode bits, so it always reports false there. */
|
|
27
|
+
export declare function isExecutable(mode: number | bigint): boolean;
|
|
28
|
+
export declare function sha256Hex(bytes: Uint8Array): string;
|
|
29
|
+
/** Hashes one file for read-time checks. Returns the same fields the certificate records. */
|
|
30
|
+
export declare function hashFile(absolutePath: string, relativePath: string): Promise<TreeFile>;
|
|
31
|
+
export interface IgnoreRule {
|
|
32
|
+
pattern: string;
|
|
33
|
+
directoryOnly: boolean;
|
|
34
|
+
}
|
|
35
|
+
export declare function parseIgnoreFile(text: string): IgnoreRule[];
|
|
36
|
+
export declare function compareTreePaths(left: string, right: string): number;
|
|
37
|
+
/** The tree digest is SHA-256 over the canonical JSON of the profile and the sorted per-file list. */
|
|
38
|
+
export declare function digestFileList(files: readonly TreeFile[]): string;
|
|
39
|
+
export declare function collectSkillTree(rootPath: string, { includeContents }?: {
|
|
40
|
+
includeContents?: boolean | undefined;
|
|
41
|
+
}): Promise<SkillTree & {
|
|
42
|
+
contents?: Map<string, Buffer>;
|
|
43
|
+
}>;
|
|
@@ -0,0 +1,243 @@
|
|
|
1
|
+
import { createHash } from 'node:crypto';
|
|
2
|
+
import { constants as fsConstants } from 'node:fs';
|
|
3
|
+
import { lstat, open, opendir, realpath } from 'node:fs/promises';
|
|
4
|
+
import path from 'node:path';
|
|
5
|
+
import { canonicalBytes } from "./canonical-json.js";
|
|
6
|
+
export const TREE_PROFILE = 'mago.skill-tree/v2';
|
|
7
|
+
export const CERTIFICATE_FILENAME = '.mago-ski-cert.json';
|
|
8
|
+
export const IGNORE_FILENAME = '.skilldigestignore';
|
|
9
|
+
/** Always covered: it holds the instructions and the description hosts show the model. */
|
|
10
|
+
export const SKILL_FILENAME = 'SKILL.md';
|
|
11
|
+
export const MAX_TREE_FILES = 20_000;
|
|
12
|
+
export const MAX_TREE_ENTRIES = 50_000;
|
|
13
|
+
export const MAX_FILE_BYTES = 64 * 1024 * 1024;
|
|
14
|
+
export const MAX_TREE_BYTES = 256 * 1024 * 1024;
|
|
15
|
+
export const MAX_RELATIVE_PATH_BYTES = 4_096;
|
|
16
|
+
const MAX_IGNORE_BYTES = 64 * 1024;
|
|
17
|
+
const MAX_IGNORE_PATTERNS = 256;
|
|
18
|
+
const utf8Decoder = new TextDecoder('utf-8', { fatal: true });
|
|
19
|
+
const noFollow = fsConstants.O_NOFOLLOW ?? 0;
|
|
20
|
+
function fail(message) {
|
|
21
|
+
throw new Error(message);
|
|
22
|
+
}
|
|
23
|
+
function decodeEntryName(name) {
|
|
24
|
+
let decoded;
|
|
25
|
+
try {
|
|
26
|
+
decoded = utf8Decoder.decode(name);
|
|
27
|
+
}
|
|
28
|
+
catch {
|
|
29
|
+
fail('Skill tree contains a path that is not valid UTF-8');
|
|
30
|
+
}
|
|
31
|
+
if (decoded.length === 0 || decoded === '.' || decoded === '..' ||
|
|
32
|
+
decoded.includes('/') || decoded.includes('\\') || decoded.includes(':') ||
|
|
33
|
+
/[. ]$/u.test(decoded) ||
|
|
34
|
+
/^(?:CON|PRN|AUX|NUL|COM[1-9]|LPT[1-9])(?:\..*)?$/iu.test(decoded) ||
|
|
35
|
+
/[\u0000-\u001f\u007f]/u.test(decoded) ||
|
|
36
|
+
decoded.normalize('NFC') !== decoded) {
|
|
37
|
+
fail(`Skill tree contains an unsupported path component: ${JSON.stringify(decoded)}`);
|
|
38
|
+
}
|
|
39
|
+
return decoded;
|
|
40
|
+
}
|
|
41
|
+
function sameFileVersion(left, right) {
|
|
42
|
+
return left.dev === right.dev && left.ino === right.ino && left.size === right.size &&
|
|
43
|
+
left.mtimeNs === right.mtimeNs && left.ctimeNs === right.ctimeNs;
|
|
44
|
+
}
|
|
45
|
+
/** Executable bit of a regular file. Windows has no POSIX mode bits, so it always reports false there. */
|
|
46
|
+
export function isExecutable(mode) {
|
|
47
|
+
if (process.platform === 'win32')
|
|
48
|
+
return false;
|
|
49
|
+
return (BigInt(mode) & 73n) !== 0n;
|
|
50
|
+
}
|
|
51
|
+
async function readStable(absolutePath, label, expected) {
|
|
52
|
+
let handle;
|
|
53
|
+
try {
|
|
54
|
+
handle = await open(absolutePath, fsConstants.O_RDONLY | noFollow);
|
|
55
|
+
const before = await handle.stat({ bigint: true });
|
|
56
|
+
if (!before.isFile() || (expected && !sameFileVersion(expected, before)))
|
|
57
|
+
fail(`Skill file changed while being read: ${label}`);
|
|
58
|
+
if (before.size > BigInt(MAX_FILE_BYTES))
|
|
59
|
+
fail(`Skill file exceeds the ${MAX_FILE_BYTES}-byte limit: ${label}`);
|
|
60
|
+
const chunks = [];
|
|
61
|
+
let total = 0;
|
|
62
|
+
while (true) {
|
|
63
|
+
const chunk = Buffer.allocUnsafe(64 * 1024);
|
|
64
|
+
const { bytesRead } = await handle.read(chunk, 0, chunk.length, null);
|
|
65
|
+
if (bytesRead === 0)
|
|
66
|
+
break;
|
|
67
|
+
total += bytesRead;
|
|
68
|
+
if (total > MAX_FILE_BYTES)
|
|
69
|
+
fail(`Skill file exceeds the ${MAX_FILE_BYTES}-byte limit: ${label}`);
|
|
70
|
+
chunks.push(chunk.subarray(0, bytesRead));
|
|
71
|
+
}
|
|
72
|
+
const after = await handle.stat({ bigint: true });
|
|
73
|
+
if (!sameFileVersion(before, after) || total !== Number(before.size))
|
|
74
|
+
fail(`Skill file changed while being read: ${label}`);
|
|
75
|
+
return { content: Buffer.concat(chunks, total), stat: after };
|
|
76
|
+
}
|
|
77
|
+
catch (error) {
|
|
78
|
+
if (error?.code === 'ELOOP')
|
|
79
|
+
fail(`Skill tree contains a symbolic link: ${label}`);
|
|
80
|
+
throw error;
|
|
81
|
+
}
|
|
82
|
+
finally {
|
|
83
|
+
await handle?.close();
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
export function sha256Hex(bytes) {
|
|
87
|
+
return createHash('sha256').update(bytes).digest('hex');
|
|
88
|
+
}
|
|
89
|
+
/** Hashes one file for read-time checks. Returns the same fields the certificate records. */
|
|
90
|
+
export async function hashFile(absolutePath, relativePath) {
|
|
91
|
+
const entry = await lstat(absolutePath, { bigint: true });
|
|
92
|
+
if (entry.isSymbolicLink() || !entry.isFile())
|
|
93
|
+
fail(`Not a regular file: ${relativePath}`);
|
|
94
|
+
const { content, stat } = await readStable(absolutePath, relativePath, entry);
|
|
95
|
+
return { path: relativePath, size: content.length, sha256: sha256Hex(content), exec: isExecutable(stat.mode) };
|
|
96
|
+
}
|
|
97
|
+
export function parseIgnoreFile(text) {
|
|
98
|
+
const rules = [];
|
|
99
|
+
for (const rawLine of text.split(/\r?\n/u)) {
|
|
100
|
+
const line = rawLine.trim();
|
|
101
|
+
if (line === '' || line.startsWith('#'))
|
|
102
|
+
continue;
|
|
103
|
+
if (rules.length >= MAX_IGNORE_PATTERNS)
|
|
104
|
+
fail(`${IGNORE_FILENAME} exceeds ${MAX_IGNORE_PATTERNS} patterns`);
|
|
105
|
+
const directoryOnly = line.endsWith('/');
|
|
106
|
+
const pattern = directoryOnly ? line.slice(0, -1) : line;
|
|
107
|
+
const segments = pattern.split('/');
|
|
108
|
+
if (pattern === '' || pattern.startsWith('/') || pattern.includes('\\') || /[*?[\]!]/u.test(pattern) ||
|
|
109
|
+
segments.some((segment) => segment === '' || segment === '.' || segment === '..') ||
|
|
110
|
+
pattern === IGNORE_FILENAME || pattern === SKILL_FILENAME || pattern.normalize('NFC') !== pattern) {
|
|
111
|
+
fail(`${IGNORE_FILENAME} contains an unsupported pattern: ${JSON.stringify(line)} (use plain relative paths; globs are not supported)`);
|
|
112
|
+
}
|
|
113
|
+
rules.push({ pattern, directoryOnly });
|
|
114
|
+
}
|
|
115
|
+
return rules;
|
|
116
|
+
}
|
|
117
|
+
function isIgnored(relativePath, isDirectory, rules) {
|
|
118
|
+
for (const rule of rules) {
|
|
119
|
+
if (relativePath === rule.pattern && (isDirectory || !rule.directoryOnly))
|
|
120
|
+
return true;
|
|
121
|
+
if (relativePath.startsWith(`${rule.pattern}/`))
|
|
122
|
+
return true;
|
|
123
|
+
}
|
|
124
|
+
return false;
|
|
125
|
+
}
|
|
126
|
+
async function enumerate(root) {
|
|
127
|
+
const rootStat = await lstat(root, { bigint: true });
|
|
128
|
+
if (!rootStat.isDirectory() || rootStat.isSymbolicLink())
|
|
129
|
+
fail('Skill root must be a real directory, not a symbolic link');
|
|
130
|
+
const canonicalRoot = await realpath(root);
|
|
131
|
+
let rules = [];
|
|
132
|
+
const ignorePath = path.join(canonicalRoot, IGNORE_FILENAME);
|
|
133
|
+
try {
|
|
134
|
+
const entry = await lstat(ignorePath, { bigint: true });
|
|
135
|
+
if (entry.isSymbolicLink() || !entry.isFile())
|
|
136
|
+
fail(`${IGNORE_FILENAME} must be a regular file`);
|
|
137
|
+
if (entry.size > BigInt(MAX_IGNORE_BYTES))
|
|
138
|
+
fail(`${IGNORE_FILENAME} exceeds ${MAX_IGNORE_BYTES} bytes`);
|
|
139
|
+
const { content } = await readStable(ignorePath, IGNORE_FILENAME, entry);
|
|
140
|
+
rules = parseIgnoreFile(utf8Decoder.decode(content));
|
|
141
|
+
}
|
|
142
|
+
catch (error) {
|
|
143
|
+
if (error?.code !== 'ENOENT')
|
|
144
|
+
throw error;
|
|
145
|
+
}
|
|
146
|
+
const records = [];
|
|
147
|
+
const excluded = [];
|
|
148
|
+
const seenCaseFolded = new Set();
|
|
149
|
+
let entryCount = 0;
|
|
150
|
+
async function visit(directory, relativeDirectory, depth) {
|
|
151
|
+
if (depth > 64)
|
|
152
|
+
fail('Skill tree exceeds the maximum directory depth of 64');
|
|
153
|
+
const directoryStat = await lstat(directory, { bigint: true });
|
|
154
|
+
if (!directoryStat.isDirectory() || directoryStat.isSymbolicLink()) {
|
|
155
|
+
fail(`Skill tree contains a changed or symbolic-link directory: ${relativeDirectory || '.'}`);
|
|
156
|
+
}
|
|
157
|
+
const expected = relativeDirectory ? path.join(canonicalRoot, relativeDirectory) : canonicalRoot;
|
|
158
|
+
if (await realpath(directory) !== expected)
|
|
159
|
+
fail(`Skill tree directory path changed during traversal: ${relativeDirectory || '.'}`);
|
|
160
|
+
const dir = await opendir(expected, { encoding: 'buffer', bufferSize: 32 });
|
|
161
|
+
for await (const dirent of dir) {
|
|
162
|
+
entryCount += 1;
|
|
163
|
+
if (entryCount > MAX_TREE_ENTRIES)
|
|
164
|
+
fail(`Skill tree exceeds the ${MAX_TREE_ENTRIES}-entry limit`);
|
|
165
|
+
const name = decodeEntryName(dirent.name);
|
|
166
|
+
const relativePath = relativeDirectory ? `${relativeDirectory}/${name}` : name;
|
|
167
|
+
const pathBytes = Buffer.from(relativePath, 'utf8');
|
|
168
|
+
if (pathBytes.length > MAX_RELATIVE_PATH_BYTES)
|
|
169
|
+
fail(`Skill path exceeds the ${MAX_RELATIVE_PATH_BYTES}-byte limit`);
|
|
170
|
+
const caseKey = relativePath.normalize('NFKC').toLowerCase();
|
|
171
|
+
if (seenCaseFolded.has(caseKey))
|
|
172
|
+
fail(`Skill tree contains a case-insensitive path collision: ${relativePath}`);
|
|
173
|
+
seenCaseFolded.add(caseKey);
|
|
174
|
+
const absolutePath = path.join(expected, name);
|
|
175
|
+
const stat = await lstat(absolutePath, { bigint: true });
|
|
176
|
+
if (stat.isSymbolicLink())
|
|
177
|
+
fail(`Skill tree contains a symbolic link: ${relativePath}`);
|
|
178
|
+
const isDirectory = stat.isDirectory();
|
|
179
|
+
if (!relativeDirectory && (name === '.git' || (name === CERTIFICATE_FILENAME && !isDirectory))) {
|
|
180
|
+
excluded.push(isDirectory ? `${relativePath}/` : relativePath);
|
|
181
|
+
continue;
|
|
182
|
+
}
|
|
183
|
+
if (isIgnored(relativePath, isDirectory, rules)) {
|
|
184
|
+
excluded.push(isDirectory ? `${relativePath}/` : relativePath);
|
|
185
|
+
continue;
|
|
186
|
+
}
|
|
187
|
+
if (isDirectory) {
|
|
188
|
+
await visit(absolutePath, relativePath, depth + 1);
|
|
189
|
+
}
|
|
190
|
+
else if (stat.isFile()) {
|
|
191
|
+
if (records.length >= MAX_TREE_FILES)
|
|
192
|
+
fail(`Skill tree exceeds the ${MAX_TREE_FILES}-file limit`);
|
|
193
|
+
if (stat.size > BigInt(MAX_FILE_BYTES))
|
|
194
|
+
fail(`Skill file exceeds the ${MAX_FILE_BYTES}-byte limit: ${relativePath}`);
|
|
195
|
+
records.push({ path: relativePath, pathBytes, absolutePath, stat });
|
|
196
|
+
}
|
|
197
|
+
else {
|
|
198
|
+
fail(`Skill tree contains an unsupported special file: ${relativePath}`);
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
}
|
|
202
|
+
await visit(canonicalRoot, '', 0);
|
|
203
|
+
records.sort((left, right) => Buffer.compare(left.pathBytes, right.pathBytes));
|
|
204
|
+
excluded.sort();
|
|
205
|
+
return { root: canonicalRoot, records, excluded };
|
|
206
|
+
}
|
|
207
|
+
export function compareTreePaths(left, right) {
|
|
208
|
+
return Buffer.compare(Buffer.from(left, 'utf8'), Buffer.from(right, 'utf8'));
|
|
209
|
+
}
|
|
210
|
+
/** The tree digest is SHA-256 over the canonical JSON of the profile and the sorted per-file list. */
|
|
211
|
+
export function digestFileList(files) {
|
|
212
|
+
for (let index = 1; index < files.length; index += 1) {
|
|
213
|
+
if (compareTreePaths(files[index - 1].path, files[index].path) >= 0)
|
|
214
|
+
fail('File list must be sorted by UTF-8 path bytes without duplicates');
|
|
215
|
+
}
|
|
216
|
+
const body = canonicalBytes({
|
|
217
|
+
profile: TREE_PROFILE,
|
|
218
|
+
files: files.map((file) => ({ path: file.path, size: file.size, sha256: file.sha256, exec: file.exec })),
|
|
219
|
+
});
|
|
220
|
+
return `sha256:${sha256Hex(body)}`;
|
|
221
|
+
}
|
|
222
|
+
export async function collectSkillTree(rootPath, { includeContents = false } = {}) {
|
|
223
|
+
const { root, records, excluded } = await enumerate(path.resolve(rootPath));
|
|
224
|
+
const files = [];
|
|
225
|
+
const contents = includeContents ? new Map() : undefined;
|
|
226
|
+
let totalBytes = 0;
|
|
227
|
+
for (const record of records) {
|
|
228
|
+
const { content, stat } = await readStable(record.absolutePath, record.path, record.stat);
|
|
229
|
+
totalBytes += content.length;
|
|
230
|
+
if (totalBytes > MAX_TREE_BYTES)
|
|
231
|
+
fail(`Skill tree exceeds the ${MAX_TREE_BYTES}-byte total limit`);
|
|
232
|
+
files.push({ path: record.path, size: content.length, sha256: sha256Hex(content), exec: isExecutable(stat.mode) });
|
|
233
|
+
contents?.set(record.path, content);
|
|
234
|
+
}
|
|
235
|
+
if (!files.some((file) => file.path === SKILL_FILENAME))
|
|
236
|
+
fail(`Skill tree must contain ${SKILL_FILENAME} at its root`);
|
|
237
|
+
const tree = {
|
|
238
|
+
profile: TREE_PROFILE, digest: digestFileList(files), root, files, totalBytes, excluded,
|
|
239
|
+
};
|
|
240
|
+
if (contents)
|
|
241
|
+
tree.contents = contents;
|
|
242
|
+
return tree;
|
|
243
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import type { KeyObject } from 'node:crypto';
|
|
2
|
+
import { type PublicKeyInfo } from './keys.ts';
|
|
3
|
+
export declare const TRUST_ROOT_PAYLOAD_TYPE = "application/vnd.mago-ski.trust-root+json";
|
|
4
|
+
export declare const TRUST_ROOT_TYPE = "mago.trust-root/v1";
|
|
5
|
+
export declare const MAX_APPROVERS = 256;
|
|
6
|
+
export declare const MAX_SCOPES = 64;
|
|
7
|
+
export interface Approver extends PublicKeyInfo {
|
|
8
|
+
name: string;
|
|
9
|
+
scopes: string[];
|
|
10
|
+
expiresAt: Date;
|
|
11
|
+
}
|
|
12
|
+
export interface TrustRoot {
|
|
13
|
+
version: number;
|
|
14
|
+
issuedAt: Date;
|
|
15
|
+
expiresAt: Date;
|
|
16
|
+
root: PublicKeyInfo;
|
|
17
|
+
approvers: Approver[];
|
|
18
|
+
}
|
|
19
|
+
/** Failure of a signed policy document; `code` maps to a verdict. */
|
|
20
|
+
export declare class TrustDocumentError extends Error {
|
|
21
|
+
readonly code: 'UNVERIFIABLE' | 'EXPIRED';
|
|
22
|
+
constructor(code: 'UNVERIFIABLE' | 'EXPIRED', message: string);
|
|
23
|
+
}
|
|
24
|
+
export declare function trustRootPayload(trustRoot: TrustRoot): Record<string, unknown>;
|
|
25
|
+
export declare function signTrustRoot(trustRoot: TrustRoot, rootPrivateKey: KeyObject): Buffer;
|
|
26
|
+
export declare function parseTrustRootPayload(bytes: Uint8Array): TrustRoot;
|
|
27
|
+
/**
|
|
28
|
+
* Verifies a signed trust root against the pinned root key fingerprint and the current time.
|
|
29
|
+
* Rollback (an older version than already seen) is checked separately against host state.
|
|
30
|
+
*/
|
|
31
|
+
export declare function verifyTrustRoot(bytes: Uint8Array, pinnedRootKeyId: string, now: Date): TrustRoot;
|
|
32
|
+
/** Parses a trust root signed by `rootKeyId` without the expiry check, for editing. */
|
|
33
|
+
export declare function readTrustRootForUpdate(bytes: Uint8Array, rootKeyId: string): TrustRoot;
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
import { canonicalBytes, exactKeys, parseCanonicalJsonBytes, requireArray, requirePositiveInteger, requireString } from "./canonical-json.js";
|
|
2
|
+
import { envelopeBytes, parseEnvelope, signEnvelope, verifyEnvelopeSignature } from "./dsse.js";
|
|
3
|
+
import { parseSpki, validateKeyId } from "./keys.js";
|
|
4
|
+
import { validateScope } from "./names.js";
|
|
5
|
+
import { formatTimestamp, parseTimestamp } from "./time.js";
|
|
6
|
+
export const TRUST_ROOT_PAYLOAD_TYPE = 'application/vnd.mago-ski.trust-root+json';
|
|
7
|
+
export const TRUST_ROOT_TYPE = 'mago.trust-root/v1';
|
|
8
|
+
export const MAX_APPROVERS = 256;
|
|
9
|
+
export const MAX_SCOPES = 64;
|
|
10
|
+
/** Failure of a signed policy document; `code` maps to a verdict. */
|
|
11
|
+
export class TrustDocumentError extends Error {
|
|
12
|
+
code;
|
|
13
|
+
constructor(code, message) {
|
|
14
|
+
super(message);
|
|
15
|
+
this.code = code;
|
|
16
|
+
this.name = 'TrustDocumentError';
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
export function trustRootPayload(trustRoot) {
|
|
20
|
+
return {
|
|
21
|
+
type: TRUST_ROOT_TYPE,
|
|
22
|
+
version: trustRoot.version,
|
|
23
|
+
issued_at: formatTimestamp(trustRoot.issuedAt),
|
|
24
|
+
expires_at: formatTimestamp(trustRoot.expiresAt),
|
|
25
|
+
root: { key_id: trustRoot.root.keyId, public_key: trustRoot.root.spki },
|
|
26
|
+
approvers: [...trustRoot.approvers]
|
|
27
|
+
.sort((left, right) => (left.keyId < right.keyId ? -1 : 1))
|
|
28
|
+
.map((approver) => ({
|
|
29
|
+
key_id: approver.keyId,
|
|
30
|
+
public_key: approver.spki,
|
|
31
|
+
name: approver.name,
|
|
32
|
+
scopes: [...approver.scopes].sort(),
|
|
33
|
+
expires_at: formatTimestamp(approver.expiresAt),
|
|
34
|
+
})),
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
export function signTrustRoot(trustRoot, rootPrivateKey) {
|
|
38
|
+
const payload = canonicalBytes(trustRootPayload(trustRoot));
|
|
39
|
+
return envelopeBytes(signEnvelope(TRUST_ROOT_PAYLOAD_TYPE, payload, trustRoot.root.keyId, rootPrivateKey));
|
|
40
|
+
}
|
|
41
|
+
export function parseTrustRootPayload(bytes) {
|
|
42
|
+
const label = 'trust-root payload';
|
|
43
|
+
const value = exactKeys(parseCanonicalJsonBytes(bytes, label), ['type', 'version', 'issued_at', 'expires_at', 'root', 'approvers'], label);
|
|
44
|
+
if (value.type !== TRUST_ROOT_TYPE)
|
|
45
|
+
throw new Error(`${label} has unsupported type`);
|
|
46
|
+
const rootValue = exactKeys(value.root, ['key_id', 'public_key'], `${label} root`);
|
|
47
|
+
const root = parseSpki(rootValue.public_key, `${label} root public_key`, validateKeyId(rootValue.key_id, `${label} root key_id`));
|
|
48
|
+
const approvers = [];
|
|
49
|
+
let previous = '';
|
|
50
|
+
for (const [index, item] of requireArray(value.approvers, `${label} approvers`, MAX_APPROVERS).entries()) {
|
|
51
|
+
const itemLabel = `${label} approvers[${index}]`;
|
|
52
|
+
const entry = exactKeys(item, ['key_id', 'public_key', 'name', 'scopes', 'expires_at'], itemLabel);
|
|
53
|
+
const keyId = validateKeyId(entry.key_id, `${itemLabel} key_id`);
|
|
54
|
+
if (keyId <= previous)
|
|
55
|
+
throw new Error(`${label} approvers must be unique and sorted by key_id`);
|
|
56
|
+
previous = keyId;
|
|
57
|
+
if (keyId === root.keyId)
|
|
58
|
+
throw new Error(`${label}: the root key must not also be an approver`);
|
|
59
|
+
const scopes = requireArray(entry.scopes, `${itemLabel} scopes`, MAX_SCOPES).map((scope, scopeIndex) => validateScope(scope, `${itemLabel} scopes[${scopeIndex}]`));
|
|
60
|
+
if (scopes.length === 0)
|
|
61
|
+
throw new Error(`${itemLabel} needs at least one scope`);
|
|
62
|
+
for (let scopeIndex = 1; scopeIndex < scopes.length; scopeIndex += 1) {
|
|
63
|
+
if (scopes[scopeIndex - 1] >= scopes[scopeIndex])
|
|
64
|
+
throw new Error(`${itemLabel} scopes must be unique and sorted`);
|
|
65
|
+
}
|
|
66
|
+
approvers.push({
|
|
67
|
+
...parseSpki(entry.public_key, `${itemLabel} public_key`, keyId),
|
|
68
|
+
name: requireString(entry.name, `${itemLabel} name`, 128),
|
|
69
|
+
scopes,
|
|
70
|
+
expiresAt: parseTimestamp(entry.expires_at, `${itemLabel} expires_at`),
|
|
71
|
+
});
|
|
72
|
+
}
|
|
73
|
+
const issuedAt = parseTimestamp(value.issued_at, `${label} issued_at`);
|
|
74
|
+
const expiresAt = parseTimestamp(value.expires_at, `${label} expires_at`);
|
|
75
|
+
if (expiresAt <= issuedAt)
|
|
76
|
+
throw new Error(`${label} expires before it is issued`);
|
|
77
|
+
return { version: requirePositiveInteger(value.version, `${label} version`), issuedAt, expiresAt, root, approvers };
|
|
78
|
+
}
|
|
79
|
+
/**
|
|
80
|
+
* Verifies a signed trust root against the pinned root key fingerprint and the current time.
|
|
81
|
+
* Rollback (an older version than already seen) is checked separately against host state.
|
|
82
|
+
*/
|
|
83
|
+
export function verifyTrustRoot(bytes, pinnedRootKeyId, now) {
|
|
84
|
+
let trustRoot;
|
|
85
|
+
try {
|
|
86
|
+
const envelope = parseEnvelope(bytes, 'trust root');
|
|
87
|
+
if (envelope.payloadType !== TRUST_ROOT_PAYLOAD_TYPE)
|
|
88
|
+
throw new Error('trust root has the wrong payload type');
|
|
89
|
+
if (envelope.signatures[0].keyid !== pinnedRootKeyId)
|
|
90
|
+
throw new Error('trust root is not signed by the pinned root key');
|
|
91
|
+
trustRoot = parseTrustRootPayload(envelope.payloadBytes);
|
|
92
|
+
if (trustRoot.root.keyId !== pinnedRootKeyId)
|
|
93
|
+
throw new Error('trust root names a different root key than the pinned fingerprint');
|
|
94
|
+
if (!verifyEnvelopeSignature(envelope, trustRoot.root.publicKey))
|
|
95
|
+
throw new Error('trust root signature is invalid');
|
|
96
|
+
}
|
|
97
|
+
catch (error) {
|
|
98
|
+
throw new TrustDocumentError('UNVERIFIABLE', error.message);
|
|
99
|
+
}
|
|
100
|
+
if (trustRoot.expiresAt <= now)
|
|
101
|
+
throw new TrustDocumentError('EXPIRED', `trust root expired at ${formatTimestamp(trustRoot.expiresAt)}`);
|
|
102
|
+
return trustRoot;
|
|
103
|
+
}
|
|
104
|
+
/** Parses a trust root signed by `rootKeyId` without the expiry check, for editing. */
|
|
105
|
+
export function readTrustRootForUpdate(bytes, rootKeyId) {
|
|
106
|
+
const envelope = parseEnvelope(bytes, 'trust root');
|
|
107
|
+
if (envelope.payloadType !== TRUST_ROOT_PAYLOAD_TYPE)
|
|
108
|
+
throw new Error('trust root has the wrong payload type');
|
|
109
|
+
const trustRoot = parseTrustRootPayload(envelope.payloadBytes);
|
|
110
|
+
if (trustRoot.root.keyId !== rootKeyId || envelope.signatures[0].keyid !== rootKeyId)
|
|
111
|
+
throw new Error('trust root belongs to a different root key');
|
|
112
|
+
if (!verifyEnvelopeSignature(envelope, trustRoot.root.publicKey))
|
|
113
|
+
throw new Error('trust root signature is invalid');
|
|
114
|
+
return trustRoot;
|
|
115
|
+
}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import { type Certificate } from './certificate.ts';
|
|
2
|
+
import { type Revocations } from './revocations.ts';
|
|
3
|
+
import { type SkillTree, type TreeFile } from './tree-digest.ts';
|
|
4
|
+
import { type TrustRoot } from './trust-root.ts';
|
|
5
|
+
export declare const VERDICTS: readonly ["VERIFIED", "UNAPPROVED_CHANGE", "NO_CERTIFICATE", "UNTRUSTED_SIGNER", "REVOKED", "EXPIRED", "UNVERIFIABLE"];
|
|
6
|
+
export type Verdict = (typeof VERDICTS)[number];
|
|
7
|
+
export interface TrustContext {
|
|
8
|
+
trustRoot: TrustRoot;
|
|
9
|
+
revocations: Revocations;
|
|
10
|
+
}
|
|
11
|
+
export interface MinimumVersions {
|
|
12
|
+
trustRootVersion: number;
|
|
13
|
+
revocationsVersion: number;
|
|
14
|
+
}
|
|
15
|
+
export type TrustContextResult = {
|
|
16
|
+
ok: true;
|
|
17
|
+
context: TrustContext;
|
|
18
|
+
} | {
|
|
19
|
+
ok: false;
|
|
20
|
+
verdict: 'EXPIRED' | 'UNVERIFIABLE';
|
|
21
|
+
reason: string;
|
|
22
|
+
};
|
|
23
|
+
/** Verifies the trust root and revocation list once; every Skill check reuses the result. */
|
|
24
|
+
export declare function loadTrustContext(options: {
|
|
25
|
+
trustRootBytes: Uint8Array;
|
|
26
|
+
revocationsBytes: Uint8Array;
|
|
27
|
+
rootKeyId: string;
|
|
28
|
+
now: Date;
|
|
29
|
+
minimum?: MinimumVersions | undefined;
|
|
30
|
+
}): TrustContextResult;
|
|
31
|
+
export interface CertificateEvaluation {
|
|
32
|
+
verdict: Verdict;
|
|
33
|
+
reason: string;
|
|
34
|
+
certificate?: Certificate;
|
|
35
|
+
}
|
|
36
|
+
/** Checks one certificate for one Skill: trust chain, scope, signature, expiry, revocation, then bytes. */
|
|
37
|
+
export declare function evaluateCertificate(bytes: Uint8Array, skillName: string, digest: string, context: TrustContext, now: Date): CertificateEvaluation;
|
|
38
|
+
export interface CertificateSource {
|
|
39
|
+
source: string;
|
|
40
|
+
bytes: Uint8Array;
|
|
41
|
+
}
|
|
42
|
+
export interface VerificationResult {
|
|
43
|
+
verdict: Verdict;
|
|
44
|
+
reason: string;
|
|
45
|
+
skillName: string;
|
|
46
|
+
skillDir: string;
|
|
47
|
+
digest: string | null;
|
|
48
|
+
/** Per-file hashes of the approved version; present only when VERIFIED. */
|
|
49
|
+
files: TreeFile[] | null;
|
|
50
|
+
certificateId: string | null;
|
|
51
|
+
certificateSource: string | null;
|
|
52
|
+
approverKeyId: string | null;
|
|
53
|
+
excluded: string[];
|
|
54
|
+
checkedAt: string;
|
|
55
|
+
}
|
|
56
|
+
export declare function resolveSkillName(skillDir: string, explicit?: string): Promise<string>;
|
|
57
|
+
export declare function decide(options: {
|
|
58
|
+
skillDir: string;
|
|
59
|
+
skillName: string;
|
|
60
|
+
tree: SkillTree;
|
|
61
|
+
certificates: CertificateSource[];
|
|
62
|
+
context: TrustContext;
|
|
63
|
+
now: Date;
|
|
64
|
+
}): VerificationResult;
|
|
65
|
+
/** Full check of one Skill directory against an already-verified trust context. */
|
|
66
|
+
export declare function verifySkill(options: {
|
|
67
|
+
skillDir: string;
|
|
68
|
+
skillName?: string | undefined;
|
|
69
|
+
certificates: CertificateSource[] | ((skillName: string, root: string) => Promise<CertificateSource[]>);
|
|
70
|
+
context: TrustContext;
|
|
71
|
+
now: Date;
|
|
72
|
+
}): Promise<VerificationResult>;
|
|
73
|
+
export declare function unverifiable(skillDir: string, skillName: string, reason: string, now: Date, verdict?: Verdict): VerificationResult;
|
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
import { readFile } from 'node:fs/promises';
|
|
2
|
+
import path from 'node:path';
|
|
3
|
+
import { parseCertificate } from "./certificate.js";
|
|
4
|
+
import { verifyEnvelopeSignature } from "./dsse.js";
|
|
5
|
+
import { scopeMatches, skillNameFromFrontmatter, validateSkillName } from "./names.js";
|
|
6
|
+
import { verifyRevocations } from "./revocations.js";
|
|
7
|
+
import { CLOCK_SKEW_MS, formatTimestamp } from "./time.js";
|
|
8
|
+
import { collectSkillTree } from "./tree-digest.js";
|
|
9
|
+
import { TrustDocumentError, verifyTrustRoot } from "./trust-root.js";
|
|
10
|
+
export const VERDICTS = ['VERIFIED', 'UNAPPROVED_CHANGE', 'NO_CERTIFICATE', 'UNTRUSTED_SIGNER', 'REVOKED', 'EXPIRED', 'UNVERIFIABLE'];
|
|
11
|
+
/** When no certificate verifies, the most informative failure is reported. */
|
|
12
|
+
const FAILURE_PRIORITY = ['REVOKED', 'UNAPPROVED_CHANGE', 'EXPIRED', 'UNTRUSTED_SIGNER', 'UNVERIFIABLE', 'NO_CERTIFICATE'];
|
|
13
|
+
/** Verifies the trust root and revocation list once; every Skill check reuses the result. */
|
|
14
|
+
export function loadTrustContext(options) {
|
|
15
|
+
try {
|
|
16
|
+
const trustRoot = verifyTrustRoot(options.trustRootBytes, options.rootKeyId, options.now);
|
|
17
|
+
const revocations = verifyRevocations(options.revocationsBytes, trustRoot, options.now);
|
|
18
|
+
if (options.minimum && trustRoot.version < options.minimum.trustRootVersion) {
|
|
19
|
+
return { ok: false, verdict: 'UNVERIFIABLE', reason: `trust root version ${trustRoot.version} is older than version ${options.minimum.trustRootVersion} already seen (rollback)` };
|
|
20
|
+
}
|
|
21
|
+
if (options.minimum && revocations.version < options.minimum.revocationsVersion) {
|
|
22
|
+
return { ok: false, verdict: 'UNVERIFIABLE', reason: `revocation list version ${revocations.version} is older than version ${options.minimum.revocationsVersion} already seen (rollback)` };
|
|
23
|
+
}
|
|
24
|
+
return { ok: true, context: { trustRoot, revocations } };
|
|
25
|
+
}
|
|
26
|
+
catch (error) {
|
|
27
|
+
if (error instanceof TrustDocumentError)
|
|
28
|
+
return { ok: false, verdict: error.code, reason: error.message };
|
|
29
|
+
return { ok: false, verdict: 'UNVERIFIABLE', reason: error.message };
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
/** Checks one certificate for one Skill: trust chain, scope, signature, expiry, revocation, then bytes. */
|
|
33
|
+
export function evaluateCertificate(bytes, skillName, digest, context, now) {
|
|
34
|
+
let certificate;
|
|
35
|
+
try {
|
|
36
|
+
certificate = parseCertificate(bytes);
|
|
37
|
+
}
|
|
38
|
+
catch (error) {
|
|
39
|
+
return { verdict: 'UNVERIFIABLE', reason: `malformed certificate: ${error.message}` };
|
|
40
|
+
}
|
|
41
|
+
if (certificate.skillName !== skillName) {
|
|
42
|
+
return { verdict: 'NO_CERTIFICATE', reason: `certificate is for Skill "${certificate.skillName}", not "${skillName}"`, certificate };
|
|
43
|
+
}
|
|
44
|
+
const { trustRoot, revocations } = context;
|
|
45
|
+
const revokedKey = revocations.keys.find((entry) => entry.keyId === certificate.approverKeyId);
|
|
46
|
+
if (revokedKey)
|
|
47
|
+
return { verdict: 'REVOKED', reason: `approver key ${certificate.approverKeyId} is revoked: ${revokedKey.reason}`, certificate };
|
|
48
|
+
const approver = trustRoot.approvers.find((entry) => entry.keyId === certificate.approverKeyId);
|
|
49
|
+
if (!approver)
|
|
50
|
+
return { verdict: 'UNTRUSTED_SIGNER', reason: `signer ${certificate.approverKeyId} is not an approver in trust root v${trustRoot.version}`, certificate };
|
|
51
|
+
if (!approver.scopes.some((scope) => scopeMatches(scope, skillName))) {
|
|
52
|
+
return { verdict: 'UNTRUSTED_SIGNER', reason: `approver "${approver.name}" is not authorized for Skill "${skillName}" (scopes: ${approver.scopes.join(', ')})`, certificate };
|
|
53
|
+
}
|
|
54
|
+
if (!verifyEnvelopeSignature(certificate.envelope, approver.publicKey)) {
|
|
55
|
+
return { verdict: 'UNVERIFIABLE', reason: 'certificate signature is invalid', certificate };
|
|
56
|
+
}
|
|
57
|
+
if (certificate.issuedAt.getTime() > now.getTime() + CLOCK_SKEW_MS) {
|
|
58
|
+
return { verdict: 'UNVERIFIABLE', reason: `certificate is issued in the future (${formatTimestamp(certificate.issuedAt)})`, certificate };
|
|
59
|
+
}
|
|
60
|
+
if (certificate.issuedAt >= approver.expiresAt) {
|
|
61
|
+
return { verdict: 'UNTRUSTED_SIGNER', reason: `certificate was issued after approver "${approver.name}" expired`, certificate };
|
|
62
|
+
}
|
|
63
|
+
if (approver.expiresAt <= now)
|
|
64
|
+
return { verdict: 'EXPIRED', reason: `approver "${approver.name}" expired at ${formatTimestamp(approver.expiresAt)}`, certificate };
|
|
65
|
+
if (certificate.expiresAt <= now)
|
|
66
|
+
return { verdict: 'EXPIRED', reason: `certificate expired at ${formatTimestamp(certificate.expiresAt)}`, certificate };
|
|
67
|
+
const revokedDigest = revocations.digests.find((entry) => entry.digest === certificate.digest);
|
|
68
|
+
if (revokedDigest)
|
|
69
|
+
return { verdict: 'REVOKED', reason: `approved version ${certificate.digest} is revoked: ${revokedDigest.reason}`, certificate };
|
|
70
|
+
if (certificate.digest !== digest) {
|
|
71
|
+
return { verdict: 'UNAPPROVED_CHANGE', reason: `Skill bytes changed since approval (approved ${certificate.digest}, found ${digest}); a new certificate is required`, certificate };
|
|
72
|
+
}
|
|
73
|
+
return { verdict: 'VERIFIED', reason: `approved by "${approver.name}" until ${formatTimestamp(certificate.expiresAt)}`, certificate };
|
|
74
|
+
}
|
|
75
|
+
export async function resolveSkillName(skillDir, explicit) {
|
|
76
|
+
if (explicit)
|
|
77
|
+
return validateSkillName(explicit);
|
|
78
|
+
let text;
|
|
79
|
+
try {
|
|
80
|
+
text = await readFile(path.join(skillDir, 'SKILL.md'), 'utf8');
|
|
81
|
+
}
|
|
82
|
+
catch (error) {
|
|
83
|
+
if (error?.code !== 'ENOENT')
|
|
84
|
+
throw error;
|
|
85
|
+
}
|
|
86
|
+
const fromFrontmatter = text === undefined ? undefined : skillNameFromFrontmatter(text);
|
|
87
|
+
if (fromFrontmatter)
|
|
88
|
+
return validateSkillName(fromFrontmatter, 'SKILL.md name');
|
|
89
|
+
return validateSkillName(path.basename(path.resolve(skillDir)), 'Skill directory name');
|
|
90
|
+
}
|
|
91
|
+
export function decide(options) {
|
|
92
|
+
const base = {
|
|
93
|
+
skillName: options.skillName, skillDir: options.tree.root, digest: options.tree.digest,
|
|
94
|
+
excluded: options.tree.excluded, checkedAt: formatTimestamp(options.now),
|
|
95
|
+
};
|
|
96
|
+
if (options.certificates.length === 0) {
|
|
97
|
+
return { ...base, verdict: 'NO_CERTIFICATE', reason: 'no certificate found for this Skill', files: null, certificateId: null, certificateSource: null, approverKeyId: null };
|
|
98
|
+
}
|
|
99
|
+
const evaluations = options.certificates.map((source) => ({
|
|
100
|
+
source, evaluation: evaluateCertificate(source.bytes, options.skillName, options.tree.digest, options.context, options.now),
|
|
101
|
+
}));
|
|
102
|
+
const verified = evaluations.find((entry) => entry.evaluation.verdict === 'VERIFIED');
|
|
103
|
+
const chosen = verified ?? evaluations.sort((a, b) => FAILURE_PRIORITY.indexOf(a.evaluation.verdict) - FAILURE_PRIORITY.indexOf(b.evaluation.verdict))[0];
|
|
104
|
+
const certificate = chosen.evaluation.certificate;
|
|
105
|
+
return {
|
|
106
|
+
...base,
|
|
107
|
+
verdict: chosen.evaluation.verdict,
|
|
108
|
+
reason: chosen.evaluation.reason,
|
|
109
|
+
files: chosen.evaluation.verdict === 'VERIFIED' ? certificate.files : null,
|
|
110
|
+
certificateId: certificate?.id ?? null,
|
|
111
|
+
certificateSource: chosen.source.source,
|
|
112
|
+
approverKeyId: certificate?.approverKeyId ?? null,
|
|
113
|
+
};
|
|
114
|
+
}
|
|
115
|
+
/** Full check of one Skill directory against an already-verified trust context. */
|
|
116
|
+
export async function verifySkill(options) {
|
|
117
|
+
const skillDir = path.resolve(options.skillDir);
|
|
118
|
+
let skillName = options.skillName ?? path.basename(skillDir);
|
|
119
|
+
try {
|
|
120
|
+
skillName = await resolveSkillName(skillDir, options.skillName);
|
|
121
|
+
const tree = await collectSkillTree(skillDir);
|
|
122
|
+
const certificates = typeof options.certificates === 'function' ? await options.certificates(skillName, tree.root) : options.certificates;
|
|
123
|
+
return decide({ skillDir, skillName, tree, certificates, context: options.context, now: options.now });
|
|
124
|
+
}
|
|
125
|
+
catch (error) {
|
|
126
|
+
return unverifiable(skillDir, skillName, error.message, options.now);
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
export function unverifiable(skillDir, skillName, reason, now, verdict = 'UNVERIFIABLE') {
|
|
130
|
+
return {
|
|
131
|
+
verdict, reason, skillName, skillDir, digest: null, files: null, certificateId: null,
|
|
132
|
+
certificateSource: null, approverKeyId: null, excluded: [], checkedAt: formatTimestamp(now),
|
|
133
|
+
};
|
|
134
|
+
}
|