@kya-os/mcp-i-cloudflare 1.14.1 → 1.14.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/dist/agent.d.ts.map +1 -1
- package/dist/agent.js +23 -5
- package/dist/agent.js.map +1 -1
- package/dist/audit/deployment-binding.d.ts +54 -54
- package/dist/config.d.ts +4 -0
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +2 -0
- package/dist/config.js.map +1 -1
- package/dist/delegation-http/anchor-do.d.ts.map +1 -1
- package/dist/delegation-http/anchor-do.js +108 -10
- package/dist/delegation-http/anchor-do.js.map +1 -1
- package/dist/delegation-http/anchor-registration-validate.d.ts +4 -0
- package/dist/delegation-http/anchor-registration-validate.d.ts.map +1 -1
- package/dist/delegation-http/anchor-registration-validate.js +9 -0
- package/dist/delegation-http/anchor-registration-validate.js.map +1 -1
- package/dist/delegation-http/anchor-registration.d.ts.map +1 -1
- package/dist/delegation-http/anchor-registration.js +119 -29
- package/dist/delegation-http/anchor-registration.js.map +1 -1
- package/dist/delegation-http/bearer-retry.d.ts +6 -14
- package/dist/delegation-http/bearer-retry.d.ts.map +1 -1
- package/dist/delegation-http/bearer-retry.js +37 -73
- package/dist/delegation-http/bearer-retry.js.map +1 -1
- package/dist/delegation-http/challenge.d.ts +4 -6
- package/dist/delegation-http/challenge.d.ts.map +1 -1
- package/dist/delegation-http/challenge.js +10 -8
- package/dist/delegation-http/challenge.js.map +1 -1
- package/dist/delegation-http/consent-anchor-bridge.d.ts +5 -8
- package/dist/delegation-http/consent-anchor-bridge.d.ts.map +1 -1
- package/dist/delegation-http/consent-anchor-bridge.js +236 -40
- package/dist/delegation-http/consent-anchor-bridge.js.map +1 -1
- package/dist/delegation-http/constants.d.ts +2 -0
- package/dist/delegation-http/constants.d.ts.map +1 -1
- package/dist/delegation-http/constants.js +2 -0
- package/dist/delegation-http/constants.js.map +1 -1
- package/dist/delegation-http/credential-consent.d.ts +3 -1
- package/dist/delegation-http/credential-consent.d.ts.map +1 -1
- package/dist/delegation-http/credential-consent.js +11 -1
- package/dist/delegation-http/credential-consent.js.map +1 -1
- package/dist/delegation-http/native-capabilities.d.ts +4 -0
- package/dist/delegation-http/native-capabilities.d.ts.map +1 -0
- package/dist/delegation-http/native-capabilities.js +53 -0
- package/dist/delegation-http/native-capabilities.js.map +1 -0
- package/dist/delegation-http/native-fetch.d.ts +3 -0
- package/dist/delegation-http/native-fetch.d.ts.map +1 -0
- package/dist/delegation-http/native-fetch.js +13 -0
- package/dist/delegation-http/native-fetch.js.map +1 -0
- package/dist/delegation-http/native-http.d.ts +102 -0
- package/dist/delegation-http/native-http.d.ts.map +1 -0
- package/dist/delegation-http/native-http.js +191 -0
- package/dist/delegation-http/native-http.js.map +1 -0
- package/dist/delegation-http/native-oauth.d.ts +26 -0
- package/dist/delegation-http/native-oauth.d.ts.map +1 -0
- package/dist/delegation-http/native-oauth.js +369 -0
- package/dist/delegation-http/native-oauth.js.map +1 -0
- package/dist/delegation-http/native-pickup.d.ts +20 -0
- package/dist/delegation-http/native-pickup.d.ts.map +1 -0
- package/dist/delegation-http/native-pickup.js +227 -0
- package/dist/delegation-http/native-pickup.js.map +1 -0
- package/dist/delegation-http/pickup-routes.d.ts +1 -0
- package/dist/delegation-http/pickup-routes.d.ts.map +1 -1
- package/dist/delegation-http/pickup-routes.js +55 -1
- package/dist/delegation-http/pickup-routes.js.map +1 -1
- package/dist/delegation-http/register.d.ts.map +1 -1
- package/dist/delegation-http/register.js +4 -7
- package/dist/delegation-http/register.js.map +1 -1
- package/dist/delegation-http/remote-issuer.d.ts +37 -0
- package/dist/delegation-http/remote-issuer.d.ts.map +1 -0
- package/dist/delegation-http/remote-issuer.js +289 -0
- package/dist/delegation-http/remote-issuer.js.map +1 -0
- package/dist/delegation-http/sid.d.ts +5 -2
- package/dist/delegation-http/sid.d.ts.map +1 -1
- package/dist/delegation-http/sid.js +8 -2
- package/dist/delegation-http/sid.js.map +1 -1
- package/dist/delegation-http/types.d.ts +18 -5
- package/dist/delegation-http/types.d.ts.map +1 -1
- package/dist/delegation-http/well-known-capability.d.ts.map +1 -1
- package/dist/delegation-http/well-known-capability.js +5 -0
- package/dist/delegation-http/well-known-capability.js.map +1 -1
- package/dist/helpers/env-mapper.d.ts.map +1 -1
- package/dist/helpers/env-mapper.js +4 -0
- package/dist/helpers/env-mapper.js.map +1 -1
- package/dist/index.d.ts +4 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -1
- package/dist/proof-generator.d.ts +2 -0
- package/dist/proof-generator.d.ts.map +1 -1
- package/dist/proof-generator.js +1 -0
- package/dist/proof-generator.js.map +1 -1
- package/dist/runtime/oauth-handler.d.ts.map +1 -1
- package/dist/runtime/oauth-handler.js +44 -1
- package/dist/runtime/oauth-handler.js.map +1 -1
- package/dist/security/mcp-admission.d.ts +43 -0
- package/dist/security/mcp-admission.d.ts.map +1 -0
- package/dist/security/mcp-admission.js +165 -0
- package/dist/security/mcp-admission.js.map +1 -0
- package/dist/security/mcp-holder-admission.d.ts +19 -0
- package/dist/security/mcp-holder-admission.d.ts.map +1 -0
- package/dist/security/mcp-holder-admission.js +52 -0
- package/dist/security/mcp-holder-admission.js.map +1 -0
- package/dist/security/presented-delegation.d.ts +13 -0
- package/dist/security/presented-delegation.d.ts.map +1 -0
- package/dist/security/presented-delegation.js +73 -0
- package/dist/security/presented-delegation.js.map +1 -0
- package/dist/services/consent.service.d.ts +10 -0
- package/dist/services/consent.service.d.ts.map +1 -1
- package/dist/services/consent.service.js +15 -3
- package/dist/services/consent.service.js.map +1 -1
- package/dist/types.d.ts +4 -0
- package/dist/types.d.ts.map +1 -1
- package/package.json +3 -3
|
@@ -82,13 +82,13 @@ declare const deploymentBindingSchema: z.ZodObject<{
|
|
|
82
82
|
value: z.ZodString;
|
|
83
83
|
keyId: z.ZodString;
|
|
84
84
|
}, "strict", z.ZodTypeAny, {
|
|
85
|
+
kind: "keyed_commitment";
|
|
85
86
|
value: string;
|
|
86
87
|
keyId: string;
|
|
87
|
-
kind: "keyed_commitment";
|
|
88
88
|
}, {
|
|
89
|
+
kind: "keyed_commitment";
|
|
89
90
|
value: string;
|
|
90
91
|
keyId: string;
|
|
91
|
-
kind: "keyed_commitment";
|
|
92
92
|
}>, z.ZodObject<{
|
|
93
93
|
kind: z.ZodLiteral<"evidence_ref">;
|
|
94
94
|
ref: z.ZodObject<{
|
|
@@ -103,14 +103,14 @@ declare const deploymentBindingSchema: z.ZodObject<{
|
|
|
103
103
|
nonce: z.ZodString;
|
|
104
104
|
aadDigest: z.ZodString;
|
|
105
105
|
}, "strict", z.ZodTypeAny, {
|
|
106
|
+
nonce: string;
|
|
106
107
|
suite: "A256GCM";
|
|
107
108
|
keyId: string;
|
|
108
|
-
nonce: string;
|
|
109
109
|
aadDigest: string;
|
|
110
110
|
}, {
|
|
111
|
+
nonce: string;
|
|
111
112
|
suite: "A256GCM";
|
|
112
113
|
keyId: string;
|
|
113
|
-
nonce: string;
|
|
114
114
|
aadDigest: string;
|
|
115
115
|
}>;
|
|
116
116
|
}, "strict", z.ZodTypeAny, {
|
|
@@ -119,9 +119,9 @@ declare const deploymentBindingSchema: z.ZodObject<{
|
|
|
119
119
|
mediaType: string;
|
|
120
120
|
size: string;
|
|
121
121
|
encryption: {
|
|
122
|
+
nonce: string;
|
|
122
123
|
suite: "A256GCM";
|
|
123
124
|
keyId: string;
|
|
124
|
-
nonce: string;
|
|
125
125
|
aadDigest: string;
|
|
126
126
|
};
|
|
127
127
|
plaintextCommitment?: string | undefined;
|
|
@@ -131,43 +131,43 @@ declare const deploymentBindingSchema: z.ZodObject<{
|
|
|
131
131
|
mediaType: string;
|
|
132
132
|
size: string;
|
|
133
133
|
encryption: {
|
|
134
|
+
nonce: string;
|
|
134
135
|
suite: "A256GCM";
|
|
135
136
|
keyId: string;
|
|
136
|
-
nonce: string;
|
|
137
137
|
aadDigest: string;
|
|
138
138
|
};
|
|
139
139
|
plaintextCommitment?: string | undefined;
|
|
140
140
|
}>;
|
|
141
141
|
}, "strict", z.ZodTypeAny, {
|
|
142
|
+
kind: "evidence_ref";
|
|
142
143
|
ref: {
|
|
143
144
|
objectId: string;
|
|
144
145
|
ciphertextDigest: string;
|
|
145
146
|
mediaType: string;
|
|
146
147
|
size: string;
|
|
147
148
|
encryption: {
|
|
149
|
+
nonce: string;
|
|
148
150
|
suite: "A256GCM";
|
|
149
151
|
keyId: string;
|
|
150
|
-
nonce: string;
|
|
151
152
|
aadDigest: string;
|
|
152
153
|
};
|
|
153
154
|
plaintextCommitment?: string | undefined;
|
|
154
155
|
};
|
|
155
|
-
kind: "evidence_ref";
|
|
156
156
|
}, {
|
|
157
|
+
kind: "evidence_ref";
|
|
157
158
|
ref: {
|
|
158
159
|
objectId: string;
|
|
159
160
|
ciphertextDigest: string;
|
|
160
161
|
mediaType: string;
|
|
161
162
|
size: string;
|
|
162
163
|
encryption: {
|
|
164
|
+
nonce: string;
|
|
163
165
|
suite: "A256GCM";
|
|
164
166
|
keyId: string;
|
|
165
|
-
nonce: string;
|
|
166
167
|
aadDigest: string;
|
|
167
168
|
};
|
|
168
169
|
plaintextCommitment?: string | undefined;
|
|
169
170
|
};
|
|
170
|
-
kind: "evidence_ref";
|
|
171
171
|
}>]>;
|
|
172
172
|
producerRef: z.ZodDiscriminatedUnion<"kind", [z.ZodObject<{
|
|
173
173
|
kind: z.ZodLiteral<"public_did">;
|
|
@@ -192,13 +192,13 @@ declare const deploymentBindingSchema: z.ZodObject<{
|
|
|
192
192
|
value: z.ZodString;
|
|
193
193
|
keyId: z.ZodString;
|
|
194
194
|
}, "strict", z.ZodTypeAny, {
|
|
195
|
+
kind: "keyed_commitment";
|
|
195
196
|
value: string;
|
|
196
197
|
keyId: string;
|
|
197
|
-
kind: "keyed_commitment";
|
|
198
198
|
}, {
|
|
199
|
+
kind: "keyed_commitment";
|
|
199
200
|
value: string;
|
|
200
201
|
keyId: string;
|
|
201
|
-
kind: "keyed_commitment";
|
|
202
202
|
}>, z.ZodObject<{
|
|
203
203
|
kind: z.ZodLiteral<"evidence_ref">;
|
|
204
204
|
ref: z.ZodObject<{
|
|
@@ -213,14 +213,14 @@ declare const deploymentBindingSchema: z.ZodObject<{
|
|
|
213
213
|
nonce: z.ZodString;
|
|
214
214
|
aadDigest: z.ZodString;
|
|
215
215
|
}, "strict", z.ZodTypeAny, {
|
|
216
|
+
nonce: string;
|
|
216
217
|
suite: "A256GCM";
|
|
217
218
|
keyId: string;
|
|
218
|
-
nonce: string;
|
|
219
219
|
aadDigest: string;
|
|
220
220
|
}, {
|
|
221
|
+
nonce: string;
|
|
221
222
|
suite: "A256GCM";
|
|
222
223
|
keyId: string;
|
|
223
|
-
nonce: string;
|
|
224
224
|
aadDigest: string;
|
|
225
225
|
}>;
|
|
226
226
|
}, "strict", z.ZodTypeAny, {
|
|
@@ -229,9 +229,9 @@ declare const deploymentBindingSchema: z.ZodObject<{
|
|
|
229
229
|
mediaType: string;
|
|
230
230
|
size: string;
|
|
231
231
|
encryption: {
|
|
232
|
+
nonce: string;
|
|
232
233
|
suite: "A256GCM";
|
|
233
234
|
keyId: string;
|
|
234
|
-
nonce: string;
|
|
235
235
|
aadDigest: string;
|
|
236
236
|
};
|
|
237
237
|
plaintextCommitment?: string | undefined;
|
|
@@ -241,43 +241,43 @@ declare const deploymentBindingSchema: z.ZodObject<{
|
|
|
241
241
|
mediaType: string;
|
|
242
242
|
size: string;
|
|
243
243
|
encryption: {
|
|
244
|
+
nonce: string;
|
|
244
245
|
suite: "A256GCM";
|
|
245
246
|
keyId: string;
|
|
246
|
-
nonce: string;
|
|
247
247
|
aadDigest: string;
|
|
248
248
|
};
|
|
249
249
|
plaintextCommitment?: string | undefined;
|
|
250
250
|
}>;
|
|
251
251
|
}, "strict", z.ZodTypeAny, {
|
|
252
|
+
kind: "evidence_ref";
|
|
252
253
|
ref: {
|
|
253
254
|
objectId: string;
|
|
254
255
|
ciphertextDigest: string;
|
|
255
256
|
mediaType: string;
|
|
256
257
|
size: string;
|
|
257
258
|
encryption: {
|
|
259
|
+
nonce: string;
|
|
258
260
|
suite: "A256GCM";
|
|
259
261
|
keyId: string;
|
|
260
|
-
nonce: string;
|
|
261
262
|
aadDigest: string;
|
|
262
263
|
};
|
|
263
264
|
plaintextCommitment?: string | undefined;
|
|
264
265
|
};
|
|
265
|
-
kind: "evidence_ref";
|
|
266
266
|
}, {
|
|
267
|
+
kind: "evidence_ref";
|
|
267
268
|
ref: {
|
|
268
269
|
objectId: string;
|
|
269
270
|
ciphertextDigest: string;
|
|
270
271
|
mediaType: string;
|
|
271
272
|
size: string;
|
|
272
273
|
encryption: {
|
|
274
|
+
nonce: string;
|
|
273
275
|
suite: "A256GCM";
|
|
274
276
|
keyId: string;
|
|
275
|
-
nonce: string;
|
|
276
277
|
aadDigest: string;
|
|
277
278
|
};
|
|
278
279
|
plaintextCommitment?: string | undefined;
|
|
279
280
|
};
|
|
280
|
-
kind: "evidence_ref";
|
|
281
281
|
}>]>;
|
|
282
282
|
recorderSigner: z.ZodObject<{
|
|
283
283
|
did: z.ZodString;
|
|
@@ -307,6 +307,17 @@ declare const deploymentBindingSchema: z.ZodObject<{
|
|
|
307
307
|
evidenceKey?: "KYA_OS_AUDIT_EVIDENCE_KEY" | undefined;
|
|
308
308
|
}>;
|
|
309
309
|
}, "strict", z.ZodTypeAny, {
|
|
310
|
+
config: {
|
|
311
|
+
enabled: boolean;
|
|
312
|
+
delivery: "best-effort" | "buffered" | "required";
|
|
313
|
+
requestedProfile: "AAP-0" | "AAP-1" | "AAP-2" | "AAP-3" | "AAP-4";
|
|
314
|
+
evidenceMode: "none" | "encrypted-separate" | "encrypted-inline";
|
|
315
|
+
retentionClass: string;
|
|
316
|
+
retentionDays: number;
|
|
317
|
+
residency: "global" | "eu" | "inherit-project" | "us";
|
|
318
|
+
keyCustody: "none" | "checkpoint-managed" | "customer-managed-kms";
|
|
319
|
+
recorderTopology: "none" | "self-hosted" | "managed" | "verified-mirror";
|
|
320
|
+
};
|
|
310
321
|
schema: "https://schema.kya-os.org/v1/protocol/audit/deployment-binding/v1.0.0";
|
|
311
322
|
recorderSigner: {
|
|
312
323
|
did: string;
|
|
@@ -321,35 +332,24 @@ declare const deploymentBindingSchema: z.ZodObject<{
|
|
|
321
332
|
did: string;
|
|
322
333
|
kind: "pairwise_did";
|
|
323
334
|
} | {
|
|
335
|
+
kind: "keyed_commitment";
|
|
324
336
|
value: string;
|
|
325
337
|
keyId: string;
|
|
326
|
-
kind: "keyed_commitment";
|
|
327
338
|
} | {
|
|
339
|
+
kind: "evidence_ref";
|
|
328
340
|
ref: {
|
|
329
341
|
objectId: string;
|
|
330
342
|
ciphertextDigest: string;
|
|
331
343
|
mediaType: string;
|
|
332
344
|
size: string;
|
|
333
345
|
encryption: {
|
|
346
|
+
nonce: string;
|
|
334
347
|
suite: "A256GCM";
|
|
335
348
|
keyId: string;
|
|
336
|
-
nonce: string;
|
|
337
349
|
aadDigest: string;
|
|
338
350
|
};
|
|
339
351
|
plaintextCommitment?: string | undefined;
|
|
340
352
|
};
|
|
341
|
-
kind: "evidence_ref";
|
|
342
|
-
};
|
|
343
|
-
config: {
|
|
344
|
-
enabled: boolean;
|
|
345
|
-
delivery: "best-effort" | "buffered" | "required";
|
|
346
|
-
requestedProfile: "AAP-0" | "AAP-1" | "AAP-2" | "AAP-3" | "AAP-4";
|
|
347
|
-
evidenceMode: "none" | "encrypted-separate" | "encrypted-inline";
|
|
348
|
-
retentionClass: string;
|
|
349
|
-
retentionDays: number;
|
|
350
|
-
residency: "global" | "eu" | "inherit-project" | "us";
|
|
351
|
-
keyCustody: "none" | "checkpoint-managed" | "customer-managed-kms";
|
|
352
|
-
recorderTopology: "none" | "self-hosted" | "managed" | "verified-mirror";
|
|
353
353
|
};
|
|
354
354
|
readiness: {
|
|
355
355
|
status: "disabled" | "ready" | "degraded";
|
|
@@ -366,24 +366,24 @@ declare const deploymentBindingSchema: z.ZodObject<{
|
|
|
366
366
|
did: string;
|
|
367
367
|
kind: "pairwise_did";
|
|
368
368
|
} | {
|
|
369
|
+
kind: "keyed_commitment";
|
|
369
370
|
value: string;
|
|
370
371
|
keyId: string;
|
|
371
|
-
kind: "keyed_commitment";
|
|
372
372
|
} | {
|
|
373
|
+
kind: "evidence_ref";
|
|
373
374
|
ref: {
|
|
374
375
|
objectId: string;
|
|
375
376
|
ciphertextDigest: string;
|
|
376
377
|
mediaType: string;
|
|
377
378
|
size: string;
|
|
378
379
|
encryption: {
|
|
380
|
+
nonce: string;
|
|
379
381
|
suite: "A256GCM";
|
|
380
382
|
keyId: string;
|
|
381
|
-
nonce: string;
|
|
382
383
|
aadDigest: string;
|
|
383
384
|
};
|
|
384
385
|
plaintextCommitment?: string | undefined;
|
|
385
386
|
};
|
|
386
|
-
kind: "evidence_ref";
|
|
387
387
|
};
|
|
388
388
|
secretReferences: {
|
|
389
389
|
producerInternalToken: "KYA_OS_AUDIT_PRODUCER_INTERNAL_TOKEN";
|
|
@@ -391,6 +391,17 @@ declare const deploymentBindingSchema: z.ZodObject<{
|
|
|
391
391
|
evidenceKey?: "KYA_OS_AUDIT_EVIDENCE_KEY" | undefined;
|
|
392
392
|
};
|
|
393
393
|
}, {
|
|
394
|
+
config: {
|
|
395
|
+
enabled: boolean;
|
|
396
|
+
delivery: "best-effort" | "buffered" | "required";
|
|
397
|
+
requestedProfile: "AAP-0" | "AAP-1" | "AAP-2" | "AAP-3" | "AAP-4";
|
|
398
|
+
evidenceMode: "none" | "encrypted-separate" | "encrypted-inline";
|
|
399
|
+
retentionClass: string;
|
|
400
|
+
retentionDays: number;
|
|
401
|
+
residency: "global" | "eu" | "inherit-project" | "us";
|
|
402
|
+
keyCustody: "none" | "checkpoint-managed" | "customer-managed-kms";
|
|
403
|
+
recorderTopology: "none" | "self-hosted" | "managed" | "verified-mirror";
|
|
404
|
+
};
|
|
394
405
|
schema: "https://schema.kya-os.org/v1/protocol/audit/deployment-binding/v1.0.0";
|
|
395
406
|
recorderSigner: {
|
|
396
407
|
did: string;
|
|
@@ -405,35 +416,24 @@ declare const deploymentBindingSchema: z.ZodObject<{
|
|
|
405
416
|
did: string;
|
|
406
417
|
kind: "pairwise_did";
|
|
407
418
|
} | {
|
|
419
|
+
kind: "keyed_commitment";
|
|
408
420
|
value: string;
|
|
409
421
|
keyId: string;
|
|
410
|
-
kind: "keyed_commitment";
|
|
411
422
|
} | {
|
|
423
|
+
kind: "evidence_ref";
|
|
412
424
|
ref: {
|
|
413
425
|
objectId: string;
|
|
414
426
|
ciphertextDigest: string;
|
|
415
427
|
mediaType: string;
|
|
416
428
|
size: string;
|
|
417
429
|
encryption: {
|
|
430
|
+
nonce: string;
|
|
418
431
|
suite: "A256GCM";
|
|
419
432
|
keyId: string;
|
|
420
|
-
nonce: string;
|
|
421
433
|
aadDigest: string;
|
|
422
434
|
};
|
|
423
435
|
plaintextCommitment?: string | undefined;
|
|
424
436
|
};
|
|
425
|
-
kind: "evidence_ref";
|
|
426
|
-
};
|
|
427
|
-
config: {
|
|
428
|
-
enabled: boolean;
|
|
429
|
-
delivery: "best-effort" | "buffered" | "required";
|
|
430
|
-
requestedProfile: "AAP-0" | "AAP-1" | "AAP-2" | "AAP-3" | "AAP-4";
|
|
431
|
-
evidenceMode: "none" | "encrypted-separate" | "encrypted-inline";
|
|
432
|
-
retentionClass: string;
|
|
433
|
-
retentionDays: number;
|
|
434
|
-
residency: "global" | "eu" | "inherit-project" | "us";
|
|
435
|
-
keyCustody: "none" | "checkpoint-managed" | "customer-managed-kms";
|
|
436
|
-
recorderTopology: "none" | "self-hosted" | "managed" | "verified-mirror";
|
|
437
437
|
};
|
|
438
438
|
readiness: {
|
|
439
439
|
status: "disabled" | "ready" | "degraded";
|
|
@@ -450,24 +450,24 @@ declare const deploymentBindingSchema: z.ZodObject<{
|
|
|
450
450
|
did: string;
|
|
451
451
|
kind: "pairwise_did";
|
|
452
452
|
} | {
|
|
453
|
+
kind: "keyed_commitment";
|
|
453
454
|
value: string;
|
|
454
455
|
keyId: string;
|
|
455
|
-
kind: "keyed_commitment";
|
|
456
456
|
} | {
|
|
457
|
+
kind: "evidence_ref";
|
|
457
458
|
ref: {
|
|
458
459
|
objectId: string;
|
|
459
460
|
ciphertextDigest: string;
|
|
460
461
|
mediaType: string;
|
|
461
462
|
size: string;
|
|
462
463
|
encryption: {
|
|
464
|
+
nonce: string;
|
|
463
465
|
suite: "A256GCM";
|
|
464
466
|
keyId: string;
|
|
465
|
-
nonce: string;
|
|
466
467
|
aadDigest: string;
|
|
467
468
|
};
|
|
468
469
|
plaintextCommitment?: string | undefined;
|
|
469
470
|
};
|
|
470
|
-
kind: "evidence_ref";
|
|
471
471
|
};
|
|
472
472
|
secretReferences: {
|
|
473
473
|
producerInternalToken: "KYA_OS_AUDIT_PRODUCER_INTERNAL_TOKEN";
|
package/dist/config.d.ts
CHANGED
|
@@ -63,6 +63,8 @@ export interface CloudflareR2Binding {
|
|
|
63
63
|
* lazy-expiry garbage window stays bounded.
|
|
64
64
|
*/
|
|
65
65
|
export interface HttpChallengeConfig {
|
|
66
|
+
/** Explicit native HTTP issuer/status capabilities. Legacy MCP consent does not use this. */
|
|
67
|
+
native?: import("./delegation-http/native-http").NativeHttpHostConfig | null;
|
|
66
68
|
/** Master switch. Default false — the layer is flag-gated. */
|
|
67
69
|
enabled: boolean;
|
|
68
70
|
/**
|
|
@@ -103,6 +105,8 @@ export interface HttpChallengeConfig {
|
|
|
103
105
|
* Note: session and environment are inherited from MCPIBaseConfig.
|
|
104
106
|
*/
|
|
105
107
|
export interface CloudflareRuntimeConfig extends MCPIConfig {
|
|
108
|
+
/** Resource admission before MCP tool input transformation. Throws fail closed. */
|
|
109
|
+
requestAdmission?: import('./security/mcp-admission').McpRequestAdmission;
|
|
106
110
|
/** Canonical KYA-OS audit trail configuration. */
|
|
107
111
|
auditTrail?: RuntimeAuditConfig;
|
|
108
112
|
/**
|
package/dist/config.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EACV,UAAU,EAIV,gBAAgB,EAChB,0BAA0B,EAC3B,MAAM,0BAA0B,CAAC;
|
|
1
|
+
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EACV,UAAU,EAIV,gBAAgB,EAChB,0BAA0B,EAC3B,MAAM,0BAA0B,CAAC;AAGlC,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAEhE;;GAEG;AACH,MAAM,WAAW,mBAAmB;IAClC;;;OAGG;IACH,IAAI,EAAE,MAAM,CAAC;IAEb;;OAEG;IACH,OAAO,EAAE,UAAU,GAAG,aAAa,GAAG,OAAO,GAAG,SAAS,CAAC;CAC3D;AAED;;GAEG;AACH,MAAM,WAAW,mBAAmB;IAClC;;;OAGG;IACH,IAAI,EAAE,MAAM,CAAC;IAEb;;OAEG;IACH,SAAS,EAAE,MAAM,CAAC;IAElB;;OAEG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED;;GAEG;AACH,MAAM,WAAW,mBAAmB;IAClC;;;OAGG;IACH,IAAI,EAAE,MAAM,CAAC;IAEb;;OAEG;IACH,OAAO,EAAE,QAAQ,GAAG,MAAM,GAAG,UAAU,GAAG,SAAS,CAAC;CACrD;AAED;;;;;;;GAOG;AACH,MAAM,WAAW,mBAAmB;IAClC,6FAA6F;IAC7F,MAAM,CAAC,EAAE,OAAO,+BAA+B,EAAE,oBAAoB,GAAG,IAAI,CAAC;IAC7E,8DAA8D;IAC9D,OAAO,EAAE,OAAO,CAAC;IACjB;;;OAGG;IACH,IAAI,CAAC,EAAE,YAAY,GAAG,QAAQ,CAAC;IAC/B,yFAAyF;IACzF,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,6DAA6D;IAC7D,aAAa,CAAC,EAAE,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EAAE,OAAO,CAAC,uBAAuB,CAAC,GACvC,uBAAuB,CAiGzB;AAwBD;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,wBAAgB,0BAA0B,CACxC,MAAM,EAAE,uBAAuB,GAAG,SAAS,EAC3C,GAAG,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAC3B,QAAQ,CAAC,mBAAmB,CAAC,GAAG,IAAI,CA8CtC"}
|
package/dist/config.js
CHANGED
|
@@ -7,6 +7,7 @@
|
|
|
7
7
|
* @module @kya-os/mcp-i-cloudflare/config
|
|
8
8
|
*/
|
|
9
9
|
import { buildBaseConfig } from "@kya-os/contracts/config";
|
|
10
|
+
import { resolveManagedNativeIssuer } from "./delegation-http/remote-issuer";
|
|
10
11
|
/**
|
|
11
12
|
* Default Cloudflare runtime configuration
|
|
12
13
|
*/
|
|
@@ -280,6 +281,7 @@ export function resolveHttpChallengeConfig(config, env) {
|
|
|
280
281
|
const realm = realmEnv || httpChallenge?.realm || "";
|
|
281
282
|
return {
|
|
282
283
|
enabled: true,
|
|
284
|
+
native: httpChallenge?.native ?? resolveManagedNativeIssuer(env),
|
|
283
285
|
mode: httpChallenge?.mode ?? "negotiated",
|
|
284
286
|
realm,
|
|
285
287
|
pollIntervalS: positiveOrDefault(httpChallenge?.pollIntervalS, 3),
|
package/dist/config.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.js","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAUH,OAAO,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC;
|
|
1
|
+
{"version":3,"file":"config.js","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAUH,OAAO,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC;AAC3D,OAAO,EAAE,0BAA0B,EAAE,MAAM,iCAAiC,CAAC;AAwX7E;;GAEG;AACH,MAAM,CAAC,MAA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QACL,OAAO,EAAE,IAAI;QACb,MAAM,EAAE,aAAa,EAAE,MAAM,IAAI,0BAA0B,CAAC,GAAG,CAAC;QAChE,IAAI,EAAE,aAAa,EAAE,IAAI,IAAI,YAAY;QACzC,KAAK;QACL,aAAa,EAAE,iBAAiB,CAAC,aAAa,EAAE,aAAa,EAAE,CAAC,CAAC;QACjE,UAAU;QACV,oBAAoB,EAAE,iBAAiB,CACrC,aAAa,EAAE,oBAAoB,EACnC,GAAG,CACJ;QACD,2BAA2B,EACzB,aAAa,EAAE,2BAA2B,IAAI,KAAK;QACrD,wBAAwB;KACzB,CAAC;AACJ,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"anchor-do.d.ts","sourceRoot":"","sources":["../../src/delegation-http/anchor-do.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AAEH,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAC;AACpE,OAAO,KAAK,EAAE,kBAAkB,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"anchor-do.d.ts","sourceRoot":"","sources":["../../src/delegation-http/anchor-do.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AAEH,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAC;AACpE,OAAO,KAAK,EAAE,kBAAkB,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAuFhE;;;;GAIG;AACH,wBAAgB,YAAY,CAC1B,GAAG,EAAE,kBAAkB,GAAG,SAAS,EACnC,KAAK,EAAE,OAAO,EACd,GAAG,EAAE,MAAM,GACV;IACD,MAAM,CAAC,EAAE,kBAAkB,CAAC;IAC5B,QAAQ,EAAE;QAAE,MAAM,EAAE,MAAM,CAAC;QAAC,IAAI,CAAC,EAAE,OAAO,CAAA;KAAE,CAAC;CAC9C,CAmEA;AAED;;;;;;;;;GASG;AACH,wBAAgB,UAAU,CACxB,GAAG,EAAE,kBAAkB,GAAG,SAAS,EACnC,MAAM,EAAE,YAAY,EACpB,GAAG,EAAE,MAAM,GACV;IACD,MAAM,CAAC,EAAE,kBAAkB,CAAC;IAC5B,QAAQ,EAAE;QACR,MAAM,EAAE,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,CAAC;QAC1C,IAAI,CAAC,EAAE,OAAO,CAAC;QACf,WAAW,CAAC,EAAE,MAAM,CAAC;KACtB,CAAC;CACH,CA+EA;AAED;;;;GAIG;AACH,wBAAgB,aAAa,CAC3B,GAAG,EAAE,kBAAkB,GAAG,SAAS,EACnC,KAAK,EAAE,OAAO,EACd,GAAG,EAAE,MAAM,GACV;IACD,MAAM,CAAC,EAAE,kBAAkB,CAAC;IAC5B,QAAQ,EAAE;QAAE,MAAM,EAAE,MAAM,CAAC;QAAC,IAAI,CAAC,EAAE,OAAO,CAAA;KAAE,CAAC;CAC9C,CAyEA;AAuBD;;;;;;;;GAQG;AACH,wBAAsB,oBAAoB,CACxC,GAAG,EAAE,kBAAkB,EACvB,OAAO,EAAE,OAAO,EAChB,GAAG,CAAC,EAAE,MAAM,GACX,OAAO,CAAC,QAAQ,CAAC,CA+EnB"}
|
|
@@ -49,12 +49,26 @@ function anchorSnapshot(rec) {
|
|
|
49
49
|
agentDid: rec.agentDid,
|
|
50
50
|
audience: rec.audience,
|
|
51
51
|
serverDid: rec.serverDid,
|
|
52
|
+
nativeHttp: rec.nativeHttp,
|
|
53
|
+
nativeRegistration: rec.nativeRegistration,
|
|
54
|
+
nativeIssuerDid: rec.nativeIssuerDid,
|
|
55
|
+
nativePolicyRevision: rec.nativePolicyRevision,
|
|
52
56
|
};
|
|
53
57
|
}
|
|
54
58
|
const pendingBody = () => ({ status: "pending" });
|
|
55
59
|
const pinnedErr = () => ({ error: KYAOS_ERRORS.pickupPinned });
|
|
56
60
|
const invalidSessionErr = () => ({ error: KYAOS_ERRORS.invalidSession });
|
|
57
61
|
const pickupExpiredErr = () => ({ error: KYAOS_ERRORS.pickupExpired });
|
|
62
|
+
/** Native records predating persisted signed expiry cannot safely be delivered. */
|
|
63
|
+
function nativeGrantExpired(rec, now) {
|
|
64
|
+
if (!rec.nativeHttp || rec.status !== "approved")
|
|
65
|
+
return false;
|
|
66
|
+
const exp = rec.delegation?.expiresAtUnix;
|
|
67
|
+
return (!Number.isSafeInteger(exp) ||
|
|
68
|
+
exp <= 0 ||
|
|
69
|
+
!Number.isSafeInteger(exp * 1000) ||
|
|
70
|
+
now >= exp * 1000);
|
|
71
|
+
}
|
|
58
72
|
/**
|
|
59
73
|
* Pure reducer for `create`. Writes a fresh anchor record (PENDING, or PINNED when a
|
|
60
74
|
* challenge-time keyid pin is supplied). Idempotent by construction: a `pickup:<sid>`
|
|
@@ -79,6 +93,15 @@ export function reduceCreate(rec, input, now) {
|
|
|
79
93
|
},
|
|
80
94
|
};
|
|
81
95
|
}
|
|
96
|
+
if (i.nativeHttp &&
|
|
97
|
+
i.nativeIssuedAtMs !== undefined &&
|
|
98
|
+
(!Number.isSafeInteger(i.nativeIssuedAtMs) ||
|
|
99
|
+
i.nativeIssuedAtMs > now + 30_000 ||
|
|
100
|
+
i.nativeIssuedAtMs + 600_000 <= now))
|
|
101
|
+
return {
|
|
102
|
+
response: { status: 410, body: { error: "kyaos/pickup-expired" } },
|
|
103
|
+
};
|
|
104
|
+
const issuedAt = i.nativeHttp && i.nativeIssuedAtMs !== undefined ? i.nativeIssuedAtMs : now;
|
|
82
105
|
const record = {
|
|
83
106
|
sid: i.sid,
|
|
84
107
|
status: i.pin ? "pinned" : "pending",
|
|
@@ -86,12 +109,17 @@ export function reduceCreate(rec, input, now) {
|
|
|
86
109
|
minAssurance: i.minAssurance,
|
|
87
110
|
pollIntervalS: i.pollIntervalS,
|
|
88
111
|
createdAt: now,
|
|
89
|
-
expiresAt:
|
|
112
|
+
expiresAt: issuedAt +
|
|
113
|
+
Math.min(i.nativeHttp ? 600 : i.anchorTtlS, i.anchorTtlS) * 1000,
|
|
90
114
|
agentDid: typeof i.agentDid === "string" ? i.agentDid : undefined,
|
|
91
115
|
audience: typeof i.audience === "string" ? i.audience : undefined,
|
|
92
116
|
serverDid: typeof i.serverDid === "string" ? i.serverDid : undefined,
|
|
93
117
|
registeredAtMs: typeof i.registeredAtMs === "number" ? i.registeredAtMs : undefined,
|
|
94
|
-
issuedAtMs:
|
|
118
|
+
issuedAtMs: issuedAt,
|
|
119
|
+
nativeHttp: i.nativeHttp,
|
|
120
|
+
nativeRegistration: i.nativeRegistration,
|
|
121
|
+
nativeIssuerDid: i.nativeIssuerDid,
|
|
122
|
+
nativePolicyRevision: i.nativePolicyRevision,
|
|
95
123
|
pin: i.pin
|
|
96
124
|
? {
|
|
97
125
|
type: i.pin.type,
|
|
@@ -123,10 +151,18 @@ export function reducePoll(rec, holder, now) {
|
|
|
123
151
|
if (!rec) {
|
|
124
152
|
return { response: { status: 404, body: invalidSessionErr() } };
|
|
125
153
|
}
|
|
126
|
-
if (now > rec.expiresAt) {
|
|
154
|
+
if (now > rec.expiresAt || nativeGrantExpired(rec, now)) {
|
|
127
155
|
// delete-on-expired-read: a 410 outcome tells the dispatcher to drop the key.
|
|
128
156
|
return { response: { status: 410, body: pickupExpiredErr() } };
|
|
129
157
|
}
|
|
158
|
+
if (rec.nativeHttp &&
|
|
159
|
+
(!holder.nativeVerified ||
|
|
160
|
+
holder.type !== "keyid" ||
|
|
161
|
+
rec.nativeHttp.action.pin.mode !== "key")) {
|
|
162
|
+
return {
|
|
163
|
+
response: { status: 403, body: { error: "kyaos/profile-violation" } },
|
|
164
|
+
};
|
|
165
|
+
}
|
|
130
166
|
const holderSha = sha256Hex(holder.value);
|
|
131
167
|
let working = rec;
|
|
132
168
|
let pinnedJustNow = false;
|
|
@@ -148,6 +184,7 @@ export function reducePoll(rec, holder, now) {
|
|
|
148
184
|
valueSha256: holderSha,
|
|
149
185
|
pinnedAt: now,
|
|
150
186
|
source: "first-poll",
|
|
187
|
+
...(rec.nativeHttp ? { keyId: holder.value } : {}),
|
|
151
188
|
},
|
|
152
189
|
};
|
|
153
190
|
pinnedJustNow = true;
|
|
@@ -158,7 +195,9 @@ export function reducePoll(rec, holder, now) {
|
|
|
158
195
|
status: "ready",
|
|
159
196
|
token_type: "Bearer",
|
|
160
197
|
delegation: working.delegation.vcJwt,
|
|
161
|
-
expires_in: working.
|
|
198
|
+
expires_in: working.nativeHttp
|
|
199
|
+
? Math.max(0, Math.floor((working.delegation.expiresAtUnix * 1000 - now) / 1000))
|
|
200
|
+
: working.delegation.expiresInS,
|
|
162
201
|
};
|
|
163
202
|
return pinnedJustNow
|
|
164
203
|
? { record: working, response: { status: 200, body } }
|
|
@@ -186,22 +225,70 @@ export function reduceApprove(rec, input, now) {
|
|
|
186
225
|
if (!rec) {
|
|
187
226
|
return { response: { status: 404, body: invalidSessionErr() } };
|
|
188
227
|
}
|
|
189
|
-
if (now > rec.expiresAt) {
|
|
228
|
+
if (now > rec.expiresAt || nativeGrantExpired(rec, now)) {
|
|
190
229
|
return { response: { status: 410, body: pickupExpiredErr() } };
|
|
191
230
|
}
|
|
231
|
+
if (rec.nativeHttp && (!rec.pin?.keyId || rec.pin.type !== "keyid")) {
|
|
232
|
+
return {
|
|
233
|
+
response: { status: 409, body: { error: "kyaos/pickup-unpinned" } },
|
|
234
|
+
};
|
|
235
|
+
}
|
|
192
236
|
// Idempotent approve: once a credential is parked, a duplicate approval (a
|
|
193
237
|
// double-submit, two consent tabs) must NOT replace it. Each approve mints a fresh
|
|
194
238
|
// VC-JWT, so a blind upsert would swap a live delegation the pinned holder may
|
|
195
239
|
// already be picking up. Return the existing success without re-parking.
|
|
196
240
|
if (rec.status === "approved" && rec.delegation) {
|
|
197
|
-
|
|
241
|
+
if (rec.nativeHttp &&
|
|
242
|
+
(rec.delegation.vcJwt !== i.vcJwt ||
|
|
243
|
+
rec.delegation.expiresAtUnix !== i.expiresAtUnix)) {
|
|
244
|
+
return {
|
|
245
|
+
response: { status: 409, body: { error: "kyaos/session-mismatch" } },
|
|
246
|
+
};
|
|
247
|
+
}
|
|
248
|
+
return {
|
|
249
|
+
response: {
|
|
250
|
+
status: 200,
|
|
251
|
+
body: {
|
|
252
|
+
success: true,
|
|
253
|
+
...(rec.nativeHttp
|
|
254
|
+
? { expiresAtUnix: rec.delegation.expiresAtUnix }
|
|
255
|
+
: {}),
|
|
256
|
+
},
|
|
257
|
+
},
|
|
258
|
+
};
|
|
259
|
+
}
|
|
260
|
+
if (rec.nativeHttp &&
|
|
261
|
+
(!Number.isSafeInteger(i.expiresAtUnix) ||
|
|
262
|
+
i.expiresAtUnix <= 0 ||
|
|
263
|
+
!Number.isSafeInteger(i.expiresAtUnix * 1000) ||
|
|
264
|
+
i.expiresAtUnix > Math.floor(now / 1000) + 3630)) {
|
|
265
|
+
return {
|
|
266
|
+
response: { status: 400, body: { error: "kyaos/profile-violation" } },
|
|
267
|
+
};
|
|
268
|
+
}
|
|
269
|
+
if (rec.nativeHttp && now >= i.expiresAtUnix * 1000) {
|
|
270
|
+
return { response: { status: 410, body: pickupExpiredErr() } };
|
|
198
271
|
}
|
|
199
272
|
const record = {
|
|
200
273
|
...rec,
|
|
201
274
|
status: "approved",
|
|
202
|
-
delegation: {
|
|
275
|
+
delegation: {
|
|
276
|
+
vcJwt: i.vcJwt,
|
|
277
|
+
expiresInS: i.expiresInS,
|
|
278
|
+
approvedAt: now,
|
|
279
|
+
...(rec.nativeHttp ? { expiresAtUnix: i.expiresAtUnix } : {}),
|
|
280
|
+
},
|
|
281
|
+
};
|
|
282
|
+
return {
|
|
283
|
+
record,
|
|
284
|
+
response: {
|
|
285
|
+
status: 200,
|
|
286
|
+
body: {
|
|
287
|
+
success: true,
|
|
288
|
+
...(rec.nativeHttp ? { expiresAtUnix: i.expiresAtUnix } : {}),
|
|
289
|
+
},
|
|
290
|
+
},
|
|
203
291
|
};
|
|
204
|
-
return { record, response: { status: 200, body: { success: true } } };
|
|
205
292
|
}
|
|
206
293
|
/** Reducer outcome → wire `Response`, applying the frozen header rules. */
|
|
207
294
|
function wireResponse(r) {
|
|
@@ -253,7 +340,10 @@ export async function handlePickupInternal(ctx, request, now) {
|
|
|
253
340
|
(h.type !== "token" && h.type !== "keyid")) {
|
|
254
341
|
return wireResponse({
|
|
255
342
|
status: 400,
|
|
256
|
-
body: {
|
|
343
|
+
body: {
|
|
344
|
+
error: "kyaos/invalid-request",
|
|
345
|
+
message: "missing or malformed holder",
|
|
346
|
+
},
|
|
257
347
|
});
|
|
258
348
|
}
|
|
259
349
|
const { record, response } = reducePoll(rec, h, t);
|
|
@@ -275,7 +365,7 @@ export async function handlePickupInternal(ctx, request, now) {
|
|
|
275
365
|
if (!rec) {
|
|
276
366
|
return wireResponse({ status: 404, body: invalidSessionErr() });
|
|
277
367
|
}
|
|
278
|
-
if (t > rec.expiresAt) {
|
|
368
|
+
if (t > rec.expiresAt || nativeGrantExpired(rec, t)) {
|
|
279
369
|
await ctx.storage.delete(key);
|
|
280
370
|
return wireResponse({ status: 410, body: pickupExpiredErr() });
|
|
281
371
|
}
|
|
@@ -290,6 +380,14 @@ export async function handlePickupInternal(ctx, request, now) {
|
|
|
290
380
|
agentDid: rec.agentDid,
|
|
291
381
|
audience: rec.audience,
|
|
292
382
|
serverDid: rec.serverDid,
|
|
383
|
+
nativeHttp: rec.nativeHttp,
|
|
384
|
+
nativeRegistration: rec.nativeRegistration,
|
|
385
|
+
nativeIssuerDid: rec.nativeIssuerDid,
|
|
386
|
+
nativePolicyRevision: rec.nativePolicyRevision,
|
|
387
|
+
// This internal-only projection carries public key material for issuance.
|
|
388
|
+
...(rec.nativeHttp && rec.pin?.type === "keyid"
|
|
389
|
+
? { holderKeyId: rec.pin.keyId }
|
|
390
|
+
: {}),
|
|
293
391
|
},
|
|
294
392
|
});
|
|
295
393
|
}
|