@ocap/chain-node 1.32.2 → 1.32.3
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/esm/did-tls.d.mts +192 -0
- package/esm/did-tls.mjs +1606 -0
- package/esm/env.d.mts +17 -2
- package/esm/env.mjs +126 -1
- package/esm/follower-config.mjs +1 -1
- package/esm/index.d.mts +6 -4
- package/esm/index.mjs +5 -3
- package/esm/mesh-egress.d.mts +30 -0
- package/esm/mesh-egress.mjs +152 -0
- package/esm/start-chain-node.d.mts +6 -1
- package/esm/start-chain-node.mjs +774 -47
- package/esm/types.d.mts +63 -2
- package/lib/did-tls.cjs +1628 -0
- package/lib/did-tls.d.cts +192 -0
- package/lib/env.cjs +131 -1
- package/lib/env.d.cts +17 -2
- package/lib/follower-config.cjs +1 -1
- package/lib/index.cjs +30 -1
- package/lib/index.d.cts +6 -4
- package/lib/mesh-egress.cjs +155 -0
- package/lib/mesh-egress.d.cts +30 -0
- package/lib/start-chain-node.cjs +778 -48
- package/lib/start-chain-node.d.cts +6 -1
- package/lib/types.d.cts +62 -1
- package/package.json +16 -16
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { DnsLookupAllFn } from "@ocap/resolver";
|
|
2
|
+
|
|
3
|
+
//#region src/mesh-egress.d.ts
|
|
4
|
+
|
|
5
|
+
interface ValidatedMeshEgress {
|
|
6
|
+
readonly normalizedUrl: string;
|
|
7
|
+
readonly origin: string;
|
|
8
|
+
readonly hostname: '127.0.0.1' | '[::1]';
|
|
9
|
+
readonly port: number;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Parse and strictly validate `ARC_MESH_EGRESS_URL` / `meshEgressUrl` at config parse time.
|
|
13
|
+
* Must be `http:` on literal `127.0.0.1` or `[::1]` with an explicit port `1..65535`,
|
|
14
|
+
* no credentials, no subpath, and no query/hash.
|
|
15
|
+
*/
|
|
16
|
+
declare function parseMeshEgressUrl(rawUrl: string | undefined | null, label?: string): ValidatedMeshEgress | null;
|
|
17
|
+
/**
|
|
18
|
+
* Create a connect-time SSRF guard for `@ocap/chain-node` outbound peer requests
|
|
19
|
+
* that pins local loopback access exclusively to `meshEgress` (`redirect: 'error'`)
|
|
20
|
+
* when `allowPrivatePeers` is false.
|
|
21
|
+
*/
|
|
22
|
+
declare function createChainNodePeerFetchGuard(options: {
|
|
23
|
+
allowPrivatePeers?: boolean;
|
|
24
|
+
meshEgress?: ValidatedMeshEgress | null;
|
|
25
|
+
trustedStaticUrls?: Array<string | undefined | null>;
|
|
26
|
+
dnsLookup?: DnsLookupAllFn;
|
|
27
|
+
baseFetch?: typeof fetch;
|
|
28
|
+
}): typeof fetch;
|
|
29
|
+
//#endregion
|
|
30
|
+
export { ValidatedMeshEgress, createChainNodePeerFetchGuard, parseMeshEgressUrl };
|