@nekzus/liop 2.5.0-beta.1 → 2.5.0-beta.2
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/NOTICE +19 -0
- package/README.md +66 -34
- package/dist/bin/agent.js +673 -82
- package/dist/bin/agent.js.map +1 -1
- package/dist/bridge.d.ts +3 -3
- package/dist/bridge.js +3 -3
- package/dist/{chunk-PYKRQAER.js → chunk-2KSO3W4A.js} +2 -2
- package/dist/chunk-2KSO3W4A.js.map +1 -0
- package/dist/{chunk-32ADSAJS.js → chunk-2STZHJ24.js} +14 -4
- package/dist/chunk-2STZHJ24.js.map +1 -0
- package/dist/chunk-3QH44NKZ.js +115 -0
- package/dist/chunk-3QH44NKZ.js.map +1 -0
- package/dist/{chunk-WCCGE4QR.js → chunk-5SWHE62F.js} +196 -33
- package/dist/chunk-5SWHE62F.js.map +1 -0
- package/dist/{chunk-SONUORBT.js → chunk-7BSCUYUE.js} +2 -2
- package/dist/chunk-7BSCUYUE.js.map +1 -0
- package/dist/{chunk-QLCOEP5J.js → chunk-7PITYWOV.js} +2 -2
- package/dist/chunk-7PITYWOV.js.map +1 -0
- package/dist/{chunk-T5IUZF47.js → chunk-EJ426URA.js} +109 -7
- package/dist/chunk-EJ426URA.js.map +1 -0
- package/dist/{chunk-CRZBVFDV.js → chunk-FCFTYOAS.js} +243 -66
- package/dist/chunk-FCFTYOAS.js.map +1 -0
- package/dist/chunk-FTF6AMF6.js +3 -0
- package/dist/{chunk-RWRRBYG4.js.map → chunk-FTF6AMF6.js.map} +1 -1
- package/dist/{chunk-OUUTDSOW.js → chunk-IK7CGWAZ.js} +3 -3
- package/dist/chunk-IK7CGWAZ.js.map +1 -0
- package/dist/chunk-K3DGJLUY.js +106 -0
- package/dist/chunk-K3DGJLUY.js.map +1 -0
- package/dist/{chunk-U5BZ66VX.js → chunk-PAICJCKJ.js} +60 -175
- package/dist/chunk-PAICJCKJ.js.map +1 -0
- package/dist/chunk-PUDETPL4.js +279 -0
- package/dist/chunk-PUDETPL4.js.map +1 -0
- package/dist/{chunk-547TYL27.js → chunk-UJFWPRDM.js} +164 -1389
- package/dist/chunk-UJFWPRDM.js.map +1 -0
- package/dist/chunk-VRB5HUYU.js +1492 -0
- package/dist/chunk-VRB5HUYU.js.map +1 -0
- package/dist/{chunk-GA3Q2S7O.js → chunk-VRDZ5IKE.js} +5 -5
- package/dist/chunk-VRDZ5IKE.js.map +1 -0
- package/dist/chunk-WPTOJYN5.js +181 -0
- package/dist/chunk-WPTOJYN5.js.map +1 -0
- package/dist/{chunk-74CISO2I.js → chunk-XRDN232O.js} +28 -4
- package/dist/chunk-XRDN232O.js.map +1 -0
- package/dist/{chunk-JIJPZFR2.js → chunk-Y62GORQF.js} +2 -2
- package/dist/chunk-Y62GORQF.js.map +1 -0
- package/dist/chunk-ZP3VVXOI.js +66 -0
- package/dist/chunk-ZP3VVXOI.js.map +1 -0
- package/dist/client.d.ts +4 -3
- package/dist/client.js +10 -8
- package/dist/gateway.d.ts +4 -4
- package/dist/gateway.js +10 -9
- package/dist/{hybrid-CF__0YnC.d.ts → hybrid-DWe1bMoV.d.ts} +5 -4
- package/dist/{index-cMV0_yD9.d.ts → index-BuEQtBHD.d.ts} +39 -34
- package/dist/{index-BW95kAL4.d.ts → index-CdW8j8Bn.d.ts} +9 -72
- package/dist/index.d.ts +172 -48
- package/dist/index.js +20 -15
- package/dist/index.js.map +1 -1
- package/dist/kyber-CGOA7Q6A.js +3 -0
- package/dist/{kyber-3ULIJSE3.js.map → kyber-CGOA7Q6A.js.map} +1 -1
- package/dist/mesh.d.ts +27 -143
- package/dist/mesh.js +4 -3
- package/dist/node-B0b2vUFS.d.ts +164 -0
- package/dist/protocol/liop_core.proto +3 -0
- package/dist/server.d.ts +3 -3
- package/dist/server.js +7 -6
- package/dist/types-CzRSOlOo.d.ts +452 -0
- package/dist/types.d.ts +1 -1
- package/dist/types.js +1 -1
- package/dist/verifier-XFU7ZB2W.js +6 -0
- package/dist/{verifier-3FAKCFNN.js.map → verifier-XFU7ZB2W.js.map} +1 -1
- package/dist/workers/logic-execution.js +3 -3
- package/dist/workers/logic-execution.js.map +1 -1
- package/dist/workers/zk-verifier.js +1 -1
- package/dist/workers/zk-verifier.js.map +1 -1
- package/package.json +50 -44
- package/dist/chunk-32ADSAJS.js.map +0 -1
- package/dist/chunk-547TYL27.js.map +0 -1
- package/dist/chunk-72MNYFR6.js +0 -64
- package/dist/chunk-72MNYFR6.js.map +0 -1
- package/dist/chunk-74CISO2I.js.map +0 -1
- package/dist/chunk-CRZBVFDV.js.map +0 -1
- package/dist/chunk-GA3Q2S7O.js.map +0 -1
- package/dist/chunk-JIJPZFR2.js.map +0 -1
- package/dist/chunk-OUUTDSOW.js.map +0 -1
- package/dist/chunk-PYKRQAER.js.map +0 -1
- package/dist/chunk-QLCOEP5J.js.map +0 -1
- package/dist/chunk-RWRRBYG4.js +0 -3
- package/dist/chunk-SONUORBT.js.map +0 -1
- package/dist/chunk-T5IUZF47.js.map +0 -1
- package/dist/chunk-U5BZ66VX.js.map +0 -1
- package/dist/chunk-WCCGE4QR.js.map +0 -1
- package/dist/chunk-WSW6YJNY.js +0 -168
- package/dist/chunk-WSW6YJNY.js.map +0 -1
- package/dist/kyber-3ULIJSE3.js +0 -3
- package/dist/types-lJIxBlWF.d.ts +0 -256
- package/dist/verifier-3FAKCFNN.js +0 -5
package/dist/chunk-WSW6YJNY.js
DELETED
|
@@ -1,168 +0,0 @@
|
|
|
1
|
-
import { log } from './chunk-72MNYFR6.js';
|
|
2
|
-
import path from 'path';
|
|
3
|
-
import { fileURLToPath } from 'url';
|
|
4
|
-
import * as grpc2 from '@grpc/grpc-js';
|
|
5
|
-
import * as protoLoader from '@grpc/proto-loader';
|
|
6
|
-
import * as fs2 from 'fs';
|
|
7
|
-
|
|
8
|
-
// src/rpc/channel-options.ts
|
|
9
|
-
var GRPC_CHANNEL_OPTIONS = {
|
|
10
|
-
"grpc.keepalive_time_ms": 3e4,
|
|
11
|
-
"grpc.keepalive_timeout_ms": 1e4,
|
|
12
|
-
"grpc.keepalive_permit_without_calls": 1,
|
|
13
|
-
"grpc.max_send_message_length": -1,
|
|
14
|
-
"grpc.max_receive_message_length": -1,
|
|
15
|
-
"grpc.enable_retries": 1
|
|
16
|
-
};
|
|
17
|
-
var __filename2 = fileURLToPath(import.meta.url);
|
|
18
|
-
var __dirname2 = path.dirname(__filename2);
|
|
19
|
-
var PROD_PATHS = [
|
|
20
|
-
path.resolve(__dirname2, "./protocol/liop_core.proto"),
|
|
21
|
-
// Flat dist/ (tsup)
|
|
22
|
-
path.resolve(__dirname2, "../protocol/liop_core.proto")
|
|
23
|
-
// dist/rpc/ (tsc)
|
|
24
|
-
];
|
|
25
|
-
var DEV_PROTO_PATH = path.resolve(
|
|
26
|
-
__dirname2,
|
|
27
|
-
"../../../../protocol/proto/liop_core.proto"
|
|
28
|
-
);
|
|
29
|
-
var PROTO_PATH = PROD_PATHS.find((p) => fs2.existsSync(p)) || DEV_PROTO_PATH;
|
|
30
|
-
if (!fs2.existsSync(PROTO_PATH)) {
|
|
31
|
-
log.error(`[LIOP-Proto] CRITICAL: Proto file not found at ${PROTO_PATH}`);
|
|
32
|
-
}
|
|
33
|
-
var packageDefinition = protoLoader.loadSync(PROTO_PATH, {
|
|
34
|
-
keepCase: true,
|
|
35
|
-
longs: String,
|
|
36
|
-
enums: String,
|
|
37
|
-
defaults: true,
|
|
38
|
-
oneofs: true
|
|
39
|
-
});
|
|
40
|
-
var liopProto = grpc2.loadPackageDefinition(packageDefinition);
|
|
41
|
-
var liopV1 = liopProto.liop.v1;
|
|
42
|
-
var isTlsEnforced = () => process.env.NODE_ENV === "production" || process.env.LIOP_ENFORCE_TLS === "true";
|
|
43
|
-
function createServerCredentials(tls) {
|
|
44
|
-
if (tls?.mutualTls && !tls.rootCert && !tls.certManager?.getRootCert()) {
|
|
45
|
-
throw new Error(
|
|
46
|
-
"[LIOP-TLS] FATAL: Mutual TLS (mTLS) enabled but no root CA certificate (rootCert) provided to verify client certificates."
|
|
47
|
-
);
|
|
48
|
-
}
|
|
49
|
-
if (tls?.certManager) {
|
|
50
|
-
try {
|
|
51
|
-
const certChain = tls.certManager.getCertChain();
|
|
52
|
-
const privateKey = tls.certManager.getPrivateKey();
|
|
53
|
-
const rootCert = tls.certManager.getRootCert();
|
|
54
|
-
if (tls.mutualTls && !rootCert) {
|
|
55
|
-
throw new Error(
|
|
56
|
-
"[LIOP-TLS] FATAL: Mutual TLS (mTLS) enabled but CertManager has no root CA certificate loaded."
|
|
57
|
-
);
|
|
58
|
-
}
|
|
59
|
-
return grpc2.ServerCredentials.createSsl(
|
|
60
|
-
rootCert,
|
|
61
|
-
[{ cert_chain: certChain, private_key: privateKey }],
|
|
62
|
-
Boolean(tls.mutualTls)
|
|
63
|
-
);
|
|
64
|
-
} catch (error) {
|
|
65
|
-
if (isTlsEnforced()) {
|
|
66
|
-
throw new Error(
|
|
67
|
-
`[LIOP-TLS] FATAL: CertManager server credential creation failed in enforced mode: ${error}`
|
|
68
|
-
);
|
|
69
|
-
}
|
|
70
|
-
log.warn(
|
|
71
|
-
`[LIOP-TLS] CertManager failed, falling back to insecure: ${error}`
|
|
72
|
-
);
|
|
73
|
-
return grpc2.ServerCredentials.createInsecure();
|
|
74
|
-
}
|
|
75
|
-
}
|
|
76
|
-
if (!tls?.certChain || !tls?.privateKey) {
|
|
77
|
-
if (isTlsEnforced()) {
|
|
78
|
-
throw new Error(
|
|
79
|
-
"[LIOP-TLS] FATAL: TLS certificates required in production or when LIOP_ENFORCE_TLS=true."
|
|
80
|
-
);
|
|
81
|
-
}
|
|
82
|
-
log.warn(
|
|
83
|
-
"[LIOP-TLS] No TLS certificates configured \u2014 using insecure server credentials"
|
|
84
|
-
);
|
|
85
|
-
return grpc2.ServerCredentials.createInsecure();
|
|
86
|
-
}
|
|
87
|
-
try {
|
|
88
|
-
const rootCert = tls.rootCert ? fs2.readFileSync(tls.rootCert) : null;
|
|
89
|
-
const certChain = fs2.readFileSync(tls.certChain);
|
|
90
|
-
const privateKey = fs2.readFileSync(tls.privateKey);
|
|
91
|
-
if (tls.mutualTls && !rootCert) {
|
|
92
|
-
throw new Error(
|
|
93
|
-
"[LIOP-TLS] FATAL: Mutual TLS (mTLS) enabled but no root CA certificate (rootCert) provided to verify client certificates."
|
|
94
|
-
);
|
|
95
|
-
}
|
|
96
|
-
return grpc2.ServerCredentials.createSsl(
|
|
97
|
-
rootCert,
|
|
98
|
-
[{ cert_chain: certChain, private_key: privateKey }],
|
|
99
|
-
Boolean(tls.mutualTls)
|
|
100
|
-
);
|
|
101
|
-
} catch (error) {
|
|
102
|
-
if (isTlsEnforced()) {
|
|
103
|
-
throw new Error(
|
|
104
|
-
`[LIOP-TLS] FATAL: Server certificate loading failed in production or enforced mode. Refusing insecure fallback to prevent MITM/eavesdropping: ${error}`
|
|
105
|
-
);
|
|
106
|
-
}
|
|
107
|
-
log.warn(
|
|
108
|
-
`[LIOP-TLS] Server certificate loading failed, falling back to insecure (dev mode): ${error}`
|
|
109
|
-
);
|
|
110
|
-
return grpc2.ServerCredentials.createInsecure();
|
|
111
|
-
}
|
|
112
|
-
}
|
|
113
|
-
function createChannelCredentials(tls) {
|
|
114
|
-
if (tls?.certManager) {
|
|
115
|
-
try {
|
|
116
|
-
const rootCert = tls.certManager.getRootCert();
|
|
117
|
-
if (!rootCert) {
|
|
118
|
-
throw new Error(
|
|
119
|
-
"[LIOP-TLS] FATAL: Channel TLS requires a root CA certificate in CertManager."
|
|
120
|
-
);
|
|
121
|
-
}
|
|
122
|
-
const certChain = tls.certManager.getCertChain();
|
|
123
|
-
const privateKey = tls.certManager.getPrivateKey();
|
|
124
|
-
return grpc2.credentials.createSsl(rootCert, privateKey, certChain);
|
|
125
|
-
} catch (error) {
|
|
126
|
-
if (isTlsEnforced()) {
|
|
127
|
-
throw new Error(
|
|
128
|
-
`[LIOP-TLS] FATAL: Channel certificate loading failed in enforced mode: ${error}`
|
|
129
|
-
);
|
|
130
|
-
}
|
|
131
|
-
log.warn(
|
|
132
|
-
`[LIOP-TLS] Channel CertManager failed, falling back to insecure: ${error}`
|
|
133
|
-
);
|
|
134
|
-
return grpc2.credentials.createInsecure();
|
|
135
|
-
}
|
|
136
|
-
}
|
|
137
|
-
if (!tls?.rootCert) {
|
|
138
|
-
if (isTlsEnforced()) {
|
|
139
|
-
throw new Error(
|
|
140
|
-
"[LIOP-TLS] FATAL: TLS root certificate required in production or when LIOP_ENFORCE_TLS=true."
|
|
141
|
-
);
|
|
142
|
-
}
|
|
143
|
-
log.warn(
|
|
144
|
-
"[LIOP-TLS] No TLS root certificate configured \u2014 using insecure channel credentials"
|
|
145
|
-
);
|
|
146
|
-
return grpc2.credentials.createInsecure();
|
|
147
|
-
}
|
|
148
|
-
try {
|
|
149
|
-
const rootCert = fs2.readFileSync(tls.rootCert);
|
|
150
|
-
const certChain = tls.certChain ? fs2.readFileSync(tls.certChain) : void 0;
|
|
151
|
-
const privateKey = tls.privateKey ? fs2.readFileSync(tls.privateKey) : void 0;
|
|
152
|
-
return grpc2.credentials.createSsl(rootCert, privateKey, certChain);
|
|
153
|
-
} catch (error) {
|
|
154
|
-
if (isTlsEnforced()) {
|
|
155
|
-
throw new Error(
|
|
156
|
-
`[LIOP-TLS] FATAL: Channel certificate loading failed in production or enforced mode. Refusing insecure fallback to prevent MITM/eavesdropping: ${error}`
|
|
157
|
-
);
|
|
158
|
-
}
|
|
159
|
-
log.warn(
|
|
160
|
-
`[LIOP-TLS] Channel certificate loading failed, falling back to insecure (dev mode): ${error}`
|
|
161
|
-
);
|
|
162
|
-
return grpc2.credentials.createInsecure();
|
|
163
|
-
}
|
|
164
|
-
}
|
|
165
|
-
|
|
166
|
-
export { GRPC_CHANNEL_OPTIONS, createChannelCredentials, createServerCredentials, liopV1 };
|
|
167
|
-
//# sourceMappingURL=chunk-WSW6YJNY.js.map
|
|
168
|
-
//# sourceMappingURL=chunk-WSW6YJNY.js.map
|
|
@@ -1 +0,0 @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,CAAA,WAAA,CAAY,SAAA,CAAU,QAAA,EAAU,UAAA,EAAY,SAAS,CAAA;AAAA,EAClE,SAAS,KAAA,EAAO;AACf,IAAA,IAAI,eAAc,EAAG;AACpB,MAAA,MAAM,IAAI,KAAA;AAAA,QACT,kJAC8D,KAAK,CAAA;AAAA,OACpE;AAAA,IACD;AACA,IAAA,GAAA,CAAI,IAAA;AAAA,MACH,uFAAuF,KAAK,CAAA;AAAA,KAC7F;AACA,IAAA,OAAY,kBAAY,cAAA,EAAe;AAAA,EACxC;AACD","file":"chunk-WSW6YJNY.js","sourcesContent":["/**\n * LIOP Production-Grade gRPC Channel Options\n *\n * Enforces bidirectional symmetry between LiopRpcServer, LiopRpcClient,\n * and gateway proxy channels per NIST SP 800-207 continuous verification.\n * Prevents silent disconnections behind corporate stateful firewalls and NAT gateways.\n */\nexport const GRPC_CHANNEL_OPTIONS: Readonly<Record<string, string | number>> = {\n\t\"grpc.keepalive_time_ms\": 30_000,\n\t\"grpc.keepalive_timeout_ms\": 10_000,\n\t\"grpc.keepalive_permit_without_calls\": 1,\n\t\"grpc.max_send_message_length\": -1,\n\t\"grpc.max_receive_message_length\": -1,\n\t\"grpc.enable_retries\": 1,\n};\n","import path from \"node:path\";\nimport { fileURLToPath } from \"node:url\";\nimport * as grpc from \"@grpc/grpc-js\";\nimport * as protoLoader from \"@grpc/proto-loader\";\n\nconst __filename = fileURLToPath(import.meta.url);\nconst __dirname = path.dirname(__filename);\n\nimport * as fs from \"node:fs\";\nimport { log } from \"../utils/logger.js\";\n\n// Selection logic: support both flat dist/ and original src/ structure\nconst PROD_PATHS = [\n\tpath.resolve(__dirname, \"./protocol/liop_core.proto\"), // Flat dist/ (tsup)\n\tpath.resolve(__dirname, \"../protocol/liop_core.proto\"), // dist/rpc/ (tsc)\n];\n\nconst DEV_PROTO_PATH = path.resolve(\n\t__dirname,\n\t\"../../../../protocol/proto/liop_core.proto\",\n);\n\n// Selection logic\nconst PROTO_PATH = PROD_PATHS.find((p) => fs.existsSync(p)) || DEV_PROTO_PATH;\n\nif (!fs.existsSync(PROTO_PATH)) {\n\tlog.error(`[LIOP-Proto] CRITICAL: Proto file not found at ${PROTO_PATH}`);\n}\n\n/**\n * LIOP Proto Loader\n * Loads the core gRPC definitions for the Logic-Injection-on-Origin Protocol.\n */\nconst packageDefinition = protoLoader.loadSync(PROTO_PATH, {\n\tkeepCase: true,\n\tlongs: String,\n\tenums: String,\n\tdefaults: true,\n\toneofs: true,\n});\n\n// biome-ignore lint/suspicious/noExplicitAny: gRPC dynamic loading requires any for the service definition map\nexport const liopProto = grpc.loadPackageDefinition(packageDefinition) as any;\nexport const liopV1 = liopProto.liop.v1;\n","/**\n * LIOP TLS Configuration\n *\n * Provides conditional TLS credential factories for gRPC connections.\n * When TLS options are provided, connections are secured with mutual TLS.\n * Otherwise, falls back to insecure credentials (alpha/development mode).\n *\n * Production Hardening (Phase 128):\n * - When NODE_ENV=production and TLS is configured but certificate loading\n * fails, the system throws a fatal error instead of silently degrading\n * to insecure credentials. This prevents MITM/eavesdropping attacks\n * caused by misconfigured certificate paths going unnoticed.\n * - Reference: gRPC-node official docs — \"Using insecure credentials in\n * production poses significant security risks including eavesdropping,\n * MITM attacks, and lack of authentication.\"\n */\n\nimport * as fs from \"node:fs\";\nimport * as grpc from \"@grpc/grpc-js\";\nimport type { CertManager } from \"../security/cert-manager.js\";\nimport { log } from \"../utils/logger.js\";\n\nexport interface LiopTlsOptions {\n\t/** Path to the root CA certificate (PEM format) */\n\trootCert?: string;\n\t/** Path to the server/client certificate (PEM format) */\n\tcertChain?: string;\n\t/** Path to the private key (PEM format) */\n\tprivateKey?: string;\n\t/** Require mutual TLS (mTLS): verify client certificate against root CA */\n\tmutualTls?: boolean;\n\t/** Optional CertManager instance for automated certificate management and hot reloading */\n\tcertManager?: CertManager;\n}\n\nconst isTlsEnforced = () =>\n\tprocess.env.NODE_ENV === \"production\" ||\n\tprocess.env.LIOP_ENFORCE_TLS === \"true\";\n\n/**\n * Creates gRPC server credentials from TLS options.\n * In production or when LIOP_ENFORCE_TLS=true, refuses to fall back to insecure.\n * When mutualTls=true, enforces client certificate authentication against root CA.\n */\nexport function createServerCredentials(\n\ttls?: LiopTlsOptions,\n): grpc.ServerCredentials {\n\t// Mutual TLS requires a root CA certificate to authenticate clients\n\tif (tls?.mutualTls && !tls.rootCert && !tls.certManager?.getRootCert()) {\n\t\tthrow new Error(\n\t\t\t\"[LIOP-TLS] FATAL: Mutual TLS (mTLS) enabled but no root CA certificate (rootCert) provided to verify client certificates.\",\n\t\t);\n\t}\n\n\t// If CertManager is provided, use its in-memory cached buffers\n\tif (tls?.certManager) {\n\t\ttry {\n\t\t\tconst certChain = tls.certManager.getCertChain();\n\t\t\tconst privateKey = tls.certManager.getPrivateKey();\n\t\t\tconst rootCert = tls.certManager.getRootCert();\n\n\t\t\tif (tls.mutualTls && !rootCert) {\n\t\t\t\tthrow new Error(\n\t\t\t\t\t\"[LIOP-TLS] FATAL: Mutual TLS (mTLS) enabled but CertManager has no root CA certificate loaded.\",\n\t\t\t\t);\n\t\t\t}\n\n\t\t\treturn grpc.ServerCredentials.createSsl(\n\t\t\t\trootCert,\n\t\t\t\t[{ cert_chain: certChain, private_key: privateKey }],\n\t\t\t\tBoolean(tls.mutualTls),\n\t\t\t);\n\t\t} catch (error) {\n\t\t\tif (isTlsEnforced()) {\n\t\t\t\tthrow new Error(\n\t\t\t\t\t`[LIOP-TLS] FATAL: CertManager server credential creation failed in enforced mode: ${error}`,\n\t\t\t\t);\n\t\t\t}\n\t\t\tlog.warn(\n\t\t\t\t`[LIOP-TLS] CertManager failed, falling back to insecure: ${error}`,\n\t\t\t);\n\t\t\treturn grpc.ServerCredentials.createInsecure();\n\t\t}\n\t}\n\n\tif (!tls?.certChain || !tls?.privateKey) {\n\t\tif (isTlsEnforced()) {\n\t\t\tthrow new Error(\n\t\t\t\t\"[LIOP-TLS] FATAL: TLS certificates required in production or when LIOP_ENFORCE_TLS=true.\",\n\t\t\t);\n\t\t}\n\t\tlog.warn(\n\t\t\t\"[LIOP-TLS] No TLS certificates configured — using insecure server credentials\",\n\t\t);\n\t\treturn grpc.ServerCredentials.createInsecure();\n\t}\n\n\ttry {\n\t\tconst rootCert = tls.rootCert ? fs.readFileSync(tls.rootCert) : null;\n\t\tconst certChain = fs.readFileSync(tls.certChain);\n\t\tconst privateKey = fs.readFileSync(tls.privateKey);\n\n\t\tif (tls.mutualTls && !rootCert) {\n\t\t\tthrow new Error(\n\t\t\t\t\"[LIOP-TLS] FATAL: Mutual TLS (mTLS) enabled but no root CA certificate (rootCert) provided to verify client certificates.\",\n\t\t\t);\n\t\t}\n\n\t\treturn grpc.ServerCredentials.createSsl(\n\t\t\trootCert,\n\t\t\t[{ cert_chain: certChain, private_key: privateKey }],\n\t\t\tBoolean(tls.mutualTls),\n\t\t);\n\t} catch (error) {\n\t\tif (isTlsEnforced()) {\n\t\t\tthrow new Error(\n\t\t\t\t`[LIOP-TLS] FATAL: Server certificate loading failed in production or enforced mode. ` +\n\t\t\t\t\t`Refusing insecure fallback to prevent MITM/eavesdropping: ${error}`,\n\t\t\t);\n\t\t}\n\t\tlog.warn(\n\t\t\t`[LIOP-TLS] Server certificate loading failed, falling back to insecure (dev mode): ${error}`,\n\t\t);\n\t\treturn grpc.ServerCredentials.createInsecure();\n\t}\n}\n\n/**\n * Creates gRPC channel credentials from TLS options.\n * In production or when LIOP_ENFORCE_TLS=true, refuses to fall back to insecure.\n */\nexport function createChannelCredentials(\n\ttls?: LiopTlsOptions,\n): grpc.ChannelCredentials {\n\t// If CertManager is provided, use its in-memory cached credentials\n\tif (tls?.certManager) {\n\t\ttry {\n\t\t\tconst rootCert = tls.certManager.getRootCert();\n\t\t\tif (!rootCert) {\n\t\t\t\tthrow new Error(\n\t\t\t\t\t\"[LIOP-TLS] FATAL: Channel TLS requires a root CA certificate in CertManager.\",\n\t\t\t\t);\n\t\t\t}\n\t\t\tconst certChain = tls.certManager.getCertChain();\n\t\t\tconst privateKey = tls.certManager.getPrivateKey();\n\t\t\treturn grpc.credentials.createSsl(rootCert, privateKey, certChain);\n\t\t} catch (error) {\n\t\t\tif (isTlsEnforced()) {\n\t\t\t\tthrow new Error(\n\t\t\t\t\t`[LIOP-TLS] FATAL: Channel certificate loading failed in enforced mode: ${error}`,\n\t\t\t\t);\n\t\t\t}\n\t\t\tlog.warn(\n\t\t\t\t`[LIOP-TLS] Channel CertManager failed, falling back to insecure: ${error}`,\n\t\t\t);\n\t\t\treturn grpc.credentials.createInsecure();\n\t\t}\n\t}\n\n\tif (!tls?.rootCert) {\n\t\tif (isTlsEnforced()) {\n\t\t\tthrow new Error(\n\t\t\t\t\"[LIOP-TLS] FATAL: TLS root certificate required in production or when LIOP_ENFORCE_TLS=true.\",\n\t\t\t);\n\t\t}\n\t\tlog.warn(\n\t\t\t\"[LIOP-TLS] No TLS root certificate configured — using insecure channel credentials\",\n\t\t);\n\t\treturn grpc.credentials.createInsecure();\n\t}\n\n\ttry {\n\t\tconst rootCert = fs.readFileSync(tls.rootCert);\n\t\tconst certChain = tls.certChain\n\t\t\t? fs.readFileSync(tls.certChain)\n\t\t\t: undefined;\n\t\tconst privateKey = tls.privateKey\n\t\t\t? fs.readFileSync(tls.privateKey)\n\t\t\t: undefined;\n\n\t\treturn grpc.credentials.createSsl(rootCert, privateKey, certChain);\n\t} catch (error) {\n\t\tif (isTlsEnforced()) {\n\t\t\tthrow new Error(\n\t\t\t\t`[LIOP-TLS] FATAL: Channel certificate loading failed in production or enforced mode. ` +\n\t\t\t\t\t`Refusing insecure fallback to prevent MITM/eavesdropping: ${error}`,\n\t\t\t);\n\t\t}\n\t\tlog.warn(\n\t\t\t`[LIOP-TLS] Channel certificate loading failed, falling back to insecure (dev mode): ${error}`,\n\t\t);\n\t\treturn grpc.credentials.createInsecure();\n\t}\n}\n"]}
|
package/dist/kyber-3ULIJSE3.js
DELETED
package/dist/types-lJIxBlWF.d.ts
DELETED
|
@@ -1,256 +0,0 @@
|
|
|
1
|
-
import { z } from 'zod';
|
|
2
|
-
import * as jose from 'jose';
|
|
3
|
-
|
|
4
|
-
/**
|
|
5
|
-
* LIOP JWT Validator — Token Verification Engine
|
|
6
|
-
*
|
|
7
|
-
* Validates JWT Access Tokens using the `jose` library.
|
|
8
|
-
* Supports two modes:
|
|
9
|
-
* - Local JWKS (Nexus role): Keys in memory, zero network latency.
|
|
10
|
-
* - Remote JWKS (Node role): Fetched from Nexus /oidc/jwks with 10min cache.
|
|
11
|
-
*
|
|
12
|
-
* Standards: NIST SP 800-207 (continuous verification), OWASP API-A01
|
|
13
|
-
* Source: panva/jose DeepWiki — createRemoteJWKSet, jwtVerify
|
|
14
|
-
*/
|
|
15
|
-
|
|
16
|
-
/**
|
|
17
|
-
* Authorization context extracted from a validated JWT.
|
|
18
|
-
* Compatible with MCP TypeScript SDK AuthInfo interface.
|
|
19
|
-
*/
|
|
20
|
-
interface AuthInfo {
|
|
21
|
-
/** Raw JWT string. */
|
|
22
|
-
token: string;
|
|
23
|
-
/** Subject claim (client_id for M2M flows). */
|
|
24
|
-
clientId: string;
|
|
25
|
-
/** Space-delimited scopes parsed into an array. */
|
|
26
|
-
scopes: string[];
|
|
27
|
-
/** Token expiration timestamp (Unix seconds). */
|
|
28
|
-
expiresAt?: number;
|
|
29
|
-
}
|
|
30
|
-
/**
|
|
31
|
-
* JWT Validator with dual-mode JWKS resolution.
|
|
32
|
-
*
|
|
33
|
-
* - Nexus role: `new JwtValidator(issuer, audience, localJwks)` (createLocalJWKSet)
|
|
34
|
-
* - Node role: `new JwtValidator(issuer, audience, new URL(jwksUri))` (createRemoteJWKSet)
|
|
35
|
-
*/
|
|
36
|
-
declare class JwtValidator {
|
|
37
|
-
private readonly jwksResolver;
|
|
38
|
-
private readonly issuer;
|
|
39
|
-
private readonly audience;
|
|
40
|
-
constructor(issuer: string, audience: string, jwksSource: URL | jose.JSONWebKeySet);
|
|
41
|
-
/**
|
|
42
|
-
* Validates a JWT access token and extracts authorization context.
|
|
43
|
-
*
|
|
44
|
-
* Checks performed (jose.jwtVerify):
|
|
45
|
-
* - Cryptographic signature verification (EdDSA or ES256)
|
|
46
|
-
* - Issuer claim matches configured issuer
|
|
47
|
-
* - Audience claim matches configured audience
|
|
48
|
-
* - Token is not expired (with clock tolerance for mesh skew)
|
|
49
|
-
* - Required claims (sub, scope) are present
|
|
50
|
-
*
|
|
51
|
-
* @throws JOSEError if validation fails (expired, wrong issuer, bad signature, etc.)
|
|
52
|
-
*/
|
|
53
|
-
validate(token: string): Promise<AuthInfo>;
|
|
54
|
-
/**
|
|
55
|
-
* Builds a complete set of issuer URL aliases for the LIOP demo topology.
|
|
56
|
-
*
|
|
57
|
-
* The LIOP mesh runs on Docker Desktop with the following network layout:
|
|
58
|
-
* Container hostnames: "nexus", "liop-nexus" (internal port 3000)
|
|
59
|
-
* Host-published ports: 13000 (HTTP/MCP), 13001 (libp2p TCP)
|
|
60
|
-
* Loopback addresses: 127.0.0.1, localhost
|
|
61
|
-
*
|
|
62
|
-
* The Nexus OAuth server may set its issuer to any of these depending on
|
|
63
|
-
* how it was configured, and nodes may resolve it via LIOP_NEXUS_URL
|
|
64
|
-
* which varies by context. This method generates all equivalent aliases
|
|
65
|
-
* so that jose.jwtVerify accepts the token regardless of which alias
|
|
66
|
-
* was used as `iss` in the JWT.
|
|
67
|
-
*
|
|
68
|
-
* Security note: This does NOT weaken validation — the cryptographic
|
|
69
|
-
* signature is still verified against the same JWKS keys. Only the
|
|
70
|
-
* string comparison of the `iss` claim is relaxed across known aliases.
|
|
71
|
-
*/
|
|
72
|
-
private buildIssuerAliases;
|
|
73
|
-
/**
|
|
74
|
-
* Returns the configured issuer URL for PRM (RFC 9728) metadata.
|
|
75
|
-
*/
|
|
76
|
-
getIssuer(): string;
|
|
77
|
-
/**
|
|
78
|
-
* Returns the configured audience for PRM metadata.
|
|
79
|
-
*/
|
|
80
|
-
getAudience(): string;
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
/**
|
|
84
|
-
* @mcp-legacy ENTIRE FILE — MCP 2025-era backward compatibility layer.
|
|
85
|
-
* Remove this file when MCP v1 (2025-11-25) reaches EOL.
|
|
86
|
-
*
|
|
87
|
-
* SUNSET INSTRUCTION: Delete this file, then grep for "@mcp-legacy" in the
|
|
88
|
-
* codebase to find and remove all remaining legacy seams.
|
|
89
|
-
*/
|
|
90
|
-
/**
|
|
91
|
-
* @mcp-legacy Master kill switch for MCP 2025-era backward compatibility.
|
|
92
|
-
* Set to `false` when MCP v1 reaches End-of-Life (EOL) to disable all legacy seams.
|
|
93
|
-
*/
|
|
94
|
-
declare const MCP_LEGACY_SUPPORT_ENABLED = true;
|
|
95
|
-
/**
|
|
96
|
-
* @mcp-legacy Legacy protocol version constant.
|
|
97
|
-
*/
|
|
98
|
-
declare const MCP_PROTOCOL_VERSION_LEGACY: "2025-11-25";
|
|
99
|
-
|
|
100
|
-
/**
|
|
101
|
-
* Protocol Version Identifiers
|
|
102
|
-
*/
|
|
103
|
-
declare const MCP_PROTOCOL_VERSION: "2026-07-28";
|
|
104
|
-
|
|
105
|
-
/**
|
|
106
|
-
* Protocol Era Classification
|
|
107
|
-
*/
|
|
108
|
-
type McpEra = "legacy" | "modern";
|
|
109
|
-
/**
|
|
110
|
-
* Caching Hints for MCP 2026-07-28 Spec
|
|
111
|
-
*/
|
|
112
|
-
interface CacheableResult {
|
|
113
|
-
ttlMs?: number;
|
|
114
|
-
cacheScope?: "public" | "private";
|
|
115
|
-
}
|
|
116
|
-
/**
|
|
117
|
-
* Multi-Round-Trip Requests (MRTR) Specification Types
|
|
118
|
-
*/
|
|
119
|
-
interface InputRequest {
|
|
120
|
-
id: string;
|
|
121
|
-
message: string;
|
|
122
|
-
schema?: Record<string, unknown>;
|
|
123
|
-
}
|
|
124
|
-
interface InputResponse {
|
|
125
|
-
id: string;
|
|
126
|
-
value: unknown;
|
|
127
|
-
}
|
|
128
|
-
interface InputRequiredResult {
|
|
129
|
-
resultType: "input_required";
|
|
130
|
-
inputRequests: InputRequest[];
|
|
131
|
-
requestState?: string;
|
|
132
|
-
}
|
|
133
|
-
/**
|
|
134
|
-
* Modern Envelope Metadata (_meta)
|
|
135
|
-
*/
|
|
136
|
-
interface McpRequestMeta {
|
|
137
|
-
"io.modelcontextprotocol/protocolVersion"?: string;
|
|
138
|
-
"io.modelcontextprotocol/clientInfo"?: {
|
|
139
|
-
name: string;
|
|
140
|
-
version: string;
|
|
141
|
-
};
|
|
142
|
-
"io.modelcontextprotocol/clientCapabilities"?: Record<string, unknown>;
|
|
143
|
-
[key: string]: unknown;
|
|
144
|
-
}
|
|
145
|
-
/**
|
|
146
|
-
* Base Protocol Types representing parity with Model Context Protocol
|
|
147
|
-
*/
|
|
148
|
-
declare const ToolSchema: z.ZodObject<{
|
|
149
|
-
name: z.ZodString;
|
|
150
|
-
description: z.ZodOptional<z.ZodString>;
|
|
151
|
-
inputSchema: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
152
|
-
}, z.core.$strip>;
|
|
153
|
-
type Tool = z.infer<typeof ToolSchema>;
|
|
154
|
-
declare const ResourceSchema: z.ZodObject<{
|
|
155
|
-
uri: z.ZodString;
|
|
156
|
-
name: z.ZodString;
|
|
157
|
-
description: z.ZodOptional<z.ZodString>;
|
|
158
|
-
mimeType: z.ZodOptional<z.ZodString>;
|
|
159
|
-
}, z.core.$strip>;
|
|
160
|
-
type Resource = z.infer<typeof ResourceSchema>;
|
|
161
|
-
declare const PromptSchema: z.ZodObject<{
|
|
162
|
-
name: z.ZodString;
|
|
163
|
-
description: z.ZodOptional<z.ZodString>;
|
|
164
|
-
arguments: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
165
|
-
name: z.ZodString;
|
|
166
|
-
description: z.ZodOptional<z.ZodString>;
|
|
167
|
-
required: z.ZodOptional<z.ZodBoolean>;
|
|
168
|
-
}, z.core.$strip>>>;
|
|
169
|
-
}, z.core.$strip>;
|
|
170
|
-
type Prompt = z.infer<typeof PromptSchema>;
|
|
171
|
-
interface CallToolRequest {
|
|
172
|
-
name: string;
|
|
173
|
-
arguments?: Record<string, unknown>;
|
|
174
|
-
}
|
|
175
|
-
interface CallToolResult {
|
|
176
|
-
content: Array<{
|
|
177
|
-
type: "text" | "image" | "resource";
|
|
178
|
-
text?: string;
|
|
179
|
-
data?: string;
|
|
180
|
-
mimeType?: string;
|
|
181
|
-
resource?: {
|
|
182
|
-
uri: string;
|
|
183
|
-
text?: string;
|
|
184
|
-
blob?: string;
|
|
185
|
-
};
|
|
186
|
-
}>;
|
|
187
|
-
isError?: boolean;
|
|
188
|
-
}
|
|
189
|
-
interface GetPromptRequest {
|
|
190
|
-
name: string;
|
|
191
|
-
arguments?: Record<string, string>;
|
|
192
|
-
}
|
|
193
|
-
interface GetPromptResult {
|
|
194
|
-
description?: string;
|
|
195
|
-
messages: Array<{
|
|
196
|
-
role: "user" | "assistant";
|
|
197
|
-
content: {
|
|
198
|
-
type: "text";
|
|
199
|
-
text: string;
|
|
200
|
-
} | {
|
|
201
|
-
type: "image";
|
|
202
|
-
data: string;
|
|
203
|
-
mimeType: string;
|
|
204
|
-
} | {
|
|
205
|
-
type: "resource";
|
|
206
|
-
resource: {
|
|
207
|
-
uri: string;
|
|
208
|
-
text?: string;
|
|
209
|
-
blob?: string;
|
|
210
|
-
};
|
|
211
|
-
};
|
|
212
|
-
}>;
|
|
213
|
-
}
|
|
214
|
-
interface ServerInfo {
|
|
215
|
-
name: string;
|
|
216
|
-
version: string;
|
|
217
|
-
capabilities?: {
|
|
218
|
-
prompts?: {
|
|
219
|
-
listChanged?: boolean;
|
|
220
|
-
};
|
|
221
|
-
resources?: {
|
|
222
|
-
subscribe?: boolean;
|
|
223
|
-
listChanged?: boolean;
|
|
224
|
-
};
|
|
225
|
-
tools?: {
|
|
226
|
-
listChanged?: boolean;
|
|
227
|
-
};
|
|
228
|
-
/** @mcp-legacy @deprecated Deprecated in MCP 2026-07-28 spec */
|
|
229
|
-
logging?: Record<string, unknown>;
|
|
230
|
-
};
|
|
231
|
-
}
|
|
232
|
-
interface DiscoverResult {
|
|
233
|
-
resultType: "complete";
|
|
234
|
-
supportedVersions: string[];
|
|
235
|
-
capabilities: ServerInfo["capabilities"];
|
|
236
|
-
serverInfo: ServerInfo;
|
|
237
|
-
instructions?: string;
|
|
238
|
-
}
|
|
239
|
-
interface McpRequest {
|
|
240
|
-
method: string;
|
|
241
|
-
params?: unknown;
|
|
242
|
-
id?: string | number | null;
|
|
243
|
-
jsonrpc?: "2.0";
|
|
244
|
-
}
|
|
245
|
-
interface McpResponse {
|
|
246
|
-
jsonrpc: "2.0";
|
|
247
|
-
id?: string | number | null;
|
|
248
|
-
result?: unknown;
|
|
249
|
-
error?: {
|
|
250
|
-
code: number;
|
|
251
|
-
message: string;
|
|
252
|
-
data?: unknown;
|
|
253
|
-
};
|
|
254
|
-
}
|
|
255
|
-
|
|
256
|
-
export { type AuthInfo as A, type CallToolRequest as C, type DiscoverResult as D, type GetPromptRequest as G, type InputRequest as I, JwtValidator as J, type McpEra as M, type Prompt as P, type Resource as R, type ServerInfo as S, type Tool as T, type CallToolResult as a, type McpRequest as b, type McpResponse as c, type GetPromptResult as d, type CacheableResult as e, type InputRequiredResult as f, type InputResponse as g, MCP_LEGACY_SUPPORT_ENABLED as h, MCP_PROTOCOL_VERSION as i, MCP_PROTOCOL_VERSION_LEGACY as j, type McpRequestMeta as k, PromptSchema as l, ResourceSchema as m, ToolSchema as n };
|