@veilio-inc/cli 0.9.2 → 0.11.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/README.md +98 -20
- 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 +4 -0
- package/dist/client/fingerprint.d.ts.map +1 -0
- package/dist/client/fingerprint.js +20 -0
- package/dist/client/fingerprint.js.map +1 -0
- package/dist/client/maps.d.ts.map +1 -1
- package/dist/client/maps.js +29 -8
- package/dist/client/maps.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 +10 -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 +342 -5
- package/dist/cloud-commands.js.map +1 -1
- package/dist/cloud.d.ts +5 -1
- package/dist/cloud.d.ts.map +1 -1
- package/dist/cloud.js +7 -1
- 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/README.md
CHANGED
|
@@ -6,14 +6,14 @@ Anonymize code before it reaches an LLM, restore it after — from a terminal, a
|
|
|
6
6
|
>
|
|
7
7
|
> - **[veilio-guard](../../plugins/veilio-guard/README.md)** keeps your names from the model while a coding agent works: it masks everything the agent reads - files, command output, search results and your prompts. Claude Code today; other agents are in progress.
|
|
8
8
|
> - **The CLI (this package)** does what the guard cannot, because the guard makes no network call: `veilio scrub` builds the map before the first session, `veilio maps pull` brings in your team's map and its numbers, `veilio rules pull` your custom rules, `veilio restore` brings back the names in an answer, and `veilio scan` stops a live key in a commit or in CI.
|
|
9
|
-
> - **[The MCP server](../mcp/README.md) (`@veilio-inc/mcp`)** gives the agent tools of its own: read a file masked, restore an answer, scan for secrets. In an agent the guard does not cover yet, it is the way in - with the agent's own file and shell tools turned off.
|
|
9
|
+
> - **[The MCP server](../mcp/README.md) (`@veilio-inc/mcp`)** gives the agent tools of its own: read a file masked, restore an answer (opt-in), scan for secrets. In an agent the guard does not cover yet, it is the way in - with the agent's own file and shell tools turned off.
|
|
10
10
|
>
|
|
11
11
|
> **Without the guard, the CLI and the MCP server protect only what passes through them.** An agent that reads files and test output with its own tools sends them to the model as written: in our benchmark (spec 067, run 3), project names reached the model in 93-95 of 96 sessions with the MCP server or the CLI alone, and in 0 of 96 with the guard.
|
|
12
12
|
|
|
13
13
|
```bash
|
|
14
14
|
veilio scrub src/billing.ts | pbcopy # mask, then paste anywhere
|
|
15
15
|
pbpaste | veilio restore # bring the answer back
|
|
16
|
-
|
|
16
|
+
veilio scan .env config.yml # refuse to commit a live key
|
|
17
17
|
```
|
|
18
18
|
|
|
19
19
|
Full guide - terminal, Cloud sign-in, and connecting AI assistants (Claude Code, Claude Desktop, Xcode, Cursor, VS Code): [docs/USING-THE-CLI-AND-MCP.md](../../docs/USING-THE-CLI-AND-MCP.md).
|
|
@@ -58,6 +58,8 @@ veilio projects # the projects your team works in; * marks the o
|
|
|
58
58
|
veilio projects use <name> # work in that project (kept with the sign-in)
|
|
59
59
|
veilio team unlock # open the team key with your vault passphrase (kept 7 days)
|
|
60
60
|
veilio team lock # remove the unlocked team key, and the team rules, from this machine
|
|
61
|
+
veilio team trust <team> <fp> # confirm a teammate's key by its fingerprint, so maps can be saved under it
|
|
62
|
+
veilio keys fingerprint # your own key fingerprint, for teammates who confirm a key you granted
|
|
61
63
|
veilio vault unlock # keep the personal-maps key here (7 days), for the MCP server
|
|
62
64
|
veilio vault lock # remove it, and the personal rules, from this machine
|
|
63
65
|
veilio rules pull # fetch your custom rules; scrub then applies them offline
|
|
@@ -74,6 +76,52 @@ derives the key here, on your machine — the passphrase and the key never
|
|
|
74
76
|
leave it. A team map is sealed under the team key, which the server cannot
|
|
75
77
|
read either; `veilio team unlock` opens it here with your vault passphrase.
|
|
76
78
|
|
|
79
|
+
**Confirming who granted the team key.** A team key reaches you wrapped by the
|
|
80
|
+
teammate who granted it, and the wrap names their key - but Veilio's server
|
|
81
|
+
hands over both, so `team unlock` cannot tell a teammate's grant from one the
|
|
82
|
+
server made itself. So it reads with every key it opens, and **writes** (`maps
|
|
83
|
+
push --team`, `maps update`, the MCP server's map writes) only under the newest
|
|
84
|
+
version of the team key that Cloud holds for you, and only once it is confirmed:
|
|
85
|
+
|
|
86
|
+
- a key you made yourself, or one granted by a teammate whose key you confirmed
|
|
87
|
+
and who is still an active member, is used to save maps;
|
|
88
|
+
- if a newer version was refused or did not open, nothing is written under an
|
|
89
|
+
older one - even when Cloud later leaves that version out, and after a logout
|
|
90
|
+
or `team lock` (the version is kept in `~/.veilio/key-pins.json`). It lifts
|
|
91
|
+
once that version is stored and writable. If your team really removed it,
|
|
92
|
+
`veilio team unlock --forget-refused` forgets it - but only once Cloud no
|
|
93
|
+
longer offers that version (one it still offers is refused again), and only
|
|
94
|
+
if the newest key it then stores is writable;
|
|
95
|
+
- a key from a teammate you have not confirmed is kept read-only, and `team
|
|
96
|
+
unlock` prints who granted it and their key's fingerprint. Ask them for the
|
|
97
|
+
fingerprint they see - on their dashboard in the web app under "Your key
|
|
98
|
+
fingerprint", or from `veilio keys fingerprint` - and if it matches, run
|
|
99
|
+
`veilio team trust <team> <fingerprint>` (case, spaces and dashes are
|
|
100
|
+
ignored). It needs no network;
|
|
101
|
+
- a key granted by someone who is no longer an active member of the team (or a
|
|
102
|
+
deleted account) is kept read-only, confirmed or not, and `team unlock` says so.
|
|
103
|
+
`team unlock` writes nothing if Cloud does not list the team's members;
|
|
104
|
+
- a confirmed teammate's key that changed, or a key labelled as your own that is
|
|
105
|
+
not, is not stored at all, and `team unlock` says so. To accept a changed key,
|
|
106
|
+
compare the new fingerprint with them and run `veilio team trust` with it: it
|
|
107
|
+
asks Cloud for the team's keys again, and for your vault passphrase, and
|
|
108
|
+
stores the key it confirmed.
|
|
109
|
+
|
|
110
|
+
While the newest team key is not confirmed, a write is refused with nothing sent,
|
|
111
|
+
and so is a `scrub --team` that would reserve numbers for a custom rule's
|
|
112
|
+
placeholder - a rule's name goes to the server only as a hash under a confirmed
|
|
113
|
+
key:
|
|
114
|
+
|
|
115
|
+
```text
|
|
116
|
+
veilio: Not saved: the newest key for team "Payments" is not confirmed on this device. Run `veilio team unlock` to see who granted it, then `veilio team trust`.
|
|
117
|
+
```
|
|
118
|
+
|
|
119
|
+
**After upgrading:** keys unlocked by an earlier version are read-only until
|
|
120
|
+
the next `veilio team unlock`, which judges them. A team key you made yourself
|
|
121
|
+
is writable again at once; a teammate's grant needs one `veilio team trust` on
|
|
122
|
+
each device. Confirmations are kept in `~/.veilio/key-pins.json` and are never
|
|
123
|
+
sent to Veilio.
|
|
124
|
+
|
|
77
125
|
**Updating a map in place.** `veilio maps update <id>` replaces a Cloud map's
|
|
78
126
|
entries with the local map's and keeps its id, name and project, so refreshing a
|
|
79
127
|
map never leaves a second copy behind. Before anything is sent it refuses, and
|
|
@@ -179,7 +227,9 @@ Four files, all `0600`, all under `~/.veilio/`: `credential.json` (the session
|
|
|
179
227
|
and the chosen project, removed by `logout`), `rules.json` (the rules copy),
|
|
180
228
|
`team-keys.json` (the keys `team unlock` opened, kept seven days) and
|
|
181
229
|
`personal-maps-key.json` (the key `vault unlock` opened, kept seven days). `logout`
|
|
182
|
-
removes all of them.
|
|
230
|
+
removes all of them. A fifth, `key-pins.json` (also `0600`), holds the teammate
|
|
231
|
+
keys `team trust` confirmed, per instance and account, and is kept: it holds no
|
|
232
|
+
key material, and a confirmation should outlive a sign-in.
|
|
183
233
|
|
|
184
234
|
### Scrubbing with the team's numbering
|
|
185
235
|
|
|
@@ -313,6 +363,14 @@ a plan feature the web app couldn't.
|
|
|
313
363
|
update, team unlock
|
|
314
364
|
--json Machine-readable output
|
|
315
365
|
For: scan, map
|
|
366
|
+
--blobs <listing> scan the files a `git diff --raw --no-abbrev` listing
|
|
367
|
+
names, their content read from `git cat-file --batch`
|
|
368
|
+
on stdin (used by the pre-commit hook and the GitHub
|
|
369
|
+
Action)
|
|
370
|
+
For: scan
|
|
371
|
+
--name <path> scan stdin as if it were the file <path> (its file
|
|
372
|
+
type decides the rules; used by the pre-commit hook)
|
|
373
|
+
For: scan
|
|
316
374
|
--strict scan: also fail on advisory findings. restore: write
|
|
317
375
|
nothing and exit 1 if a placeholder or a redaction
|
|
318
376
|
would be left
|
|
@@ -329,6 +387,10 @@ a plan feature the web app couldn't.
|
|
|
329
387
|
For: scrub, maps push
|
|
330
388
|
--days <n> Keep the key for n days (1 to 30; 7 by default)
|
|
331
389
|
For: team unlock, vault unlock
|
|
390
|
+
--forget-refused Forget a newer team key version refused before. Helps
|
|
391
|
+
only once Cloud no longer offers that version, and
|
|
392
|
+
only if the newest key stored is writable
|
|
393
|
+
For: team unlock
|
|
332
394
|
--allow-drop Allow dropping entries the Cloud map has and the local
|
|
333
395
|
map does not
|
|
334
396
|
For: maps update
|
|
@@ -405,18 +467,12 @@ Standard output and the exit code are never changed, so pipes keep working. The
|
|
|
405
467
|
| Code | Meaning |
|
|
406
468
|
| ---- | ------------------------------------------------------------------------------------------------------------------ |
|
|
407
469
|
| 0 | Clean |
|
|
408
|
-
| 1 | Findings that should stop the pipeline: a credential (`scan`),
|
|
470
|
+
| 1 | Findings that should stop the pipeline: a credential (`scan`), a placeholder or redaction `restore --strict` would have left, or a map the CLI refuses to use (see [The symbol map](#the-symbol-map)) |
|
|
409
471
|
| 2 | Usage or IO error |
|
|
410
472
|
|
|
411
|
-
As a pre-commit hook
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
#!/bin/sh
|
|
415
|
-
git diff --cached | veilio scan || {
|
|
416
|
-
echo "Commit blocked: credentials detected." >&2
|
|
417
|
-
exit 1
|
|
418
|
-
}
|
|
419
|
-
```
|
|
473
|
+
As a pre-commit hook, use the one this package ships ([Pre-commit](#pre-commit)).
|
|
474
|
+
It scans each staged file under its own name; a diff piped into `veilio scan`
|
|
475
|
+
has no file name, so the `.env`, YAML and shell rules cannot apply to it.
|
|
420
476
|
|
|
421
477
|
## What is masked
|
|
422
478
|
|
|
@@ -439,6 +495,15 @@ are redacted whatever they are called.
|
|
|
439
495
|
|
|
440
496
|
Redacted credentials are **not** in the map. `restore` cannot bring them back, by construction.
|
|
441
497
|
|
|
498
|
+
The map is yours only if you made it, so the CLI refuses (exit 1) to read or write a store:
|
|
499
|
+
|
|
500
|
+
- that git tracks: a `.veilio/map.json` or `.veilio/aliases.json` a repository committed is not yours to restore from. Remove it from git (`git rm --cached`), then scrub again to build your own. The CLI reads the git index itself and runs no git command.
|
|
501
|
+
- through a link: `.veilio/`, `map.json`, `aliases.json` and `reserved.json` are read and written only where they appear to be.
|
|
502
|
+
- that belongs to another user on this machine (macOS and Linux): a `.veilio` someone else made, say in `/tmp`, is skipped when the CLI looks for the project, and refused when named with `--map`. Under `sudo`, a store of the user who ran it (`SUDO_UID`) can be read but not written, and no store is made in a project that user owns: a file root writes there would be root's, so run `veilio` without `sudo`. To use a store someone else owns on purpose (a shared CI workspace, say), list its full path in `VEILIO_TRUST_STORE_OWNER`, as git's `safe.directory`: absolute paths separated by `:` (`;` on Windows), for example `VEILIO_TRUST_STORE_OWNER=/srv/build/.veilio`. Only a listed store is accepted, by its real path.
|
|
503
|
+
- whose `.veilio/.gitignore` does not keep it out of git: an existing one must be a plain file whose only pattern is `*`. The CLI writes one when there is none and never rewrites one that is there.
|
|
504
|
+
|
|
505
|
+
Outside a git checkout, the CLI cannot tell a map you made from one that came with the files. Check `.veilio/` in an unpacked archive before you restore.
|
|
506
|
+
|
|
442
507
|
## Every file is judged strictly
|
|
443
508
|
|
|
444
509
|
`scrub` and `scan` read every file as real source, test, fixture and example files included: a weak password in a secret position (`PGPASSWORD=Summer24`, `mysql -pSummer24`, the password in a URL, an auth header) is redacted wherever it is. The MCP server and the Claude Code guard do the same. A committed fixture cannot be told from a copy of `.env` in `tests/` safely enough to leave its passwords in place, so no Veilio client tries.
|
|
@@ -465,12 +530,16 @@ Edition release workflow, so the two are not independent.
|
|
|
465
530
|
|
|
466
531
|
Scans the **pull-request diff** by default, not the whole tree. A repo adopting
|
|
467
532
|
this mid-life almost always has a historical finding somewhere; blocking every PR
|
|
468
|
-
on that is how a security check gets switched off in week one.
|
|
469
|
-
|
|
533
|
+
on that is how a security check gets switched off in week one. Each changed file
|
|
534
|
+
is scanned under its own name, as the pre-commit hook does, so a `-diff`
|
|
535
|
+
attribute hides nothing; this needs a CLI with `scan --blobs`, so a `version:`
|
|
536
|
+
pinned below this release fails the step. Pass `paths:` to scan a fixed set
|
|
537
|
+
instead.
|
|
470
538
|
|
|
471
539
|
Findings land in the job summary and, with `sarif:`, in GitHub code scanning.
|
|
472
|
-
Reports
|
|
473
|
-
|
|
540
|
+
Reports show only a value's last four characters and its length (`…vJKx (39 chars)`;
|
|
541
|
+
`•••• (9 chars)` for 12 characters or fewer) — a stored, shareable artifact must
|
|
542
|
+
never contain the credential it is reporting.
|
|
474
543
|
|
|
475
544
|
### Pre-commit
|
|
476
545
|
|
|
@@ -485,6 +554,15 @@ cp packages/cli/hooks/pre-commit .git/hooks/pre-commit
|
|
|
485
554
|
chmod +x .git/hooks/pre-commit
|
|
486
555
|
```
|
|
487
556
|
|
|
488
|
-
It scans
|
|
489
|
-
a finding in an unstaged scratch file shouldn't block you.
|
|
490
|
-
|
|
557
|
+
It scans what is **staged** — what you are about to commit is what matters, and
|
|
558
|
+
a finding in an unstaged scratch file shouldn't block you. Each staged file
|
|
559
|
+
(added, changed, renamed or retyped) is scanned under its own name, so its file
|
|
560
|
+
type picks the rules; a `.gitattributes` `-diff` hides nothing, because the
|
|
561
|
+
file is read, not its diff. One `veilio scan --blobs` checks the whole commit:
|
|
562
|
+
git lists the staged files with their object ids, `git cat-file --batch`
|
|
563
|
+
streams those blobs, and each is matched to its name by id, read as it
|
|
564
|
+
arrives. Binary files and submodules are skipped; a text file over 16 MiB is
|
|
565
|
+
not scanned and stops the commit as "could not check", naming it. A finding blocks the commit with the credentials
|
|
566
|
+
message; anything that stops the check blocks it with "could not check" and
|
|
567
|
+
the reason. The hook needs veilio 0.10.0 or later; an older one stops the
|
|
568
|
+
commit with a line saying to upgrade. `--no-verify` overrides, as usual.
|
package/dist/args.d.ts
CHANGED
|
@@ -24,6 +24,10 @@ export interface ParsedArgs {
|
|
|
24
24
|
strict: boolean;
|
|
25
25
|
/** Keep JSDoc blocks when restoring. */
|
|
26
26
|
keepDocs: boolean;
|
|
27
|
+
/** `scan --name <path>`: the file name stdin stands for (spec 085 L1). */
|
|
28
|
+
stdinName: string | null;
|
|
29
|
+
/** `scan --blobs <listing>`: a git raw listing; the blobs come on stdin. */
|
|
30
|
+
blobsFile: string | null;
|
|
27
31
|
/** Allow a map write that would drop entries already on disk. */
|
|
28
32
|
force: boolean;
|
|
29
33
|
/**
|
|
@@ -74,9 +78,13 @@ export interface ParsedArgs {
|
|
|
74
78
|
* server above all. `vault`, not `team`: it is the account's own key.
|
|
75
79
|
*/
|
|
76
80
|
vaultAction: ActionOf<'vault'> | null;
|
|
81
|
+
/** `keys fingerprint` (spec 080 item 7a). */
|
|
82
|
+
keysAction: ActionOf<'keys'> | null;
|
|
77
83
|
/** `vault unlock --days N`, `team unlock --days N`: how long the unlock
|
|
78
84
|
* lasts. Null: the default, 7 days. */
|
|
79
85
|
days: number | null;
|
|
86
|
+
/** `team unlock --forget-refused` (spec 080 review). */
|
|
87
|
+
forgetRefused: boolean;
|
|
80
88
|
/** `projects` (or `projects list`) and `projects use <name|id>`. */
|
|
81
89
|
projectsAction: ActionOf<'projects'> | null;
|
|
82
90
|
/** `rules pull`. */
|
package/dist/args.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"args.d.ts","sourceRoot":"","sources":["../src/args.ts"],"names":[],"mappings":"AAIA,OAAO,EAA4B,KAAK,cAAc,EAAE,MAAM,oBAAoB,CAAA;AAClF,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAA;AACtD,OAAO,EAUL,KAAK,QAAQ,EAEb,KAAK,WAAW,EACjB,MAAM,YAAY,CAAA;AAEnB;0DAC0D;AAC1D,MAAM,MAAM,OAAO,GAAG,WAAW,GAAG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D;AAYD,wBAAgB,SAAS,CAAC,IAAI,EAAE,SAAS,MAAM,EAAE,GAAG,UAAU,CAqO7D"}
|
package/dist/args.js
CHANGED
|
@@ -30,6 +30,7 @@ const ACTION_FIELD = {
|
|
|
30
30
|
maps: 'mapsAction',
|
|
31
31
|
team: 'teamAction',
|
|
32
32
|
vault: 'vaultAction',
|
|
33
|
+
keys: 'keysAction',
|
|
33
34
|
projects: 'projectsAction',
|
|
34
35
|
rules: 'rulesAction',
|
|
35
36
|
};
|
|
@@ -63,6 +64,8 @@ export function parseArgs(argv) {
|
|
|
63
64
|
clear: false,
|
|
64
65
|
strict: false,
|
|
65
66
|
keepDocs: false,
|
|
67
|
+
stdinName: null,
|
|
68
|
+
blobsFile: null,
|
|
66
69
|
force: false,
|
|
67
70
|
team: false,
|
|
68
71
|
device: false,
|
|
@@ -71,8 +74,10 @@ export function parseArgs(argv) {
|
|
|
71
74
|
allowDrop: false,
|
|
72
75
|
teamAction: null,
|
|
73
76
|
vaultAction: null,
|
|
77
|
+
keysAction: null,
|
|
74
78
|
projectsAction: null,
|
|
75
79
|
days: null,
|
|
80
|
+
forgetRefused: false,
|
|
76
81
|
rulesAction: null,
|
|
77
82
|
helpTopic: null,
|
|
78
83
|
};
|
|
@@ -211,6 +216,12 @@ export function parseArgs(argv) {
|
|
|
211
216
|
case '--keep-docs':
|
|
212
217
|
parsed.keepDocs = true;
|
|
213
218
|
break;
|
|
219
|
+
case '--name':
|
|
220
|
+
parsed.stdinName = requireValue(arg, argv[++i]);
|
|
221
|
+
break;
|
|
222
|
+
case '--blobs':
|
|
223
|
+
parsed.blobsFile = requireValue(arg, argv[++i]);
|
|
224
|
+
break;
|
|
214
225
|
case '--team':
|
|
215
226
|
parsed.team = true;
|
|
216
227
|
break;
|
|
@@ -231,6 +242,9 @@ export function parseArgs(argv) {
|
|
|
231
242
|
parsed.days = Number(value);
|
|
232
243
|
break;
|
|
233
244
|
}
|
|
245
|
+
case '--forget-refused':
|
|
246
|
+
parsed.forgetRefused = true;
|
|
247
|
+
break;
|
|
234
248
|
case '--allow-drop':
|
|
235
249
|
parsed.allowDrop = true;
|
|
236
250
|
break;
|
package/dist/args.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"args.js","sourceRoot":"","sources":["../src/args.ts"],"names":[],"mappings":"AAAA,gFAAgF;AAChF,2EAA2E;AAC3E,8DAA8D;AAE9D,OAAO,EAAE,SAAS,EAAsC,MAAM,oBAAoB,CAAA;AAElF,OAAO,EACL,aAAa,EACb,aAAa,EACb,UAAU,EACV,SAAS,EACT,SAAS,EACT,OAAO,EACP,OAAO,EACP,QAAQ,EACR,KAAK,GAIN,MAAM,YAAY,CAAA;
|
|
1
|
+
{"version":3,"file":"args.js","sourceRoot":"","sources":["../src/args.ts"],"names":[],"mappings":"AAAA,gFAAgF;AAChF,2EAA2E;AAC3E,8DAA8D;AAE9D,OAAO,EAAE,SAAS,EAAsC,MAAM,oBAAoB,CAAA;AAElF,OAAO,EACL,aAAa,EACb,aAAa,EACb,UAAU,EACV,SAAS,EACT,SAAS,EACT,OAAO,EACP,OAAO,EACP,QAAQ,EACR,KAAK,GAIN,MAAM,YAAY,CAAA;AA8GnB,MAAM,OAAO,UAAW,SAAQ,KAAK;IACnC;qDACiD;IACxC,OAAO,CAAoB;IACpC,6EAA6E;IACpE,QAAQ,CAAS;IAE1B,YAAY,OAAe,EAAE,OAAgB,EAAE,QAAQ,GAAG,KAAK;QAC7D,KAAK,CAAC,OAAO,CAAC,CAAA;QACd,IAAI,CAAC,OAAO,GAAG,OAAO,CAAA;QACtB,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAA;IAC1B,CAAC;CACF;AAED;4DAC4D;AAC5D,SAAS,WAAW,CAAC,QAAgB,EAAE,OAAmB,EAAE,KAAc;IACxE,MAAM,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC,CAAA;IAChC,MAAM,IAAI,GAAG,KAAK;QAChB,CAAC,CAAC,GAAG,QAAQ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C,EAAE,MAAM;AACb;oDACoD;AACpD,YAAY,CAAC,EAAE,sBAAsB,EAAE,GAAG,IAAI,GAC7C,OAAO,CAAC,aAAa,CAAC,CAoGxB"}
|
package/dist/client/blocks.js
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
// highest number of a kind and never into a gap below it.
|
|
8
8
|
import { highestPerKind, isSaneBlock } from '@veilio-inc/engine';
|
|
9
9
|
import { reservePlaceholders, CloudError } from '../cloud.js';
|
|
10
|
-
import { teamKeyBytes, teamKeyVersion } from '../hashed-bases.js';
|
|
10
|
+
import { teamKeyBytes, teamKeyUnconfirmed, teamKeyVersion } from '../hashed-bases.js';
|
|
11
11
|
import { loadMap } from '../store.js';
|
|
12
12
|
import { CORE_BASES, basesNeedingBlocks, drawTag, loadReserved, saveReserved, } from '../reservations.js';
|
|
13
13
|
/** Why a reservation failed, in the four kinds a member can act on (spec 066 R4). */
|
|
@@ -90,6 +90,7 @@ reservations) {
|
|
|
90
90
|
block: true,
|
|
91
91
|
keys: teamKeyBytes(credential, home, teamId),
|
|
92
92
|
keyVersion: teamKeyVersion(credential, home, teamId),
|
|
93
|
+
unconfirmed: teamKeyUnconfirmed(credential, home, teamId),
|
|
93
94
|
...(reservations !== undefined ? { reservations } : {}),
|
|
94
95
|
}));
|
|
95
96
|
// Round 4 (D): the floor the server was sent, once vouched.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"blocks.js","sourceRoot":"","sources":["../../src/client/blocks.ts"],"names":[],"mappings":"AAAA,8EAA8E;AAC9E,4EAA4E;AAC5E,EAAE;AACF,4EAA4E;AAC5E,4EAA4E;AAC5E,0EAA0E;AAC1E,0DAA0D;AAE1D,OAAO,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAA;AAChE,OAAO,EAAE,mBAAmB,EAAE,UAAU,EAA+B,MAAM,aAAa,CAAA;AAC1F,OAAO,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,oBAAoB,CA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C,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CACpF,CAAA;IACH,IAAI,CAAC,IAAI;QAAE,OAAO,IAAI,CAAC,QAAQ,EAAE,4CAA4C,CAAC,CAAA;IAC9E,MAAM,MAAM,GAA0B,EAAE,GAAG,IAAI,EAAE,CAAA;IACjD,KAAK,MAAM,CAAC,IAAI,MAAM;QAAE,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,EAAE,KAAK,EAAE,CAAC,CAAC,KAAK,EAAE,GAAG,EAAE,CAAC,CAAC,GAAG,EAAE,CAAA;IACvE,IAAI,OAAO,EAAE,CAAC;QACZ,IAAI,GAAG,MAAM,CAAA;QACb,OAAO,IAAI,CAAC,QAAQ,EAAE,OAAO,CAAC,MAAM,CAAC,CAAA;IACvC,CAAC;IACD,IAAI,CAAC,MAAM,CAAC,CAAA;IACZ,OAAO;QACL,MAAM,EAAE,UAAU;QAClB,MAAM,EAAE,MAAM,CAAC,WAAW,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE,EAAE,KAAK,EAAE,CAAC,CAAC,KAAK,EAAE,GAAG,EAAE,CAAC,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC;KACxF,CAAA;AACH,CAAC"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export declare function fingerprint(publicKeyBase64: string): Promise<string>;
|
|
2
|
+
/** A typed fingerprint against a computed one: spaces, dashes and case ignored. */
|
|
3
|
+
export declare function sameFingerprint(typed: string, actual: string): boolean;
|
|
4
|
+
//# sourceMappingURL=fingerprint.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fingerprint.d.ts","sourceRoot":"","sources":["../../src/client/fingerprint.ts"],"names":[],"mappings":"AAUA,wBAAsB,WAAW,CAAC,eAAe,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAK1E;AAED,mFAAmF;AACnF,wBAAgB,eAAe,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,OAAO,CAGtE"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
// A public key's fingerprint, as two people read it out to each other when one
|
|
2
|
+
// confirms a key the other granted (spec 080 item 7a).
|
|
3
|
+
//
|
|
4
|
+
// Byte-identical to Cloud `frontend/src/lib/keyPinning.ts` `fingerprint()`,
|
|
5
|
+
// which the web app shows a member as "Your key fingerprint": the first 20 hex
|
|
6
|
+
// characters of SHA-256 over the raw key, in four groups of five joined by `-`.
|
|
7
|
+
// The shared known-answer vectors are in tests/fingerprint.test.ts.
|
|
8
|
+
import { fromBase64 } from '@veilio-inc/engine';
|
|
9
|
+
export async function fingerprint(publicKeyBase64) {
|
|
10
|
+
const raw = fromBase64(publicKeyBase64);
|
|
11
|
+
const digest = await crypto.subtle.digest('SHA-256', raw);
|
|
12
|
+
const hex = [...new Uint8Array(digest)].map((b) => b.toString(16).padStart(2, '0')).join('');
|
|
13
|
+
return (hex.slice(0, 20).match(/.{5}/g) ?? []).join('-');
|
|
14
|
+
}
|
|
15
|
+
/** A typed fingerprint against a computed one: spaces, dashes and case ignored. */
|
|
16
|
+
export function sameFingerprint(typed, actual) {
|
|
17
|
+
const bare = (s) => s.replace(/[\s-]/g, '').toLowerCase();
|
|
18
|
+
return bare(typed) === bare(actual);
|
|
19
|
+
}
|
|
20
|
+
//# sourceMappingURL=fingerprint.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fingerprint.js","sourceRoot":"","sources":["../../src/client/fingerprint.ts"],"names":[],"mappings":"AAAA,+EAA+E;AAC/E,uDAAuD;AACvD,EAAE;AACF,4EAA4E;AAC5E,+EAA+E;AAC/E,gFAAgF;AAChF,oEAAoE;AAEpE,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAA;AAE/C,MAAM,CAAC,KAAK,UAAU,WAAW,CAAC,eAAuB;IACvD,MAAM,GAAG,GAAG,UAAU,CAAC,eAAe,CAAC,CAAA;IACvC,MAAM,MAAM,GAAG,MAAM,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,SAAS,EAAE,GAA8B,CAAC,CAAA;IACpF,MAAM,GAAG,GAAG,CAAC,GAAG,IAAI,UAAU,CAAC,MAAM,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,QAAQ,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC,CAAA;IAC5F,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,IAAI,EAAE,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAA;AAC1D,CAAC;AAED,mFAAmF;AACnF,MAAM,UAAU,eAAe,CAAC,KAAa,EAAE,MAAc;IAC3D,MAAM,IAAI,GAAG,CAAC,CAAS,EAAE,EAAE,CAAC,CAAC,CAAC,OAAO,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAC,WAAW,EAAE,CAAA;IACjE,OAAO,IAAI,CAAC,KAAK,CAAC,KAAK,IAAI,CAAC,MAAM,CAAC,CAAA;AACrC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"maps.d.ts","sourceRoot":"","sources":["../../src/client/maps.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"maps.d.ts","sourceRoot":"","sources":["../../src/client/maps.ts"],"names":[],"mappings":"AA0EA,OAAO,EAAgB,KAAK,aAAa,EAAE,MAAM,aAAa,CAAA;AAU9D,OAAO,EAKL,KAAK,GAAG,EAET,MAAM,oBAAoB,CAAA;AAC3B,OAAO,EAAiC,KAAK,OAAO,EAAgB,MAAM,cAAc,CAAA;AAExF,MAAM,WAAW,aAAa;IAC5B,kEAAkE;IAClE,IAAI,CAAC,EAAE,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AAE,OAAO,CAAA;CAAE,GAC7C,OAAO,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,CA+K3B;AAwCD;;;;;;;GAOG;AACH,wBAAsB,cAAc,CAClC,GAAG,EAAE,aAAa,EAClB,EAAE,EAAE,MAAM,GAAG,IAAI,EACjB,IAAI,GAAE;IAAE,WAAW,CAAC,EAAE,MAAM,CAAA;CAAO,GAClC,OAAO,CAAC,OAAO,CAAC;IAAE,EAAE,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,GAAG,IAAI,CAAA;CAAE,CAAC,CAAC,CAyCvD"}
|
package/dist/client/maps.js
CHANGED
|
@@ -21,15 +21,15 @@
|
|
|
21
21
|
// agent's tool call and a terminal command behave alike - otherwise, where a
|
|
22
22
|
// person is present to type it (the CLI), the vault passphrase.
|
|
23
23
|
import { decryptMapFromVault, decryptTeamMapWithAny, encryptMapForVault, encryptTeamMap, importTeamKey, isEngineBase, isSaneBlock, parseVaultEnvelope, LOCAL_PREFIX, MAX_PLACEHOLDER_NUMBER, teamBaseOf, } from '@veilio-inc/engine';
|
|
24
|
-
import { servedAs, teamKeyBytes, teamKeyVersion, wireBase } from '../hashed-bases.js';
|
|
24
|
+
import { servedAs, teamKeyBytes, teamKeyUnconfirmed, teamKeyVersion, wireBase, } from '../hashed-bases.js';
|
|
25
25
|
import { CloudError, createMap, deleteMap, getMap, getPersonalMapsKeyWrap, listMaps, listProjects, readReservationsFor, reservePlaceholders, updateMapContent, } from '../cloud.js';
|
|
26
|
-
import { addAliases, drawTag, loadAliases, loadReserved, resetSessionTag, saveReserved, } from '../reservations.js';
|
|
26
|
+
import { addAliases, drawTag, loadAliases, loadReserved, printable, resetSessionTag, saveReserved, } from '../reservations.js';
|
|
27
27
|
import { highestPerBase } from '../team-anonymize.js';
|
|
28
28
|
const NUMBERED = /^(__[A-Z][A-Z0-9_]*__)(\d+)$/;
|
|
29
29
|
import { readCredential } from '../credential.js';
|
|
30
30
|
import { ensureBlocks } from './blocks.js';
|
|
31
31
|
import { loadMap, loadRemote, saveMap } from '../store.js';
|
|
32
|
-
import { readTeamUnlock } from '../team-unlock.js';
|
|
32
|
+
import { readTeamUnlock, writeKeyOf } from '../team-unlock.js';
|
|
33
33
|
import { describeMaps, resolveTeamNamespace, vouchNumbers } from '../team-namespace.js';
|
|
34
34
|
import { importPersonalMapsKey, readPersonalMapsKey, unwrapPersonalMapsKey, } from './personal-maps-key.js';
|
|
35
35
|
import { vaultKeyFor } from './vault-key.js';
|
|
@@ -191,7 +191,18 @@ async function teamKeys(credential, ctx) {
|
|
|
191
191
|
continue;
|
|
192
192
|
}
|
|
193
193
|
}
|
|
194
|
-
return ok({
|
|
194
|
+
return ok({
|
|
195
|
+
teamId: unlock.teamId,
|
|
196
|
+
teamName: printable(unlock.teamName ?? unlock.teamId),
|
|
197
|
+
all,
|
|
198
|
+
// Never an older writable version instead: a write belongs under the
|
|
199
|
+
// newest key, and an older one may be one a removed member still holds.
|
|
200
|
+
newest: writeKeyOf(unlock) ? { version: newestStored.version, key: newest } : null,
|
|
201
|
+
});
|
|
202
|
+
}
|
|
203
|
+
/** The key a team map is sealed under, or the refusal to write at all. */
|
|
204
|
+
function writeKey(keys) {
|
|
205
|
+
return keys.newest ? ok(keys.newest) : refuse('team_key_unconfirmed', { team: keys.teamName });
|
|
195
206
|
}
|
|
196
207
|
async function openTeam(keys, mapData, label) {
|
|
197
208
|
try {
|
|
@@ -481,6 +492,7 @@ published = {}, home) {
|
|
|
481
492
|
const r = await reservePlaceholders(credential, found.teamId, asked, undefined, {
|
|
482
493
|
keys,
|
|
483
494
|
keyVersion: teamKeyVersion(credential, home, found.teamId),
|
|
495
|
+
unconfirmed: teamKeyUnconfirmed(credential, home, found.teamId),
|
|
484
496
|
...(found.reservations ? { reservations: found.reservations } : {}),
|
|
485
497
|
});
|
|
486
498
|
if (r.refused)
|
|
@@ -648,6 +660,9 @@ export async function createCloudMap(ctx, opts) {
|
|
|
648
660
|
const keys = await teamKeys(credential, ctx);
|
|
649
661
|
if (!keys.ok)
|
|
650
662
|
return keys;
|
|
663
|
+
const write = writeKey(keys.value);
|
|
664
|
+
if (!write.ok)
|
|
665
|
+
return write;
|
|
651
666
|
// Keys unlocked for a team this account has since left - or another
|
|
652
667
|
// team entirely - must never seal a map for this one: the team could not
|
|
653
668
|
// read it, and whoever holds that other key could. Checked HERE, at the
|
|
@@ -676,7 +691,7 @@ export async function createCloudMap(ctx, opts) {
|
|
|
676
691
|
return stuck;
|
|
677
692
|
keepRenumbering(opts.mapPath, numbered.value);
|
|
678
693
|
// Nothing above this line has sent a map (only the reservation, if any).
|
|
679
|
-
const envelope = await encryptTeamMap(
|
|
694
|
+
const envelope = await encryptTeamMap(write.value.key, map);
|
|
680
695
|
let created;
|
|
681
696
|
try {
|
|
682
697
|
created = await createMap(credential, {
|
|
@@ -684,7 +699,7 @@ export async function createCloudMap(ctx, opts) {
|
|
|
684
699
|
map_data: JSON.stringify(envelope),
|
|
685
700
|
identifier_count: count,
|
|
686
701
|
scope: 'team',
|
|
687
|
-
key_version:
|
|
702
|
+
key_version: write.value.version,
|
|
688
703
|
});
|
|
689
704
|
}
|
|
690
705
|
catch (err) {
|
|
@@ -821,6 +836,9 @@ export async function updateCloudMap(ctx, id, opts) {
|
|
|
821
836
|
return keys;
|
|
822
837
|
if (list.team?.id !== keys.value.teamId)
|
|
823
838
|
return refuse('team_key_mismatch');
|
|
839
|
+
const write = writeKey(keys.value);
|
|
840
|
+
if (!write.ok)
|
|
841
|
+
return write;
|
|
824
842
|
}
|
|
825
843
|
const team = summary.scope === 'team';
|
|
826
844
|
const label = { id, name: summary.name };
|
|
@@ -836,6 +854,9 @@ export async function updateCloudMap(ctx, id, opts) {
|
|
|
836
854
|
const keys = await teamKeys(credential, ctx);
|
|
837
855
|
if (!keys.ok)
|
|
838
856
|
return keys;
|
|
857
|
+
const write = writeKey(keys.value);
|
|
858
|
+
if (!write.ok)
|
|
859
|
+
return write;
|
|
839
860
|
// The team's maps, read once, with this one among them: its current
|
|
840
861
|
// content comes from the same request as the clash check, not from a
|
|
841
862
|
// second download (spec 052, the staging rate limit).
|
|
@@ -880,8 +901,8 @@ export async function updateCloudMap(ctx, id, opts) {
|
|
|
880
901
|
keepRenumbering(opts.mapPath, numbered.value);
|
|
881
902
|
notes = [...renumberNote(numbered.value.renumbered), ...check.value.notes];
|
|
882
903
|
sealed = {
|
|
883
|
-
map_data: JSON.stringify(await encryptTeamMap(
|
|
884
|
-
key_version:
|
|
904
|
+
map_data: JSON.stringify(await encryptTeamMap(write.value.key, local)),
|
|
905
|
+
key_version: write.value.version,
|
|
885
906
|
};
|
|
886
907
|
}
|
|
887
908
|
else {
|