agent-comms 9.0.11 → 9.0.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.claude-plugin/marketplace.json +1 -1
- package/.claude-plugin/plugin.json +1 -1
- package/README.md +10 -6
- package/dist/account-cli.d.ts.map +1 -1
- package/dist/account-cli.js +4 -1
- package/dist/account-cli.js.map +1 -1
- package/dist/bridges/user/web/dist/mesh-worker.js +4 -4
- package/dist/bridges/user/web/dist/sw.js +1 -1
- package/dist/cli-main.d.ts.map +1 -1
- package/dist/cli-main.js +9 -12
- package/dist/cli-main.js.map +1 -1
- package/dist/core/account-bundle.d.ts +1 -1
- package/dist/core/account-bundle.d.ts.map +1 -1
- package/dist/core/account-bundle.js +26 -19
- package/dist/core/account-bundle.js.map +1 -1
- package/dist/core/account-join.d.ts.map +1 -1
- package/dist/core/account-join.js +5 -2
- package/dist/core/account-join.js.map +1 -1
- package/dist/core/account-ledger-crypto.d.ts.map +1 -1
- package/dist/core/account-ledger-crypto.js +4 -1
- package/dist/core/account-ledger-crypto.js.map +1 -1
- package/dist/core/account-ledger-store.d.ts +3 -1
- package/dist/core/account-ledger-store.d.ts.map +1 -1
- package/dist/core/account-ledger-store.js +6 -3
- package/dist/core/account-ledger-store.js.map +1 -1
- package/dist/core/account-ledger.d.ts +51 -4
- package/dist/core/account-ledger.d.ts.map +1 -1
- package/dist/core/account-ledger.js +102 -15
- package/dist/core/account-ledger.js.map +1 -1
- package/dist/core/bridge-mesh.d.ts.map +1 -1
- package/dist/core/bridge-mesh.js +3 -0
- package/dist/core/bridge-mesh.js.map +1 -1
- package/dist/core/bridge.d.ts.map +1 -1
- package/dist/core/bridge.js +16 -4
- package/dist/core/bridge.js.map +1 -1
- package/dist/core/capability-ask.d.ts.map +1 -1
- package/dist/core/capability-ask.js +10 -2
- package/dist/core/capability-ask.js.map +1 -1
- package/dist/core/connection-code-tool.d.ts +1 -1
- package/dist/core/connection-code-tool.js +2 -2
- package/dist/core/connection-code-tool.js.map +1 -1
- package/dist/core/connection-code.d.ts +5 -5
- package/dist/core/connection-code.d.ts.map +1 -1
- package/dist/core/connection-code.js +22 -6
- package/dist/core/connection-code.js.map +1 -1
- package/dist/core/device-membership.d.ts +8 -3
- package/dist/core/device-membership.d.ts.map +1 -1
- package/dist/core/device-membership.js +4 -4
- package/dist/core/device-membership.js.map +1 -1
- package/dist/core/dm-grant-actions.d.ts.map +1 -1
- package/dist/core/dm-grant-actions.js +7 -1
- package/dist/core/dm-grant-actions.js.map +1 -1
- package/dist/core/error-reporting.d.ts.map +1 -1
- package/dist/core/error-reporting.js +5 -0
- package/dist/core/error-reporting.js.map +1 -1
- package/dist/core/gateway-trust.d.ts +1 -1
- package/dist/core/gateway-trust.d.ts.map +1 -1
- package/dist/core/gateway-trust.js +4 -4
- package/dist/core/gateway-trust.js.map +1 -1
- package/dist/core/group-proofs.d.ts.map +1 -1
- package/dist/core/group-proofs.js +2 -2
- package/dist/core/group-proofs.js.map +1 -1
- package/dist/core/identity-store.d.ts +13 -9
- package/dist/core/identity-store.d.ts.map +1 -1
- package/dist/core/identity-store.js +122 -147
- package/dist/core/identity-store.js.map +1 -1
- package/dist/core/index.d.ts +1 -0
- package/dist/core/index.d.ts.map +1 -1
- package/dist/core/index.js +1 -0
- package/dist/core/index.js.map +1 -1
- package/dist/core/iso-timestamp.d.ts +10 -0
- package/dist/core/iso-timestamp.d.ts.map +1 -0
- package/dist/core/iso-timestamp.js +19 -0
- package/dist/core/iso-timestamp.js.map +1 -0
- package/dist/core/issuer-identity-file.d.ts +15 -0
- package/dist/core/issuer-identity-file.d.ts.map +1 -1
- package/dist/core/issuer-identity-file.js +69 -20
- package/dist/core/issuer-identity-file.js.map +1 -1
- package/dist/core/machine-identity.d.ts +1 -1
- package/dist/core/machine-identity.d.ts.map +1 -1
- package/dist/core/machine-identity.js +14 -11
- package/dist/core/machine-identity.js.map +1 -1
- package/dist/core/mesh-store.d.ts +2 -2
- package/dist/core/mesh-store.d.ts.map +1 -1
- package/dist/core/mesh-store.js.map +1 -1
- package/dist/core/peer-lifecycle.d.ts.map +1 -1
- package/dist/core/peer-lifecycle.js +8 -2
- package/dist/core/peer-lifecycle.js.map +1 -1
- package/dist/core/pid-lock-file.d.ts +27 -4
- package/dist/core/pid-lock-file.d.ts.map +1 -1
- package/dist/core/pid-lock-file.js +120 -11
- package/dist/core/pid-lock-file.js.map +1 -1
- package/dist/core/process-start.d.ts +10 -0
- package/dist/core/process-start.d.ts.map +1 -0
- package/dist/core/process-start.js +43 -0
- package/dist/core/process-start.js.map +1 -0
- package/dist/core/room-lifecycle.d.ts +3 -2
- package/dist/core/room-lifecycle.d.ts.map +1 -1
- package/dist/core/room-lifecycle.js +9 -8
- package/dist/core/room-lifecycle.js.map +1 -1
- package/dist/core/room-protocol.d.ts.map +1 -1
- package/dist/core/room-protocol.js +25 -3
- package/dist/core/room-protocol.js.map +1 -1
- package/dist/core/stale-agent-checker.d.ts.map +1 -1
- package/dist/core/stale-agent-checker.js +3 -1
- package/dist/core/stale-agent-checker.js.map +1 -1
- package/dist/core/store.d.ts +3 -0
- package/dist/core/store.d.ts.map +1 -1
- package/dist/core/store.js +42 -20
- package/dist/core/store.js.map +1 -1
- package/dist/core/tool.d.ts +5 -1
- package/dist/core/tool.d.ts.map +1 -1
- package/dist/core/tool.js +7 -1
- package/dist/core/tool.js.map +1 -1
- package/dist/core/types.d.ts +1 -1
- package/dist/core/types.d.ts.map +1 -1
- package/dist/core/types.js +8 -3
- package/dist/core/types.js.map +1 -1
- package/dist/core/user-identity.d.ts +5 -5
- package/dist/core/user-identity.d.ts.map +1 -1
- package/dist/core/user-identity.js +59 -45
- package/dist/core/user-identity.js.map +1 -1
- package/package.json +1 -1
- package/src/account-cli.ts +4 -1
- package/src/bridges/user/web/dist/mesh-worker.js +4 -4
- package/src/bridges/user/web/dist/sw.js +1 -1
- package/src/cli-main.ts +10 -12
- package/src/core/account-bundle.ts +36 -25
- package/src/core/account-join.ts +5 -2
- package/src/core/account-ledger-crypto.ts +4 -1
- package/src/core/account-ledger-store.ts +11 -3
- package/src/core/account-ledger.ts +142 -20
- package/src/core/bridge-mesh.ts +4 -0
- package/src/core/bridge.ts +24 -4
- package/src/core/capability-ask.ts +16 -1
- package/src/core/connection-code-tool.ts +2 -2
- package/src/core/connection-code.ts +34 -8
- package/src/core/device-membership.ts +12 -8
- package/src/core/dm-grant-actions.ts +7 -1
- package/src/core/error-reporting.ts +5 -0
- package/src/core/gateway-trust.ts +4 -4
- package/src/core/group-proofs.ts +5 -2
- package/src/core/identity-store.ts +182 -191
- package/src/core/index.ts +1 -0
- package/src/core/iso-timestamp.ts +21 -0
- package/src/core/issuer-identity-file.ts +87 -23
- package/src/core/machine-identity.ts +15 -12
- package/src/core/mesh-store.ts +2 -1
- package/src/core/peer-lifecycle.ts +9 -4
- package/src/core/pid-lock-file.ts +139 -11
- package/src/core/process-start.ts +45 -0
- package/src/core/room-lifecycle.ts +12 -9
- package/src/core/room-protocol.ts +23 -3
- package/src/core/stale-agent-checker.ts +3 -1
- package/src/core/store.ts +48 -23
- package/src/core/tool.ts +14 -1
- package/src/core/types.ts +9 -3
- package/src/core/user-identity.ts +65 -51
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* ConnectionCode generation and redemption (agent-comms#188): bootstraps GatewayTrust between two devices that have never established a mesh connection, since GatewayTrust's own deny-by-default, pin-the-key model otherwise requires a device-id to already be known and pasted in by hand (gateway_trust). One artifact, one generation flow, one redemption flow -- never two mechanisms bolted together.
|
|
3
3
|
*
|
|
4
|
-
* `code`/`expiresAt` are the always-checked half: freshness/liveness proof that whoever redeems this was on the other end of this exact exchange, recently. `signature` is the optional half: a detached PGP signature (armored) over `${code}:${expiresAt}:${deviceId}
|
|
4
|
+
* `code`/`expiresAt` are the always-checked half: freshness/liveness proof that whoever redeems this was on the other end of this exact exchange, recently. `expiresAt` must be an ISO 8601 timestamp; a code whose expiry does not parse is refused as invalid. `signature` is the optional half: a detached PGP signature (armored) over `${code}:${expiresAt}:${deviceId}`. An unsigned code is a bearer hint and authenticates nothing about who issued it: redeeming one trusts whatever device-id it names, so a device with no PGP identity can still generate and redeem a bare code, but only where the redeemer has some other reason to believe it. A redeemer who supplies a public key or a fingerprint is asking for the issuer to be authenticated, so the code must then carry a signature that verifies against that key, and a code without one is refused. Verifying needs the signer's own public key, supplied by the caller either as a pasted armored block or (see pgp-keyserver.ts) fetched from a keyserver by fingerprint. A caller who also supplies the fingerprint they already independently trust gets it pinned: the verified key's own computed fingerprint must equal it, or redemption fails.
|
|
5
5
|
*
|
|
6
6
|
* PGP key material is never generated, stored, or managed by this module or by agent-comms generally -- signing and verification both take key material supplied per call by the caller, exactly as invoking `gpg --sign`/`gpg --verify` directly would. Building a persisted PGP-identity subsystem (key generation, passphrase storage, revocation) is a materially larger, security-sensitive scope the settled design (agent-comms#188) never asked for; a caller who wants a code signed brings whatever real-world PGP identity they already have (git-commit signing key, personal key on a keyserver, etc.) rather than trusting agent-comms to mint and hold a new one on their behalf.
|
|
7
7
|
*
|
|
@@ -12,7 +12,7 @@ import type { ConnectionCode } from "./types.js";
|
|
|
12
12
|
/** Default validity window for a generated code absent an explicit ttlMs: long enough for a human to relay it out of band (Slack, a phone call), short enough that "freshness" actually means something. */
|
|
13
13
|
export declare const DEFAULT_CONNECTION_CODE_TTL_MS: number;
|
|
14
14
|
/** Every reason ConnectionCodeLedger.redeem can reject a candidate code. */
|
|
15
|
-
export type ConnectionCodeInvalidReason = "expired" | "already_redeemed" | "signature_required" | "signature_invalid" | "fingerprint_mismatch";
|
|
15
|
+
export type ConnectionCodeInvalidReason = "expired" | "already_redeemed" | "invalid_expiry" | "signature_required" | "signature_missing" | "signature_invalid" | "fingerprint_mismatch";
|
|
16
16
|
/** Thrown by ConnectionCodeLedger.redeem for every rejection reason above -- callers branch on `reason` rather than parsing `message`. */
|
|
17
17
|
export declare class ConnectionCodeError extends Error {
|
|
18
18
|
readonly reason: ConnectionCodeInvalidReason;
|
|
@@ -29,9 +29,9 @@ export interface GenerateConnectionCodeOptions {
|
|
|
29
29
|
now?: number;
|
|
30
30
|
}
|
|
31
31
|
export interface RedeemConnectionCodeOptions {
|
|
32
|
-
/** The signer's own armored PGP public key
|
|
32
|
+
/** The signer's own armored PGP public key. Supplying it asks for the code's issuer to be authenticated: a candidate without a signature is refused with "signature_missing", and one with a signature must verify against this key. */
|
|
33
33
|
publicKeyArmored?: string;
|
|
34
|
-
/** A PGP fingerprint the caller already has independent reason to trust.
|
|
34
|
+
/** A PGP fingerprint the caller already has independent reason to trust. Supplying it asks for the code's issuer to be authenticated: a candidate without a signature is refused with "signature_missing", and the verified signing key's own computed fingerprint must equal it (case- and whitespace-insensitive) or redemption fails with "fingerprint_mismatch". When omitted, a present signature is still verified against publicKeyArmored, but nothing pins it to a fingerprint the caller actually recognises. */
|
|
35
35
|
expectedFingerprint?: string;
|
|
36
36
|
/** Injectable clock for tests; defaults to Date.now(). */
|
|
37
37
|
now?: number;
|
|
@@ -43,7 +43,7 @@ export interface RedeemConnectionCodeResult {
|
|
|
43
43
|
fingerprint?: string;
|
|
44
44
|
}
|
|
45
45
|
/**
|
|
46
|
-
* Generates and redeems ConnectionCode artifacts, enforcing the always-checked freshness/liveness half (expiry, single-use) and the
|
|
46
|
+
* Generates and redeems ConnectionCode artifacts, enforcing the always-checked freshness/liveness half (expiry, single-use) and the PGP-signature half (verified when a code carries a signature, and required whenever the redeemer supplies a key or fingerprint to check it against). Optionally persisted per bridge slot via identity-store.ts's connection-code ledger (see this file's own header comment for what survives a restart and why); constructed with no slot, stays in-memory only, mirroring GatewayTrust's own no-slot fallback.
|
|
47
47
|
*/
|
|
48
48
|
export declare class ConnectionCodeLedger {
|
|
49
49
|
private readonly issued;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"connection-code.d.ts","sourceRoot":"","sources":["../../src/core/connection-code.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAQH,OAAO,K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C,MAAM,CAA2C;IAClE,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAA6B;IACtD,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAqC;gBAE9C,IAAI,CAAC,EAAE,QAAQ,CAAC,YAAY,CAAC;IAazC,2LAA2L;IAC3L,OAAO,CAAC,KAAK;IASb,OAAO,CAAC,OAAO;IASf;;OAEG;IACG,QAAQ,CACZ,QAAQ,EAAE,MAAM,EAChB,OAAO,GAAE,QAAQ,CAAC,6BAA6B,CAAM,GACpD,OAAO,CAAC,cAAc,CAAC;IA6B1B;;OAEG;IACG,MAAM,CACV,SAAS,EAAE,QAAQ,CAAC,cAAc,CAAC,EACnC,OAAO,GAAE,QAAQ,CAAC,2BAA2B,CAAM,GAClD,OAAO,CAAC,0BAA0B,CAAC;CA0EvC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* ConnectionCode generation and redemption (agent-comms#188): bootstraps GatewayTrust between two devices that have never established a mesh connection, since GatewayTrust's own deny-by-default, pin-the-key model otherwise requires a device-id to already be known and pasted in by hand (gateway_trust). One artifact, one generation flow, one redemption flow -- never two mechanisms bolted together.
|
|
3
3
|
*
|
|
4
|
-
* `code`/`expiresAt` are the always-checked half: freshness/liveness proof that whoever redeems this was on the other end of this exact exchange, recently. `signature` is the optional half: a detached PGP signature (armored) over `${code}:${expiresAt}:${deviceId}
|
|
4
|
+
* `code`/`expiresAt` are the always-checked half: freshness/liveness proof that whoever redeems this was on the other end of this exact exchange, recently. `expiresAt` must be an ISO 8601 timestamp; a code whose expiry does not parse is refused as invalid. `signature` is the optional half: a detached PGP signature (armored) over `${code}:${expiresAt}:${deviceId}`. An unsigned code is a bearer hint and authenticates nothing about who issued it: redeeming one trusts whatever device-id it names, so a device with no PGP identity can still generate and redeem a bare code, but only where the redeemer has some other reason to believe it. A redeemer who supplies a public key or a fingerprint is asking for the issuer to be authenticated, so the code must then carry a signature that verifies against that key, and a code without one is refused. Verifying needs the signer's own public key, supplied by the caller either as a pasted armored block or (see pgp-keyserver.ts) fetched from a keyserver by fingerprint. A caller who also supplies the fingerprint they already independently trust gets it pinned: the verified key's own computed fingerprint must equal it, or redemption fails.
|
|
5
5
|
*
|
|
6
6
|
* PGP key material is never generated, stored, or managed by this module or by agent-comms generally -- signing and verification both take key material supplied per call by the caller, exactly as invoking `gpg --sign`/`gpg --verify` directly would. Building a persisted PGP-identity subsystem (key generation, passphrase storage, revocation) is a materially larger, security-sensitive scope the settled design (agent-comms#188) never asked for; a caller who wants a code signed brings whatever real-world PGP identity they already have (git-commit signing key, personal key on a keyserver, etc.) rather than trusting agent-comms to mint and hold a new one on their behalf.
|
|
7
7
|
*
|
|
@@ -10,6 +10,7 @@
|
|
|
10
10
|
import * as openpgp from "openpgp";
|
|
11
11
|
import { nanoid } from "./nanoid.js";
|
|
12
12
|
import { loadConnectionCodeLedger, saveConnectionCodeLedger, } from "./identity-store.js";
|
|
13
|
+
import { parseIsoTimestampMs } from "./iso-timestamp.js";
|
|
13
14
|
/** Nonce length: longer than nanoid's own 21-character default, since this identifier doubles as the single-use token a redemption check keys off, not merely a display id. */
|
|
14
15
|
const CONNECTION_CODE_NONCE_LENGTH = 32;
|
|
15
16
|
/** Minutes a generated code stays valid absent an explicit ttlMs override. */
|
|
@@ -81,8 +82,13 @@ async function verifyConnectionCodeSignature(message, signatureArmored, publicKe
|
|
|
81
82
|
function normalizeFingerprint(fingerprint) {
|
|
82
83
|
return fingerprint.replace(/[\s:]+/g, "").toLowerCase();
|
|
83
84
|
}
|
|
85
|
+
/** Whether an expiry given as text has passed at `now`. An expiry that does not parse counts as passed: it can never be compared against the clock, so nothing may rely on it staying valid. */
|
|
86
|
+
function hasExpired(expiresAt, now) {
|
|
87
|
+
const expiresAtMs = parseIsoTimestampMs(expiresAt);
|
|
88
|
+
return expiresAtMs === undefined || expiresAtMs <= now;
|
|
89
|
+
}
|
|
84
90
|
/**
|
|
85
|
-
* Generates and redeems ConnectionCode artifacts, enforcing the always-checked freshness/liveness half (expiry, single-use) and the
|
|
91
|
+
* Generates and redeems ConnectionCode artifacts, enforcing the always-checked freshness/liveness half (expiry, single-use) and the PGP-signature half (verified when a code carries a signature, and required whenever the redeemer supplies a key or fingerprint to check it against). Optionally persisted per bridge slot via identity-store.ts's connection-code ledger (see this file's own header comment for what survives a restart and why); constructed with no slot, stays in-memory only, mirroring GatewayTrust's own no-slot fallback.
|
|
86
92
|
*/
|
|
87
93
|
export class ConnectionCodeLedger {
|
|
88
94
|
issued = new Map();
|
|
@@ -103,11 +109,11 @@ export class ConnectionCodeLedger {
|
|
|
103
109
|
/** Drops every issued or redeemed entry whose own expiresAt has already passed, so neither map accumulates forever across a long-running process or a slot that survives many restarts. */
|
|
104
110
|
prune(now) {
|
|
105
111
|
for (const [nonce, record] of this.issued) {
|
|
106
|
-
if (
|
|
112
|
+
if (hasExpired(record.expiresAt, now))
|
|
107
113
|
this.issued.delete(nonce);
|
|
108
114
|
}
|
|
109
115
|
for (const [nonce, expiresAt] of this.redeemed) {
|
|
110
|
-
if (
|
|
116
|
+
if (hasExpired(expiresAt, now))
|
|
111
117
|
this.redeemed.delete(nonce);
|
|
112
118
|
}
|
|
113
119
|
}
|
|
@@ -146,14 +152,24 @@ export class ConnectionCodeLedger {
|
|
|
146
152
|
async redeem(candidate, options = {}) {
|
|
147
153
|
const now = options.now ?? Date.now();
|
|
148
154
|
this.prune(now);
|
|
149
|
-
if (
|
|
155
|
+
if (parseIsoTimestampMs(candidate.expiresAt) === undefined) {
|
|
156
|
+
throw new ConnectionCodeError("invalid_expiry", "Connection code expiry is not an ISO 8601 timestamp");
|
|
157
|
+
}
|
|
158
|
+
if (hasExpired(candidate.expiresAt, now)) {
|
|
150
159
|
throw new ConnectionCodeError("expired", `Connection code expired at ${candidate.expiresAt}`);
|
|
151
160
|
}
|
|
152
161
|
if (this.redeemed.has(candidate.code)) {
|
|
153
162
|
throw new ConnectionCodeError("already_redeemed", "Connection code has already been redeemed");
|
|
154
163
|
}
|
|
155
164
|
let fingerprint;
|
|
156
|
-
if (candidate.signature
|
|
165
|
+
if (candidate.signature === undefined) {
|
|
166
|
+
// The caller supplied something to check the issuer against, and an unsigned code has no issuer to check: accepting it as "freshness only" would pass the pin on nothing.
|
|
167
|
+
if (options.publicKeyArmored !== undefined ||
|
|
168
|
+
options.expectedFingerprint !== undefined) {
|
|
169
|
+
throw new ConnectionCodeError("signature_missing", "A public key or fingerprint was supplied to check the issuer against, but this connection code is not signed");
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
else {
|
|
157
173
|
if (options.publicKeyArmored === undefined) {
|
|
158
174
|
throw new ConnectionCodeError("signature_required", "Connection code carries a signature but no public key was supplied to verify it against");
|
|
159
175
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"connection-code.js","sourceRoot":"","sources":["../../src/core/connection-code.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,OAAO,MAAM,SAAS,CAAC;AACnC,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AACrC,OAAO,EACL,wBAAwB,EACxB,wBAAwB,GACzB,MAAM,qBAAqB,CAAC;
|
|
1
|
+
{"version":3,"file":"connection-code.js","sourceRoot":"","sources":["../../src/core/connection-code.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,OAAO,MAAM,SAAS,CAAC;AACnC,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AACrC,OAAO,EACL,wBAAwB,EACxB,wBAAwB,GACzB,MAAM,qBAAqB,CAAC;AAE7B,OAAO,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AAGzD,+KAA+K;AAC/K,MAAM,4BAA4B,GAAG,EAAE,CAAC;AAExC,8EAA8E;AAC9E,MAAM,mCAAmC,GAAG,EAAE,CAAC;AAC/C,+FAA+F;AAC/F,MAAM,kBAAkB,GAAG,EAAE,CAAC;AAC9B,oGAAoG;AACpG,M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deviceId's own group:member grant from the user principal: a root-level, non-delegable token scoped to the principal's own group (groupPath). On success, records the grant's token-id in the account's replicated ledger so a later removeDevice, on this machine or any other holding the account key, can find it to revoke. An admission without that record would leave removal permanently unable to find what to revoke, so it is what makes revocation possible at all.
|
|
36
36
|
*/
|
|
37
37
|
export declare function admitDevice(options: Readonly<AdmitDeviceOptions>): Promise<MintVerdict>;
|
|
38
|
+
/** What removeDevice did: the revocation entries it minted, to broadcast, and how many ledger entries could not be read. When `unreadable` is above zero the removal is incomplete: a grant recorded only in an unreadable entry was not revoked, so a caller must not report the device as removed. */
|
|
39
|
+
export interface RemoveDeviceResult {
|
|
40
|
+
entries: RevocationEntry[];
|
|
41
|
+
unreadable: number;
|
|
42
|
+
}
|
|
38
43
|
export interface RemoveDeviceOptions {
|
|
39
44
|
/** The user principal's own identity -- only the principal that issued a device's membership may revoke it. */
|
|
40
45
|
userIdentity: IdentityPort;
|
|
@@ -45,9 +50,9 @@ export interface RemoveDeviceOptions {
|
|
|
45
50
|
deviceId: DeviceId;
|
|
46
51
|
}
|
|
47
52
|
/**
|
|
48
|
-
* Revokes every group:member grant for deviceId that the account's ledger holds as outstanding, whichever machine of the account minted it: mints a revocation-entry for each token-id, records it in the given RevocationView immediately, and appends it to the ledger, so every other machine of the account sees the grant as revoked and a later re-admission starts from nothing outstanding. Returns no entries for a device the account never admitted.
|
|
53
|
+
* Revokes every group:member grant for deviceId that the account's ledger holds as outstanding, whichever machine of the account minted it: mints a revocation-entry for each token-id, records it in the given RevocationView immediately, and appends it to the ledger, so every other machine of the account sees the grant as revoked and a later re-admission starts from nothing outstanding. Returns no entries for a device the account never admitted. A ledger entry that cannot be read does not stop the removal (account-ledger.ts): every grant the readable entries record is still revoked, and one recorded only in an unreadable entry is not, which the result says.
|
|
49
54
|
*
|
|
50
|
-
* Returns the minted entries so the caller can broadcast them to the mesh (this module has no MeshTransport dependency to do so itself, mirroring the module-level "no assumption about locality" boundary documented above): every other device that might hold one of this device's grants needs the entry to independently start refusing it.
|
|
55
|
+
* Returns the minted entries, and the number of unreadable ledger entries met, so the caller can broadcast them to the mesh (this module has no MeshTransport dependency to do so itself, mirroring the module-level "no assumption about locality" boundary documented above): every other device that might hold one of this device's grants needs the entry to independently start refusing it.
|
|
51
56
|
*/
|
|
52
|
-
export declare function removeDevice(options: Readonly<RemoveDeviceOptions>): Promise<
|
|
57
|
+
export declare function removeDevice(options: Readonly<RemoveDeviceOptions>): Promise<RemoveDeviceResult>;
|
|
53
58
|
//# sourceMappingURL=device-membership.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"device-membership.d.ts","sourceRoot":"","sources":["../../src/core/device-membership.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAGL,KAAK,WAAW,EACjB,MAAM,8BAA8B,CAAC;AAEtC,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,uCAAuC,CAAC;AAC5E,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAC;AAClE,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,4BAA4B,CAAC;AACxD,OAAO,KAAK,EACV,QAAQ,EACR,eAAe,EAChB,MAAM,mCAAmC,CAAC;AAK3C,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAKzD,MAAM,WAAW,kBAAkB;IACjC,uEAAuE;IACvE,YAAY,EAAE,YAAY,CAAC;IAC3B,+HAA+H;IAC/H,aAAa,EAAE,aAAa,CAAC;IAC7B,KAAK,EAAE,KAAK,CAAC;IACb,OAAO,EAAE,UAAU,CAAC,WAAW,CAAC,CAAC;IACjC,iCAAiC;IACjC,QAAQ,EAAE,QAAQ,CAAC;IACnB,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,0BAA0B;IACzC,iLAAiL;IACjL,MAAM,EAAE,YAAY,CAAC;IACrB,KAAK,EAAE,KAAK,CAAC;IACb,OAAO,EAAE,UAAU,CAAC,WAAW,CAAC,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AAC;IACb,OAAO,EAAE,UAAU,CAAC,WAAW,CAAC,CAAC;IACjC,iCAAiC;IACjC,QAAQ,EAAE,QAAQ,CAAC;IACnB,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,0BAA0B;IACzC,iLAAiL;IACjL,MAAM,EAAE,YAAY,CAAC;IACrB,KAAK,EAAE,KAAK,CAAC;IACb,OAAO,EAAE,UAAU,CAAC,WAAW,CAAC,CAAC;IACjC,qDAAqD;IACrD,QAAQ,EAAE,QAAQ,CAAC;IACnB,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,icAAic;AACjc,wBAAsB,mBAAmB,CACvC,OAAO,EAAE,QAAQ,CAAC,0BAA0B,CAAC,GAC5C,OAAO,CAAC,WAAW,CAAC,CActB;AAED;;GAEG;AACH,wBAAsB,WAAW,CAC/B,OAAO,EAAE,QAAQ,CAAC,kBAAkB,CAAC,GACpC,OAAO,CAAC,WAAW,CAAC,CAatB;AAED,wSAAwS;AACxS,MAAM,WAAW,kBAAkB;IACjC,OAAO,EAAE,eAAe,EAAE,CAAC;IAC3B,UAAU,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,mBAAmB;IAClC,+GAA+G;IAC/G,YAAY,EAAE,YAAY,CAAC;IAC3B,aAAa,EAAE,aAAa,CAAC;IAC7B,KAAK,EAAE,KAAK,CAAC;IACb,oNAAoN;IACpN,UAAU,EAAE,cAAc,CAAC;IAC3B,QAAQ,EAAE,QAAQ,CAAC;CACpB;AAED;;;;GAIG;AACH,wBAAsB,YAAY,CAChC,OAAO,EAAE,QAAQ,CAAC,mBAAmB,CAAC,GACrC,OAAO,CAAC,kBAAkB,CAAC,CAqB7B"}
|
|
@@ -38,13 +38,13 @@ export async function admitDevice(options) {
|
|
|
38
38
|
return verdict;
|
|
39
39
|
}
|
|
40
40
|
/**
|
|
41
|
-
* Revokes every group:member grant for deviceId that the account's ledger holds as outstanding, whichever machine of the account minted it: mints a revocation-entry for each token-id, records it in the given RevocationView immediately, and appends it to the ledger, so every other machine of the account sees the grant as revoked and a later re-admission starts from nothing outstanding. Returns no entries for a device the account never admitted.
|
|
41
|
+
* Revokes every group:member grant for deviceId that the account's ledger holds as outstanding, whichever machine of the account minted it: mints a revocation-entry for each token-id, records it in the given RevocationView immediately, and appends it to the ledger, so every other machine of the account sees the grant as revoked and a later re-admission starts from nothing outstanding. Returns no entries for a device the account never admitted. A ledger entry that cannot be read does not stop the removal (account-ledger.ts): every grant the readable entries record is still revoked, and one recorded only in an unreadable entry is not, which the result says.
|
|
42
42
|
*
|
|
43
|
-
* Returns the minted entries so the caller can broadcast them to the mesh (this module has no MeshTransport dependency to do so itself, mirroring the module-level "no assumption about locality" boundary documented above): every other device that might hold one of this device's grants needs the entry to independently start refusing it.
|
|
43
|
+
* Returns the minted entries, and the number of unreadable ledger entries met, so the caller can broadcast them to the mesh (this module has no MeshTransport dependency to do so itself, mirroring the module-level "no assumption about locality" boundary documented above): every other device that might hold one of this device's grants needs the entry to independently start refusing it.
|
|
44
44
|
*/
|
|
45
45
|
export async function removeDevice(options) {
|
|
46
46
|
const deviceHex = deviceIdToHex(options.deviceId);
|
|
47
|
-
const outstanding = await options.accountLedger.
|
|
47
|
+
const { grants: outstanding, unreadable } = await options.accountLedger.outstandingGrantsChecked("device", deviceHex);
|
|
48
48
|
const entries = [];
|
|
49
49
|
for (const { tokenId } of outstanding) {
|
|
50
50
|
const entry = await mintRevocationEntry({
|
|
@@ -56,6 +56,6 @@ export async function removeDevice(options) {
|
|
|
56
56
|
await options.accountLedger.recordRevocation("device", deviceHex, tokenId, entry);
|
|
57
57
|
entries.push(entry);
|
|
58
58
|
}
|
|
59
|
-
return entries;
|
|
59
|
+
return { entries, unreadable };
|
|
60
60
|
}
|
|
61
61
|
//# sourceMappingURL=device-membership.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"device-membership.js","sourceRoot":"","sources":["../../src/core/device-membership.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EACL,mBAAmB,EACnB,mBAAmB,GAEpB,MAAM,8BAA8B,CAAC;AACtC,OAAO,EAAE,aAAa,EAAE,MAAM,iCAAiC,CAAC;AAQhE,OAAO,EACL,wBAAwB,EACxB,SAAS,GACV,MAAM,qCAAqC,CAAC;AAG7C,0YAA0Y;AAC1Y,MAAM,aAAa,GAAG,CAAC,CAAC;AAwBxB,icAAic;AACjc,MAAM,CAAC,KAAK,UAAU,mBAAmB,CACvC,OAA6C;IAE7C,OAAO,mBAAmB,CAAC;QACzB,QAAQ,EAAE,OAAO,CAAC,MAAM;QACxB,KAAK,EAAE,OAAO,CAAC,KAAK;QACpB,OAAO,EAAE,OAAO,CAAC,OAAO;QACxB,MAAM,EAAE,OAAO,CAAC,QAAQ;QACxB,UAAU,EAAE,wBAAwB;QACpC,KAAK,EAAE;YACL,IAAI,EAAE,OAAO;YACb,IAAI,EAAE,SAAS,CAAC,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC;SACzC;QACD,OAAO,EAAE,OAAO,CAAC,OAAO;QACxB,oBAAoB,EAAE,aAAa;KACpC,CAAC,CAAC;AACL,CAAC;AAED;;GAEG;AACH,MAAM,CAAC,KAAK,UAAU,WAAW,CAC/B,OAAqC;IAErC,MAAM,OAAO,GAAG,MAAM,mBAAmB,CAAC;QACxC,GAAG,OAAO;QACV,MAAM,EAAE,OAAO,CAAC,YAAY;KAC7B,CAAC,CAAC;IACH,IAAI,CAAC,OAAO,CAAC,EAAE;QAAE,OAAO,OAAO,CAAC;IAEhC,MAAM,OAAO,CAAC,aAAa,CAAC,WAAW,CACrC,QAAQ,EACR,aAAa,CAAC,OAAO,CAAC,QAAQ,CAAC,EAC/B,OAAO,CAAC,OAAO,CAChB,CAAC;IACF,OAAO,OAAO,CAAC;AACjB,CAAC;
|
|
1
|
+
{"version":3,"file":"device-membership.js","sourceRoot":"","sources":["../../src/core/device-membership.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EACL,mBA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AAE,qBAAqB,CAAC,CAAC,EAC9D,MAAM,EAAE,WAAW,GAAG;IAAE,MAAM,EAAE,WAAW,CAAA;CAAE,GAC5C,OAAO,CAAC,WAAW,CAAC,CAatB"}
|
|
@@ -45,7 +45,13 @@ export async function dmUseGrant(store, action) {
|
|
|
45
45
|
export async function dmRevoke(store, action) {
|
|
46
46
|
if (!store.revokeAgentDmAccess)
|
|
47
47
|
return grantsUnavailable();
|
|
48
|
-
await store.revokeAgentDmAccess(action.target);
|
|
48
|
+
const { unreadable } = await store.revokeAgentDmAccess(action.target);
|
|
49
|
+
if (unreadable > 0) {
|
|
50
|
+
return {
|
|
51
|
+
content: `Revoked every DM grant for ${action.target} that the readable ledger entries record, but ${String(unreadable)} ledger entries cannot be read, so a grant recorded only in them is still valid. Repair or replace them from another machine's replica of the account, then revoke again.`,
|
|
52
|
+
isError: true,
|
|
53
|
+
};
|
|
54
|
+
}
|
|
49
55
|
return {
|
|
50
56
|
content: `Revoked ${action.target}'s DM grant.`,
|
|
51
57
|
isError: false,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dm-grant-actions.js","sourceRoot":"","sources":["../../src/core/dm-grant-actions.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAIH,OAAO,EAAE,eAAe,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAEnE,oHAAoH;AACpH,SAAS,iBAAiB;IACxB,OAAO;QACL,OAAO,EAAE,4CAA4C;QACrD,OAAO,EAAE,IAAI;KACd,CAAC;AACJ,CAAC;AAED,4HAA4H;AAC5H,MAAM,0BAA0B,GAAG,CAAC,CAAC;AAErC,wQAAwQ;AACxQ,MAAM,CAAC,KAAK,UAAU,OAAO,CAC3B,KAA0D,EAC1D,MAA4C,EAC5C,UAAkB;IAElB,IAAI,CAAC,KAAK,CAAC,eAAe;QAAE,OAAO,iBAAiB,EAAE,CAAC;IACvD,MAAM,KAAK,GAAG,MAAM,KAAK,CAAC,eAAe,CACvC,MAAM,CAA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AE,KAAK;KACf,CAAC;AACJ,CAAC;AAED,8EAA8E;AAC9E,MAAM,CAAC,KAAK,UAAU,QAAQ,CAC5B,KAA8D,EAC9D,MAA6C;IAE7C,IAAI,CAAC,KAAK,CAAC,mBAAmB;QAAE,OAAO,iBAAiB,EAAE,CAAC;IAC3D,MAAM,EAAE,UAAU,EAAE,GAAG,MAAM,KAAK,CAAC,mBAAmB,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;IACtE,IAAI,UAAU,GAAG,CAAC,EAAE,CAAC;QACnB,OAAO;YACL,OAAO,EAAE,8BAA8B,MAAM,CAAC,MAAM,iDAAiD,MAAM,CAAC,UAAU,CAAC,2KAA2K;YAClS,OAAO,EAAE,IAAI;SACd,CAAC;IACJ,CAAC;IACD,OAAO;QACL,OAAO,EAAE,WAAW,MAAM,CAAC,MAAM,cAAc;QAC/C,OAAO,EAAE,KAAK;KACf,CAAC;AACJ,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"error-reporting.d.ts","sourceRoot":"","sources":["../../src/core/error-reporting.ts"],"names":[],"mappings":"AAAA;;GAEG;
|
|
1
|
+
{"version":3,"file":"error-reporting.d.ts","sourceRoot":"","sources":["../../src/core/error-reporting.ts"],"names":[],"mappings":"AAAA;;GAEG;AAmBH,iNAAiN;AACjN,MAAM,WAAW,kBAAkB;IACjC,GAAG,EAAE,MAAM,CAAC;IACZ,OAAO,EAAE,MAAM,CAAC;CACjB;AAyBD,mLAAmL;AACnL,wBAAgB,iBAAiB,CAC/B,KAAK,EAAE,QAAQ,CAAC,KAAK,CAAC,GACrB,kBAAkB,GAAG,SAAS,CAchC;AAED,mDAAmD;AACnD,wBAAgB,eAAe,CAAC,KAAK,EAAE,QAAQ,CAAC,KAAK,CAAC,GAAG,MAAM,CAE9D;AAED,0jBAA0jB;AAC1jB,wBAAgB,uBAAuB,CACrC,KAAK,GAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAExB,GACA,CAAC,KAAK,EAAE,KAAK,KAAK,IAAI,CAUxB"}
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
* Default sink for a mesh store's error channel. MeshStore.onError carries every failure the mesh handles internally (a hub dial that was refused, a gossip send that failed, a default-front session that could not attach), and nothing shows them unless a bridge assigns a handler, so a bridge without a UI of its own routes them to stderr.
|
|
3
3
|
*/
|
|
4
4
|
import { shortId } from "./display-name.js";
|
|
5
|
+
import { UnusableIdentityRecordError } from "./issuer-identity-file.js";
|
|
5
6
|
import { errnoCode, PeerLinkError } from "./peer-link-error.js";
|
|
6
7
|
/** The causes of a refused or dropped connection to a peer, which all mean the process behind that address has gone. */
|
|
7
8
|
const PEER_GONE_CODES = new Set([
|
|
@@ -38,6 +39,10 @@ function describePeerLinkError(error) {
|
|
|
38
39
|
export function describeMeshError(error) {
|
|
39
40
|
if (error instanceof PeerLinkError)
|
|
40
41
|
return describePeerLinkError(error);
|
|
42
|
+
// Already says what happened and what to do. Keyed by file, since the cc-peer front tries to attach a session on every tick and each try meets the same file.
|
|
43
|
+
if (error instanceof UnusableIdentityRecordError) {
|
|
44
|
+
return { key: `identity-unusable:${error.file}`, message: error.message };
|
|
45
|
+
}
|
|
41
46
|
const code = errnoCode(error);
|
|
42
47
|
if (code !== undefined && NO_NETWORK_CODES.has(code)) {
|
|
43
48
|
return {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"error-reporting.js","sourceRoot":"","sources":["../../src/core/error-reporting.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAC5C,OAAO,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAEhE,wHAAwH;AACxH,MAAM,eAAe,GAAwB,IAAI,GAAG,CAAC;IACnD,cAAc;IACd,YAAY;CACb,CAAC,CAAC;AAEH,sFAAsF;AACtF,MAAM,gBAAgB,GAAwB,IAAI,GAAG,CAAC;IACpD,aAAa;IACb,cAAc;I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G,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC;QAC9B,CAAC;QACD,KAAK,CAAC,eAAe,CAAC,KAAK,CAAC,CAAC,CAAC;IAChC,CAAC,CAAC;AACJ,CAAC"}
|
|
@@ -48,7 +48,7 @@ export declare class GatewayTrust {
|
|
|
48
48
|
private readonly clock;
|
|
49
49
|
/** Constructs the trust boundary, optionally bound to an identity location for persistence (agent-comms#186); any IdentitySlot serves as one, since only its directory matters. See this class's own doc comment for what a location does and doesn't change. Given a location, immediately loads whatever devices and principals are already trusted into the in-memory sets. */
|
|
50
50
|
constructor(options?: Readonly<GatewayTrustOptions>);
|
|
51
|
-
/** Replaces the in-memory sets with whatever the file currently holds, recording the file's stamp. A no-op without a location. Verified members are left alone: they are in memory only and are dropped on their own when their principal stops being trusted. */
|
|
51
|
+
/** Replaces the in-memory sets with whatever the file currently holds, recording the file's stamp. Identifiers are kept in lower case whatever case the file holds them in, so every lookup and removal, which lower-cases its argument, finds them. A no-op without a location. Verified members are left alone: they are in memory only and are dropped on their own when their principal stops being trusted. */
|
|
52
52
|
private load;
|
|
53
53
|
/** Reloads from disk when another process has replaced the file since this instance last looked, looking at most once per TRUST_FILE_RECHECK_INTERVAL_MS. Called first by every method that only reads the sets, so a trust decision is never older than the file by more than that bound. */
|
|
54
54
|
private refresh;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"gateway-trust.d.ts","sourceRoot":"","sources":["../../src/core/gateway-trust.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,4BAA4B,CAAC;AAExD,OAAO,KAAK,EAAE,YAAY,EAAsB,MAAM,qBAAqB,CAAC;AAU5E;;;;GAIG;AACH,eAAO,MAAM,8BAA8B,QACU,CAAC;AAEtD,2XAA2X;AAC3X,MAAM,MAAM,kBAAkB,GAAG,IAAI,CACnC,YAAY,EACV,WAAW,GACX,aAAa,GACb,aAAa,GACb,QAAQ,GACR,oBA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-28,7 +28,7 @@ export class GatewayTrust {
|
|
|
28
28
|
this.clock = options.clock ?? createSystemClock();
|
|
29
29
|
this.load();
|
|
30
30
|
}
|
|
31
|
-
/** Replaces the in-memory sets with whatever the file currently holds, recording the file's stamp. A no-op without a location. Verified members are left alone: they are in memory only and are dropped on their own when their principal stops being trusted. */
|
|
31
|
+
/** Replaces the in-memory sets with whatever the file currently holds, recording the file's stamp. Identifiers are kept in lower case whatever case the file holds them in, so every lookup and removal, which lower-cases its argument, finds them. A no-op without a location. Verified members are left alone: they are in memory only and are dropped on their own when their principal stops being trusted. */
|
|
32
32
|
load() {
|
|
33
33
|
if (this.location === undefined)
|
|
34
34
|
return;
|
|
@@ -39,13 +39,13 @@ export class GatewayTrust {
|
|
|
39
39
|
this.trustedIssuers.principal.clear();
|
|
40
40
|
this.trustedIssuers.machine.clear();
|
|
41
41
|
for (const deviceHex of loaded.devices) {
|
|
42
|
-
this.trusted.add(deviceHex);
|
|
42
|
+
this.trusted.add(deviceHex.toLowerCase());
|
|
43
43
|
}
|
|
44
44
|
for (const principalHex of loaded.principals) {
|
|
45
|
-
this.trustedIssuers.principal.add(principalHex);
|
|
45
|
+
this.trustedIssuers.principal.add(principalHex.toLowerCase());
|
|
46
46
|
}
|
|
47
47
|
for (const machineHex of loaded.machines) {
|
|
48
|
-
this.trustedIssuers.machine.add(machineHex);
|
|
48
|
+
this.trustedIssuers.machine.add(machineHex.toLowerCase());
|
|
49
49
|
}
|
|
50
50
|
}
|
|
51
51
|
/** Reloads from disk when another process has replaced the file since this instance last looked, looking at most once per TRUST_FILE_RECHECK_INTERVAL_MS. Called first by every method that only reads the sets, so a trust decision is never older than the file by more than that bound. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"gateway-trust.js","sourceRoot":"","sources":["../../src/core/gateway-trust.ts"],"names":[],"mappings":"AAYA,OAAO,EAAE,iBAAiB,EAAE,MAAM,sCAAsC,CAAC;AAEzE,OAAO,EACL,iBAAiB,EACjB,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AAM,CAAC,CAAC;CAMlD"}
|
|
@@ -126,12 +126,12 @@ export class GroupProofs {
|
|
|
126
126
|
}
|
|
127
127
|
/** Sets (or, given undefined, clears) this machine's self display name and re-mints its claim now rather than on the next refresh. Throws if the store has no identity yet. */
|
|
128
128
|
async saveMachineName(name) {
|
|
129
|
-
saveMachineDisplayName(this.getIdentity().machineIdentityOptions, name);
|
|
129
|
+
await saveMachineDisplayName(this.getIdentity().machineIdentityOptions, name);
|
|
130
130
|
return this.machineName.refresh();
|
|
131
131
|
}
|
|
132
132
|
/** Sets (or, given undefined, clears) this account's self display name and re-mints its claim now rather than on the next refresh. Throws if the store has no identity yet. */
|
|
133
133
|
async saveUserName(name) {
|
|
134
|
-
saveUserDisplayName(this.getIdentity().userIdentityOptions, name);
|
|
134
|
+
await saveUserDisplayName(this.getIdentity().userIdentityOptions, name);
|
|
135
135
|
return this.principalName.refresh();
|
|
136
136
|
}
|
|
137
137
|
/** Whether a gossiped proof shows that issuerHex, a principal or a machine, vouches for deviceHex. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"group-proofs.js","sourceRoot":"","sources":["../../src/core/group-proofs.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,aAAa,EAAE,MAAM,iCAAiC,CAAC;AAGhE,OAAO,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAC1D,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AACtD,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACrD,OAAO,EACL,sBAAsB,EACtB,sBAAsB,GACvB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AACtD,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAClD,OAAO,EAAE,mBAAmB,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AAmB9E,MAAM,OAAO,WAAW;IACL,SAAS,C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CAAC,IAAI,CAAC,WAAW,EAAE,CAAC,mBAAmB,EAAE,IAAI,CAAC,CAAC;QACxE,OAAO,IAAI,CAAC,aAAa,CAAC,OAAO,EAAE,CAAC;IACtC,CAAC;IAED,sGAAsG;IACtG,KAAK,CAAC,MAAM,CACV,KAAwE;QAExE,OAAO,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;IACtC,CAAC;IAED,qLAAqL;IACrL,KAAK,CAAC,QAAQ,CACZ,KAAqD;QAErD,OAAO,IAAI,CAAC,SAAS,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;IACxC,CAAC;IAED,uFAAuF;IACvF,KAAK,CAAC,gBAAgB;QACpB,OAAO,IAAI,CAAC,eAAe,CAAC,eAAe,EAAE,CAAC;IAChD,CAAC;IAED,iOAAiO;IACjO,KAAK,CAAC,WAAW;QACf,OAAO,IAAI,GAAG,CAAC;YACb,GAAG,CAAC,MAAM,IAAI,CAAC,eAAe,CAAC,WAAW,EAAE,CAAC;YAC7C,GAAG,CAAC,MAAM,IAAI,CAAC,iBAAiB,CAAC,WAAW,EAAE,CAAC;SAChD,CAAC,CAAC;IACL,CAAC;CACF"}
|
|
@@ -3,7 +3,9 @@
|
|
|
3
3
|
*
|
|
4
4
|
* Mesh state stays in memory and on the wire; the only thing on disk is this local credential (plus, now, the tokens minted against it), the same trust model as an SSH key. A lock file holding a PID keeps two live bridges in one slot from sharing an identity, which would put duplicate peer IDs on the mesh; the second bridge runs with an ephemeral identity (the behaviour before persistence) instead. Bridges without a graceful shutdown hook can skip releasing the lock: a stale lock is detected by probing the recorded PID, the same way the coordinator probes for stale agents.
|
|
5
5
|
*
|
|
6
|
-
* Persisting the key material rather than a bare agent ID is what makes restarts work: delivery routing fires when agentId === peerId, and peerId is deviceIdToHex(identity.deviceId), so an ID without its key can never match the running peer. Renewal near certificate expiry
|
|
6
|
+
* Persisting the key material rather than a bare agent ID is what makes restarts work: delivery routing fires when agentId === peerId, and peerId is deviceIdToHex(identity.deviceId), so an ID without its key can never match the running peer. Renewal near certificate expiry re-certifies the existing key pair, so the device-id survives it. A slot file that exists but cannot be used is never replaced: loading it throws UnusableIdentityRecordError (issuer-identity-file.ts), because a new key would silently change the peer id and discard every token the file holds. Only a missing file starts a new identity.
|
|
7
|
+
*
|
|
8
|
+
* Several processes can write one slot file: the bridge holding the slot lock, a cc-peer front loading the same identity without that lock, and whichever of them is renewing the certificate. Every read-modify-write of the file therefore runs under a short-lived write lock of its own (the slot lock is held for the bridge's whole lifetime, so it cannot serialise them). A bridge that lost the slot lock runs under an identity that is not the file's, so the tokens it mints and holds are kept in its own memory for the life of the process and never read from or written to the file.
|
|
7
9
|
*/
|
|
8
10
|
import { type DataDirectoryLocation } from "./data-directory.js";
|
|
9
11
|
import type { CapabilityToken } from "wire-mesh-core/generated/protocol";
|
|
@@ -35,6 +37,8 @@ export declare function deserializeToken(serialized: SerializedCapabilityToken):
|
|
|
35
37
|
export declare function oplogDirFor(slot: Readonly<IdentitySlot>): string;
|
|
36
38
|
/**
|
|
37
39
|
* Load the persisted identity for the slot, creating it on first use, and take the slot lock. Returns an ephemeral identity when the slot is already held by another live process.
|
|
40
|
+
*
|
|
41
|
+
* Throws UnusableIdentityRecordError when the slot's file exists but cannot be used (damaged, unreadable, or holding a key that cannot be certified again). The file is left untouched, the slot lock is released and no identity is returned: a caller must not join the mesh under a key the user did not choose, so the bridge stops with the error's message, which says what to do.
|
|
38
42
|
*/
|
|
39
43
|
export declare function loadOrCreateIdentity(slot: Readonly<IdentitySlot>): PeerIdentity;
|
|
40
44
|
/**
|
|
@@ -42,7 +46,7 @@ export declare function loadOrCreateIdentity(slot: Readonly<IdentitySlot>): Peer
|
|
|
42
46
|
*/
|
|
43
47
|
export declare function probeSlotOwner(slot: Readonly<IdentitySlot>): number | undefined;
|
|
44
48
|
/**
|
|
45
|
-
* Loads (creating on first use) the persisted identity for a slot without taking its exclusivity lock. The cc-peer front (agent-comms#157) uses this to assume a not-yet-live session's own future identity, so the device-id
|
|
49
|
+
* Loads (creating on first use) the persisted identity for a slot without taking its exclusivity lock. Throws UnusableIdentityRecordError exactly as loadOrCreateIdentity does, and the front reports it for that session without fronting it. The cc-peer front (agent-comms#157) uses this to assume a not-yet-live session's own future identity, so the device-id, and with it every agent id, room membership, and pending delivery already addressed to it, carries over unchanged the moment that session's own bridge starts and claims the slot for real. Callers must have already confirmed via probeSlotOwner that no live bridge currently holds the slot; re-probing atomically against a concurrent acquisition isn't possible across the two separate files (identity vs lock) this store keeps, so it's the front's own periodic re-probe, not this function, that detects and reacts to a real bridge taking over afterwards.
|
|
46
50
|
*/
|
|
47
51
|
export declare function loadIdentityForFront(slot: Readonly<IdentitySlot>): PeerIdentity;
|
|
48
52
|
/**
|
|
@@ -54,11 +58,11 @@ export declare function releaseIdentityLock(slot: Readonly<IdentitySlot>): void;
|
|
|
54
58
|
*/
|
|
55
59
|
export declare function loadRoomTokens(slot: Readonly<IdentitySlot>): Record<string, CapabilityToken>;
|
|
56
60
|
/**
|
|
57
|
-
* Persists a capability token for the given room path, surviving a restart the same way the identity it was minted against does. Overwrites any token already saved for that room; leaves every other room's token and the identity's own key material untouched.
|
|
61
|
+
* Persists a capability token for the given room path, surviving a restart the same way the identity it was minted against does. Overwrites any token already saved for that room; leaves every other room's token and the identity's own key material untouched. A slot running under an ephemeral identity keeps it in this process's memory only.
|
|
58
62
|
*/
|
|
59
|
-
export declare function saveRoomToken(slot: Readonly<IdentitySlot>, roomPath: string, token: CapabilityToken): void
|
|
63
|
+
export declare function saveRoomToken(slot: Readonly<IdentitySlot>, roomPath: string, token: CapabilityToken): Promise<void>;
|
|
60
64
|
/** Removes the persisted token for one room path, if any. A no-op if none was saved for that path. */
|
|
61
|
-
export declare function deleteRoomToken(slot: Readonly<IdentitySlot>, roomPath: string): void
|
|
65
|
+
export declare function deleteRoomToken(slot: Readonly<IdentitySlot>, roomPath: string): Promise<void>;
|
|
62
66
|
/**
|
|
63
67
|
* Every group-membership capability token this device's own identity holds (agent-comms#161), keyed by group path. Empty if this slot has never saved one (or the identity file doesn't exist yet -- call loadOrCreateIdentity first). The device-membership counterpart of loadRoomTokens.
|
|
64
68
|
*/
|
|
@@ -66,9 +70,9 @@ export declare function loadGroupTokens(slot: Readonly<IdentitySlot>): Record<st
|
|
|
66
70
|
/**
|
|
67
71
|
* Persists this device's own group:member token for the given group path, surviving a restart the same way the identity it was minted against does. Overwrites any token already saved for that group path; leaves every other group's token and the identity's own key material untouched. The device-membership counterpart of saveRoomToken.
|
|
68
72
|
*/
|
|
69
|
-
export declare function saveGroupToken(slot: Readonly<IdentitySlot>, groupPath: string, token: CapabilityToken): void
|
|
73
|
+
export declare function saveGroupToken(slot: Readonly<IdentitySlot>, groupPath: string, token: CapabilityToken): Promise<void>;
|
|
70
74
|
/** Removes the persisted token for one group path, if any. A no-op if none was saved for that path. The device-membership counterpart of deleteRoomToken. */
|
|
71
|
-
export declare function deleteGroupToken(slot: Readonly<IdentitySlot>, groupPath: string): void
|
|
75
|
+
export declare function deleteGroupToken(slot: Readonly<IdentitySlot>, groupPath: string): Promise<void>;
|
|
72
76
|
/**
|
|
73
77
|
* The token-id this identity itself minted for the given member's room:member grant, or undefined if none is on record (the slot has never admitted this member, or the record predates this bookkeeping). A room owner consults this to revoke a specific member's own grant later -- a token-id, unlike the token itself, is never presented on the wire and so is never obtainable except from this identity's own memory of having minted it.
|
|
74
78
|
*/
|
|
@@ -76,9 +80,9 @@ export declare function loadIssuedRoomGrant(slot: Readonly<IdentitySlot>, roomPa
|
|
|
76
80
|
/**
|
|
77
81
|
* Records the token-id of a room:member grant this identity has just minted for memberDeviceHex in roomPath, surviving a restart the same way roomTokens does. Overwrites any earlier record for the same (roomPath, member) pair -- a fresh join/invite always supersedes the grant it replaces, so only the current token-id is ever worth revoking.
|
|
78
82
|
*/
|
|
79
|
-
export declare function saveIssuedRoomGrant(slot: Readonly<IdentitySlot>, roomPath: string, memberDeviceHex: string, tokenId: Uint8Array): void
|
|
83
|
+
export declare function saveIssuedRoomGrant(slot: Readonly<IdentitySlot>, roomPath: string, memberDeviceHex: string, tokenId: Uint8Array): Promise<void>;
|
|
80
84
|
/** Removes the recorded token-id for one (roomPath, member) grant, if any -- called once a kick has revoked it, so a later re-join mints and records a genuinely fresh one rather than leaving a stale entry alongside it. A no-op if none was recorded. */
|
|
81
|
-
export declare function deleteIssuedRoomGrant(slot: Readonly<IdentitySlot>, roomPath: string, memberDeviceHex: string): void
|
|
85
|
+
export declare function deleteIssuedRoomGrant(slot: Readonly<IdentitySlot>, roomPath: string, memberDeviceHex: string): Promise<void>;
|
|
82
86
|
/** The persisted trusted sets: every remote device-id, every remote user-principal device-id (agent-comms#187) and every remote machine device-id (agent-comms#343) this machine's gateway currently trusts, each lowercase hex, in insertion order. */
|
|
83
87
|
export interface LoadedGatewayTrust {
|
|
84
88
|
devices: string[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"identity-store.d.ts","sourceRoot":"","sources":["../../src/core/identity-store.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"identity-store.d.ts","sourceRoot":"","sources":["../../src/core/identity-store.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAIH,OAAO,EAEL,KAAK,qBAAqB,EAC3B,MAAM,qBAAqB,CAAC;AAC7B,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,mCAAmC,CAAC;AAGzE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAclD,4EAA4E;AAC5E,MAAM,WAAW,YAAa,SAAQ,qBAAqB;IACzD,OAAO,EAAE,MAAM,CAAC;IAChB,GAAG,EAAE,MAAM,CAAC;IACZ,oCAAoC;IACpC,GAAG,CAAC,EAAE,MAAM,CAAC;CACd;AAKD,wgBAAwgB;AACxgB,MAAM,MAAM,yBAAyB,GAAG;IACtC,MAAM;IACN;QAAE,GAAG,CAAC,EAAE,MAAM,CAAC;QAAC,GAAG,CAAC,EAAE,MAAM,CAA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