@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.
Files changed (256) hide show
  1. package/README.md +273 -54
  2. package/dist/adapter.d.ts +3 -17
  3. package/dist/adapter.d.ts.map +1 -1
  4. package/dist/adapter.js +30 -477
  5. package/dist/adapter.js.map +1 -1
  6. package/dist/agent.d.ts +59 -35
  7. package/dist/agent.d.ts.map +1 -1
  8. package/dist/agent.js +383 -406
  9. package/dist/agent.js.map +1 -1
  10. package/dist/app.d.ts.map +1 -1
  11. package/dist/app.js +150 -94
  12. package/dist/app.js.map +1 -1
  13. package/dist/audit/deployment-binding.d.ts +16 -16
  14. package/dist/authority-outcome.d.ts +110 -0
  15. package/dist/authority-outcome.d.ts.map +1 -0
  16. package/dist/authority-outcome.js +154 -0
  17. package/dist/authority-outcome.js.map +1 -0
  18. package/dist/config.d.ts +8 -77
  19. package/dist/config.d.ts.map +1 -1
  20. package/dist/config.js +0 -83
  21. package/dist/config.js.map +1 -1
  22. package/dist/delegation-http/bearer-retry.d.ts +84 -32
  23. package/dist/delegation-http/bearer-retry.d.ts.map +1 -1
  24. package/dist/delegation-http/bearer-retry.js +124 -139
  25. package/dist/delegation-http/bearer-retry.js.map +1 -1
  26. package/dist/delegation-http/connect-gate.d.ts +47 -0
  27. package/dist/delegation-http/connect-gate.d.ts.map +1 -0
  28. package/dist/delegation-http/connect-gate.js +104 -0
  29. package/dist/delegation-http/connect-gate.js.map +1 -0
  30. package/dist/delegation-http/constants.d.ts +4 -49
  31. package/dist/delegation-http/constants.d.ts.map +1 -1
  32. package/dist/delegation-http/constants.js +4 -58
  33. package/dist/delegation-http/constants.js.map +1 -1
  34. package/dist/delegation-http/issuer-binding.d.ts +26 -0
  35. package/dist/delegation-http/issuer-binding.d.ts.map +1 -0
  36. package/dist/delegation-http/issuer-binding.js +51 -0
  37. package/dist/delegation-http/issuer-binding.js.map +1 -0
  38. package/dist/delegation-http/lazy-auth-gate.d.ts +88 -0
  39. package/dist/delegation-http/lazy-auth-gate.d.ts.map +1 -0
  40. package/dist/delegation-http/lazy-auth-gate.js +203 -0
  41. package/dist/delegation-http/lazy-auth-gate.js.map +1 -0
  42. package/dist/delegation-http/native-challenge.d.ts +52 -0
  43. package/dist/delegation-http/native-challenge.d.ts.map +1 -0
  44. package/dist/delegation-http/native-challenge.js +124 -0
  45. package/dist/delegation-http/native-challenge.js.map +1 -0
  46. package/dist/delegation-http/native-consent-redirect.d.ts +21 -0
  47. package/dist/delegation-http/native-consent-redirect.d.ts.map +1 -0
  48. package/dist/delegation-http/native-consent-redirect.js +43 -0
  49. package/dist/delegation-http/native-consent-redirect.js.map +1 -0
  50. package/dist/delegation-http/native-http.d.ts +1 -86
  51. package/dist/delegation-http/native-http.d.ts.map +1 -1
  52. package/dist/delegation-http/native-http.js +2 -130
  53. package/dist/delegation-http/native-http.js.map +1 -1
  54. package/dist/delegation-http/native-oauth-state-do.d.ts +13 -35
  55. package/dist/delegation-http/native-oauth-state-do.d.ts.map +1 -1
  56. package/dist/delegation-http/native-oauth-state-do.js +10 -165
  57. package/dist/delegation-http/native-oauth-state-do.js.map +1 -1
  58. package/dist/delegation-http/protected-resource.d.ts +37 -0
  59. package/dist/delegation-http/protected-resource.d.ts.map +1 -0
  60. package/dist/delegation-http/protected-resource.js +43 -0
  61. package/dist/delegation-http/protected-resource.js.map +1 -0
  62. package/dist/delegation-http/request-proof.d.ts +20 -0
  63. package/dist/delegation-http/request-proof.d.ts.map +1 -0
  64. package/dist/delegation-http/request-proof.js +29 -0
  65. package/dist/delegation-http/request-proof.js.map +1 -0
  66. package/dist/delegation-http/sid.d.ts +4 -12
  67. package/dist/delegation-http/sid.d.ts.map +1 -1
  68. package/dist/delegation-http/sid.js +4 -19
  69. package/dist/delegation-http/sid.js.map +1 -1
  70. package/dist/delegation-http/well-known-capability.d.ts +8 -12
  71. package/dist/delegation-http/well-known-capability.d.ts.map +1 -1
  72. package/dist/delegation-http/well-known-capability.js +9 -18
  73. package/dist/delegation-http/well-known-capability.js.map +1 -1
  74. package/dist/helpers/env-mapper.d.ts.map +1 -1
  75. package/dist/helpers/env-mapper.js +7 -29
  76. package/dist/helpers/env-mapper.js.map +1 -1
  77. package/dist/index.d.ts +2 -4
  78. package/dist/index.d.ts.map +1 -1
  79. package/dist/index.js +11 -8
  80. package/dist/index.js.map +1 -1
  81. package/dist/proof-generator.d.ts +24 -17
  82. package/dist/proof-generator.d.ts.map +1 -1
  83. package/dist/proof-generator.js +42 -56
  84. package/dist/proof-generator.js.map +1 -1
  85. package/dist/runtime/oauth-handler.d.ts +1 -1
  86. package/dist/runtime/oauth-handler.d.ts.map +1 -1
  87. package/dist/runtime/oauth-handler.js +15 -30
  88. package/dist/runtime/oauth-handler.js.map +1 -1
  89. package/dist/runtime.d.ts +34 -10
  90. package/dist/runtime.d.ts.map +1 -1
  91. package/dist/runtime.js +54 -12
  92. package/dist/runtime.js.map +1 -1
  93. package/dist/security/admission-refusal.d.ts +3 -3
  94. package/dist/security/admission-refusal.d.ts.map +1 -1
  95. package/dist/security/admission-refusal.js +14 -6
  96. package/dist/security/admission-refusal.js.map +1 -1
  97. package/dist/security/holder-binding.d.ts +34 -0
  98. package/dist/security/holder-binding.d.ts.map +1 -0
  99. package/dist/security/holder-binding.js +75 -0
  100. package/dist/security/holder-binding.js.map +1 -0
  101. package/dist/security/mcp-admission.d.ts +29 -1
  102. package/dist/security/mcp-admission.d.ts.map +1 -1
  103. package/dist/security/mcp-admission.js +78 -12
  104. package/dist/security/mcp-admission.js.map +1 -1
  105. package/dist/security/native-holder-admission.d.ts +39 -0
  106. package/dist/security/native-holder-admission.d.ts.map +1 -0
  107. package/dist/security/native-holder-admission.js +65 -0
  108. package/dist/security/native-holder-admission.js.map +1 -0
  109. package/dist/security/outcome-proof.d.ts +39 -0
  110. package/dist/security/outcome-proof.d.ts.map +1 -0
  111. package/dist/security/outcome-proof.js +54 -0
  112. package/dist/security/outcome-proof.js.map +1 -0
  113. package/dist/security/request-nonce-store.d.ts +43 -0
  114. package/dist/security/request-nonce-store.d.ts.map +1 -0
  115. package/dist/security/request-nonce-store.js +129 -0
  116. package/dist/security/request-nonce-store.js.map +1 -0
  117. package/dist/security/routed-request.d.ts +41 -0
  118. package/dist/security/routed-request.d.ts.map +1 -0
  119. package/dist/security/routed-request.js +86 -0
  120. package/dist/security/routed-request.js.map +1 -0
  121. package/dist/security/sign-in-amr.d.ts +23 -0
  122. package/dist/security/sign-in-amr.d.ts.map +1 -0
  123. package/dist/security/sign-in-amr.js +44 -0
  124. package/dist/security/sign-in-amr.js.map +1 -0
  125. package/dist/services/approval-route.d.ts +3 -2
  126. package/dist/services/approval-route.d.ts.map +1 -1
  127. package/dist/services/approval-route.js.map +1 -1
  128. package/dist/services/checkpoint-decision.d.ts +56 -0
  129. package/dist/services/checkpoint-decision.d.ts.map +1 -0
  130. package/dist/services/checkpoint-decision.js +109 -0
  131. package/dist/services/checkpoint-decision.js.map +1 -0
  132. package/dist/services/consent-page-renderer.d.ts.map +1 -1
  133. package/dist/services/consent-page-renderer.js +2 -3
  134. package/dist/services/consent-page-renderer.js.map +1 -1
  135. package/dist/services/consent.service.d.ts +11 -49
  136. package/dist/services/consent.service.d.ts.map +1 -1
  137. package/dist/services/consent.service.js +81 -307
  138. package/dist/services/consent.service.js.map +1 -1
  139. package/dist/services/credential-auth.handler.d.ts.map +1 -1
  140. package/dist/services/credential-auth.handler.js +2 -8
  141. package/dist/services/credential-auth.handler.js.map +1 -1
  142. package/dist/services/delegation-authority.d.ts +53 -0
  143. package/dist/services/delegation-authority.d.ts.map +1 -0
  144. package/dist/services/delegation-authority.js +130 -0
  145. package/dist/services/delegation-authority.js.map +1 -0
  146. package/dist/services/delegation-trust.d.ts +35 -64
  147. package/dist/services/delegation-trust.d.ts.map +1 -1
  148. package/dist/services/delegation-trust.js +98 -279
  149. package/dist/services/delegation-trust.js.map +1 -1
  150. package/dist/services/delegation.service.d.ts +83 -105
  151. package/dist/services/delegation.service.d.ts.map +1 -1
  152. package/dist/services/delegation.service.js +166 -518
  153. package/dist/services/delegation.service.js.map +1 -1
  154. package/dist/services/idp-token-storage.d.ts +32 -12
  155. package/dist/services/idp-token-storage.d.ts.map +1 -1
  156. package/dist/services/idp-token-storage.js +79 -36
  157. package/dist/services/idp-token-storage.js.map +1 -1
  158. package/dist/services/issuer-keys.d.ts +55 -0
  159. package/dist/services/issuer-keys.d.ts.map +1 -0
  160. package/dist/services/issuer-keys.js +184 -0
  161. package/dist/services/issuer-keys.js.map +1 -0
  162. package/dist/services/oauth-security.service.d.ts +17 -1
  163. package/dist/services/oauth-security.service.d.ts.map +1 -1
  164. package/dist/services/oauth-security.service.js +29 -10
  165. package/dist/services/oauth-security.service.js.map +1 -1
  166. package/dist/services/resource-audience.d.ts +12 -9
  167. package/dist/services/resource-audience.d.ts.map +1 -1
  168. package/dist/services/resource-audience.js +12 -9
  169. package/dist/services/resource-audience.js.map +1 -1
  170. package/dist/services/unenforceable-tool-protection.d.ts +32 -0
  171. package/dist/services/unenforceable-tool-protection.d.ts.map +1 -0
  172. package/dist/services/unenforceable-tool-protection.js +90 -0
  173. package/dist/services/unenforceable-tool-protection.js.map +1 -0
  174. package/dist/services/upstream-fetch.d.ts +14 -0
  175. package/dist/services/upstream-fetch.d.ts.map +1 -0
  176. package/dist/services/upstream-fetch.js +56 -0
  177. package/dist/services/upstream-fetch.js.map +1 -0
  178. package/dist/types.d.ts +5 -18
  179. package/dist/types.d.ts.map +1 -1
  180. package/dist/utils/tool-security-schemes.d.ts +65 -0
  181. package/dist/utils/tool-security-schemes.d.ts.map +1 -0
  182. package/dist/utils/tool-security-schemes.js +168 -0
  183. package/dist/utils/tool-security-schemes.js.map +1 -0
  184. package/package.json +3 -4
  185. package/dist/delegation-http/anchor-do.d.ts +0 -84
  186. package/dist/delegation-http/anchor-do.d.ts.map +0 -1
  187. package/dist/delegation-http/anchor-do.js +0 -412
  188. package/dist/delegation-http/anchor-do.js.map +0 -1
  189. package/dist/delegation-http/anchor-registration-validate.d.ts +0 -61
  190. package/dist/delegation-http/anchor-registration-validate.d.ts.map +0 -1
  191. package/dist/delegation-http/anchor-registration-validate.js +0 -191
  192. package/dist/delegation-http/anchor-registration-validate.js.map +0 -1
  193. package/dist/delegation-http/anchor-registration.d.ts +0 -62
  194. package/dist/delegation-http/anchor-registration.d.ts.map +0 -1
  195. package/dist/delegation-http/anchor-registration.js +0 -337
  196. package/dist/delegation-http/anchor-registration.js.map +0 -1
  197. package/dist/delegation-http/anchor-routing.d.ts +0 -20
  198. package/dist/delegation-http/anchor-routing.d.ts.map +0 -1
  199. package/dist/delegation-http/anchor-routing.js +0 -27
  200. package/dist/delegation-http/anchor-routing.js.map +0 -1
  201. package/dist/delegation-http/challenge-middleware.d.ts +0 -28
  202. package/dist/delegation-http/challenge-middleware.d.ts.map +0 -1
  203. package/dist/delegation-http/challenge-middleware.js +0 -190
  204. package/dist/delegation-http/challenge-middleware.js.map +0 -1
  205. package/dist/delegation-http/challenge.d.ts +0 -102
  206. package/dist/delegation-http/challenge.d.ts.map +0 -1
  207. package/dist/delegation-http/challenge.js +0 -223
  208. package/dist/delegation-http/challenge.js.map +0 -1
  209. package/dist/delegation-http/consent-anchor-bridge.d.ts +0 -70
  210. package/dist/delegation-http/consent-anchor-bridge.d.ts.map +0 -1
  211. package/dist/delegation-http/consent-anchor-bridge.js +0 -1130
  212. package/dist/delegation-http/consent-anchor-bridge.js.map +0 -1
  213. package/dist/delegation-http/consent-preparation-page.d.ts +0 -18
  214. package/dist/delegation-http/consent-preparation-page.d.ts.map +0 -1
  215. package/dist/delegation-http/consent-preparation-page.js +0 -172
  216. package/dist/delegation-http/consent-preparation-page.js.map +0 -1
  217. package/dist/delegation-http/credential-consent.d.ts +0 -149
  218. package/dist/delegation-http/credential-consent.d.ts.map +0 -1
  219. package/dist/delegation-http/credential-consent.js +0 -338
  220. package/dist/delegation-http/credential-consent.js.map +0 -1
  221. package/dist/delegation-http/native-capabilities.d.ts +0 -4
  222. package/dist/delegation-http/native-capabilities.d.ts.map +0 -1
  223. package/dist/delegation-http/native-capabilities.js +0 -53
  224. package/dist/delegation-http/native-capabilities.js.map +0 -1
  225. package/dist/delegation-http/native-oauth-state.d.ts +0 -28
  226. package/dist/delegation-http/native-oauth-state.d.ts.map +0 -1
  227. package/dist/delegation-http/native-oauth-state.js +0 -146
  228. package/dist/delegation-http/native-oauth-state.js.map +0 -1
  229. package/dist/delegation-http/native-oauth.d.ts +0 -26
  230. package/dist/delegation-http/native-oauth.d.ts.map +0 -1
  231. package/dist/delegation-http/native-oauth.js +0 -401
  232. package/dist/delegation-http/native-oauth.js.map +0 -1
  233. package/dist/delegation-http/native-pickup.d.ts +0 -20
  234. package/dist/delegation-http/native-pickup.d.ts.map +0 -1
  235. package/dist/delegation-http/native-pickup.js +0 -227
  236. package/dist/delegation-http/native-pickup.js.map +0 -1
  237. package/dist/delegation-http/pickup-routes.d.ts +0 -43
  238. package/dist/delegation-http/pickup-routes.d.ts.map +0 -1
  239. package/dist/delegation-http/pickup-routes.js +0 -166
  240. package/dist/delegation-http/pickup-routes.js.map +0 -1
  241. package/dist/delegation-http/register.d.ts +0 -26
  242. package/dist/delegation-http/register.d.ts.map +0 -1
  243. package/dist/delegation-http/register.js +0 -95
  244. package/dist/delegation-http/register.js.map +0 -1
  245. package/dist/delegation-http/registrar-auth.d.ts +0 -24
  246. package/dist/delegation-http/registrar-auth.d.ts.map +0 -1
  247. package/dist/delegation-http/registrar-auth.js +0 -61
  248. package/dist/delegation-http/registrar-auth.js.map +0 -1
  249. package/dist/delegation-http/remote-issuer.d.ts +0 -52
  250. package/dist/delegation-http/remote-issuer.d.ts.map +0 -1
  251. package/dist/delegation-http/remote-issuer.js +0 -324
  252. package/dist/delegation-http/remote-issuer.js.map +0 -1
  253. package/dist/delegation-http/types.d.ts +0 -116
  254. package/dist/delegation-http/types.d.ts.map +0 -1
  255. package/dist/delegation-http/types.js +0 -11
  256. package/dist/delegation-http/types.js.map +0 -1
