@veilio-inc/cli 0.9.2 → 0.11.1
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 +101 -23
- package/dist/args.d.ts +8 -0
- package/dist/args.d.ts.map +1 -1
- package/dist/args.js +14 -0
- package/dist/args.js.map +1 -1
- package/dist/client/blocks.d.ts.map +1 -1
- package/dist/client/blocks.js +2 -1
- package/dist/client/blocks.js.map +1 -1
- package/dist/client/fingerprint.d.ts +7 -0
- package/dist/client/fingerprint.d.ts.map +1 -0
- package/dist/client/fingerprint.js +25 -0
- package/dist/client/fingerprint.js.map +1 -0
- package/dist/client/maps.d.ts.map +1 -1
- package/dist/client/maps.js +32 -8
- package/dist/client/maps.js.map +1 -1
- package/dist/client/team-key-bootstrap.d.ts +4 -0
- package/dist/client/team-key-bootstrap.d.ts.map +1 -1
- package/dist/client/team-key-bootstrap.js +13 -1
- package/dist/client/team-key-bootstrap.js.map +1 -1
- package/dist/client/wording.d.ts +3 -1
- package/dist/client/wording.d.ts.map +1 -1
- package/dist/client/wording.js +23 -2
- package/dist/client/wording.js.map +1 -1
- package/dist/client/wrap-judge.d.ts +30 -0
- package/dist/client/wrap-judge.d.ts.map +1 -0
- package/dist/client/wrap-judge.js +59 -0
- package/dist/client/wrap-judge.js.map +1 -0
- package/dist/cloud-commands.d.ts +21 -1
- package/dist/cloud-commands.d.ts.map +1 -1
- package/dist/cloud-commands.js +344 -5
- package/dist/cloud-commands.js.map +1 -1
- package/dist/cloud.d.ts +8 -2
- package/dist/cloud.d.ts.map +1 -1
- package/dist/cloud.js +9 -2
- package/dist/cloud.js.map +1 -1
- package/dist/commands.d.ts +3 -0
- package/dist/commands.d.ts.map +1 -1
- package/dist/commands.js +35 -10
- package/dist/commands.js.map +1 -1
- package/dist/flags.d.ts +14 -0
- package/dist/flags.d.ts.map +1 -1
- package/dist/flags.js +40 -0
- package/dist/flags.js.map +1 -1
- package/dist/git-index.d.ts +8 -0
- package/dist/git-index.d.ts.map +1 -0
- package/dist/git-index.js +161 -0
- package/dist/git-index.js.map +1 -0
- package/dist/hashed-bases.d.ts +6 -1
- package/dist/hashed-bases.d.ts.map +1 -1
- package/dist/hashed-bases.js +16 -3
- package/dist/hashed-bases.js.map +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +29 -19
- package/dist/index.js.map +1 -1
- package/dist/key-pins.d.ts +46 -0
- package/dist/key-pins.d.ts.map +1 -0
- package/dist/key-pins.js +165 -0
- package/dist/key-pins.js.map +1 -0
- package/dist/reservations.d.ts +6 -4
- package/dist/reservations.d.ts.map +1 -1
- package/dist/reservations.js +19 -21
- package/dist/reservations.js.map +1 -1
- package/dist/staged-blobs.d.ts +21 -0
- package/dist/staged-blobs.d.ts.map +1 -0
- package/dist/staged-blobs.js +150 -0
- package/dist/staged-blobs.js.map +1 -0
- package/dist/store.d.ts +39 -0
- package/dist/store.d.ts.map +1 -1
- package/dist/store.js +243 -24
- package/dist/store.js.map +1 -1
- package/dist/team-unlock.d.ts +36 -0
- package/dist/team-unlock.d.ts.map +1 -1
- package/dist/team-unlock.js +25 -1
- package/dist/team-unlock.js.map +1 -1
- package/package.json +2 -2
package/dist/store.js
CHANGED
|
@@ -8,9 +8,11 @@
|
|
|
8
8
|
// The map holds real identifier names, so it is written 0600 and the store
|
|
9
9
|
// directory carries a .gitignore. Committing it would undo the anonymization
|
|
10
10
|
// for anyone reading the repo.
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
11
|
+
import { closeSync, existsSync, lstatSync, mkdirSync, openSync, readFileSync, realpathSync, renameSync, rmSync, writeFileSync, writeSync, } from 'node:fs';
|
|
12
|
+
import { randomBytes } from 'node:crypto';
|
|
13
|
+
import { basename, delimiter, dirname, isAbsolute, join, relative, resolve, sep } from 'node:path';
|
|
13
14
|
import { STORE_DIR } from '@veilio-inc/engine';
|
|
15
|
+
import { trackedPaths } from './git-index.js';
|
|
14
16
|
export { STORE_DIR };
|
|
15
17
|
export const STORE_FILE = 'map.json';
|
|
16
18
|
/** Walk up from `from` looking for an existing store or a repo root, so running
|
|
@@ -19,7 +21,11 @@ export const STORE_FILE = 'map.json';
|
|
|
19
21
|
export function findProjectRoot(from) {
|
|
20
22
|
let dir = resolve(from);
|
|
21
23
|
for (;;) {
|
|
22
|
-
|
|
24
|
+
// Another user's .veilio is not this project's store (spec 085 L2): on a
|
|
25
|
+
// shared machine anyone can make /tmp/.veilio.
|
|
26
|
+
const store = join(dir, STORE_DIR);
|
|
27
|
+
if ((existsSync(store) && (ownerOf(store) !== 'other' || trustedStore(store))) ||
|
|
28
|
+
existsSync(join(dir, '.git')))
|
|
23
29
|
return dir;
|
|
24
30
|
const parent = dirname(dir);
|
|
25
31
|
if (parent === dir)
|
|
@@ -33,10 +39,158 @@ export function resolveMapPath(override, cwd) {
|
|
|
33
39
|
return resolve(cwd, override);
|
|
34
40
|
return join(findProjectRoot(cwd), STORE_DIR, STORE_FILE);
|
|
35
41
|
}
|
|
42
|
+
/** The longest real name kept, as for aliases.json (reservations.ts). */
|
|
43
|
+
const MAX_NAME = 100_000;
|
|
44
|
+
// C0 and C1 controls (line feed, tab, NEL, escape, ...) and the Unicode line
|
|
45
|
+
// and paragraph separators. A map value is not always an identifier (a manual
|
|
46
|
+
// mark can be words with spaces, spec 082 adds non-ASCII letters), so no exact
|
|
47
|
+
// name pattern exists; a character that breaks a line or drives a terminal is
|
|
48
|
+
// never part of a name.
|
|
49
|
+
const NOT_IN_A_NAME = /[\p{Cc}\u2028\u2029]/u;
|
|
50
|
+
/** What a map or aliases.json may restore: 1 to 100000 characters, none of them a control or line separator. */
|
|
51
|
+
export function isName(v) {
|
|
52
|
+
return typeof v === 'string' && v.length > 0 && v.length <= MAX_NAME && !NOT_IN_A_NAME.test(v);
|
|
53
|
+
}
|
|
36
54
|
function isSymbolMap(value) {
|
|
37
55
|
if (typeof value !== 'object' || value === null || Array.isArray(value))
|
|
38
56
|
return false;
|
|
39
|
-
return Object.values(value).every(
|
|
57
|
+
return Object.values(value).every(isName);
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* Refuses to write a value the store would not read back (review round 1):
|
|
61
|
+
* a map with one would be refused whole on its next read. Refused, not
|
|
62
|
+
* dropped, so a pull never quietly loses a teammate's entry.
|
|
63
|
+
*/
|
|
64
|
+
export function refuseNonNames(what, map) {
|
|
65
|
+
const bad = Object.keys(map).find((k) => !isName(map[k]));
|
|
66
|
+
if (bad !== undefined)
|
|
67
|
+
throw new StoreRefusal(`refusing to write ${what}: the value of ${bad.replace(new RegExp(NOT_IN_A_NAME.source, 'gu'), '').slice(0, 60)} is not a name (1 to 100000 characters, no control character or line break), so nothing was written.`);
|
|
68
|
+
}
|
|
69
|
+
/** A store the CLI will not use: exit 1 in the CLI, a tool error in the MCP server. */
|
|
70
|
+
export class StoreRefusal extends Error {
|
|
71
|
+
}
|
|
72
|
+
/**
|
|
73
|
+
* The one way a store file (map.json, aliases.json, reserved.json) is read
|
|
74
|
+
* (spec 085 R1): its text, or null when there is none. Refused, whatever the
|
|
75
|
+
* file: when `.veilio/` or the file is a link (a cloned repository can commit
|
|
76
|
+
* one to another project's map), and when git tracks `.veilio`, map.json or
|
|
77
|
+
* aliases.json (a map in the repository is not yours to restore from). Git is
|
|
78
|
+
* asked first, so a tracked map is refused even where the file is absent under
|
|
79
|
+
* this spelling. Outside git, or with an index this reader cannot follow, the
|
|
80
|
+
* tracked check cannot answer and the file is read as before.
|
|
81
|
+
*/
|
|
82
|
+
export function openStoreFile(what, path) {
|
|
83
|
+
const dir = dirname(path);
|
|
84
|
+
const found = trackedStoreFile(path);
|
|
85
|
+
if (found !== null) {
|
|
86
|
+
const { root, tracked } = found;
|
|
87
|
+
// The path comes from the checkout: shown without control characters. A
|
|
88
|
+
// command only off Windows (its shells read quotes differently) and only
|
|
89
|
+
// for a root and path of plain characters; both single-quoted.
|
|
90
|
+
const shown = tracked.replace(new RegExp(NOT_IN_A_NAME.source, 'gu'), '');
|
|
91
|
+
const plain = /^[A-Za-z0-9._/ -]+$/;
|
|
92
|
+
const how = process.platform !== 'win32' && plain.test(root) && plain.test(tracked)
|
|
93
|
+
? ` (\`git -C ${shellQuote(root)} rm --cached -- ${shellQuote(tracked)}\`)`
|
|
94
|
+
: '';
|
|
95
|
+
throw new StoreRefusal(`\`${shown}\` is tracked by git: a map in the repository is not yours to restore from. ` +
|
|
96
|
+
`Remove it from git${how}, then scrub again to build your own.`);
|
|
97
|
+
}
|
|
98
|
+
for (const p of [dir, path])
|
|
99
|
+
if (isLink(p))
|
|
100
|
+
throw new StoreRefusal(`refusing to read ${what}: ${p} is a link. The map is read only where it appears to be.`);
|
|
101
|
+
refuseOthers(dir, path);
|
|
102
|
+
if (!existsSync(path))
|
|
103
|
+
return null;
|
|
104
|
+
return readFileSync(path, 'utf8');
|
|
105
|
+
}
|
|
106
|
+
/**
|
|
107
|
+
* Whose `path` is: 'me' for the running user, 'other' for anyone else, 'none'
|
|
108
|
+
* when it is not there. Windows (no uid): always 'me'. Under sudo (root, with
|
|
109
|
+
* SUDO_UID), a file of the user who ran sudo is 'sudo': readable, not writable
|
|
110
|
+
* (security review: a file root writes there would be root's).
|
|
111
|
+
*/
|
|
112
|
+
function ownerOf(path) {
|
|
113
|
+
const me = process.getuid?.();
|
|
114
|
+
let uid;
|
|
115
|
+
try {
|
|
116
|
+
uid = lstatSync(path).uid;
|
|
117
|
+
}
|
|
118
|
+
catch {
|
|
119
|
+
return 'none';
|
|
120
|
+
}
|
|
121
|
+
if (me === undefined || uid === me)
|
|
122
|
+
return 'me';
|
|
123
|
+
return me === 0 && process.env.SUDO_UID === String(uid) ? 'sudo' : 'other';
|
|
124
|
+
}
|
|
125
|
+
/**
|
|
126
|
+
* The stores VEILIO_TRUST_STORE_OWNER lists (absolute paths, separated as in
|
|
127
|
+
* PATH), by real path, as git's safe.directory: each one exactly, no other.
|
|
128
|
+
*/
|
|
129
|
+
function trustedStore(dir) {
|
|
130
|
+
const listed = (process.env.VEILIO_TRUST_STORE_OWNER ?? '').split(delimiter).filter(isAbsolute);
|
|
131
|
+
if (listed.length === 0)
|
|
132
|
+
return false;
|
|
133
|
+
const real = (p) => {
|
|
134
|
+
try {
|
|
135
|
+
return realpathSync(p);
|
|
136
|
+
}
|
|
137
|
+
catch {
|
|
138
|
+
return resolve(p);
|
|
139
|
+
}
|
|
140
|
+
};
|
|
141
|
+
const here = real(dir);
|
|
142
|
+
return listed.some((p) => real(p) === here);
|
|
143
|
+
}
|
|
144
|
+
const sudoWriteRefusal = (dir) => new StoreRefusal(`refusing to write ${dir} as root: it belongs to the user who ran sudo, and a file root writes there would be root's. Run veilio without sudo.`);
|
|
145
|
+
/** The store directory and its file are this user's, or not used (spec 085 L2, Q2 = A). */
|
|
146
|
+
function refuseOthers(dir, path, write = false) {
|
|
147
|
+
const owners = [ownerOf(dir), ownerOf(path)];
|
|
148
|
+
if (owners.includes('sudo') && write && !trustedStore(dir))
|
|
149
|
+
throw sudoWriteRefusal(dir);
|
|
150
|
+
if (owners.includes('other') && !trustedStore(dir))
|
|
151
|
+
throw new StoreRefusal(`refusing to use ${dir}: it belongs to another user on this machine. Run veilio inside your own project, or remove that directory. If you trust it, add its full path to VEILIO_TRUST_STORE_OWNER.`);
|
|
152
|
+
}
|
|
153
|
+
/**
|
|
154
|
+
* Write a store file as a new file beside it, then rename it into place
|
|
155
|
+
* (spec 085 L2): never written through the file already there, which may be
|
|
156
|
+
* another name for a file elsewhere (a hard link) or another user's.
|
|
157
|
+
*/
|
|
158
|
+
export function writeStoreFile(what, path, text) {
|
|
159
|
+
checkStoreWrite(what, path);
|
|
160
|
+
const tmp = join(dirname(path), `.${basename(path)}.${randomBytes(6).toString('hex')}.tmp`);
|
|
161
|
+
const fd = openSync(tmp, 'wx', 0o600);
|
|
162
|
+
try {
|
|
163
|
+
try {
|
|
164
|
+
writeSync(fd, text);
|
|
165
|
+
}
|
|
166
|
+
finally {
|
|
167
|
+
closeSync(fd);
|
|
168
|
+
}
|
|
169
|
+
renameSync(tmp, path);
|
|
170
|
+
}
|
|
171
|
+
catch (err) {
|
|
172
|
+
rmSync(tmp, { force: true });
|
|
173
|
+
throw err;
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
/** One POSIX shell word, for a string of plain characters (no quote in it). */
|
|
177
|
+
const shellQuote = (s) => `'${s}'`;
|
|
178
|
+
/** The store path git tracks, as git names it, with its work tree root; null when none, or no way to tell. */
|
|
179
|
+
function trackedStoreFile(path) {
|
|
180
|
+
const dir = dirname(path);
|
|
181
|
+
const git = trackedPaths(dir);
|
|
182
|
+
if (!git)
|
|
183
|
+
return null;
|
|
184
|
+
const rel = (p) => relative(git.root, p).split(sep).join('/');
|
|
185
|
+
const candidates = [path];
|
|
186
|
+
if (basename(dir) === STORE_DIR)
|
|
187
|
+
candidates.unshift(dir, join(dir, STORE_FILE), join(dir, 'aliases.json'));
|
|
188
|
+
for (const p of candidates) {
|
|
189
|
+
const name = rel(p);
|
|
190
|
+
if (name && !name.startsWith('..') && git.paths.has(name.toLowerCase()))
|
|
191
|
+
return { root: git.root, tracked: name };
|
|
192
|
+
}
|
|
193
|
+
return null;
|
|
40
194
|
}
|
|
41
195
|
/**
|
|
42
196
|
* The Cloud provenance recorded alongside the local map, if any.
|
|
@@ -46,10 +200,11 @@ function isSymbolMap(value) {
|
|
|
46
200
|
* `remote` — which reads correctly as "this map did not come from Cloud".
|
|
47
201
|
*/
|
|
48
202
|
export function loadRemote(path) {
|
|
49
|
-
|
|
203
|
+
const text = openStoreFile('the map', path);
|
|
204
|
+
if (text === null)
|
|
50
205
|
return undefined;
|
|
51
206
|
try {
|
|
52
|
-
const parsed = JSON.parse(
|
|
207
|
+
const parsed = JSON.parse(text);
|
|
53
208
|
const remote = parsed.remote;
|
|
54
209
|
if (!remote || typeof remote.id !== 'string' || typeof remote.updatedAt !== 'string') {
|
|
55
210
|
return undefined;
|
|
@@ -64,11 +219,12 @@ export function loadRemote(path) {
|
|
|
64
219
|
* file exists but cannot be understood — silently starting from empty there
|
|
65
220
|
* would orphan every placeholder the user already has in flight. */
|
|
66
221
|
export function loadMap(path) {
|
|
67
|
-
|
|
222
|
+
const text = openStoreFile('the map', path);
|
|
223
|
+
if (text === null)
|
|
68
224
|
return {};
|
|
69
225
|
let parsed;
|
|
70
226
|
try {
|
|
71
|
-
parsed = JSON.parse(
|
|
227
|
+
parsed = JSON.parse(text);
|
|
72
228
|
}
|
|
73
229
|
catch {
|
|
74
230
|
throw new Error(`map file at ${path} is not valid JSON`);
|
|
@@ -100,6 +256,7 @@ export class MapOverwriteError extends Error {
|
|
|
100
256
|
* another session's store, or by a future caller that forgets to load first.
|
|
101
257
|
*/
|
|
102
258
|
export function saveMap(path, map, options = {}) {
|
|
259
|
+
refuseNonNames('the map', map);
|
|
103
260
|
if (!options.force && existsSync(path)) {
|
|
104
261
|
const dropped = Object.entries(loadMap(path)).filter(([placeholder, real]) => map[placeholder] !== real);
|
|
105
262
|
if (dropped.length > 0) {
|
|
@@ -112,32 +269,94 @@ export function saveMap(path, map, options = {}) {
|
|
|
112
269
|
`could never be restored. Pass --force to overwrite anyway.`);
|
|
113
270
|
}
|
|
114
271
|
}
|
|
115
|
-
|
|
116
|
-
// Security audit 2026-11-01: a store that is a link (one a repository
|
|
117
|
-
// committed) would put the real names in a file outside the project.
|
|
118
|
-
refuseLinks('the map', dir, path);
|
|
119
|
-
mkdirSync(dir, { recursive: true });
|
|
120
|
-
// A store directory inside a repo must never be committed — it holds the real
|
|
121
|
-
// names the anonymization exists to hide.
|
|
122
|
-
const ignore = join(dir, '.gitignore');
|
|
123
|
-
if (dir.endsWith(STORE_DIR) && !existsSync(ignore)) {
|
|
124
|
-
writeFileSync(ignore, '*\n', { mode: 0o600 });
|
|
125
|
-
}
|
|
272
|
+
prepareStoreWrite('the map', path);
|
|
126
273
|
// Carried forward when the caller does not supply one, so an ordinary `scrub`
|
|
127
274
|
// does not quietly erase the provenance a `pull` recorded.
|
|
128
275
|
const remote = options.remote ?? loadRemote(path);
|
|
129
276
|
const payload = { version: 1, map, ...(remote ? { remote } : {}) };
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
277
|
+
// A new 0600 file each time, so a world-readable map already there is replaced too.
|
|
278
|
+
writeStoreFile('the map', path, `${JSON.stringify(payload, null, 2)}\n`);
|
|
279
|
+
}
|
|
280
|
+
/**
|
|
281
|
+
* Everything that must hold before a store file is written: neither the store
|
|
282
|
+
* directory nor the file is a link (security audit 2026-11-01: a link a
|
|
283
|
+
* repository committed would put the real names outside the project), and a
|
|
284
|
+
* `.veilio` directory carries a `.gitignore` that keeps it out of git. One
|
|
285
|
+
* there already must be a plain file whose only pattern is `*` (spec 085 L4: a
|
|
286
|
+
* repository can commit its own, which ignores nothing); a missing one is
|
|
287
|
+
* written. It is never rewritten: it may be tracked, and a silent change to a
|
|
288
|
+
* tracked file is worse than a refusal.
|
|
289
|
+
*/
|
|
290
|
+
export function prepareStoreWrite(what, path) {
|
|
291
|
+
const dir = dirname(path);
|
|
292
|
+
// Under sudo, in a project the invoking user owns, root would make a store
|
|
293
|
+
// that user cannot use (review round 2): refused before anything is made.
|
|
294
|
+
if (ownerOf(dirname(dir)) === 'sudo' && !trustedStore(dir))
|
|
295
|
+
throw sudoWriteRefusal(dir);
|
|
296
|
+
checkStoreWrite(what, path);
|
|
297
|
+
// Made 0700 and not recursively, so a directory already there is checked
|
|
298
|
+
// again rather than taken: another user may have swapped it in meanwhile.
|
|
299
|
+
mkdirSync(dirname(dir), { recursive: true });
|
|
300
|
+
try {
|
|
301
|
+
mkdirSync(dir, { mode: 0o700 });
|
|
302
|
+
}
|
|
303
|
+
catch (err) {
|
|
304
|
+
if (err.code !== 'EEXIST')
|
|
305
|
+
throw err;
|
|
306
|
+
}
|
|
307
|
+
checkStoreWrite(what, path);
|
|
308
|
+
if (basename(dir) !== STORE_DIR)
|
|
309
|
+
return;
|
|
310
|
+
const ignore = join(dir, '.gitignore');
|
|
311
|
+
let st;
|
|
312
|
+
try {
|
|
313
|
+
st = lstatSync(ignore);
|
|
314
|
+
}
|
|
315
|
+
catch {
|
|
316
|
+
// None there: written, and never through a link planted after the check.
|
|
317
|
+
writeFileSync(ignore, '*\n', { mode: 0o600, flag: 'wx' });
|
|
318
|
+
return;
|
|
319
|
+
}
|
|
320
|
+
if (!st.isFile() || !onlyStar(readFileSync(ignore, 'utf8')))
|
|
321
|
+
throw new StoreRefusal(`refusing to write ${what}: ${dir}/.gitignore does not keep it out of git (it must be a plain file whose only pattern is \`*\`). Fix that file, then run again.`);
|
|
322
|
+
}
|
|
323
|
+
/**
|
|
324
|
+
* The store directory is a real directory and neither it nor the file is a
|
|
325
|
+
* link or another user's. Run before mkdir, after it, and again right before
|
|
326
|
+
* the rename (security review). Node has no openat, so a window remains
|
|
327
|
+
* between the last check and the rename; the 0700 directory bounds it.
|
|
328
|
+
*/
|
|
329
|
+
function checkStoreWrite(what, path) {
|
|
330
|
+
const dir = dirname(path);
|
|
331
|
+
refuseLinks(what, dir, path);
|
|
332
|
+
let st;
|
|
333
|
+
try {
|
|
334
|
+
st = lstatSync(dir);
|
|
335
|
+
}
|
|
336
|
+
catch {
|
|
337
|
+
st = null; // not made yet
|
|
338
|
+
}
|
|
339
|
+
if (st && !st.isDirectory())
|
|
340
|
+
throw new StoreRefusal(`refusing to write ${what}: ${dir} is not a directory`);
|
|
341
|
+
refuseOthers(dir, path, true);
|
|
342
|
+
}
|
|
343
|
+
/**
|
|
344
|
+
* A .gitignore whose only pattern is `*` (security review): `*` then
|
|
345
|
+
* `!map.json` would let git track the map, and the CLI cannot ask git which
|
|
346
|
+
* files it ignores. Blank lines and `#` comments are allowed. No trimming:
|
|
347
|
+
* git keeps leading spaces and a trailing tab (` *`, `*\t` match nothing), so
|
|
348
|
+
* only a line that is exactly `*` (CRLF accepted) counts.
|
|
349
|
+
*/
|
|
350
|
+
function onlyStar(text) {
|
|
351
|
+
const patterns = text.split(/\r?\n/).filter((l) => l !== '' && !l.startsWith('#'));
|
|
352
|
+
return patterns.length > 0 && patterns.every((l) => l === '*');
|
|
134
353
|
}
|
|
135
354
|
/** Throws when any of `paths` is a link: the store's files are written only
|
|
136
355
|
* where they appear to be (security audit 2026-11-01). */
|
|
137
356
|
export function refuseLinks(what, ...paths) {
|
|
138
357
|
for (const p of paths)
|
|
139
358
|
if (isLink(p))
|
|
140
|
-
throw new
|
|
359
|
+
throw new StoreRefusal(`refusing to write ${what}: ${p} is a link`);
|
|
141
360
|
}
|
|
142
361
|
function isLink(path) {
|
|
143
362
|
try {
|
package/dist/store.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"store.js","sourceRoot":"","sources":["../src/store.ts"],"names":[],"mappings":"AAAA,0BAA0B;AAC1B,EAAE;AACF,gFAAgF;AAChF,gFAAgF;AAChF,4EAA4E;AAC5E,kEAAkE;AAClE,EAAE;AACF,2EAA2E;AAC3E,6EAA6E;AAC7E,+BAA+B;AAE/B,OAAO,EACL,SAAS,EACT,UAAU,EACV,SAAS,EACT,SAAS,EACT,YAAY,EACZ,MAAM,EACN,aAAa,GACd,MAAM,SAAS,CAAA;AAChB,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AAClD,OAAO,EAAE,SAAS,EAAkB,MAAM,oBAAoB,CAAA;AAE9D,OAAO,EAAE,SAAS,EAAE,CAAA;AACpB,MAAM,CAAC,MAAM,UAAU,GAAG,UAAU,CAAA;AAEpC;;oCAEoC;AACpC,MAAM,UAAU,eAAe,CAAC,IAAY;IAC1C,IAAI,GAAG,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;IACvB,SAAS,CAAC;QACR,IAAI,UAAU,CAAC,IAAI,CAAC,GAAG,EAAE,SAAS,CAAC,CAAC,IAAI,UAAU,CAAC,IAAI,CAAC,GAAG,EAAE,MAAM,CAAC,CAAC;YAAE,OAAO,GAAG,CAAA;QACjF,MAAM,MAAM,GAAG,OAAO,CAAC,GAAG,CAAC,CAAA;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,MAAM,CAAC,CAAC,CAAC;YAAE,MAAM,IAAI,YAAY,CAAC,qBAAqB,IAAI,KAAK,CAAC,YAAY,CAAC,CAAA;AACtF,CAAC;AAED,SAAS,MAAM,CAAC,IAAY;IAC1B,IAAI,CAAC;QACH,OAAO,SAAS,CAAC,IAAI,CAAC,CAAC,cAAc,EAAE,CAAA;IACzC,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,KAAK,CAAA,CAAC,gBAAgB;IAC/B,CAAC;AACH,CAAC;AAED,MAAM,UAAU,QAAQ,CAAC,IAAY;IACnC,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC;QAAE,OAAO,KAAK,CAAA;IACnC,MAAM,CAAC,IAAI,CAAC,CAAA;IACZ,OAAO,IAAI,CAAA;AACb,CAAC"}
|
package/dist/team-unlock.d.ts
CHANGED
|
@@ -5,6 +5,26 @@ export interface StoredTeamKey {
|
|
|
5
5
|
version: number;
|
|
6
6
|
/** Raw AES-256 key, base64. */
|
|
7
7
|
key: string;
|
|
8
|
+
/**
|
|
9
|
+
* Who made the wrap it came from (spec 080 item 7a): the server's
|
|
10
|
+
* `wrapped_by` (null for a deleted or unnamed granter) and the wrap's
|
|
11
|
+
* granter key. Absent in a file an earlier CLI wrote.
|
|
12
|
+
*/
|
|
13
|
+
granter?: {
|
|
14
|
+
id: string | null;
|
|
15
|
+
publicKey: string;
|
|
16
|
+
/** Who that is, for `team trust`'s message only: never judged by. */
|
|
17
|
+
label?: string;
|
|
18
|
+
/** An active member when `team unlock` read the team (or our own key).
|
|
19
|
+
* Only true lets `team trust` make the key writable; absent is false. */
|
|
20
|
+
current?: boolean;
|
|
21
|
+
};
|
|
22
|
+
/**
|
|
23
|
+
* May a map be sealed under it: true only when `team unlock` or
|
|
24
|
+
* `team trust` judged its wrap `trusted`. Read as false without a granter,
|
|
25
|
+
* which is how a file from an earlier CLI migrates.
|
|
26
|
+
*/
|
|
27
|
+
writable: boolean;
|
|
8
28
|
}
|
|
9
29
|
export interface TeamUnlock {
|
|
10
30
|
v: 1;
|
|
@@ -14,6 +34,15 @@ export interface TeamUnlock {
|
|
|
14
34
|
instance: string;
|
|
15
35
|
account: string;
|
|
16
36
|
teamId: string;
|
|
37
|
+
/** For the messages printed where there is no network to ask. */
|
|
38
|
+
teamName?: string;
|
|
39
|
+
/**
|
|
40
|
+
* The newest version Cloud held for this account that was NOT stored -
|
|
41
|
+
* refused, or did not open - when it is above every stored one (spec 080
|
|
42
|
+
* review). Nothing is written under an older key while it is set: the
|
|
43
|
+
* team has moved past it. Recomputed by every `team unlock`.
|
|
44
|
+
*/
|
|
45
|
+
blockedVersion?: number;
|
|
17
46
|
/** ISO-8601. Past this, reads return null and the file is ignored. */
|
|
18
47
|
expiresAt: string;
|
|
19
48
|
keys: StoredTeamKey[];
|
|
@@ -30,6 +59,13 @@ export declare function readTeamUnlock(binding: {
|
|
|
30
59
|
instance: string;
|
|
31
60
|
account: string;
|
|
32
61
|
}, home?: string, now?: Date): TeamUnlock | null;
|
|
62
|
+
/**
|
|
63
|
+
* The one rule for using a team key to write (spec 080 item 7a): the newest
|
|
64
|
+
* stored version, and only while it is writable. A team map is sealed under
|
|
65
|
+
* it, and a rule's name is hashed for the server only while it exists. Never
|
|
66
|
+
* an older writable version instead: a write belongs under the newest key.
|
|
67
|
+
*/
|
|
68
|
+
export declare function writeKeyOf(unlock: TeamUnlock): StoredTeamKey | null;
|
|
33
69
|
/** Write the unlocked keys, readable only by this user. */
|
|
34
70
|
export declare function writeTeamUnlock(unlock: TeamUnlock, home?: string): void;
|
|
35
71
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"team-unlock.d.ts","sourceRoot":"","sources":["../src/team-unlock.ts"],"names":[],"mappings":"AAwCA,eAAO,MAAM,gBAAgB,mBAAmB,CAAA;AAEhD,mEAAmE;AACnE,eAAO,MAAM,mBAAmB,IAAI,CAAA;AAEpC,MAAM,WAAW,aAAa;IAC5B,OAAO,EAAE,MAAM,CAAA;IACf,+B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;;;GAKG;AACH,wBAAgB,UAAU,CAAC,MAAM,EAAE,UAAU,GAAG,aAAa,GAAG,IAAI,CAOnE;AAYD,2DAA2D;AAC3D,wBAAgB,eAAe,CAAC,MAAM,EAAE,UAAU,EAAE,IAAI,GAAE,MAAkB,GAAG,IAAI,CAQlF;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,gBAAgB,CAAC,IAAI,GAAE,MAAkB,GAAG,OAAO,CASlE;AAED,6CAA6C;AAC7C,wBAAgB,UAAU,CAAC,GAAG,EAAE,IAAI,EAAE,IAAI,GAAE,MAA4B,GAAG,MAAM,CAEhF"}
|
package/dist/team-unlock.js
CHANGED
|
@@ -93,7 +93,31 @@ export function readTeamUnlock(binding, home = homedir(), now = new Date()) {
|
|
|
93
93
|
const expiresAt = Date.parse(parsed.expiresAt);
|
|
94
94
|
if (Number.isNaN(expiresAt) || expiresAt <= now.getTime())
|
|
95
95
|
return null;
|
|
96
|
-
return parsed;
|
|
96
|
+
return { ...parsed, keys: parsed.keys.map(withWritable) };
|
|
97
|
+
}
|
|
98
|
+
/**
|
|
99
|
+
* The one rule for using a team key to write (spec 080 item 7a): the newest
|
|
100
|
+
* stored version, and only while it is writable. A team map is sealed under
|
|
101
|
+
* it, and a rule's name is hashed for the server only while it exists. Never
|
|
102
|
+
* an older writable version instead: a write belongs under the newest key.
|
|
103
|
+
*/
|
|
104
|
+
export function writeKeyOf(unlock) {
|
|
105
|
+
const newest = [...unlock.keys].sort((a, b) => b.version - a.version)[0];
|
|
106
|
+
if (!newest?.writable)
|
|
107
|
+
return null;
|
|
108
|
+
const blocked = unlock.blockedVersion;
|
|
109
|
+
if (blocked === undefined)
|
|
110
|
+
return newest;
|
|
111
|
+
// A damaged value compares false: blocked, which fails closed.
|
|
112
|
+
return blocked <= newest.version ? newest : null;
|
|
113
|
+
}
|
|
114
|
+
/** Writable only when judged so, with the granter it was judged by. */
|
|
115
|
+
function withWritable(k) {
|
|
116
|
+
const g = k.granter;
|
|
117
|
+
const granted = typeof g === 'object' &&
|
|
118
|
+
g !== null &&
|
|
119
|
+
typeof g.publicKey === 'string';
|
|
120
|
+
return { ...k, writable: granted && k.writable === true };
|
|
97
121
|
}
|
|
98
122
|
/** Write the unlocked keys, readable only by this user. */
|
|
99
123
|
export function writeTeamUnlock(unlock, home = homedir()) {
|
package/dist/team-unlock.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"team-unlock.js","sourceRoot":"","sources":["../src/team-unlock.ts"],"names":[],"mappings":"AAAA,iEAAiE;AACjE,EAAE;AACF,gFAAgF;AAChF,8EAA8E;AAC9E,4EAA4E;AAC5E,uBAAuB;AACvB,EAAE;AACF,sEAAsE;AACtE,EAAE;AACF,gFAAgF;AAChF,4EAA4E;AAC5E,gFAAgF;AAChF,8EAA8E;AAC9E,0EAA0E;AAC1E,gEAAgE;AAChE,EAAE;AACF,8EAA8E;AAC9E,2EAA2E;AAC3E,gFAAgF;AAChF,6EAA6E;AAC7E,oCAAoC;AACpC,EAAE;AACF,2BAA2B;AAC3B,EAAE;AACF,6EAA6E;AAC7E,yEAAyE;AACzE,6EAA6E;AAC7E,6EAA6E;AAC7E,6EAA6E;AAC7E,mBAAmB;AACnB,EAAE;AACF,8EAA8E;AAC9E,8EAA8E;AAC9E,kEAAkE;AAElE,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,EAAE,QAAQ,EAAE,aAAa,EAAE,MAAM,SAAS,CAAA;AAC7F,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAA;AACzC,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAA;AACjC,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAA;AAE9C,MAAM,CAAC,MAAM,gBAAgB,GAAG,gBAAgB,CAAA;AAEhD,mEAAmE;AACnE,MAAM,CAAC,MAAM,mBAAmB,GAAG,CAAC,CAAA;
|
|
1
|
+
{"version":3,"file":"team-unlock.js","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AAG,IAAI,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,IAAI,CAAC,CAAC,WAAW,EAAE,CAAA;AAC3E,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@veilio-inc/cli",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.11.1",
|
|
4
4
|
"description": "Anonymize identifiers and redact credentials in source code before it reaches an LLM \u2014 from the terminal, a pipe, or a pre-commit hook.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
],
|
|
29
29
|
"license": "SEE LICENSE IN LICENSE",
|
|
30
30
|
"dependencies": {
|
|
31
|
-
"@veilio-inc/engine": "^1.
|
|
31
|
+
"@veilio-inc/engine": "^1.17.0"
|
|
32
32
|
},
|
|
33
33
|
"scripts": {
|
|
34
34
|
"build": "tsc",
|