@kya-os/mcp-i-cloudflare 1.12.1 → 1.12.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.
@@ -1 +1 @@
1
- {"version":3,"file":"consent-anchor-bridge.d.ts","sourceRoot":"","sources":["../../src/delegation-http/consent-anchor-bridge.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAWH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAC5D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAC9C,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,WAAW,CAAC;AA6arD;;GAEG;AACH,wBAAsB,sBAAsB,CAC1C,CAAC,EAAE,WAAW,EACd,GAAG,EAAE,MAAM,EACX,GAAG,EAAE,aAAa,EAClB,IAAI,EAAE,QAAQ,CAAC,mBAAmB,CAAC,GAClC,OAAO,CAAC,QAAQ,CAAC,CAiBnB;AAED;;;GAGG;AACH,wBAAsB,0BAA0B,CAC9C,CAAC,EAAE,WAAW,EACd,GAAG,EAAE,MAAM,EACX,GAAG,EAAE,aAAa,EAClB,GAAG,EAAE,QAAQ,CAAC,mBAAmB,CAAC,GACjC,OAAO,CAAC,QAAQ,CAAC,CAyEnB"}
1
+ {"version":3,"file":"consent-anchor-bridge.d.ts","sourceRoot":"","sources":["../../src/delegation-http/consent-anchor-bridge.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAWH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAC5D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAC9C,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,WAAW,CAAC;AA+frD;;GAEG;AACH,wBAAsB,sBAAsB,CAC1C,CAAC,EAAE,WAAW,EACd,GAAG,EAAE,MAAM,EACX,GAAG,EAAE,aAAa,EAClB,IAAI,EAAE,QAAQ,CAAC,mBAAmB,CAAC,GAClC,OAAO,CAAC,QAAQ,CAAC,CAqCnB;AAED;;;GAGG;AACH,wBAAsB,0BAA0B,CAC9C,CAAC,EAAE,WAAW,EACd,GAAG,EAAE,MAAM,EACX,GAAG,EAAE,aAAa,EAClB,GAAG,EAAE,QAAQ,CAAC,mBAAmB,CAAC,GACjC,OAAO,CAAC,QAAQ,CAAC,CAqLnB"}
@@ -24,8 +24,10 @@ import { wrapDelegationAsVC, createUnsignedVCJWT, completeVCJWT, base64urlEncode
24
24
  import { WebCryptoProvider } from "../providers/crypto";
25
25
  import { getConfiguredIdentity } from "../providers/storage";
26
26
  import { escapeHtml } from "../services/consent-templates/base/escape";
27
+ import { createCredentialAuthHandler } from "../services/credential-auth.handler";
27
28
  import { getAnchorStub } from "./anchor-routing";
28
29
  import { INTERNAL_PICKUP_INFO, INTERNAL_PICKUP_APPROVE } from "./constants";
30
+ import { resolveAnchorCredentialProvider, resolveCredentialIdentity, notifyDelegation, } from "./credential-consent";
29
31
  /** Internal origin for durable-object stub fetches — the DO routes by pathname only. */
30
32
  const DO_INTERNAL_ORIGIN = "https://do.internal";
31
33
  /**
@@ -114,6 +116,57 @@ function approveFormPage(sid, info, csrfToken) {
114
116
  </form>
115
117
  </main>`);
116
118
  }
119
+ /**
120
+ * The form input names a credential provider expects, derived from the
121
+ * `{{placeholder}}` tokens in its `requestBodyTemplate` values. E.g.
122
+ * `{ email: "{{email}}", password: "{{password}}" }` → `["email", "password"]`.
123
+ * The credential auth handler reads the POSTed credentials by these same
124
+ * placeholder names (`resolveCredentialField`), so the form and the handler stay
125
+ * in lock-step off one source of truth.
126
+ */
127
+ function credentialFieldNames(provider) {
128
+ const names = [];
129
+ for (const template of Object.values(provider.config.requestBodyTemplate)) {
130
+ const match = /\{\{(\w+)\}\}/.exec(template);
131
+ if (match && !names.includes(match[1]))
132
+ names.push(match[1]);
133
+ }
134
+ // Deterministic fallback so a misconfigured template still renders a usable form.
135
+ return names.length > 0 ? names : ["email", "password"];
136
+ }
137
+ /**
138
+ * Render the credential sign-in form for `GET /consent?sid=…` when the anchored
139
+ * scopes are protected by a credential provider. Same CSRF-protected POST target
140
+ * as {@link approveFormPage}; the extra inputs are the provider's own fields, so
141
+ * the shopper signs in on the deployment's OWN branded page before authorizing.
142
+ */
143
+ function credentialFormPage(sid, info, provider, csrfToken) {
144
+ const scopeItems = info.requiredScopes.length > 0
145
+ ? info.requiredScopes
146
+ .map((s) => `<li class="kya-scope-item">${escapeHtml(s)}</li>`)
147
+ .join("")
148
+ : `<li class="kya-scope-item">No specific permissions required.</li>`;
149
+ const fieldInputs = credentialFieldNames(provider)
150
+ .map((name) => {
151
+ const isSecret = /pass|secret|token|pin/i.test(name);
152
+ const label = name.charAt(0).toUpperCase() + name.slice(1);
153
+ return `<label class="kya-field-label" for="kya-field-${escapeHtml(name)}">${escapeHtml(label)}</label>
154
+ <input class="kya-field-input" id="kya-field-${escapeHtml(name)}" name="${escapeHtml(name)}" type="${isSecret ? "password" : "text"}" autocomplete="${isSecret ? "current-password" : "username"}" required>`;
155
+ })
156
+ .join("");
157
+ return page("Permission Request", `<main class="kya-consent">
158
+ <h1>Sign in to authorize</h1>
159
+ <p class="kya-provider-name">${escapeHtml(provider.displayName)}</p>
160
+ <p class="kya-permissions-header">This request needs the following permissions:</p>
161
+ <ul class="kya-permissions-list">${scopeItems}</ul>
162
+ <form method="POST" action="/consent/approve?sid=${encodeURIComponent(sid)}">
163
+ <input type="hidden" name="sid" value="${escapeHtml(sid)}">
164
+ <input type="hidden" name="csrf_token" value="${escapeHtml(csrfToken)}">
165
+ ${fieldInputs}
166
+ <button type="submit" class="kya-consent-allow">Sign in &amp; allow</button>
167
+ </form>
168
+ </main>`);
169
+ }
117
170
  // ── CSRF (mirrors consent.service's HMAC token format, bound to the anchor sid) ──
118
171
  /** Base64url-encode bytes without padding. */
119
172
  function base64UrlEncodeBytes(bytes) {
@@ -316,7 +369,13 @@ async function mintDelegationVcJwt(env, sid, info, expiresInS) {
316
369
  const signingInput = withCrossResourceClaims(unsigned, info, sid);
317
370
  const signatureBytes = await cryptoProvider.sign(new TextEncoder().encode(signingInput), signingPrivateKey);
318
371
  const signature = base64urlEncodeFromBytes(signatureBytes);
319
- return completeVCJWT(signingInput, signature);
372
+ // Return the resolved subject alongside the JWT so the notify report sends the
373
+ // SAME DID the VC carries (never an empty `agent_did`, which mismatches the VC
374
+ // and fails checkpoint's notify schema).
375
+ return {
376
+ vcJwt: completeVCJWT(signingInput, signature),
377
+ subjectDid: agentDid,
378
+ };
320
379
  }
321
380
  // ── Public handlers ──────────────────────────────────────────────────────────
322
381
  /**
@@ -335,6 +394,19 @@ export async function handleAnchorConsentGet(c, sid, env, _cfg) {
335
394
  }
336
395
  const info = (await infoResponse.json());
337
396
  const csrfToken = await mintCsrfToken(env, sid);
397
+ // When the project protects these scopes with a credential provider (merchant
398
+ // sign-in), render the branded sign-in form instead of the bare "Allow" form —
399
+ // so the shopper authenticates before authorizing and the minted delegation is
400
+ // bound to their identity. Falls back to consent-only when there is no such
401
+ // provider (resolution failed, or no checkpoint link), preserving today's
402
+ // behavior exactly.
403
+ const resolution = await resolveAnchorCredentialProvider(env, info.requiredScopes);
404
+ if (resolution.status === "credential") {
405
+ return htmlResponse(credentialFormPage(sid, info, resolution.provider, csrfToken), 200);
406
+ }
407
+ // "none" and "unavailable" both render the consent-only form. On "unavailable"
408
+ // the approve POST re-resolves and FAILS CLOSED, so a form shown during a
409
+ // transient error can never lead to an anonymous mint for a credential project.
338
410
  return htmlResponse(approveFormPage(sid, info, csrfToken), 200);
339
411
  }
340
412
  /**
@@ -342,10 +414,14 @@ export async function handleAnchorConsentGet(c, sid, env, _cfg) {
342
414
  * parks it on the anchor; an expired/unknown anchor makes the approval FAIL.
343
415
  */
344
416
  export async function handleAnchorConsentApprove(c, sid, env, cfg) {
417
+ // Read the POST body EXACTLY ONCE. The CSRF token and the credential fields
418
+ // both live in it; reading it twice (a second clone after CSRF) is unreliable
419
+ // across runtimes — the second read can throw and silently yield empty
420
+ // credentials, failing every sign-in. Extract everything from this one parse.
421
+ const bodyFields = await readBodyFields(c);
345
422
  // CSRF, unless test mode relaxes it for miniflare POSTs.
346
423
  if (!isTestConsentMode(env)) {
347
- const csrfToken = await readCsrfTokenFromBody(c);
348
- const valid = await validateCsrfToken(env, sid, csrfToken);
424
+ const valid = await validateCsrfToken(env, sid, bodyFields.csrf_token);
349
425
  if (!valid) {
350
426
  return htmlResponse(page("Authorization failed", `<main class="kya-consent-failed"><h1>Authorization failed</h1><p>Invalid or missing security token. Please reload and try again.</p></main>`), 403);
351
427
  }
@@ -363,9 +439,55 @@ export async function handleAnchorConsentApprove(c, sid, env, cfg) {
363
439
  return approvalFailedPage("This authorization request could not be loaded. Please start over.", 502);
364
440
  }
365
441
  const info = (await infoResponse.json());
442
+ // Credential path: when a credential provider protects these scopes, the
443
+ // shopper must sign in before we mint. Authenticate against the provider's own
444
+ // endpoint, then resolve the checkpoint user DID — both BEFORE minting, so a
445
+ // bad password parks nothing. `null` provider → consent-only (unchanged).
446
+ const resolution = await resolveAnchorCredentialProvider(env, info.requiredScopes);
447
+ // Fail CLOSED when the sign-in requirement could not be determined (a
448
+ // checkpoint /providers error or ambiguous config). Falling through to a
449
+ // consent-only mint here would skip merchant sign-in for a credential-
450
+ // protected project on a transient error — the exact bypass we must prevent.
451
+ if (resolution.status === "unavailable") {
452
+ return approvalFailedPage("We could not verify the sign-in requirement for this request. Please try again.", 503);
453
+ }
454
+ const provider = resolution.status === "credential" ? resolution.provider : null;
455
+ let authorizedUser = null;
456
+ if (provider) {
457
+ const credentials = {};
458
+ for (const name of credentialFieldNames(provider)) {
459
+ if (bodyFields[name] !== undefined)
460
+ credentials[name] = bodyFields[name];
461
+ }
462
+ const handler = createCredentialAuthHandler({
463
+ fetch: (...args) => globalThis.fetch(...args),
464
+ logger: (msg, data) => console.debug(`[kya-http] ${msg}`, data),
465
+ });
466
+ const authResult = await handler.authenticate(provider.config, credentials);
467
+ if (!authResult.success) {
468
+ return htmlResponse(page("Sign-in failed", `<main class="kya-consent-failed"><h1>Sign-in failed</h1><p>${escapeHtml(authResult.error ||
469
+ "Those credentials were not accepted. Please try again.")}</p></main>`), 401);
470
+ }
471
+ const identity = await resolveCredentialIdentity(env, {
472
+ projectId: env.AGENTSHIELD_PROJECT_ID || "",
473
+ provider: provider.providerId,
474
+ userId: authResult.userId || "unknown",
475
+ userEmail: authResult.userEmail,
476
+ userDisplayName: authResult.userDisplayName,
477
+ });
478
+ if (!identity.success || !identity.userDid) {
479
+ return approvalFailedPage("We signed you in but could not resolve your identity. Please start over.", 500);
480
+ }
481
+ authorizedUser = {
482
+ userDid: identity.userDid,
483
+ userId: authResult.userId,
484
+ userEmail: authResult.userEmail,
485
+ };
486
+ }
366
487
  let vcJwt;
488
+ let subjectDid;
367
489
  try {
368
- vcJwt = await mintDelegationVcJwt(env, sid, info, cfg.delegationExpiresInS);
490
+ ({ vcJwt, subjectDid } = await mintDelegationVcJwt(env, sid, info, cfg.delegationExpiresInS));
369
491
  }
370
492
  catch (error) {
371
493
  // A mint failure (keygen/sign) must surface as a styled no-store error page, not
@@ -389,30 +511,63 @@ export async function handleAnchorConsentApprove(c, sid, env, cfg) {
389
511
  if (!approveResponse.ok) {
390
512
  return approvalFailedPage("We could not complete the authorization. Please start over.", 502);
391
513
  }
514
+ // Report the minted delegation to checkpoint so it appears in the dashboard,
515
+ // attributed to the signed-in customer. Only the credential path has a
516
+ // `user_did` (the notify schema requires one), so a consent-only anchor
517
+ // reports nothing — there is no user to attribute it to.
518
+ if (authorizedUser && provider) {
519
+ // FIRE-AND-FORGET: dispatch the report but NEVER await it — the VC is already
520
+ // parked and the shopper's approval must not hang on a slow/hung checkpoint.
521
+ // `waitUntil` (when the runtime provides it) lets the report finish after the
522
+ // success page is returned; `notifyDelegation` swallows its own errors.
523
+ const report = notifyDelegation(env, {
524
+ sid,
525
+ agentDid: subjectDid,
526
+ userDid: authorizedUser.userDid,
527
+ userId: authorizedUser.userId,
528
+ userIdentifier: authorizedUser.userEmail,
529
+ scopes: info.requiredScopes,
530
+ provider: provider.providerId,
531
+ // Record the same expiry the VC was minted with, matching the OAuth path.
532
+ expiresAt: new Date(Date.now() + cfg.delegationExpiresInS * 1000).toISOString(),
533
+ });
534
+ const execCtx = c.executionCtx;
535
+ execCtx?.waitUntil?.(report);
536
+ }
392
537
  return successPage();
393
538
  }
394
539
  /**
395
- * Read the `csrf_token` form field from the POST body via the underlying native
396
- * Request (`c.req.raw`). The sid travels in the query, so consuming the body here
397
- * never interferes with route-order interception. Returns undefined on parse failure.
540
+ * Read every string field from the POST body ONCE via the underlying native
541
+ * Request (`c.req.raw`), for both the CSRF token and the credential fields. Reads
542
+ * `raw` directly (no clone) because it is consumed a single time — a second read
543
+ * of the same body is unreliable across runtimes. The sid travels in the query,
544
+ * so consuming the body here never interferes with route-order interception.
545
+ * Returns an empty object on parse failure.
398
546
  */
399
- async function readCsrfTokenFromBody(c) {
547
+ async function readBodyFields(c) {
548
+ const out = {};
400
549
  const raw = c.req?.raw;
401
550
  if (!raw)
402
- return undefined;
551
+ return out;
403
552
  try {
404
553
  const contentType = raw.headers.get("Content-Type") || "";
405
554
  if (contentType.includes("application/json")) {
406
- const body = (await raw.clone().json());
407
- const token = body?.csrf_token;
408
- return typeof token === "string" ? token : undefined;
555
+ const body = (await raw.json());
556
+ for (const [key, value] of Object.entries(body)) {
557
+ if (typeof value === "string")
558
+ out[key] = value;
559
+ }
560
+ return out;
409
561
  }
410
- const form = await raw.clone().formData();
411
- const token = form.get("csrf_token");
412
- return typeof token === "string" ? token : undefined;
562
+ const form = await raw.formData();
563
+ form.forEach((value, key) => {
564
+ if (typeof value === "string")
565
+ out[key] = value;
566
+ });
567
+ return out;
413
568
  }
414
569
  catch {
415
- return undefined;
570
+ return out;
416
571
  }
417
572
  }
418
573
  //# sourceMappingURL=consent-anchor-bridge.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"consent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,OAAO,CAAC,CAAC,KAAK,EAAE,GAAG,EAAE,EAAE;YAC1B,IAAI,OAAO,KAAK,KAAK,QAAQ;gBAAE,GAAG,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC;QAClD,CAAC,CAAC,CAAC;QACH,OAAO,GAAG,CAAC;IACb,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,GAAG,CAAC;IACb,CAAC;AACH,CAAC"}
@@ -0,0 +1,147 @@
1
+ /**
2
+ * Credential-backed consent for the §8.1 anchor path.
3
+ *
4
+ * The anchor consent bridge (`consent-anchor-bridge.ts`) was consent-only: it
5
+ * rendered an "Allow" form, minted an anonymous delegation, and reported
6
+ * nothing to checkpoint. When a project's tool protection requires a credential
7
+ * provider (merchant sign-in), the branded consent an agent is redirected to
8
+ * must instead authenticate the shopper and mint a delegation bound to their
9
+ * identity — the same outcome the NATIVE MCP consent (`consent.service.ts`)
10
+ * produces, reached here for the HTTP-challenge transport.
11
+ *
12
+ * This module holds the runtime-agnostic pieces that don't belong inline in the
13
+ * bridge:
14
+ * - {@link resolveCredentialIdentity} — customer → `user_did` via checkpoint's
15
+ * `/api/v1/bouncer/identity/resolve` (lifted verbatim from
16
+ * `consent.service.ts`, which needs nothing but `env`).
17
+ * - {@link notifyDelegation} — fire-and-forget report to checkpoint's
18
+ * `/api/v1/bouncer/delegations/notify` so the minted delegation appears in
19
+ * the dashboard, attributed to the signed-in customer. This call is the ONLY
20
+ * path that populates dashboard visibility, and its schema REQUIRES a
21
+ * `user_did` — which is exactly why the anchor path could never show up
22
+ * while it was consent-only.
23
+ * - {@link sidToDelegationUuid} — the anchor sid (`kya-…`) is not a UUID, but
24
+ * the notify schema demands `delegation_id` be one; this maps a sid to a
25
+ * stable UUID so repeated notifies for the same anchor stay idempotent.
26
+ *
27
+ * @module @kya-os/mcp-i-cloudflare/delegation-http/credential-consent
28
+ */
29
+ import type { CredentialProviderConfig } from "@kya-os/contracts/config";
30
+ import type { CloudflareEnv } from "../types";
31
+ /** A resolved credential provider the anchor consent should authenticate with. */
32
+ export interface ResolvedCredentialProvider {
33
+ /** The provider id (dashboard key), used for identity resolution + notify. */
34
+ providerId: string;
35
+ /** Human-readable name for the consent page heading. */
36
+ displayName: string;
37
+ /** The provider config the credential auth handler consumes. */
38
+ config: CredentialProviderConfig;
39
+ }
40
+ /**
41
+ * The result of resolving whether the anchored scopes need credential auth.
42
+ *
43
+ * `unavailable` is deliberately distinct from `none`: it means we could NOT
44
+ * determine the requirement (the checkpoint `/providers` fetch failed, or its
45
+ * answer was ambiguous/malformed). The approve handler MUST fail closed on
46
+ * `unavailable` rather than mint an anonymous delegation — otherwise a transient
47
+ * error would silently skip merchant sign-in for a credential-protected project.
48
+ */
49
+ export type AnchorCredentialResolution = {
50
+ status: "credential";
51
+ provider: ResolvedCredentialProvider;
52
+ } | {
53
+ status: "none";
54
+ } | {
55
+ status: "unavailable";
56
+ };
57
+ /**
58
+ * Resolve whether the project has a credential (merchant sign-in) provider the
59
+ * anchor consent should authenticate against, by fetching checkpoint's
60
+ * `/api/v1/bouncer/projects/{projectId}/providers` (the CRED-001 endpoint that
61
+ * returns full credential configs — authEndpoint / requestBodyTemplate /
62
+ * responseFields / successCheck — the same source the native consent uses).
63
+ *
64
+ * Returns `none` (→ consent-only) when the deployment has no checkpoint link or
65
+ * the project has no credential provider; `unavailable` (→ fail closed on mint)
66
+ * when the requirement could not be determined (fetch error / ambiguous config);
67
+ * `credential` with the provider otherwise. NEVER throws.
68
+ *
69
+ * v1 selection: prefer the project's `configuredProvider` when it is a credential
70
+ * provider; otherwise the single configured credential provider. When several
71
+ * credential providers exist with no default, resolution is `unavailable` (fail
72
+ * closed) rather than a silent anonymous mint — per-scope provider mapping is a
73
+ * documented follow-up.
74
+ */
75
+ export declare function resolveAnchorCredentialProvider(env: CloudflareEnv, _scopes: string[]): Promise<AnchorCredentialResolution>;
76
+ /** Params for {@link resolveCredentialIdentity}. */
77
+ export interface ResolveCredentialIdentityParams {
78
+ projectId: string;
79
+ /** Credential provider id (e.g. the merchant provider). */
80
+ provider: string;
81
+ /** The customer id the provider's login returned. */
82
+ userId: string;
83
+ userEmail?: string;
84
+ userDisplayName?: string;
85
+ }
86
+ /**
87
+ * Resolve a signed-in customer to a checkpoint `user_did` via
88
+ * `/api/v1/bouncer/identity/resolve`. Mirrors
89
+ * `ConsentService.resolveCredentialIdentity` — it depends only on `env`
90
+ * (`AGENTSHIELD_API_URL` + `AGENTSHIELD_API_KEY`), never session/audit state, so
91
+ * it lives here as a free function the bridge can call directly. Returns
92
+ * `{ success: false }` (never throws) on any failure so the caller fails closed.
93
+ */
94
+ export declare function resolveCredentialIdentity(env: CloudflareEnv, params: ResolveCredentialIdentityParams): Promise<{
95
+ success: boolean;
96
+ userDid?: string;
97
+ }>;
98
+ /**
99
+ * Map an anchor sid (`kya-` + 16–64 hex) to a stable RFC-4122 v4-shaped UUID.
100
+ *
101
+ * The notify schema pins `delegation_id` to a UUID, but a sid is not one. We
102
+ * derive it from the SHA-256 of the WHOLE sid so a repeated notify for the same
103
+ * anchor is idempotent (same sid → same id) while distinct sids stay distinct —
104
+ * hashing the full value avoids the collisions that truncating/repeating the raw
105
+ * hex would cause (sids longer than 32 hex would drop entropy; padded short sids
106
+ * could alias). The version nibble is forced to `4` and the variant nibble into
107
+ * the `8–b` range so the result passes strict UUID validators. This id
108
+ * identifies the dashboard row; it is intentionally NOT the VC's own
109
+ * `urn:uuid:${sid}` id.
110
+ */
111
+ export declare function sidToDelegationUuid(sid: string): string;
112
+ /** Params for {@link notifyDelegation}. */
113
+ export interface NotifyDelegationParams {
114
+ /** The anchor sid the delegation was minted for. */
115
+ sid: string;
116
+ /** Subject (agent) DID the delegation was granted to. */
117
+ agentDid: string;
118
+ /** Human-readable agent name for the dashboard, if known. */
119
+ agentName?: string;
120
+ /** REQUIRED by the notify schema: the authorizing customer's DID. */
121
+ userDid: string;
122
+ /** Provider-native customer id. */
123
+ userId?: string;
124
+ /** Human-readable customer identifier (email) for dashboard display. */
125
+ userIdentifier?: string;
126
+ /** Granted scopes (at least one). */
127
+ scopes: string[];
128
+ /** Credential provider id. */
129
+ provider: string;
130
+ /** ISO-8601 expiry, if the delegation expires. */
131
+ expiresAt?: string;
132
+ /** Extra audit metadata merged into the report. */
133
+ metadata?: Record<string, unknown>;
134
+ }
135
+ /**
136
+ * Report a minted delegation to checkpoint so it appears in the dashboard,
137
+ * attributed to the signed-in customer. Fire-and-forget and best-effort: it
138
+ * NEVER throws and never blocks the consent response — a checkpoint hiccup must
139
+ * not fail an approval the user already granted. Matches the payload the OAuth
140
+ * path sends (`oauth-handler.ts`) against checkpoint's `notifyDelegationSchema`.
141
+ *
142
+ * No-ops (returns without a request) when the deployment has no
143
+ * `AGENTSHIELD_API_KEY` or `AGENTSHIELD_PROJECT_ID` — a self-hosted anchor with
144
+ * no checkpoint link has nothing to report to.
145
+ */
146
+ export declare function notifyDelegation(env: CloudflareEnv, params: NotifyDelegationParams): Promise<void>;
147
+ //# sourceMappingURL=credential-consent.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"credential-consent.d.ts","sourceRoot":"","sources":["../../src/delegation-http/credential-consent.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,0BAA0B,CAAC;AAEzE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAG9C,kFAAkF;AAClF,MAAM,WAAW,0BAA0B;IACzC,8EAA8E;IAC9E,UAAU,EAAE,MAAM,CAAC;IACnB,wDAAwD;IACxD,WAAW,EAAE,MAAM,CAAC;IACpB,gEAAgE;IAChE,MAAM,EAAE,wBAAwB,CAAC;CAClC;AAED;;;;;;;;GAQG;AACH,MAAM,MAAM,0BAA0B,GAClC;IAAE,MAAM,EAAE,YAAY,CAAC;IAAC,QAAQ,EAAE,0BAA0B,CAAA;CAAE,GAC9D;IAAE,MAAM,EAAE,MAAM,CAAA;CAAE,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AC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACpC;AAED;;;;;;;;;;GAUG;AACH,wBAAsB,gBAAgB,CACpC,GAAG,EAAE,aAAa,EAClB,MAAM,EAAE,sBAAsB,GAC7B,OAAO,CAAC,IAAI,CAAC,CA+Cf"}
@@ -0,0 +1,287 @@
1
+ import { DEFAULT_AGENTSHIELD_URL } from "../constants";
2
+ import { sha256Hex } from "./hash";
3
+ function readString(entry, camel, snake) {
4
+ const value = entry[camel] ?? entry[snake];
5
+ return typeof value === "string" ? value : undefined;
6
+ }
7
+ function readRecord(entry, camel, snake) {
8
+ const value = entry[camel] ?? entry[snake];
9
+ return value && typeof value === "object" ? value : undefined;
10
+ }
11
+ /** Whether an entry is a credential provider by its `type` discriminator. */
12
+ function isCredentialTyped(entry) {
13
+ return (!!entry &&
14
+ (entry.type === "password" || entry.type === "credential") &&
15
+ entry.configured !== false);
16
+ }
17
+ /**
18
+ * Map a raw `successCheck` to the contract shape, reading `expectedValue` in
19
+ * either casing. Returns `undefined` for an absent, empty, or incomplete object
20
+ * (missing `path` or `expectedValue`) so a half-configured check is dropped
21
+ * rather than left to reject every successful login.
22
+ */
23
+ function buildSuccessCheck(raw) {
24
+ if (!raw)
25
+ return undefined;
26
+ const path = typeof raw.path === "string" ? raw.path : undefined;
27
+ const expectedValue = raw.expectedValue ?? raw.expected_value;
28
+ if (!path || expectedValue === undefined)
29
+ return undefined;
30
+ if (typeof expectedValue !== "string" &&
31
+ typeof expectedValue !== "boolean" &&
32
+ typeof expectedValue !== "number") {
33
+ return undefined;
34
+ }
35
+ return { path, expectedValue };
36
+ }
37
+ /**
38
+ * Build a {@link CredentialProviderConfig} from a raw entry, reading every field
39
+ * in either casing (including the nested `responseFields`). Returns `null` when a
40
+ * required field is absent — a credential-typed entry that yields `null` must
41
+ * fail CLOSED at the call site, never fall through to an anonymous mint.
42
+ */
43
+ function buildCredentialConfig(entry) {
44
+ const authEndpoint = readString(entry, "authEndpoint", "auth_endpoint");
45
+ const requestBodyTemplate = readRecord(entry, "requestBodyTemplate", "request_body_template");
46
+ const rawResponseFields = readRecord(entry, "responseFields", "response_fields");
47
+ if (!authEndpoint || !requestBodyTemplate || !rawResponseFields)
48
+ return null;
49
+ const sessionToken = readString(rawResponseFields, "sessionToken", "session_token");
50
+ if (!sessionToken)
51
+ return null;
52
+ const responseFields = {
53
+ sessionToken,
54
+ userId: readString(rawResponseFields, "userId", "user_id"),
55
+ userEmail: readString(rawResponseFields, "userEmail", "user_email"),
56
+ userDisplayName: readString(rawResponseFields, "userDisplayName", "user_display_name"),
57
+ expiresIn: readString(rawResponseFields, "expiresIn", "expires_in"),
58
+ };
59
+ // Map the nested successCheck fields BOTH ways (`expectedValue` /
60
+ // `expected_value`) and drop an empty/incomplete object entirely — leaving a
61
+ // snake_case `expected_value` unmapped would make the auth handler read
62
+ // `expectedValue` as undefined and reject a successful login as a failed check.
63
+ const successCheck = buildSuccessCheck(readRecord(entry, "successCheck", "success_check"));
64
+ const headers = readRecord(entry, "headers", "headers");
65
+ const tokenUsage = readString(entry, "tokenUsage", "token_usage");
66
+ const tokenHeader = readString(entry, "tokenHeader", "token_header");
67
+ const cookieFormat = readString(entry, "cookieFormat", "cookie_format");
68
+ return {
69
+ // The handler ignores `type`, but the contract's discriminant is "credential".
70
+ type: "credential",
71
+ displayName: readString(entry, "displayName", "display_name"),
72
+ authEndpoint,
73
+ requestBodyTemplate,
74
+ responseFields,
75
+ ...(successCheck ? { successCheck } : {}),
76
+ ...(headers ? { headers } : {}),
77
+ ...(tokenUsage ? { tokenUsage } : {}),
78
+ ...(tokenHeader ? { tokenHeader } : {}),
79
+ ...(cookieFormat ? { cookieFormat } : {}),
80
+ };
81
+ }
82
+ /**
83
+ * Resolve whether the project has a credential (merchant sign-in) provider the
84
+ * anchor consent should authenticate against, by fetching checkpoint's
85
+ * `/api/v1/bouncer/projects/{projectId}/providers` (the CRED-001 endpoint that
86
+ * returns full credential configs — authEndpoint / requestBodyTemplate /
87
+ * responseFields / successCheck — the same source the native consent uses).
88
+ *
89
+ * Returns `none` (→ consent-only) when the deployment has no checkpoint link or
90
+ * the project has no credential provider; `unavailable` (→ fail closed on mint)
91
+ * when the requirement could not be determined (fetch error / ambiguous config);
92
+ * `credential` with the provider otherwise. NEVER throws.
93
+ *
94
+ * v1 selection: prefer the project's `configuredProvider` when it is a credential
95
+ * provider; otherwise the single configured credential provider. When several
96
+ * credential providers exist with no default, resolution is `unavailable` (fail
97
+ * closed) rather than a silent anonymous mint — per-scope provider mapping is a
98
+ * documented follow-up.
99
+ */
100
+ export async function resolveAnchorCredentialProvider(env, _scopes) {
101
+ const apiKey = env.AGENTSHIELD_API_KEY;
102
+ const projectId = env.AGENTSHIELD_PROJECT_ID;
103
+ // No checkpoint link → nothing to authenticate against → legitimately
104
+ // consent-only (this is not an error condition).
105
+ if (!apiKey || !projectId)
106
+ return { status: "none" };
107
+ const agentShieldUrl = env.AGENTSHIELD_API_URL || DEFAULT_AGENTSHIELD_URL;
108
+ let providersMap;
109
+ let configuredProvider;
110
+ try {
111
+ const response = await fetch(`${agentShieldUrl}/api/v1/bouncer/projects/${encodeURIComponent(projectId)}/providers`, {
112
+ method: "GET",
113
+ headers: {
114
+ Authorization: `Bearer ${apiKey}`,
115
+ "Content-Type": "application/json",
116
+ },
117
+ });
118
+ // A non-2xx from checkpoint means we cannot confirm the auth requirement —
119
+ // fail closed rather than fall through to an anonymous mint.
120
+ if (!response.ok)
121
+ return { status: "unavailable" };
122
+ const body = (await response.json());
123
+ // A 200 with an UNEXPECTED shape (no `success`, or a missing/non-object
124
+ // `providers` map) is NOT the same as "no credential provider" — we cannot
125
+ // trust it to say the project is consent-only, so fail closed rather than
126
+ // read it as an empty map and mint anonymously.
127
+ if (body.success !== true ||
128
+ !body.data ||
129
+ typeof body.data.providers !== "object" ||
130
+ body.data.providers === null) {
131
+ return { status: "unavailable" };
132
+ }
133
+ providersMap = body.data.providers;
134
+ configuredProvider =
135
+ body.data.configuredProvider ?? body.data.configured_provider ?? null;
136
+ }
137
+ catch {
138
+ // Network/parse failure — same fail-closed reasoning as a non-2xx.
139
+ return { status: "unavailable" };
140
+ }
141
+ // Detect credential providers by their `type` discriminator (reliably present),
142
+ // NOT by whether a camelCase authEndpoint parsed — a snake_case entry must not
143
+ // silently look non-credential and drop to an anonymous mint.
144
+ const credentialIds = Object.keys(providersMap).filter((id) => isCredentialTyped(providersMap[id]));
145
+ // No credential provider configured → the project is genuinely consent-only.
146
+ if (credentialIds.length === 0)
147
+ return { status: "none" };
148
+ // Prefer the project's default provider when it is itself a credential provider;
149
+ // else fall back to the single configured credential provider.
150
+ const chosenId = configuredProvider && isCredentialTyped(providersMap[configuredProvider])
151
+ ? configuredProvider
152
+ : credentialIds.length === 1
153
+ ? credentialIds[0]
154
+ : null;
155
+ // Credential providers exist but we cannot pick one (several, no default) —
156
+ // fail closed rather than mint anonymously.
157
+ if (!chosenId)
158
+ return { status: "unavailable" };
159
+ const config = buildCredentialConfig(providersMap[chosenId]);
160
+ // A credential-TYPED provider we cannot fully parse (missing/odd-cased fields)
161
+ // must fail closed — never fall through to a consent-only anonymous mint.
162
+ if (!config)
163
+ return { status: "unavailable" };
164
+ return {
165
+ status: "credential",
166
+ provider: {
167
+ providerId: chosenId,
168
+ displayName: config.displayName || chosenId,
169
+ config,
170
+ },
171
+ };
172
+ }
173
+ /**
174
+ * Resolve a signed-in customer to a checkpoint `user_did` via
175
+ * `/api/v1/bouncer/identity/resolve`. Mirrors
176
+ * `ConsentService.resolveCredentialIdentity` — it depends only on `env`
177
+ * (`AGENTSHIELD_API_URL` + `AGENTSHIELD_API_KEY`), never session/audit state, so
178
+ * it lives here as a free function the bridge can call directly. Returns
179
+ * `{ success: false }` (never throws) on any failure so the caller fails closed.
180
+ */
181
+ export async function resolveCredentialIdentity(env, params) {
182
+ const agentShieldUrl = env.AGENTSHIELD_API_URL || DEFAULT_AGENTSHIELD_URL;
183
+ const apiKey = env.AGENTSHIELD_API_KEY;
184
+ if (!apiKey)
185
+ return { success: false };
186
+ try {
187
+ const response = await fetch(`${agentShieldUrl}/api/v1/bouncer/identity/resolve`, {
188
+ method: "POST",
189
+ headers: {
190
+ "X-API-Key": apiKey,
191
+ "Content-Type": "application/json",
192
+ },
193
+ body: JSON.stringify({
194
+ project_id: params.projectId,
195
+ credential_result: {
196
+ provider: params.provider,
197
+ user_id: params.userId,
198
+ email: params.userEmail,
199
+ name: params.userDisplayName,
200
+ },
201
+ }),
202
+ });
203
+ if (!response.ok)
204
+ return { success: false };
205
+ const data = (await response.json());
206
+ const userDid = data?.data?.user_did;
207
+ return userDid ? { success: true, userDid } : { success: false };
208
+ }
209
+ catch {
210
+ return { success: false };
211
+ }
212
+ }
213
+ /**
214
+ * Map an anchor sid (`kya-` + 16–64 hex) to a stable RFC-4122 v4-shaped UUID.
215
+ *
216
+ * The notify schema pins `delegation_id` to a UUID, but a sid is not one. We
217
+ * derive it from the SHA-256 of the WHOLE sid so a repeated notify for the same
218
+ * anchor is idempotent (same sid → same id) while distinct sids stay distinct —
219
+ * hashing the full value avoids the collisions that truncating/repeating the raw
220
+ * hex would cause (sids longer than 32 hex would drop entropy; padded short sids
221
+ * could alias). The version nibble is forced to `4` and the variant nibble into
222
+ * the `8–b` range so the result passes strict UUID validators. This id
223
+ * identifies the dashboard row; it is intentionally NOT the VC's own
224
+ * `urn:uuid:${sid}` id.
225
+ */
226
+ export function sidToDelegationUuid(sid) {
227
+ // sha256Hex is a synchronous FIPS-180-4 digest (asserted against
228
+ // crypto.subtle) — lets this stay a pure sync helper.
229
+ const h = sha256Hex(sid).slice(0, 32).split("");
230
+ h[12] = "4"; // version 4
231
+ // Variant 10xx: keep entropy from the hash nibble, forcing the top two bits.
232
+ h[16] = ((parseInt(h[16], 16) & 0x3) | 0x8).toString(16);
233
+ const s = h.join("");
234
+ return `${s.slice(0, 8)}-${s.slice(8, 12)}-${s.slice(12, 16)}-${s.slice(16, 20)}-${s.slice(20, 32)}`;
235
+ }
236
+ /**
237
+ * Report a minted delegation to checkpoint so it appears in the dashboard,
238
+ * attributed to the signed-in customer. Fire-and-forget and best-effort: it
239
+ * NEVER throws and never blocks the consent response — a checkpoint hiccup must
240
+ * not fail an approval the user already granted. Matches the payload the OAuth
241
+ * path sends (`oauth-handler.ts`) against checkpoint's `notifyDelegationSchema`.
242
+ *
243
+ * No-ops (returns without a request) when the deployment has no
244
+ * `AGENTSHIELD_API_KEY` or `AGENTSHIELD_PROJECT_ID` — a self-hosted anchor with
245
+ * no checkpoint link has nothing to report to.
246
+ */
247
+ export async function notifyDelegation(env, params) {
248
+ const apiKey = env.AGENTSHIELD_API_KEY;
249
+ const projectId = env.AGENTSHIELD_PROJECT_ID;
250
+ if (!apiKey || !projectId)
251
+ return;
252
+ const agentShieldUrl = env.AGENTSHIELD_API_URL || DEFAULT_AGENTSHIELD_URL;
253
+ try {
254
+ const response = await fetch(`${agentShieldUrl}/api/v1/bouncer/delegations/notify`, {
255
+ method: "POST",
256
+ headers: {
257
+ "X-API-Key": apiKey,
258
+ "Content-Type": "application/json",
259
+ },
260
+ body: JSON.stringify({
261
+ delegation_id: sidToDelegationUuid(params.sid),
262
+ agent_did: params.agentDid,
263
+ agent_name: params.agentName || undefined,
264
+ user_did: params.userDid,
265
+ user_id: params.userId || undefined,
266
+ user_identifier: params.userIdentifier || undefined,
267
+ scopes: params.scopes,
268
+ provider: params.provider,
269
+ project_id: projectId,
270
+ created_at: new Date().toISOString(),
271
+ expires_at: params.expiresAt || undefined,
272
+ metadata: {
273
+ source: "mcp-i-anchor-consent",
274
+ sid: params.sid,
275
+ ...params.metadata,
276
+ },
277
+ }),
278
+ });
279
+ if (!response.ok) {
280
+ console.warn(`[kya-http] delegation notify failed (non-blocking): ${response.status} sid=${params.sid}`);
281
+ }
282
+ }
283
+ catch (error) {
284
+ console.warn(`[kya-http] delegation notify failed (non-blocking): ${error instanceof Error ? error.message : String(error)} sid=${params.sid}`);
285
+ }
286
+ }
287
+ //# sourceMappingURL=credential-consent.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"credential-consent.js","sourceRoot":"","sources":["../../src/delegation-http/credential-consent.ts"],"names":[],"mappings":"AA6BA,OAAO,EAAE,uBAAuB,EAAE,MAAM,cAAc,CAAC;AAEvD,OAAO,EAAE,SAAS,EAAE,MAAM,QAAQ,CAAC;AAmCnC,SAAS,UAAU,CACjB,KAAuB,EACvB,KAAa,EACb,KAAa;IAEb,MAAM,KAAK,GAAG,KAAK,CAAC,KAAK,CAAC,IAAI,KAAK,CAAC,KAAK,CAAC,CAAC;IAC3C,OAAO,OAAO,KAAK,KAAK,QAAQ,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,SAAS,CAAC;AACvD,CAAC;AAED,SAAS,UAAU,CACjB,KAAuB,EACvB,KAAa,EACb,KAAa;IAEb,MAAM,KAAK,GAAG,KAAK,CAAC,KAAK,CAAC,IAAI,KAAK,CAAC,KAAK,CAAC,CAAC;IAC3C,OAAO,KAAK,IAAI,OAAO,KAAK,KAAK,QAAQ,CAAC,CAAC,CAAE,KAAW,CAAC,CAAC,CAAC,SAAS,CAAC;AACvE,CAAC;AAED,6EAA6E;AAC7E,SAAS,iBAAiB,CAAC,KAAmC;IAC5D,OAAO,CACL,CAAC,CAAC,KAAK;QACP,CAAC,KAAK,CAAC,IAAI,KAAK,UAAU,IAAI,KAAK,CAAC,IAAI,KAAK,YAAY,CAAC;QAC1D,KAAK,CAAC,UAAU,KAAK,KAAK,CAC3B,CAAC;AACJ,CAAC;AAED;;;;;GAKG;AACH,SAAS,iBAAiB,CACxB,GAAiC;IAEjC,IAAI,CAAC,GAAG;QAAE,OAAO,SAAS,CAAC;IAC3B,MAAM,IAAI,GAAG,OAAO,GAAG,CAAC,IAAI,KAAK,QAAQ,CAAC,CAAC,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC,SAAS,CAAC;IACjE,MAAM,aAAa,GAAG,GAAG,CAAC,aAAa,IAAI,GAAG,CAAC,cAAc,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UAAU,EAAE,MAAM,CAAC,SAAS,IAAI,SAAS;gBACzC,QAAQ,EAAE,MAAM,CAAC,OAAO;gBACxB,OAAO,EAAE,MAAM,CAAC,MAAM,IAAI,SAAS;gBACnC,eAAe,EAAE,MAAM,CAAC,cAAc,IAAI,SAAS;gBACnD,MAAM,EAAE,MAAM,CAAC,MAAM;gBACrB,QAAQ,EAAE,MAAM,CAAC,QAAQ;gBACzB,UAAU,EAAE,SAAS;gBACrB,UAAU,EAAE,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE;gBACpC,UAAU,EAAE,MAAM,CAAC,SAAS,IAAI,SAAS;gBACzC,QAAQ,EAAE;oBACR,MAAM,EAAE,sBAAsB;oBAC9B,GAAG,EAAE,MAAM,CAAC,GAAG;oBACf,GAAG,MAAM,CAAC,QAAQ;iBACnB;aACF,CAAC;SACH,CACF,CAAC;QACF,IAAI,CAAC,QAAQ,CAAC,EAAE,EAAE,CAAC;YACjB,OAAO,CAAC,IAAI,CACV,uDAAuD,QAAQ,CAAC,MAAM,QAAQ,MAAM,CAAC,GAAG,EAAE,CAC3F,CAAC;QACJ,CAAC;IACH,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,OAAO,CAAC,IAAI,CACV,uDACE,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CACvD,QAAQ,MAAM,CAAC,GAAG,EAAE,CACrB,CAAC;IACJ,CAAC;AACH,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kya-os/mcp-i-cloudflare",
3
- "version": "1.12.1",
3
+ "version": "1.12.2",
4
4
  "description": "Cloudflare Workers adapter for MCP-I framework",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -29,9 +29,9 @@
29
29
  },
30
30
  "dependencies": {
31
31
  "@kya-os/consent": "^0.1.41",
32
- "@kya-os/contracts": "^1.9.0",
32
+ "@kya-os/contracts": "^1.9.1",
33
33
  "@kya-os/mcp": "^1.10.1",
34
- "@kya-os/mcp-i-core": "^1.8.1",
34
+ "@kya-os/mcp-i-core": "^1.8.2",
35
35
  "@kya-os/mcp-i-runtime": "^1.0.0",
36
36
  "@kya-os/provider-registry": "^0.1.7",
37
37
  "@modelcontextprotocol/sdk": "^1.25.2",