package/README.md CHANGED
@@ -121,7 +121,7 @@ export function getRuntimeConfig(env: CloudflareEnv) {
121
121
 
122
122
  The package provides several services that handle framework functionality:
123
123
 
124
- - **DelegationService**: Token retrieval, verification, and cache management
124
+ - **DelegationService**: Local verification of the presented delegation (the authority), plus the optional Checkpoint decision hook
125
125
  - **ProofService**: Proof submission to Checkpoint
126
126
  - **AdminService**: Admin endpoints for cache management (optional)
127
127
  - **ConsentService**: Consent page rendering (Phase 0 placeholder)
@@ -255,6 +255,8 @@ Health check endpoint.
255
255
 
256
256
  Consent page endpoints for user authorization flows.
257
257
 
258
+ For pure-delegation tools the consent page is at the org: `GET /consent?sid=…` redirects there and the no-sign-in approval answers `410`. The endpoints below apply to tools that sign in through the worker.
259
+
258
260
  **Endpoints:**
259
261
 
260
262
  - `GET /consent` - Render consent page with tool and scope information
@@ -316,45 +318,197 @@ OAuth callback handler for delegation flow.
316
318
 
317
319
  ### Delegation Credential Trust
318
320
 
319
- `DelegationService` (stored delegations and the `Authorization: Bearer` retry)
320
- accepts a delegation VC-JWT only if all of these hold, with or without
321
- `CHECKPOINT_API_KEY`:
322
-
323
- - **Pinned issuer.** `iss` is one of: the worker's own identity
324
- (`MCP_IDENTITY_AGENT_DID`), the org DID in the native issuer binding
325
- (`MCPI_NATIVE_HTTP_ISSUER_CONFIG`), a DID listed in
326
- `KYA_OS_TRUSTED_DELEGATION_ISSUERS`, or the Checkpoint platform signer. The
327
- platform signer is the did:key that the configured Checkpoint origin's
328
- `/.well-known/did.json` (`CHECKPOINT_API_URL`, default `https://kya.vouched.id`)
329
- lists in `alsoKnownAs` under its own assertion key. did:web issuers are
330
- resolved with `@kya-os/mcp`'s did:web resolver, and the key is picked by the
331
- JWT `kid` from the document's `assertionMethod`. An issuer is pinned before
332
- its document is fetched. An untrusted or unresolvable issuer is refused.
333
- - **Audience.** `aud` is exactly `did:web:<the request's Host>`, and that DID
334
- is one of this worker's resources, listed in `KYA_OS_RESOURCE_DIDS` (a JSON
335
- array, one `did:web:<host>` per host the worker is routed under, provisioned
336
- by Checkpoint). A token for one host is refused at another, and a
337
- multi-valued `aud` is refused. The host is the request URL the edge
338
- delivered (Workers for Platforms dispatch forwards the original request), never
339
- `X-Forwarded-Host`. Nothing else is accepted: not the org DID, the worker's
340
- own DID or a project id, whoever the issuer and with or without an API key.
341
- With `KYA_OS_RESOURCE_DIDS` unset, empty or malformed, every delegation is
321
+ The client presents its delegation VC-JWT on every call (`Authorization: Bearer`
322
+ or the `KYA-Delegation` header). The worker never looks a grant up by session
323
+ id, user DID or agent DID.
324
+
325
+ `DelegationService` verifies the credential locally, and that verification is
326
+ the authority. It accepts a credential only if all of these hold:
327
+
328
+ - **Trusted issuer.** `iss` is the org DID in the native issuer binding
329
+ (`MCPI_NATIVE_HTTP_ISSUER_CONFIG`) or, on a worker without a binding, a DID
330
+ listed in `KYA_OS_TRUSTED_DELEGATION_ISSUERS`. Trust comes from the
331
+ deployment's environment only: nothing in the runtime configuration adds an
332
+ issuer, so the edge and the Durable Object trust the same ones. The worker's
333
+ own DID is never an issuer, and no issuer is discovered from Checkpoint: list
334
+ any other issuer there. An issuer is pinned before its DID document is
335
+ fetched.
336
+ - **Key named by `kid`.** The protected header's `kid` names one verification
337
+ method of the issuer (`<issuer DID>#key-N`), and the issuer's DID document
338
+ (did:web via `@kya-os/mcp`'s resolver) authorizes it in `assertionMethod`.
339
+ Org keys rotate, so no key is pinned and none is guessed: a missing or
340
+ unknown `kid` is refused.
341
+ - **Audience.** `aud` is exactly `did:web:<the host this request was routed
342
+ for>`, and that DID is one of this worker's resources, listed in
343
+ `KYA_OS_RESOURCE_DIDS` (a JSON array, one `did:web:<host>` per host the
344
+ worker is routed under: provisioned by Checkpoint for a managed worker, set
345
+ by the operator for a self-hosted one). So is
346
+ `delegation.constraints.audience` when present. A token for one host is
347
+ refused at another, and a multi-valued `aud` is refused. In the worker the
348
+ routed host is the request URL the edge delivered; in the Durable Object it
349
+ is `X-MCP-Original-Origin`, which the worker strips and resets on every
350
+ request it forwards. No other forwarding header is read. Never the org DID;
351
+ with `KYA_OS_RESOURCE_DIDS` unset, empty or malformed, an unlisted host or no
352
+ routed host, nothing is accepted.
353
+ - **Credential status.** The credential carries a `credentialStatus` entry
354
+ (StatusList2021 or Bitstring, revocation purpose). The list is fetched from
355
+ the entry's `statusListCredential` URL on every verification, and its
356
+ signature (a VC-JWT, served bare or as a `JwtProof2020` envelope) is verified
357
+ against the issuer's DID document before any bit is read. A revoked entry is
358
+ refused; an unreachable, unsigned or malformed list fails closed.
359
+ - **Holder binding.** A credential carrying `cnf`, or an `assurance` of
360
+ `key-bound`, `registered` or `delegated`, is used only with proof that the
361
+ caller holds the bound key: the request proof that request admission
362
+ verified for the call. Its `credentialSubject.id` (and `sub`, when present)
363
+ must be the proved holder's DID, and `cnf.jkt` the RFC 7638 thumbprint of
364
+ that DID's key. Without a proved holder it is refused (`holder_proof_required`),
365
+ and for another holder too (`holder_mismatch`). An unsigned tool call carrying one is
366
+ answered as a tool result.
367
+ A deployment with the native issuer binding (`MCPI_NATIVE_HTTP_ISSUER_CONFIG`)
368
+ and no `requestAdmission` of its own gets one by default: every tool is
369
+ `public`, so a signed call's proof is always verified and an unsigned call
370
+ keeps today's path; holders are did:key; each proof's nonce is consumed once
371
+ per deployment through a named `MCP_OBJECT` instance. Any other deployment
372
+ without `requestAdmission` accepts no holder-bound credential.
373
+
374
+ With `CHECKPOINT_API_KEY` set, Checkpoint's verify endpoint is then consulted as
375
+ a decision hook. It can refuse a locally valid credential only for a stateful
376
+ reason (revocation fresher than the list, call caps, quota, calling-context
377
+ policy), and when it cannot answer the call is refused. It never makes a
378
+ credential valid that local verification refused.
379
+
380
+ | Variable | Format | Purpose |
381
+ | ----------------------------------- | ---------------------------- | -------------------------------------------------------- |
382
+ | `KYA_OS_RESOURCE_DIDS` | JSON array of `did:web` DIDs | The worker's resources, one per routed host (required) |
383
+ | `KYA_OS_TRUSTED_DELEGATION_ISSUERS` | comma/space-separated DIDs | Org issuers for a worker without a native issuer binding |
384
+
385
+ ### Authorization
386
+
387
+ The worker grants nothing itself. The org authorization service decides, and
388
+ the worker enforces. Connecting and calling tools are separate layers.
389
+
390
+ #### Connecting
391
+
392
+ Connecting is the deployment's ordinary MCP Authorization setting. The edge
393
+ serves protected-resource metadata (RFC 9728) at
394
+ `/.well-known/oauth-protected-resource`, never gated. It names the resource,
395
+ `https://<routed host>`, and the org authorization server from the
396
+ deployment's issuer binding, `<authorization origin>/oauth/<org slug>`. A
397
+ deployment without a binding answers `404` there. Clients discover the
398
+ authorization server from it and sign in the usual way.
399
+
400
+ By default the edge does not require a token to connect. A deployment can
401
+ require one with `requireTokenToConnect: true` in the runtime config, or
402
+ `MCPI_REQUIRE_TOKEN_TO_CONNECT=true` (or `1`) in the environment; either turns
403
+ it on. Then every request to `/sse`, `/sse/*`, `/mcp` and
404
+ `/mcp/*` needs a valid Bearer credential for this resource (`Authorization:
405
+ Bearer` or `KYA-Delegation`, read from the headers). Without one the edge
406
+ answers `401` with the `resource_metadata` challenge; an expired or invalid
407
+ one is `401 invalid_token`. It applies to every caller, KYA-OS native ones
408
+ included. `/.well-known/*`, `/consent*`, `/oauth/callback`, `/health` and
409
+ `OPTIONS` preflights are not gated. What the edge cannot decide (revocation,
410
+ status list, holder binding) passes through to the Durable Object, which
411
+ decides per tool, so per-tool decisions are unchanged. If the credential
412
+ cannot be verified, the edge fails closed with `503` and `Retry-After: 3`.
413
+
414
+ #### Lazy auth
415
+
416
+ Lazy auth is the one case where a tool call gets an HTTP status. It applies to
417
+ an unsigned `tools/call` (no KYA-OS request proof) of a protected tool on
418
+ `/mcp` and on the SSE message endpoint. The edge decides it from the parsed
419
+ request, before the agent runs:
420
+
421
+ | Credential | Response |
422
+ | -------------------------------------------------------------------------- | ---------------------------------------------------------------------- |
423
+ | None, or malformed | `401` with `WWW-Authenticate: Bearer scope="…", resource_metadata="…"` |
424
+ | Expired, or invalid in itself (signature, issuer, audience, not yet valid) | `401` with `error="invalid_token"` |
425
+ | Valid but missing a required scope | `403` with `error="insufficient_scope"` and the union of the scopes |
426
+
427
+ Revocation, status-list unavailability, holder binding and the delegation
428
+ chain are checked in the Durable Object and come back as tool results. A
429
+ caller that carries a KYA-OS request proof never gets an HTTP status.
430
+
431
+ #### Tool results
432
+
433
+ Every other authority decision is a signed tool result. The worker's identity
434
+ key signs it, and the signature is verifiable.
435
+
436
+ - **`needs_authorization`**: `structuredContent` holds the
437
+ `NeedsAuthorizationError` (its `expiresAt` in seconds since the epoch), an
438
+ optional `reasonCode`, and `context`, which mirrors the hint exactly. A
439
+ caller with a proved KYA-OS holder on a native-rail deployment also gets
440
+ `kyaos`, the challenge the org registered for it. `_meta` carries
441
+ `mcp/www_authenticate`, the hint some clients act on, and the proof. The
442
+ proof binds the result without its `_meta` and says so with the envelope
443
+ profile claim, so `@kya-os/mcp`'s verifier checks it.
444
+ - **`denied`**: stateful policy, an amount limit or a request-admission
445
+ refusal. It carries a reason and no response hash.
446
+
447
+ The hint in a tool result always names `insufficient_scope`, the code hosts
448
+ act on there; the precise cause is `reasonCode`. When the verifier found a
449
+ presented grant genuine but too narrow, its `scope` names the scopes the grant
450
+ holds together with the required ones, so a new grant keeps them.
451
+
452
+ `tools/list` advertises `securitySchemes` per tool: `oauth2` with its scopes,
453
+ or `noauth`. When the served protection cannot be read, the listing uses the
454
+ last one it served (kept in `TOOL_PROTECTION_KV` when bound), because hosts
455
+ snapshot tool metadata when a connector is created.
456
+
457
+ Tool protection needs `CHECKPOINT_API_KEY` and the `TOOL_PROTECTION_KV`
458
+ binding. When the runtime config declares tool protection and either is
459
+ missing, the protection can't be enforced, so the worker fails closed and
460
+ logs one warning:
461
+
462
+ - Without the key, a tool the local configuration (`inline` or
463
+ `localConfig`) leaves public still runs, and every tool it protects is
342
464
  refused.
343
- - **Credential status.** A `credentialStatus` entry (Bitstring or StatusList2021,
344
- revocation purpose) is read from its status list on every verification. A
345
- revoked, unreachable or malformed entry is refused.
346
-
347
- With `CHECKPOINT_API_KEY` set, every accepted credential is still confirmed with
348
- Checkpoint and nothing is cached. Without it, legacy (non VC-JWT) tokens are
349
- refused unless `KYA_OS_INSECURE_DEV_TOKENS=1` is set. That flag is for local
350
- development only, logs a warning on every use, and is never cached. Only a
351
- pinned issuer's status-less verdict is cached, for 60 seconds.
352
-
353
- | Variable | Format | Purpose |
354
- | ----------------------------------- | ---------------------------- | --------------------------------------------------------------------------------- |
355
- | `KYA_OS_TRUSTED_DELEGATION_ISSUERS` | comma/space-separated DIDs | Extra pinned issuers (e.g. an org `did:web` on a worker without a native binding) |
356
- | `KYA_OS_RESOURCE_DIDS` | JSON array of `did:web` DIDs | The worker's resources, one per routed host (required) |
357
- | `KYA_OS_INSECURE_DEV_TOKENS` | `1` / `true` | Accept unchecked legacy tokens without an API key (development only) |
465
+ - With the key but no binding, the project's protections can't be read, so
466
+ every tool is refused.
467
+
468
+ Two more cases are refused the same way, on any deployment:
469
+
470
+ - A protected tool whose protection names no required scope: there is nothing
471
+ to check a delegation against (`missing: ["requiredScopes"]`). Give it a
472
+ scope. The edge doesn't challenge such a call, since no credential could
473
+ satisfy it. Public tools are unaffected.
474
+ - Any tool while protection is unavailable: the API can't be reached, nothing
475
+ is cached and there is no `offlineFallbackConfig`
476
+ (`missing: ["toolProtectionConfig"]`). The cache, including a stale entry
477
+ the service may still use, comes first. The refusal lasts until a config
478
+ can be read: it isn't cached, so the next call asks the API again.
479
+
480
+ A refused call gets an `isError` result whose JSON names
481
+ `tool_protection_unenforceable` and what is missing. A deployment without tool
482
+ protection config is unaffected.
483
+
484
+ `authorizationUrl` in the result is:
485
+
486
+ - the worker's sign-in link, for tools that sign in through the worker
487
+ (credentials, password, oauth2), for every caller, and for any tool whose
488
+ served protection cannot be read (the worker's page still sends a pure
489
+ delegation on to the org);
490
+ - otherwise, the org `consent_uri`, for a native caller;
491
+ - otherwise, on the native rail, the org's public connect page for the
492
+ project (`<authorization origin>/connect/<project id>`);
493
+ - the legacy consent URL, off the native rail.
494
+
495
+ On the native rail the worker registers the challenge with the org
496
+ (`POST <controlPlaneOrigin>/api/v1/bouncer/sessions`, with the deployment's
497
+ `CHECKPOINT_API_KEY`) and reports the revision of the tool protection
498
+ Checkpoint served. Consent and pickup are at the org. When registration fails,
499
+ the result is `needs_authorization` with `context.reason` set to
500
+ `authorization_host_unavailable`. It is retryable.
501
+
502
+ The worker does not host consent for pure-delegation tools. A
503
+ `/consent?sid=…` link redirects (`302`) to the org, and the no-sign-in
504
+ approval answers `410`.
505
+
506
+ Every outcome is recorded through the deployment's audit trail
507
+ (`KYA_OS_AUDIT_CONFIG`, the durable producer, then the recorder, which keeps
508
+ the Merkle tree and signed checkpoints).
509
+
510
+ See [Native challenges](../../docs/delegation/native-http-challenges.md) for
511
+ the native rail.
358
512
 
359
513
  ### CSRF Protection for OAuth Flows
360
514
 
@@ -378,6 +532,8 @@ CSRF protection is automatically enabled when `DELEGATION_STORAGE` KV namespace
378
532
 
379
533
  **`OAUTH_ENCRYPTION_SECRET` is REQUIRED.** It was previously optional (token encryption only), but the consent auth-gate fix made every check that depends on it **fail closed**: CSRF validation, CSRF token minting, and identity-assertion mint/verify all refuse rather than degrade when it is unset. A worker without it will **403 every delegation mint and 500 the credential render** — the consent flow does not work at all.
380
534
 
535
+ Stored sign-ins fail closed too. The worker keeps an IdP's tokens and a credential provider's session only encrypted, so without the secret it refuses the sign-in itself: the credential approval and the OAuth callback answer **503 `token_encryption_unavailable`** before any credential reaches the provider or any code is exchanged, and nothing is stored or read in plaintext.
536
+
381
537
  Set it as a **secret**, not a committed var:
382
538
 
383
539
  ```bash
@@ -486,6 +642,84 @@ All security logs redact sensitive information:
486
642
  - OAuth subjects are hashed or truncated
487
643
  - PII is redacted before logging
488
644
 
645
+ ## Standalone (self-hosted) deployment
646
+
647
+ A standalone deployment runs this package's worker on the operator's own
648
+ Cloudflare account and deploy pipeline. At runtime it behaves exactly as a
649
+ managed worker does:
650
+
651
+ - its organization's authorization service issues every delegation;
652
+ - the worker verifies the delegation locally and enforces it;
653
+ - consent and pickup happen at the organization;
654
+ - the worker hosts no consent and mints nothing.
655
+
656
+ The operator keeps the account, the routes, the custom domains and when to
657
+ deploy. Checkpoint keeps the deployment record, its key and the registration of
658
+ the worker's hosts as resources.
659
+
660
+ ### What Checkpoint provides
661
+
662
+ Checkpoint issues these values once, to the project owner, when the deployment
663
+ is registered and again whenever its key is rotated:
664
+
665
+ - the issuer binding, which names the organization's authorization host;
666
+ - the resource DIDs for the worker's registered hosts;
667
+ - the deployment key.
668
+
669
+ The operator sets them as the worker's secrets. Checkpoint never needs the
670
+ operator's Cloudflare credentials.
671
+
672
+ ### The operator's contract
673
+
674
+ 1. **Run a published version of this worker template, pinned.** Redeploy
675
+ promptly after a security release. Checkpoint reads the running version
676
+ from `/.well-known/kya-os-identity`.
677
+ 2. **Set exactly these:**
678
+
679
+ | Variable | Value |
680
+ | --------------------------------------------- | ---------------------------------------------------------- |
681
+ | `MCPI_NATIVE_HTTP_ISSUER_CONFIG` | The issuer binding, as issued |
682
+ | `KYA_OS_RESOURCE_DIDS` | The resource DIDs, as issued |
683
+ | `CHECKPOINT_API_KEY` | The deployment key, as issued |
684
+ | `CHECKPOINT_API_URL`, `CHECKPOINT_PROJECT_ID` | The control plane and the project |
685
+ | `MCP_IDENTITY_AGENT_DID` and its keys | The worker's own identity, which is never an issuer |
686
+ | `KYA_OS_AUDIT_CONFIG` (optional) | The audit trail |
687
+ | `MCPI_REQUIRE_TOKEN_TO_CONNECT` (optional) | Require a token to connect (see [Connecting](#connecting)) |
688
+
689
+ 3. **Don't set the retired variables:** `MCPI_NATIVE_HTTP_ISSUER_API_KEY`,
690
+ `MCPI_NATIVE_HTTP_INGRESS`, `MCPI_HTTP_CHALLENGE`,
691
+ `MCPI_ANCHOR_REGISTRATION`, `MCPI_REALM`. This version ignores them.
692
+ 4. **Keep the template's bindings:** `MCP_OBJECT`, `NONCE_CACHE`,
693
+ `TOOL_PROTECTION_KV`, and the `NativeOAuthState` export with its binding and
694
+ migration.
695
+ 5. **Serve the worker only on its registered hosts.**
696
+ - Register a new host with Checkpoint before routing traffic to it.
697
+ - Don't put a proxy or CDN in front that rewrites the request URL's host:
698
+ the audience a delegation must name is the host the worker sees.
699
+ 6. **Leave these paths reachable without authentication:**
700
+ `/.well-known/oauth-protected-resource`, `/.well-known/kya-os-identity` and
701
+ `/health`. Clients and Checkpoint discover the deployment through them.
702
+ 7. **Treat the deployment key as a secret.** Rotate it when asked and report a
703
+ compromise. The key can register challenges only for the worker's own
704
+ registered hosts.
705
+ 8. **Leave consent to the organization.** For delegation-protected tools,
706
+ consent belongs to the organization's authorization service, and the worker
707
+ serves none.
708
+
709
+ ### Pending decisions
710
+
711
+ These parts of the standalone model are still open and may change:
712
+
713
+ - **Delivery of the values.** The current proposal is that Checkpoint issues
714
+ them once to the project owner, as described above.
715
+ - **Starting host.** Which host a standalone worker starts on (its
716
+ `workers.dev` host or a branded one), and how ownership of each host is
717
+ proven.
718
+ - **Sign-in tools.** Whether tools that sign in through the worker
719
+ (credentials, password, oauth2) stay available on standalone deployments.
720
+ - **Existing grants.** Whether grants issued before a deployment moves to this
721
+ model carry over. The default is that people consent again.
722
+
489
723
  ## Migration from v1.x
490
724
 
491
725
  If you're upgrading from v1.x, see the migration guide below.
@@ -508,18 +742,3 @@ If you're upgrading from v1.x, see the migration guide below.
508
742
  ## License
509
743
 
510
744
  MIT
511
-
512
- ### Native HTTP behind Workers for Platforms
513
-
514
- Isolated Cloudflare dispatch workers do not expose `request.cf`. For managed
515
- workers reached exclusively through your Cloudflare dispatch ingress, provision
516
- `MCPI_NATIVE_HTTP_INGRESS=cloudflare-dispatch` alongside the native issuer role.
517
- This explicitly trusts Cloudflare's `CF-Connecting-IP` header for replay admission
518
- accounting. The ingress must preserve the edge-provided header and must not
519
- replace it with client-supplied forwarding headers. Do not enable this setting
520
- behind an arbitrary proxy or on an origin reachable without the trusted ingress.
521
-
522
- Without this binding, the existing `request.cf` check remains required. Unknown
523
- modes disable the managed native capability; missing or invalid source IPs fail
524
- closed. `X-Forwarded-For` and `X-Real-IP` are never fallback sources. Holder proof
525
- verification and the shared atomic nonce claim remain mandatory in either mode.
package/dist/adapter.d.ts CHANGED
@@ -119,19 +119,6 @@ declare class CloudflareMCPServer {
119
119
  * are guaranteed to route identically.
120
120
  */
121
121
  private calculateDOInstanceId;
122
- /**
123
- * Fetch delegation from Durable Object (strongly consistent storage)
124
- *
125
- * This provides parity with the Agent pattern by using the same DO-based
126
- * storage for delegations. The consent service stores to DO first, and
127
- * now the adapter can read from DO first as well.
128
- *
129
- * @param sessionId - Session ID to lookup
130
- * @param userDid - Optional user DID for user+agent scoped lookup
131
- * @param agentDid - Agent DID for the lookup
132
- * @returns Delegation token if found, undefined otherwise
133
- */
134
- private getDelegationFromDO;
135
122
  /**
136
123
  * Retrieve stored client capabilities from DO storage.
137
124
  * The agent stores these during the MCP initialize handshake.
@@ -143,10 +130,9 @@ declare class CloudflareMCPServer {
143
130
  * Priority: 1. `Mcp-Session-Id` header (MCP protocol standard),
144
131
  * 2. `session_id` / `sessionId` param (legacy clients).
145
132
  *
146
- * This id is the one the consent flow keys delegations on (consentUrl
147
- * `session_id` → OAuth callback → STORAGE_KEYS.session), so it must be the
148
- * id used for every delegation lookup and for the session handed to the
149
- * runtime. Returns `{ id: undefined }` when the request names no session.
133
+ * The session handed to the runtime carries this id, so proofs and the
134
+ * consent URL are attributed to it. It never selects a delegation. Returns
135
+ * `{ id: undefined }` when the request names no session.
150
136
  */
151
137
  private resolveTransportSessionId;
152
138
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"adapter.d.ts","sourceRoot":"","sources":["../src/adapter.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAGH,OAAO,KAAK,EAAE,oBAAoB,EAAiB,MAAM,SAAS,CAAC;AACnE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAC7D,OAAO,EAML,KAAK,oBAAoB,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