@did-btcr2/cli 0.16.0 → 0.17.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/dist/.tsbuildinfo +1 -1
- package/dist/cjs/index.js +310 -42
- package/dist/esm/src/commands/init.js +7 -1
- package/dist/esm/src/commands/init.js.map +1 -1
- package/dist/esm/src/commands/keystore.js +107 -8
- package/dist/esm/src/commands/keystore.js.map +1 -1
- package/dist/esm/src/config.js +27 -6
- package/dist/esm/src/config.js.map +1 -1
- package/dist/esm/src/keystore/file-key-store.js +48 -0
- package/dist/esm/src/keystore/file-key-store.js.map +1 -1
- package/dist/esm/src/keystore/passphrase.js +13 -0
- package/dist/esm/src/keystore/passphrase.js.map +1 -1
- package/dist/esm/src/keystore/session.js +250 -0
- package/dist/esm/src/keystore/session.js.map +1 -0
- package/dist/esm/src/paths.js +12 -0
- package/dist/esm/src/paths.js.map +1 -1
- package/dist/esm/src/types.js.map +1 -1
- package/dist/types/src/commands/init.d.ts.map +1 -1
- package/dist/types/src/commands/keystore.d.ts +5 -4
- package/dist/types/src/commands/keystore.d.ts.map +1 -1
- package/dist/types/src/config.d.ts.map +1 -1
- package/dist/types/src/keystore/file-key-store.d.ts +16 -0
- package/dist/types/src/keystore/file-key-store.d.ts.map +1 -1
- package/dist/types/src/keystore/passphrase.d.ts +10 -0
- package/dist/types/src/keystore/passphrase.d.ts.map +1 -1
- package/dist/types/src/keystore/session.d.ts +105 -0
- package/dist/types/src/keystore/session.d.ts.map +1 -0
- package/dist/types/src/paths.d.ts +10 -0
- package/dist/types/src/paths.d.ts.map +1 -1
- package/dist/types/src/types.d.ts +15 -0
- package/dist/types/src/types.d.ts.map +1 -1
- package/package.json +4 -4
- package/src/commands/init.ts +7 -1
- package/src/commands/keystore.ts +143 -9
- package/src/config.ts +28 -6
- package/src/keystore/file-key-store.ts +43 -0
- package/src/keystore/passphrase.ts +23 -0
- package/src/keystore/session.ts +303 -0
- package/src/paths.ts +13 -0
- package/src/types.ts +4 -1
|
@@ -0,0 +1,250 @@
|
|
|
1
|
+
import { closeSync, constants, existsSync, fstatSync, openSync, readdirSync, readFileSync, rmSync } from 'node:fs';
|
|
2
|
+
import { basename, dirname, join, resolve } from 'node:path';
|
|
3
|
+
import { utf8ToBytes } from '@noble/hashes/utils.js';
|
|
4
|
+
import { base64urlnopad } from '@scure/base';
|
|
5
|
+
import { ensureDir, writeFileAtomic } from './atomic.js';
|
|
6
|
+
/**
|
|
7
|
+
* The session unlock agent (ADR 081). `keystore unlock` caches the verified
|
|
8
|
+
* keystore passphrase in a single `<home>/session.json`, and subsequent commands
|
|
9
|
+
* read it in place of a prompt until it expires or `keystore lock` revokes it.
|
|
10
|
+
*
|
|
11
|
+
* This is an on-disk v1 design. The cached passphrase is base64url-*encoded*, not
|
|
12
|
+
* encrypted: its only protection at rest is the file's `0600` mode. That is the
|
|
13
|
+
* deliberate, documented cost of a portable, minimal-diff convenience; a future
|
|
14
|
+
* in-memory agent (v2) that never persists the secret is the real fix. Every read
|
|
15
|
+
* here is defensive and never throws, so a bad or hostile session degrades to a
|
|
16
|
+
* passphrase prompt rather than a crash.
|
|
17
|
+
*/
|
|
18
|
+
/** Current session-file format version. */
|
|
19
|
+
export const SESSION_VERSION = 1;
|
|
20
|
+
/** Default session lifetime: one hour. */
|
|
21
|
+
export const DEFAULT_SESSION_TTL_MS = 60 * 60 * 1000;
|
|
22
|
+
/** Hard cap on a cached-passphrase lifetime: 24 hours. A longer TTL is refused. */
|
|
23
|
+
export const MAX_SESSION_TTL_MS = 24 * 60 * 60 * 1000;
|
|
24
|
+
/** Environment variable supplying a default TTL below the `--ttl` flag. */
|
|
25
|
+
export const ENV_KEYSTORE_TTL = 'BTCR2_KEYSTORE_TTL';
|
|
26
|
+
/**
|
|
27
|
+
* Writes the session file atomically at `0600` (temp sibling + rename), returning
|
|
28
|
+
* the written record so the caller can report expiry without re-reading. The
|
|
29
|
+
* caller is responsible for verifying the passphrase first; this only persists it.
|
|
30
|
+
*/
|
|
31
|
+
export function writeSession(sessionPath, input) {
|
|
32
|
+
const createdAt = Date.now();
|
|
33
|
+
const session = {
|
|
34
|
+
v: SESSION_VERSION,
|
|
35
|
+
keystore: resolve(input.keystorePath),
|
|
36
|
+
verifierId: input.verifierId,
|
|
37
|
+
passphrase: base64urlnopad.encode(utf8ToBytes(input.passphrase)),
|
|
38
|
+
allowMainnet: input.allowMainnet ?? false,
|
|
39
|
+
createdAt,
|
|
40
|
+
expiresAt: createdAt + input.ttlMs,
|
|
41
|
+
ttlSeconds: Math.round(input.ttlMs / 1000),
|
|
42
|
+
};
|
|
43
|
+
ensureDir(dirname(sessionPath), 0o700);
|
|
44
|
+
writeFileAtomic(sessionPath, `${JSON.stringify(session, null, 2)}\n`, 0o600);
|
|
45
|
+
return session;
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* Deletes the session file and any crash-orphaned `writeFileAtomic` temp sibling
|
|
49
|
+
* (each of which would hold a plaintext passphrase). Idempotent; needs no
|
|
50
|
+
* passphrase. Returns whether a session file was present. Unlink is best-effort:
|
|
51
|
+
* it removes the name, it does not securely erase the bytes (see ADR 081).
|
|
52
|
+
*/
|
|
53
|
+
export function clearSession(sessionPath) {
|
|
54
|
+
let existed = false;
|
|
55
|
+
try {
|
|
56
|
+
existed = existsSync(sessionPath);
|
|
57
|
+
if (existed)
|
|
58
|
+
rmSync(sessionPath, { force: true });
|
|
59
|
+
}
|
|
60
|
+
catch {
|
|
61
|
+
// Best effort: a session we cannot remove is reported as not-cleared below.
|
|
62
|
+
existed = false;
|
|
63
|
+
}
|
|
64
|
+
sweepSessionTemps(sessionPath);
|
|
65
|
+
return existed;
|
|
66
|
+
}
|
|
67
|
+
/** Removes `.session.json.<pid>.<n>.tmp` leftovers from an interrupted atomic write. */
|
|
68
|
+
function sweepSessionTemps(sessionPath) {
|
|
69
|
+
const dir = dirname(sessionPath);
|
|
70
|
+
const prefix = `.${basename(sessionPath)}.`;
|
|
71
|
+
try {
|
|
72
|
+
for (const name of readdirSync(dir)) {
|
|
73
|
+
if (name.startsWith(prefix) && name.endsWith('.tmp')) {
|
|
74
|
+
try {
|
|
75
|
+
rmSync(join(dir, name), { force: true });
|
|
76
|
+
}
|
|
77
|
+
catch {
|
|
78
|
+
// A temp file we cannot remove is left for the next sweep.
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
catch {
|
|
84
|
+
// Directory unreadable or absent: nothing to sweep.
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
/**
|
|
88
|
+
* Returns the cached passphrase for `keystorePath` when a live, matching session
|
|
89
|
+
* exists, else `undefined`. Never throws. A session that is expired, stale (the
|
|
90
|
+
* keystore passphrase rotated), future-dated, or malformed is pruned on read; a
|
|
91
|
+
* live session bound to a *different* keystore is left in place (it prompts for
|
|
92
|
+
* the current keystore instead).
|
|
93
|
+
*
|
|
94
|
+
* `isMainnetOperation` gates the one case the network is known at consumption: a
|
|
95
|
+
* live session that was not unlocked with `--allow-mainnet` is withheld from a
|
|
96
|
+
* `bitcoin` operation (returning `undefined` so the caller falls through to a
|
|
97
|
+
* per-use prompt) but *not* pruned, since it remains valid for the non-mainnet
|
|
98
|
+
* operations the operator unlocked for (ADR 081).
|
|
99
|
+
*/
|
|
100
|
+
export function readLiveSessionPassphrase(sessionPath, keystorePath, currentVerifierId, isMainnetOperation = false) {
|
|
101
|
+
const verdict = evaluateSession(sessionPath, keystorePath, currentVerifierId, Date.now());
|
|
102
|
+
if (verdict.status === 'live') {
|
|
103
|
+
// Withhold a session lacking mainnet allowance from a mainnet operation, so
|
|
104
|
+
// signing a `bitcoin` DID still authenticates per use. Leave it in place: it
|
|
105
|
+
// is a valid session, just not for this operation (like a foreign keystore).
|
|
106
|
+
if (isMainnetOperation && !verdict.session.allowMainnet)
|
|
107
|
+
return undefined;
|
|
108
|
+
try {
|
|
109
|
+
return Buffer.from(base64urlnopad.decode(verdict.session.passphrase)).toString('utf-8');
|
|
110
|
+
}
|
|
111
|
+
catch {
|
|
112
|
+
clearSession(sessionPath);
|
|
113
|
+
return undefined;
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
// Prune a session that is dead for everyone or dead for this keystore. A
|
|
117
|
+
// 'foreign' (live, different keystore) or 'none' session is left untouched.
|
|
118
|
+
if (verdict.status === 'expired' || verdict.status === 'stale'
|
|
119
|
+
|| verdict.status === 'future' || verdict.status === 'malformed') {
|
|
120
|
+
clearSession(sessionPath);
|
|
121
|
+
}
|
|
122
|
+
return undefined;
|
|
123
|
+
}
|
|
124
|
+
/**
|
|
125
|
+
* Reports whether a live session exists for `keystorePath` and its remaining
|
|
126
|
+
* lifetime, without decrypting, prompting, throwing, or emitting the passphrase.
|
|
127
|
+
* An expired, foreign, stale, or malformed session reports inactive. Read-only:
|
|
128
|
+
* unlike {@link readLiveSessionPassphrase}, it does not prune.
|
|
129
|
+
*/
|
|
130
|
+
export function readSessionStatus(sessionPath, keystorePath, currentVerifierId) {
|
|
131
|
+
const now = Date.now();
|
|
132
|
+
const verdict = evaluateSession(sessionPath, keystorePath, currentVerifierId, now);
|
|
133
|
+
if (verdict.status !== 'live')
|
|
134
|
+
return { active: false };
|
|
135
|
+
return {
|
|
136
|
+
active: true,
|
|
137
|
+
expiresAt: verdict.session.expiresAt,
|
|
138
|
+
secondsRemaining: Math.max(0, Math.round((verdict.session.expiresAt - now) / 1000)),
|
|
139
|
+
allowMainnet: verdict.session.allowMainnet,
|
|
140
|
+
};
|
|
141
|
+
}
|
|
142
|
+
/**
|
|
143
|
+
* Parses a TTL string into milliseconds: a bare integer is seconds; an `s`, `m`,
|
|
144
|
+
* or `h` suffix scales it. Returns `undefined` for any malformed input. The
|
|
145
|
+
* caller applies the default, the 24h cap, and the `<= 0` rejection.
|
|
146
|
+
*/
|
|
147
|
+
export function parseTtlToMs(raw) {
|
|
148
|
+
const match = /^(\d+)([smh]?)$/.exec(raw.trim());
|
|
149
|
+
if (!match)
|
|
150
|
+
return undefined;
|
|
151
|
+
const n = Number(match[1]);
|
|
152
|
+
if (!Number.isFinite(n))
|
|
153
|
+
return undefined;
|
|
154
|
+
const unitMs = match[2] === 'h' ? 3_600_000 : match[2] === 'm' ? 60_000 : 1_000;
|
|
155
|
+
return n * unitMs;
|
|
156
|
+
}
|
|
157
|
+
/**
|
|
158
|
+
* Classifies the session file: read it securely, then check version, shape,
|
|
159
|
+
* clock, keystore binding, and verifier fingerprint in that order. Ordering
|
|
160
|
+
* `expired` before `foreign` means an expired session is pruned regardless of
|
|
161
|
+
* which keystore it was for. Never throws.
|
|
162
|
+
*/
|
|
163
|
+
function evaluateSession(sessionPath, keystorePath, currentVerifierId, now) {
|
|
164
|
+
const session = secureReadSession(sessionPath);
|
|
165
|
+
if (!session)
|
|
166
|
+
return { status: 'none' };
|
|
167
|
+
if (session.v !== SESSION_VERSION)
|
|
168
|
+
return { status: 'malformed' };
|
|
169
|
+
if (typeof session.passphrase !== 'string' || typeof session.keystore !== 'string'
|
|
170
|
+
|| typeof session.verifierId !== 'string' || typeof session.allowMainnet !== 'boolean'
|
|
171
|
+
|| typeof session.createdAt !== 'number' || typeof session.expiresAt !== 'number') {
|
|
172
|
+
return { status: 'malformed' };
|
|
173
|
+
}
|
|
174
|
+
if (session.createdAt > now)
|
|
175
|
+
return { status: 'future' };
|
|
176
|
+
if (now >= session.expiresAt)
|
|
177
|
+
return { status: 'expired' };
|
|
178
|
+
if (resolve(session.keystore) !== resolve(keystorePath))
|
|
179
|
+
return { status: 'foreign' };
|
|
180
|
+
if (currentVerifierId === undefined || session.verifierId !== currentVerifierId)
|
|
181
|
+
return { status: 'stale' };
|
|
182
|
+
return { status: 'live', session };
|
|
183
|
+
}
|
|
184
|
+
/**
|
|
185
|
+
* Reads and parses the session file with a plaintext secret in mind. On POSIX,
|
|
186
|
+
* opens with `O_NOFOLLOW` (refusing a symlink) and refuses a non-regular file, a
|
|
187
|
+
* file not owned by this user, or one accessible by group or other, best-effort
|
|
188
|
+
* deleting a rejected file and reading only from the opened descriptor (no TOCTOU
|
|
189
|
+
* re-open). On Windows those POSIX guards are skipped (they would throw), so the
|
|
190
|
+
* file is read normally under the same directory ACL the keystore trusts, keeping
|
|
191
|
+
* the session usable rather than silently ignored. Returns `undefined` on any
|
|
192
|
+
* failure; never throws.
|
|
193
|
+
*/
|
|
194
|
+
function secureReadSession(sessionPath) {
|
|
195
|
+
let raw;
|
|
196
|
+
if (process.platform === 'win32') {
|
|
197
|
+
try {
|
|
198
|
+
raw = readFileSync(sessionPath, 'utf-8');
|
|
199
|
+
}
|
|
200
|
+
catch {
|
|
201
|
+
return undefined;
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
else {
|
|
205
|
+
let fd;
|
|
206
|
+
try {
|
|
207
|
+
fd = openSync(sessionPath, constants.O_RDONLY | constants.O_NOFOLLOW);
|
|
208
|
+
}
|
|
209
|
+
catch {
|
|
210
|
+
// ENOENT (no session), ELOOP (symlink refused by O_NOFOLLOW), or any other
|
|
211
|
+
// open failure: no usable session.
|
|
212
|
+
return undefined;
|
|
213
|
+
}
|
|
214
|
+
try {
|
|
215
|
+
const st = fstatSync(fd);
|
|
216
|
+
const myUid = typeof process.getuid === 'function' ? process.getuid() : undefined;
|
|
217
|
+
if (!st.isFile() || (myUid !== undefined && st.uid !== myUid) || (st.mode & 0o077) !== 0) {
|
|
218
|
+
// Not a regular file we own with 0600 perms: it was not written by this
|
|
219
|
+
// process. Best-effort remove it (it may hold a plaintext passphrase) and
|
|
220
|
+
// fall back to a prompt.
|
|
221
|
+
try {
|
|
222
|
+
rmSync(sessionPath, { force: true });
|
|
223
|
+
}
|
|
224
|
+
catch {
|
|
225
|
+
// Cannot remove a file we do not own; ignoring it is enough.
|
|
226
|
+
}
|
|
227
|
+
return undefined;
|
|
228
|
+
}
|
|
229
|
+
raw = readFileSync(fd, 'utf-8');
|
|
230
|
+
}
|
|
231
|
+
catch {
|
|
232
|
+
return undefined;
|
|
233
|
+
}
|
|
234
|
+
finally {
|
|
235
|
+
try {
|
|
236
|
+
closeSync(fd);
|
|
237
|
+
}
|
|
238
|
+
catch {
|
|
239
|
+
// Descriptor already gone; nothing to close.
|
|
240
|
+
}
|
|
241
|
+
}
|
|
242
|
+
}
|
|
243
|
+
try {
|
|
244
|
+
return JSON.parse(raw);
|
|
245
|
+
}
|
|
246
|
+
catch {
|
|
247
|
+
return undefined;
|
|
248
|
+
}
|
|
249
|
+
}
|
|
250
|
+
//# sourceMappingURL=session.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"session.js","sourceRoot":"","sources":["../../../../src/keystore/session.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,UAAU,EAAE,SAAS,EAAE,QAAQ,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AACnH,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAC7D,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AACrD,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAC7C,OAAO,EAAE,SAAS,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAEzD;;;;;;;;;;;GAWG;AAEH,2CAA2C;AAC3C,MAAM,CAAC,MAAM,eAAe,GAAG,CAAU,CAAC;AAE1C,0CAA0C;AAC1C,MAAM,CAAC,MAAM,sBAAsB,GAAG,EAAE,GAAG,EAAE,GAAG,IAAI,CAAC;AACrD,mFAAmF;AACnF,MAAM,CAAC,MAAM,kBAAkB,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,IAAI,CAAC;AACtD,2EAA2E;AAC3E,MAAM,CAAC,MAAM,gBAAgB,GAAG,oBAAoB,CAAC;AAwCrD;;;;GAIG;AACH,MAAM,UAAU,YAAY,CAAC,WAAmB,EAAE,KAAwB;IACxE,MAAM,SAAS,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C;oBACP,6DAA6D;gBAC/D,CAAC;gBACD,OAAO,SAAS,CAAC;YACnB,CAAC;YACD,GAAG,GAAG,YAAY,CAAC,EAAE,EAAE,OAAO,CAAC,CAAC;QAClC,CAAC;QAAC,MAAM,CAAC;YACP,OAAO,SAAS,CAAC;QACnB,CAAC;gBAAS,CAAC;YACT,IAAI,CAAC;gBACH,SAAS,CAAC,EAAE,CAAC,CAAC;YAChB,CAAC;YAAC,MAAM,CAAC;gBACP,6CAA6C;YAC/C,CAAC;QACH,CAAC;IACH,CAAC;IACD,IAAI,CAAC;QACH,OAAO,IAAI,CAAC,KAAK,CAAC,GAAG,CAAgB,CAAC;IACxC,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,SAAS,CAAC;IACnB,CAAC;AACH,CAAC"}
|
package/dist/esm/src/paths.js
CHANGED
|
@@ -6,6 +6,8 @@ export const ENV_HOME = 'BTCR2_HOME';
|
|
|
6
6
|
/** The config and keystore file names, kept side by side under the home root. */
|
|
7
7
|
export const CONFIG_FILENAME = 'config.json';
|
|
8
8
|
export const KEYSTORE_FILENAME = 'keystore.json';
|
|
9
|
+
/** The session file name, holding the unlock agent's cached passphrase (ADR 081). */
|
|
10
|
+
export const SESSION_FILENAME = 'session.json';
|
|
9
11
|
/**
|
|
10
12
|
* Resolves the CLI home directory: the single root that holds `config.json` and
|
|
11
13
|
* `keystore.json` side by side (ADR 079). Resolution order, highest wins:
|
|
@@ -56,4 +58,14 @@ export function defaultConfigPath(overrides) {
|
|
|
56
58
|
export function defaultKeystorePath(overrides) {
|
|
57
59
|
return join(resolveHome(overrides), KEYSTORE_FILENAME);
|
|
58
60
|
}
|
|
61
|
+
/**
|
|
62
|
+
* Session file path: `<home>/session.json`, where the unlock agent caches the
|
|
63
|
+
* keystore passphrase (ADR 081). Deliberately derived from the home root alone,
|
|
64
|
+
* never from `--config` / `--keystore` or the config file, so `keystore lock`
|
|
65
|
+
* can revoke a session even under a malformed config, and so the read and write
|
|
66
|
+
* paths always agree on one location per home.
|
|
67
|
+
*/
|
|
68
|
+
export function defaultSessionPath(overrides) {
|
|
69
|
+
return join(resolveHome(overrides), SESSION_FILENAME);
|
|
70
|
+
}
|
|
59
71
|
//# sourceMappingURL=paths.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"paths.js","sourceRoot":"","sources":["../../../src/paths.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAClC,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAiB1C,gFAAgF;AAChF,MAAM,CAAC,MAAM,QAAQ,GAAG,YAAY,CAAC;AAErC,iFAAiF;AACjF,MAAM,CAAC,MAAM,eAAe,GAAG,aAAa,CAAC;AAC7C,MAAM,CAAC,MAAM,iBAAiB,GAAG,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"paths.js","sourceRoot":"","sources":["../../../src/paths.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAClC,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAiB1C,gFAAgF;AAChF,MAAM,CAAC,MAAM,QAAQ,GAAG,YAAY,CAAC;AAErC,iFAAiF;AACjF,MAAM,CAAC,MAAM,eAAe,GAAG,aAAa,CAAC;AAC7C,MAAM,CAAC,MAAM,iBAAiB,GAAG,eAAe,CAAC;AACjD,qFAAqF;AACrF,MAAM,CAAC,MAAM,gBAAgB,GAAG,cAAc,CAAC;AAE/C;;;;;;;;;;;GAWG;AACH,MAAM,UAAU,WAAW,CAAC,SAAyB;IACnD,OAAO,YAAY,CAAC,SAAS,EAAE,IAAI,CAAC;WAC/B,YAAY,CAAC,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;WACnC,mBAAmB,EAAE,CAAC;AAC7B,CAAC;AAED;;;;;;;;GAQG;AACH,MAAM,UAAU,mBAAmB;IACjC,IAAI,OAAO,CAAC,QAAQ,KAAK,OAAO,EAAE,CAAC;QACjC,MAAM,IAAI,GAAG,YAAY,CAAC,OAAO,CAAC,GAAG,CAAC,YAAY,CAAC;eAC9C,YAAY,CAAC,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC;eACjC,OAAO,EAAE,CAAC;QACf,OAAO,IAAI,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;IAC7B,CAAC;IACD,OAAO,IAAI,CAAC,OAAO,EAAE,EAAE,QAAQ,CAAC,CAAC;AACnC,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,iBAAiB,CAAC,SAAyB;IACzD,OAAO,IAAI,CAAC,WAAW,CAAC,SAAS,CAAC,EAAE,eAAe,CAAC,CAAC;AACvD,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,mBAAmB,CAAC,SAAyB;IAC3D,OAAO,IAAI,CAAC,WAAW,CAAC,SAAS,CAAC,EAAE,iBAAiB,CAAC,CAAC;AACzD,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,kBAAkB,CAAC,SAAyB;IAC1D,OAAO,IAAI,CAAC,WAAW,CAAC,SAAS,CAAC,EAAE,gBAAgB,CAAC,CAAC;AACxD,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/types.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/types.ts"],"names":[],"mappings":"AAkBA,MAAM,CAAC,MAAM,kBAAkB,GAAoB;IACjD,SAAS,EAAE,UAAU,EAAE,UAAU,EAAE,QAAQ,EAAE,WAAW,EAAE,SAAS;CACpE,CAAC;AAEF;;;;;GAKG;AACH,MAAM,UAAU,YAAY,CAAC,KAAyB;IACpD,IAAI,KAAK,KAAK,SAAS;QAAE,OAAO,SAAS,CAAC;IAC1C,OAAO,KAAK,CAAC,IAAI,EAAE,KAAK,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,KAAK,CAAC;AACjD,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"init.d.ts","sourceRoot":"","sources":["../../../../src/commands/init.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"init.d.ts","sourceRoot":"","sources":["../../../../src/commands/init.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AASzC,OAAO,KAAK,EAAiB,aAAa,EAAE,MAAM,aAAa,CAAC;AAEhE;;;;;;;;GAQG;AACH,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,aAAa,GAAG,IAAI,CA2DxF"}
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import type { Command } from 'commander';
|
|
2
|
-
import type
|
|
2
|
+
import { type GlobalOptions } from '../types.js';
|
|
3
3
|
/**
|
|
4
4
|
* Registers the `keystore` command group: establish, inspect, and re-key the
|
|
5
|
-
* encrypted keystore (ADR 080)
|
|
6
|
-
*
|
|
7
|
-
* re-sealing during
|
|
5
|
+
* encrypted keystore (ADR 080), plus the session unlock agent (ADR 081). These
|
|
6
|
+
* operate on the keystore and session files directly (no Bitcoin connection or
|
|
7
|
+
* KeyManager) and never decrypt a key except when re-sealing during
|
|
8
|
+
* `change-passphrase`.
|
|
8
9
|
*/
|
|
9
10
|
export declare function registerKeystoreCommand(program: Command, globals: () => GlobalOptions): void;
|
|
10
11
|
//# sourceMappingURL=keystore.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"keystore.d.ts","sourceRoot":"","sources":["../../../../src/commands/keystore.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"keystore.d.ts","sourceRoot":"","sources":["../../../../src/commands/keystore.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAuBzC,OAAO,EAAoC,KAAK,aAAa,EAAE,MAAM,aAAa,CAAC;AAEnF;;;;;;GAMG;AACH,wBAAgB,uBAAuB,CAAC,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,aAAa,GAAG,IAAI,CA0K5F"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../../src/config.ts"],"names":[],"mappings":"AAAA,OAAO,EAA8E,KAAK,gBAAgB,EAAE,KAAK,SAAS,EAAE,KAAK,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAGrK,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../../src/config.ts"],"names":[],"mappings":"AAAA,OAAO,EAA8E,KAAK,gBAAgB,EAAE,KAAK,SAAS,EAAE,KAAK,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAGrK,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAU1D,OAAO,EAAE,iBAAiB,EAAsB,MAAM,YAAY,CAAC;AACnE,OAAO,EAAoC,KAAK,uBAAuB,EAAE,KAAK,aAAa,EAAE,KAAK,YAAY,EAAE,MAAM,YAAY,CAAC;AAEnI,OAAO,EAAE,iBAAiB,EAAE,CAAC;AAE7B;;;;;;;GAOG;AACH,MAAM,MAAM,mBAAmB,GAAG;IAChC,OAAO,CAAC,EAAU,MAAM,CAAC;IACzB,SAAS,CAAC,EAAQ,MAAM,CAAC;IACzB,UAAU,CAAC,EAAO,MAAM,CAAC;IACzB,UAAU,CAAC,EAAO,MAAM,CAAC;IACzB,mDAAmD;IACnD,UAAU,CAAC,EAAO,MAAM,CAAC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AAmB,GAAG,uBAAuB,CAElG;AAED;;;;;GAKG;AACH,wBAAgB,+BAA+B,CAAC,OAAO,EAAE,aAAa,EAAE,SAAS,CAAC,EAAE,mBAAmB,GAAG,IAAI,CAW7G;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,mBAAmB,CAAC,SAAS,CAAC,EAAE,mBAAmB,EAAE,OAAO,CAAC,EAAE;IAAE,OAAO,CAAC,EAAE,OAAO,CAAA;CAAE,GAAG,MAAM,CAa5G;AAoBD;;;;;GAKG;AACH,wBAAgB,oBAAoB,CAAC,SAAS,CAAC,EAAE,mBAAmB,GAAG,MAAM,GAAG,SAAS,CAExF;AAED;;;;;GAKG;AACH,wBAAgB,kBAAkB,CAAC,OAAO,CAAC,EAAE,aAAa,EAAE,SAAS,CAAC,EAAE,mBAAmB,GAAG,WAAW,CAKxG;AAED;;;;;;;;;GASG;AACH,wBAAgB,aAAa,CAAC,GAAG,EAAE,MAAM,GAAG,aAAa,CAUxD"}
|
|
@@ -115,6 +115,22 @@ export interface KeystoreSummary {
|
|
|
115
115
|
export declare function keystoreSummary(path: string): KeystoreSummary;
|
|
116
116
|
/** The protection label of a keystore file, without decrypting or prompting. */
|
|
117
117
|
export declare function keystoreProtection(path: string): KeystoreProtectionLabel;
|
|
118
|
+
/**
|
|
119
|
+
* A stable fingerprint of a keystore's passphrase verifier, or `undefined` when
|
|
120
|
+
* the file is absent, unparsable, or carries no verifier. Compared by equality
|
|
121
|
+
* to detect a rotated passphrase (`change-passphrase`, `init --force`) or a
|
|
122
|
+
* re-established keystore, so a cached session (ADR 081) stops matching a
|
|
123
|
+
* keystore whose passphrase has changed. Never decrypts, never throws.
|
|
124
|
+
*/
|
|
125
|
+
export declare function keystoreVerifierId(path: string): string | undefined;
|
|
126
|
+
/**
|
|
127
|
+
* Checks a candidate passphrase against the keystore's verifier without
|
|
128
|
+
* constructing a store or opening any key. Returns `false` for an absent,
|
|
129
|
+
* unparsable, dev, or verifier-less keystore and for a wrong passphrase; `true`
|
|
130
|
+
* only when the passphrase opens the verifier sentinel. Never throws. Used by
|
|
131
|
+
* `keystore unlock` (ADR 081) to refuse caching a wrong passphrase.
|
|
132
|
+
*/
|
|
133
|
+
export declare function verifyKeystorePassphrase(path: string, passphrase: string): boolean;
|
|
118
134
|
/** Options for {@link initKeystore}. */
|
|
119
135
|
export interface InitKeystoreOptions {
|
|
120
136
|
protection: KeystoreProtection;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"file-key-store.d.ts","sourceRoot":"","sources":["../../../../src/keystore/file-key-store.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,QAAQ,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;
|
|
1
|
+
{"version":3,"file":"file-key-store.d.ts","sourceRoot":"","sources":["../../../../src/keystore/file-key-store.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,QAAQ,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAIrF,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,aAAa,CAAC;AAG3D,OAAO,KAAK,EAAE,WAAW,EAAkB,MAAM,eAAe,CAAC;AAEjE,OAAO,EAAgB,KAAK,WAAW,EAAE,MAAM,WAAW,CAAC;AAG3D,oDAAoD;AACpD,eAAO,MAAM,gBAAgB,EAAG,CAAU,CAAC;AAE3C;;;;;;GAMG;AACH,MAAM,MAAM,kBAAkB,GAAG,YAAY,GAAG,MAAM,CAAC;AAuDvD,uDAAuD;AACvD,MAAM,MAAM,mBAAmB,GAAG;IAChC,mEAAmE;IACnE,IAAI,CAAC,EAAE,MAAM,CAAC;IACd;;;;;OAKG;IACH,aAAa,EAAE,CAAC,IAAI,CAAC,EAAE;QAAE,OAAO,CAAC,EAAE,OAAO,CAAA;KAAE,KAAK,MAAM,CAAC;IACxD,wGAAwG;IACxG,WAAW,CAAC,EAAE,WAAW,CAAC;IAC1B,2FAA2F;IAC3F,IAAI,CAAC,EA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AI,EAAE,MAAM,GAAG,uBAAuB,CAExE;AAED;;;;;;GAMG;AACH,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAUnE;AAED;;;;;;GAMG;AACH,wBAAgB,wBAAwB,CAAC,IAAI,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,GAAG,OAAO,CAclF;AAED,wCAAwC;AACxC,MAAM,WAAW,mBAAmB;IAClC,UAAU,EAAM,kBAAkB,CAAC;IACnC,aAAa,EAAG,CAAC,IAAI,CAAC,EAAE;QAAE,OAAO,CAAC,EAAE,OAAO,CAAA;KAAE,KAAK,MAAM,CAAC;IACzD,WAAW,CAAC,EAAI,WAAW,CAAC;CAC7B;AAED;;;;;GAKG;AACH,wBAAgB,YAAY,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,mBAAmB,GAAG,IAAI,CAW7E;AAED;;;;;GAKG;AACH,wBAAgB,wBAAwB,CACtC,IAAI,EAAY,MAAM,EACtB,aAAa,EAAG,MAAM,EACtB,aAAa,EAAG,MAAM,EACtB,WAAW,CAAC,EAAI,WAAW,GAC1B,MAAM,CAaR"}
|
|
@@ -15,6 +15,16 @@ export type PassphraseOptions = {
|
|
|
15
15
|
* satisfy the new one (which would make the change a no-op).
|
|
16
16
|
*/
|
|
17
17
|
forcePrompt?: boolean;
|
|
18
|
+
/**
|
|
19
|
+
* An optional non-interactive source consulted *after* the env var and
|
|
20
|
+
* passphrase file and *before* the terminal prompt (and before the "no TTY"
|
|
21
|
+
* failure). The session unlock agent (ADR 081) wires this to a cached
|
|
22
|
+
* passphrase, so a returning command consumes the session instead of
|
|
23
|
+
* prompting, and a non-interactive follow-on command does not hard-fail. It
|
|
24
|
+
* returns `undefined` when no session is available. Skipped when `forcePrompt`
|
|
25
|
+
* is set, and never wired during passphrase establishment (`confirm`).
|
|
26
|
+
*/
|
|
27
|
+
beforePrompt?: () => string | undefined;
|
|
18
28
|
};
|
|
19
29
|
/**
|
|
20
30
|
* Acquires a passphrase without ever reading it from a command-line flag value
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"passphrase.d.ts","sourceRoot":"","sources":["../../../../src/keystore/passphrase.ts"],"names":[],"mappings":"AAGA,qFAAqF;AACrF,eAAO,MAAM,uBAAuB,8BAA8B,CAAC;AAEnE,wDAAwD;AACxD,MAAM,MAAM,iBAAiB,GAAG;IAC9B,wFAAwF;IACxF,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,wCAAwC;IACxC,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,qFAAqF;IACrF,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB;;;;;OAKG;IACH,WAAW,CAAC,EAAE,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"passphrase.d.ts","sourceRoot":"","sources":["../../../../src/keystore/passphrase.ts"],"names":[],"mappings":"AAGA,qFAAqF;AACrF,eAAO,MAAM,uBAAuB,8BAA8B,CAAC;AAEnE,wDAAwD;AACxD,MAAM,MAAM,iBAAiB,GAAG;IAC9B,wFAAwF;IACxF,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,wCAAwC;IACxC,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,qFAAqF;IACrF,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB;;;;;OAKG;IACH,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB;;;;;;;;OAQG;IACH,YAAY,CAAC,EAAE,MAAM,MAAM,GAAG,SAAS,CAAC;CACzC,CAAC;AAEF;;;;;;;GAOG;AACH,wBAAgB,iBAAiB,CAAC,OAAO,GAAE,iBAAsB,GAAG,MAAM,CAwCzE;AAuBD;;;;;GAKG;AACH,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,MAAM,EAAE,GAAG,IAAI,CAGtD"}
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The session unlock agent (ADR 081). `keystore unlock` caches the verified
|
|
3
|
+
* keystore passphrase in a single `<home>/session.json`, and subsequent commands
|
|
4
|
+
* read it in place of a prompt until it expires or `keystore lock` revokes it.
|
|
5
|
+
*
|
|
6
|
+
* This is an on-disk v1 design. The cached passphrase is base64url-*encoded*, not
|
|
7
|
+
* encrypted: its only protection at rest is the file's `0600` mode. That is the
|
|
8
|
+
* deliberate, documented cost of a portable, minimal-diff convenience; a future
|
|
9
|
+
* in-memory agent (v2) that never persists the secret is the real fix. Every read
|
|
10
|
+
* here is defensive and never throws, so a bad or hostile session degrades to a
|
|
11
|
+
* passphrase prompt rather than a crash.
|
|
12
|
+
*/
|
|
13
|
+
/** Current session-file format version. */
|
|
14
|
+
export declare const SESSION_VERSION: 1;
|
|
15
|
+
/** Default session lifetime: one hour. */
|
|
16
|
+
export declare const DEFAULT_SESSION_TTL_MS: number;
|
|
17
|
+
/** Hard cap on a cached-passphrase lifetime: 24 hours. A longer TTL is refused. */
|
|
18
|
+
export declare const MAX_SESSION_TTL_MS: number;
|
|
19
|
+
/** Environment variable supplying a default TTL below the `--ttl` flag. */
|
|
20
|
+
export declare const ENV_KEYSTORE_TTL = "BTCR2_KEYSTORE_TTL";
|
|
21
|
+
/**
|
|
22
|
+
* The on-disk session file. `passphrase` is base64url(utf8(passphrase)): an
|
|
23
|
+
* encoding, not encryption. `keystore` binds the session to one keystore, and
|
|
24
|
+
* `verifierId` (a hash of that keystore's verifier) invalidates the session when
|
|
25
|
+
* the passphrase is rotated. `allowMainnet` records whether the operator unlocked
|
|
26
|
+
* with `--allow-mainnet`; a session without it is withheld from a `bitcoin`
|
|
27
|
+
* operation so mainnet keeps per-use authentication (ADR 081). No derived key,
|
|
28
|
+
* keystore ciphertext, or signing-key bytes ever appear here.
|
|
29
|
+
*/
|
|
30
|
+
export interface SessionFile {
|
|
31
|
+
v: typeof SESSION_VERSION;
|
|
32
|
+
keystore: string;
|
|
33
|
+
verifierId: string;
|
|
34
|
+
passphrase: string;
|
|
35
|
+
allowMainnet: boolean;
|
|
36
|
+
createdAt: number;
|
|
37
|
+
expiresAt: number;
|
|
38
|
+
ttlSeconds: number;
|
|
39
|
+
}
|
|
40
|
+
/** Inputs for {@link writeSession}. */
|
|
41
|
+
export interface WriteSessionInput {
|
|
42
|
+
/** The keystore this session unlocks (stored resolved/normalized). */
|
|
43
|
+
keystorePath: string;
|
|
44
|
+
/** Fingerprint of the keystore verifier, from `keystoreVerifierId`. */
|
|
45
|
+
verifierId: string;
|
|
46
|
+
/** The verified passphrase to cache. */
|
|
47
|
+
passphrase: string;
|
|
48
|
+
/** Lifetime in milliseconds. */
|
|
49
|
+
ttlMs: number;
|
|
50
|
+
/**
|
|
51
|
+
* Whether this session may be consumed for a mainnet (`bitcoin`) operation,
|
|
52
|
+
* from the `unlock --allow-mainnet` flag. Defaults to `false` (deny), so
|
|
53
|
+
* mainnet operations fall through to a per-use passphrase prompt (ADR 081).
|
|
54
|
+
*/
|
|
55
|
+
allowMainnet?: boolean;
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* Writes the session file atomically at `0600` (temp sibling + rename), returning
|
|
59
|
+
* the written record so the caller can report expiry without re-reading. The
|
|
60
|
+
* caller is responsible for verifying the passphrase first; this only persists it.
|
|
61
|
+
*/
|
|
62
|
+
export declare function writeSession(sessionPath: string, input: WriteSessionInput): SessionFile;
|
|
63
|
+
/**
|
|
64
|
+
* Deletes the session file and any crash-orphaned `writeFileAtomic` temp sibling
|
|
65
|
+
* (each of which would hold a plaintext passphrase). Idempotent; needs no
|
|
66
|
+
* passphrase. Returns whether a session file was present. Unlink is best-effort:
|
|
67
|
+
* it removes the name, it does not securely erase the bytes (see ADR 081).
|
|
68
|
+
*/
|
|
69
|
+
export declare function clearSession(sessionPath: string): boolean;
|
|
70
|
+
/**
|
|
71
|
+
* Returns the cached passphrase for `keystorePath` when a live, matching session
|
|
72
|
+
* exists, else `undefined`. Never throws. A session that is expired, stale (the
|
|
73
|
+
* keystore passphrase rotated), future-dated, or malformed is pruned on read; a
|
|
74
|
+
* live session bound to a *different* keystore is left in place (it prompts for
|
|
75
|
+
* the current keystore instead).
|
|
76
|
+
*
|
|
77
|
+
* `isMainnetOperation` gates the one case the network is known at consumption: a
|
|
78
|
+
* live session that was not unlocked with `--allow-mainnet` is withheld from a
|
|
79
|
+
* `bitcoin` operation (returning `undefined` so the caller falls through to a
|
|
80
|
+
* per-use prompt) but *not* pruned, since it remains valid for the non-mainnet
|
|
81
|
+
* operations the operator unlocked for (ADR 081).
|
|
82
|
+
*/
|
|
83
|
+
export declare function readLiveSessionPassphrase(sessionPath: string, keystorePath: string, currentVerifierId: string | undefined, isMainnetOperation?: boolean): string | undefined;
|
|
84
|
+
/** Public, redacted view of the session state for `keystore status`. Never emits the passphrase. */
|
|
85
|
+
export interface SessionStatus {
|
|
86
|
+
active: boolean;
|
|
87
|
+
expiresAt?: number;
|
|
88
|
+
secondsRemaining?: number;
|
|
89
|
+
/** Whether the session may sign a mainnet operation prompt-free (unlocked with `--allow-mainnet`). */
|
|
90
|
+
allowMainnet?: boolean;
|
|
91
|
+
}
|
|
92
|
+
/**
|
|
93
|
+
* Reports whether a live session exists for `keystorePath` and its remaining
|
|
94
|
+
* lifetime, without decrypting, prompting, throwing, or emitting the passphrase.
|
|
95
|
+
* An expired, foreign, stale, or malformed session reports inactive. Read-only:
|
|
96
|
+
* unlike {@link readLiveSessionPassphrase}, it does not prune.
|
|
97
|
+
*/
|
|
98
|
+
export declare function readSessionStatus(sessionPath: string, keystorePath: string, currentVerifierId: string | undefined): SessionStatus;
|
|
99
|
+
/**
|
|
100
|
+
* Parses a TTL string into milliseconds: a bare integer is seconds; an `s`, `m`,
|
|
101
|
+
* or `h` suffix scales it. Returns `undefined` for any malformed input. The
|
|
102
|
+
* caller applies the default, the 24h cap, and the `<= 0` rejection.
|
|
103
|
+
*/
|
|
104
|
+
export declare function parseTtlToMs(raw: string): number | undefined;
|
|
105
|
+
//# sourceMappingURL=session.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"session.d.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AAS,CAqBpB;AAED,oGAAoG;AACpG,MAAM,WAAW,aAAa;IAC5B,MAAM,EAAc,OAAO,CAAC;IAC5B,SAAS,CAAC,EAAU,MAAM,CAAC;IAC3B,gBAAgB,CAAC,EAAG,MAAM,CAAC;IAC3B,sGAAsG;IACtG,YAAY,CAAC,EAAO,OAAO,CAAC;CAC7B;AAED;;;;;GAKG;AACH,wBAAgB,iBAAiB,CAC/B,WAAW,EAAS,MAAM,EAC1B,YAAY,EAAQ,MAAM,EAC1B,iBAAiB,EAAG,MAAM,GAAG,SAAS,GACrC,aAAa,CAUf;AAED;;;;GAIG;AACH,wBAAgB,YAAY,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAO5D"}
|
|
@@ -17,6 +17,8 @@ export declare const ENV_HOME = "BTCR2_HOME";
|
|
|
17
17
|
/** The config and keystore file names, kept side by side under the home root. */
|
|
18
18
|
export declare const CONFIG_FILENAME = "config.json";
|
|
19
19
|
export declare const KEYSTORE_FILENAME = "keystore.json";
|
|
20
|
+
/** The session file name, holding the unlock agent's cached passphrase (ADR 081). */
|
|
21
|
+
export declare const SESSION_FILENAME = "session.json";
|
|
20
22
|
/**
|
|
21
23
|
* Resolves the CLI home directory: the single root that holds `config.json` and
|
|
22
24
|
* `keystore.json` side by side (ADR 079). Resolution order, highest wins:
|
|
@@ -51,4 +53,12 @@ export declare function defaultConfigPath(overrides?: PathOverrides): string;
|
|
|
51
53
|
* function is the final fallback in that chain.
|
|
52
54
|
*/
|
|
53
55
|
export declare function defaultKeystorePath(overrides?: PathOverrides): string;
|
|
56
|
+
/**
|
|
57
|
+
* Session file path: `<home>/session.json`, where the unlock agent caches the
|
|
58
|
+
* keystore passphrase (ADR 081). Deliberately derived from the home root alone,
|
|
59
|
+
* never from `--config` / `--keystore` or the config file, so `keystore lock`
|
|
60
|
+
* can revoke a session even under a malformed config, and so the read and write
|
|
61
|
+
* paths always agree on one location per home.
|
|
62
|
+
*/
|
|
63
|
+
export declare function defaultSessionPath(overrides?: PathOverrides): string;
|
|
54
64
|
//# sourceMappingURL=paths.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"paths.d.ts","sourceRoot":"","sources":["../../../src/paths.ts"],"names":[],"mappings":"AAIA;;;;;GAKG;AACH,MAAM,WAAW,aAAa;IAC5B,0EAA0E;IAC1E,IAAI,CAAC,EAAO,MAAM,CAAC;IACnB,sFAAsF;IACtF,MAAM,CAAC,EAAK,MAAM,CAAC;IACnB,qFAAqF;IACrF,QAAQ,CAAC,EAAG,MAAM,CAAC;CACpB;AAED,gFAAgF;AAChF,eAAO,MAAM,QAAQ,eAAe,CAAC;AAErC,iFAAiF;AACjF,eAAO,MAAM,eAAe,gBAAgB,CAAC;AAC7C,eAAO,MAAM,iBAAiB,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"paths.d.ts","sourceRoot":"","sources":["../../../src/paths.ts"],"names":[],"mappings":"AAIA;;;;;GAKG;AACH,MAAM,WAAW,aAAa;IAC5B,0EAA0E;IAC1E,IAAI,CAAC,EAAO,MAAM,CAAC;IACnB,sFAAsF;IACtF,MAAM,CAAC,EAAK,MAAM,CAAC;IACnB,qFAAqF;IACrF,QAAQ,CAAC,EAAG,MAAM,CAAC;CACpB;AAED,gFAAgF;AAChF,eAAO,MAAM,QAAQ,eAAe,CAAC;AAErC,iFAAiF;AACjF,eAAO,MAAM,eAAe,gBAAgB,CAAC;AAC7C,eAAO,MAAM,iBAAiB,kBAAkB,CAAC;AACjD,qFAAqF;AACrF,eAAO,MAAM,gBAAgB,iBAAiB,CAAC;AAE/C;;;;;;;;;;;GAWG;AACH,wBAAgB,WAAW,CAAC,SAAS,CAAC,EAAE,aAAa,GAAG,MAAM,CAI7D;AAED;;;;;;;;GAQG;AACH,wBAAgB,mBAAmB,IAAI,MAAM,CAQ5C;AAED;;;GAGG;AACH,wBAAgB,iBAAiB,CAAC,SAAS,CAAC,EAAE,aAAa,GAAG,MAAM,CAEnE;AAED;;;;GAIG;AACH,wBAAgB,mBAAmB,CAAC,SAAS,CAAC,EAAE,aAAa,GAAG,MAAM,CAErE;AAED;;;;;;GAMG;AACH,wBAAgB,kBAAkB,CAAC,SAAS,CAAC,EAAE,aAAa,GAAG,MAAM,CAEpE"}
|
|
@@ -4,6 +4,7 @@ import type { Btcr2DidDocument, ResolutionOptions } from '@did-btcr2/method';
|
|
|
4
4
|
import type { DidResolutionResult } from '@web5/dids';
|
|
5
5
|
import type { DoctorReport, EffectiveConfig } from './config.js';
|
|
6
6
|
import type { ConfigIssue } from './config-schema.js';
|
|
7
|
+
import type { SessionStatus } from './keystore/session.js';
|
|
7
8
|
export type NetworkOption = 'bitcoin' | 'testnet3' | 'testnet4' | 'signet' | 'mutinynet' | 'regtest';
|
|
8
9
|
export type OutputFormat = 'json' | 'text';
|
|
9
10
|
/**
|
|
@@ -157,6 +158,7 @@ export type CommandResult = {
|
|
|
157
158
|
established: boolean;
|
|
158
159
|
keyCount: number;
|
|
159
160
|
active: string | undefined;
|
|
161
|
+
session: SessionStatus;
|
|
160
162
|
};
|
|
161
163
|
} | {
|
|
162
164
|
action: 'keystore-change-passphrase';
|
|
@@ -164,6 +166,19 @@ export type CommandResult = {
|
|
|
164
166
|
path: string;
|
|
165
167
|
rekeyed: number;
|
|
166
168
|
};
|
|
169
|
+
} | {
|
|
170
|
+
action: 'keystore-unlock';
|
|
171
|
+
data: {
|
|
172
|
+
keystore: string;
|
|
173
|
+
expiresAt: number;
|
|
174
|
+
ttlSeconds: number;
|
|
175
|
+
};
|
|
176
|
+
} | {
|
|
177
|
+
action: 'keystore-lock';
|
|
178
|
+
data: {
|
|
179
|
+
path: string;
|
|
180
|
+
cleared: boolean;
|
|
181
|
+
};
|
|
167
182
|
} | {
|
|
168
183
|
action: 'profile-add';
|
|
169
184
|
data: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/types.ts"],"names":[],"mappings":"AAAA,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