wire-mesh-core 3.7.2 → 3.9.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/adapters/byte-stream-connection.d.cts +2 -2
- package/dist/adapters/byte-stream-connection.d.mts +2 -2
- package/dist/adapters/frame-codec.d.cts +1 -1
- package/dist/adapters/frame-codec.d.mts +1 -1
- package/dist/adapters/node-identity.d.cts +2 -2
- package/dist/adapters/node-identity.d.mts +2 -2
- package/dist/adapters/tcp-transport.d.cts +1 -1
- package/dist/adapters/tcp-transport.d.mts +1 -1
- package/dist/adapters/threshold-identity.d.cts +2 -2
- package/dist/adapters/threshold-identity.d.mts +2 -2
- package/dist/adapters/threshold-wasm.d.cts +1 -1
- package/dist/adapters/threshold-wasm.d.mts +1 -1
- package/dist/adapters/tls-transport.d.cts +1 -1
- package/dist/adapters/tls-transport.d.mts +1 -1
- package/dist/domain/advert-extension-policy.d.cts +1 -1
- package/dist/domain/advert-extension-policy.d.mts +1 -1
- package/dist/domain/bulk.d.cts +2 -2
- package/dist/domain/bulk.d.mts +2 -2
- package/dist/domain/capability-grant.cjs +4 -4
- package/dist/domain/capability-grant.d.cts +3 -3
- package/dist/domain/capability-grant.d.mts +3 -3
- package/dist/domain/capability-grant.mjs +2 -2
- package/dist/domain/capability-request.cjs +66 -6
- package/dist/domain/capability-request.d.cts +21 -3
- package/dist/domain/capability-request.d.mts +21 -3
- package/dist/domain/capability-request.mjs +64 -6
- package/dist/domain/coordinator-election.d.cts +1 -1
- package/dist/domain/coordinator-election.d.mts +1 -1
- package/dist/domain/data-sync.d.cts +2 -2
- package/dist/domain/data-sync.d.mts +2 -2
- package/dist/domain/device-id.d.cts +1 -1
- package/dist/domain/device-id.d.mts +1 -1
- package/dist/domain/direct-manage-request.d.cts +2 -2
- package/dist/domain/direct-manage-request.d.mts +2 -2
- package/dist/domain/gossip-expansion.d.cts +1 -1
- package/dist/domain/gossip-expansion.d.mts +1 -1
- package/dist/domain/grant-candidates.cjs +2 -2
- package/dist/domain/grant-candidates.d.cts +1 -1
- package/dist/domain/grant-candidates.d.mts +1 -1
- package/dist/domain/grant-candidates.mjs +1 -1
- package/dist/domain/handshake.d.cts +1 -1
- package/dist/domain/handshake.d.mts +1 -1
- package/dist/domain/hub-mailbox.d.cts +1 -1
- package/dist/domain/hub-mailbox.d.mts +1 -1
- package/dist/domain/mesh-session.cjs +3 -3
- package/dist/domain/mesh-session.d.cts +3 -3
- package/dist/domain/mesh-session.d.mts +3 -3
- package/dist/domain/mesh-session.mjs +2 -2
- package/dist/domain/notice-board.d.cts +3 -3
- package/dist/domain/notice-board.d.mts +3 -3
- package/dist/domain/path-trace.d.cts +1 -1
- package/dist/domain/path-trace.d.mts +1 -1
- package/dist/domain/peer-advert.cjs +2 -2
- package/dist/domain/peer-advert.d.cts +2 -2
- package/dist/domain/peer-advert.d.mts +2 -2
- package/dist/domain/peer-advert.mjs +1 -1
- package/dist/domain/relay-advert.d.cts +1 -1
- package/dist/domain/relay-advert.d.mts +1 -1
- package/dist/domain/relay-hub.d.cts +2 -2
- package/dist/domain/relay-hub.d.mts +2 -2
- package/dist/domain/relay-use-gate.d.cts +2 -2
- package/dist/domain/relay-use-gate.d.mts +2 -2
- package/dist/domain/revocation-view.cjs +2 -2
- package/dist/domain/revocation-view.d.cts +2 -2
- package/dist/domain/revocation-view.d.mts +2 -2
- package/dist/domain/revocation-view.mjs +1 -1
- package/dist/domain/room-rekey.d.cts +3 -3
- package/dist/domain/room-rekey.d.mts +3 -3
- package/dist/domain/room-token-verification.cjs +2 -2
- package/dist/domain/room-token-verification.d.cts +1 -1
- package/dist/domain/room-token-verification.d.mts +1 -1
- package/dist/domain/room-token-verification.mjs +1 -1
- package/dist/domain/room.d.cts +4 -4
- package/dist/domain/room.d.mts +4 -4
- package/dist/domain/shard-manifest.d.cts +1 -1
- package/dist/domain/shard-manifest.d.mts +1 -1
- package/dist/domain/threshold-subject.cjs +2 -2
- package/dist/domain/threshold-subject.mjs +1 -1
- package/dist/domain/token-predicates.cjs +184 -0
- package/dist/domain/token-predicates.d.cts +2 -0
- package/dist/domain/token-predicates.d.mts +2 -0
- package/dist/domain/token-predicates.mjs +173 -0
- package/dist/{token-scope-CxHXTT3u.cjs → domain/token-scope.cjs} +3 -12
- package/dist/domain/token-scope.d.cts +11 -0
- package/dist/domain/token-scope.d.mts +11 -0
- package/dist/{token-scope-Z4bmci4M.mjs → domain/token-scope.mjs} +1 -1
- package/dist/domain/tokens.cjs +466 -7
- package/dist/domain/tokens.d.cts +131 -2
- package/dist/domain/tokens.d.mts +131 -2
- package/dist/domain/tokens.mjs +459 -2
- package/dist/domain/topology-snapshot.d.cts +1 -1
- package/dist/domain/topology-snapshot.d.mts +1 -1
- package/dist/domain/topology.d.cts +1 -1
- package/dist/domain/topology.d.mts +1 -1
- package/dist/domain/webrtc-signaling.cjs +2 -2
- package/dist/domain/webrtc-signaling.d.cts +2 -2
- package/dist/domain/webrtc-signaling.d.mts +2 -2
- package/dist/domain/webrtc-signaling.mjs +1 -1
- package/dist/generated/protocol.cjs +4 -1
- package/dist/generated/protocol.d.cts +1 -1
- package/dist/generated/protocol.d.mts +1 -1
- package/dist/generated/protocol.mjs +4 -1
- package/dist/{identity-DVCNuFLG.d.cts → identity-DJbr96J3.d.cts} +1 -1
- package/dist/{identity-DcaYgjXT.d.mts → identity-ViYdZrIU.d.mts} +1 -1
- package/dist/ports/identity.d.cts +1 -1
- package/dist/ports/identity.d.mts +1 -1
- package/dist/ports/transport.d.cts +1 -1
- package/dist/ports/transport.d.mts +1 -1
- package/dist/{protocol-DCDae3z4.d.cts → protocol-BgR1e_NI.d.cts} +3 -0
- package/dist/{protocol-DCDae3z4.d.mts → protocol-BgR1e_NI.d.mts} +3 -0
- package/dist/{room-token-verification-CkGnFuQc.d.mts → room-token-verification-BpQ6yJtj.d.cts} +2 -2
- package/dist/{room-token-verification-PSv4eQ1x.d.cts → room-token-verification-CTQSihUO.d.mts} +2 -2
- package/dist/token-predicates-C-aIe1DT.d.cts +72 -0
- package/dist/token-predicates-DqvyS7Y8.d.mts +72 -0
- package/dist/{transport-DIXjoQKn.d.cts → transport-DP3hdehk.d.cts} +1 -1
- package/dist/{transport-B0GywEzG.d.mts → transport-Dv_LTCsF.d.mts} +1 -1
- package/package.json +9 -1
- package/dist/tokens-CBiSYuzp.d.mts +0 -126
- package/dist/tokens-CMdWiRBb.mjs +0 -459
- package/dist/tokens-DSG3SDr8.cjs +0 -494
- package/dist/tokens-DqFu7iMX.d.cts +0 -126
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { D as DeviceId } from "../protocol-
|
|
1
|
+
import { D as DeviceId } from "../protocol-BgR1e_NI.mjs";
|
|
2
2
|
//#region src/domain/device-id.d.ts
|
|
3
3
|
/** Lowercase, byte-exact hex for an arbitrary-length byte string -- the same encoding convention deviceIdToHex uses for the fixed-length device-id case, extracted so any other byte string needing a stable, displayable, map-keyable text form (e.g. a token-id, which tokens.cddl defines as an arbitrary-length bstr rather than a 32-byte device-id) can use the identical convention without going through a device-id-shaped function. */
|
|
4
4
|
export declare function bytesToHex(bytes: Uint8Array): string;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { D as DeviceId, V as ManageCommand, f as CapabilityScope, p as CapabilityToken } from "../protocol-
|
|
2
|
-
import { r as Transport, t as Connection } from "../transport-
|
|
1
|
+
import { D as DeviceId, V as ManageCommand, f as CapabilityScope, p as CapabilityToken } from "../protocol-BgR1e_NI.cjs";
|
|
2
|
+
import { r as Transport, t as Connection } from "../transport-DP3hdehk.cjs";
|
|
3
3
|
import { IncomingManageRequest, ManageOutcome } from "./mesh-session.cjs";
|
|
4
4
|
//#region src/domain/direct-manage-request.d.ts
|
|
5
5
|
/** Reads exactly one frame off a freshly-accepted, bare connection and, if it's a manage-request, returns an IncomingManageRequest ready to hand to the same application-level dispatch logic session.incomingManageRequests already feeds elsewhere -- no handshake or gossip is ever read or sent on this connection (wire-mesh#38: the manage-request/manage-response exchange has no dependency on handshake state at the dispatch layer, confirmed against mesh-session.ts's own applyManageRequest/applyFrame). respond() sends the manage-response directly and closes the connection, since a one-off request/response is this connection's entire purpose -- unlike a real MeshSession, there is nothing further to do with it afterwards. Resolves null, without closing the connection (that's the caller's call), for any other first frame or if the connection ends before one arrives: interpreting either case is a Transport.listen() caller's own business, e.g. peeking the first frame to route between this path and acceptMeshSession's own handshake path. */
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { D as DeviceId, V as ManageCommand, f as CapabilityScope, p as CapabilityToken } from "../protocol-
|
|
2
|
-
import { r as Transport, t as Connection } from "../transport-
|
|
1
|
+
import { D as DeviceId, V as ManageCommand, f as CapabilityScope, p as CapabilityToken } from "../protocol-BgR1e_NI.mjs";
|
|
2
|
+
import { r as Transport, t as Connection } from "../transport-Dv_LTCsF.mjs";
|
|
3
3
|
import { IncomingManageRequest, ManageOutcome } from "./mesh-session.mjs";
|
|
4
4
|
//#region src/domain/direct-manage-request.d.ts
|
|
5
5
|
/** Reads exactly one frame off a freshly-accepted, bare connection and, if it's a manage-request, returns an IncomingManageRequest ready to hand to the same application-level dispatch logic session.incomingManageRequests already feeds elsewhere -- no handshake or gossip is ever read or sent on this connection (wire-mesh#38: the manage-request/manage-response exchange has no dependency on handshake state at the dispatch layer, confirmed against mesh-session.ts's own applyManageRequest/applyFrame). respond() sends the manage-response directly and closes the connection, since a one-off request/response is this connection's entire purpose -- unlike a real MeshSession, there is nothing further to do with it afterwards. Resolves null, without closing the connection (that's the caller's call), for any other first frame or if the connection ends before one arrives: interpreting either case is a Transport.listen() caller's own business, e.g. peeking the first frame to route between this path and acceptMeshSession's own handshake path. */
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { D as DeviceId, et as PeerAdvert } from "../protocol-
|
|
1
|
+
import { D as DeviceId, et as PeerAdvert } from "../protocol-BgR1e_NI.cjs";
|
|
2
2
|
import { MeshSession } from "./mesh-session.cjs";
|
|
3
3
|
//#region src/domain/gossip-expansion.d.ts
|
|
4
4
|
/** One not-yet-considered device this session's gossip directory has surfaced, carrying only what a dial/trust decision needs: the device-id to decide identity, and the "host:port" addresses its own peer-advert claims are directly reachable at, in the order it advertised them. */
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { D as DeviceId, et as PeerAdvert } from "../protocol-
|
|
1
|
+
import { D as DeviceId, et as PeerAdvert } from "../protocol-BgR1e_NI.mjs";
|
|
2
2
|
import { MeshSession } from "./mesh-session.mjs";
|
|
3
3
|
//#region src/domain/gossip-expansion.d.ts
|
|
4
4
|
/** One not-yet-considered device this session's gossip directory has surfaced, carrying only what a dial/trust decision needs: the device-id to decide identity, and the "host:port" addresses its own peer-advert claims are directly reachable at, in the order it advertised them. */
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
2
|
const require_generated_protocol = require("../generated/protocol.cjs");
|
|
3
|
-
const
|
|
3
|
+
const require_domain_token_scope = require("./token-scope.cjs");
|
|
4
4
|
let zod = require("zod");
|
|
5
5
|
//#region src/domain/grant-candidates.ts
|
|
6
6
|
/**
|
|
@@ -38,7 +38,7 @@ function findGrantCandidate(directory, capability, scope) {
|
|
|
38
38
|
if (candidate.capability !== capability) continue;
|
|
39
39
|
const remaining = candidate["delegations-remaining"];
|
|
40
40
|
if (remaining !== void 0 && remaining <= 0) continue;
|
|
41
|
-
if (
|
|
41
|
+
if (require_domain_token_scope.scopeNarrows(candidate.scope, scope)) return entry.device;
|
|
42
42
|
}
|
|
43
43
|
}
|
|
44
44
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { D as DeviceId, f as CapabilityScope } from "../protocol-
|
|
1
|
+
import { D as DeviceId, f as CapabilityScope } from "../protocol-BgR1e_NI.cjs";
|
|
2
2
|
import { DirectoryEntry, MeshSession } from "./mesh-session.cjs";
|
|
3
3
|
import { z } from "zod";
|
|
4
4
|
//#region src/domain/grant-candidates.d.ts
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { D as DeviceId, f as CapabilityScope } from "../protocol-
|
|
1
|
+
import { D as DeviceId, f as CapabilityScope } from "../protocol-BgR1e_NI.mjs";
|
|
2
2
|
import { DirectoryEntry, MeshSession } from "./mesh-session.mjs";
|
|
3
3
|
import { z } from "zod";
|
|
4
4
|
//#region src/domain/grant-candidates.d.ts
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { A as DomainId, R as HandshakeFrame, lt as ProtocolVersion } from "../protocol-
|
|
1
|
+
import { A as DomainId, R as HandshakeFrame, lt as ProtocolVersion } from "../protocol-BgR1e_NI.cjs";
|
|
2
2
|
//#region src/domain/handshake.d.ts
|
|
3
3
|
/** The highest protocol version this build of core understands. */
|
|
4
4
|
export declare const SUPPORTED_PROTOCOL_VERSION: ProtocolVersion;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { A as DomainId, R as HandshakeFrame, lt as ProtocolVersion } from "../protocol-
|
|
1
|
+
import { A as DomainId, R as HandshakeFrame, lt as ProtocolVersion } from "../protocol-BgR1e_NI.mjs";
|
|
2
2
|
//#region src/domain/handshake.d.ts
|
|
3
3
|
/** The highest protocol version this build of core understands. */
|
|
4
4
|
export declare const SUPPORTED_PROTOCOL_VERSION: ProtocolVersion;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { D as DeviceId, E as DataRequestFrame, N as Frame, T as DataHaveFrame, w as DataEntriesFrame } from "../protocol-
|
|
1
|
+
import { D as DeviceId, E as DataRequestFrame, N as Frame, T as DataHaveFrame, w as DataEntriesFrame } from "../protocol-BgR1e_NI.cjs";
|
|
2
2
|
import { t as KeyValueStorage } from "../storage-B403CRyu.cjs";
|
|
3
3
|
//#region src/domain/hub-mailbox.d.ts
|
|
4
4
|
export interface MailboxLimits {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { D as DeviceId, E as DataRequestFrame, N as Frame, T as DataHaveFrame, w as DataEntriesFrame } from "../protocol-
|
|
1
|
+
import { D as DeviceId, E as DataRequestFrame, N as Frame, T as DataHaveFrame, w as DataEntriesFrame } from "../protocol-BgR1e_NI.mjs";
|
|
2
2
|
import { t as KeyValueStorage } from "../storage-B403CRyu.mjs";
|
|
3
3
|
//#region src/domain/hub-mailbox.d.ts
|
|
4
4
|
export interface MailboxLimits {
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
2
|
const require_adapters_frame_codec = require("../adapters/frame-codec.cjs");
|
|
3
|
-
const
|
|
3
|
+
const require_domain_device_id = require("./device-id.cjs");
|
|
4
|
+
const require_domain_token_scope = require("./token-scope.cjs");
|
|
4
5
|
const require_gossip_extensions = require("../gossip-extensions-BBYgMZ2N.cjs");
|
|
5
6
|
const require_domain_peer_advert = require("./peer-advert.cjs");
|
|
6
7
|
const require_domain_async_queue = require("./async-queue.cjs");
|
|
7
|
-
const require_domain_device_id = require("./device-id.cjs");
|
|
8
8
|
const require_domain_handshake = require("./handshake.cjs");
|
|
9
9
|
const require_domain_ping_round_trips = require("./ping-round-trips.cjs");
|
|
10
10
|
const require_domain_topology_snapshot = require("./topology-snapshot.cjs");
|
|
@@ -101,7 +101,7 @@ async function verifyHello(identity, hello) {
|
|
|
101
101
|
const key = hello["identity-key"];
|
|
102
102
|
try {
|
|
103
103
|
const sender = await identity.deriveDeviceId(key["public-key"]);
|
|
104
|
-
if (!
|
|
104
|
+
if (!require_domain_token_scope.bytesEqual(hello["to-device"], identity.deviceId)) return {
|
|
105
105
|
ok: false,
|
|
106
106
|
reason: "wrong_recipient"
|
|
107
107
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { D as DeviceId, E as DataRequestFrame, N as Frame, T as DataHaveFrame, U as ManageError, V as ManageCommand, W as ManageOk, bt as RevocationEntry, et as PeerAdvert, f as CapabilityScope, g as CoordinatorFrame, lt as ProtocolVersion, nn as TopologyPeers, p as CapabilityToken, w as DataEntriesFrame } from "../protocol-
|
|
2
|
-
import { r as Transport, t as Connection } from "../transport-
|
|
3
|
-
import { t as IdentityPort } from "../identity-
|
|
1
|
+
import { D as DeviceId, E as DataRequestFrame, N as Frame, T as DataHaveFrame, U as ManageError, V as ManageCommand, W as ManageOk, bt as RevocationEntry, et as PeerAdvert, f as CapabilityScope, g as CoordinatorFrame, lt as ProtocolVersion, nn as TopologyPeers, p as CapabilityToken, w as DataEntriesFrame } from "../protocol-BgR1e_NI.cjs";
|
|
2
|
+
import { r as Transport, t as Connection } from "../transport-DP3hdehk.cjs";
|
|
3
|
+
import { t as IdentityPort } from "../identity-DJbr96J3.cjs";
|
|
4
4
|
import { t as Clock } from "../clock-DiSx-WKM.cjs";
|
|
5
5
|
//#region src/domain/mesh-session.d.ts
|
|
6
6
|
/** How long to wait for the node's handshake before calling it unanswered. A relay-only node never sends one; that is a state to display, not an error. */
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { D as DeviceId, E as DataRequestFrame, N as Frame, T as DataHaveFrame, U as ManageError, V as ManageCommand, W as ManageOk, bt as RevocationEntry, et as PeerAdvert, f as CapabilityScope, g as CoordinatorFrame, lt as ProtocolVersion, nn as TopologyPeers, p as CapabilityToken, w as DataEntriesFrame } from "../protocol-
|
|
2
|
-
import { r as Transport, t as Connection } from "../transport-
|
|
3
|
-
import { t as IdentityPort } from "../identity-
|
|
1
|
+
import { D as DeviceId, E as DataRequestFrame, N as Frame, T as DataHaveFrame, U as ManageError, V as ManageCommand, W as ManageOk, bt as RevocationEntry, et as PeerAdvert, f as CapabilityScope, g as CoordinatorFrame, lt as ProtocolVersion, nn as TopologyPeers, p as CapabilityToken, w as DataEntriesFrame } from "../protocol-BgR1e_NI.mjs";
|
|
2
|
+
import { r as Transport, t as Connection } from "../transport-Dv_LTCsF.mjs";
|
|
3
|
+
import { t as IdentityPort } from "../identity-ViYdZrIU.mjs";
|
|
4
4
|
import { t as Clock } from "../clock-DiSx-WKM.mjs";
|
|
5
5
|
//#region src/domain/mesh-session.d.ts
|
|
6
6
|
/** How long to wait for the node's handshake before calling it unanswered. A relay-only node never sends one; that is a state to display, not an error. */
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { messageFromFrame, tryDecodeFrame, wrapRelayData } from "../adapters/frame-codec.mjs";
|
|
2
|
-
import {
|
|
2
|
+
import { deviceIdToHex } from "./device-id.mjs";
|
|
3
|
+
import { bytesEqual } from "./token-scope.mjs";
|
|
3
4
|
import { a as OWN_VERSION, i as CORE_VERSION_GOSSIP_KEY, n as TOPOLOGY_PEERS_GOSSIP_KEY, o as isVersionGetCommand, r as validateGossipExtensions, s as versionGetOutcome } from "../gossip-extensions-B6WJjkAr.mjs";
|
|
4
5
|
import { signPeerAdvert, verifyPeerAdvert } from "./peer-advert.mjs";
|
|
5
6
|
import { createAsyncQueue } from "./async-queue.mjs";
|
|
6
|
-
import { deviceIdToHex } from "./device-id.mjs";
|
|
7
7
|
import { negotiate } from "./handshake.mjs";
|
|
8
8
|
import { createPingRoundTrips } from "./ping-round-trips.mjs";
|
|
9
9
|
import { createTopologySnapshotTracker } from "./topology-snapshot.mjs";
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { D as DeviceId, Ot as RoomNotice, T as DataHaveFrame, kt as RoomNoticeClaims, p as CapabilityToken } from "../protocol-
|
|
1
|
+
import { D as DeviceId, Ot as RoomNotice, T as DataHaveFrame, kt as RoomNoticeClaims, p as CapabilityToken } from "../protocol-BgR1e_NI.cjs";
|
|
2
2
|
import { t as KeyValueStorage } from "../storage-B403CRyu.cjs";
|
|
3
|
-
import { t as IdentityPort } from "../identity-
|
|
3
|
+
import { t as IdentityPort } from "../identity-DJbr96J3.cjs";
|
|
4
4
|
import { t as Clock } from "../clock-DiSx-WKM.cjs";
|
|
5
|
-
import {
|
|
5
|
+
import { RevocationCheck } from "./tokens.cjs";
|
|
6
6
|
import { RoomNoticeVerdictReason } from "./room.cjs";
|
|
7
7
|
//#region src/domain/notice-board.d.ts
|
|
8
8
|
/**
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { D as DeviceId, Ot as RoomNotice, T as DataHaveFrame, kt as RoomNoticeClaims, p as CapabilityToken } from "../protocol-
|
|
1
|
+
import { D as DeviceId, Ot as RoomNotice, T as DataHaveFrame, kt as RoomNoticeClaims, p as CapabilityToken } from "../protocol-BgR1e_NI.mjs";
|
|
2
2
|
import { t as KeyValueStorage } from "../storage-B403CRyu.mjs";
|
|
3
|
-
import { t as IdentityPort } from "../identity-
|
|
3
|
+
import { t as IdentityPort } from "../identity-ViYdZrIU.mjs";
|
|
4
4
|
import { t as Clock } from "../clock-DiSx-WKM.mjs";
|
|
5
|
-
import {
|
|
5
|
+
import { RevocationCheck } from "./tokens.mjs";
|
|
6
6
|
import { RoomNoticeVerdictReason } from "./room.mjs";
|
|
7
7
|
//#region src/domain/notice-board.d.ts
|
|
8
8
|
/**
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { D as DeviceId, H as ManageCommandParams, Q as PathTrace, V as ManageCommand, f as CapabilityScope, p as CapabilityToken } from "../protocol-
|
|
1
|
+
import { D as DeviceId, H as ManageCommandParams, Q as PathTrace, V as ManageCommand, f as CapabilityScope, p as CapabilityToken } from "../protocol-BgR1e_NI.cjs";
|
|
2
2
|
import { t as Clock } from "../clock-DiSx-WKM.cjs";
|
|
3
3
|
import { IncomingManageRequest, ManageOutcome, MeshSession } from "./mesh-session.cjs";
|
|
4
4
|
//#region src/domain/path-trace.d.ts
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { D as DeviceId, H as ManageCommandParams, Q as PathTrace, V as ManageCommand, f as CapabilityScope, p as CapabilityToken } from "../protocol-
|
|
1
|
+
import { D as DeviceId, H as ManageCommandParams, Q as PathTrace, V as ManageCommand, f as CapabilityScope, p as CapabilityToken } from "../protocol-BgR1e_NI.mjs";
|
|
2
2
|
import { t as Clock } from "../clock-DiSx-WKM.mjs";
|
|
3
3
|
import { IncomingManageRequest, ManageOutcome, MeshSession } from "./mesh-session.mjs";
|
|
4
4
|
//#region src/domain/path-trace.d.ts
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
const
|
|
2
|
+
const require_domain_token_scope = require("./token-scope.cjs");
|
|
3
3
|
let cbor2 = require("cbor2");
|
|
4
4
|
//#region src/domain/peer-advert.ts
|
|
5
5
|
/** peer-advert's own signature field, the one entry the signature does not cover, named once here so the signing input and the reserved-extension-key guard cannot drift apart. */
|
|
@@ -46,7 +46,7 @@ async function verifyPeerAdvert(identity, advert) {
|
|
|
46
46
|
const key = advert[PEER_ADVERT_IDENTITY_KEY_KEY];
|
|
47
47
|
try {
|
|
48
48
|
const derived = await identity.deriveDeviceId(key["public-key"]);
|
|
49
|
-
if (!
|
|
49
|
+
if (!require_domain_token_scope.bytesEqual(derived, advert.device)) return false;
|
|
50
50
|
return await identity.verify(key, peerAdvertSigningInput(advert), advert[PEER_ADVERT_SIGNATURE_KEY]);
|
|
51
51
|
} catch {
|
|
52
52
|
return false;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { B as IdentityKey, D as DeviceId, et as PeerAdvert } from "../protocol-
|
|
2
|
-
import { t as IdentityPort } from "../identity-
|
|
1
|
+
import { B as IdentityKey, D as DeviceId, et as PeerAdvert } from "../protocol-BgR1e_NI.cjs";
|
|
2
|
+
import { t as IdentityPort } from "../identity-DJbr96J3.cjs";
|
|
3
3
|
//#region src/domain/peer-advert.d.ts
|
|
4
4
|
/** peer-advert's own signature field, the one entry the signature does not cover, named once here so the signing input and the reserved-extension-key guard cannot drift apart. */
|
|
5
5
|
export declare const PEER_ADVERT_SIGNATURE_KEY = "signature";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { B as IdentityKey, D as DeviceId, et as PeerAdvert } from "../protocol-
|
|
2
|
-
import { t as IdentityPort } from "../identity-
|
|
1
|
+
import { B as IdentityKey, D as DeviceId, et as PeerAdvert } from "../protocol-BgR1e_NI.mjs";
|
|
2
|
+
import { t as IdentityPort } from "../identity-ViYdZrIU.mjs";
|
|
3
3
|
//#region src/domain/peer-advert.d.ts
|
|
4
4
|
/** peer-advert's own signature field, the one entry the signature does not cover, named once here so the signing input and the reserved-extension-key guard cannot drift apart. */
|
|
5
5
|
export declare const PEER_ADVERT_SIGNATURE_KEY = "signature";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { bytesEqual } from "./token-scope.mjs";
|
|
2
2
|
import { cdeEncodeOptions, encode } from "cbor2";
|
|
3
3
|
//#region src/domain/peer-advert.ts
|
|
4
4
|
/** peer-advert's own signature field, the one entry the signature does not cover, named once here so the signing input and the reserved-extension-key guard cannot drift apart. */
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { et as PeerAdvert } from "../protocol-
|
|
1
|
+
import { et as PeerAdvert } from "../protocol-BgR1e_NI.cjs";
|
|
2
2
|
//#region src/domain/relay-advert.d.ts
|
|
3
3
|
/** The domain-qualified gossip extension key a node's relay offer rides under, the same `wire-mesh` domain the core's own gossiped version fact occupies. */
|
|
4
4
|
export declare const RELAY_OFFER_GOSSIP_KEY = "wire-mesh/relay-offer";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { et as PeerAdvert } from "../protocol-
|
|
1
|
+
import { et as PeerAdvert } from "../protocol-BgR1e_NI.mjs";
|
|
2
2
|
//#region src/domain/relay-advert.d.ts
|
|
3
3
|
/** The domain-qualified gossip extension key a node's relay offer rides under, the same `wire-mesh` domain the core's own gossiped version fact occupies. */
|
|
4
4
|
export declare const RELAY_OFFER_GOSSIP_KEY = "wire-mesh/relay-offer";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { D as DeviceId, N as Frame, et as PeerAdvert } from "../protocol-
|
|
2
|
-
import { t as Connection } from "../transport-
|
|
1
|
+
import { D as DeviceId, N as Frame, et as PeerAdvert } from "../protocol-BgR1e_NI.cjs";
|
|
2
|
+
import { t as Connection } from "../transport-DP3hdehk.cjs";
|
|
3
3
|
import { AdvertExtensionPolicy } from "./advert-extension-policy.cjs";
|
|
4
4
|
import { Mailbox, MailboxRefusalReason } from "./hub-mailbox.cjs";
|
|
5
5
|
import { PeerAdvertVerifier } from "./peer-advert.cjs";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { D as DeviceId, N as Frame, et as PeerAdvert } from "../protocol-
|
|
2
|
-
import { t as Connection } from "../transport-
|
|
1
|
+
import { D as DeviceId, N as Frame, et as PeerAdvert } from "../protocol-BgR1e_NI.mjs";
|
|
2
|
+
import { t as Connection } from "../transport-Dv_LTCsF.mjs";
|
|
3
3
|
import { AdvertExtensionPolicy } from "./advert-extension-policy.mjs";
|
|
4
4
|
import { Mailbox, MailboxRefusalReason } from "./hub-mailbox.mjs";
|
|
5
5
|
import { PeerAdvertVerifier } from "./peer-advert.mjs";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { N as Frame } from "../protocol-
|
|
2
|
-
import { t as Connection } from "../transport-
|
|
1
|
+
import { N as Frame } from "../protocol-BgR1e_NI.cjs";
|
|
2
|
+
import { t as Connection } from "../transport-DP3hdehk.cjs";
|
|
3
3
|
//#region src/domain/relay-use-gate.d.ts
|
|
4
4
|
export interface RelayUseAuthorizationTracker {
|
|
5
5
|
/** True once authorize() has been called for this exact connection and revoke() has not been called since. */
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { N as Frame } from "../protocol-
|
|
2
|
-
import { t as Connection } from "../transport-
|
|
1
|
+
import { N as Frame } from "../protocol-BgR1e_NI.mjs";
|
|
2
|
+
import { t as Connection } from "../transport-Dv_LTCsF.mjs";
|
|
3
3
|
//#region src/domain/relay-use-gate.d.ts
|
|
4
4
|
export interface RelayUseAuthorizationTracker {
|
|
5
5
|
/** True once authorize() has been called for this exact connection and revoke() has not been called since. */
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
const require_tokens = require("../tokens-DSG3SDr8.cjs");
|
|
3
2
|
const require_domain_device_id = require("./device-id.cjs");
|
|
3
|
+
const require_domain_tokens = require("./tokens.cjs");
|
|
4
4
|
//#region src/domain/revocation-view.ts
|
|
5
5
|
function revocationKey(tokenId) {
|
|
6
6
|
return require_domain_device_id.bytesToHex(tokenId);
|
|
@@ -12,7 +12,7 @@ function createRevocationView() {
|
|
|
12
12
|
return Promise.resolve(entriesByTokenId.get(revocationKey(tokenId)) ?? []);
|
|
13
13
|
},
|
|
14
14
|
async record(entry, options) {
|
|
15
|
-
const verdict = await
|
|
15
|
+
const verdict = await require_domain_tokens.verifyRevocationEntry(entry, options);
|
|
16
16
|
if (verdict.ok) {
|
|
17
17
|
const key = revocationKey(verdict.claims["token-id"]);
|
|
18
18
|
const existing = entriesByTokenId.get(key);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { bt as RevocationEntry } from "../protocol-
|
|
2
|
-
import {
|
|
1
|
+
import { bt as RevocationEntry } from "../protocol-BgR1e_NI.cjs";
|
|
2
|
+
import { RevocationCheck, RevocationEntryVerdict, VerifyRevocationEntryOptions } from "./tokens.cjs";
|
|
3
3
|
//#region src/domain/revocation-view.d.ts
|
|
4
4
|
/**
|
|
5
5
|
* An in-memory RevocationCheck fed by ingested revocation-announce frames. Keyed by token-id alone, per management.cddl's contract: a token-id can legitimately carry multiple recorded entries from different issuers (the token's own issuer, and/or any number of parties holding a delegated manage:revoke authorization over it) -- entriesFor returns every one of them unfiltered, since checking which actually apply (issuer-match, or a verified authorization) is verifyTokenChain's own obligation, not this store's.
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { bt as RevocationEntry } from "../protocol-
|
|
2
|
-
import {
|
|
1
|
+
import { bt as RevocationEntry } from "../protocol-BgR1e_NI.mjs";
|
|
2
|
+
import { RevocationCheck, RevocationEntryVerdict, VerifyRevocationEntryOptions } from "./tokens.mjs";
|
|
3
3
|
//#region src/domain/revocation-view.d.ts
|
|
4
4
|
/**
|
|
5
5
|
* An in-memory RevocationCheck fed by ingested revocation-announce frames. Keyed by token-id alone, per management.cddl's contract: a token-id can legitimately carry multiple recorded entries from different issuers (the token's own issuer, and/or any number of parties holding a delegated manage:revoke authorization over it) -- entriesFor returns every one of them unfiltered, since checking which actually apply (issuer-match, or a verified authorization) is verifyTokenChain's own obligation, not this store's.
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { o as verifyRevocationEntry } from "../tokens-CMdWiRBb.mjs";
|
|
2
1
|
import { bytesToHex } from "./device-id.mjs";
|
|
2
|
+
import { verifyRevocationEntry } from "./tokens.mjs";
|
|
3
3
|
//#region src/domain/revocation-view.ts
|
|
4
4
|
function revocationKey(tokenId) {
|
|
5
5
|
return bytesToHex(tokenId);
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { D as DeviceId, V as ManageCommand, p as CapabilityToken } from "../protocol-
|
|
2
|
-
import { t as IdentityPort } from "../identity-
|
|
1
|
+
import { D as DeviceId, V as ManageCommand, p as CapabilityToken } from "../protocol-BgR1e_NI.cjs";
|
|
2
|
+
import { t as IdentityPort } from "../identity-DJbr96J3.cjs";
|
|
3
3
|
import { t as Clock } from "../clock-DiSx-WKM.cjs";
|
|
4
4
|
import { IncomingManageRequest, ManageOutcome, MeshSession } from "./mesh-session.cjs";
|
|
5
|
-
import {
|
|
5
|
+
import { RevocationCheck } from "./tokens.cjs";
|
|
6
6
|
//#region src/domain/room-rekey.d.ts
|
|
7
7
|
/**
|
|
8
8
|
* Builds a room.rekey command per room.cddl. The outer verb is room:member, the same "one resource, several inner verbs" pattern room.send/room.leave/room.members already establish -- not a new capability of its own.
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { D as DeviceId, V as ManageCommand, p as CapabilityToken } from "../protocol-
|
|
2
|
-
import { t as IdentityPort } from "../identity-
|
|
1
|
+
import { D as DeviceId, V as ManageCommand, p as CapabilityToken } from "../protocol-BgR1e_NI.mjs";
|
|
2
|
+
import { t as IdentityPort } from "../identity-ViYdZrIU.mjs";
|
|
3
3
|
import { t as Clock } from "../clock-DiSx-WKM.mjs";
|
|
4
4
|
import { IncomingManageRequest, ManageOutcome, MeshSession } from "./mesh-session.mjs";
|
|
5
|
-
import {
|
|
5
|
+
import { RevocationCheck } from "./tokens.mjs";
|
|
6
6
|
//#region src/domain/room-rekey.d.ts
|
|
7
7
|
/**
|
|
8
8
|
* Builds a room.rekey command per room.cddl. The outer verb is room:member, the same "one resource, several inner verbs" pattern room.send/room.leave/room.members already establish -- not a new capability of its own.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
const require_tokens = require("../tokens-DSG3SDr8.cjs");
|
|
3
2
|
const require_domain_device_id = require("./device-id.cjs");
|
|
3
|
+
const require_domain_tokens = require("./tokens.cjs");
|
|
4
4
|
const require_domain_room_path = require("./room-path.cjs");
|
|
5
5
|
//#region src/domain/room-token-verification.ts
|
|
6
6
|
/**
|
|
@@ -12,7 +12,7 @@ const ROOM_MEMBER_CAPABILITY = "room:member";
|
|
|
12
12
|
* Verifies a `room:member` capability token against all six of core/room's verifier obligations. Delegates obligations 2/4/5 to verifyCapabilityToken directly; adds obligation 3 (scope.kind/scope.path must match the room being acted on) and obligation 1 (the chain's root must be the room's own owner for a named room, or the verifying identity itself for a DM -- never either named participant directly, since a DM token minted by anyone other than the verifier would let a sender self-issue authority to message a stranger unsolicited).
|
|
13
13
|
*/
|
|
14
14
|
async function verifyRoomToken(token, options) {
|
|
15
|
-
const verdict = await
|
|
15
|
+
const verdict = await require_domain_tokens.verifyCapabilityToken(token, {
|
|
16
16
|
identity: options.identity,
|
|
17
17
|
clock: options.clock,
|
|
18
18
|
revocation: options.revocation,
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as verifyRoomToken, i as VerifyRoomTokenOptions, n as RoomTokenVerdict, r as RoomTokenVerdictReason, t as ROOM_MEMBER_CAPABILITY } from "../room-token-verification-
|
|
1
|
+
import { a as verifyRoomToken, i as VerifyRoomTokenOptions, n as RoomTokenVerdict, r as RoomTokenVerdictReason, t as ROOM_MEMBER_CAPABILITY } from "../room-token-verification-BpQ6yJtj.cjs";
|
|
2
2
|
export { ROOM_MEMBER_CAPABILITY, RoomTokenVerdict, RoomTokenVerdictReason, VerifyRoomTokenOptions, verifyRoomToken };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as verifyRoomToken, i as VerifyRoomTokenOptions, n as RoomTokenVerdict, r as RoomTokenVerdictReason, t as ROOM_MEMBER_CAPABILITY } from "../room-token-verification-
|
|
1
|
+
import { a as verifyRoomToken, i as VerifyRoomTokenOptions, n as RoomTokenVerdict, r as RoomTokenVerdictReason, t as ROOM_MEMBER_CAPABILITY } from "../room-token-verification-CTQSihUO.mjs";
|
|
2
2
|
export { ROOM_MEMBER_CAPABILITY, RoomTokenVerdict, RoomTokenVerdictReason, VerifyRoomTokenOptions, verifyRoomToken };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { a as verifyCapabilityToken } from "../tokens-CMdWiRBb.mjs";
|
|
2
1
|
import { deviceIdToHex } from "./device-id.mjs";
|
|
2
|
+
import { verifyCapabilityToken } from "./tokens.mjs";
|
|
3
3
|
import { parseRoomPath } from "./room-path.mjs";
|
|
4
4
|
//#region src/domain/room-token-verification.ts
|
|
5
5
|
/**
|
package/dist/domain/room.d.cts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { At as RoomPath, Ot as RoomNotice, kt as RoomNoticeClaims, p as CapabilityToken, q as MessageRef } from "../protocol-
|
|
2
|
-
import { t as IdentityPort } from "../identity-
|
|
1
|
+
import { At as RoomPath, Ot as RoomNotice, kt as RoomNoticeClaims, p as CapabilityToken, q as MessageRef } from "../protocol-BgR1e_NI.cjs";
|
|
2
|
+
import { t as IdentityPort } from "../identity-DJbr96J3.cjs";
|
|
3
3
|
import { t as Clock } from "../clock-DiSx-WKM.cjs";
|
|
4
|
-
import {
|
|
5
|
-
import { r as RoomTokenVerdictReason } from "../room-token-verification-
|
|
4
|
+
import { RevocationCheck } from "./tokens.cjs";
|
|
5
|
+
import { r as RoomTokenVerdictReason } from "../room-token-verification-BpQ6yJtj.cjs";
|
|
6
6
|
//#region src/domain/room.d.ts
|
|
7
7
|
export type RoomNoticeVerdictReason = "malformed" | "wrong_room" | "bad_signature" | "wrong_poster" | "content_expired" | "key_epoch_mismatch" | RoomTokenVerdictReason;
|
|
8
8
|
export type RoomNoticeVerdict = {
|
package/dist/domain/room.d.mts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { At as RoomPath, Ot as RoomNotice, kt as RoomNoticeClaims, p as CapabilityToken, q as MessageRef } from "../protocol-
|
|
2
|
-
import { t as IdentityPort } from "../identity-
|
|
1
|
+
import { At as RoomPath, Ot as RoomNotice, kt as RoomNoticeClaims, p as CapabilityToken, q as MessageRef } from "../protocol-BgR1e_NI.mjs";
|
|
2
|
+
import { t as IdentityPort } from "../identity-ViYdZrIU.mjs";
|
|
3
3
|
import { t as Clock } from "../clock-DiSx-WKM.mjs";
|
|
4
|
-
import {
|
|
5
|
-
import { r as RoomTokenVerdictReason } from "../room-token-verification-
|
|
4
|
+
import { RevocationCheck } from "./tokens.mjs";
|
|
5
|
+
import { r as RoomTokenVerdictReason } from "../room-token-verification-CTQSihUO.mjs";
|
|
6
6
|
//#region src/domain/room.d.ts
|
|
7
7
|
export type RoomNoticeVerdictReason = "malformed" | "wrong_room" | "bad_signature" | "wrong_poster" | "content_expired" | "key_epoch_mismatch" | RoomTokenVerdictReason;
|
|
8
8
|
export type RoomNoticeVerdict = {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { D as DeviceId } from "../protocol-
|
|
1
|
+
import { D as DeviceId } from "../protocol-BgR1e_NI.cjs";
|
|
2
2
|
import { PresentedShard, ShardConfig } from "./erasure-coding.cjs";
|
|
3
3
|
//#region src/domain/shard-manifest.d.ts
|
|
4
4
|
/** The content-type a core/data entry carrying a shard manifest declares. */
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { D as DeviceId } from "../protocol-
|
|
1
|
+
import { D as DeviceId } from "../protocol-BgR1e_NI.mjs";
|
|
2
2
|
import { PresentedShard, ShardConfig } from "./erasure-coding.mjs";
|
|
3
3
|
//#region src/domain/shard-manifest.d.ts
|
|
4
4
|
/** The content-type a core/data entry carrying a shard manifest declares. */
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
const
|
|
2
|
+
const require_domain_tokens = require("./tokens.cjs");
|
|
3
3
|
//#region src/domain/threshold-subject.ts
|
|
4
4
|
/**
|
|
5
5
|
* `threshold-subject` -- what a signing session actually asks a group to sign, and the single most important design decision in the whole protocol: it carries the FULL decoded content, never a bare hash. A participant that commits to an opaque digest is a blind signer, and the entire security value of T-of-N is that each participant independently reviews and authorises the content -- returning a round-1 commitment IS that act of authorisation. This module builds exactly the bytes a participant signs its round-1 commitment over: the RFC 9052 §4.4 `Sig_structure`, reusing `tokens.ts`'s own `sig1ToBeSigned` rather than a second hand-rolled construction, and NEVER accepting a pre-assembled to-be-signed blob from a coordinator. Mirrors `wire_mesh_threshold::subject` on the Rust side exactly.
|
|
@@ -27,7 +27,7 @@ function refuseUnrecognisedKind(subject, known = KNOWN_KINDS) {
|
|
|
27
27
|
* Reconstructs the exact bytes this participant signs its round-1 commitment (and, transitively, its round-2 share) over -- the Sig_structure built from THIS participant's own decoding of `protected`/`payload`, never a coordinator-supplied to-be-signed blob.
|
|
28
28
|
*/
|
|
29
29
|
function toBeSigned(subject) {
|
|
30
|
-
return Uint8Array.from(
|
|
30
|
+
return Uint8Array.from(require_domain_tokens.sig1ToBeSigned(subject.protected, subject.payload));
|
|
31
31
|
}
|
|
32
32
|
//#endregion
|
|
33
33
|
exports.KNOWN_KINDS = KNOWN_KINDS;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { sig1ToBeSigned } from "./tokens.mjs";
|
|
2
2
|
//#region src/domain/threshold-subject.ts
|
|
3
3
|
/**
|
|
4
4
|
* `threshold-subject` -- what a signing session actually asks a group to sign, and the single most important design decision in the whole protocol: it carries the FULL decoded content, never a bare hash. A participant that commits to an opaque digest is a blind signer, and the entire security value of T-of-N is that each participant independently reviews and authorises the content -- returning a round-1 commitment IS that act of authorisation. This module builds exactly the bytes a participant signs its round-1 commitment over: the RFC 9052 §4.4 `Sig_structure`, reusing `tokens.ts`'s own `sig1ToBeSigned` rather than a second hand-rolled construction, and NEVER accepting a pre-assembled to-be-signed blob from a coordinator. Mirrors `wire_mesh_threshold::subject` on the Rust side exactly.
|