@seams/wallet-server 0.11.0 → 0.13.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/artifact-manifest.json +32 -27
- package/cloudflare-router-ab/build/deriver-a/build-stamp.json +1 -1
- package/cloudflare-router-ab/build/deriver-a/index_bg.wasm +0 -0
- package/cloudflare-router-ab/build/deriver-b/build-stamp.json +1 -1
- package/cloudflare-router-ab/build/deriver-b/index_bg.wasm +0 -0
- package/cloudflare-router-ab/build/router/build-stamp.json +1 -1
- package/cloudflare-router-ab/build/router/index_bg.wasm +0 -0
- package/cloudflare-router-ab/build/signing-worker/build-stamp.json +1 -1
- package/cloudflare-router-ab/build/signing-worker/index.js +2 -2
- package/cloudflare-router-ab/build/signing-worker/index_bg.wasm +0 -0
- package/cloudflare-router-ab/build/tenant-root-control-plane/build-stamp.json +1 -1
- package/cloudflare-router-ab/build/tenant-root-control-plane/index.js +2 -2
- package/cloudflare-router-ab/build/tenant-root-control-plane/index_bg.wasm +0 -0
- package/cloudflare-router-ab/scripts/start-local-role-workers.mjs +3 -0
- package/cloudflare-router-ab/scripts/start-local-wallet-system.mjs +3 -0
- package/dist/esm/cloud-host.js +2 -3
- package/dist/esm/core/ThresholdService/kv.js +1 -218
- package/dist/esm/index.js +3 -3
- package/dist/esm/local-hosted-wallet-gateway-worker.js +4 -2
- package/dist/esm/localHostedWalletGatewayHandler.js +20 -7
- package/dist/esm/router/cloudflare/d1/registration/d1WalletExecutionAuthority.js +109 -14
- package/dist/esm/router/cloudflare/d1/registration/d1WalletRegistrationService.js +16 -2
- package/dist/esm/router/cloudflare/d1/registration/walletRegistrationEstablishedSessionIssuer.js +7 -12
- package/dist/esm/router/cloudflare-adaptor.js +1 -2
- package/dist/esm/router/cloudflare.js +2 -86
- package/dist/esm/router/domains/walletRegistration/walletRegistrationRoutes.js +1 -1
- package/dist/esm/threshold/session/signingSessionSeal/guards/backends.js +2 -98
- package/dist/esm/threshold/session/signingSessionSeal/idempotencyBackends.js +2 -69
- package/dist/esm/threshold/session/signingSessionSeal/index.js +3 -3
- package/dist/types/wallet-server/src/cloud-host.d.ts +1 -1
- package/dist/types/wallet-server/src/core/ThresholdService/kv.d.ts +0 -29
- package/dist/types/wallet-server/src/localHostedWalletGatewayHandler.d.ts +2 -0
- package/dist/types/wallet-server/src/router/cloudflare/d1/registration/d1WalletExecutionAuthority.d.ts +22 -2
- package/dist/types/wallet-server/src/router/cloudflare/d1/registration/d1WalletRegistrationService.d.ts +1 -1
- package/dist/types/wallet-server/src/router/cloudflare/d1/registration/walletRegistrationEstablishedSessionIssuer.d.ts +1 -1
- package/dist/types/wallet-server/src/router/cloudflare-adaptor.d.ts +0 -2
- package/dist/types/wallet-server/src/router/domains/walletRegistration/walletRegistrationReservation.d.ts +13 -18
- package/dist/types/wallet-server/src/router/framework/authServicePort.d.ts +1 -1
- package/dist/types/wallet-server/src/threshold/session/signingSessionSeal/guards/backends.d.ts +1 -16
- package/dist/types/wallet-server/src/threshold/session/signingSessionSeal/idempotencyBackends.d.ts +1 -16
- package/dist/types/wallet-server/src/threshold/session/signingSessionSeal/index.d.ts +4 -4
- package/migrations/d1-signer/0081_registration_directory_publications.sql +26 -0
- package/package.json +1 -1
- package/dist/esm/router/cloudflare/runtime/createSelfHostedCloudflareSigningWorker.js +0 -93
- package/dist/types/wallet-server/src/router/cloudflare/runtime/createSelfHostedCloudflareSigningWorker.d.ts +0 -23
package/dist/esm/cloud-host.js
CHANGED
|
@@ -73,7 +73,7 @@ import { createStaticWalletConsoleBindingV1, handleStaticWalletConsoleRequestV1,
|
|
|
73
73
|
import { parseWebAuthnSyncChallengeRecord } from "./router/cloudflare/d1/webauthn/d1WebAuthnRecords.js";
|
|
74
74
|
import { CloudflareD1WebAuthnStore, prepareD1WebAuthnAuthenticatorInsertStatement, prepareD1WebAuthnAuthenticatorPutStatement } from "./router/cloudflare/d1/webauthn/d1WebAuthnStore.js";
|
|
75
75
|
import { CloudflareD1WebAuthnAuthService } from "./router/cloudflare/d1/webauthn/d1WebAuthnAuthService.js";
|
|
76
|
-
import { admitD1EstablishedWalletHome } from "./router/cloudflare/d1/registration/d1WalletExecutionAuthority.js";
|
|
76
|
+
import { admitD1EstablishedWalletHome, resumeRegistrationDirectoryPublicationsV1 } from "./router/cloudflare/d1/registration/d1WalletExecutionAuthority.js";
|
|
77
77
|
import { parseLinkedDeviceSessionRecordV1 } from "./core/deviceLinking/linkedDeviceSessionRecord.js";
|
|
78
78
|
import { D1LinkedDeviceSourceContributionPreparationPlannerV1, createD1LinkedDeviceSourceContributionPreparationPlannerV1, linkedDeviceX25519RecipientPublicKeyB64uV1 } from "./router/cloudflare/d1/deviceLinking/d1LinkedDeviceSourceContributionPreparationPlanner.js";
|
|
79
79
|
import { D1LinkedDeviceAuthorityInstallServiceV1, parseInstalledEcdsaCustodySnapshotV1, readD1LinkedDeviceEcdsaSourceV1, readD1LinkedDeviceEd25519SourceV1 } from "./router/cloudflare/d1/deviceLinking/d1LinkedDeviceAuthorityInstallService.js";
|
|
@@ -87,7 +87,6 @@ import { buildRouterAbEd25519YaoAddSignerAdmissionRequestV1, buildRouterAbEd2551
|
|
|
87
87
|
import { RouterAbEd25519YaoHttpRegistrationBackend, createRouterAbEd25519YaoHttpRegistrationBackendFromEnv, parseRouterAbEd25519YaoActivationKeysetFromEnvV1, parseRouterAbEd25519YaoRegistrationRouterAnswerV1 } from "./router/domains/ed25519Yao/registration/routerAbEd25519YaoHttpRegistrationBackend.js";
|
|
88
88
|
import { StaticCloudflareTenantStorageRouteResolver, createCloudflareTenantStorageRoute, createSignerD1DoStorageTarget, createStaticCloudflareTenantStorageRouteResolver, createStaticCloudflareTenantStorageRouteResolverFromBindings, tenantStorageRouteBackendFamily, tenantStorageRouteDiagnostic } from "./storage/tenantRoute.js";
|
|
89
89
|
import { createInMemoryRouterApiRuntimeSnapshotConsumer, validateRuntimeSnapshotExpectation } from "./router/framework/runtimeSnapshotConsumer.js";
|
|
90
|
-
import { createSelfHostedCloudflareSigningRouter, createSelfHostedCloudflareSigningWorker } from "./router/cloudflare/runtime/createSelfHostedCloudflareSigningWorker.js";
|
|
91
90
|
import { CloudflareDurableObjectVersionedJsonRecordStore, CloudflareVersionedJsonRecordStoreError, createCloudflareDurableObjectVersionedJsonRecordStore } from "./router/cloudflare/durableObjects/versionedJsonRecordStore.js";
|
|
92
91
|
import { CloudflareD1VersionedJsonRecordStore, CloudflareD1VersionedJsonRecordStoreError, createCloudflareD1VersionedJsonRecordStore } from "./router/cloudflare/d1/versionedJson/d1VersionedJsonRecordStore.js";
|
|
93
92
|
import { createRouterAbEd25519YaoCeremonyStateStoreV1, encodeRouterAbEd25519YaoProductRegistrationStateV1, parseRouterAbEd25519YaoCeremonyKeyV1, parseRouterAbEd25519YaoProductRegistrationStateJsonV1, resolveRouterAbEd25519YaoCeremonyKeyFromRequestV1 } from "./router/domains/ed25519Yao/capabilityLifecycle/routerAbEd25519YaoProductRegistrationPersistence.js";
|
|
@@ -132,4 +131,4 @@ import { handleRouterAbEd25519YaoRecoveryRequestScopedCloudflareV1 } from "./rou
|
|
|
132
131
|
import { RouterAbEd25519YaoRecoveryWalletSessionAuthorizationAdapter } from "./router/domains/ed25519Yao/recovery/routerAbEd25519YaoRecoveryWalletSessionAuthorization.js";
|
|
133
132
|
import { keccak256Bytes } from "./shared-ts/src/utils/keccak.js";
|
|
134
133
|
import { decodeEvmBlockHeader, decodeEvmTransactionByHash, decodeEvmTransactionCall, decodeEvmTransactionReceipt, parseRpcHexQuantity } from "./shared-ts/src/utils/evmRpcResults.js";
|
|
135
|
-
export { API_CREDENTIAL_ROUTE_SCOPES, API_CREDENTIAL_TYPES, ActionType, CLOUDFLARE_ROUTER_ED25519_YAO_SOURCE_PRESERVING_EXECUTE_PATH_V1, CLOUDFLARE_SIGNING_WORKER_ECDSA_ACTIVATE_RESERVATION_PATH_V1, CLOUDFLARE_SIGNING_WORKER_ECDSA_DEACTIVATE_RESERVATION_PATH_V1, CLOUDFLARE_SIGNING_WORKER_ECDSA_RESERVE_INACTIVE_SOURCE_PRESERVING_PATH_V1, CLOUDFLARE_SIGNING_WORKER_ED25519_YAO_ACTIVATE_RESERVATION_PATH_V1, CLOUDFLARE_SIGNING_WORKER_ED25519_YAO_DEACTIVATE_RESERVATION_PATH_V1, CloudflareD1AuthorizationStore, CloudflareD1GoogleEmailOtpRegistrationAttemptStore, CloudflareD1OidcJwksCache, CloudflareD1RouterAbEd25519YaoCapabilityPersistence, CloudflareD1RouterAbNormalSigningAdmissionStore, CloudflareD1VaultProxyStore, CloudflareD1VersionedJsonRecordStore, CloudflareD1VersionedJsonRecordStoreError, CloudflareD1WebAuthnAuthService, CloudflareD1WebAuthnStore, CloudflareDurableObjectVersionedJsonRecordStore, CloudflareOrdinaryInactiveSignerMaterialDeactivationWorkerV1, CloudflareOrdinaryInactiveSignerMaterialReservationWorkerV1, CloudflareVersionedJsonRecordStoreError, CrossSiteSessionCookieAdapter, D1IdentityStore, D1LinkedDeviceAuthorityInstallServiceV1, D1LinkedDeviceEd25519ExportRootStoreV1, D1LinkedDeviceRequestProofNonceStoreV1, D1LinkedDeviceSessionStoreV1, D1LinkedDeviceSourceContributionPreparationPlannerV1, D1LinkedDeviceTargetAuthenticatorStoreV1, D1LinkedDeviceTargetCredentialProviderV1, D1LinkedDeviceTargetPlannerV1, D1WalletAuthMethodStore, D1WalletObjectAddresses, D1WalletStore, D1_BATCH_CAS_GUARD_SQL, DEFAULT_SESSION_COOKIE_NAME, DEFAULT_WALLET_CONSOLE_SIGNED_DELEGATE_ROUTE_V1, DEFAULT_WALLET_CONSOLE_SPONSORED_EVM_CALL_ROUTE_V1, DEFAULT_WALLET_SESSION_REMAINING_USES, DEFAULT_WALLET_SESSION_TTL_MS, ED25519_SIGNER_ACTIVATION_ID_PATH, InMemoryRouterAbEd25519YaoExportService, InMemoryRouterAbEd25519YaoExportStateV1, InMemoryRouterAbEd25519YaoRegistrationIntentAuthorizationAdapter, InMemoryRouterAbEd25519YaoRegistrationService, InMemoryRouterAbNormalSigningAdmissionStore, LINKED_DEVICE_OWNER_AUTHORIZATION_PATH_V1, LinkedDeviceRetiredTargetRegistrationShapeErrorV1, LinkedDeviceSourceFamilyUnavailableErrorV1, LinkedDeviceWebAuthnRegistrationVerifierV1, LocalRegistrationSetupAuthority, MAX_WALLET_SESSION_REMAINING_USES, MAX_WALLET_SESSION_TTL_MS, PUBLIC_PROOF_TYPES, ROUTER_AB_ECDSA_DERIVATION_PRIVATE_SIGNING_PATHS, ROUTER_AB_ED25519_PRIVATE_SIGNING_PATHS, ROUTER_AB_ED25519_YAO_CAPABILITY_REPLACEMENT_TABLE_V1, ROUTER_AB_ED25519_YAO_EXPORT_ADMISSION_PATH_V1, ROUTER_AB_ED25519_YAO_EXPORT_EXECUTE_PATH_V1, ROUTER_AB_ED25519_YAO_RECOVERY_ACTIVATE_PATH_V1, ROUTER_AB_ED25519_YAO_RECOVERY_ADMISSION_PATH_V1, ROUTER_AB_ED25519_YAO_RECOVERY_EXECUTE_PATH_V1, ROUTER_AB_ED25519_YAO_RECOVERY_STATUS_PATH_V1, ROUTER_AB_ED25519_YAO_REGISTRATION_ADMISSION_PATH_V1, ROUTER_AB_ED25519_YAO_REGISTRATION_EXECUTE_PATH_V1, ROUTER_AB_ED25519_YAO_SHARED_STATE_RECORD_KEY_V1, ROUTER_AB_ED25519_YAO_WARM_RECOVERY_BOOTSTRAP_PATH_V1, ROUTER_AB_MPC_ROUTER_ORIGIN, ROUTER_AB_PUBLIC_KEYSET_PATH, ROUTER_AB_PUBLIC_KEYSET_VERSION_V2, ROUTER_AB_PUBLIC_KEYSET_WELL_KNOWN_PATH, ROUTER_AB_SIGNING_WORKER_ORIGIN, ROUTER_AB_TRACE_ID_HEADER_V1, ROUTER_API_CREDENTIAL_SCOPES, ROUTE_SERVICE_KEYS, RouterAbEcdsaPresignRuntime, RouterAbEd25519YaoExportOwnerProofAuthorizationAdapter, RouterAbEd25519YaoHttpRegistrationBackend, RouterAbEd25519YaoRecoveryWalletSessionAuthorizationAdapter, SESSION_CAS_GUARD_SQL, SessionService, StaticCloudflareTenantStorageRouteResolver, UnavailableOrdinaryInactiveSignerMaterialDeactivationWorkerV1, UnavailableOrdinaryInactiveSignerMaterialReservationWorkerV1, WALLET_AUTH_METHOD_D1_STORE, WALLET_AUTH_METHOD_STORE_D1_SCHEMA_SQL, WALLET_AUTH_METHOD_STORE_D1_SCHEMA_V2_SQL, WALLET_CONSOLE_API_WALLET_DETAIL_PREFIX_V1, WALLET_CONSOLE_OPS_BASE_PATH_V1, WALLET_CONSOLE_OP_PATHS_V1, WALLET_CONSOLE_SERVICE_ORIGIN_V1, WALLET_CONSOLE_SIGNED_DELEGATE_ROUTE_ID_V1, WALLET_CONSOLE_SPONSORED_EVM_CALL_ROUTE_ID_V1, WALLET_CONTROL_AUTH_MARKER_V1, WALLET_CONTROL_BASE_PATH_V1, WALLET_CONTROL_SERVICE_ORIGIN_V1, WALLET_RUNTIME_OPS_BASE_PATH_V1, WALLET_RUNTIME_OP_PATHS_V1, WALLET_RUNTIME_SERVICE_ORIGIN_V1, WALLET_STORE_D1_SCHEMA_SQL, WalletHomeCustodyBinding, WalletLifecycleLocator, WalletObjectAddressSnapshot, WalletPlacementRoutes, abusePrincipalKey, addSecp256k1PublicKeys33, admitD1EstablishedWalletHome, admitRouterAbEcdsaReusableWalletSessionOperation, applyRouteMetering, assertUniqueRouterApiRouteDefinitions, authenticateDeviceLinkingOwnerWalletSessionRequestV1, authenticateRouterAbEcdsaOperationStepUp, authenticateRouterAbWalletOperationStepUp, authenticateRouterAbWalletOperationStepUpIdentity, authorizeRouterAbEcdsaDerivationNormalSigningRoute, authorizeRouterAbEd25519NormalSigningRoute, base64UrlDecode, base64UrlEncode, bindWalletAuthMethodIdentity, bindWalletAuthMethodIdentityV2, buildCorsOrigins, buildRouterAbEcdsaDerivationPrivateSigningWorkerBody, buildRouterAbEcdsaOwnerOperationStepUpPreparation, buildRouterAbEd25519OwnerOperationStepUpPreparation, buildRouterAbEd25519PrivateSigningWorkerBody, buildRouterAbEd25519YaoAddSignerAdmissionRequestV1, buildRouterAbEd25519YaoProductAdmissionRequestV1, buildTenantRootIdentityFromAuthenticatedDeploymentV1, buildVerifiedLinkInputV1, buildVerifiedTargetFactorV1, buildWalletEcdsaSignerRecord, claimRouterAbEcdsaOperationStepUp, coerceLogger, coerceRouterLogger, completeRouterAbEcdsaOperation, computeEip1559TxHash, computeLinkedDeviceSessionClaimDigestV1, computeRouterAbEd25519NormalSigningAdmissionMaterial, computeVerifiedTargetFactorVerificationDigestV1, createCloudflareD1RouterAbNormalSigningAdmissionStore, createCloudflareD1RouterApiAuthService, createCloudflareD1VersionedJsonRecordStore, createCloudflareDurableObjectVersionedJsonRecordStore, createCloudflareLinkedDeviceEd25519SourcePreservingRouterEndpointV1, createCloudflareOrdinaryInactiveSignerMaterialActivationEndpointV1, createCloudflareOrdinaryInactiveSignerMaterialActivationPortV1, createCloudflareOrdinaryInactiveSignerMaterialDeactivationEndpointV1, createCloudflareOrdinaryInactiveSignerMaterialDeactivationPortV1, createCloudflareOrdinaryInactiveSignerMaterialReservationEndpointV1, createCloudflareOrdinaryInactiveSignerMaterialReservationServiceV1, createCloudflareRouter, createCloudflareTenantStorageRoute, createCloudflareWalletGatewayRouterV1, createD1LinkedDeviceOwnerAuthorizationMetadataSourceV1, createD1LinkedDeviceOwnerAuthorizationProviderV1, createD1LinkedDeviceOwnerSourceChildReaderV1, createD1LinkedDeviceRouteServiceV1, createD1LinkedDeviceSessionServiceV1, createD1LinkedDeviceSourceContributionPreparationPlannerV1, createD1LinkedDeviceVerifiedLinkSourceReaderV1, createDeviceLinkingOwnerRequestAuthenticatorV1, createEd25519SessionAdapter, createInMemoryRouterAbNormalSigningAdmissionAdapter, createInMemoryRouterAbNormalSigningAdmissionStore, createInMemoryRouterApiRuntimeSnapshotConsumer, createRouterAbEcdsaEd25519CeremonyTokenIssuer, createRouterAbEcdsaStrictPostRegistrationPort, createRouterAbEcdsaStrictRegistrationPort, createRouterAbEd25519YaoCeremonyStateStoreV1, createRouterAbEd25519YaoExportModule, createRouterAbEd25519YaoHttpRegistrationBackendFromEnv, createRouterAbEd25519YaoMaterialActivationRefV1, createRouterAbEd25519YaoProductRegistrationCompositionFromPortsV1, createRouterAbEd25519YaoProductRegistrationPartitionedStateStoreFromD1V1, createRouterAbEd25519YaoProductRegistrationPartitionedStateStoreV1, createRouterAbEd25519YaoProductRegistrationRequestScopedRuntimeV1, createRouterAbEd25519YaoProductRegistrationRuntimeV1, createRouterAbEd25519YaoProductRegistrationStateFromPartsV1, createRouterAbEd25519YaoProductRegistrationStateV1, createRouterAbEd25519YaoRegistrationModule, createRouterAbNormalSigningAdmissionAdapter, createRouterAbServiceBindingFetch, createRouterApiModule, createRouterApiRouteDefinitions, createSelfHostedCloudflareSigningRouter, createSelfHostedCloudflareSigningWorker, createSignerD1DoStorageTarget, createSigningSessionSealOptions, createStaticCloudflareTenantStorageRouteResolver, createStaticCloudflareTenantStorageRouteResolverFromBindings, createStaticWalletConsoleBindingV1, createUnavailableOrdinaryInactiveSignerMaterialDeactivationPortV1, createUnavailableOrdinaryInactiveSignerMaterialReservationWorkerV1, createWalletConsoleOpsClient, createWalletConsoleRelayProxyExtensionV1, createWalletControlClientBindings, createWalletRegistrationContextResolver, createWalletRuntimeOpsHandler, d1ChangedRows, d1Integer, d1Number, decideRouterAbEcdsaOwnerOperationAuthorization, decideRouterAbEd25519OwnerOperationAuthorization, decodeEvmBlockHeader, decodeEvmTransactionByHash, decodeEvmTransactionCall, decodeEvmTransactionReceipt, decodeJsonRpcEnvelope, decodeWalletConsoleTenantRootActiveLineageRequestV1, decodeWalletConsoleTenantRootActiveLineageResponseV1, defineRoute, defineRouteExtension, deriveJwtExpiresAtIso, deriveRecoveryCodeLocatorV1FromBytes, digestOpaqueValue, encodeEip1559SignedTxFromSignature65, encodeRouterAbEd25519YaoProductRegistrationPartitionRecordV1, encodeRouterAbEd25519YaoProductRegistrationStateV1, encodeSessionJsonSegment, encodeTenantRootIdentityV1, enforceDelegatePolicy, enforceRoutePolicy, ensureEvmCryptoWasm, ensureLeadingSlash, ensureWalletAuthMethodStoreD1Schema, ensureWalletStoreD1Schema, evaluateRouterAbNormalSigningAdmission, executeRouterAbEd25519YaoAdmittedRegistrationV1, executeSignedDelegateWithRelayer, extractBearerCredential, extractRouterApiEnvironmentId, findRouteDefinitionById, findRouteDefinitionForRequest, formatD1ExecStatement, getRouterApiRouteExtensionDefinitions, getRouterApiRouteExtensionRoutes, getRouterApiRouteExtensionsForTransport, handleRouterAbEcdsaDerivationNormalSigningRouteCore, handleRouterAbEd25519YaoExportRequestScopedCloudflareV1, handleRouterAbEd25519YaoRecoveryRequestScopedCloudflareV1, handleRouterAbEd25519YaoRegistrationRequestScopedCloudflareV1, handleStaticWalletConsoleRequestV1, handleWalletControlRequest, headersToRecord, isD1DatabaseLike, isObject, isPlainObject, json, jsonFailure, keccak256Bytes, linkedDeviceSignerManifestsEqualV1, linkedDeviceX25519RecipientPublicKeyB64uV1, loadCloudflareSignerWasmModule, matchesRouteDefinitionRequest, mergeRouterAbEd25519YaoProductRegistrationStatePartitionV1, mintRouterAbEd25519YaoRegistrationIdentityV1, normalizeBoundedPositiveInteger, normalizeCorsOrigin, normalizeD1RouterApiAuthOptions, normalizeHashToBytes, normalizeLinkedDevicePasskeyTargetConfigurationV1, normalizeLogger, normalizeLowercaseString, normalizeSessionString, normalizeSessionTtlSeconds, normalizeSourceIp, normalizeTrimmedString, normalizeWalletAuthMethod, normalizeWalletAuthMethodV2, parseBooleanFlag, parseBooleanJwtClaim, parseCacheControlMaxAgeSec, parseCsvList, parseD1JsonArrayColumn, parseD1JsonColumn, parseD1JsonObjectColumn, parseD1LinkedDeviceSessionRowV1, parseD1LinkedDeviceSessionTranscriptRowV1, parseGoogleEmailOtpRegistrationAttemptRecord, parseGoogleEmailOtpRegistrationOfferCandidates, parseGoogleJwks, parseGoogleLoginVerifyRequest, parseInstalledEcdsaCustodySnapshotV1, parseJwtAud, parseLinkedDeviceSessionRecordV1, parseOrgId, parseRecoveryCodeLocatorV1, parseRouterAbEcdsaEd25519PrivateJwk, parseRouterAbEcdsaPresignRuntimeConfig, parseRouterAbEcdsaStrictRegistrationTopology, parseRouterAbEd25519NormalSigningScopeV2, parseRouterAbEd25519OperationStepUpScope, parseRouterAbEd25519YaoActivationKeysetFromEnvV1, parseRouterAbEd25519YaoCeremonyKeyV1, parseRouterAbEd25519YaoExportAdmissionEnvelopeV1, parseRouterAbEd25519YaoExportExecuteEnvelopeV1, parseRouterAbEd25519YaoProductRegistrationPartitionRecordJsonV1, parseRouterAbEd25519YaoProductRegistrationPartitionRecordV1, parseRouterAbEd25519YaoProductRegistrationStateJsonV1, parseRouterAbEd25519YaoProductRegistrationStateV1, parseRouterAbEd25519YaoRegistrationAdmissionReadV1, parseRouterAbEd25519YaoRegistrationRouterAnswerV1, parseRouterAbEd25519YaoTenantRootWireV1, parseRouterAbOperationStepUpOperation, parseRouterAbPublicKeysetV2, parseRpcHexQuantity, parseRs256JwtForVerification, parseSessionJwt, parseSigningSessionSealRootConfig, parseStaticWalletConsoleBindingConfigV1, parseStoredRouterAbEcdsaPendingActivationV1, parseWalletEd25519SignerRecord, parseWalletId, parseWalletRecoveryOperationId, parseWalletRegistrationContextResponse, parseWalletRegistrationSetupRequest, parseWalletRegistrationSetupReservation, parseWalletRuntimeExecuteSignedDelegateRequest, parseWalletRuntimeExecuteSignedDelegateResponse, parseWalletRuntimeExecuteSignedDelegateResult, parseWalletRuntimeRelayerAccount, parseWalletRuntimeWalletIdentitiesResult, parseWalletRuntimeWalletIdentityRequest, parseWebAuthnRpId, parseWebAuthnSyncChallengeRecord, partitionRouterAbEd25519YaoProductRegistrationStateV1, postRouterAbSigningWorkerJson, prepareD1TenantStatement, prepareD1WalletAuthMethodInsertStatement, prepareD1WalletAuthMethodPutStatement, prepareD1WalletAuthMethodV2PutStatement, prepareD1WalletPutSignerStatement, prepareD1WalletPutSubjectStatement, prepareD1WebAuthnAuthenticatorInsertStatement, prepareD1WebAuthnAuthenticatorPutStatement, projectRouterAbEd25519YaoExactWalletSession, proposeWalletRegistrationSetup, publishableKeyRoutePrincipal, queryD1All, queryD1One, randomTenantRootCreationGrantBytesV1, readD1LinkedDeviceEcdsaSourceV1, readD1LinkedDeviceEd25519SourceV1, readEnvironmentCsv, readEnvironmentString, readJson, registrationPreparationIdFromString, requireD1RouterApiAuthScopeString, requireEnvironmentString, requireNormalizedSessionString, requireRuntimePolicyScope, resolveFreshRouterAbEcdsaMaterialActivation, resolvePublishableKeyApiCredentialAuth, resolveRequestOriginRateLimitKeyFromFetchHeaders, resolveRouterAbEd25519YaoCeremonyKeyFromRequestV1, resolveRuntimeTenantRootLineage, resolveSecretKeyApiCredentialAuth, resolveSourceIpFromFetchHeaders, resolveWalletRegistrationContext, routeError, routeJson, routerAbEcdsaAtomicAuthorizationConfigured, routerAbEcdsaOperationInProgressResult, routerAbEcdsaOwnerOperationFailureResult, routerAbEcdsaRecordedResponse, routerAbEcdsaReplayHttpResponse, routerAbEcdsaReplayResult, routerAbEcdsaReplayUnavailableResult, routerAbEcdsaStrictRegistrationFactsBindingJson, routerAbEcdsaStrictRegistrationRequestBindingJson, routerAbEcdsaStrictRegistrationRequestMatchesFacts, routerAbEd25519OwnerOperationFailureResult, routerAbEd25519YaoAdmittedRegistrationAuthorityV1, routerAbEd25519YaoPartitionedStateAfterStoredCommitV1, routerAbEd25519YaoPersistedCapabilityMatchesLookupV1, routerAbEd25519YaoRegistrationExecutionTimingEntriesV1, routerAbEd25519YaoRegistrationSigningRootIdV1, routerAbEd25519YaoTenantRootWireV1, runRouterAbEd25519YaoProductRegistrationRequestScopedV1, runRouterAbEd25519YaoRegistrationSideEffectV1, runRouterAbEd25519YaoRegistrationTwoPhaseV1, runRouterAbPrewarmScheduledV1, runtimePolicyScopeKey, sameRouterAbEd25519YaoSharedStateCanonicalEncodingV1, secp256k1PrivateKey32ToPublicKey33, secp256k1PublicKey33ToEthereumAddress, secureRandomBase36, secureRandomBase64Url, selectWalletEd25519Signer, sessionJwtTimeClaims, sha256Bytes, sha256BytesSync, signSecp256k1Recoverable, signTenantRootCreationGrantV1, tenantRootIdentityDigestB64uV1, tenantStorageRouteBackendFamily, tenantStorageRouteDiagnostic, toFetchRouteResponse, normalizeOptionalTrimmedString as toOptionalTrimmedString, toResponse, toSessionArrayBufferCopy, unavailableRegistrationContext, validateDelegateExpiryAndNonce, validateGoogleIdTokenClaims, validateRuntimeSnapshotExpectation, validateSecp256k1PublicKey33, verifyGoogleOidcToken, verifyRs256JwtSignature, verifySecp256k1Bip340SignatureAgainstPublicKey33, verifySecp256k1RecoverableSignatureAgainstPublicKey33, walletAuthMethodId, walletAuthMethodV2Id, walletConsoleApiWalletGetRouteDefinitionV1, walletConsoleApiWalletListRouteDefinitionV1, walletConsoleApiWalletSearchRouteDefinitionV1, walletConsoleRelayRouteDefinitionsV1, walletConsoleSignedDelegateRouteDefinitionV1, walletConsoleSponsoredEvmCallRouteDefinitionV1, walletObjectIdentity, walletRegistrationContext, walletRegistrationSetupRequestDigest, webAuthnCredentialIdB64uFromCredential, withCors };
|
|
134
|
+
export { API_CREDENTIAL_ROUTE_SCOPES, API_CREDENTIAL_TYPES, ActionType, CLOUDFLARE_ROUTER_ED25519_YAO_SOURCE_PRESERVING_EXECUTE_PATH_V1, CLOUDFLARE_SIGNING_WORKER_ECDSA_ACTIVATE_RESERVATION_PATH_V1, CLOUDFLARE_SIGNING_WORKER_ECDSA_DEACTIVATE_RESERVATION_PATH_V1, CLOUDFLARE_SIGNING_WORKER_ECDSA_RESERVE_INACTIVE_SOURCE_PRESERVING_PATH_V1, CLOUDFLARE_SIGNING_WORKER_ED25519_YAO_ACTIVATE_RESERVATION_PATH_V1, CLOUDFLARE_SIGNING_WORKER_ED25519_YAO_DEACTIVATE_RESERVATION_PATH_V1, CloudflareD1AuthorizationStore, CloudflareD1GoogleEmailOtpRegistrationAttemptStore, CloudflareD1OidcJwksCache, CloudflareD1RouterAbEd25519YaoCapabilityPersistence, CloudflareD1RouterAbNormalSigningAdmissionStore, CloudflareD1VaultProxyStore, CloudflareD1VersionedJsonRecordStore, CloudflareD1VersionedJsonRecordStoreError, CloudflareD1WebAuthnAuthService, CloudflareD1WebAuthnStore, CloudflareDurableObjectVersionedJsonRecordStore, CloudflareOrdinaryInactiveSignerMaterialDeactivationWorkerV1, CloudflareOrdinaryInactiveSignerMaterialReservationWorkerV1, CloudflareVersionedJsonRecordStoreError, CrossSiteSessionCookieAdapter, D1IdentityStore, D1LinkedDeviceAuthorityInstallServiceV1, D1LinkedDeviceEd25519ExportRootStoreV1, D1LinkedDeviceRequestProofNonceStoreV1, D1LinkedDeviceSessionStoreV1, D1LinkedDeviceSourceContributionPreparationPlannerV1, D1LinkedDeviceTargetAuthenticatorStoreV1, D1LinkedDeviceTargetCredentialProviderV1, D1LinkedDeviceTargetPlannerV1, D1WalletAuthMethodStore, D1WalletObjectAddresses, D1WalletStore, D1_BATCH_CAS_GUARD_SQL, DEFAULT_SESSION_COOKIE_NAME, DEFAULT_WALLET_CONSOLE_SIGNED_DELEGATE_ROUTE_V1, DEFAULT_WALLET_CONSOLE_SPONSORED_EVM_CALL_ROUTE_V1, DEFAULT_WALLET_SESSION_REMAINING_USES, DEFAULT_WALLET_SESSION_TTL_MS, ED25519_SIGNER_ACTIVATION_ID_PATH, InMemoryRouterAbEd25519YaoExportService, InMemoryRouterAbEd25519YaoExportStateV1, InMemoryRouterAbEd25519YaoRegistrationIntentAuthorizationAdapter, InMemoryRouterAbEd25519YaoRegistrationService, InMemoryRouterAbNormalSigningAdmissionStore, LINKED_DEVICE_OWNER_AUTHORIZATION_PATH_V1, LinkedDeviceRetiredTargetRegistrationShapeErrorV1, LinkedDeviceSourceFamilyUnavailableErrorV1, LinkedDeviceWebAuthnRegistrationVerifierV1, LocalRegistrationSetupAuthority, MAX_WALLET_SESSION_REMAINING_USES, MAX_WALLET_SESSION_TTL_MS, PUBLIC_PROOF_TYPES, ROUTER_AB_ECDSA_DERIVATION_PRIVATE_SIGNING_PATHS, ROUTER_AB_ED25519_PRIVATE_SIGNING_PATHS, ROUTER_AB_ED25519_YAO_CAPABILITY_REPLACEMENT_TABLE_V1, ROUTER_AB_ED25519_YAO_EXPORT_ADMISSION_PATH_V1, ROUTER_AB_ED25519_YAO_EXPORT_EXECUTE_PATH_V1, ROUTER_AB_ED25519_YAO_RECOVERY_ACTIVATE_PATH_V1, ROUTER_AB_ED25519_YAO_RECOVERY_ADMISSION_PATH_V1, ROUTER_AB_ED25519_YAO_RECOVERY_EXECUTE_PATH_V1, ROUTER_AB_ED25519_YAO_RECOVERY_STATUS_PATH_V1, ROUTER_AB_ED25519_YAO_REGISTRATION_ADMISSION_PATH_V1, ROUTER_AB_ED25519_YAO_REGISTRATION_EXECUTE_PATH_V1, ROUTER_AB_ED25519_YAO_SHARED_STATE_RECORD_KEY_V1, ROUTER_AB_ED25519_YAO_WARM_RECOVERY_BOOTSTRAP_PATH_V1, ROUTER_AB_MPC_ROUTER_ORIGIN, ROUTER_AB_PUBLIC_KEYSET_PATH, ROUTER_AB_PUBLIC_KEYSET_VERSION_V2, ROUTER_AB_PUBLIC_KEYSET_WELL_KNOWN_PATH, ROUTER_AB_SIGNING_WORKER_ORIGIN, ROUTER_AB_TRACE_ID_HEADER_V1, ROUTER_API_CREDENTIAL_SCOPES, ROUTE_SERVICE_KEYS, RouterAbEcdsaPresignRuntime, RouterAbEd25519YaoExportOwnerProofAuthorizationAdapter, RouterAbEd25519YaoHttpRegistrationBackend, RouterAbEd25519YaoRecoveryWalletSessionAuthorizationAdapter, SESSION_CAS_GUARD_SQL, SessionService, StaticCloudflareTenantStorageRouteResolver, UnavailableOrdinaryInactiveSignerMaterialDeactivationWorkerV1, UnavailableOrdinaryInactiveSignerMaterialReservationWorkerV1, WALLET_AUTH_METHOD_D1_STORE, WALLET_AUTH_METHOD_STORE_D1_SCHEMA_SQL, WALLET_AUTH_METHOD_STORE_D1_SCHEMA_V2_SQL, WALLET_CONSOLE_API_WALLET_DETAIL_PREFIX_V1, WALLET_CONSOLE_OPS_BASE_PATH_V1, WALLET_CONSOLE_OP_PATHS_V1, WALLET_CONSOLE_SERVICE_ORIGIN_V1, WALLET_CONSOLE_SIGNED_DELEGATE_ROUTE_ID_V1, WALLET_CONSOLE_SPONSORED_EVM_CALL_ROUTE_ID_V1, WALLET_CONTROL_AUTH_MARKER_V1, WALLET_CONTROL_BASE_PATH_V1, WALLET_CONTROL_SERVICE_ORIGIN_V1, WALLET_RUNTIME_OPS_BASE_PATH_V1, WALLET_RUNTIME_OP_PATHS_V1, WALLET_RUNTIME_SERVICE_ORIGIN_V1, WALLET_STORE_D1_SCHEMA_SQL, WalletHomeCustodyBinding, WalletLifecycleLocator, WalletObjectAddressSnapshot, WalletPlacementRoutes, abusePrincipalKey, addSecp256k1PublicKeys33, admitD1EstablishedWalletHome, admitRouterAbEcdsaReusableWalletSessionOperation, applyRouteMetering, assertUniqueRouterApiRouteDefinitions, authenticateDeviceLinkingOwnerWalletSessionRequestV1, authenticateRouterAbEcdsaOperationStepUp, authenticateRouterAbWalletOperationStepUp, authenticateRouterAbWalletOperationStepUpIdentity, authorizeRouterAbEcdsaDerivationNormalSigningRoute, authorizeRouterAbEd25519NormalSigningRoute, base64UrlDecode, base64UrlEncode, bindWalletAuthMethodIdentity, bindWalletAuthMethodIdentityV2, buildCorsOrigins, buildRouterAbEcdsaDerivationPrivateSigningWorkerBody, buildRouterAbEcdsaOwnerOperationStepUpPreparation, buildRouterAbEd25519OwnerOperationStepUpPreparation, buildRouterAbEd25519PrivateSigningWorkerBody, buildRouterAbEd25519YaoAddSignerAdmissionRequestV1, buildRouterAbEd25519YaoProductAdmissionRequestV1, buildTenantRootIdentityFromAuthenticatedDeploymentV1, buildVerifiedLinkInputV1, buildVerifiedTargetFactorV1, buildWalletEcdsaSignerRecord, claimRouterAbEcdsaOperationStepUp, coerceLogger, coerceRouterLogger, completeRouterAbEcdsaOperation, computeEip1559TxHash, computeLinkedDeviceSessionClaimDigestV1, computeRouterAbEd25519NormalSigningAdmissionMaterial, computeVerifiedTargetFactorVerificationDigestV1, createCloudflareD1RouterAbNormalSigningAdmissionStore, createCloudflareD1RouterApiAuthService, createCloudflareD1VersionedJsonRecordStore, createCloudflareDurableObjectVersionedJsonRecordStore, createCloudflareLinkedDeviceEd25519SourcePreservingRouterEndpointV1, createCloudflareOrdinaryInactiveSignerMaterialActivationEndpointV1, createCloudflareOrdinaryInactiveSignerMaterialActivationPortV1, createCloudflareOrdinaryInactiveSignerMaterialDeactivationEndpointV1, createCloudflareOrdinaryInactiveSignerMaterialDeactivationPortV1, createCloudflareOrdinaryInactiveSignerMaterialReservationEndpointV1, createCloudflareOrdinaryInactiveSignerMaterialReservationServiceV1, createCloudflareRouter, createCloudflareTenantStorageRoute, createCloudflareWalletGatewayRouterV1, createD1LinkedDeviceOwnerAuthorizationMetadataSourceV1, createD1LinkedDeviceOwnerAuthorizationProviderV1, createD1LinkedDeviceOwnerSourceChildReaderV1, createD1LinkedDeviceRouteServiceV1, createD1LinkedDeviceSessionServiceV1, createD1LinkedDeviceSourceContributionPreparationPlannerV1, createD1LinkedDeviceVerifiedLinkSourceReaderV1, createDeviceLinkingOwnerRequestAuthenticatorV1, createEd25519SessionAdapter, createInMemoryRouterAbNormalSigningAdmissionAdapter, createInMemoryRouterAbNormalSigningAdmissionStore, createInMemoryRouterApiRuntimeSnapshotConsumer, createRouterAbEcdsaEd25519CeremonyTokenIssuer, createRouterAbEcdsaStrictPostRegistrationPort, createRouterAbEcdsaStrictRegistrationPort, createRouterAbEd25519YaoCeremonyStateStoreV1, createRouterAbEd25519YaoExportModule, createRouterAbEd25519YaoHttpRegistrationBackendFromEnv, createRouterAbEd25519YaoMaterialActivationRefV1, createRouterAbEd25519YaoProductRegistrationCompositionFromPortsV1, createRouterAbEd25519YaoProductRegistrationPartitionedStateStoreFromD1V1, createRouterAbEd25519YaoProductRegistrationPartitionedStateStoreV1, createRouterAbEd25519YaoProductRegistrationRequestScopedRuntimeV1, createRouterAbEd25519YaoProductRegistrationRuntimeV1, createRouterAbEd25519YaoProductRegistrationStateFromPartsV1, createRouterAbEd25519YaoProductRegistrationStateV1, createRouterAbEd25519YaoRegistrationModule, createRouterAbNormalSigningAdmissionAdapter, createRouterAbServiceBindingFetch, createRouterApiModule, createRouterApiRouteDefinitions, createSignerD1DoStorageTarget, createSigningSessionSealOptions, createStaticCloudflareTenantStorageRouteResolver, createStaticCloudflareTenantStorageRouteResolverFromBindings, createStaticWalletConsoleBindingV1, createUnavailableOrdinaryInactiveSignerMaterialDeactivationPortV1, createUnavailableOrdinaryInactiveSignerMaterialReservationWorkerV1, createWalletConsoleOpsClient, createWalletConsoleRelayProxyExtensionV1, createWalletControlClientBindings, createWalletRegistrationContextResolver, createWalletRuntimeOpsHandler, d1ChangedRows, d1Integer, d1Number, decideRouterAbEcdsaOwnerOperationAuthorization, decideRouterAbEd25519OwnerOperationAuthorization, decodeEvmBlockHeader, decodeEvmTransactionByHash, decodeEvmTransactionCall, decodeEvmTransactionReceipt, decodeJsonRpcEnvelope, decodeWalletConsoleTenantRootActiveLineageRequestV1, decodeWalletConsoleTenantRootActiveLineageResponseV1, defineRoute, defineRouteExtension, deriveJwtExpiresAtIso, deriveRecoveryCodeLocatorV1FromBytes, digestOpaqueValue, encodeEip1559SignedTxFromSignature65, encodeRouterAbEd25519YaoProductRegistrationPartitionRecordV1, encodeRouterAbEd25519YaoProductRegistrationStateV1, encodeSessionJsonSegment, encodeTenantRootIdentityV1, enforceDelegatePolicy, enforceRoutePolicy, ensureEvmCryptoWasm, ensureLeadingSlash, ensureWalletAuthMethodStoreD1Schema, ensureWalletStoreD1Schema, evaluateRouterAbNormalSigningAdmission, executeRouterAbEd25519YaoAdmittedRegistrationV1, executeSignedDelegateWithRelayer, extractBearerCredential, extractRouterApiEnvironmentId, findRouteDefinitionById, findRouteDefinitionForRequest, formatD1ExecStatement, getRouterApiRouteExtensionDefinitions, getRouterApiRouteExtensionRoutes, getRouterApiRouteExtensionsForTransport, handleRouterAbEcdsaDerivationNormalSigningRouteCore, handleRouterAbEd25519YaoExportRequestScopedCloudflareV1, handleRouterAbEd25519YaoRecoveryRequestScopedCloudflareV1, handleRouterAbEd25519YaoRegistrationRequestScopedCloudflareV1, handleStaticWalletConsoleRequestV1, handleWalletControlRequest, headersToRecord, isD1DatabaseLike, isObject, isPlainObject, json, jsonFailure, keccak256Bytes, linkedDeviceSignerManifestsEqualV1, linkedDeviceX25519RecipientPublicKeyB64uV1, loadCloudflareSignerWasmModule, matchesRouteDefinitionRequest, mergeRouterAbEd25519YaoProductRegistrationStatePartitionV1, mintRouterAbEd25519YaoRegistrationIdentityV1, normalizeBoundedPositiveInteger, normalizeCorsOrigin, normalizeD1RouterApiAuthOptions, normalizeHashToBytes, normalizeLinkedDevicePasskeyTargetConfigurationV1, normalizeLogger, normalizeLowercaseString, normalizeSessionString, normalizeSessionTtlSeconds, normalizeSourceIp, normalizeTrimmedString, normalizeWalletAuthMethod, normalizeWalletAuthMethodV2, parseBooleanFlag, parseBooleanJwtClaim, parseCacheControlMaxAgeSec, parseCsvList, parseD1JsonArrayColumn, parseD1JsonColumn, parseD1JsonObjectColumn, parseD1LinkedDeviceSessionRowV1, parseD1LinkedDeviceSessionTranscriptRowV1, parseGoogleEmailOtpRegistrationAttemptRecord, parseGoogleEmailOtpRegistrationOfferCandidates, parseGoogleJwks, parseGoogleLoginVerifyRequest, parseInstalledEcdsaCustodySnapshotV1, parseJwtAud, parseLinkedDeviceSessionRecordV1, parseOrgId, parseRecoveryCodeLocatorV1, parseRouterAbEcdsaEd25519PrivateJwk, parseRouterAbEcdsaPresignRuntimeConfig, parseRouterAbEcdsaStrictRegistrationTopology, parseRouterAbEd25519NormalSigningScopeV2, parseRouterAbEd25519OperationStepUpScope, parseRouterAbEd25519YaoActivationKeysetFromEnvV1, parseRouterAbEd25519YaoCeremonyKeyV1, parseRouterAbEd25519YaoExportAdmissionEnvelopeV1, parseRouterAbEd25519YaoExportExecuteEnvelopeV1, parseRouterAbEd25519YaoProductRegistrationPartitionRecordJsonV1, parseRouterAbEd25519YaoProductRegistrationPartitionRecordV1, parseRouterAbEd25519YaoProductRegistrationStateJsonV1, parseRouterAbEd25519YaoProductRegistrationStateV1, parseRouterAbEd25519YaoRegistrationAdmissionReadV1, parseRouterAbEd25519YaoRegistrationRouterAnswerV1, parseRouterAbEd25519YaoTenantRootWireV1, parseRouterAbOperationStepUpOperation, parseRouterAbPublicKeysetV2, parseRpcHexQuantity, parseRs256JwtForVerification, parseSessionJwt, parseSigningSessionSealRootConfig, parseStaticWalletConsoleBindingConfigV1, parseStoredRouterAbEcdsaPendingActivationV1, parseWalletEd25519SignerRecord, parseWalletId, parseWalletRecoveryOperationId, parseWalletRegistrationContextResponse, parseWalletRegistrationSetupRequest, parseWalletRegistrationSetupReservation, parseWalletRuntimeExecuteSignedDelegateRequest, parseWalletRuntimeExecuteSignedDelegateResponse, parseWalletRuntimeExecuteSignedDelegateResult, parseWalletRuntimeRelayerAccount, parseWalletRuntimeWalletIdentitiesResult, parseWalletRuntimeWalletIdentityRequest, parseWebAuthnRpId, parseWebAuthnSyncChallengeRecord, partitionRouterAbEd25519YaoProductRegistrationStateV1, postRouterAbSigningWorkerJson, prepareD1TenantStatement, prepareD1WalletAuthMethodInsertStatement, prepareD1WalletAuthMethodPutStatement, prepareD1WalletAuthMethodV2PutStatement, prepareD1WalletPutSignerStatement, prepareD1WalletPutSubjectStatement, prepareD1WebAuthnAuthenticatorInsertStatement, prepareD1WebAuthnAuthenticatorPutStatement, projectRouterAbEd25519YaoExactWalletSession, proposeWalletRegistrationSetup, publishableKeyRoutePrincipal, queryD1All, queryD1One, randomTenantRootCreationGrantBytesV1, readD1LinkedDeviceEcdsaSourceV1, readD1LinkedDeviceEd25519SourceV1, readEnvironmentCsv, readEnvironmentString, readJson, registrationPreparationIdFromString, requireD1RouterApiAuthScopeString, requireEnvironmentString, requireNormalizedSessionString, requireRuntimePolicyScope, resolveFreshRouterAbEcdsaMaterialActivation, resolvePublishableKeyApiCredentialAuth, resolveRequestOriginRateLimitKeyFromFetchHeaders, resolveRouterAbEd25519YaoCeremonyKeyFromRequestV1, resolveRuntimeTenantRootLineage, resolveSecretKeyApiCredentialAuth, resolveSourceIpFromFetchHeaders, resolveWalletRegistrationContext, resumeRegistrationDirectoryPublicationsV1, routeError, routeJson, routerAbEcdsaAtomicAuthorizationConfigured, routerAbEcdsaOperationInProgressResult, routerAbEcdsaOwnerOperationFailureResult, routerAbEcdsaRecordedResponse, routerAbEcdsaReplayHttpResponse, routerAbEcdsaReplayResult, routerAbEcdsaReplayUnavailableResult, routerAbEcdsaStrictRegistrationFactsBindingJson, routerAbEcdsaStrictRegistrationRequestBindingJson, routerAbEcdsaStrictRegistrationRequestMatchesFacts, routerAbEd25519OwnerOperationFailureResult, routerAbEd25519YaoAdmittedRegistrationAuthorityV1, routerAbEd25519YaoPartitionedStateAfterStoredCommitV1, routerAbEd25519YaoPersistedCapabilityMatchesLookupV1, routerAbEd25519YaoRegistrationExecutionTimingEntriesV1, routerAbEd25519YaoRegistrationSigningRootIdV1, routerAbEd25519YaoTenantRootWireV1, runRouterAbEd25519YaoProductRegistrationRequestScopedV1, runRouterAbEd25519YaoRegistrationSideEffectV1, runRouterAbEd25519YaoRegistrationTwoPhaseV1, runRouterAbPrewarmScheduledV1, runtimePolicyScopeKey, sameRouterAbEd25519YaoSharedStateCanonicalEncodingV1, secp256k1PrivateKey32ToPublicKey33, secp256k1PublicKey33ToEthereumAddress, secureRandomBase36, secureRandomBase64Url, selectWalletEd25519Signer, sessionJwtTimeClaims, sha256Bytes, sha256BytesSync, signSecp256k1Recoverable, signTenantRootCreationGrantV1, tenantRootIdentityDigestB64uV1, tenantStorageRouteBackendFamily, tenantStorageRouteDiagnostic, toFetchRouteResponse, normalizeOptionalTrimmedString as toOptionalTrimmedString, toResponse, toSessionArrayBufferCopy, unavailableRegistrationContext, validateDelegateExpiryAndNonce, validateGoogleIdTokenClaims, validateRuntimeSnapshotExpectation, validateSecp256k1PublicKey33, verifyGoogleOidcToken, verifyRs256JwtSignature, verifySecp256k1Bip340SignatureAgainstPublicKey33, verifySecp256k1RecoverableSignatureAgainstPublicKey33, walletAuthMethodId, walletAuthMethodV2Id, walletConsoleApiWalletGetRouteDefinitionV1, walletConsoleApiWalletListRouteDefinitionV1, walletConsoleApiWalletSearchRouteDefinitionV1, walletConsoleRelayRouteDefinitionsV1, walletConsoleSignedDelegateRouteDefinitionV1, walletConsoleSponsoredEvmCallRouteDefinitionV1, walletObjectIdentity, walletRegistrationContext, walletRegistrationSetupRequestDigest, webAuthnCredentialIdB64uFromCredential, withCors };
|
|
@@ -80,224 +80,7 @@ var UpstashRedisRestClient = class {
|
|
|
80
80
|
return readResult(json);
|
|
81
81
|
}
|
|
82
82
|
};
|
|
83
|
-
function concatBytes(a, b) {
|
|
84
|
-
if (!a.length) return b;
|
|
85
|
-
if (!b.length) return a;
|
|
86
|
-
const out = new Uint8Array(a.length + b.length);
|
|
87
|
-
out.set(a, 0);
|
|
88
|
-
out.set(b, a.length);
|
|
89
|
-
return out;
|
|
90
|
-
}
|
|
91
|
-
function encodeRespArray(args) {
|
|
92
|
-
const encoder = new TextEncoder();
|
|
93
|
-
const parts = [];
|
|
94
|
-
parts.push(`*${args.length}\r\n`);
|
|
95
|
-
for (const arg of args) {
|
|
96
|
-
const s = String(arg);
|
|
97
|
-
const len = encoder.encode(s).length;
|
|
98
|
-
parts.push(`$${len}\r\n${s}\r\n`);
|
|
99
|
-
}
|
|
100
|
-
return encoder.encode(parts.join(""));
|
|
101
|
-
}
|
|
102
|
-
function parseLine(buf, start) {
|
|
103
|
-
for (let i = start; i + 1 < buf.length; i++) if (buf[i] === 13 && buf[i + 1] === 10) return {
|
|
104
|
-
line: new TextDecoder().decode(buf.slice(start, i)),
|
|
105
|
-
next: i + 2
|
|
106
|
-
};
|
|
107
|
-
return null;
|
|
108
|
-
}
|
|
109
|
-
function parseOneResp(buf) {
|
|
110
|
-
if (!buf.length) return null;
|
|
111
|
-
const prefix = buf[0];
|
|
112
|
-
const head = parseLine(buf, 1);
|
|
113
|
-
if (!head) return null;
|
|
114
|
-
const { line, next } = head;
|
|
115
|
-
if (prefix === 43) return {
|
|
116
|
-
value: {
|
|
117
|
-
type: "simple",
|
|
118
|
-
value: line
|
|
119
|
-
},
|
|
120
|
-
rest: buf.slice(next)
|
|
121
|
-
};
|
|
122
|
-
if (prefix === 45) return {
|
|
123
|
-
value: {
|
|
124
|
-
type: "error",
|
|
125
|
-
value: line
|
|
126
|
-
},
|
|
127
|
-
rest: buf.slice(next)
|
|
128
|
-
};
|
|
129
|
-
if (prefix === 58) {
|
|
130
|
-
const n = Number(line);
|
|
131
|
-
return {
|
|
132
|
-
value: {
|
|
133
|
-
type: "integer",
|
|
134
|
-
value: Number.isFinite(n) ? n : 0
|
|
135
|
-
},
|
|
136
|
-
rest: buf.slice(next)
|
|
137
|
-
};
|
|
138
|
-
}
|
|
139
|
-
if (prefix === 36) {
|
|
140
|
-
const len = Number(line);
|
|
141
|
-
if (len === -1) return {
|
|
142
|
-
value: {
|
|
143
|
-
type: "bulk",
|
|
144
|
-
value: null
|
|
145
|
-
},
|
|
146
|
-
rest: buf.slice(next)
|
|
147
|
-
};
|
|
148
|
-
if (!Number.isFinite(len) || len < 0) return {
|
|
149
|
-
value: {
|
|
150
|
-
type: "error",
|
|
151
|
-
value: `Invalid bulk length: ${line}`
|
|
152
|
-
},
|
|
153
|
-
rest: buf.slice(next)
|
|
154
|
-
};
|
|
155
|
-
const end = next + len;
|
|
156
|
-
if (buf.length < end + 2) return null;
|
|
157
|
-
return {
|
|
158
|
-
value: {
|
|
159
|
-
type: "bulk",
|
|
160
|
-
value: new TextDecoder().decode(buf.slice(next, end))
|
|
161
|
-
},
|
|
162
|
-
rest: buf.slice(end + 2)
|
|
163
|
-
};
|
|
164
|
-
}
|
|
165
|
-
return {
|
|
166
|
-
value: {
|
|
167
|
-
type: "error",
|
|
168
|
-
value: `Unsupported RESP prefix ${prefix}`
|
|
169
|
-
},
|
|
170
|
-
rest: new Uint8Array(0)
|
|
171
|
-
};
|
|
172
|
-
}
|
|
173
|
-
var RedisTcpClient = class {
|
|
174
|
-
constructor(redisUrl) {
|
|
175
|
-
this.socket = null;
|
|
176
|
-
this.buffer = new Uint8Array(0);
|
|
177
|
-
this.pending = [];
|
|
178
|
-
this.connecting = null;
|
|
179
|
-
this.url = new URL(redisUrl);
|
|
180
|
-
}
|
|
181
|
-
async ensureConnected() {
|
|
182
|
-
if (this.socket) return;
|
|
183
|
-
if (this.connecting) return this.connecting;
|
|
184
|
-
this.connecting = this.connect();
|
|
185
|
-
try {
|
|
186
|
-
await this.connecting;
|
|
187
|
-
} finally {
|
|
188
|
-
this.connecting = null;
|
|
189
|
-
}
|
|
190
|
-
}
|
|
191
|
-
async connect() {
|
|
192
|
-
const isTls = this.url.protocol === "rediss:";
|
|
193
|
-
const host = this.url.hostname;
|
|
194
|
-
const port = Number(this.url.port || (isTls ? 6380 : 6379));
|
|
195
|
-
const password = this.url.password ? decodeURIComponent(this.url.password) : "";
|
|
196
|
-
const db = (() => {
|
|
197
|
-
const p = this.url.pathname.replace(/^\//, "");
|
|
198
|
-
if (!p) return null;
|
|
199
|
-
const n = Number(p);
|
|
200
|
-
return Number.isFinite(n) ? n : null;
|
|
201
|
-
})();
|
|
202
|
-
const socket = isTls ? (await import("node:tls")).connect({
|
|
203
|
-
host,
|
|
204
|
-
port,
|
|
205
|
-
servername: host
|
|
206
|
-
}) : (await import("node:net")).connect({
|
|
207
|
-
host,
|
|
208
|
-
port
|
|
209
|
-
});
|
|
210
|
-
await new Promise((resolve, reject) => {
|
|
211
|
-
socket.once("error", reject);
|
|
212
|
-
socket.once(isTls ? "secureConnect" : "connect", () => resolve());
|
|
213
|
-
});
|
|
214
|
-
socket.on("data", (chunk) => {
|
|
215
|
-
const next = new Uint8Array(chunk.buffer, chunk.byteOffset, chunk.byteLength);
|
|
216
|
-
this.buffer = concatBytes(this.buffer, next);
|
|
217
|
-
this.drain();
|
|
218
|
-
});
|
|
219
|
-
socket.on("error", (err) => {
|
|
220
|
-
this.failAll(err);
|
|
221
|
-
this.socket = null;
|
|
222
|
-
});
|
|
223
|
-
socket.on("close", () => {
|
|
224
|
-
this.failAll(/* @__PURE__ */ new Error("Redis socket closed"));
|
|
225
|
-
this.socket = null;
|
|
226
|
-
});
|
|
227
|
-
this.socket = socket;
|
|
228
|
-
if (password) {
|
|
229
|
-
const authResp = await this.send(["AUTH", password]);
|
|
230
|
-
if (authResp.type === "error") throw new Error(`Redis AUTH failed: ${authResp.value}`);
|
|
231
|
-
}
|
|
232
|
-
if (db !== null && db !== 0) {
|
|
233
|
-
const sel = await this.send(["SELECT", String(db)]);
|
|
234
|
-
if (sel.type === "error") throw new Error(`Redis SELECT failed: ${sel.value}`);
|
|
235
|
-
}
|
|
236
|
-
}
|
|
237
|
-
drain() {
|
|
238
|
-
while (this.pending.length) {
|
|
239
|
-
const parsed = parseOneResp(this.buffer);
|
|
240
|
-
if (!parsed) return;
|
|
241
|
-
this.buffer = parsed.rest;
|
|
242
|
-
this.pending.shift().resolve(parsed.value);
|
|
243
|
-
}
|
|
244
|
-
}
|
|
245
|
-
failAll(err) {
|
|
246
|
-
const list = this.pending.splice(0);
|
|
247
|
-
for (const job of list) job.reject(err);
|
|
248
|
-
}
|
|
249
|
-
async send(args) {
|
|
250
|
-
await this.ensureConnected();
|
|
251
|
-
if (!this.socket) throw new Error("Redis socket not connected");
|
|
252
|
-
const payload = encodeRespArray(args);
|
|
253
|
-
const resp = new Promise((resolve, reject) => {
|
|
254
|
-
this.pending.push({
|
|
255
|
-
resolve,
|
|
256
|
-
reject
|
|
257
|
-
});
|
|
258
|
-
});
|
|
259
|
-
this.socket.write(payload);
|
|
260
|
-
return resp;
|
|
261
|
-
}
|
|
262
|
-
};
|
|
263
|
-
async function redisGetJson(client, key) {
|
|
264
|
-
const raw = await redisGetRaw(client, key);
|
|
265
|
-
return raw ? tryParseJson(raw) : null;
|
|
266
|
-
}
|
|
267
|
-
async function redisGetRaw(client, key) {
|
|
268
|
-
const resp = await client.send(["GET", key]);
|
|
269
|
-
if (resp.type === "bulk") {
|
|
270
|
-
if (!resp.value) return null;
|
|
271
|
-
return resp.value;
|
|
272
|
-
}
|
|
273
|
-
if (resp.type === "error") throw new Error(`Redis GET error: ${resp.value}`);
|
|
274
|
-
return null;
|
|
275
|
-
}
|
|
276
|
-
async function redisDel(client, key) {
|
|
277
|
-
const resp = await client.send(["DEL", key]);
|
|
278
|
-
if (resp.type === "error") throw new Error(`Redis DEL error: ${resp.value}`);
|
|
279
|
-
}
|
|
280
|
-
async function redisSetJson(client, key, value, ttlMs) {
|
|
281
|
-
if (ttlMs === void 0) {
|
|
282
|
-
const resp = await client.send([
|
|
283
|
-
"SET",
|
|
284
|
-
key,
|
|
285
|
-
JSON.stringify(value)
|
|
286
|
-
]);
|
|
287
|
-
if (resp.type === "error") throw new Error(`Redis SET error: ${resp.value}`);
|
|
288
|
-
return;
|
|
289
|
-
}
|
|
290
|
-
const ttlSeconds = Math.max(1, Math.ceil(Math.max(0, Number(ttlMs) || 0) / 1e3));
|
|
291
|
-
const resp = await client.send([
|
|
292
|
-
"SET",
|
|
293
|
-
key,
|
|
294
|
-
JSON.stringify(value),
|
|
295
|
-
"EX",
|
|
296
|
-
String(ttlSeconds)
|
|
297
|
-
]);
|
|
298
|
-
if (resp.type === "error") throw new Error(`Redis SET error: ${resp.value}`);
|
|
299
|
-
}
|
|
300
83
|
//#endregion
|
|
301
|
-
export {
|
|
84
|
+
export { UpstashRedisRestClient };
|
|
302
85
|
|
|
303
86
|
//# sourceMappingURL=kv.js.map
|
package/dist/esm/index.js
CHANGED
|
@@ -30,10 +30,10 @@ import "./core/IdentityStore.js";
|
|
|
30
30
|
import "./core/WalletAuthMethodStore.js";
|
|
31
31
|
import { parseBool, requireEnvVar } from "./core/config.js";
|
|
32
32
|
import { createInMemorySigningSessionSealIdempotencyStore } from "./threshold/session/signingSessionSeal/idempotency.js";
|
|
33
|
-
import {
|
|
34
|
-
import {
|
|
33
|
+
import { createUpstashSigningSessionSealRateLimiter } from "./threshold/session/signingSessionSeal/guards/backends.js";
|
|
34
|
+
import { createUpstashSigningSessionSealIdempotencyStore } from "./threshold/session/signingSessionSeal/idempotencyBackends.js";
|
|
35
35
|
import "./threshold/session/signingSessionSeal/index.js";
|
|
36
36
|
import { StaticRorOriginsProvider } from "./router/framework/ror/staticProvider.js";
|
|
37
37
|
import { createRorOptions } from "./router/framework/ror/options.js";
|
|
38
38
|
import "./router/framework/ror/index.js";
|
|
39
|
-
export { AUTHORIZED_OPERATION_REPLAY_BODY_MAX_BYTES, AuthorizationService, CloudflareD1RouterAbNormalSigningAdmissionStore, D1IdentityStore, D1WalletAuthMethodStore, D1WalletStore, IDENTITY_STORE_D1_SCHEMA_SQL, InMemoryRouterAbNormalSigningAdmissionStore, LocalWorkerVaultProxyGateway, OrdinaryInactiveSignerMaterialReservationServiceV1, RouterAbEcdsaPresignRuntime, SessionService, StaticCloudflareTenantStorageRouteResolver, StaticRorOriginsProvider, VaultProxyUseService, WALLET_AUTH_METHOD_STORE_D1_SCHEMA_SQL, WALLET_STORE_D1_SCHEMA_SQL, authorizeSigningSessionSealRequest, authorizedOperationReplayBodyInit, buildActiveWalletSessionQuota, buildAuthorizedOperation, buildCorsOrigins, buildExactWalletSessionQuotaProjectionV1, buildPersistedActiveWalletSessionAuthorizationV2, buildSigningSessionSealApplyPath, buildSigningSessionSealRemovePath, buildVaultProxyUseOperation, buildWalletEcdsaSignerRecord, buildWalletEd25519SignerId, buildWalletSessionAuthorizationV2, buildWalletSessionCapabilitySubjectsV1, composeSigningSessionSealGuards, computeAuthorizedOperationResultDigest, computeEip1559TxHash, createCloudflareD1RouterAbNormalSigningAdmissionStore, createCloudflareTenantStorageRoute, createInMemoryRouterAbNormalSigningAdmissionAdapter, createInMemoryRouterAbNormalSigningAdmissionStore, createInMemorySigningSessionSealIdempotencyStore, createInMemorySigningSessionSealRateLimiter, createOrdinaryInactiveSignerMaterialReservationServiceV1, createPassthroughSigningSessionSealCipherAdapter,
|
|
39
|
+
export { AUTHORIZED_OPERATION_REPLAY_BODY_MAX_BYTES, AuthorizationService, CloudflareD1RouterAbNormalSigningAdmissionStore, D1IdentityStore, D1WalletAuthMethodStore, D1WalletStore, IDENTITY_STORE_D1_SCHEMA_SQL, InMemoryRouterAbNormalSigningAdmissionStore, LocalWorkerVaultProxyGateway, OrdinaryInactiveSignerMaterialReservationServiceV1, RouterAbEcdsaPresignRuntime, SessionService, StaticCloudflareTenantStorageRouteResolver, StaticRorOriginsProvider, VaultProxyUseService, WALLET_AUTH_METHOD_STORE_D1_SCHEMA_SQL, WALLET_STORE_D1_SCHEMA_SQL, authorizeSigningSessionSealRequest, authorizedOperationReplayBodyInit, buildActiveWalletSessionQuota, buildAuthorizedOperation, buildCorsOrigins, buildExactWalletSessionQuotaProjectionV1, buildPersistedActiveWalletSessionAuthorizationV2, buildSigningSessionSealApplyPath, buildSigningSessionSealRemovePath, buildVaultProxyUseOperation, buildWalletEcdsaSignerRecord, buildWalletEd25519SignerId, buildWalletSessionAuthorizationV2, buildWalletSessionCapabilitySubjectsV1, composeSigningSessionSealGuards, computeAuthorizedOperationResultDigest, computeEip1559TxHash, createCloudflareD1RouterAbNormalSigningAdmissionStore, createCloudflareTenantStorageRoute, createInMemoryRouterAbNormalSigningAdmissionAdapter, createInMemoryRouterAbNormalSigningAdmissionStore, createInMemorySigningSessionSealIdempotencyStore, createInMemorySigningSessionSealRateLimiter, createOrdinaryInactiveSignerMaterialReservationServiceV1, createPassthroughSigningSessionSealCipherAdapter, createRorOptions, createRouterAbNormalSigningAdmissionAdapter, createRouterApiModule, createSignerD1DoStorageTarget, createSigningSessionSealAuditLogger, createSigningSessionSealCipherAdapter, createSigningSessionSealOptions, createSigningSessionSealRateLimitGuard, createSigningSessionSealRoutesOptions, createSigningSessionSealService, createSigningSessionSealShamir3PassCipherAdapter, createStaticCloudflareTenantStorageRouteResolver, createStaticCloudflareTenantStorageRouteResolverFromBindings, createUpstashSigningSessionSealIdempotencyStore, createUpstashSigningSessionSealRateLimiter, createVaultProxyUseRouteExtension, digestOpaqueValue, encodeEip1559SignedTxFromSignature65, encodeSigningSessionSealServerLockContext, ensureEvmCryptoWasm, ensureIdentityStoreD1Schema, ensureWalletAuthMethodStoreD1Schema, ensureWalletStoreD1Schema, exactWalletSessionCapabilitySubjectsResolveAuthority, formatSigningSessionSealKeyVersionForWire, handleSigningSessionSealRoutes, normalizeRorHost, normalizeWalletAuthMethod, parseAuthorizedOperationReplayResponse, parseBool, parseCsvList, parseHostedWalletSeamsSessionExchangeCode, parseHostedWalletSeamsSessionExchangeNonce, parseHostedWalletSessionCredentialId, parseHostedWalletSessionOperationCredentialToken, parseHostedWalletSessionOperationCredentialV1, parseMpcWalletSigningQuotaId, parseOrdinaryEcdsaSignerMaterialDeactivationResultV1, parseOrdinaryEcdsaSignerMaterialWorkerReservationV1, parseOrdinaryEd25519SignerMaterialDeactivationResultV1, parseOrdinaryEd25519SignerMaterialWorkerReservationV1, parsePrimaryWalletSessionOperationCredentialToken, parseSessionOrigin, parseSigningSessionSealApplyBody, parseSigningSessionSealKeyVersion, parseSigningSessionSealRemoveBody, parseSigningSessionSealRootConfig, parseVaultProxyDestination, parseVerifiedOwnerProofId, parseWalletSessionAuthorizationV2, parseWalletSessionId, projectActiveWalletSession, projectExactWalletSessionAuthorizationV1, registrationPreparationIdFromString, requireEnvVar, resolveRorRpId, resolveSigningSessionSealBasePath, sanitizeRorOrigins, secp256k1PrivateKey32ToPublicKey33, secp256k1PublicKey33ToEthereumAddress, signSecp256k1Recoverable, signingSessionSealAuthorizeStatusCode, signingSessionSealStatusCode, tenantStorageRouteBackendFamily, tenantStorageRouteDiagnostic, validateOrdinaryInactiveSignerMaterialDeactivationRequestV1, validateOrdinaryInactiveSignerMaterialReservationRequestV1, validateRouterApiRorOptions, walletSessionAuthorizationV2RecordsEqual, walletSessionCapabilitySubjectsV1Equal };
|
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
import { runRouterAbPrewarmScheduledV1 } from "./router/cloudflare/runtime/routerAbPrewarm.js";
|
|
2
2
|
import "./cloud-host.js";
|
|
3
|
-
import { handleLocalHostedWalletGatewayRequestV1 } from "./localHostedWalletGatewayHandler.js";
|
|
3
|
+
import { handleLocalHostedWalletGatewayRequestV1, resumeLocalRegistrationDirectoryPublicationsV1 } from "./localHostedWalletGatewayHandler.js";
|
|
4
4
|
//#region src/local-hosted-wallet-gateway-worker.ts
|
|
5
5
|
async function fetch(request, env, ctx) {
|
|
6
6
|
return await handleLocalHostedWalletGatewayRequestV1(request, env, ctx);
|
|
7
7
|
}
|
|
8
8
|
async function scheduled(event, env, _ctx) {
|
|
9
|
-
await runRouterAbPrewarmScheduledV1(event, env);
|
|
9
|
+
const [prewarm, publications] = await Promise.allSettled([runRouterAbPrewarmScheduledV1(event, env), resumeLocalRegistrationDirectoryPublicationsV1(env)]);
|
|
10
|
+
if (prewarm.status === "rejected") throw prewarm.reason;
|
|
11
|
+
if (publications.status === "rejected") throw publications.reason;
|
|
10
12
|
}
|
|
11
13
|
var local_hosted_wallet_gateway_worker_default = {
|
|
12
14
|
fetch,
|
|
@@ -5,6 +5,7 @@ import { LocalRegistrationSetupAuthority } from "./localRegistrationSetupAuthori
|
|
|
5
5
|
import { WALLET_CONSOLE_OP_PATHS_V1 } from "./router/cloudflare/runtime/walletConsoleOps.js";
|
|
6
6
|
import { WalletHomeCustodyBinding } from "./router/cloudflare/runtime/routerAbServiceBindings.js";
|
|
7
7
|
import { createStaticWalletConsoleBindingV1, parseStaticWalletConsoleBindingConfigV1 } from "./router/cloudflare/runtime/staticWalletConsoleBinding.js";
|
|
8
|
+
import { resumeRegistrationDirectoryPublicationsV1 } from "./router/cloudflare/d1/registration/d1WalletExecutionAuthority.js";
|
|
8
9
|
import { handleSplitGatewayRequest } from "./hosted-wallet-gateway.js";
|
|
9
10
|
import { localPresignCancellationProbe } from "./localIntendedPresignCancellation.js";
|
|
10
11
|
import { LOCAL_INTENDED_YAO_FAULT_HEADER_V1, LOCAL_INTENDED_YAO_FAULT_TOKEN_HEADER_V1, LocalIntendedYaoFaultControllerV1, parseLocalIntendedYaoFaultModeV1, parseLocalIntendedYaoFaultTokenV1, requestWithoutLocalIntendedYaoFaultHeadersV1, responseWithLocalIntendedYaoFaultOutcomeV1 } from "./localIntendedYaoFault.js";
|
|
@@ -99,6 +100,23 @@ async function handleEcdsaRespondFault(request, env, ctx, dependencies, fault, e
|
|
|
99
100
|
}
|
|
100
101
|
return Response.json({ code: "invalid_intended_ecdsa_fault" }, { status: 400 });
|
|
101
102
|
}
|
|
103
|
+
function localTenantScope(env, config) {
|
|
104
|
+
return {
|
|
105
|
+
namespace: requireCanonicalString(env.SEAMS_TENANT_STORAGE_NAMESPACE, "Local namespace"),
|
|
106
|
+
orgId: config.deployment.orgId,
|
|
107
|
+
projectId: config.deployment.projectId,
|
|
108
|
+
envId: config.deployment.environmentKey
|
|
109
|
+
};
|
|
110
|
+
}
|
|
111
|
+
/** Sends the due directory publications to the local registration authority. */
|
|
112
|
+
async function resumeLocalRegistrationDirectoryPublicationsV1(env) {
|
|
113
|
+
const scope = localTenantScope(env, parseStaticWalletConsoleBindingConfigV1(JSON.parse(env.WALLET_LOCAL_DEPLOYMENT_JSON)));
|
|
114
|
+
await resumeRegistrationDirectoryPublicationsV1({
|
|
115
|
+
database: env.SIGNER_DB,
|
|
116
|
+
scope,
|
|
117
|
+
registrationAuthority: new LocalRegistrationSetupAuthority(env.SIGNER_DB, scope)
|
|
118
|
+
});
|
|
119
|
+
}
|
|
102
120
|
/**
|
|
103
121
|
* The local Gateway: the hosted Gateway handler plus the intended-suite
|
|
104
122
|
* transport faults, which a request arms with local-only headers. The local
|
|
@@ -106,12 +124,7 @@ async function handleEcdsaRespondFault(request, env, ctx, dependencies, fault, e
|
|
|
106
124
|
*/
|
|
107
125
|
async function handleLocalHostedWalletGatewayRequestV1(request, env, ctx, dependencies) {
|
|
108
126
|
const config = parseStaticWalletConsoleBindingConfigV1(JSON.parse(env.WALLET_LOCAL_DEPLOYMENT_JSON));
|
|
109
|
-
const tenantScope =
|
|
110
|
-
namespace: requireCanonicalString(env.SEAMS_TENANT_STORAGE_NAMESPACE, "Local namespace"),
|
|
111
|
-
orgId: config.deployment.orgId,
|
|
112
|
-
projectId: config.deployment.projectId,
|
|
113
|
-
envId: config.deployment.environmentKey
|
|
114
|
-
};
|
|
127
|
+
const tenantScope = localTenantScope(env, config);
|
|
115
128
|
dependencies = {
|
|
116
129
|
emailOtpDeliveryProvider: dependencies?.emailOtpDeliveryProvider,
|
|
117
130
|
signerWasm: dependencies?.signerWasm,
|
|
@@ -328,6 +341,6 @@ async function handleEcdsaFinalizeFault(request, env, ctx, dependencies, rawMode
|
|
|
328
341
|
}, ctx, dependencies), controller.consumeOutcome(), token);
|
|
329
342
|
}
|
|
330
343
|
//#endregion
|
|
331
|
-
export { handleLocalHostedWalletGatewayRequestV1 };
|
|
344
|
+
export { handleLocalHostedWalletGatewayRequestV1, resumeLocalRegistrationDirectoryPublicationsV1 };
|
|
332
345
|
|
|
333
346
|
//# sourceMappingURL=localHostedWalletGatewayHandler.js.map
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
import { D1_BATCH_CAS_GUARD_SQL } from "../../../../storage/d1Sql.js";
|
|
2
2
|
import { prepareD1TenantStatement } from "../../../../core/d1TenantStore.js";
|
|
3
3
|
//#region src/router/cloudflare/d1/registration/d1WalletExecutionAuthority.ts
|
|
4
|
+
/** The finalize response normally delivers first; the scheduled resumption waits this long. */
|
|
5
|
+
const DIRECTORY_PUBLICATION_FIRST_RETRY_MS = 6e4;
|
|
6
|
+
const DIRECTORY_PUBLICATION_MAX_RETRY_MS = 36e5;
|
|
4
7
|
var D1WalletExecutionAuthority = class {
|
|
5
8
|
constructor(database, scope, registration) {
|
|
6
9
|
this.database = database;
|
|
@@ -83,23 +86,104 @@ var D1WalletExecutionAuthority = class {
|
|
|
83
86
|
await this.database.batch(this.prepareState(input, "retired"));
|
|
84
87
|
return completed;
|
|
85
88
|
}
|
|
86
|
-
|
|
87
|
-
if (input.registration.state === "active") return
|
|
88
|
-
|
|
89
|
-
activation: null
|
|
90
|
-
};
|
|
91
|
-
const completed = await this.registration.complete({
|
|
92
|
-
ceremonyId: input.registration.ceremonyId,
|
|
89
|
+
prepareEstablished(input) {
|
|
90
|
+
if (input.registration.state === "active") return null;
|
|
91
|
+
const publication = {
|
|
93
92
|
walletId: input.registration.walletId,
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
93
|
+
ceremonyId: input.registration.ceremonyId,
|
|
94
|
+
digest: input.session.digest,
|
|
95
|
+
expiresAtMs: input.session.expiresAtMs,
|
|
96
|
+
attempts: 0
|
|
97
|
+
};
|
|
98
98
|
return {
|
|
99
|
-
|
|
100
|
-
|
|
99
|
+
statements: [...this.prepareState(input.registration, "active"), prepareD1TenantStatement(this.database, this.scope, `INSERT INTO wallet_registration_directory_publications
|
|
100
|
+
(namespace, org_id, project_id, env_id, wallet_id, ceremony_id,
|
|
101
|
+
session_digest, session_expires_at_ms, next_attempt_at_ms)
|
|
102
|
+
VALUES (?1, ?2, ?3, ?4, ?5, ?6, ?7, ?8, ?9)
|
|
103
|
+
ON CONFLICT DO NOTHING`, [
|
|
104
|
+
publication.walletId,
|
|
105
|
+
publication.ceremonyId,
|
|
106
|
+
publication.digest,
|
|
107
|
+
publication.expiresAtMs,
|
|
108
|
+
Date.now() + DIRECTORY_PUBLICATION_FIRST_RETRY_MS
|
|
109
|
+
])],
|
|
110
|
+
publish: async () => {
|
|
111
|
+
try {
|
|
112
|
+
await this.deliver(publication);
|
|
113
|
+
} catch (error) {
|
|
114
|
+
console.warn("[wallet-registration] directory publication stays pending", error);
|
|
115
|
+
}
|
|
116
|
+
}
|
|
101
117
|
};
|
|
102
118
|
}
|
|
119
|
+
/** Sends the publications that are due, oldest first, one at a time. */
|
|
120
|
+
async resumeDirectoryPublications(input) {
|
|
121
|
+
const due = await prepareD1TenantStatement(this.database, this.scope, `SELECT wallet_id, ceremony_id, session_digest, session_expires_at_ms, attempts
|
|
122
|
+
FROM wallet_registration_directory_publications
|
|
123
|
+
WHERE namespace = ?1 AND org_id = ?2 AND project_id = ?3 AND env_id = ?4
|
|
124
|
+
AND state = 'pending' AND next_attempt_at_ms <= ?5
|
|
125
|
+
ORDER BY next_attempt_at_ms LIMIT ?6`, [input.nowMs, input.limit]).all();
|
|
126
|
+
if (!due.success) throw new Error("Registration directory publication read failed");
|
|
127
|
+
const delivered = {
|
|
128
|
+
acknowledged: 0,
|
|
129
|
+
deferred: 0,
|
|
130
|
+
refused: 0
|
|
131
|
+
};
|
|
132
|
+
for (const row of due.results ?? []) {
|
|
133
|
+
const outcome = await this.deliver({
|
|
134
|
+
walletId: row.wallet_id,
|
|
135
|
+
ceremonyId: row.ceremony_id,
|
|
136
|
+
digest: row.session_digest,
|
|
137
|
+
expiresAtMs: row.session_expires_at_ms,
|
|
138
|
+
attempts: row.attempts
|
|
139
|
+
});
|
|
140
|
+
delivered[outcome] += 1;
|
|
141
|
+
}
|
|
142
|
+
return delivered;
|
|
143
|
+
}
|
|
144
|
+
async deliver(publication) {
|
|
145
|
+
let completed;
|
|
146
|
+
try {
|
|
147
|
+
completed = await this.registration.complete({
|
|
148
|
+
ceremonyId: publication.ceremonyId,
|
|
149
|
+
walletId: publication.walletId,
|
|
150
|
+
outcome: "established",
|
|
151
|
+
session: {
|
|
152
|
+
kind: "credential",
|
|
153
|
+
walletId: publication.walletId,
|
|
154
|
+
digest: publication.digest,
|
|
155
|
+
expiresAtMs: publication.expiresAtMs
|
|
156
|
+
}
|
|
157
|
+
});
|
|
158
|
+
} catch (error) {
|
|
159
|
+
console.warn("[wallet-registration] directory publication deferred", error);
|
|
160
|
+
const delayMs = Math.min(DIRECTORY_PUBLICATION_FIRST_RETRY_MS * 2 ** Math.min(publication.attempts + 1, 16), DIRECTORY_PUBLICATION_MAX_RETRY_MS);
|
|
161
|
+
await this.preparePublicationUpdate(publication, `attempts = attempts + 1, next_attempt_at_ms = ?7`, [Date.now() + delayMs]).run();
|
|
162
|
+
return "deferred";
|
|
163
|
+
}
|
|
164
|
+
if (!completed.ok) {
|
|
165
|
+
console.error("[wallet-registration] directory refused an established registration", {
|
|
166
|
+
walletId: publication.walletId,
|
|
167
|
+
ceremonyId: publication.ceremonyId,
|
|
168
|
+
code: completed.code
|
|
169
|
+
});
|
|
170
|
+
await this.preparePublicationUpdate(publication, `state = 'refused'`, []).run();
|
|
171
|
+
return "refused";
|
|
172
|
+
}
|
|
173
|
+
await prepareD1TenantStatement(this.database, this.scope, `DELETE FROM wallet_registration_directory_publications
|
|
174
|
+
WHERE namespace = ?1 AND org_id = ?2 AND project_id = ?3 AND env_id = ?4
|
|
175
|
+
AND wallet_id = ?5 AND ceremony_id = ?6 AND state = 'pending'`, [publication.walletId, publication.ceremonyId]).run();
|
|
176
|
+
return "acknowledged";
|
|
177
|
+
}
|
|
178
|
+
preparePublicationUpdate(publication, assignments, values) {
|
|
179
|
+
return prepareD1TenantStatement(this.database, this.scope, `UPDATE wallet_registration_directory_publications SET ${assignments}
|
|
180
|
+
WHERE namespace = ?1 AND org_id = ?2 AND project_id = ?3 AND env_id = ?4
|
|
181
|
+
AND wallet_id = ?5 AND ceremony_id = ?6 AND state = 'pending'`, [
|
|
182
|
+
publication.walletId,
|
|
183
|
+
publication.ceremonyId,
|
|
184
|
+
...values
|
|
185
|
+
]);
|
|
186
|
+
}
|
|
103
187
|
async fixCancellation(input) {
|
|
104
188
|
await this.database.batch([prepareD1TenantStatement(this.database, this.scope, `UPDATE wallet_execution_generations
|
|
105
189
|
SET registration_completion = 'cancelled', state = 'retired'
|
|
@@ -162,7 +246,18 @@ async function admitD1EstablishedWalletHome(database, scope, input) {
|
|
|
162
246
|
ownershipGeneration: row.generation
|
|
163
247
|
};
|
|
164
248
|
}
|
|
249
|
+
/**
|
|
250
|
+
* Sends the due directory publications of one tenant scope. The Gateway's
|
|
251
|
+
* scheduled handler runs it, so a publication that the finalize response could
|
|
252
|
+
* not deliver still reaches the directory.
|
|
253
|
+
*/
|
|
254
|
+
function resumeRegistrationDirectoryPublicationsV1(input) {
|
|
255
|
+
return new D1WalletExecutionAuthority(input.database, input.scope, input.registrationAuthority).resumeDirectoryPublications({
|
|
256
|
+
nowMs: input.nowMs ?? Date.now(),
|
|
257
|
+
limit: input.limit ?? 20
|
|
258
|
+
});
|
|
259
|
+
}
|
|
165
260
|
//#endregion
|
|
166
|
-
export { D1WalletExecutionAuthority, admitD1EstablishedWalletHome, prepareD1RegistrationHomeReservation };
|
|
261
|
+
export { D1WalletExecutionAuthority, admitD1EstablishedWalletHome, prepareD1RegistrationHomeReservation, resumeRegistrationDirectoryPublicationsV1 };
|
|
167
262
|
|
|
168
263
|
//# sourceMappingURL=d1WalletExecutionAuthority.js.map
|
|
@@ -68,6 +68,17 @@ async function buildRespondEd25519AdmissionRequest(input) {
|
|
|
68
68
|
materialActivation: mint.materialActivation
|
|
69
69
|
});
|
|
70
70
|
}
|
|
71
|
+
/**
|
|
72
|
+
* Sends the directory publication that a completed registration operation
|
|
73
|
+
* recorded as pending. The response does not wait for it when the runtime keeps
|
|
74
|
+
* background work; a failed delivery stays pending for the scheduled resumption.
|
|
75
|
+
*/
|
|
76
|
+
async function publishCompletedRegistration(execution, waitUntil) {
|
|
77
|
+
const activation = registrationCommitActivation(execution);
|
|
78
|
+
if (!activation) return;
|
|
79
|
+
if (waitUntil) waitUntil(activation.publish());
|
|
80
|
+
else await activation.publish();
|
|
81
|
+
}
|
|
71
82
|
function ignoreRespondExecutionFailure() {
|
|
72
83
|
return null;
|
|
73
84
|
}
|
|
@@ -2425,7 +2436,9 @@ var CloudflareD1WalletRegistrationService = class {
|
|
|
2425
2436
|
recordRegistrationServerTiming(serverTiming, "near_finalize_side_effect", sideEffectStartedAtMs);
|
|
2426
2437
|
switch (run.kind) {
|
|
2427
2438
|
case "executed":
|
|
2428
|
-
case "exact_replay":
|
|
2439
|
+
case "exact_replay":
|
|
2440
|
+
await publishCompletedRegistration(run.value, waitUntil);
|
|
2441
|
+
break;
|
|
2429
2442
|
case "request_conflict": return {
|
|
2430
2443
|
ok: false,
|
|
2431
2444
|
code: "idempotency_conflict",
|
|
@@ -2767,7 +2780,7 @@ var CloudflareD1WalletRegistrationService = class {
|
|
|
2767
2780
|
* before execution; an ambiguous outcome after the custody call stays
|
|
2768
2781
|
* `uncertain` rather than being guessed either way.
|
|
2769
2782
|
*/
|
|
2770
|
-
async activateWalletRegistration(input, traceContext, serverTiming) {
|
|
2783
|
+
async activateWalletRegistration(input, traceContext, serverTiming, waitUntil) {
|
|
2771
2784
|
try {
|
|
2772
2785
|
const verifiedSetup = await verifyWalletRegistrationSetupClaims(input.verifier, input.signedSetup, {
|
|
2773
2786
|
registrationCeremonyId: input.registrationCeremonyId,
|
|
@@ -2830,6 +2843,7 @@ var CloudflareD1WalletRegistrationService = class {
|
|
|
2830
2843
|
switch (run.kind) {
|
|
2831
2844
|
case "executed":
|
|
2832
2845
|
case "exact_replay":
|
|
2846
|
+
await publishCompletedRegistration(run.value, waitUntil);
|
|
2833
2847
|
if (run.value.response.ok && run.value.response.kind === "evm_family_ecdsa") await cleanupFinalizedRegistrationCeremony({
|
|
2834
2848
|
store: this.getRegistrationCeremonyIntentStore(),
|
|
2835
2849
|
registrationCeremonyId: claims.registrationCeremonyId
|