wire-mesh-core 1.17.0 → 1.19.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/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/tls-transport.d.cts +1 -1
- package/dist/adapters/tls-transport.d.mts +1 -1
- package/dist/domain/capability-grant.cjs +3 -3
- package/dist/domain/capability-grant.d.cts +3 -3
- package/dist/domain/capability-grant.d.mts +3 -3
- package/dist/domain/capability-grant.mjs +1 -1
- package/dist/domain/capability-request.cjs +2 -2
- package/dist/domain/capability-request.d.cts +2 -2
- package/dist/domain/capability-request.d.mts +2 -2
- package/dist/domain/capability-request.mjs +1 -1
- package/dist/domain/device-id.d.cts +1 -1
- package/dist/domain/device-id.d.mts +1 -1
- package/dist/domain/handshake.d.cts +1 -1
- package/dist/domain/handshake.d.mts +1 -1
- package/dist/domain/mesh-session.d.cts +3 -3
- package/dist/domain/mesh-session.d.mts +3 -3
- package/dist/domain/relay-hub.d.cts +1 -1
- package/dist/domain/relay-hub.d.mts +1 -1
- 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-token-verification.cjs +2 -2
- package/dist/domain/room-token-verification.d.cts +2 -2
- package/dist/domain/room-token-verification.d.mts +2 -2
- package/dist/domain/room-token-verification.mjs +1 -1
- package/dist/domain/tokens.cjs +6 -315
- package/dist/domain/tokens.d.cts +2 -104
- package/dist/domain/tokens.d.mts +2 -104
- package/dist/domain/tokens.mjs +2 -310
- package/dist/generated/protocol.cjs +2 -1
- package/dist/generated/protocol.d.cts +1 -1
- package/dist/generated/protocol.d.mts +1 -1
- package/dist/generated/protocol.mjs +2 -1
- package/dist/{identity-B1hBV3YA.d.mts → identity-B7YMBhMf.d.mts} +1 -1
- package/dist/{identity-BldV8xFj.d.cts → identity-COdFfaW8.d.cts} +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-Dhswk7YD.d.cts → protocol-B3U828E7.d.cts} +1 -0
- package/dist/{protocol-Dhswk7YD.d.mts → protocol-B3U828E7.d.mts} +1 -0
- package/dist/tokens-BxTxBmXt.cjs +499 -0
- package/dist/tokens-D2aFwPcZ.d.cts +122 -0
- package/dist/tokens-D9I1Pn14.mjs +464 -0
- package/dist/tokens-DSwixfDl.d.mts +122 -0
- package/dist/{transport-BNNdUBq-.d.mts → transport-B_diuPHT.d.mts} +1 -1
- package/dist/{transport-hEUxrdhT.d.cts → transport-BrAqN6I5.d.cts} +1 -1
- package/package.json +2 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { D as Frame } from "../protocol-
|
|
1
|
+
import { D as Frame } from "../protocol-B3U828E7.cjs";
|
|
2
2
|
//#region src/adapters/frame-codec.d.ts
|
|
3
3
|
export declare function messageFromFrame(frame: Frame): Uint8Array<ArrayBuffer>;
|
|
4
4
|
/** A frame that fails schema validation, caught separately from a decode failure so it can be dropped without disconnecting. */
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { D as Frame } from "../protocol-
|
|
1
|
+
import { D as Frame } from "../protocol-B3U828E7.mjs";
|
|
2
2
|
//#region src/adapters/frame-codec.d.ts
|
|
3
3
|
export declare function messageFromFrame(frame: Frame): Uint8Array<ArrayBuffer>;
|
|
4
4
|
/** A frame that fails schema validation, caught separately from a decode failure so it can be dropped without disconnecting. */
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { P as IdentityKey, x as DeviceId } from "../protocol-
|
|
2
|
-
import { t as IdentityPort } from "../identity-
|
|
1
|
+
import { P as IdentityKey, x as DeviceId } from "../protocol-B3U828E7.cjs";
|
|
2
|
+
import { t as IdentityPort } from "../identity-COdFfaW8.cjs";
|
|
3
3
|
import { webcrypto } from "node:crypto";
|
|
4
4
|
//#region src/adapters/node-identity.d.ts
|
|
5
5
|
export declare function deriveDeviceId(publicKey: Uint8Array): Promise<DeviceId>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { P as IdentityKey, x as DeviceId } from "../protocol-
|
|
2
|
-
import { t as IdentityPort } from "../identity-
|
|
1
|
+
import { P as IdentityKey, x as DeviceId } from "../protocol-B3U828E7.mjs";
|
|
2
|
+
import { t as IdentityPort } from "../identity-B7YMBhMf.mjs";
|
|
3
3
|
import { webcrypto } from "node:crypto";
|
|
4
4
|
//#region src/adapters/node-identity.d.ts
|
|
5
5
|
export declare function deriveDeviceId(publicKey: Uint8Array): Promise<DeviceId>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { r as Transport } from "../transport-
|
|
1
|
+
import { r as Transport } from "../transport-BrAqN6I5.cjs";
|
|
2
2
|
//#region src/adapters/tcp-transport.d.ts
|
|
3
3
|
/** A Node net.Socket-based Transport: length-prefixed, CBOR-encoded frames over plain TCP -- matching Cascade's own transport shape, since interop with Cascade nodes is wire-mesh's stated goal. Framing (not TLS) is this adapter's own concern; a TLS-terminated variant is a separate adapter behind the same Transport contract. */
|
|
4
4
|
export declare function createTcpTransport(): Transport;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { r as Transport } from "../transport-
|
|
1
|
+
import { r as Transport } from "../transport-B_diuPHT.mjs";
|
|
2
2
|
//#region src/adapters/tcp-transport.d.ts
|
|
3
3
|
/** A Node net.Socket-based Transport: length-prefixed, CBOR-encoded frames over plain TCP -- matching Cascade's own transport shape, since interop with Cascade nodes is wire-mesh's stated goal. Framing (not TLS) is this adapter's own concern; a TLS-terminated variant is a separate adapter behind the same Transport contract. */
|
|
4
4
|
export declare function createTcpTransport(): Transport;
|
|
@@ -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_tokens = require("../tokens-BxTxBmXt.cjs");
|
|
4
4
|
//#region src/domain/capability-grant.ts
|
|
5
5
|
/**
|
|
6
6
|
* The generic, capability-agnostic capability-grant primitive (wire-mesh#117, spec/management.cddl) -- the unsolicited push counterpart to capability-request.ts's own ask/response primitive. Where capability-request lifts core/room's room.join shape (a pull: the requester asks, the owner mints and returns a grant on the same response) out of that one domain, capability-grant lifts room.invite's own shape (a push: the owner mints unprompted and delivers the grant in the request itself, since there is no approval round-trip to carry it back) the same way. core/room's own room-client.ts is the reference consumer: it builds sendRoomInvite as a thin wrapper over sendCapabilityGrant below, and wires createRoomRouter's dispatch onto createCapabilityGrantHandler for the receiving side.
|
|
@@ -48,7 +48,7 @@ function createCapabilityGrantHandler(options) {
|
|
|
48
48
|
return;
|
|
49
49
|
}
|
|
50
50
|
const grantedToken = parsed.data["granted-token"];
|
|
51
|
-
const verdict = await
|
|
51
|
+
const verdict = await require_tokens.verifyCapabilityToken(grantedToken, {
|
|
52
52
|
identity: options.identity,
|
|
53
53
|
clock: options.clock,
|
|
54
54
|
revocation: options.revocation,
|
|
@@ -68,7 +68,7 @@ function createCapabilityGrantHandler(options) {
|
|
|
68
68
|
});
|
|
69
69
|
return;
|
|
70
70
|
}
|
|
71
|
-
if (!
|
|
71
|
+
if (!require_tokens.scopeNarrows(verdict.claims.scope, incoming.scope)) {
|
|
72
72
|
await incoming.respond({
|
|
73
73
|
result: "error",
|
|
74
74
|
code: "scope_mismatch"
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { F as ManageCommand, o as CapabilityScope, s as CapabilityToken, x as DeviceId } from "../protocol-
|
|
2
|
-
import { t as IdentityPort } from "../identity-
|
|
1
|
+
import { F as ManageCommand, o as CapabilityScope, s as CapabilityToken, x as DeviceId } from "../protocol-B3U828E7.cjs";
|
|
2
|
+
import { t as IdentityPort } from "../identity-COdFfaW8.cjs";
|
|
3
3
|
import { t as Clock } from "../clock-DiSx-WKM.cjs";
|
|
4
4
|
import { IncomingManageRequest, ManageOutcome, MeshSession } from "./mesh-session.cjs";
|
|
5
|
-
import { RevocationCheck } from "
|
|
5
|
+
import { a as RevocationCheck } from "../tokens-D2aFwPcZ.cjs";
|
|
6
6
|
//#region src/domain/capability-grant.d.ts
|
|
7
7
|
/**
|
|
8
8
|
* Builds a capability-grant command per management.cddl. The outer `manage-command.verb` is the capability string itself, the identical convention capability-request.ts's own buildCapabilityRequestCommand already establishes -- a receiver's per-capability handler is how it knows which grant this push is even for. `params.verb` is the fixed "capability.grant" marker. No scope or invitee field: manage-request-frame's own top-level scope already carries the former, and the request's own destination already carries the latter -- naming either a second time inside params could only ever disagree with the fact it duplicates.
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { F as ManageCommand, o as CapabilityScope, s as CapabilityToken, x as DeviceId } from "../protocol-
|
|
2
|
-
import { t as IdentityPort } from "../identity-
|
|
1
|
+
import { F as ManageCommand, o as CapabilityScope, s as CapabilityToken, x as DeviceId } from "../protocol-B3U828E7.mjs";
|
|
2
|
+
import { t as IdentityPort } from "../identity-B7YMBhMf.mjs";
|
|
3
3
|
import { t as Clock } from "../clock-DiSx-WKM.mjs";
|
|
4
4
|
import { IncomingManageRequest, ManageOutcome, MeshSession } from "./mesh-session.mjs";
|
|
5
|
-
import { RevocationCheck } from "
|
|
5
|
+
import { a as RevocationCheck } from "../tokens-DSwixfDl.mjs";
|
|
6
6
|
//#region src/domain/capability-grant.d.ts
|
|
7
7
|
/**
|
|
8
8
|
* Builds a capability-grant command per management.cddl. The outer `manage-command.verb` is the capability string itself, the identical convention capability-request.ts's own buildCapabilityRequestCommand already establishes -- a receiver's per-capability handler is how it knows which grant this push is even for. `params.verb` is the fixed "capability.grant" marker. No scope or invitee field: manage-request-frame's own top-level scope already carries the former, and the request's own destination already carries the latter -- naming either a second time inside params could only ever disagree with the fact it duplicates.
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { capabilityGrantSchema } from "../generated/protocol.mjs";
|
|
2
|
-
import {
|
|
2
|
+
import { i as verifyCapabilityToken, o as scopeNarrows } from "../tokens-D9I1Pn14.mjs";
|
|
3
3
|
//#region src/domain/capability-grant.ts
|
|
4
4
|
/**
|
|
5
5
|
* The generic, capability-agnostic capability-grant primitive (wire-mesh#117, spec/management.cddl) -- the unsolicited push counterpart to capability-request.ts's own ask/response primitive. Where capability-request lifts core/room's room.join shape (a pull: the requester asks, the owner mints and returns a grant on the same response) out of that one domain, capability-grant lifts room.invite's own shape (a push: the owner mints unprompted and delivers the grant in the request itself, since there is no approval round-trip to carry it back) the same way. core/room's own room-client.ts is the reference consumer: it builds sendRoomInvite as a thin wrapper over sendCapabilityGrant below, and wires createRoomRouter's dispatch onto createCapabilityGrantHandler for the receiving side.
|
|
@@ -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_tokens = require("../tokens-BxTxBmXt.cjs");
|
|
4
4
|
//#region src/domain/capability-request.ts
|
|
5
5
|
/**
|
|
6
6
|
* The generic, capability-agnostic capability-request / capability-grant-ok primitive (wire-mesh#78, spec/management.cddl). Lifts core/room's own room.join shape -- an ungated ask, held open, a human (or any other domain-supplied decision) accepts or refuses, acceptance mints and returns a token on the same response -- out of that one domain so any capability can reuse it, not just room:member. core/room's own room-client.ts is the reference consumer: it rewires requestToJoin/createRoomRouter's room.join handling onto requestCapability/createCapabilityRequestHandler below, supplying room-specific extension fields (its member list) through this module's own extensions mechanism rather than this module knowing anything about rooms.
|
|
@@ -85,7 +85,7 @@ function createCapabilityRequestHandler(options) {
|
|
|
85
85
|
});
|
|
86
86
|
return;
|
|
87
87
|
}
|
|
88
|
-
const verdict = await
|
|
88
|
+
const verdict = await require_tokens.mintCapabilityToken({
|
|
89
89
|
identity: options.identity,
|
|
90
90
|
clock: options.clock,
|
|
91
91
|
tokenId: randomTokenId(),
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { F as ManageCommand, i as CapabilityGrantOk, o as CapabilityScope, x as DeviceId } from "../protocol-
|
|
2
|
-
import { t as IdentityPort } from "../identity-
|
|
1
|
+
import { F as ManageCommand, i as CapabilityGrantOk, o as CapabilityScope, x as DeviceId } from "../protocol-B3U828E7.cjs";
|
|
2
|
+
import { t as IdentityPort } from "../identity-COdFfaW8.cjs";
|
|
3
3
|
import { t as Clock } from "../clock-DiSx-WKM.cjs";
|
|
4
4
|
import { IncomingManageRequest, MeshSession } from "./mesh-session.cjs";
|
|
5
5
|
//#region src/domain/capability-request.d.ts
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { F as ManageCommand, i as CapabilityGrantOk, o as CapabilityScope, x as DeviceId } from "../protocol-
|
|
2
|
-
import { t as IdentityPort } from "../identity-
|
|
1
|
+
import { F as ManageCommand, i as CapabilityGrantOk, o as CapabilityScope, x as DeviceId } from "../protocol-B3U828E7.mjs";
|
|
2
|
+
import { t as IdentityPort } from "../identity-B7YMBhMf.mjs";
|
|
3
3
|
import { t as Clock } from "../clock-DiSx-WKM.mjs";
|
|
4
4
|
import { IncomingManageRequest, MeshSession } from "./mesh-session.mjs";
|
|
5
5
|
//#region src/domain/capability-request.d.ts
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { capabilityGrantOkSchema, capabilityRequestSchema } from "../generated/protocol.mjs";
|
|
2
|
-
import { mintCapabilityToken } from "
|
|
2
|
+
import { n as mintCapabilityToken } from "../tokens-D9I1Pn14.mjs";
|
|
3
3
|
//#region src/domain/capability-request.ts
|
|
4
4
|
/**
|
|
5
5
|
* The generic, capability-agnostic capability-request / capability-grant-ok primitive (wire-mesh#78, spec/management.cddl). Lifts core/room's own room.join shape -- an ungated ask, held open, a human (or any other domain-supplied decision) accepts or refuses, acceptance mints and returns a token on the same response -- out of that one domain so any capability can reuse it, not just room:member. core/room's own room-client.ts is the reference consumer: it rewires requestToJoin/createRoomRouter's room.join handling onto requestCapability/createCapabilityRequestHandler below, supplying room-specific extension fields (its member list) through this module's own extensions mechanism rather than this module knowing anything about rooms.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { x as DeviceId } from "../protocol-
|
|
1
|
+
import { x as DeviceId } from "../protocol-B3U828E7.cjs";
|
|
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,4 +1,4 @@
|
|
|
1
|
-
import { x as DeviceId } from "../protocol-
|
|
1
|
+
import { x as DeviceId } from "../protocol-B3U828E7.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,4 +1,4 @@
|
|
|
1
|
-
import { M as HandshakeFrame, et as ProtocolVersion, w as DomainId } from "../protocol-
|
|
1
|
+
import { M as HandshakeFrame, et as ProtocolVersion, w as DomainId } from "../protocol-B3U828E7.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 { M as HandshakeFrame, et as ProtocolVersion, w as DomainId } from "../protocol-
|
|
1
|
+
import { M as HandshakeFrame, et as ProtocolVersion, w as DomainId } from "../protocol-B3U828E7.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,7 +1,7 @@
|
|
|
1
|
-
import { D as Frame, F as ManageCommand, K as PeerAdvert, L as ManageError, R as ManageOk, dt as RevocationEntry, et as ProtocolVersion, o as CapabilityScope, s as CapabilityToken, x as DeviceId } from "../protocol-
|
|
2
|
-
import { t as IdentityPort } from "../identity-
|
|
1
|
+
import { D as Frame, F as ManageCommand, K as PeerAdvert, L as ManageError, R as ManageOk, dt as RevocationEntry, et as ProtocolVersion, o as CapabilityScope, s as CapabilityToken, x as DeviceId } from "../protocol-B3U828E7.cjs";
|
|
2
|
+
import { t as IdentityPort } from "../identity-COdFfaW8.cjs";
|
|
3
3
|
import { t as Clock } from "../clock-DiSx-WKM.cjs";
|
|
4
|
-
import { r as Transport, t as Connection } from "../transport-
|
|
4
|
+
import { r as Transport, t as Connection } from "../transport-BrAqN6I5.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. */
|
|
7
7
|
export declare const HANDSHAKE_TIMEOUT_MS = 3000;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { D as Frame, F as ManageCommand, K as PeerAdvert, L as ManageError, R as ManageOk, dt as RevocationEntry, et as ProtocolVersion, o as CapabilityScope, s as CapabilityToken, x as DeviceId } from "../protocol-
|
|
2
|
-
import { t as IdentityPort } from "../identity-
|
|
1
|
+
import { D as Frame, F as ManageCommand, K as PeerAdvert, L as ManageError, R as ManageOk, dt as RevocationEntry, et as ProtocolVersion, o as CapabilityScope, s as CapabilityToken, x as DeviceId } from "../protocol-B3U828E7.mjs";
|
|
2
|
+
import { t as IdentityPort } from "../identity-B7YMBhMf.mjs";
|
|
3
3
|
import { t as Clock } from "../clock-DiSx-WKM.mjs";
|
|
4
|
-
import { r as Transport, t as Connection } from "../transport-
|
|
4
|
+
import { r as Transport, t as Connection } from "../transport-B_diuPHT.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. */
|
|
7
7
|
export declare const HANDSHAKE_TIMEOUT_MS = 3000;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as Connection } from "../transport-
|
|
1
|
+
import { t as Connection } from "../transport-BrAqN6I5.cjs";
|
|
2
2
|
//#region src/domain/relay-hub.d.ts
|
|
3
3
|
export interface RelayHub {
|
|
4
4
|
/** Drives one accepted connection until it closes: registers gossip-advertised devices, re-broadcasts each gossip frame to every other connected client and replies to the gossiping connection with a catch-up frame of every other already-known device, answers relay-connect by pairing and notifying the target, and forwards relay-data within established pairings. Resolves when the connection's frame stream ends. */
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as Connection } from "../transport-
|
|
1
|
+
import { t as Connection } from "../transport-B_diuPHT.mjs";
|
|
2
2
|
//#region src/domain/relay-hub.d.ts
|
|
3
3
|
export interface RelayHub {
|
|
4
4
|
/** Drives one accepted connection until it closes: registers gossip-advertised devices, re-broadcasts each gossip frame to every other connected client and replies to the gossiping connection with a catch-up frame of every other already-known device, answers relay-connect by pairing and notifying the target, and forwards relay-data within established pairings. Resolves when the connection's frame stream ends. */
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
const
|
|
2
|
+
const require_tokens = require("../tokens-BxTxBmXt.cjs");
|
|
3
3
|
const require_domain_device_id = require("./device-id.cjs");
|
|
4
4
|
//#region src/domain/revocation-view.ts
|
|
5
5
|
function revocationKey(tokenId, issuer) {
|
|
@@ -12,7 +12,7 @@ function createRevocationView() {
|
|
|
12
12
|
return Promise.resolve(revoked.has(revocationKey(tokenId, issuer)));
|
|
13
13
|
},
|
|
14
14
|
async record(entry, options) {
|
|
15
|
-
const verdict = await
|
|
15
|
+
const verdict = await require_tokens.verifyRevocationEntry(entry, options);
|
|
16
16
|
if (verdict.ok) revoked.add(revocationKey(verdict.claims["token-id"], verdict.claims.issuer));
|
|
17
17
|
return verdict;
|
|
18
18
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { dt as RevocationEntry } from "../protocol-
|
|
2
|
-
import { RevocationCheck,
|
|
1
|
+
import { dt as RevocationEntry } from "../protocol-B3U828E7.cjs";
|
|
2
|
+
import { a as RevocationCheck, d as VerifyRevocationEntryOptions, o as RevocationEntryVerdict } from "../tokens-D2aFwPcZ.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, issuer) per management.cddl's contract: an entry counts against a token only when both match, so a third party's entry for someone else's token-id is stored (it is a well-formed, self-certifying entry) but never matches a lookup for the token it does not actually govern.
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { dt as RevocationEntry } from "../protocol-
|
|
2
|
-
import { RevocationCheck,
|
|
1
|
+
import { dt as RevocationEntry } from "../protocol-B3U828E7.mjs";
|
|
2
|
+
import { a as RevocationCheck, d as VerifyRevocationEntryOptions, o as RevocationEntryVerdict } from "../tokens-DSwixfDl.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, issuer) per management.cddl's contract: an entry counts against a token only when both match, so a third party's entry for someone else's token-id is stored (it is a well-formed, self-certifying entry) but never matches a lookup for the token it does not actually govern.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { verifyRevocationEntry } from "
|
|
1
|
+
import { a as verifyRevocationEntry } from "../tokens-D9I1Pn14.mjs";
|
|
2
2
|
import { bytesToHex, deviceIdToHex } from "./device-id.mjs";
|
|
3
3
|
//#region src/domain/revocation-view.ts
|
|
4
4
|
function revocationKey(tokenId, issuer) {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
const
|
|
2
|
+
const require_tokens = require("../tokens-BxTxBmXt.cjs");
|
|
3
3
|
const require_domain_device_id = require("./device-id.cjs");
|
|
4
4
|
const require_domain_room_path = require("./room-path.cjs");
|
|
5
5
|
//#region src/domain/room-token-verification.ts
|
|
@@ -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_tokens.verifyCapabilityToken(token, {
|
|
16
16
|
identity: options.identity,
|
|
17
17
|
clock: options.clock,
|
|
18
18
|
revocation: options.revocation,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { kt as TokenClaims, s as CapabilityToken, x as DeviceId } from "../protocol-
|
|
2
|
-
import { TokenVerdictReason, VerifyCapabilityTokenOptions } from "
|
|
1
|
+
import { kt as TokenClaims, s as CapabilityToken, x as DeviceId } from "../protocol-B3U828E7.cjs";
|
|
2
|
+
import { l as TokenVerdictReason, u as VerifyCapabilityTokenOptions } from "../tokens-D2aFwPcZ.cjs";
|
|
3
3
|
//#region src/domain/room-token-verification.d.ts
|
|
4
4
|
/** The one capability every core/room verb (room.send/read/leave/members) is gated by, per spec/room.cddl -- room.join/room.invite are deliberately ungated instead and need no token check at all. */
|
|
5
5
|
export declare const ROOM_MEMBER_CAPABILITY = "room:member";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { kt as TokenClaims, s as CapabilityToken, x as DeviceId } from "../protocol-
|
|
2
|
-
import { TokenVerdictReason, VerifyCapabilityTokenOptions } from "
|
|
1
|
+
import { kt as TokenClaims, s as CapabilityToken, x as DeviceId } from "../protocol-B3U828E7.mjs";
|
|
2
|
+
import { l as TokenVerdictReason, u as VerifyCapabilityTokenOptions } from "../tokens-DSwixfDl.mjs";
|
|
3
3
|
//#region src/domain/room-token-verification.d.ts
|
|
4
4
|
/** The one capability every core/room verb (room.send/read/leave/members) is gated by, per spec/room.cddl -- room.join/room.invite are deliberately ungated instead and need no token check at all. */
|
|
5
5
|
export declare const ROOM_MEMBER_CAPABILITY = "room:member";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { verifyCapabilityToken } from "
|
|
1
|
+
import { i as verifyCapabilityToken } from "../tokens-D9I1Pn14.mjs";
|
|
2
2
|
import { deviceIdToHex } from "./device-id.mjs";
|
|
3
3
|
import { parseRoomPath } from "./room-path.mjs";
|
|
4
4
|
//#region src/domain/room-token-verification.ts
|