@tinycloud/node-sdk 3.9.0-beta.3 → 3.9.0-beta.5

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,"sources":["../src/credentials/interpreter.ts","../src/credentials/transport.ts"],"sourcesContent":["import {\n CredentialError,\n encodeBase64Url,\n holderBindingSigningBytes,\n validateCredentialHolderBinding,\n type CredentialFlowDescriptor,\n type CredentialProgressEvent,\n type CredentialRequirement,\n} from \"@tinycloud/sdk-core\";\nimport type { CredentialAcquisitionTransport, CredentialProofSubject, CredentialSigningAdapter, InlineCredentialProofHandler, InlineCredentialProofRequest, PrimitiveStepHandler } from \"./types\";\n\nconst delay = (ms: number, signal?: AbortSignal) => new Promise<void>((resolve, reject) => {\n const timer = setTimeout(resolve, ms);\n signal?.addEventListener(\"abort\", () => { clearTimeout(timer); reject(new DOMException(\"Aborted\", \"AbortError\")); }, { once: true });\n});\n\n/** The mailbox named by an email requirement, which the issuer delivers the code to. */\nexport function mailboxSubject(requirement: CredentialRequirement): CredentialProofSubject | undefined {\n const email = requirement.claims.email;\n return typeof email === \"string\" && email.length > 0 ? Object.freeze({ kind: \"email\" as const, value: email }) : undefined;\n}\n\n/** Finite step interpreter. Dispatch is exclusively by registered primitive and version. */\nexport async function interpretCredentialFlow(input: {\n readonly descriptor: CredentialFlowDescriptor;\n readonly requirement: CredentialRequirement;\n readonly requestId: string;\n readonly verifier: string;\n readonly holderDid: string;\n readonly descriptorDigest: string;\n readonly requirementDigest: string;\n readonly openerOrigin: string;\n readonly transport: CredentialAcquisitionTransport;\n readonly signing: CredentialSigningAdapter;\n /**\n * Fallback for a host-owned surface. It receives every declared proof step,\n * including primitives added by a later protocol version.\n */\n readonly proofHandler?: InlineCredentialProofHandler;\n readonly handlers?: Partial<Record<\"collect_input\" | \"mailbox_otp\", PrimitiveStepHandler>>;\n readonly signal?: AbortSignal;\n readonly onProgress?: (event: CredentialProgressEvent) => void;\n readonly onWait?: () => Promise<void>;\n}): Promise<void> {\n const steps = new Map(input.descriptor.steps.map((step) => [step.type, step]));\n const completed = new Set<string>(); let lastTransition = \"\";\n for (;;) {\n input.signal?.throwIfAborted();\n const state = await input.transport.state(input.requestId, input.verifier, input.signal);\n if (state.requestId !== input.requestId) throw new CredentialError(\"REQUEST_SUBSTITUTED\", \"Credential request identity changed\");\n if (state.state === \"expired\") throw new CredentialError(\"REQUEST_EXPIRED\", \"Credential request expired\", { state: state.state, correlationId: state.correlationId });\n if (state.state === \"canceled\") throw new CredentialError(\"CANCELED\", \"Credential request was canceled\", { state: state.state, correlationId: state.correlationId });\n if (state.state === \"issuer_unready\") throw new CredentialError(\"ISSUER_UNREADY\", \"Credential issuer is not ready\", { retryAfterMs: state.retryAfterMs, state: state.state, correlationId: state.correlationId });\n if (state.state === \"complete\") return;\n if (state.state === \"ready_to_issue\" || state.state === \"issued\") {\n if (state.state === \"ready_to_issue\" && !completed.has(\"issue\")) { await input.transport.issue(input.requestId, input.verifier, input.signal); completed.add(\"issue\"); }\n else await (input.onWait?.() ?? delay(state.retryAfterMs ?? 50, input.signal));\n continue;\n }\n const next = state.nextStep;\n if (!next) { await (input.onWait?.() ?? delay(state.retryAfterMs ?? 50, input.signal)); continue; }\n const declared = steps.get(next.type);\n if (next.id !== next.type || !declared || declared.type !== next.type || declared.version !== next.version) throw new CredentialError(\"REQUEST_SUBSTITUTED\", \"Server selected an undeclared credential step\");\n if (completed.has(next.id) || state.transitionId === lastTransition) { await (input.onWait?.() ?? delay(state.retryAfterMs ?? 50, input.signal)); continue; }\n lastTransition = state.transitionId;\n if (next.type === \"holder_signature\") {\n input.onProgress?.({ state: \"signing\", stepId: next.id, correlationId: state.correlationId });\n const binding = validateCredentialHolderBinding(await input.transport.holderBinding(input.requestId, input.verifier, input.signal));\n if (binding.requestId !== input.requestId || binding.descriptorDigest !== input.descriptorDigest || binding.requirementDigest !== input.requirementDigest || binding.holderDid !== input.holderDid || binding.issuer !== input.descriptor.issuer.did || binding.issuerKid !== input.descriptor.issuer.kid || binding.profile !== input.descriptor.profile || binding.openerOrigin !== input.openerOrigin || binding.completionOrigin !== input.openerOrigin || binding.audience !== \"tinycloud://credentials\") throw new CredentialError(\"REQUEST_SUBSTITUTED\", \"Holder binding was substituted\");\n const bytes = holderBindingSigningBytes(binding);\n let signature = await input.signing.autoSign?.(binding, bytes, input.signal);\n if (signature === undefined) {\n if (!input.signing.requestApproval) throw new CredentialError(\"SIGNATURE_REJECTED\", \"OpenKey approval is required\");\n try { signature = await input.signing.requestApproval(binding, bytes, input.signal); } catch (cause) { if (cause instanceof CredentialError) throw cause; throw new CredentialError(\"SIGNATURE_REJECTED\", \"OpenKey approval was rejected\", { cause }); }\n }\n if (!(signature instanceof Uint8Array) || signature.length === 0) throw new CredentialError(\"SIGNATURE_REJECTED\", \"OpenKey signature is invalid\");\n await input.transport.submitHolderSignature(input.requestId, input.verifier, encodeBase64Url(signature), input.signal, input.signing.holderKey);\n } else {\n input.onProgress?.({ state: next.type === \"collect_input\" ? \"collecting\" : \"proving\", stepId: next.id, correlationId: state.correlationId });\n const handler = input.handlers?.[next.type];\n const inlineHandler = input.proofHandler;\n if (!handler && !inlineHandler) { await (input.onWait?.() ?? delay(state.retryAfterMs ?? 50, input.signal)); continue; }\n if (next.constraints.challengeRequired === true) await input.transport.beginStep(input.requestId, input.verifier, next.type, input.signal);\n if (handler) {\n const proof = await handler({ descriptor: input.descriptor, requirement: input.requirement, stepId: next.id, constraints: next.constraints, signal: input.signal });\n await input.transport.submitStep(input.requestId, input.verifier, next.id, proof, input.signal);\n } else {\n let feedback: InlineCredentialProofRequest[\"feedback\"];\n // A mistyped code is re-entered against the same challenge; the issuer\n // counts every attempt and reports when the bounded budget is spent.\n for (let attempt = 1; ; attempt += 1) {\n const proof = await inlineHandler!({\n stepId: next.id,\n constraints: next.constraints,\n display: {\n title: input.descriptor.display.title,\n description: input.descriptor.display.description,\n consent: input.descriptor.display.consent,\n progressLabel: input.descriptor.accessibility.progressLabel,\n errorLiveRegion: input.descriptor.accessibility.errorLiveRegion,\n },\n inputs: input.descriptor.inputs.map(({ id, label, schema }) => ({ id, label, schema })),\n ...(feedback === undefined ? {} : { feedback }),\n signal: input.signal,\n });\n try {\n await input.transport.submitStep(input.requestId, input.verifier, next.id, proof, input.signal);\n break;\n } catch (cause) {\n if (!(cause instanceof CredentialError) || cause.code !== \"PROOF_REJECTED\") throw cause;\n const attemptsRemaining = input.descriptor.lifecycle.maxProofAttempts - attempt;\n // Once this view stops re-prompting, the rejection is final: a\n // host must not silently start a new acquisition on its behalf.\n if (next.type !== \"mailbox_otp\" || attemptsRemaining <= 0) throw new CredentialError(\"VERIFICATION_FAILED\", \"The proof was not accepted\", { state: attemptsRemaining <= 0 ? \"proof_attempts_exhausted\" : \"proof_rejected\", cause });\n feedback = { kind: \"rejected\", attemptsRemaining };\n }\n }\n }\n }\n completed.add(next.id);\n }\n}\n","import {\n CredentialError, canonicalDigest, credentialEndpointPath, decodeBase64Url, encodeBase64Url,\n holderBindingCanonicalBytes, sha256Base64Url, validateCredentialHolderBinding,\n type CredentialFlowDescriptor, type CredentialHolderBinding, type CredentialIssuerMetadata,\n type CredentialRequirement, type IssuedCredentialEnvelope,\n} from \"@tinycloud/sdk-core\";\nimport type { CredentialAcquisitionTransport, CredentialRequestState, HolderSignatureKey, PrimitiveStepResult } from \"./types\";\n\nfunction object(value: unknown, label: string): Record<string, unknown> { if (typeof value !== \"object\" || value === null || Array.isArray(value)) throw new CredentialError(\"VERIFICATION_FAILED\", `${label} is invalid`); return value as Record<string, unknown>; }\nfunction opaque(value: unknown, label: string): string { if (typeof value !== \"string\" || !/^[A-Za-z0-9_-]{16,128}$/.test(value)) throw new CredentialError(\"REQUEST_SUBSTITUTED\", `${label} is invalid`); return value; }\nfunction timestamp(value: unknown, label: string): string { if (typeof value !== \"string\" || !Number.isFinite(Date.parse(value))) throw new CredentialError(\"VERIFICATION_FAILED\", `${label} is invalid`); return new Date(value).toISOString(); }\nfunction jwtPayload(credential: string): Record<string, unknown> { const part = credential.split(\"~\", 1)[0]?.split(\".\")[1]; if (!part) throw new CredentialError(\"VERIFICATION_FAILED\", \"Issued SD-JWT is invalid\"); try { return object(JSON.parse(new TextDecoder().decode(decodeBase64Url(part))), \"SD-JWT payload\"); } catch (cause) { if (cause instanceof CredentialError) throw cause; throw new CredentialError(\"VERIFICATION_FAILED\", \"Issued SD-JWT is invalid\", { cause }); } }\nconst SERVER_CODES = new Set([\"REQUEST_EXPIRED\", \"ISSUER_UNREADY\", \"UNSUPPORTED_PROFILE\", \"UNSUPPORTED_VERSION\", \"SIGNATURE_REJECTED\"] as const);\nfunction serverError(value: unknown, response: Response, honorServerRecoverable: boolean): CredentialError | undefined {\n if (typeof value !== \"object\" || value === null || Array.isArray(value)) return undefined;\n const body = value as Record<string, unknown>;\n const keys = Object.keys(body).sort();\n if (keys.join(\",\") !== \"code,correlationId,recoverable,state,type\" || body.type !== \"tinycloud.credentials/error/v1\" || typeof body.code !== \"string\" || typeof body.recoverable !== \"boolean\" || typeof body.state !== \"string\" || typeof body.correlationId !== \"string\") return undefined;\n // A rejected proof is retryable only while the issuer still has attempts\n // left for this challenge; once exhausted the acquisition cannot finish.\n if (body.code === \"PROOF_REJECTED\") return body.recoverable\n ? new CredentialError(\"PROOF_REJECTED\", \"The proof was not accepted\", { state: body.state, correlationId: body.correlationId })\n : new CredentialError(\"VERIFICATION_FAILED\", \"The proof attempt limit was reached\", { state: \"proof_attempts_exhausted\", correlationId: body.correlationId });\n if (body.code === \"RATE_LIMITED\") return new CredentialError(\"ISSUER_UNREADY\", \"Too many verification codes were requested\", { state: \"rate_limited\", correlationId: body.correlationId, retryAfterMs: Number(response.headers.get(\"retry-after\")) * 1000 || undefined, recoverable: honorServerRecoverable ? body.recoverable : undefined });\n if (body.code === \"CHALLENGE_EXPIRED\") return new CredentialError(\"REQUEST_EXPIRED\", \"The credential challenge expired\", { state: body.state, correlationId: body.correlationId, recoverable: honorServerRecoverable ? body.recoverable : undefined });\n if (!SERVER_CODES.has(body.code as any)) return undefined;\n const code = body.code as \"REQUEST_EXPIRED\" | \"ISSUER_UNREADY\" | \"UNSUPPORTED_PROFILE\" | \"UNSUPPORTED_VERSION\" | \"SIGNATURE_REJECTED\";\n return new CredentialError(code, `OpenCredentials rejected the request: ${code}`, {\n state: body.state,\n correlationId: body.correlationId,\n retryAfterMs: Number(response.headers.get(\"retry-after\")) * 1000 || undefined,\n recoverable: honorServerRecoverable ? body.recoverable : undefined,\n });\n}\n\nexport class OpenCredentialsHttpTransport implements CredentialAcquisitionTransport {\n private readonly nonces = new Map<string, string>();\n private readonly bindings = new Map<string, CredentialHolderBinding>();\n constructor(private readonly descriptor: CredentialFlowDescriptor, private readonly fetchFn: typeof fetch = globalThis.fetch.bind(globalThis), private readonly options: { readonly honorServerRecoverable?: boolean } = {}) {}\n private url(endpoint: Parameters<typeof credentialEndpointPath>[0], id?: string): string { return new URL(credentialEndpointPath(endpoint, id), this.descriptor.issuer.origin).href; }\n private async request(endpoint: Parameters<typeof credentialEndpointPath>[0], input: { readonly id?: string; readonly method?: \"GET\" | \"POST\"; readonly verifier?: string; readonly body?: unknown; readonly signal?: AbortSignal }): Promise<unknown> {\n let response: Response;\n try { const init: RequestInit & { readonly cache: \"no-store\" } = { method: input.method ?? \"GET\", credentials: \"omit\", cache: \"no-store\", redirect: \"error\", referrerPolicy: \"no-referrer\", signal: input.signal, headers: { accept: \"application/json\", ...(input.body === undefined ? {} : { \"content-type\": \"application/json\" }), ...(input.verifier === undefined ? {} : { authorization: `Bearer ${input.verifier}` }) }, ...(input.body === undefined ? {} : { body: JSON.stringify(input.body) }) }; response = await this.fetchFn(this.url(endpoint, input.id), init); }\n catch (cause) { if (cause instanceof DOMException && cause.name === \"AbortError\") throw new CredentialError(\"CANCELED\", \"Credential acquisition was canceled\", { cause }); throw new CredentialError(\"OFFLINE\", \"OpenCredentials is unavailable\", { cause }); }\n if (!response.ok) {\n let parsed: unknown;\n try { parsed = await response.json(); } catch { parsed = undefined; }\n const typed = serverError(parsed, response, this.options.honorServerRecoverable === true);\n if (typed) throw typed;\n if (response.status === 410) throw new CredentialError(\"REQUEST_EXPIRED\", \"Credential request expired\");\n if (response.status === 409) throw new CredentialError(\"REQUEST_SUBSTITUTED\", \"Credential request was replayed or substituted\");\n if (response.status === 503) throw new CredentialError(\"ISSUER_UNREADY\", \"Credential issuer is not ready\", { retryAfterMs: Number(response.headers.get(\"retry-after\")) * 1000 || undefined });\n throw new CredentialError(\"VERIFICATION_FAILED\", \"OpenCredentials rejected the request\");\n }\n if (response.status === 204) return undefined; try { return await response.json(); } catch (cause) { throw new CredentialError(\"VERIFICATION_FAILED\", \"OpenCredentials response is invalid\", { cause }); }\n }\n async create(input: { descriptor: CredentialFlowDescriptor; descriptorDigest: string; requirement: CredentialRequirement; requirementDigest: string; holderDid: string; openerOrigin: string; completionVerifierChallenge: string; inputs?: Readonly<Record<string, string>>; signal?: AbortSignal }) {\n const body = object(await this.request(\"request\", { method: \"POST\", body: { protocol: input.descriptor.protocol, profile: input.descriptor.profile, profileVersion: input.descriptor.profileVersion, descriptorDigest: input.descriptorDigest, requirementDigest: input.requirementDigest, holderDid: input.holderDid, inputs: input.inputs ?? input.requirement.claims, audience: \"tinycloud://credentials\", openerOrigin: input.openerOrigin, completionOrigin: input.openerOrigin, completionContext: \"sdk-acquisition\", completionVerifierChallenge: input.completionVerifierChallenge }, signal: input.signal }), \"create response\");\n if (body.type !== \"tinycloud.credentials/acquisition-request/v1\" || body.protocol !== input.descriptor.protocol || body.next !== \"challenge\" || body.endpoint !== \"challenge\") throw new CredentialError(\"VERIFICATION_FAILED\", \"create response is invalid\");\n const requestId = opaque(body.requestId, \"requestId\"); return { requestId, locator: requestId, expiresAt: timestamp(body.expiresAt, \"expiresAt\"), correlationId: requestId };\n }\n private proofStep(): \"mailbox_otp\" | \"collect_input\" { return this.descriptor.steps.some((step) => step.type === \"mailbox_otp\") ? \"mailbox_otp\" : \"collect_input\"; }\n async state(id: string, verifier: string, signal?: AbortSignal): Promise<CredentialRequestState> {\n const raw = object(await this.request(\"state\", { id, verifier, signal }), \"state response\");\n if (raw.type !== \"tinycloud.credentials/acquisition-state/v1\" || raw.requestId !== id || raw.profile !== this.descriptor.profile || raw.profileVersion !== 1) throw new CredentialError(\"REQUEST_SUBSTITUTED\", \"Credential state response is substituted\");\n const base = { type: \"OpenCredentialsAcquisitionState\" as const, version: 1 as const, requestId: id, transitionId: `${String(raw.state)}:${String(raw.resultPreviouslyRead ?? false)}`, correlationId: id };\n if (raw.state === \"challenge_required\") { const type = this.proofStep(); return { ...base, state: \"pending\", nextStep: { id: type, type, version: 1, constraints: { challengeRequired: true } } }; }\n if (raw.state === \"proof_required\") { const type = this.proofStep(); this.nonces.set(id, opaque(raw.challengeNonce, \"challengeNonce\")); return { ...base, state: \"pending\", nextStep: { id: type, type, version: 1, constraints: {} } }; }\n if (raw.state === \"holder_binding_required\" || raw.state === \"holder_signature_required\") return { ...base, state: \"pending\", nextStep: { id: \"holder_signature\", type: \"holder_signature\", version: 1, constraints: {} } };\n if (raw.state === \"ready_to_issue\") return { ...base, state: \"ready_to_issue\" };\n if (raw.state === \"issued\") return { ...base, state: \"complete\" };\n throw new CredentialError(\"REQUEST_SUBSTITUTED\", \"Credential state is unsupported\");\n }\n async beginStep(id: string, verifier: string, stepId: \"collect_input\" | \"mailbox_otp\", signal?: AbortSignal): Promise<void> { const step = this.proofStep(); if (stepId !== step) throw new CredentialError(\"REQUEST_SUBSTITUTED\", \"Credential challenge step is substituted\"); const challenge = object(await this.request(\"challenge\", { id, verifier, method: \"POST\", body: { step, stepVersion: 1 }, signal }), \"challenge response\"); if (challenge.type !== \"tinycloud.credentials/challenge/v1\" || challenge.step !== step || challenge.stepVersion !== 1) throw new CredentialError(\"REQUEST_SUBSTITUTED\", \"Credential challenge is substituted\"); this.nonces.set(id, opaque(challenge.challengeNonce, \"challengeNonce\")); }\n async submitStep(id: string, verifier: string, stepId: string, proof: PrimitiveStepResult, signal?: AbortSignal): Promise<void> { const step = this.proofStep(); if (stepId !== step) throw new CredentialError(\"REQUEST_SUBSTITUTED\", \"Credential proof step is substituted\"); const nonce = this.nonces.get(id); if (!nonce) throw new CredentialError(\"REQUEST_SUBSTITUTED\", \"Credential challenge is missing\"); await this.request(\"proof\", { id, verifier, method: \"POST\", body: { step, stepVersion: 1, challengeNonce: nonce, proof }, signal }); }\n async holderBinding(id: string, verifier: string, signal?: AbortSignal): Promise<CredentialHolderBinding> { const raw = object(await this.request(\"holder_binding\", { id, verifier, signal }), \"holder binding response\"); if (raw.type !== \"tinycloud.credentials/holder-binding-request/v1\" || raw.signingDomain !== \"tinycloud.credentials/holder-binding/v1\" || raw.alg !== \"EdDSA\" || typeof raw.canonical !== \"string\") throw new CredentialError(\"REQUEST_SUBSTITUTED\", \"Holder binding response is invalid\"); const binding = validateCredentialHolderBinding(raw.binding); if (encodeBase64Url(holderBindingCanonicalBytes(binding)) !== raw.canonical) throw new CredentialError(\"REQUEST_SUBSTITUTED\", \"Holder binding canonical bytes were substituted\"); this.bindings.set(id, binding); return binding; }\n async submitHolderSignature(id: string, verifier: string, signature: string, signal?: AbortSignal, key?: HolderSignatureKey): Promise<void> { const binding = this.bindings.get(id); if (!binding) throw new CredentialError(\"REQUEST_SUBSTITUTED\", \"Holder binding was not retrieved\"); const kid = key?.kid ?? `${binding.holderDid}#${binding.holderDid.replace(\"did:key:\", \"\")}`; await this.request(\"holder_signature\", { id, verifier, method: \"POST\", body: { alg: key?.alg ?? \"EdDSA\", kid, signature }, signal }); }\n async issue(id: string, verifier: string, signal?: AbortSignal): Promise<void> { await this.request(\"issue\", { id, verifier, method: \"POST\", signal }); }\n async result(id: string, verifier: string, signal?: AbortSignal): Promise<IssuedCredentialEnvelope> {\n const raw = object(await this.request(\"result\", { id, verifier, signal }), \"result response\"); if (raw.type !== \"tinycloud.credentials/result/v1\" || raw.protocol !== this.descriptor.protocol || raw.profile !== this.descriptor.profile || raw.profileVersion !== 1 || raw.format !== \"vc+sd-jwt\" || raw.descriptorDigest !== await canonicalDigest(this.descriptor) || raw.issuer !== this.descriptor.issuer.did || raw.issuerKid !== this.descriptor.issuer.kid || typeof raw.credential !== \"string\" || await sha256Base64Url(raw.credential) !== raw.credentialDigest) throw new CredentialError(\"VERIFICATION_FAILED\", \"Issued result metadata is invalid\");\n const holder = object(raw.holderBinding, \"result holder binding\"); if (raw.subject !== holder.did || holder.signingDomain !== \"tinycloud.credentials/holder-binding/v1\") throw new CredentialError(\"HOLDER_MISMATCH\", \"Issued holder binding is invalid\");\n const claimsRaw = object(raw.claims, \"result claims\"); const claims: Record<string, string> = {}; for (const [name, value] of Object.entries(claimsRaw)) { if (typeof value !== \"string\") throw new CredentialError(\"VERIFICATION_FAILED\", \"Issued claims are invalid\"); claims[name] = value; }\n const validity = object(raw.validity, \"result validity\"); const payload = jwtPayload(raw.credential); if (typeof payload.jti !== \"string\") throw new CredentialError(\"VERIFICATION_FAILED\", \"Credential id is invalid\"); const issuedAt = timestamp(validity.issuedAt, \"issuedAt\"); const expiresAt = timestamp(validity.expiresAt, \"expiresAt\");\n const status = object(raw.status, \"result status\"); if (status.type !== \"none\" || status.freshnessSeconds !== this.descriptor.status.freshnessSeconds) throw new CredentialError(\"VERIFICATION_FAILED\", \"Credential status is invalid\");\n return { type: \"OpenCredentialsIssuedCredential\", version: 1, protocol: this.descriptor.protocol, profile: { id: this.descriptor.profile, version: 1 }, credentialType: { id: this.descriptor.format.vct, version: 1 }, schema: this.descriptor.format.vct, format: \"vc+sd-jwt\", issuerDid: raw.issuer as string, issuerKid: raw.issuerKid as string, subjectDid: raw.subject as string, holderDid: raw.subject as string, claims, claimsDigest: await canonicalDigest(claims), descriptorDigest: raw.descriptorDigest as string, credentialId: payload.jti, issuedAt, notBefore: issuedAt, expiresAt, status: { method: \"none\", freshnessSeconds: status.freshnessSeconds as number }, credential: raw.credential };\n }\n async issuerMetadata(signal?: AbortSignal): Promise<CredentialIssuerMetadata> { return await this.request(\"issuer_metadata\", { signal }) as CredentialIssuerMetadata; }\n async checkStatus(status: IssuedCredentialEnvelope[\"status\"], _signal?: AbortSignal): Promise<boolean> { return status.method === \"none\" && status.freshnessSeconds === this.descriptor.status.freshnessSeconds; }\n}\n"],"mappings":";AAAA;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OAIK;AAGP,IAAM,QAAQ,CAAC,IAAY,WAAyB,IAAI,QAAc,CAAC,SAAS,WAAW;AACzF,QAAM,QAAQ,WAAW,SAAS,EAAE;AACpC,UAAQ,iBAAiB,SAAS,MAAM;AAAE,iBAAa,KAAK;AAAG,WAAO,IAAI,aAAa,WAAW,YAAY,CAAC;AAAA,EAAG,GAAG,EAAE,MAAM,KAAK,CAAC;AACrI,CAAC;AAGM,SAAS,eAAe,aAAwE;AACrG,QAAM,QAAQ,YAAY,OAAO;AACjC,SAAO,OAAO,UAAU,YAAY,MAAM,SAAS,IAAI,OAAO,OAAO,EAAE,MAAM,SAAkB,OAAO,MAAM,CAAC,IAAI;AACnH;AAGA,eAAsB,wBAAwB,OAoB5B;AAChB,QAAM,QAAQ,IAAI,IAAI,MAAM,WAAW,MAAM,IAAI,CAAC,SAAS,CAAC,KAAK,MAAM,IAAI,CAAC,CAAC;AAC7E,QAAM,YAAY,oBAAI,IAAY;AAAG,MAAI,iBAAiB;AAC1D,aAAS;AACP,UAAM,QAAQ,eAAe;AAC7B,UAAM,QAAQ,MAAM,MAAM,UAAU,MAAM,MAAM,WAAW,MAAM,UAAU,MAAM,MAAM;AACvF,QAAI,MAAM,cAAc,MAAM,UAAW,OAAM,IAAI,gBAAgB,uBAAuB,qCAAqC;AAC/H,QAAI,MAAM,UAAU,UAAW,OAAM,IAAI,gBAAgB,mBAAmB,8BAA8B,EAAE,OAAO,MAAM,OAAO,eAAe,MAAM,cAAc,CAAC;AACpK,QAAI,MAAM,UAAU,WAAY,OAAM,IAAI,gBAAgB,YAAY,mCAAmC,EAAE,OAAO,M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AW,OAAO,KAAK,SAAS,EAAE,GAAG,QAAQ,KAAK,WAAW,OAAO,KAAK,QAAQ,aAAa,WAAW,IAAI,QAAkB,WAAW,IAAI,WAAqB,YAAY,IAAI,SAAmB,WAAW,IAAI,SAAmB,QAAQ,cAAc,MAAM,gBAAgB,MAAM,GAAG,kBAAkB,IAAI,kBAA4B,cAAc,QAAQ,KAAK,UAAU,WAAW,UAAU,WAAW,QAAQ,EAAE,QAAQ,QAAQ,kBAAkB,OAAO,iBAA2B,GAAG,YAAY,IAAI,WAAW;AAAA,EACrrB;AAAA,EACA,MAAM,eAAe,QAAyD;AAAE,WAAO,MAAM,KAAK,QAAQ,mBAAmB,EAAE,OAAO,CAAC;AAAA,EAA+B;AAAA,EACtK,MAAM,YAAY,QAA4C,SAAyC;AAAE,WAAO,OAAO,WAAW,UAAU,OAAO,qBAAqB,KAAK,WAAW,OAAO;AAAA,EAAkB;AACnN;","names":["CredentialError","encodeBase64Url","validateCredentialHolderBinding"]}
1
+ {"version":3,"sources":["../src/credentials/interpreter.ts","../src/credentials/held-binding.ts","../src/credentials/pins.ts","../src/credentials/transport.ts"],"sourcesContent":["import {\n CredentialError,\n encodeBase64Url,\n holderBindingSigningBytes,\n validateCredentialHolderBinding,\n type CredentialFlowDescriptor,\n type CredentialProgressEvent,\n type CredentialRequirement,\n} from \"@tinycloud/sdk-core\";\nimport { assertHeldBinding } from \"./held-binding\";\nimport type { CredentialAcquisitionTransport, CredentialProofSubject, CredentialSigningAdapter, InlineCredentialProofHandler, InlineCredentialProofRequest, PrimitiveStepHandler } from \"./types\";\n\nconst delay = (ms: number, signal?: AbortSignal) => new Promise<void>((resolve, reject) => {\n const timer = setTimeout(resolve, ms);\n signal?.addEventListener(\"abort\", () => { clearTimeout(timer); reject(new DOMException(\"Aborted\", \"AbortError\")); }, { once: true });\n});\n\n/** The mailbox named by an email requirement, which the issuer delivers the code to. */\nexport function mailboxSubject(requirement: CredentialRequirement): CredentialProofSubject | undefined {\n const email = requirement.claims.email;\n return typeof email === \"string\" && email.length > 0 ? Object.freeze({ kind: \"email\" as const, value: email }) : undefined;\n}\n\n/** Finite step interpreter. Dispatch is exclusively by registered primitive and version. */\nexport async function interpretCredentialFlow(input: {\n readonly descriptor: CredentialFlowDescriptor;\n readonly requirement: CredentialRequirement;\n readonly requestId: string;\n readonly verifier: string;\n readonly holderDid: string;\n readonly descriptorDigest: string;\n readonly requirementDigest: string;\n readonly openerOrigin: string;\n /** `expiresAt` of the create response. Required for a held (account) descriptor: the signed binding must carry it. */\n readonly expiresAt?: string;\n readonly transport: CredentialAcquisitionTransport;\n readonly signing: CredentialSigningAdapter;\n /**\n * Fallback for a host-owned surface. It receives every declared proof step,\n * including primitives added by a later protocol version.\n */\n readonly proofHandler?: InlineCredentialProofHandler;\n readonly handlers?: Partial<Record<\"collect_input\" | \"mailbox_otp\", PrimitiveStepHandler>>;\n readonly signal?: AbortSignal;\n readonly onProgress?: (event: CredentialProgressEvent) => void;\n readonly onWait?: () => Promise<void>;\n /**\n * Passed only by the email-proof functions, after the per-call held opt-in was accepted. Without it an account-bound (held, EIP191)\n * descriptor is refused before the first transport call (TC-2254 A2.5).\n */\n readonly allowAccountSubject?: true;\n}): Promise<void> {\n const held = input.descriptor.subjectRelationship === \"account_is_subject\";\n if (held && input.allowAccountSubject !== true) throw new CredentialError(\"UNSUPPORTED_PROFILE\", \"The held credential profile requires an explicit opt-in\");\n const steps = new Map(input.descriptor.steps.map((step) => [step.type, step]));\n const completed = new Set<string>(); let lastTransition = \"\";\n /** The identity checks on a holder binding, and for a held request all of S11 (a). One function, called wherever a held binding is read. */\n const checkBinding = async (value: unknown) => {\n const binding = validateCredentialHolderBinding(value);\n if (binding.requestId !== input.requestId || binding.descriptorDigest !== input.descriptorDigest || binding.requirementDigest !== input.requirementDigest || binding.holderDid !== input.holderDid || binding.issuer !== input.descriptor.issuer.did || binding.issuerKid !== input.descriptor.issuer.kid || binding.profile !== input.descriptor.profile || binding.openerOrigin !== input.openerOrigin || binding.completionOrigin !== input.openerOrigin || binding.audience !== \"tinycloud://credentials\") throw new CredentialError(\"REQUEST_SUBSTITUTED\", \"Holder binding was substituted\");\n const alg = input.descriptor.holderBinding.alg;\n if (binding.type !== input.descriptor.holderBinding.domain || (alg === \"EIP191\" && !input.transport.challengeNonce)) throw new CredentialError(\"REQUEST_SUBSTITUTED\", \"Holder binding was substituted\");\n if (alg === \"EIP191\") await assertHeldBinding(binding, { descriptor: input.descriptor, requirement: input.requirement, requestId: input.requestId, descriptorDigest: input.descriptorDigest, requirementDigest: input.requirementDigest, holderDid: input.holderDid, openerOrigin: input.openerOrigin, challengeNonce: input.transport.challengeNonce!(input.requestId), serverExpiresAt: input.expiresAt });\n return binding;\n };\n /**\n * S11 (e): a held request found past the signature (a retry after a failed notice, or after a lost issue response) has no binding read in\n * this call. Read it and check it in full before R7 or R8, so (vi) and (viii) are judged against the binding of THIS call. No R6, no wallet.\n *\n * Residual risk, accepted (contract addendum A3(1), appended to A2.2): on the retry path the SDK cannot tell that the `jti` in the re-fetched\n * R5 binding is the `jti` the account signed at R6. A2.1(a) keeps no record of that `jti`, and the witness keeps no copy of the signature\n * (`OC/mod.rs:500,2416`). S11(a) therefore checks the re-fetched `jti` for format only (lowercase v4 `urn:uuid`). Checks (vi) and (viii)\n * compare the credential with the binding fetched in the same call.\n *\n * A witness that serves a different `jti` on the retry is detected only at (vi), after R7 has sent the notice, and only if it issues a `jti`\n * different from the one it served. If it issues the `jti` it served, the credential is accepted.\n *\n * This gives a compromised witness nothing it lacks as the pinned issuer. It can already issue a held credential for any account and mailbox\n * without an account signature. The held credential carries no account signature (`held_email.rs:303-317`), and no verifier relies on the\n * `jti` being account-signed (`held_presentation.rs:315-320,367`; `sdk-core/src/held-credentials/credential.ts:159,194`). Possession is proven\n * at presentation by the account's SIWE (`held_presentation.rs:351-359`).\n *\n * An honest witness serves the same binding on every R5 call (`binding_for` is deterministic, `OC/mod.rs:2657-2676`).\n */\n const ensureHeldBinding = async () => {\n if (!held || input.transport.signedBinding?.(input.requestId) !== undefined) return;\n await checkBinding(await input.transport.holderBinding(input.requestId, input.verifier, input.signal));\n };\n for (;;) {\n input.signal?.throwIfAborted();\n const state = await input.transport.state(input.requestId, input.verifier, input.signal);\n if (state.requestId !== input.requestId) throw new CredentialError(\"REQUEST_SUBSTITUTED\", \"Credential request identity changed\");\n if (state.state === \"expired\") throw new CredentialError(\"REQUEST_EXPIRED\", \"Credential request expired\", { state: state.state, correlationId: state.correlationId });\n if (state.state === \"canceled\") throw new CredentialError(\"CANCELED\", \"Credential request was canceled\", { state: state.state, correlationId: state.correlationId });\n if (state.state === \"issuer_unready\") throw new CredentialError(\"ISSUER_UNREADY\", \"Credential issuer is not ready\", { retryAfterMs: state.retryAfterMs, state: state.state, correlationId: state.correlationId });\n if (state.state === \"complete\") { await ensureHeldBinding(); return; }\n if (state.state === \"ready_to_issue\" || state.state === \"issued\") {\n await ensureHeldBinding();\n if (state.state === \"ready_to_issue\" && !completed.has(\"issue\")) { await input.transport.issue(input.requestId, input.verifier, input.signal); completed.add(\"issue\"); }\n else await (input.onWait?.() ?? delay(state.retryAfterMs ?? 50, input.signal));\n continue;\n }\n const next = state.nextStep;\n if (!next) { await (input.onWait?.() ?? delay(state.retryAfterMs ?? 50, input.signal)); continue; }\n const declared = steps.get(next.type);\n if (next.id !== next.type || !declared || declared.type !== next.type || declared.version !== next.version) throw new CredentialError(\"REQUEST_SUBSTITUTED\", \"Server selected an undeclared credential step\");\n if (completed.has(next.id) || state.transitionId === lastTransition) { await (input.onWait?.() ?? delay(state.retryAfterMs ?? 50, input.signal)); continue; }\n lastTransition = state.transitionId;\n if (next.type === \"holder_signature\") {\n input.onProgress?.({ state: \"signing\", stepId: next.id, correlationId: state.correlationId });\n const binding = await checkBinding(await input.transport.holderBinding(input.requestId, input.verifier, input.signal));\n // Held (account, EIP-191) and ticket (did:key, EdDSA) never mix: the descriptor, the binding type and the holder key agree, or nothing is signed.\n const alg = input.descriptor.holderBinding.alg;\n if ((alg === \"EIP191\") !== (input.signing.holderKey?.alg === \"EIP191\")) throw new CredentialError(\"REQUEST_SUBSTITUTED\", \"Holder binding was substituted\");\n const bytes = holderBindingSigningBytes(binding);\n let signature = await input.signing.autoSign?.(binding, bytes, input.signal);\n if (signature === undefined) {\n if (!input.signing.requestApproval) throw new CredentialError(\"SIGNATURE_REJECTED\", \"OpenKey approval is required\");\n try { signature = await input.signing.requestApproval(binding, bytes, input.signal); } catch (cause) { if (cause instanceof CredentialError) throw cause; throw new CredentialError(\"SIGNATURE_REJECTED\", \"OpenKey approval was rejected\", { cause }); }\n }\n if (!(signature instanceof Uint8Array) || signature.length === 0) throw new CredentialError(\"SIGNATURE_REJECTED\", \"OpenKey signature is invalid\");\n await input.transport.submitHolderSignature(input.requestId, input.verifier, alg === \"EIP191\" ? `0x${Array.from(signature, (byte) => byte.toString(16).padStart(2, \"0\")).join(\"\")}` : encodeBase64Url(signature), input.signal, input.signing.holderKey);\n } else {\n input.onProgress?.({ state: next.type === \"collect_input\" ? \"collecting\" : \"proving\", stepId: next.id, correlationId: state.correlationId });\n const handler = input.handlers?.[next.type];\n const inlineHandler = input.proofHandler;\n if (!handler && !inlineHandler) { await (input.onWait?.() ?? delay(state.retryAfterMs ?? 50, input.signal)); continue; }\n if (next.constraints.challengeRequired === true) await input.transport.beginStep(input.requestId, input.verifier, next.type, input.signal);\n if (handler) {\n const proof = await handler({ descriptor: input.descriptor, requirement: input.requirement, stepId: next.id, constraints: next.constraints, signal: input.signal });\n await input.transport.submitStep(input.requestId, input.verifier, next.id, proof, input.signal);\n } else {\n let feedback: InlineCredentialProofRequest[\"feedback\"];\n // A mistyped code is re-entered against the same challenge; the issuer\n // counts every attempt and reports when the bounded budget is spent.\n for (let attempt = 1; ; attempt += 1) {\n const proof = await inlineHandler!({\n stepId: next.id,\n constraints: next.constraints,\n display: {\n title: input.descriptor.display.title,\n description: input.descriptor.display.description,\n consent: input.descriptor.display.consent,\n progressLabel: input.descriptor.accessibility.progressLabel,\n errorLiveRegion: input.descriptor.accessibility.errorLiveRegion,\n },\n inputs: input.descriptor.inputs.map(({ id, label, schema }) => ({ id, label, schema })),\n ...(feedback === undefined ? {} : { feedback }),\n signal: input.signal,\n });\n try {\n await input.transport.submitStep(input.requestId, input.verifier, next.id, proof, input.signal);\n break;\n } catch (cause) {\n if (!(cause instanceof CredentialError) || cause.code !== \"PROOF_REJECTED\") throw cause;\n const attemptsRemaining = input.descriptor.lifecycle.maxProofAttempts - attempt;\n // Once this view stops re-prompting, the rejection is final: a\n // host must not silently start a new acquisition on its behalf.\n if (next.type !== \"mailbox_otp\" || attemptsRemaining <= 0) throw new CredentialError(\"VERIFICATION_FAILED\", \"The proof was not accepted\", { state: attemptsRemaining <= 0 ? \"proof_attempts_exhausted\" : \"proof_rejected\", cause });\n feedback = { kind: \"rejected\", attemptsRemaining };\n }\n }\n }\n }\n completed.add(next.id);\n }\n}\n","import { canonicalDigest, CredentialError, type CredentialFlowDescriptor, type CredentialHolderBinding, type CredentialRequirement } from \"@tinycloud/sdk-core\";\nimport { HELD_ACCOUNT_BINDING_PINS as PINS } from \"./pins\";\n\n/** The witness's request window: the signed binding runs from request creation to creation + 600 s. */\nconst REQUEST_TTL_MS = 600_000;\n\n/** What the SDK itself computed for this request. The witness's binding must equal all of it before the wallet is called. */\nexport interface HeldBindingExpectation {\n readonly descriptor: CredentialFlowDescriptor;\n readonly requirement: CredentialRequirement;\n readonly requestId: string;\n readonly descriptorDigest: string;\n readonly requirementDigest: string;\n readonly holderDid: string;\n readonly openerOrigin: string;\n /** The nonce this client's transport stored from the challenge, or undefined if none was stored. */\n readonly challengeNonce: string | undefined;\n /** `expiresAt` of the R1 create response (ISO), or undefined if none was kept. */\n readonly serverExpiresAt: string | undefined;\n}\n\nconst substituted = (): CredentialError => new CredentialError(\"REQUEST_SUBSTITUTED\", \"Holder binding was substituted\");\n\n/**\n * Refuses (REQUEST_SUBSTITUTED) unless the held account binding is exactly what this client asked for: the domain comes from the\n * pinned descriptor, never from the response. The field shape, `protocol`, `profileVersion`, the 365-day lifetime and the `urn:uuid`\n * `jti` were already checked by `validateCredentialHolderBinding`. The `jti` itself cannot be known in advance (on the retry path: format only;\n * see the residual risk above `ensureHeldBinding` in the interpreter); it is kept by the caller and compared with the credential's after issuance.\n */\nexport async function assertHeldBinding(binding: CredentialHolderBinding, expected: HeldBindingExpectation): Promise<void> {\n const { descriptor } = expected;\n if (\n descriptor.holderBinding.alg !== \"EIP191\" ||\n binding.type !== descriptor.holderBinding.domain ||\n binding.requestId !== expected.requestId ||\n binding.descriptorDigest !== expected.descriptorDigest ||\n binding.requirementDigest !== expected.requirementDigest ||\n binding.holderDid !== expected.holderDid ||\n binding.issuer !== descriptor.issuer.did ||\n binding.issuerKid !== descriptor.issuer.kid ||\n binding.profile !== descriptor.profile ||\n binding.openerOrigin !== expected.openerOrigin ||\n binding.completionOrigin !== expected.openerOrigin ||\n binding.audience !== PINS.audience ||\n binding.completionContext !== PINS.completionContext ||\n // The static fields, against the one frozen object the request body and the account signer also use (A2.4).\n binding.type !== PINS.type || binding.protocol !== PINS.protocol || binding.profile !== PINS.profile || binding.profileVersion !== PINS.profileVersion ||\n binding.descriptorDigest !== PINS.descriptorDigest || binding.issuer !== PINS.issuer || binding.issuerKid !== PINS.issuerKid ||\n binding.openerOrigin !== PINS.openerOrigin || binding.completionOrigin !== PINS.completionOrigin || binding.credentialLifetimeSeconds !== PINS.credentialLifetimeSeconds\n ) throw substituted();\n if (expected.challengeNonce === undefined || binding.challengeNonce !== expected.challengeNonce) throw substituted();\n if (binding.normalizedClaimsDigest !== await canonicalDigest(expected.requirement.claims)) throw substituted();\n const expires = Date.parse(binding.expiresAt);\n if (expected.serverExpiresAt === undefined || expires !== Date.parse(expected.serverExpiresAt) || Date.parse(binding.issuedAt) !== expires - REQUEST_TTL_MS) throw substituted();\n}\n","import { ACCOUNT_HOLDER_BINDING_DOMAIN } from \"@tinycloud/sdk-core\";\n\n/** Production pins. Credentials verify only against these values. Tests pin them literally. */\nexport const EMAIL_PROOF_PINS = Object.freeze({\n witnessOrigin: \"https://witness.credentials.org\",\n issuerDid: \"did:web:issuer.credentials.org\",\n issuerKid: \"did:web:issuer.credentials.org#controller\",\n issuerX: \"eEJI4xEobto4HtQ7Pg9R1vBOwcpfGRTlXDG5QfqLnGQ\",\n descriptorDigest: \"1tg-qphmKBVtNwzVg9xyz-xxqt_xtMXAsQyXw46m8S0\",\n} as const);\n\n/**\n * The static fields of the held account binding (contract A2.4). One frozen object: the create request body, the binding checks\n * the SDK runs on the witness's binding (S11 (a)) and the account signer's guard all read these values, so the three cannot drift.\n * The per-request fields (`requestId`, `challengeNonce`, the digests of the request, `jti`, `issuedAt`, `expiresAt`) and the\n * signer's own `holderDid` are not static and are not here.\n */\nexport const HELD_ACCOUNT_BINDING_PINS = Object.freeze({\n type: ACCOUNT_HOLDER_BINDING_DOMAIN,\n protocol: \"tinycloud.credentials/acquisition/v1\",\n profile: \"tinycloud.email-held/v1\",\n profileVersion: 1,\n descriptorDigest: \"dc3_DuvzipXwYkTfjKqTaK1c3VS0YSPnaBsYSQriC0w\",\n issuer: EMAIL_PROOF_PINS.issuerDid,\n issuerKid: EMAIL_PROOF_PINS.issuerKid,\n audience: \"tinycloud://credentials\",\n openerOrigin: \"https://localhost\",\n completionOrigin: \"https://localhost\",\n completionContext: \"sdk-acquisition\",\n credentialLifetimeSeconds: 31_536_000,\n} as const);\n","import {\n CredentialError, canonicalDigest, credentialEndpointPath, decodeBase64Url, encodeBase64Url,\n holderBindingCanonicalBytes, sha256Base64Url, validateCredentialHolderBinding,\n type CredentialFlowDescriptor, type CredentialHolderBinding, type CredentialIssuerMetadata,\n type CredentialRequirement, type IssuedCredentialEnvelope,\n} from \"@tinycloud/sdk-core\";\nimport { HELD_ACCOUNT_BINDING_PINS } from \"./pins\";\nimport type { CredentialAcquisitionTransport, CredentialRequestState, HolderSignatureKey, PrimitiveStepResult } from \"./types\";\n\nfunction object(value: unknown, label: string): Record<string, unknown> { if (typeof value !== \"object\" || value === null || Array.isArray(value)) throw new CredentialError(\"VERIFICATION_FAILED\", `${label} is invalid`); return value as Record<string, unknown>; }\nfunction opaque(value: unknown, label: string): string { if (typeof value !== \"string\" || !/^[A-Za-z0-9_-]{16,128}$/.test(value)) throw new CredentialError(\"REQUEST_SUBSTITUTED\", `${label} is invalid`); return value; }\nfunction timestamp(value: unknown, label: string): string { if (typeof value !== \"string\" || !Number.isFinite(Date.parse(value))) throw new CredentialError(\"VERIFICATION_FAILED\", `${label} is invalid`); return new Date(value).toISOString(); }\nfunction jwtPayload(credential: string): Record<string, unknown> { const part = credential.split(\"~\", 1)[0]?.split(\".\")[1]; if (!part) throw new CredentialError(\"VERIFICATION_FAILED\", \"Issued SD-JWT is invalid\"); try { return object(JSON.parse(new TextDecoder().decode(decodeBase64Url(part))), \"SD-JWT payload\"); } catch (cause) { if (cause instanceof CredentialError) throw cause; throw new CredentialError(\"VERIFICATION_FAILED\", \"Issued SD-JWT is invalid\", { cause }); } }\nconst SERVER_CODES = new Set([\"REQUEST_EXPIRED\", \"ISSUER_UNREADY\", \"UNSUPPORTED_PROFILE\", \"UNSUPPORTED_VERSION\", \"SIGNATURE_REJECTED\"] as const);\nfunction serverError(value: unknown, response: Response, honorServerRecoverable: boolean): CredentialError | undefined {\n if (typeof value !== \"object\" || value === null || Array.isArray(value)) return undefined;\n const body = value as Record<string, unknown>;\n const keys = Object.keys(body).sort();\n if (keys.join(\",\") !== \"code,correlationId,recoverable,state,type\" || body.type !== \"tinycloud.credentials/error/v1\" || typeof body.code !== \"string\" || typeof body.recoverable !== \"boolean\" || typeof body.state !== \"string\" || typeof body.correlationId !== \"string\") return undefined;\n // A rejected proof is retryable only while the issuer still has attempts\n // left for this challenge; once exhausted the acquisition cannot finish.\n if (body.code === \"PROOF_REJECTED\") return body.recoverable\n ? new CredentialError(\"PROOF_REJECTED\", \"The proof was not accepted\", { state: body.state, correlationId: body.correlationId })\n : new CredentialError(\"VERIFICATION_FAILED\", \"The proof attempt limit was reached\", { state: \"proof_attempts_exhausted\", correlationId: body.correlationId });\n if (body.code === \"RATE_LIMITED\") return new CredentialError(\"ISSUER_UNREADY\", \"Too many verification codes were requested\", { state: \"rate_limited\", correlationId: body.correlationId, retryAfterMs: Number(response.headers.get(\"retry-after\")) * 1000 || undefined, recoverable: honorServerRecoverable ? body.recoverable : undefined });\n if (body.code === \"CHALLENGE_EXPIRED\") return new CredentialError(\"REQUEST_EXPIRED\", \"The credential challenge expired\", { state: body.state, correlationId: body.correlationId, recoverable: honorServerRecoverable ? body.recoverable : undefined });\n // The witness changed its descriptor between the catalog read and the create: the pinned profile is no longer offered.\n if (body.code === \"DESCRIPTOR_MISMATCH\") body.code = \"UNSUPPORTED_PROFILE\";\n if (!SERVER_CODES.has(body.code as any)) return undefined;\n const code = body.code as \"REQUEST_EXPIRED\" | \"ISSUER_UNREADY\" | \"UNSUPPORTED_PROFILE\" | \"UNSUPPORTED_VERSION\" | \"SIGNATURE_REJECTED\";\n return new CredentialError(code, `OpenCredentials rejected the request: ${code}`, {\n state: body.state,\n correlationId: body.correlationId,\n retryAfterMs: Number(response.headers.get(\"retry-after\")) * 1000 || undefined,\n recoverable: honorServerRecoverable ? body.recoverable : undefined,\n });\n}\n\nexport class OpenCredentialsHttpTransport implements CredentialAcquisitionTransport {\n private readonly nonces = new Map<string, string>();\n private readonly bindings = new Map<string, CredentialHolderBinding>();\n /**\n * `allowAccountSubject` is passed only by the email-proof functions, after the per-call held opt-in was accepted. Without it an account-bound\n * (held) descriptor is refused here, before any request (TC-2254 A2.5).\n */\n constructor(private readonly descriptor: CredentialFlowDescriptor, private readonly fetchFn: typeof fetch = globalThis.fetch.bind(globalThis), private readonly options: { readonly honorServerRecoverable?: boolean; readonly allowAccountSubject?: true } = {}) {\n if (descriptor.subjectRelationship === \"account_is_subject\" && options.allowAccountSubject !== true) throw new CredentialError(\"UNSUPPORTED_PROFILE\", \"The held credential profile requires an explicit opt-in\");\n }\n private url(endpoint: Parameters<typeof credentialEndpointPath>[0], id?: string): string { return new URL(credentialEndpointPath(endpoint, id), this.descriptor.issuer.origin).href; }\n private async request(endpoint: Parameters<typeof credentialEndpointPath>[0], input: { readonly id?: string; readonly method?: \"GET\" | \"POST\"; readonly verifier?: string; readonly body?: unknown; readonly signal?: AbortSignal }): Promise<unknown> {\n let response: Response;\n try { const init: RequestInit & { readonly cache: \"no-store\" } = { method: input.method ?? \"GET\", credentials: \"omit\", cache: \"no-store\", redirect: \"error\", referrerPolicy: \"no-referrer\", signal: input.signal, headers: { accept: \"application/json\", ...(input.body === undefined ? {} : { \"content-type\": \"application/json\" }), ...(input.verifier === undefined ? {} : { authorization: `Bearer ${input.verifier}` }) }, ...(input.body === undefined ? {} : { body: JSON.stringify(input.body) }) }; response = await this.fetchFn(this.url(endpoint, input.id), init); }\n catch (cause) { if (cause instanceof DOMException && cause.name === \"AbortError\") throw new CredentialError(\"CANCELED\", \"Credential acquisition was canceled\", { cause }); throw new CredentialError(\"OFFLINE\", \"OpenCredentials is unavailable\", { cause }); }\n if (!response.ok) {\n let parsed: unknown;\n try { parsed = await response.json(); } catch { parsed = undefined; }\n const typed = serverError(parsed, response, this.options.honorServerRecoverable === true);\n if (typed) throw typed;\n if (response.status === 410) throw new CredentialError(\"REQUEST_EXPIRED\", \"Credential request expired\");\n if (response.status === 409) throw new CredentialError(\"REQUEST_SUBSTITUTED\", \"Credential request was replayed or substituted\");\n if (response.status === 503) throw new CredentialError(\"ISSUER_UNREADY\", \"Credential issuer is not ready\", { retryAfterMs: Number(response.headers.get(\"retry-after\")) * 1000 || undefined });\n throw new CredentialError(\"VERIFICATION_FAILED\", \"OpenCredentials rejected the request\");\n }\n if (response.status === 204) return undefined; try { return await response.json(); } catch (cause) { throw new CredentialError(\"VERIFICATION_FAILED\", \"OpenCredentials response is invalid\", { cause }); }\n }\n async create(input: { descriptor: CredentialFlowDescriptor; descriptorDigest: string; requirement: CredentialRequirement; requirementDigest: string; holderDid: string; openerOrigin: string; completionVerifierChallenge: string; inputs?: Readonly<Record<string, string>>; signal?: AbortSignal }) {\n const body = object(await this.request(\"request\", { method: \"POST\", body: { protocol: input.descriptor.protocol, profile: input.descriptor.profile, profileVersion: input.descriptor.profileVersion, descriptorDigest: input.descriptorDigest, requirementDigest: input.requirementDigest, holderDid: input.holderDid, inputs: input.inputs ?? input.requirement.claims, audience: HELD_ACCOUNT_BINDING_PINS.audience, openerOrigin: input.openerOrigin, completionOrigin: input.openerOrigin, completionContext: HELD_ACCOUNT_BINDING_PINS.completionContext, completionVerifierChallenge: input.completionVerifierChallenge }, signal: input.signal }), \"create response\");\n if (body.type !== \"tinycloud.credentials/acquisition-request/v1\" || body.protocol !== input.descriptor.protocol || body.next !== \"challenge\" || body.endpoint !== \"challenge\") throw new CredentialError(\"VERIFICATION_FAILED\", \"create response is invalid\");\n const requestId = opaque(body.requestId, \"requestId\"); return { requestId, locator: requestId, expiresAt: timestamp(body.expiresAt, \"expiresAt\"), correlationId: requestId };\n }\n /** The nonce stored from R3 or R2 for this request. Held acquisition compares the signed binding with it. */\n challengeNonce(id: string): string | undefined { return this.nonces.get(id); }\n /** The binding fetched and validated for this request, as the account signed it. */\n signedBinding(id: string): CredentialHolderBinding | undefined { return this.bindings.get(id); }\n private proofStep(): \"mailbox_otp\" | \"collect_input\" { return this.descriptor.steps.some((step) => step.type === \"mailbox_otp\") ? \"mailbox_otp\" : \"collect_input\"; }\n async state(id: string, verifier: string, signal?: AbortSignal): Promise<CredentialRequestState> {\n const raw = object(await this.request(\"state\", { id, verifier, signal }), \"state response\");\n if (raw.type !== \"tinycloud.credentials/acquisition-state/v1\" || raw.requestId !== id || raw.profile !== this.descriptor.profile || raw.profileVersion !== 1) throw new CredentialError(\"REQUEST_SUBSTITUTED\", \"Credential state response is substituted\");\n const base = { type: \"OpenCredentialsAcquisitionState\" as const, version: 1 as const, requestId: id, transitionId: `${String(raw.state)}:${String(raw.resultPreviouslyRead ?? false)}`, correlationId: id };\n if (raw.state === \"challenge_required\") { const type = this.proofStep(); return { ...base, state: \"pending\", nextStep: { id: type, type, version: 1, constraints: { challengeRequired: true } } }; }\n // Held: the challenge nonce is read from R2 in every state after `challenge_required`, so a call that resumes the request (a retry after\n // a failed wallet prompt or a failed notice) has it. A missing nonce, or one that differs from the one this transport already holds, is a substitution.\n if (this.descriptor.subjectRelationship === \"account_is_subject\" && (raw.state === \"proof_required\" || raw.state === \"holder_binding_required\" || raw.state === \"holder_signature_required\" || raw.state === \"ready_to_issue\" || raw.state === \"issued\")) {\n const nonce = raw.challengeNonce;\n const prior = this.nonces.get(id);\n if (typeof nonce !== \"string\" || nonce === \"\" || (prior !== undefined && prior !== nonce)) throw new CredentialError(\"REQUEST_SUBSTITUTED\", \"Credential challenge nonce is missing or changed\");\n this.nonces.set(id, opaque(nonce, \"challengeNonce\"));\n }\n if (raw.state === \"proof_required\") { const type = this.proofStep(); if (this.descriptor.subjectRelationship !== \"account_is_subject\") this.nonces.set(id, opaque(raw.challengeNonce, \"challengeNonce\")); return { ...base, state: \"pending\", nextStep: { id: type, type, version: 1, constraints: {} } }; }\n if (raw.state === \"holder_binding_required\" || raw.state === \"holder_signature_required\") return { ...base, state: \"pending\", nextStep: { id: \"holder_signature\", type: \"holder_signature\", version: 1, constraints: {} } };\n if (raw.state === \"ready_to_issue\") return { ...base, state: \"ready_to_issue\" };\n if (raw.state === \"issued\") return { ...base, state: \"complete\" };\n throw new CredentialError(\"REQUEST_SUBSTITUTED\", \"Credential state is unsupported\");\n }\n async beginStep(id: string, verifier: string, stepId: \"collect_input\" | \"mailbox_otp\", signal?: AbortSignal): Promise<void> { const step = this.proofStep(); if (stepId !== step) throw new CredentialError(\"REQUEST_SUBSTITUTED\", \"Credential challenge step is substituted\"); const challenge = object(await this.request(\"challenge\", { id, verifier, method: \"POST\", body: { step, stepVersion: 1 }, signal }), \"challenge response\"); if (challenge.type !== \"tinycloud.credentials/challenge/v1\" || challenge.step !== step || challenge.stepVersion !== 1) throw new CredentialError(\"REQUEST_SUBSTITUTED\", \"Credential challenge is substituted\"); this.nonces.set(id, opaque(challenge.challengeNonce, \"challengeNonce\")); }\n async submitStep(id: string, verifier: string, stepId: string, proof: PrimitiveStepResult, signal?: AbortSignal): Promise<void> { const step = this.proofStep(); if (stepId !== step) throw new CredentialError(\"REQUEST_SUBSTITUTED\", \"Credential proof step is substituted\"); const nonce = this.nonces.get(id); if (!nonce) throw new CredentialError(\"REQUEST_SUBSTITUTED\", \"Credential challenge is missing\"); await this.request(\"proof\", { id, verifier, method: \"POST\", body: { step, stepVersion: 1, challengeNonce: nonce, proof }, signal }); }\n async holderBinding(id: string, verifier: string, signal?: AbortSignal): Promise<CredentialHolderBinding> { const raw = object(await this.request(\"holder_binding\", { id, verifier, signal }), \"holder binding response\"); if (raw.type !== \"tinycloud.credentials/holder-binding-request/v1\" || raw.signingDomain !== this.descriptor.holderBinding.domain || raw.alg !== this.descriptor.holderBinding.alg || typeof raw.canonical !== \"string\") throw new CredentialError(\"REQUEST_SUBSTITUTED\", \"Holder binding response is invalid\"); const binding = validateCredentialHolderBinding(raw.binding); if (binding.type !== raw.signingDomain) throw new CredentialError(\"REQUEST_SUBSTITUTED\", \"Holder binding type does not match its signing domain\"); if (encodeBase64Url(holderBindingCanonicalBytes(binding)) !== raw.canonical) throw new CredentialError(\"REQUEST_SUBSTITUTED\", \"Holder binding canonical bytes were substituted\"); this.bindings.set(id, binding); return binding; }\n async submitHolderSignature(id: string, verifier: string, signature: string, signal?: AbortSignal, key?: HolderSignatureKey): Promise<void> { const binding = this.bindings.get(id); if (!binding) throw new CredentialError(\"REQUEST_SUBSTITUTED\", \"Holder binding was not retrieved\"); if (this.descriptor.holderBinding.alg === \"EIP191\" && !key) throw new CredentialError(\"REQUEST_SUBSTITUTED\", \"An account holder must name its key and algorithm\"); const alg = key?.alg ?? \"EdDSA\"; const kid = key?.kid ?? `${binding.holderDid}#${binding.holderDid.replace(\"did:key:\", \"\")}`; await this.request(\"holder_signature\", { id, verifier, method: \"POST\", body: { alg, kid, signature }, signal }); }\n async issue(id: string, verifier: string, signal?: AbortSignal): Promise<void> { await this.request(\"issue\", { id, verifier, method: \"POST\", signal }); }\n async result(id: string, verifier: string, signal?: AbortSignal): Promise<IssuedCredentialEnvelope> {\n const raw = object(await this.request(\"result\", { id, verifier, signal }), \"result response\"); if (raw.type !== \"tinycloud.credentials/result/v1\" || raw.protocol !== this.descriptor.protocol || raw.profile !== this.descriptor.profile || raw.profileVersion !== 1 || raw.format !== \"vc+sd-jwt\" || raw.descriptorDigest !== await canonicalDigest(this.descriptor) || raw.issuer !== this.descriptor.issuer.did || raw.issuerKid !== this.descriptor.issuer.kid || typeof raw.credential !== \"string\" || await sha256Base64Url(raw.credential) !== raw.credentialDigest) throw new CredentialError(\"VERIFICATION_FAILED\", \"Issued result metadata is invalid\");\n const holder = object(raw.holderBinding, \"result holder binding\"); if (raw.subject !== holder.did || holder.signingDomain !== this.descriptor.holderBinding.domain) throw new CredentialError(\"HOLDER_MISMATCH\", \"Issued holder binding is invalid\");\n const claimsRaw = object(raw.claims, \"result claims\"); const claims: Record<string, string> = {}; for (const [name, value] of Object.entries(claimsRaw)) { if (typeof value !== \"string\") throw new CredentialError(\"VERIFICATION_FAILED\", \"Issued claims are invalid\"); claims[name] = value; }\n const validity = object(raw.validity, \"result validity\"); const payload = jwtPayload(raw.credential); if (typeof payload.jti !== \"string\") throw new CredentialError(\"VERIFICATION_FAILED\", \"Credential id is invalid\"); const issuedAt = timestamp(validity.issuedAt, \"issuedAt\"); const expiresAt = timestamp(validity.expiresAt, \"expiresAt\");\n const status = object(raw.status, \"result status\"); if (status.type !== \"none\" || status.freshnessSeconds !== this.descriptor.status.freshnessSeconds) throw new CredentialError(\"VERIFICATION_FAILED\", \"Credential status is invalid\");\n return { type: \"OpenCredentialsIssuedCredential\", version: 1, protocol: this.descriptor.protocol, profile: { id: this.descriptor.profile, version: 1 }, credentialType: { id: this.descriptor.format.vct, version: 1 }, schema: this.descriptor.format.vct, format: \"vc+sd-jwt\", issuerDid: raw.issuer as string, issuerKid: raw.issuerKid as string, subjectDid: raw.subject as string, holderDid: raw.subject as string, claims, claimsDigest: await canonicalDigest(claims), descriptorDigest: raw.descriptorDigest as string, credentialId: payload.jti, issuedAt, notBefore: issuedAt, expiresAt, status: { method: \"none\", freshnessSeconds: status.freshnessSeconds as number }, credential: raw.credential };\n }\n async issuerMetadata(signal?: AbortSignal): Promise<CredentialIssuerMetadata> { return await this.request(\"issuer_metadata\", { signal }) as CredentialIssuerMetadata; }\n async checkStatus(status: IssuedCredentialEnvelope[\"status\"], _signal?: AbortSignal): Promise<boolean> { return status.method === \"none\" && status.freshnessSeconds === this.descriptor.status.freshnessSeconds; }\n}\n"],"mappings":";AAAA;AAAA,EACE,mBAAAA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OAIK;;;ACRP,SAAS,iBAAiB,uBAAgH;;;ACA1I,SAAS,qCAAqC;AAGvC,IAAM,mBAAmB,OAAO,OAAO;AAAA,EAC5C,eAAe;AAAA,EACf,WAAW;AAAA,EACX,WAAW;AAAA,EACX,SAAS;AAAA,EACT,kBAAkB;AACpB,CAAU;AAQH,IAAM,4BAA4B,OAAO,OAAO;AAAA,EACrD,MAAM;AAAA,EACN,UAAU;AAAA,EACV,SAAS;AAAA,EACT,gBAAgB;AAAA,EAChB,kBAAkB;AAAA,EAClB,QAAQ,iBAAiB;AAAA,EACzB,WAAW,iBAAiB;AAAA,EAC5B,UAAU;AAAA,EACV,cAAc;AAAA,EACd,kBAAkB;AAAA,EAClB,mBAAmB;AAAA,EACnB,2BAA2B;AAC7B,CAAU;;;AD1BV,IAAM,iBAAiB;AAiBvB,IAAM,cAAc,MAAuB,IAAI,gBAAgB,uBAAuB,gCAAgC;AAQtH,eAAsB,kBAAkB,SAAkC,UAAiD;AACzH,QAAM,EAAE,WAAW,IAAI;AACvB,MACE,WAAW,cAAc,QAAQ,YACjC,QAAQ,SAAS,WAAW,cAAc,UAC1C,QAAQ,cAAc,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uBAAuB,0BAA0B;AAAG,UAAM,WAAW,UAAU,SAAS,UAAU,UAAU;AAAG,UAAM,YAAY,UAAU,SAAS,WAAW,WAAW;AAC/U,UAAM,SAAS,OAAO,IAAI,QAAQ,eAAe;AAAG,QAAI,OAAO,SAAS,UAAU,OAAO,qBAAqB,KAAK,WAAW,OAAO,iBAAkB,OAAM,IAAIA,iBAAgB,uBAAuB,8BAA8B;AACtO,WAAO,EAAE,MAAM,mCAAmC,SAAS,GAAG,UAAU,KAAK,WAAW,UAAU,SAAS,EAAE,IAAI,KAAK,WAAW,SAAS,SAAS,EAAE,GAAG,gBAAgB,EAAE,IAAI,KAAK,WAAW,OAAO,KAAK,SAAS,EAAE,GAAG,QAAQ,KAAK,WAAW,OAAO,KAAK,QAAQ,aAAa,WAAW,IAAI,QAAkB,WAAW,IAAI,WAAqB,YAAY,IAAI,SAAmB,WAAW,IAAI,SAAmB,QAAQ,cAAc,MAAMG,iBAAgB,MAAM,GAAG,kBAAkB,IAAI,kBAA4B,cAAc,QAAQ,KAAK,UAAU,WAAW,UAAU,WAAW,QAAQ,EAAE,QAAQ,QAAQ,kBAAkB,OAAO,iBAA2B,GAAG,YAAY,IAAI,WAAW;AAAA,EACrrB;AAAA,EACA,MAAM,eAAe,QAAyD;AAAE,WAAO,MAAM,KAAK,QAAQ,mBAAmB,EAAE,OAAO,CAAC;AAAA,EAA+B;AAAA,EACtK,MAAM,YAAY,QAA4C,SAAyC;AAAE,WAAO,OAAO,WAAW,UAAU,OAAO,qBAAqB,KAAK,WAAW,OAAO;AAAA,EAAkB;AACnN;","names":["CredentialError","CredentialError","CredentialError","canonicalDigest","encodeBase64Url","validateCredentialHolderBinding","CredentialError","validateCredentialHolderBinding","encodeBase64Url","canonicalDigest"]}