@kya-os/mcp-i-cloudflare 1.18.0 → 1.18.1
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/README.md +273 -54
- package/dist/adapter.d.ts +3 -17
- package/dist/adapter.d.ts.map +1 -1
- package/dist/adapter.js +30 -477
- package/dist/adapter.js.map +1 -1
- package/dist/agent.d.ts +59 -35
- package/dist/agent.d.ts.map +1 -1
- package/dist/agent.js +383 -406
- package/dist/agent.js.map +1 -1
- package/dist/app.d.ts.map +1 -1
- package/dist/app.js +150 -94
- package/dist/app.js.map +1 -1
- package/dist/audit/deployment-binding.d.ts +16 -16
- package/dist/authority-outcome.d.ts +110 -0
- package/dist/authority-outcome.d.ts.map +1 -0
- package/dist/authority-outcome.js +154 -0
- package/dist/authority-outcome.js.map +1 -0
- package/dist/config.d.ts +8 -77
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +0 -83
- package/dist/config.js.map +1 -1
- package/dist/delegation-http/bearer-retry.d.ts +84 -32
- package/dist/delegation-http/bearer-retry.d.ts.map +1 -1
- package/dist/delegation-http/bearer-retry.js +124 -139
- package/dist/delegation-http/bearer-retry.js.map +1 -1
- package/dist/delegation-http/connect-gate.d.ts +47 -0
- package/dist/delegation-http/connect-gate.d.ts.map +1 -0
- package/dist/delegation-http/connect-gate.js +104 -0
- package/dist/delegation-http/connect-gate.js.map +1 -0
- package/dist/delegation-http/constants.d.ts +4 -49
- package/dist/delegation-http/constants.d.ts.map +1 -1
- package/dist/delegation-http/constants.js +4 -58
- package/dist/delegation-http/constants.js.map +1 -1
- package/dist/delegation-http/issuer-binding.d.ts +26 -0
- package/dist/delegation-http/issuer-binding.d.ts.map +1 -0
- package/dist/delegation-http/issuer-binding.js +51 -0
- package/dist/delegation-http/issuer-binding.js.map +1 -0
- package/dist/delegation-http/lazy-auth-gate.d.ts +88 -0
- package/dist/delegation-http/lazy-auth-gate.d.ts.map +1 -0
- package/dist/delegation-http/lazy-auth-gate.js +203 -0
- package/dist/delegation-http/lazy-auth-gate.js.map +1 -0
- package/dist/delegation-http/native-challenge.d.ts +52 -0
- package/dist/delegation-http/native-challenge.d.ts.map +1 -0
- package/dist/delegation-http/native-challenge.js +124 -0
- package/dist/delegation-http/native-challenge.js.map +1 -0
- package/dist/delegation-http/native-consent-redirect.d.ts +21 -0
- package/dist/delegation-http/native-consent-redirect.d.ts.map +1 -0
- package/dist/delegation-http/native-consent-redirect.js +43 -0
- package/dist/delegation-http/native-consent-redirect.js.map +1 -0
- package/dist/delegation-http/native-http.d.ts +1 -86
- package/dist/delegation-http/native-http.d.ts.map +1 -1
- package/dist/delegation-http/native-http.js +2 -130
- package/dist/delegation-http/native-http.js.map +1 -1
- package/dist/delegation-http/native-oauth-state-do.d.ts +13 -35
- package/dist/delegation-http/native-oauth-state-do.d.ts.map +1 -1
- package/dist/delegation-http/native-oauth-state-do.js +10 -165
- package/dist/delegation-http/native-oauth-state-do.js.map +1 -1
- package/dist/delegation-http/protected-resource.d.ts +37 -0
- package/dist/delegation-http/protected-resource.d.ts.map +1 -0
- package/dist/delegation-http/protected-resource.js +43 -0
- package/dist/delegation-http/protected-resource.js.map +1 -0
- package/dist/delegation-http/request-proof.d.ts +20 -0
- package/dist/delegation-http/request-proof.d.ts.map +1 -0
- package/dist/delegation-http/request-proof.js +29 -0
- package/dist/delegation-http/request-proof.js.map +1 -0
- package/dist/delegation-http/sid.d.ts +4 -12
- package/dist/delegation-http/sid.d.ts.map +1 -1
- package/dist/delegation-http/sid.js +4 -19
- package/dist/delegation-http/sid.js.map +1 -1
- package/dist/delegation-http/well-known-capability.d.ts +8 -12
- package/dist/delegation-http/well-known-capability.d.ts.map +1 -1
- package/dist/delegation-http/well-known-capability.js +9 -18
- 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 +7 -29
- package/dist/helpers/env-mapper.js.map +1 -1
- package/dist/index.d.ts +2 -4
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +11 -8
- package/dist/index.js.map +1 -1
- package/dist/proof-generator.d.ts +24 -17
- package/dist/proof-generator.d.ts.map +1 -1
- package/dist/proof-generator.js +42 -56
- package/dist/proof-generator.js.map +1 -1
- package/dist/runtime/oauth-handler.d.ts +1 -1
- package/dist/runtime/oauth-handler.d.ts.map +1 -1
- package/dist/runtime/oauth-handler.js +15 -30
- package/dist/runtime/oauth-handler.js.map +1 -1
- package/dist/runtime.d.ts +34 -10
- package/dist/runtime.d.ts.map +1 -1
- package/dist/runtime.js +54 -12
- package/dist/runtime.js.map +1 -1
- package/dist/security/admission-refusal.d.ts +3 -3
- package/dist/security/admission-refusal.d.ts.map +1 -1
- package/dist/security/admission-refusal.js +14 -6
- package/dist/security/admission-refusal.js.map +1 -1
- package/dist/security/holder-binding.d.ts +34 -0
- package/dist/security/holder-binding.d.ts.map +1 -0
- package/dist/security/holder-binding.js +75 -0
- package/dist/security/holder-binding.js.map +1 -0
- package/dist/security/mcp-admission.d.ts +29 -1
- package/dist/security/mcp-admission.d.ts.map +1 -1
- package/dist/security/mcp-admission.js +78 -12
- package/dist/security/mcp-admission.js.map +1 -1
- package/dist/security/native-holder-admission.d.ts +39 -0
- package/dist/security/native-holder-admission.d.ts.map +1 -0
- package/dist/security/native-holder-admission.js +65 -0
- package/dist/security/native-holder-admission.js.map +1 -0
- package/dist/security/outcome-proof.d.ts +39 -0
- package/dist/security/outcome-proof.d.ts.map +1 -0
- package/dist/security/outcome-proof.js +54 -0
- package/dist/security/outcome-proof.js.map +1 -0
- package/dist/security/request-nonce-store.d.ts +43 -0
- package/dist/security/request-nonce-store.d.ts.map +1 -0
- package/dist/security/request-nonce-store.js +129 -0
- package/dist/security/request-nonce-store.js.map +1 -0
- package/dist/security/routed-request.d.ts +41 -0
- package/dist/security/routed-request.d.ts.map +1 -0
- package/dist/security/routed-request.js +86 -0
- package/dist/security/routed-request.js.map +1 -0
- package/dist/security/sign-in-amr.d.ts +23 -0
- package/dist/security/sign-in-amr.d.ts.map +1 -0
- package/dist/security/sign-in-amr.js +44 -0
- package/dist/security/sign-in-amr.js.map +1 -0
- package/dist/services/approval-route.d.ts +3 -2
- package/dist/services/approval-route.d.ts.map +1 -1
- package/dist/services/approval-route.js.map +1 -1
- package/dist/services/checkpoint-decision.d.ts +56 -0
- package/dist/services/checkpoint-decision.d.ts.map +1 -0
- package/dist/services/checkpoint-decision.js +109 -0
- package/dist/services/checkpoint-decision.js.map +1 -0
- package/dist/services/consent-page-renderer.d.ts.map +1 -1
- package/dist/services/consent-page-renderer.js +2 -3
- package/dist/services/consent-page-renderer.js.map +1 -1
- package/dist/services/consent.service.d.ts +11 -49
- package/dist/services/consent.service.d.ts.map +1 -1
- package/dist/services/consent.service.js +81 -307
- package/dist/services/consent.service.js.map +1 -1
- package/dist/services/credential-auth.handler.d.ts.map +1 -1
- package/dist/services/credential-auth.handler.js +2 -8
- package/dist/services/credential-auth.handler.js.map +1 -1
- package/dist/services/delegation-authority.d.ts +53 -0
- package/dist/services/delegation-authority.d.ts.map +1 -0
- package/dist/services/delegation-authority.js +130 -0
- package/dist/services/delegation-authority.js.map +1 -0
- package/dist/services/delegation-trust.d.ts +35 -64
- package/dist/services/delegation-trust.d.ts.map +1 -1
- package/dist/services/delegation-trust.js +98 -279
- package/dist/services/delegation-trust.js.map +1 -1
- package/dist/services/delegation.service.d.ts +83 -105
- package/dist/services/delegation.service.d.ts.map +1 -1
- package/dist/services/delegation.service.js +166 -518
- package/dist/services/delegation.service.js.map +1 -1
- package/dist/services/idp-token-storage.d.ts +32 -12
- package/dist/services/idp-token-storage.d.ts.map +1 -1
- package/dist/services/idp-token-storage.js +79 -36
- package/dist/services/idp-token-storage.js.map +1 -1
- package/dist/services/issuer-keys.d.ts +55 -0
- package/dist/services/issuer-keys.d.ts.map +1 -0
- package/dist/services/issuer-keys.js +184 -0
- package/dist/services/issuer-keys.js.map +1 -0
- package/dist/services/oauth-security.service.d.ts +17 -1
- package/dist/services/oauth-security.service.d.ts.map +1 -1
- package/dist/services/oauth-security.service.js +29 -10
- package/dist/services/oauth-security.service.js.map +1 -1
- package/dist/services/resource-audience.d.ts +12 -9
- package/dist/services/resource-audience.d.ts.map +1 -1
- package/dist/services/resource-audience.js +12 -9
- package/dist/services/resource-audience.js.map +1 -1
- package/dist/services/unenforceable-tool-protection.d.ts +32 -0
- package/dist/services/unenforceable-tool-protection.d.ts.map +1 -0
- package/dist/services/unenforceable-tool-protection.js +90 -0
- package/dist/services/unenforceable-tool-protection.js.map +1 -0
- package/dist/services/upstream-fetch.d.ts +14 -0
- package/dist/services/upstream-fetch.d.ts.map +1 -0
- package/dist/services/upstream-fetch.js +56 -0
- package/dist/services/upstream-fetch.js.map +1 -0
- package/dist/types.d.ts +5 -18
- package/dist/types.d.ts.map +1 -1
- package/dist/utils/tool-security-schemes.d.ts +65 -0
- package/dist/utils/tool-security-schemes.d.ts.map +1 -0
- package/dist/utils/tool-security-schemes.js +168 -0
- package/dist/utils/tool-security-schemes.js.map +1 -0
- package/package.json +3 -4
- package/dist/delegation-http/anchor-do.d.ts +0 -84
- package/dist/delegation-http/anchor-do.d.ts.map +0 -1
- package/dist/delegation-http/anchor-do.js +0 -412
- package/dist/delegation-http/anchor-do.js.map +0 -1
- package/dist/delegation-http/anchor-registration-validate.d.ts +0 -61
- package/dist/delegation-http/anchor-registration-validate.d.ts.map +0 -1
- package/dist/delegation-http/anchor-registration-validate.js +0 -191
- package/dist/delegation-http/anchor-registration-validate.js.map +0 -1
- package/dist/delegation-http/anchor-registration.d.ts +0 -62
- package/dist/delegation-http/anchor-registration.d.ts.map +0 -1
- package/dist/delegation-http/anchor-registration.js +0 -337
- package/dist/delegation-http/anchor-registration.js.map +0 -1
- package/dist/delegation-http/anchor-routing.d.ts +0 -20
- package/dist/delegation-http/anchor-routing.d.ts.map +0 -1
- package/dist/delegation-http/anchor-routing.js +0 -27
- package/dist/delegation-http/anchor-routing.js.map +0 -1
- package/dist/delegation-http/challenge-middleware.d.ts +0 -28
- package/dist/delegation-http/challenge-middleware.d.ts.map +0 -1
- package/dist/delegation-http/challenge-middleware.js +0 -190
- package/dist/delegation-http/challenge-middleware.js.map +0 -1
- package/dist/delegation-http/challenge.d.ts +0 -102
- package/dist/delegation-http/challenge.d.ts.map +0 -1
- package/dist/delegation-http/challenge.js +0 -223
- package/dist/delegation-http/challenge.js.map +0 -1
- package/dist/delegation-http/consent-anchor-bridge.d.ts +0 -70
- package/dist/delegation-http/consent-anchor-bridge.d.ts.map +0 -1
- package/dist/delegation-http/consent-anchor-bridge.js +0 -1130
- package/dist/delegation-http/consent-anchor-bridge.js.map +0 -1
- package/dist/delegation-http/consent-preparation-page.d.ts +0 -18
- package/dist/delegation-http/consent-preparation-page.d.ts.map +0 -1
- package/dist/delegation-http/consent-preparation-page.js +0 -172
- package/dist/delegation-http/consent-preparation-page.js.map +0 -1
- package/dist/delegation-http/credential-consent.d.ts +0 -149
- package/dist/delegation-http/credential-consent.d.ts.map +0 -1
- package/dist/delegation-http/credential-consent.js +0 -338
- package/dist/delegation-http/credential-consent.js.map +0 -1
- package/dist/delegation-http/native-capabilities.d.ts +0 -4
- package/dist/delegation-http/native-capabilities.d.ts.map +0 -1
- package/dist/delegation-http/native-capabilities.js +0 -53
- package/dist/delegation-http/native-capabilities.js.map +0 -1
- package/dist/delegation-http/native-oauth-state.d.ts +0 -28
- package/dist/delegation-http/native-oauth-state.d.ts.map +0 -1
- package/dist/delegation-http/native-oauth-state.js +0 -146
- package/dist/delegation-http/native-oauth-state.js.map +0 -1
- package/dist/delegation-http/native-oauth.d.ts +0 -26
- package/dist/delegation-http/native-oauth.d.ts.map +0 -1
- package/dist/delegation-http/native-oauth.js +0 -401
- package/dist/delegation-http/native-oauth.js.map +0 -1
- package/dist/delegation-http/native-pickup.d.ts +0 -20
- package/dist/delegation-http/native-pickup.d.ts.map +0 -1
- package/dist/delegation-http/native-pickup.js +0 -227
- package/dist/delegation-http/native-pickup.js.map +0 -1
- package/dist/delegation-http/pickup-routes.d.ts +0 -43
- package/dist/delegation-http/pickup-routes.d.ts.map +0 -1
- package/dist/delegation-http/pickup-routes.js +0 -166
- package/dist/delegation-http/pickup-routes.js.map +0 -1
- package/dist/delegation-http/register.d.ts +0 -26
- package/dist/delegation-http/register.d.ts.map +0 -1
- package/dist/delegation-http/register.js +0 -95
- package/dist/delegation-http/register.js.map +0 -1
- package/dist/delegation-http/registrar-auth.d.ts +0 -24
- package/dist/delegation-http/registrar-auth.d.ts.map +0 -1
- package/dist/delegation-http/registrar-auth.js +0 -61
- package/dist/delegation-http/registrar-auth.js.map +0 -1
- package/dist/delegation-http/remote-issuer.d.ts +0 -52
- package/dist/delegation-http/remote-issuer.d.ts.map +0 -1
- package/dist/delegation-http/remote-issuer.js +0 -324
- package/dist/delegation-http/remote-issuer.js.map +0 -1
- package/dist/delegation-http/types.d.ts +0 -116
- package/dist/delegation-http/types.d.ts.map +0 -1
- package/dist/delegation-http/types.js +0 -11
- package/dist/delegation-http/types.js.map +0 -1
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,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;
|
|
1
|
+
{"version":3,"file":"config.js","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAUH,OAAO,EAAE,eAAe,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAqchF;;GAEG;AACH,MAAM,CAAC,MAAM,8BAA8B,GACzC;IACE,WAAW,EAAE,aAAa;IAC1B,OAAO,EAAE;QACP,KAAK,EAAE,EAAE;QACT,QAAQ,EAAE,GAAG;KACd;IACD,EAAE,EAAE,EAAE;IACN,cAAc,EAAE,EAAE;IAClB,EAAE,EAAE,EAAE;IACN,IAAI,EAAE;QACJ,WAAW,EAAE,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AAqB;wBACpC;;;;;;;;;;;;;;;;;;2BAkBG;wBACH,QAAQ,EAAE,CAAC,GAAG,EAAE;4BACd,MAAM,GAAG,GAAG,GAAG,CAAC,yBAAyB;gCACvC,CAAC,CAAC,QAAQ,CAAC,GAAG,CAAC,yBAAyB,EAAE,EAAE,CAAC;gCAC7C,CAAC,CAAC,MAAM,CAAC,CAAC,oBAAoB;4BAEhC,8BAA8B;4BAC9B,IAAI,KAAK,CAAC,GAAG,CAAC,IAAI,GAAG,GAAG,CAAC,IAAI,GAAG,GAAG,OAAO,EAAE,CAAC;gCAC3C,OAAO,CAAC,IAAI,CACV,sCAAsC,GAAG,CAAC,yBAAyB,IAAI;oCACrE,yEAAyE,CAC5E,CAAC;gCACF,OAAO,MAAM,CAAC;4BAChB,CAAC;4BAED,OAAO,GAAG,CAAC;wBACb,CAAC,CAAC,EAAE;qBACL;oBACD,kEAAkE;oBAClE,0EAA0E;oBAC1E,WAAW,EAAE,EAAE;oBACf,sDAAsD;oBACtD,qBAAqB,EAAE,SAAS;oBAChC,KAAK,EAAE,UAAU,CAAC,WAAW,KAAK,aAAa;iBAChD;gBACH,CAAC,CAAC,SAAS,CAAC;QAChB,0BAA0B;QAC1B,gGAAgG;QAChG,KAAK,EACH,MAAM,CAAC,KAAK;YACZ,CAAC,GAAG,CAAC,kBAAkB;gBACrB,CAAC,CAAC;oBACE,OAAO,EAAE,IAAI;oBACb,MAAM,EAAE,GAAG,CAAC,aAAa,IAAI,GAAG,CAAC,kBAAkB;iBACpD;gBACH,CAAC,CAAC,SAAS,CAAC;KACU,CAAC;AAC/B,CAAC"}
|
|
@@ -1,62 +1,114 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
2
|
+
* Presented-delegation pass-through for MCP requests.
|
|
3
3
|
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
* adapter's existing `params.delegationToken` priority seam (adapter.ts:~458 —
|
|
7
|
-
* by `adapter-delegation-priority.test.ts`), WITHOUT editing the adapter
|
|
4
|
+
* A caller that holds a delegation presents it as `Authorization: Bearer <vc-jwt>`
|
|
5
|
+
* or in the `KYA-Delegation` header. This module moves that credential into the
|
|
6
|
+
* adapter's existing `params.delegationToken` priority seam (adapter.ts:~458 —
|
|
7
|
+
* tested by `adapter-delegation-priority.test.ts`), WITHOUT editing the adapter.
|
|
8
|
+
* It never verifies the credential and never answers an authorization decision:
|
|
9
|
+
* the Durable Object is the authority. Its delegation verification (org issuer,
|
|
10
|
+
* the routed host as audience, the signed status list, holder binding) and its
|
|
11
|
+
* request admission run for every `tools/call`, and a refusal comes back to the
|
|
12
|
+
* client as the delegation-required tool result, on every transport.
|
|
8
13
|
*
|
|
9
14
|
* - `extractDelegationVcJwt` accepts `Authorization: Bearer <jwt>` ONLY when the
|
|
10
15
|
* decoded JWT payload carries a `vc` claim. An opaque OAuth bearer (no `vc`) is
|
|
11
16
|
* left untouched (returns null) so existing OAuth clients pass through. When
|
|
12
17
|
* `Authorization` is occupied by such a non-VC bearer, the `KYA-Delegation` header
|
|
13
18
|
* is used as the fallback carrier.
|
|
14
|
-
* - `applyBearerDelegation`
|
|
15
|
-
*
|
|
16
|
-
* unsigned legacy requests, adds `params.delegationToken = vcJwt`.
|
|
17
|
-
* An invalid chain → 403 `kyaos/chain-broken`; an expired credential → 401
|
|
18
|
-
* `kyaos/expired`. Both error responses carry `Cache-Control: no-store`.
|
|
19
|
+
* - `applyBearerDelegation` adds `params.delegationToken = vcJwt` to an unsigned
|
|
20
|
+
* `tools/call` and passes every other request through unchanged.
|
|
19
21
|
* - A request that carries a request proof (a card `_meta` carrier or an HTTP
|
|
20
22
|
* message signature header) keeps its body byte for byte, because rewriting
|
|
21
23
|
* it would break the proof; admission reads the credential from the transport
|
|
22
24
|
* headers instead. The card keys come only from the validated card proof
|
|
23
25
|
* support accessor: in an esbuild bundle the statically imported card
|
|
24
26
|
* constants can stay undefined, which made every signed body look unsigned
|
|
25
|
-
* and get rewritten.
|
|
26
|
-
*
|
|
27
|
-
*
|
|
28
|
-
*
|
|
29
|
-
*
|
|
30
|
-
*
|
|
27
|
+
* and get rewritten. When that support cannot be validated, the
|
|
28
|
+
* proof-shaped superset decides, so a proof-shaped body is left untouched.
|
|
29
|
+
* - `assessPresentedBearer` and `assessPresentedCredential` classify a
|
|
30
|
+
* presented delegation (none, valid, expired, invalid, refer, malformed)
|
|
31
|
+
* for the lazy-auth gate (./lazy-auth-gate). They are not part of the
|
|
32
|
+
* pass-through.
|
|
33
|
+
* - The one refusal left is a malformed presentation (an unparseable header
|
|
34
|
+
* presentation, or a `params.delegationToken` that differs from the header
|
|
35
|
+
* credential): `400 invalid_request` with `Cache-Control: no-store`. That is a
|
|
36
|
+
* malformed request, not an authorization decision.
|
|
31
37
|
*
|
|
32
38
|
* @module @kya-os/mcp-i-cloudflare/delegation-http/bearer-retry
|
|
33
39
|
*/
|
|
34
|
-
import type { HttpChallengeConfig } from "../config";
|
|
35
40
|
import { type CardProofSupportGetter } from "../security/card-proof-support";
|
|
41
|
+
import { type LocalVerificationCode } from "../services/delegation.service";
|
|
36
42
|
import type { CloudflareEnv } from "../types";
|
|
37
43
|
/** Identify the presented VC-JWT without treating it as verified authority. */
|
|
38
44
|
export declare function extractDelegationVcJwt(request: Request): string | null;
|
|
39
45
|
/**
|
|
40
|
-
*
|
|
41
|
-
* adapter.
|
|
46
|
+
* How a presented delegation classifies at the edge.
|
|
42
47
|
*
|
|
43
|
-
* -
|
|
44
|
-
*
|
|
45
|
-
* -
|
|
48
|
+
* - `invalid`: the token's own validity failed (unparseable, bad signature,
|
|
49
|
+
* untrusted issuer, wrong audience, not yet valid).
|
|
50
|
+
* - `refer`: the refusal is an authority decision (revocation, status list,
|
|
51
|
+
* holder binding, delegation chain), left to the Durable Object.
|
|
52
|
+
*/
|
|
53
|
+
export type BearerVerdict = {
|
|
54
|
+
kind: "none";
|
|
55
|
+
} | {
|
|
56
|
+
kind: "valid";
|
|
57
|
+
holderBound: boolean;
|
|
58
|
+
scopes: readonly string[];
|
|
59
|
+
} | {
|
|
60
|
+
kind: "expired";
|
|
61
|
+
} | {
|
|
62
|
+
kind: "invalid";
|
|
63
|
+
} | {
|
|
64
|
+
kind: "refer";
|
|
65
|
+
} | {
|
|
66
|
+
kind: "malformed";
|
|
67
|
+
};
|
|
68
|
+
/** The verdict a refused credential maps to, by the verifier's refusal code. */
|
|
69
|
+
type RefusalVerdict = Extract<BearerVerdict, {
|
|
70
|
+
kind: "expired" | "invalid" | "refer";
|
|
71
|
+
}>["kind"];
|
|
72
|
+
/**
|
|
73
|
+
* Every refusal code `verifyLocally` returns, and the edge verdict it maps to.
|
|
74
|
+
* Keyed by the code union, so a new code fails to compile until it is placed.
|
|
75
|
+
* `holder_proof_required` and `holder_mismatch` are never returned while the
|
|
76
|
+
* holder check is deferred; they are listed so the table stays exhaustive.
|
|
77
|
+
*/
|
|
78
|
+
export declare const REFUSAL_VERDICTS: Readonly<Record<LocalVerificationCode, RefusalVerdict>>;
|
|
79
|
+
/**
|
|
80
|
+
* Classify a presented VC-JWT for an edge decision. It verifies locally
|
|
81
|
+
* (trusted issuer, the request URL's host as audience, the kid-named key, the
|
|
82
|
+
* signed status list) with the holder check deferred, and returns a verdict;
|
|
83
|
+
* it answers nothing itself. The Durable Object stays the authority, and
|
|
84
|
+
* Checkpoint is never asked.
|
|
85
|
+
*/
|
|
86
|
+
export declare function assessPresentedCredential(vcJwt: string, request: Request, env: CloudflareEnv, nativeIssuerDid?: string): Promise<BearerVerdict>;
|
|
87
|
+
/**
|
|
88
|
+
* Classify the delegation a request presents in its headers: none, malformed,
|
|
89
|
+
* or the verdict on the credential (see {@link assessPresentedCredential}).
|
|
90
|
+
*/
|
|
91
|
+
export declare function assessPresentedBearer(request: Request, env: CloudflareEnv, nativeIssuerDid?: string): Promise<BearerVerdict>;
|
|
92
|
+
/**
|
|
93
|
+
* Hand a presented delegation to the adapter before the request reaches it.
|
|
94
|
+
*
|
|
95
|
+
* - No delegation VC-JWT presented → `{ request }` unchanged.
|
|
96
|
+
* - A request proof (card `_meta` carrier, or `Signature`, `Signature-Input`
|
|
97
|
+
* or `KYA-OS-Delegation-Proof`) → `{ request }` unchanged.
|
|
98
|
+
* - An unsigned `tools/call` → `{ request }` whose body carries
|
|
99
|
+
* `params.delegationToken = vcJwt`.
|
|
100
|
+
* - Any other message or body → `{ request }` unchanged.
|
|
101
|
+
* - A malformed presentation → `{ errorResponse }` 400 `invalid_request`
|
|
46
102
|
* (`no-store`).
|
|
47
|
-
*
|
|
48
|
-
*
|
|
49
|
-
*
|
|
50
|
-
*
|
|
51
|
-
* `{ errorResponse }` 503 `proof_support_unavailable` (`no-store`), whatever
|
|
52
|
-
* the body carries.
|
|
53
|
-
* - Valid VC-JWT but a non-JSON-RPC body the token cannot be injected into →
|
|
54
|
-
* `{ errorResponse }` 400 `invalid_request` (`no-store`); we never silently drop
|
|
55
|
-
* an accepted credential.
|
|
103
|
+
*
|
|
104
|
+
* The credential is never verified here, so an expired, invalid or
|
|
105
|
+
* holder-bound credential goes on like any other and is refused at the
|
|
106
|
+
* Durable Object.
|
|
56
107
|
*/
|
|
57
|
-
export declare function applyBearerDelegation(request: Request,
|
|
108
|
+
export declare function applyBearerDelegation(request: Request, getProofSupport?: CardProofSupportGetter): Promise<{
|
|
58
109
|
request: Request;
|
|
59
110
|
} | {
|
|
60
111
|
errorResponse: Response;
|
|
61
112
|
}>;
|
|
113
|
+
export {};
|
|
62
114
|
//# sourceMappingURL=bearer-retry.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bearer-retry.d.ts","sourceRoot":"","sources":["../../src/delegation-http/bearer-retry.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"bearer-retry.d.ts","sourceRoot":"","sources":["../../src/delegation-http/bearer-retry.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsCG;AAEH,OAAO,EACL,KAAK,sBAAsB,EAE5B,MAAM,g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sB,qBAAqB,CACzC,OAAO,EAAE,OAAO,EAChB,eAAe,GAAE,sBAA4C,GAC5D,OAAO,CAAC;IAAE,OAAO,EAAE,OAAO,CAAA;CAAE,GAAG;IAAE,aAAa,EAAE,QAAQ,CAAA;CAAE,CAAC,CAW7D"}
|
|
@@ -1,92 +1,139 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
2
|
+
* Presented-delegation pass-through for MCP requests.
|
|
3
3
|
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
* adapter's existing `params.delegationToken` priority seam (adapter.ts:~458 —
|
|
7
|
-
* by `adapter-delegation-priority.test.ts`), WITHOUT editing the adapter
|
|
4
|
+
* A caller that holds a delegation presents it as `Authorization: Bearer <vc-jwt>`
|
|
5
|
+
* or in the `KYA-Delegation` header. This module moves that credential into the
|
|
6
|
+
* adapter's existing `params.delegationToken` priority seam (adapter.ts:~458 —
|
|
7
|
+
* tested by `adapter-delegation-priority.test.ts`), WITHOUT editing the adapter.
|
|
8
|
+
* It never verifies the credential and never answers an authorization decision:
|
|
9
|
+
* the Durable Object is the authority. Its delegation verification (org issuer,
|
|
10
|
+
* the routed host as audience, the signed status list, holder binding) and its
|
|
11
|
+
* request admission run for every `tools/call`, and a refusal comes back to the
|
|
12
|
+
* client as the delegation-required tool result, on every transport.
|
|
8
13
|
*
|
|
9
14
|
* - `extractDelegationVcJwt` accepts `Authorization: Bearer <jwt>` ONLY when the
|
|
10
15
|
* decoded JWT payload carries a `vc` claim. An opaque OAuth bearer (no `vc`) is
|
|
11
16
|
* left untouched (returns null) so existing OAuth clients pass through. When
|
|
12
17
|
* `Authorization` is occupied by such a non-VC bearer, the `KYA-Delegation` header
|
|
13
18
|
* is used as the fallback carrier.
|
|
14
|
-
* - `applyBearerDelegation`
|
|
15
|
-
*
|
|
16
|
-
* unsigned legacy requests, adds `params.delegationToken = vcJwt`.
|
|
17
|
-
* An invalid chain → 403 `kyaos/chain-broken`; an expired credential → 401
|
|
18
|
-
* `kyaos/expired`. Both error responses carry `Cache-Control: no-store`.
|
|
19
|
+
* - `applyBearerDelegation` adds `params.delegationToken = vcJwt` to an unsigned
|
|
20
|
+
* `tools/call` and passes every other request through unchanged.
|
|
19
21
|
* - A request that carries a request proof (a card `_meta` carrier or an HTTP
|
|
20
22
|
* message signature header) keeps its body byte for byte, because rewriting
|
|
21
23
|
* it would break the proof; admission reads the credential from the transport
|
|
22
24
|
* headers instead. The card keys come only from the validated card proof
|
|
23
25
|
* support accessor: in an esbuild bundle the statically imported card
|
|
24
26
|
* constants can stay undefined, which made every signed body look unsigned
|
|
25
|
-
* and get rewritten.
|
|
26
|
-
*
|
|
27
|
-
*
|
|
28
|
-
*
|
|
29
|
-
*
|
|
30
|
-
*
|
|
27
|
+
* and get rewritten. When that support cannot be validated, the
|
|
28
|
+
* proof-shaped superset decides, so a proof-shaped body is left untouched.
|
|
29
|
+
* - `assessPresentedBearer` and `assessPresentedCredential` classify a
|
|
30
|
+
* presented delegation (none, valid, expired, invalid, refer, malformed)
|
|
31
|
+
* for the lazy-auth gate (./lazy-auth-gate). They are not part of the
|
|
32
|
+
* pass-through.
|
|
33
|
+
* - The one refusal left is a malformed presentation (an unparseable header
|
|
34
|
+
* presentation, or a `params.delegationToken` that differs from the header
|
|
35
|
+
* credential): `400 invalid_request` with `Cache-Control: no-store`. That is a
|
|
36
|
+
* malformed request, not an authorization decision.
|
|
31
37
|
*
|
|
32
38
|
* @module @kya-os/mcp-i-cloudflare/delegation-http/bearer-retry
|
|
33
39
|
*/
|
|
34
|
-
import { getCardProofSupport,
|
|
35
|
-
import { decodeJwtPayload,
|
|
36
|
-
import { DelegationService } from "../services/delegation.service";
|
|
37
|
-
import {
|
|
40
|
+
import { getCardProofSupport, } from "../security/card-proof-support";
|
|
41
|
+
import { decodeJwtPayload, InvalidDelegationPresentation, readHeaderDelegation, } from "../security/presented-delegation";
|
|
42
|
+
import { DelegationService, } from "../services/delegation.service";
|
|
43
|
+
import { carriesRequestProof } from "./request-proof";
|
|
44
|
+
/** Identify the presented VC-JWT without treating it as verified authority. */
|
|
45
|
+
export function extractDelegationVcJwt(request) {
|
|
46
|
+
return readHeaderDelegation((name) => request.headers.get(name)) ?? null;
|
|
47
|
+
}
|
|
38
48
|
/**
|
|
39
|
-
*
|
|
40
|
-
*
|
|
41
|
-
*
|
|
42
|
-
*
|
|
49
|
+
* Every refusal code `verifyLocally` returns, and the edge verdict it maps to.
|
|
50
|
+
* Keyed by the code union, so a new code fails to compile until it is placed.
|
|
51
|
+
* `holder_proof_required` and `holder_mismatch` are never returned while the
|
|
52
|
+
* holder check is deferred; they are listed so the table stays exhaustive.
|
|
43
53
|
*/
|
|
54
|
+
export const REFUSAL_VERDICTS = {
|
|
55
|
+
invalid_token: "invalid",
|
|
56
|
+
delegation_expired: "expired",
|
|
57
|
+
delegation_not_yet_valid: "invalid",
|
|
58
|
+
delegation_revoked: "refer",
|
|
59
|
+
revocation_check_failed: "refer",
|
|
60
|
+
holder_proof_required: "refer",
|
|
61
|
+
holder_mismatch: "refer",
|
|
62
|
+
};
|
|
63
|
+
/** Whether the JWT is expired by a numeric `exp` claim; undecodable or no `exp` is not. */
|
|
44
64
|
function isVcJwtExpired(jwt) {
|
|
45
|
-
const
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
if (typeof exp !== "number" || !Number.isFinite(exp))
|
|
50
|
-
return false;
|
|
51
|
-
return exp < Math.floor(Date.now() / 1000);
|
|
65
|
+
const exp = decodeJwtPayload(jwt)?.exp;
|
|
66
|
+
return (typeof exp === "number" &&
|
|
67
|
+
Number.isFinite(exp) &&
|
|
68
|
+
exp < Math.floor(Date.now() / 1000));
|
|
52
69
|
}
|
|
53
|
-
/**
|
|
54
|
-
|
|
55
|
-
|
|
70
|
+
/**
|
|
71
|
+
* Classify a presented VC-JWT for an edge decision. It verifies locally
|
|
72
|
+
* (trusted issuer, the request URL's host as audience, the kid-named key, the
|
|
73
|
+
* signed status list) with the holder check deferred, and returns a verdict;
|
|
74
|
+
* it answers nothing itself. The Durable Object stays the authority, and
|
|
75
|
+
* Checkpoint is never asked.
|
|
76
|
+
*/
|
|
77
|
+
export async function assessPresentedCredential(vcJwt, request, env, nativeIssuerDid) {
|
|
78
|
+
if (isVcJwtExpired(vcJwt))
|
|
79
|
+
return { kind: "expired" };
|
|
80
|
+
const verified = await new DelegationService(env, undefined, {
|
|
81
|
+
trustedIssuers: [nativeIssuerDid],
|
|
82
|
+
routedHost: new URL(request.url).host,
|
|
83
|
+
}).verifyLocally(vcJwt, { deferHolderBinding: true });
|
|
84
|
+
if (verified.valid)
|
|
85
|
+
return {
|
|
86
|
+
kind: "valid",
|
|
87
|
+
holderBound: verified.holderBound === true,
|
|
88
|
+
scopes: verified.scopes ?? [],
|
|
89
|
+
};
|
|
90
|
+
// A refusal without a code is not the token's own validity to call.
|
|
91
|
+
return { kind: verified.code ? REFUSAL_VERDICTS[verified.code] : "refer" };
|
|
56
92
|
}
|
|
57
93
|
/**
|
|
58
|
-
*
|
|
94
|
+
* Classify the delegation a request presents in its headers: none, malformed,
|
|
95
|
+
* or the verdict on the credential (see {@link assessPresentedCredential}).
|
|
59
96
|
*/
|
|
60
|
-
function
|
|
61
|
-
|
|
62
|
-
|
|
97
|
+
export async function assessPresentedBearer(request, env, nativeIssuerDid) {
|
|
98
|
+
let vcJwt;
|
|
99
|
+
try {
|
|
100
|
+
vcJwt = extractDelegationVcJwt(request);
|
|
101
|
+
}
|
|
102
|
+
catch (error) {
|
|
103
|
+
if (!(error instanceof InvalidDelegationPresentation))
|
|
104
|
+
throw error;
|
|
105
|
+
return { kind: "malformed" };
|
|
106
|
+
}
|
|
107
|
+
if (!vcJwt)
|
|
108
|
+
return { kind: "none" };
|
|
109
|
+
return assessPresentedCredential(vcJwt, request, env, nativeIssuerDid);
|
|
110
|
+
}
|
|
111
|
+
/** The malformed-presentation response: a bad request, not an authorization decision. */
|
|
112
|
+
function invalidRequest() {
|
|
113
|
+
return new Response(JSON.stringify({ error: "invalid_request" }), {
|
|
114
|
+
status: 400,
|
|
63
115
|
headers: {
|
|
64
116
|
"Content-Type": "application/json",
|
|
65
117
|
"Cache-Control": "no-store",
|
|
66
118
|
},
|
|
67
119
|
});
|
|
68
120
|
}
|
|
69
|
-
/** Headers whose signature covers the body, so the body must not change. */
|
|
70
|
-
const SIGNED_REQUEST_HEADERS = [
|
|
71
|
-
"Signature",
|
|
72
|
-
"Signature-Input",
|
|
73
|
-
"KYA-OS-Delegation-Proof",
|
|
74
|
-
];
|
|
75
121
|
/**
|
|
76
122
|
* Clone `request` rewriting the JSON-RPC body so `params.delegationToken = vcJwt`.
|
|
77
|
-
*
|
|
78
|
-
*
|
|
123
|
+
* A call carrying a request proof is returned unchanged. A body that is not a
|
|
124
|
+
* JSON-RPC object is returned unchanged. Throws `InvalidDelegationPresentation`
|
|
125
|
+
* when the body already carries a different `params.delegationToken`.
|
|
79
126
|
*/
|
|
80
|
-
async function rewriteDelegationToken(request, vcJwt,
|
|
127
|
+
async function rewriteDelegationToken(request, vcJwt, getProofSupport) {
|
|
81
128
|
let body;
|
|
82
129
|
try {
|
|
83
130
|
body = await request.clone().json();
|
|
84
131
|
}
|
|
85
132
|
catch {
|
|
86
|
-
return
|
|
133
|
+
return request;
|
|
87
134
|
}
|
|
88
135
|
if (!body || typeof body !== "object" || Array.isArray(body))
|
|
89
|
-
return
|
|
136
|
+
return request;
|
|
90
137
|
const rpc = body;
|
|
91
138
|
const params = rpc.params && typeof rpc.params === "object"
|
|
92
139
|
? { ...rpc.params }
|
|
@@ -94,114 +141,52 @@ async function rewriteDelegationToken(request, vcJwt, carriesRequestProof) {
|
|
|
94
141
|
if (Object.prototype.hasOwnProperty.call(params, "delegationToken") &&
|
|
95
142
|
params.delegationToken !== vcJwt)
|
|
96
143
|
throw new InvalidDelegationPresentation();
|
|
144
|
+
// Only a tool call reads the credential; every other message goes on as sent.
|
|
145
|
+
if (rpc.method !== "tools/call")
|
|
146
|
+
return request;
|
|
97
147
|
// Re-serializing or adding fields would invalidate native or HTTP request
|
|
98
148
|
// proofs. Admission receives the credential via transport request headers.
|
|
99
|
-
//
|
|
100
|
-
//
|
|
101
|
-
|
|
102
|
-
|
|
149
|
+
// Without validated card keys the proof-shaped superset decides: a false
|
|
150
|
+
// "signed" only withholds the body rewrite, a false "unsigned" breaks a proof
|
|
151
|
+
// (see ./request-proof).
|
|
152
|
+
if (await carriesRequestProof(request.headers, params._meta, getProofSupport))
|
|
103
153
|
return request;
|
|
104
154
|
params.delegationToken = vcJwt;
|
|
105
|
-
const nextBody = { ...rpc, params };
|
|
106
155
|
return new Request(request.url, {
|
|
107
156
|
method: request.method,
|
|
108
157
|
headers: request.headers,
|
|
109
|
-
body: JSON.stringify(
|
|
158
|
+
body: JSON.stringify({ ...rpc, params }),
|
|
110
159
|
});
|
|
111
160
|
}
|
|
112
161
|
/**
|
|
113
|
-
*
|
|
114
|
-
* adapter.
|
|
162
|
+
* Hand a presented delegation to the adapter before the request reaches it.
|
|
115
163
|
*
|
|
116
|
-
* - No delegation VC-JWT
|
|
117
|
-
* -
|
|
118
|
-
*
|
|
164
|
+
* - No delegation VC-JWT presented → `{ request }` unchanged.
|
|
165
|
+
* - A request proof (card `_meta` carrier, or `Signature`, `Signature-Input`
|
|
166
|
+
* or `KYA-OS-Delegation-Proof`) → `{ request }` unchanged.
|
|
167
|
+
* - An unsigned `tools/call` → `{ request }` whose body carries
|
|
168
|
+
* `params.delegationToken = vcJwt`.
|
|
169
|
+
* - Any other message or body → `{ request }` unchanged.
|
|
170
|
+
* - A malformed presentation → `{ errorResponse }` 400 `invalid_request`
|
|
119
171
|
* (`no-store`).
|
|
120
|
-
*
|
|
121
|
-
*
|
|
122
|
-
*
|
|
123
|
-
*
|
|
124
|
-
* `{ errorResponse }` 503 `proof_support_unavailable` (`no-store`), whatever
|
|
125
|
-
* the body carries.
|
|
126
|
-
* - Valid VC-JWT but a non-JSON-RPC body the token cannot be injected into →
|
|
127
|
-
* `{ errorResponse }` 400 `invalid_request` (`no-store`); we never silently drop
|
|
128
|
-
* an accepted credential.
|
|
172
|
+
*
|
|
173
|
+
* The credential is never verified here, so an expired, invalid or
|
|
174
|
+
* holder-bound credential goes on like any other and is refused at the
|
|
175
|
+
* Durable Object.
|
|
129
176
|
*/
|
|
130
|
-
export async function applyBearerDelegation(request,
|
|
131
|
-
let vcJwt;
|
|
132
|
-
try {
|
|
133
|
-
vcJwt = extractDelegationVcJwt(request);
|
|
134
|
-
}
|
|
135
|
-
catch (error) {
|
|
136
|
-
if (!(error instanceof InvalidDelegationPresentation))
|
|
137
|
-
throw error;
|
|
138
|
-
return { errorResponse: kyaosError("invalid_request", 400) };
|
|
139
|
-
}
|
|
140
|
-
if (!vcJwt) {
|
|
141
|
-
return { request };
|
|
142
|
-
}
|
|
143
|
-
// Fail-fast expiry check before verification so we can emit the precise 401.
|
|
144
|
-
if (isVcJwtExpired(vcJwt)) {
|
|
145
|
-
return { errorResponse: kyaosError(KYAOS_ERRORS.expired, 401) };
|
|
146
|
-
}
|
|
147
|
-
// The native issuer (code config or the provisioned binding) is
|
|
148
|
-
// deployment-owned: its org DID is a pinned issuer. The expected audience is
|
|
149
|
-
// did:web:<this request's own Host>, which must be one of this worker's
|
|
150
|
-
// resources. The host is the URL the edge delivered (WfP dispatch forwards
|
|
151
|
-
// the original request); no forwarding header is read.
|
|
152
|
-
const native = cfg.native ?? undefined;
|
|
153
|
-
const isValid = await new DelegationService(env, undefined, {
|
|
154
|
-
trustedIssuers: [native?.issuerDid],
|
|
155
|
-
routedHost: new URL(request.url).host,
|
|
156
|
-
}).verifyDelegation(vcJwt);
|
|
157
|
-
if (!isValid) {
|
|
158
|
-
// verifyDelegation also rejects expired tokens; re-check so an expiry that the
|
|
159
|
-
// pre-check missed (e.g. exp encoded unusually) still maps to 401 not 403.
|
|
160
|
-
if (isVcJwtExpired(vcJwt)) {
|
|
161
|
-
return { errorResponse: kyaosError(KYAOS_ERRORS.expired, 401) };
|
|
162
|
-
}
|
|
163
|
-
return { errorResponse: kyaosError(KYAOS_ERRORS.chainBroken, 403) };
|
|
164
|
-
}
|
|
165
|
-
// Resolved only once a credential has verified, so a retry-free request
|
|
166
|
-
// never waits on the card module.
|
|
167
|
-
const proofSupport = await getProofSupport();
|
|
168
|
-
if (!proofSupport.ok && cfg.native) {
|
|
169
|
-
// A native issuer serves callers that sign their calls. Without the card
|
|
170
|
-
// keys a signed body cannot be told apart reliably, and handling it as
|
|
171
|
-
// unsigned would admit it without its holder, so refuse the retry.
|
|
172
|
-
return { errorResponse: kyaosError(PROOF_SUPPORT_UNAVAILABLE, 503) };
|
|
173
|
-
}
|
|
174
|
-
// Without validated keys, the card-independent superset decides: a false
|
|
175
|
-
// "signed" only withholds the body rewrite, a false "unsigned" breaks a proof.
|
|
176
|
-
// Presence under a validated card key, including a malformed value, counts
|
|
177
|
-
// as signed: verification stays mandatory downstream, and a null carrier
|
|
178
|
-
// must not turn a signed call into an unsigned one.
|
|
179
|
-
const carriesRequestProof = proofSupport.ok
|
|
180
|
-
? (meta) => hasCardProofCarrier(meta, proofSupport.support)
|
|
181
|
-
: (meta) => isProofShapedMeta(meta);
|
|
182
|
-
let rewritten;
|
|
177
|
+
export async function applyBearerDelegation(request, getProofSupport = getCardProofSupport) {
|
|
183
178
|
try {
|
|
184
|
-
|
|
179
|
+
const vcJwt = extractDelegationVcJwt(request);
|
|
180
|
+
if (!vcJwt)
|
|
181
|
+
return { request };
|
|
182
|
+
return {
|
|
183
|
+
request: await rewriteDelegationToken(request, vcJwt, getProofSupport),
|
|
184
|
+
};
|
|
185
185
|
}
|
|
186
186
|
catch (error) {
|
|
187
187
|
if (!(error instanceof InvalidDelegationPresentation))
|
|
188
188
|
throw error;
|
|
189
|
-
return { errorResponse:
|
|
190
|
-
}
|
|
191
|
-
if (!rewritten) {
|
|
192
|
-
// The delegation verified, but the request body is not a JSON-RPC object we can
|
|
193
|
-
// augment with params.delegationToken. Fail explicitly with 400: silently
|
|
194
|
-
// forwarding the original request would drop the ACCEPTED credential, and the
|
|
195
|
-
// adapter would then treat the call as unauthorized — masking the acceptance.
|
|
196
|
-
// (A real /mcp POST always carries a JSON-RPC object, so this is a
|
|
197
|
-
// malformed-request guard, not a normal path.)
|
|
198
|
-
//
|
|
199
|
-
// `invalid_request`/400 is deliberately OUT-OF-BAND from the §9 `kyaos/*` registry:
|
|
200
|
-
// this is a transport-level malformed-body error, not a delegation-chain verdict.
|
|
201
|
-
// Reusing a `kyaos/*` 401/403 here would mislead the caller into a retry/challenge
|
|
202
|
-
// loop, and the registry (vendored error-codes.json) has no malformed-body code.
|
|
203
|
-
return { errorResponse: kyaosError("invalid_request", 400) };
|
|
189
|
+
return { errorResponse: invalidRequest() };
|
|
204
190
|
}
|
|
205
|
-
return { request: rewritten };
|
|
206
191
|
}
|
|
207
192
|
//# sourceMappingURL=bearer-retry.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bearer-retry.js","sourceRoot":"","sources":["../../src/delegation-http/bearer-retry.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"bearer-retry.js","sourceRoot":"","sources":["../../src/delegation-http/bearer-retry.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsCG;AAEH,OAAO,EAEL,mBAAmB,GACpB,MAAM,gCAAgC,CAAC;AACxC,OAAO,EACL,gBAAgB,EAChB,6BAA6B,EAC7B,oBAAoB,GACrB,MAAM,kCAAkC,CAAC;AAC1C,OAAO,EACL,iBAAiB,GAElB,MAAM,gCAAgC,CAAC;AAExC,OAAO,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAC;AAEtD,+EAA+E;AAC/E,MAAM,UAAU,sBAAsB,CAAC,OAAgB;IACrD,OAAO,oBAAoB,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,OAAO,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,IAAI,IAAI,CAAC;AAC3E,CAAC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,CAAC;QAC/B,OAAO;YACL,OAAO,EAAE,MAAM,sBAAsB,CAAC,OAAO,EAAE,KAAK,EAAE,eAAe,CAAC;SACvE,CAAC;IACJ,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,IAAI,CAAC,CAAC,KAAK,YAAY,6BAA6B,CAAC;YAAE,MAAM,KAAK,CAAC;QACnE,OAAO,EAAE,aAAa,EAAE,cAAc,EAAE,EAAE,CAAC;IAC7C,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Connection auth at the edge: ordinary MCP Authorization.
|
|
3
|
+
*
|
|
4
|
+
* When a deployment turns on `requireTokenToConnect` (config) or
|
|
5
|
+
* `MCPI_REQUIRE_TOKEN_TO_CONNECT` (env), every MCP request needs a valid
|
|
6
|
+
* Bearer credential for this resource. Without one the edge answers the
|
|
7
|
+
* connect-time 401 that sends an OAuth client to the protected-resource
|
|
8
|
+
* metadata. The decision is made on the request headers alone, before the
|
|
9
|
+
* request reaches the agent.
|
|
10
|
+
*
|
|
11
|
+
* It is off unless the deployment turns it on; when off, nothing changes. The
|
|
12
|
+
* per-tool lazy auth gate (./lazy-auth-gate) is separate and unchanged.
|
|
13
|
+
*
|
|
14
|
+
* It applies to every caller, KYA-OS native ones included: requiring a token
|
|
15
|
+
* to connect is the deployment's choice. Per-tool refusals stay tool results.
|
|
16
|
+
*
|
|
17
|
+
* Verdicts:
|
|
18
|
+
* - none or malformed: 401;
|
|
19
|
+
* - expired or invalid (the token's own validity): 401 `invalid_token`;
|
|
20
|
+
* - valid: pass;
|
|
21
|
+
* - refer (revocation, status list, holder binding): pass. The edge cannot
|
|
22
|
+
* decide these; the Durable Object decides them per tool.
|
|
23
|
+
*
|
|
24
|
+
* A verification that cannot run fails closed with 503 and `Retry-After`:
|
|
25
|
+
* the deployment chose to require a token, so a request that could not be
|
|
26
|
+
* checked is not let through.
|
|
27
|
+
*
|
|
28
|
+
* @module @kya-os/mcp-i-cloudflare/delegation-http/connect-gate
|
|
29
|
+
*/
|
|
30
|
+
import type { CloudflareRuntimeConfig } from "../config";
|
|
31
|
+
import type { CloudflareEnv } from "../types";
|
|
32
|
+
import { type BearerVerdict } from "./bearer-retry";
|
|
33
|
+
import { type LazyAuthAction } from "./lazy-auth-gate";
|
|
34
|
+
/**
|
|
35
|
+
* Whether the deployment requires a token to connect: the config flag, or the
|
|
36
|
+
* env var set to "true" or "1". Either turns it on; neither turns it off.
|
|
37
|
+
*/
|
|
38
|
+
export declare function requiresTokenToConnect(env: Pick<CloudflareEnv, "MCPI_REQUIRE_TOKEN_TO_CONNECT">, runtimeConfig: Pick<CloudflareRuntimeConfig, "requireTokenToConnect">): boolean;
|
|
39
|
+
/** The connect decision for a verdict. Pure. */
|
|
40
|
+
export declare function decideConnect(verdict: BearerVerdict): LazyAuthAction;
|
|
41
|
+
/**
|
|
42
|
+
* Decide a request at the edge. Returns the 401 (or 503) response, or null
|
|
43
|
+
* when the request goes on to the agent. The credential comes from the
|
|
44
|
+
* request headers only.
|
|
45
|
+
*/
|
|
46
|
+
export declare function applyConnectGate(request: Request, env: CloudflareEnv): Promise<Response | null>;
|
|
47
|
+
//# sourceMappingURL=connect-gate.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"connect-gate.d.ts","sourceRoot":"","sources":["../../src/delegation-http/connect-gate.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AAEH,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,WAAW,CAAC;AAEzD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAC9C,OAAO,EAEL,KAAK,aAAa,EAEnB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,KAAK,cAAc,EAAoB,MAAM,kBAAkB,CAAC;AAEzE;;;GAGG;AACH,wBAAgB,sBAAsB,CACpC,GAAG,EAAE,IAAI,CAAC,aAAa,EAAE,+BAA+B,CAAC,EACzD,aAAa,EAAE,IAAI,CAAC,uBAAuB,EAAE,uBAAuB,CAAC,GACpE,OAAO,CAMT;AAED,gDAAgD;AAChD,wBAAgB,aAAa,CAAC,OAAO,EAAE,aAAa,GAAG,cAAc,CA2BpE;AAmBD;;;;GAIG;AACH,wBAAsB,gBAAgB,CACpC,OAAO,EAAE,OAAO,EAChB,GAAG,EAAE,aAAa,GACjB,OAAO,CAAC,QAAQ,GAAG,IAAI,CAAC,CAa1B"}
|