@seams/wallet-server 0.15.6 → 0.17.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/README.md +4 -4
- package/THIRD_PARTY_NOTICES.md +102 -1
- package/artifact-manifest.json +27 -22
- 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/local-tools/linux-x64/router_ab_local_init +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_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_bg.wasm +0 -0
- package/cloudflare-router-ab/migrations/postgres/0001_role_store.sql +567 -0
- package/dist/esm/authorization/factorEvidence.js +49 -8
- package/dist/esm/authorization/vaultProxyUse.js +15 -15
- package/dist/esm/core/SessionService.js +1 -0
- package/dist/esm/core/ThresholdService/kv.js +2 -0
- package/dist/esm/core/ThresholdService/routerAb/ecdsaDerivationPoolFillHandlers.js +3 -0
- package/dist/esm/core/d1IdentityStore.js +3 -1
- package/dist/esm/core/d1TenantStore.js +4 -1
- package/dist/esm/core/d1WalletAuthMethodStore.js +3 -1
- package/dist/esm/core/d1WalletStore.js +5 -2
- package/dist/esm/core/deviceLinking/linkedDeviceManagement.js +1 -4
- package/dist/esm/core/deviceLinking/linkedDeviceSession.js +2 -0
- package/dist/esm/core/deviceLinking/requestProof.js +1 -0
- package/dist/esm/core/routerAbSigning/RouterAbEcdsaPresignRuntime.js +2 -0
- package/dist/esm/core/routerAbSigning/RouterAbNormalSigningRuntime.js +3 -0
- package/dist/esm/core/rpcClients/near/NearClient.js +8 -0
- package/dist/esm/core/signingMaterial/ordinaryInactiveSignerMaterialReservation.js +0 -1
- package/dist/esm/localHostedWalletGatewayHandler.js +2 -2
- package/dist/esm/localIntendedEcdsaFinalizeFault.js +1 -1
- package/dist/esm/localIntendedLinkExecuteFault.js +1 -1
- package/dist/esm/localIntendedMaterialAdmissionFault.js +2 -2
- package/dist/esm/localIntendedRevokeFault.js +1 -1
- package/dist/esm/localIntendedSessionAdmissionFault.js +1 -1
- package/dist/esm/localIntendedYaoExportFault.js +1 -1
- package/dist/esm/localIntendedYaoFault.js +1 -1
- package/dist/esm/localIntendedYaoFinalizeFault.js +1 -1
- package/dist/esm/localIntendedYaoRecoveryFault.js +3 -3
- package/dist/esm/localIntendedYaoSigningFault.js +1 -1
- package/dist/esm/localRegistrationSetupAuthority.js +1 -0
- package/dist/esm/router/cloudflare/d1/auth/d1RouterApiAuthService.js +2 -2
- package/dist/esm/router/cloudflare/d1/authorization/d1AuthorizationStore.js +5 -0
- package/dist/esm/router/cloudflare/d1/authorization/d1VaultProxyStore.js +1 -0
- package/dist/esm/router/cloudflare/d1/deviceLinking/d1LinkedDeviceAuthorityInstallService.js +1 -0
- package/dist/esm/router/cloudflare/d1/deviceLinking/d1LinkedDeviceEd25519ExportRootStore.js +2 -0
- package/dist/esm/router/cloudflare/d1/deviceLinking/d1LinkedDeviceEmailOtpGrantStore.js +2 -0
- package/dist/esm/router/cloudflare/d1/deviceLinking/d1LinkedDeviceEmailOtpTargetFactor.js +3 -0
- package/dist/esm/router/cloudflare/d1/deviceLinking/d1LinkedDeviceOwnerAuthorizationProvider.js +2 -3
- package/dist/esm/router/cloudflare/d1/deviceLinking/d1LinkedDeviceRequestProofNonceStore.js +2 -0
- package/dist/esm/router/cloudflare/d1/deviceLinking/d1LinkedDeviceSessionStore.js +3 -0
- package/dist/esm/router/cloudflare/d1/deviceLinking/d1LinkedDeviceSourceContributionPreparationPlanner.js +6 -2
- package/dist/esm/router/cloudflare/d1/deviceLinking/d1LinkedDeviceTargetAuthenticatorStore.js +3 -0
- package/dist/esm/router/cloudflare/d1/deviceLinking/d1LinkedDeviceTargetCredentialProvider.js +10 -2
- package/dist/esm/router/cloudflare/d1/deviceLinking/d1LinkedDeviceTargetPlanner.js +3 -0
- package/dist/esm/router/cloudflare/d1/ed25519Yao/d1Ed25519YaoCapabilityPersistence.js +6 -1
- package/dist/esm/router/cloudflare/d1/ed25519Yao/d1Ed25519YaoLifecycleDecisionStore.js +2 -0
- package/dist/esm/router/cloudflare/d1/ed25519Yao/d1Ed25519YaoProductRegistrationPartitionedStateStore.js +1 -1
- package/dist/esm/router/cloudflare/d1/emailOtp/d1EmailOtpChallengeIssuer.js +5 -0
- package/dist/esm/router/cloudflare/d1/emailOtp/d1EmailOtpChallengeService.js +8 -0
- package/dist/esm/router/cloudflare/d1/emailOtp/d1EmailOtpChallengeStore.js +6 -1
- package/dist/esm/router/cloudflare/d1/emailOtp/d1EmailOtpChallengeVerifier.js +4 -0
- package/dist/esm/router/cloudflare/d1/emailOtp/d1EmailOtpEnrollmentStore.js +1 -0
- package/dist/esm/router/cloudflare/d1/emailOtp/d1EmailOtpGrantStore.js +1 -0
- package/dist/esm/router/cloudflare/d1/emailOtp/d1EmailOtpRecoveryService.js +4 -0
- package/dist/esm/router/cloudflare/d1/emailOtp/d1EmailOtpRegistrationEnrollmentFinalizer.js +2 -0
- package/dist/esm/router/cloudflare/d1/emailOtp/d1EmailOtpServerSealRuntime.js +1 -0
- package/dist/esm/router/cloudflare/d1/emailOtp/d1GoogleEmailOtpRegistrationAttemptStore.js +3 -0
- package/dist/esm/router/cloudflare/d1/emailOtp/d1GoogleEmailOtpSessionResolver.js +6 -0
- package/dist/esm/router/cloudflare/d1/identity/d1IdentityService.js +1 -0
- package/dist/esm/router/cloudflare/d1/oidc/d1OidcBoundary.js +2 -4
- package/dist/esm/router/cloudflare/d1/oidc/d1OidcVerificationService.js +4 -0
- package/dist/esm/router/cloudflare/d1/passkeyCustody/d1PasskeyCustodyEnvelopeStore.js +4 -0
- package/dist/esm/router/cloudflare/d1/passkeyCustody/d1WalletCustodyCommitStore.js +7 -0
- package/dist/esm/router/cloudflare/d1/passkeyCustody/d1WalletRecoveryGoogleEmailOtpAttemptStore.js +1 -0
- package/dist/esm/router/cloudflare/d1/passkeyCustody/d1WalletRecoveryGoogleEmailOtpService.js +8 -0
- package/dist/esm/router/cloudflare/d1/registration/d1RegistrationCeremonyRecordStore.js +3 -0
- package/dist/esm/router/cloudflare/d1/registration/d1RegistrationCeremonyStore.js +1 -0
- package/dist/esm/router/cloudflare/d1/registration/d1RegistrationIntentService.js +1 -0
- package/dist/esm/router/cloudflare/d1/registration/d1RegistrationSessionTransaction.js +1 -1
- package/dist/esm/router/cloudflare/d1/registration/d1WalletOperationStore.js +2 -0
- package/dist/esm/router/cloudflare/d1/registration/d1WalletRegistrationCommitStore.js +3 -0
- package/dist/esm/router/cloudflare/d1/registration/d1WalletRegistrationService.js +24 -0
- package/dist/esm/router/cloudflare/d1/signingAdmission/d1RouterAbNormalSigningAdmissionStore.js +3 -0
- package/dist/esm/router/cloudflare/d1/versionedJson/d1VersionedJsonRecordStore.js +6 -0
- package/dist/esm/router/cloudflare/d1/wallet/d1WalletAddSignerService.js +11 -0
- package/dist/esm/router/cloudflare/d1/wallet/d1WalletAuthMethodRevocationReplayStore.js +2 -0
- package/dist/esm/router/cloudflare/d1/wallet/d1WalletAuthMethodService.js +16 -0
- package/dist/esm/router/cloudflare/d1/wallet/d1WalletAuthorityStore.js +3 -1
- package/dist/esm/router/cloudflare/d1/webauthn/d1WebAuthnAuthService.js +4 -0
- package/dist/esm/router/cloudflare/d1/webauthn/d1WebAuthnStore.js +5 -1
- package/dist/esm/router/cloudflare/durableObjects/versionedJsonRecordStore.js +6 -0
- package/dist/esm/router/cloudflare/runtime/ed25519SessionAdapter.js +6 -0
- package/dist/esm/router/cloudflare/runtime/walletAuthorizationRelocationRoutes.js +117 -117
- package/dist/esm/router/cloudflare/runtime/walletPlacementRoutes.js +51 -51
- package/dist/esm/router/cloudflare/signingLanes/cloudflareOrdinaryInactiveSignerMaterialReservation.js +3 -3
- package/dist/esm/router/cloudflare.js +114 -61
- package/dist/esm/router/domains/ecdsa/routerAbEcdsaStrictRegistration.js +1 -1
- package/dist/esm/router/domains/ed25519Yao/capabilityLifecycle/routerAbEd25519YaoProductRegistration.js +2 -1
- package/dist/esm/router/domains/ed25519Yao/capabilityLifecycle/routerAbEd25519YaoProductRegistrationRequestScopedRuntime.js +2 -1
- package/dist/esm/router/domains/ed25519Yao/export/routerAbEd25519YaoExport.js +6 -8
- package/dist/esm/router/domains/ed25519Yao/recovery/routerAbEd25519YaoRecovery.js +11 -9
- package/dist/esm/router/domains/ed25519Yao/registration/routerAbEd25519YaoHttpRegistrationBackend.js +2 -1
- package/dist/esm/router/domains/ed25519Yao/registration/routerAbEd25519YaoRegistration.js +11 -9
- package/dist/esm/router/domains/ed25519Yao/registration/routerAbEd25519YaoRegistrationIntentAuthorization.js +2 -3
- package/dist/esm/router/domains/signingOperations/routerAbNormalSigningAdmissionCore.js +2 -4
- package/dist/esm/router/domains/walletRegistration/registrationSessionSeal.js +1 -1
- package/dist/esm/router/framework/http.js +1 -1
- package/dist/esm/router/framework/ror/staticProvider.js +1 -0
- package/dist/esm/router/ror.js +1 -0
- package/dist/esm/shared-ts/src/authorization/delegatedAuthority.js +1 -1
- package/dist/esm/shared-ts/src/authorization/operationFingerprint.js +6 -0
- package/dist/esm/shared-ts/src/device-linking/sourceContribution.js +5 -5
- package/dist/esm/shared-ts/src/near/nearClient.js +6 -0
- package/dist/esm/shared-ts/src/tenant-root/tenantRootIdentity.js +5 -0
- package/dist/esm/shared-ts/src/utils/domainIds.js +7 -0
- package/dist/esm/shared-ts/src/utils/routerAbEd25519Yao.js +7 -6
- package/dist/esm/storage/tenantRoute.js +4 -0
- package/dist/esm/threshold/session/signingSessionSeal/crypto/cipher.js +1 -1
- package/dist/esm/threshold/session/signingSessionSeal/crypto/shamir3PassWasm.js +1 -1
- package/dist/esm/threshold/session/signingSessionSeal/guards/backends.js +2 -0
- package/dist/esm/threshold/session/signingSessionSeal/guards/index.js +2 -1
- package/dist/esm/threshold/session/signingSessionSeal/idempotencyBackends.js +3 -0
- package/dist/types/shared-ts/src/authorization/capabilityKinds.d.ts +14 -14
- package/dist/types/shared-ts/src/authorization/delegatedAuthority.d.ts +1 -1
- package/dist/types/shared-ts/src/device-linking/ed25519ExportRoot.d.ts +1 -1
- package/dist/types/shared-ts/src/device-linking/requestProof.d.ts +1 -1
- package/dist/types/shared-ts/src/device-linking/sourceContribution.d.ts +5 -5
- package/dist/types/shared-ts/src/passkey-custody/custodyEnvelope.d.ts +3 -3
- package/dist/types/shared-ts/src/passkey-custody/custodySecretBinding.d.ts +1 -1
- package/dist/types/shared-ts/src/tenant-root/tenantRootIdentity.d.ts +1 -1
- package/dist/types/shared-ts/src/tenant-root/tenantRootOperationRecord.d.ts +2 -2
- package/dist/types/shared-ts/src/utils/base64.d.ts +2 -2
- package/dist/types/shared-ts/src/utils/digestEncoding.d.ts +1 -1
- package/dist/types/shared-ts/src/utils/digests.d.ts +2 -2
- package/dist/types/shared-ts/src/utils/emailOtpDomain.d.ts +16 -16
- package/dist/types/shared-ts/src/utils/emailOtpRecoveryKey.d.ts +1 -1
- package/dist/types/shared-ts/src/utils/routerAbEcdsaDerivation.d.ts +10 -10
- package/dist/types/shared-ts/src/utils/routerAbEd25519Yao.d.ts +12 -11
- package/dist/types/shared-ts/src/utils/routerAbPublicKeyset.d.ts +3 -3
- package/dist/types/shared-ts/src/utils/routerAbTraceContext.d.ts +1 -1
- package/dist/types/shared-ts/src/utils/signerDomain.d.ts +15 -15
- package/dist/types/shared-ts/src/utils/signingSessionSeal.d.ts +11 -11
- package/dist/types/shared-ts/src/utils/walletSessionFailure.d.ts +8 -8
- package/dist/types/shared-ts/src/utils/webauthnDeviceInfo.d.ts +2 -2
- package/dist/types/shared-ts/src/utils/wireSchema.d.ts +1 -1
- package/dist/types/shared-ts/src/wallet-recovery/recoveryKeyId.d.ts +1 -1
- package/dist/types/wallet-server/src/authorization/factorEvidence.d.ts +6 -6
- package/dist/types/wallet-server/src/core/ecdsaMaterialReadSnapshot.d.ts +1 -1
- package/dist/types/wallet-server/src/core/threeRouteRegistrationContracts.typecheck.d.ts +6 -6
- package/dist/types/wallet-server/src/router/auth/webAuthnCredentialCodecs.d.ts +1 -1
- package/dist/types/wallet-server/src/router/cloudflare/d1/deviceLinking/d1LinkedDeviceTargetCredentialProvider.d.ts +1 -1
- package/dist/types/wallet-server/src/router/cloudflare/d1/deviceLinking/d1LinkedDeviceTargetPlanner.d.ts +3 -3
- package/dist/types/wallet-server/src/router/cloudflare/d1/registration/d1WalletRegistrationRead.d.ts +2 -2
- package/dist/types/wallet-server/src/router/cloudflare/d1/registration/walletRegistrationEstablishedSessionIssuer.d.ts +2 -2
- package/dist/types/wallet-server/src/router/cloudflare/d1/wallet/authorizationSnapshotLayout.d.ts +1 -1
- package/dist/types/wallet-server/src/router/cloudflare/d1/wallet/d1WalletRelocationOwner.d.ts +9 -9
- package/dist/types/wallet-server/src/router/cloudflare/signingLanes/cloudflareOrdinaryInactiveSignerMaterialReservation.d.ts +6 -6
- package/dist/types/wallet-server/src/router/domains/signingOperations/signingPrepareSession.d.ts +2 -2
- package/dist/types/wallet-server/src/router/domains/walletRegistration/walletRegistrationSetupPayload.d.ts +1 -1
- package/dist/types/wallet-server/src/router/domains/walletUnlock/walletUnlockRequestedCapabilitiesValidation.d.ts +3 -3
- package/dist/types/wallet-server/src/router/framework/apiCredentialPorts.d.ts +1 -1
- package/dist/types/wallet-server/src/router/framework/routeAuthPolicy.d.ts +2 -2
- package/dist/types/wallet-server/src/router/framework/routeExecutionContext.d.ts +1 -1
- package/dist/types/wallet-server/src/router/transport/fetch/routes/deviceLinkingOwnerAuthorization.d.ts +1 -1
- package/migrations/d1-signer/0082_wallet_signature_completions.sql +39 -0
- package/package.json +4 -5
|
@@ -13,6 +13,8 @@ function readResult(json) {
|
|
|
13
13
|
return v === void 0 || v === null ? null : v;
|
|
14
14
|
}
|
|
15
15
|
var UpstashRedisRestClient = class {
|
|
16
|
+
url;
|
|
17
|
+
token;
|
|
16
18
|
constructor(input) {
|
|
17
19
|
const url = String(input.url || "").trim();
|
|
18
20
|
const token = String(input.token || "").trim();
|
|
@@ -215,6 +215,9 @@ function sameParticipantIds(a, b) {
|
|
|
215
215
|
return true;
|
|
216
216
|
}
|
|
217
217
|
var RouterAbEcdsaDerivationPoolFillHandlers = class {
|
|
218
|
+
participantIds2p;
|
|
219
|
+
ensureReady;
|
|
220
|
+
signingWorkerTransport;
|
|
218
221
|
constructor(input) {
|
|
219
222
|
this.participantIds2p = input.participantIds2p;
|
|
220
223
|
this.ensureReady = input.ensureReady;
|
|
@@ -77,8 +77,10 @@ function buildIdentitySubjectRecord(input) {
|
|
|
77
77
|
};
|
|
78
78
|
}
|
|
79
79
|
var D1IdentityStore = class {
|
|
80
|
+
adapterKind = "d1";
|
|
81
|
+
table;
|
|
82
|
+
now;
|
|
80
83
|
constructor(input) {
|
|
81
|
-
this.adapterKind = "d1";
|
|
82
84
|
this.table = new D1TenantTable(input, IDENTITY_D1_STORE, IDENTITY_STORE_D1_SCHEMA_SQL);
|
|
83
85
|
this.now = input.now || defaultNow;
|
|
84
86
|
}
|
|
@@ -20,11 +20,11 @@ async function ensureD1Schema(database, statements) {
|
|
|
20
20
|
}
|
|
21
21
|
/** A schema a store creates once, on first use, unless its caller manages it (`enabled: false`). */
|
|
22
22
|
var D1Schema = class {
|
|
23
|
+
ready = false;
|
|
23
24
|
constructor(database, statements, enabled = true) {
|
|
24
25
|
this.database = database;
|
|
25
26
|
this.statements = statements;
|
|
26
27
|
this.enabled = enabled;
|
|
27
|
-
this.ready = false;
|
|
28
28
|
}
|
|
29
29
|
async ensure() {
|
|
30
30
|
if (!this.enabled || this.ready) return;
|
|
@@ -41,6 +41,9 @@ function prepareD1TenantStatement(database, scope, sql, values = []) {
|
|
|
41
41
|
* and the schema is created on first use unless the caller manages it (`ensureSchema: false`).
|
|
42
42
|
*/
|
|
43
43
|
var D1TenantTable = class {
|
|
44
|
+
database;
|
|
45
|
+
scope;
|
|
46
|
+
schema;
|
|
44
47
|
constructor(input, store, schema) {
|
|
45
48
|
this.database = input.database;
|
|
46
49
|
this.scope = requireD1TenantScope(input, store);
|
|
@@ -486,8 +486,10 @@ function prepareD1InsertCasGuardStatement(database) {
|
|
|
486
486
|
return database.prepare(D1_BATCH_CAS_GUARD_SQL);
|
|
487
487
|
}
|
|
488
488
|
var D1WalletAuthMethodStore = class {
|
|
489
|
+
adapterKind = "d1";
|
|
490
|
+
table;
|
|
491
|
+
v2Schema;
|
|
489
492
|
constructor(input) {
|
|
490
|
-
this.adapterKind = "d1";
|
|
491
493
|
this.table = new D1TenantTable(input, WALLET_AUTH_METHOD_D1_STORE, WALLET_AUTH_METHOD_STORE_D1_SCHEMA_SQL);
|
|
492
494
|
this.v2Schema = new D1Schema(input.database, WALLET_AUTH_METHOD_STORE_D1_SCHEMA_V2_SQL, input.ensureSchema !== false);
|
|
493
495
|
}
|
|
@@ -387,9 +387,12 @@ function buildWalletEcdsaSignerRecord(input) {
|
|
|
387
387
|
};
|
|
388
388
|
}
|
|
389
389
|
var D1WalletStore = class {
|
|
390
|
+
adapterKind = "d1";
|
|
391
|
+
database;
|
|
392
|
+
scope;
|
|
393
|
+
ensureSchemaOnUse;
|
|
394
|
+
schemaReady = false;
|
|
390
395
|
constructor(input) {
|
|
391
|
-
this.adapterKind = "d1";
|
|
392
|
-
this.schemaReady = false;
|
|
393
396
|
const normalized = normalizeD1WalletStoreOptions(input);
|
|
394
397
|
this.database = normalized.database;
|
|
395
398
|
this.scope = {
|
|
@@ -4,10 +4,7 @@ import { base64UrlDecode, base64UrlEncode } from "../../shared-ts/src/utils/base
|
|
|
4
4
|
//#region src/core/deviceLinking/linkedDeviceManagement.ts
|
|
5
5
|
const MAX_LINKED_DEVICE_LIST_LIMIT_V1 = 50;
|
|
6
6
|
var LinkedDeviceListCursorError = class extends Error {
|
|
7
|
-
|
|
8
|
-
super(..._args);
|
|
9
|
-
this.kind = "linked_device_list_cursor_error_v1";
|
|
10
|
-
}
|
|
7
|
+
kind = "linked_device_list_cursor_error_v1";
|
|
11
8
|
};
|
|
12
9
|
var LinkedDeviceManagementServiceV1 = class {
|
|
13
10
|
constructor(options) {
|
|
@@ -7,6 +7,8 @@ import { activeStateV1, approvalTranscriptMatchesDigest, authorityPendingStateV1
|
|
|
7
7
|
import { validateApprovalMatchesSession, validateLinkedDeviceRequestedAuthorityV1, validateSourceContributionApprovalMatchesSession, validateSourceContributionPreparationMatchesApproval } from "./linkedDeviceSessionApproval.js";
|
|
8
8
|
//#region src/core/deviceLinking/linkedDeviceSession.ts
|
|
9
9
|
var LinkedDeviceSessionServiceV1 = class {
|
|
10
|
+
store;
|
|
11
|
+
authorization;
|
|
10
12
|
constructor(input) {
|
|
11
13
|
this.store = input.store;
|
|
12
14
|
this.authorization = input.authorization;
|
|
@@ -5,6 +5,7 @@ import { LINKED_DEVICE_CLOCK_SKEW_TOLERANCE_MS_V1, LINKED_DEVICE_REQUEST_PROOF_H
|
|
|
5
5
|
import { hasExactKeys } from "../../shared-ts/src/utils/exactKeys.js";
|
|
6
6
|
//#region src/core/deviceLinking/requestProof.ts
|
|
7
7
|
var LinkedDeviceRequestProofVerifierV1 = class {
|
|
8
|
+
nonceStore;
|
|
8
9
|
constructor(input) {
|
|
9
10
|
this.nonceStore = input.nonceStore;
|
|
10
11
|
}
|
|
@@ -18,6 +18,8 @@ function resolveSigningWorkerTransport(input) {
|
|
|
18
18
|
};
|
|
19
19
|
}
|
|
20
20
|
var RouterAbEcdsaPresignRuntime = class {
|
|
21
|
+
handlers;
|
|
22
|
+
signingWorkerTransport;
|
|
21
23
|
constructor(input) {
|
|
22
24
|
this.signingWorkerTransport = resolveSigningWorkerTransport(input.signingWorkerTransport);
|
|
23
25
|
this.handlers = new RouterAbEcdsaDerivationPoolFillHandlers({
|
|
@@ -3,6 +3,9 @@ import { MAX_WALLET_SESSION_REMAINING_USES, MAX_WALLET_SESSION_TTL_MS } from "..
|
|
|
3
3
|
import { validateRouterAbNormalSigningServerPolicy } from "../ThresholdService/routerAbNormalSigningPolicy.js";
|
|
4
4
|
//#region src/core/routerAbSigning/RouterAbNormalSigningRuntime.ts
|
|
5
5
|
var RouterAbNormalSigningRuntime = class {
|
|
6
|
+
walletSessionStore;
|
|
7
|
+
ecdsaWalletSessionStore;
|
|
8
|
+
config;
|
|
6
9
|
constructor(input) {
|
|
7
10
|
this.walletSessionStore = input.walletSessionStore;
|
|
8
11
|
this.ecdsaWalletSessionStore = input.ecdsaWalletSessionStore;
|
|
@@ -10,6 +10,14 @@ function firstKey(o) {
|
|
|
10
10
|
return keys.length ? keys[0] : void 0;
|
|
11
11
|
}
|
|
12
12
|
var NearRpcError = class NearRpcError extends Error {
|
|
13
|
+
code;
|
|
14
|
+
type;
|
|
15
|
+
kind;
|
|
16
|
+
index;
|
|
17
|
+
short;
|
|
18
|
+
details;
|
|
19
|
+
operation;
|
|
20
|
+
failureKind;
|
|
13
21
|
constructor(params) {
|
|
14
22
|
super(params.message);
|
|
15
23
|
this.name = params.name || "NearRpcError";
|
|
@@ -93,7 +93,6 @@ function validateOrdinaryInactiveSignerMaterialReservationRequestV1(request) {
|
|
|
93
93
|
const targetBinding = parseRouterAbEd25519YaoCeremonyBindingV1(request.preparation.targetBinding);
|
|
94
94
|
if (targetBinding.operation !== "registration") throw new Error("ordinary Ed25519 target binding must use registration");
|
|
95
95
|
assertMaterialActivationMatchesV1(request.plannedActivationRef, routerAbMpcMaterialActivationRefFromWire(targetBinding.material_activation));
|
|
96
|
-
if (request.preparation.sourceContribution.sourceBinding.operation !== "registration") throw new Error("ordinary Ed25519 source contribution must use registration");
|
|
97
96
|
parseRouterAbEd25519YaoParticipantIdsV1(request.preparation.sourceContribution.participantIds);
|
|
98
97
|
return;
|
|
99
98
|
}
|
|
@@ -25,9 +25,9 @@ const ECDSA_REGISTRATION_PATH = "/router-ab/ecdsa-derivation/register";
|
|
|
25
25
|
const REGISTRATION_RESPOND_PATH = "/wallets/register/respond";
|
|
26
26
|
const LINK_SOURCE_CONTRIBUTION_EXECUTE_PATH = /^\/wallet\/device-linking\/v1\/sessions\/[^/]+\/source-contribution\/execute$/;
|
|
27
27
|
var DropEcdsaRouterReply = class {
|
|
28
|
+
observed = false;
|
|
28
29
|
constructor(baseFetch) {
|
|
29
30
|
this.baseFetch = baseFetch;
|
|
30
|
-
this.observed = false;
|
|
31
31
|
}
|
|
32
32
|
async fetch(input, init) {
|
|
33
33
|
const request = new Request(input, init);
|
|
@@ -42,9 +42,9 @@ var DropEcdsaRouterReply = class {
|
|
|
42
42
|
}
|
|
43
43
|
};
|
|
44
44
|
var UnavailableTenantRootLineage = class {
|
|
45
|
+
lookups = 0;
|
|
45
46
|
constructor(base) {
|
|
46
47
|
this.base = base;
|
|
47
|
-
this.lookups = 0;
|
|
48
48
|
}
|
|
49
49
|
async fetch(input, init) {
|
|
50
50
|
const request = input instanceof Request ? input : new Request(input, init);
|
|
@@ -11,9 +11,9 @@ function parseLocalIntendedEcdsaFinalizeFaultTokenV1(value) {
|
|
|
11
11
|
return isLocalIntendedYaoFaultTokenV1(value) ? value : null;
|
|
12
12
|
}
|
|
13
13
|
var LocalIntendedEcdsaFinalizeFaultControllerV1 = class {
|
|
14
|
+
state = { kind: "armed" };
|
|
14
15
|
constructor(baseFetch) {
|
|
15
16
|
this.baseFetch = baseFetch;
|
|
16
|
-
this.state = { kind: "armed" };
|
|
17
17
|
}
|
|
18
18
|
async fetch(input, init) {
|
|
19
19
|
const request = new Request(input, init);
|
|
@@ -18,9 +18,9 @@ function parseLocalIntendedLinkExecuteFaultTokenV1(value) {
|
|
|
18
18
|
return { value };
|
|
19
19
|
}
|
|
20
20
|
var LocalIntendedLinkExecuteFaultControllerV1 = class {
|
|
21
|
+
state = { kind: "armed" };
|
|
21
22
|
constructor(baseFetch) {
|
|
22
23
|
this.baseFetch = baseFetch;
|
|
23
|
-
this.state = { kind: "armed" };
|
|
24
24
|
}
|
|
25
25
|
async fetch(input, init) {
|
|
26
26
|
const request = new Request(input, init);
|
|
@@ -22,11 +22,11 @@ function localMaterialAdmissionFault(request, database) {
|
|
|
22
22
|
}
|
|
23
23
|
/** Retire material after resolution and before one admission statement, then restore it. */
|
|
24
24
|
var LocalMaterialAdmissionFaultDatabase = class {
|
|
25
|
+
scope = null;
|
|
26
|
+
state = { kind: "armed" };
|
|
25
27
|
constructor(base, mode) {
|
|
26
28
|
this.base = base;
|
|
27
29
|
this.mode = mode;
|
|
28
|
-
this.scope = null;
|
|
29
|
-
this.state = { kind: "armed" };
|
|
30
30
|
}
|
|
31
31
|
prepare(query) {
|
|
32
32
|
const inner = this.base.prepare(query);
|
|
@@ -16,9 +16,9 @@ function parseLocalIntendedRevokeFaultTokenV1(value) {
|
|
|
16
16
|
}
|
|
17
17
|
/** The signer database, refusing one auth-method revocation's batch. */
|
|
18
18
|
var LocalIntendedRevokeFaultDatabaseV1 = class {
|
|
19
|
+
state = { kind: "armed" };
|
|
19
20
|
constructor(base) {
|
|
20
21
|
this.base = base;
|
|
21
|
-
this.state = { kind: "armed" };
|
|
22
22
|
}
|
|
23
23
|
prepare(query) {
|
|
24
24
|
return new LocalIntendedRevokeFaultStatementV1(this, RECORD_ANSWER_PATTERN.test(query), SPEND_CODE_PATTERN.test(query), this.base.prepare(query));
|
|
@@ -16,9 +16,9 @@ function parseLocalIntendedSessionAdmissionFaultTokenV1(value) {
|
|
|
16
16
|
}
|
|
17
17
|
/** The signer database, holding one request after its session read. */
|
|
18
18
|
var LocalIntendedSessionAdmissionFaultDatabaseV1 = class {
|
|
19
|
+
state = { kind: "armed" };
|
|
19
20
|
constructor(base) {
|
|
20
21
|
this.base = base;
|
|
21
|
-
this.state = { kind: "armed" };
|
|
22
22
|
}
|
|
23
23
|
prepare(query) {
|
|
24
24
|
const inner = this.base.prepare(query);
|
|
@@ -13,9 +13,9 @@ function parseLocalIntendedYaoExportFaultTokenV1(value) {
|
|
|
13
13
|
}
|
|
14
14
|
/** The signer database, losing itself once after an export authorization commits. */
|
|
15
15
|
var LocalIntendedYaoExportFaultDatabaseV1 = class {
|
|
16
|
+
state = { kind: "armed" };
|
|
16
17
|
constructor(base) {
|
|
17
18
|
this.base = base;
|
|
18
|
-
this.state = { kind: "armed" };
|
|
19
19
|
}
|
|
20
20
|
prepare(query) {
|
|
21
21
|
return new LocalIntendedYaoExportFaultStatementV1(this, statementRole(query), this.base.prepare(query));
|
|
@@ -44,10 +44,10 @@ function parseLocalIntendedKeptRouterRequestV1(value) {
|
|
|
44
44
|
});
|
|
45
45
|
}
|
|
46
46
|
var LocalIntendedYaoFaultControllerV1 = class {
|
|
47
|
+
state = { kind: "idle" };
|
|
47
48
|
constructor(baseFetch, keepRunning) {
|
|
48
49
|
this.baseFetch = baseFetch;
|
|
49
50
|
this.keepRunning = keepRunning;
|
|
50
|
-
this.state = { kind: "idle" };
|
|
51
51
|
}
|
|
52
52
|
arm(mode) {
|
|
53
53
|
if (this.state.kind !== "idle") {
|
|
@@ -13,9 +13,9 @@ function parseLocalIntendedYaoFinalizeFaultTokenV1(value) {
|
|
|
13
13
|
}
|
|
14
14
|
/** The signer database, losing itself once after a Yao decision commits. */
|
|
15
15
|
var LocalIntendedYaoFinalizeFaultDatabaseV1 = class {
|
|
16
|
+
state = { kind: "armed" };
|
|
16
17
|
constructor(base) {
|
|
17
18
|
this.base = base;
|
|
18
|
-
this.state = { kind: "armed" };
|
|
19
19
|
}
|
|
20
20
|
prepare(query) {
|
|
21
21
|
return new LocalIntendedYaoFinalizeFaultStatementV1(this, DECISION_INSERT_PATTERN.test(query), this.base.prepare(query));
|
|
@@ -20,14 +20,14 @@ function parseLocalIntendedYaoRecoveryFaultTokenV1(value) {
|
|
|
20
20
|
}
|
|
21
21
|
/** The Gateway's Router binding, faulting every call to a recovery execution. */
|
|
22
22
|
var LocalIntendedYaoRecoveryFaultControllerV1 = class {
|
|
23
|
+
executed = false;
|
|
24
|
+
failed = false;
|
|
25
|
+
kept = false;
|
|
23
26
|
constructor(baseFetch, mode, token, storage) {
|
|
24
27
|
this.baseFetch = baseFetch;
|
|
25
28
|
this.mode = mode;
|
|
26
29
|
this.token = token;
|
|
27
30
|
this.storage = storage;
|
|
28
|
-
this.executed = false;
|
|
29
|
-
this.failed = false;
|
|
30
|
-
this.kept = false;
|
|
31
31
|
}
|
|
32
32
|
async fetch(input, init) {
|
|
33
33
|
const request = new Request(input, init);
|
|
@@ -20,12 +20,12 @@ function parseLocalIntendedYaoSigningFaultTokenV1(value) {
|
|
|
20
20
|
}
|
|
21
21
|
/** The Gateway's Router binding, keeping the first NEAR finalize it carries. */
|
|
22
22
|
var LocalIntendedYaoSigningFaultControllerV1 = class {
|
|
23
|
+
kept = false;
|
|
23
24
|
constructor(baseFetch, mode, token, storage) {
|
|
24
25
|
this.baseFetch = baseFetch;
|
|
25
26
|
this.mode = mode;
|
|
26
27
|
this.token = token;
|
|
27
28
|
this.storage = storage;
|
|
28
|
-
this.kept = false;
|
|
29
29
|
}
|
|
30
30
|
async fetch(input, init) {
|
|
31
31
|
const request = new Request(input, init);
|
|
@@ -4,6 +4,7 @@ import { parseWalletRegistrationSetupReservation, proposeWalletRegistrationSetup
|
|
|
4
4
|
/** The standalone host never relocates a wallet, so every wallet keeps its first generation. */
|
|
5
5
|
const LOCAL_OWNERSHIP_GENERATION = 1;
|
|
6
6
|
var LocalRegistrationSetupAuthority = class {
|
|
7
|
+
storage;
|
|
7
8
|
constructor(database, scope) {
|
|
8
9
|
this.scope = scope;
|
|
9
10
|
this.storage = new D1RegistrationCeremonyRecordStore({
|
|
@@ -283,10 +283,10 @@ function createD1LinkedDeviceComposition(input) {
|
|
|
283
283
|
};
|
|
284
284
|
}
|
|
285
285
|
var CloudflareD1SignedDelegateExecutor = class {
|
|
286
|
+
signerWasmState = { signerWasmReady: false };
|
|
287
|
+
logger = normalizeLogger();
|
|
286
288
|
constructor(options) {
|
|
287
289
|
this.options = options;
|
|
288
|
-
this.signerWasmState = { signerWasmReady: false };
|
|
289
|
-
this.logger = normalizeLogger();
|
|
290
290
|
}
|
|
291
291
|
async execute(input) {
|
|
292
292
|
const relayerAccount = this.options.relayerAccount;
|
|
@@ -78,6 +78,11 @@ function activeV2AuthorityMethodBindings(scope, session) {
|
|
|
78
78
|
];
|
|
79
79
|
}
|
|
80
80
|
var CloudflareD1AuthorizationStore = class {
|
|
81
|
+
database;
|
|
82
|
+
namespace;
|
|
83
|
+
walletSignerScope;
|
|
84
|
+
walletStore;
|
|
85
|
+
getLinkedDeviceAuthorityReader;
|
|
81
86
|
constructor(options) {
|
|
82
87
|
this.getLinkedDeviceAuthorityReader = options.getLinkedDeviceAuthorityReader ?? (() => null);
|
|
83
88
|
this.database = options.database;
|
|
@@ -8,6 +8,7 @@ const VAULT_PROXY_SECRET_AAD_DOMAIN_V1 = "seams:vault:proxy-secret:v1";
|
|
|
8
8
|
const AES_GCM_NONCE_BYTES = 12;
|
|
9
9
|
const AES_GCM_KEY_BYTES = 32;
|
|
10
10
|
var CloudflareD1VaultProxyStore = class {
|
|
11
|
+
key;
|
|
11
12
|
constructor(database, namespace, encryptionKey) {
|
|
12
13
|
this.database = database;
|
|
13
14
|
this.namespace = namespace;
|
package/dist/esm/router/cloudflare/d1/deviceLinking/d1LinkedDeviceAuthorityInstallService.js
CHANGED
|
@@ -39,6 +39,7 @@ var LinkedDeviceActivationIntegrityErrorV1 = class extends Error {
|
|
|
39
39
|
/** Exact-method cleanup remains available for five minutes after server receipt creation. */
|
|
40
40
|
const LINKED_DEVICE_ACKNOWLEDGEMENT_CLEANUP_WINDOW_MS = 300 * 1e3;
|
|
41
41
|
var D1LinkedDeviceAuthorityInstallServiceV1 = class {
|
|
42
|
+
nowV1;
|
|
42
43
|
constructor(options) {
|
|
43
44
|
this.options = options;
|
|
44
45
|
this.nowV1 = options.nowV1 ?? Date.now;
|
|
@@ -3,6 +3,8 @@ import { d1ChangedRows, queryD1One } from "../../../../storage/d1Sql.js";
|
|
|
3
3
|
//#region src/router/cloudflare/d1/deviceLinking/d1LinkedDeviceEd25519ExportRootStore.ts
|
|
4
4
|
const TRANSFER_TABLE = "linked_device_ed25519_export_root_transfers";
|
|
5
5
|
var D1LinkedDeviceEd25519ExportRootStoreV1 = class {
|
|
6
|
+
database;
|
|
7
|
+
scope;
|
|
6
8
|
constructor(options) {
|
|
7
9
|
this.database = options.database;
|
|
8
10
|
this.scope = normalizeScope(options.scope);
|
|
@@ -12,6 +12,8 @@ import { parseLinkedDeviceEmailOtpGrantRecordV1 } from "../../../../core/deviceL
|
|
|
12
12
|
*/
|
|
13
13
|
const GRANT_TABLE = "linked_device_email_otp_grants";
|
|
14
14
|
var D1LinkedDeviceEmailOtpGrantStoreV1 = class {
|
|
15
|
+
database;
|
|
16
|
+
scope;
|
|
15
17
|
constructor(input) {
|
|
16
18
|
this.database = input.database;
|
|
17
19
|
this.scope = input.scope;
|
|
@@ -15,6 +15,9 @@ function resolveSentEmailOtpChallengeV1(session, challengeId) {
|
|
|
15
15
|
return challenge;
|
|
16
16
|
}
|
|
17
17
|
var D1LinkedDeviceEmailOtpTargetFactorV1 = class {
|
|
18
|
+
options;
|
|
19
|
+
grantTtlMs;
|
|
20
|
+
resendCooldownMs;
|
|
18
21
|
constructor(options) {
|
|
19
22
|
this.options = options;
|
|
20
23
|
this.grantTtlMs = requirePositiveMs(options.grantTtlMs ?? DEFAULT_GRANT_TTL_MS, "grantTtlMs");
|
package/dist/esm/router/cloudflare/d1/deviceLinking/d1LinkedDeviceOwnerAuthorizationProvider.js
CHANGED
|
@@ -7,6 +7,7 @@ import { parseDigestB64u } from "../../../../shared-ts/src/utils/canonicalPrimit
|
|
|
7
7
|
import { parseSecp256k1CompressedPublicKeyB64u } from "../../../../shared-ts/src/passkey-custody/primitives.js";
|
|
8
8
|
import { routerAbMpcMaterialActivationRefFromWire } from "../../../../shared-ts/src/utils/routerAbNormalSigningIdentity.js";
|
|
9
9
|
import { deriveRouterAbEd25519YaoApplicationBindingDigestV1 } from "../../../../shared-ts/src/utils/routerAbEd25519YaoDigests.js";
|
|
10
|
+
import { parseRouterAbEd25519YaoActivationBindingV1 } from "../../../../shared-ts/src/utils/routerAbEd25519Yao.js";
|
|
10
11
|
import { buildEmailOtpWalletAuthAuthority, buildPasskeyWalletAuthAuthority, walletAuthAuthorityRef } from "../../../../shared-ts/src/utils/walletAuthAuthority.js";
|
|
11
12
|
import { walletAuthorityDigestsMatchV1 } from "../../../../shared-ts/src/authorization/walletAuthority.js";
|
|
12
13
|
import { buildWalletSessionLinkedDeviceOwnerAuthorizationV1, parseQrLinkedDeviceSessionPayloadV5 } from "../../../../shared-ts/src/device-linking/parsers.js";
|
|
@@ -91,7 +92,7 @@ async function readD1LinkedDeviceOwnerSourceChildV1(projectionSource, linkedSour
|
|
|
91
92
|
* lane stays the wallet's.
|
|
92
93
|
*/
|
|
93
94
|
function linkedEd25519SourceChildResolutionV1(resolution, linked) {
|
|
94
|
-
const binding = linked.targetBinding;
|
|
95
|
+
const binding = parseRouterAbEd25519YaoActivationBindingV1(linked.targetBinding);
|
|
95
96
|
if (binding.operation !== "registration" || base64UrlEncode(Uint8Array.from(binding.stable_key_context_binding)) !== resolution.stableContextBindingB64u || base64UrlEncode(Uint8Array.from(linked.activationReceipt.registered_public_key)) !== resolution.registeredPublicKeyB64u) return null;
|
|
96
97
|
return {
|
|
97
98
|
...resolution,
|
|
@@ -158,9 +159,7 @@ async function sourceChildResolutionFromSignerV1(input) {
|
|
|
158
159
|
const source = ownerLaneProtocolSourceV1(input.projection);
|
|
159
160
|
if (input.signer.version === "wallet_signer_ed25519_v1") {
|
|
160
161
|
if (input.projection.walletKey.keyFamily !== "ed25519") return null;
|
|
161
|
-
if (input.signer.activeYaoCapability.activationResult.binding.operation !== "registration") return null;
|
|
162
162
|
const capability = input.signer.activeYaoCapability;
|
|
163
|
-
if (capability.version !== "wallet_ed25519_yao_registration_capability_v1") return null;
|
|
164
163
|
const application = capability.admissionRequest.application_binding;
|
|
165
164
|
const applicationBindingDigestB64u = parseDigestB64u(base64UrlEncode(Uint8Array.from(await deriveRouterAbEd25519YaoApplicationBindingDigestV1(application))));
|
|
166
165
|
const stableContextBindingB64u = parseDigestB64u(base64UrlEncode(Uint8Array.from(capability.activationResult.binding.stable_key_context_binding)));
|
|
@@ -7,6 +7,8 @@ import { d1ChangedRows } from "../../../../storage/d1Sql.js";
|
|
|
7
7
|
const NONCE_TABLE = "linked_device_request_proof_nonces";
|
|
8
8
|
const NONCE_EXPIRY_CLEANUP_BATCH_LIMIT_V1 = 64;
|
|
9
9
|
var D1LinkedDeviceRequestProofNonceStoreV1 = class {
|
|
10
|
+
database;
|
|
11
|
+
scope;
|
|
10
12
|
constructor(options) {
|
|
11
13
|
this.database = options.database;
|
|
12
14
|
this.scope = normalizeScope(options.scope);
|
|
@@ -12,6 +12,10 @@ import { secureRandomBase64Url } from "../../../../shared-ts/src/utils/secureRan
|
|
|
12
12
|
* copied from the verified owner lane.
|
|
13
13
|
*/
|
|
14
14
|
var D1LinkedDeviceSourceContributionPreparationPlannerV1 = class {
|
|
15
|
+
resolveOwnerSourceChildV1;
|
|
16
|
+
deriverAInputPublicKeyB64u;
|
|
17
|
+
deriverBInputPublicKeyB64u;
|
|
18
|
+
signingWorkerRecipientPublicKeyB64u;
|
|
15
19
|
constructor(input) {
|
|
16
20
|
this.resolveOwnerSourceChildV1 = input.resolveOwnerSourceChildV1;
|
|
17
21
|
this.deriverAInputPublicKeyB64u = requireCanonicalBytes32(input.deriverAInputPublicKeyB64u, "deriver A input public key");
|
|
@@ -147,8 +151,8 @@ function bindingWithMaterialActivation(source, materialActivation) {
|
|
|
147
151
|
return {
|
|
148
152
|
lifecycle: {
|
|
149
153
|
lifecycle_id: `linked-device-source-preserving:${ceremonyIdentity}`,
|
|
150
|
-
work_kind:
|
|
151
|
-
primitive_request_kind:
|
|
154
|
+
work_kind: "registration_prepare",
|
|
155
|
+
primitive_request_kind: "registration",
|
|
152
156
|
root_share_epoch: source.lifecycle.root_share_epoch,
|
|
153
157
|
account_id: source.lifecycle.account_id,
|
|
154
158
|
session_id: `linked-device-source-preserving:${ceremonyIdentity}`,
|
package/dist/esm/router/cloudflare/d1/deviceLinking/d1LinkedDeviceTargetAuthenticatorStore.js
CHANGED
|
@@ -4,6 +4,9 @@ import { d1ChangedRows } from "../../../../storage/d1Sql.js";
|
|
|
4
4
|
//#region src/router/cloudflare/d1/deviceLinking/d1LinkedDeviceTargetAuthenticatorStore.ts
|
|
5
5
|
const TARGET_CREDENTIAL_TABLE = "linked_device_target_credentials";
|
|
6
6
|
var D1LinkedDeviceTargetAuthenticatorStoreV1 = class {
|
|
7
|
+
database;
|
|
8
|
+
scope;
|
|
9
|
+
target;
|
|
7
10
|
constructor(input) {
|
|
8
11
|
this.database = input.database;
|
|
9
12
|
this.scope = input.scope;
|
package/dist/esm/router/cloudflare/d1/deviceLinking/d1LinkedDeviceTargetCredentialProvider.js
CHANGED
|
@@ -18,6 +18,7 @@ import { buildVerifiedLinkInputV1, buildVerifiedTargetFactorV1 } from "./d1Linke
|
|
|
18
18
|
//#region src/router/cloudflare/d1/deviceLinking/d1LinkedDeviceTargetCredentialProvider.ts
|
|
19
19
|
/** Verifies the browser-signed ceremony origin against the configured RP ID. */
|
|
20
20
|
var LinkedDeviceWebAuthnRegistrationVerifierV1 = class {
|
|
21
|
+
expectedRpId;
|
|
21
22
|
constructor(expectedRpId) {
|
|
22
23
|
this.expectedRpId = expectedRpId;
|
|
23
24
|
}
|
|
@@ -109,15 +110,22 @@ const TARGET_COMMIT_RESERVATION_TABLE = "linked_device_target_commit_reservation
|
|
|
109
110
|
const TARGET_COMMIT_WAIT_ATTEMPTS = 25;
|
|
110
111
|
const TARGET_COMMIT_WAIT_MS = 10;
|
|
111
112
|
var LinkedDeviceRetiredTargetRegistrationShapeErrorV1 = class extends Error {
|
|
113
|
+
kind = "retired_target_registration_shape";
|
|
112
114
|
constructor() {
|
|
113
115
|
super("relink_required:retired_target_registration_shape");
|
|
114
|
-
this.kind = "retired_target_registration_shape";
|
|
115
116
|
this.name = "LinkedDeviceRetiredTargetRegistrationShapeErrorV1";
|
|
116
117
|
}
|
|
117
118
|
};
|
|
118
119
|
var D1LinkedDeviceTargetCredentialProviderV1 = class {
|
|
120
|
+
database;
|
|
121
|
+
scope;
|
|
122
|
+
verifier;
|
|
123
|
+
emailOtpGrants;
|
|
124
|
+
planner;
|
|
125
|
+
sourceContributionPreparationPlanner;
|
|
126
|
+
verifiedLinkBuilder;
|
|
127
|
+
inFlightCommits = /* @__PURE__ */ new Map();
|
|
119
128
|
constructor(input) {
|
|
120
|
-
this.inFlightCommits = /* @__PURE__ */ new Map();
|
|
121
129
|
this.database = input.database;
|
|
122
130
|
this.scope = normalizeScope(input.scope);
|
|
123
131
|
this.verifier = input.verifier;
|
|
@@ -13,6 +13,9 @@ const DEFAULT_TARGET_PREPARATION_TTL_MS = 300 * 1e3;
|
|
|
13
13
|
* reservation identities are derived only after Device 2 verifies its factor.
|
|
14
14
|
*/
|
|
15
15
|
var D1LinkedDeviceTargetPlannerV1 = class {
|
|
16
|
+
resolveOwnerSourceChildV1;
|
|
17
|
+
targetPasskeyRpId;
|
|
18
|
+
preparationTtlMs;
|
|
16
19
|
constructor(input) {
|
|
17
20
|
this.resolveOwnerSourceChildV1 = input.resolveOwnerSourceChildV1;
|
|
18
21
|
const targetPasskeyRpId = parseWebAuthnRpId(input.targetPasskeyRpId);
|
|
@@ -66,8 +66,13 @@ function parseRecordJson(value) {
|
|
|
66
66
|
return JSON.parse(value);
|
|
67
67
|
}
|
|
68
68
|
var CloudflareD1RouterAbEd25519YaoCapabilityPersistence = class {
|
|
69
|
+
database;
|
|
70
|
+
scope;
|
|
71
|
+
walletStore;
|
|
72
|
+
ensureSchemaOnUse;
|
|
73
|
+
now;
|
|
74
|
+
schemaReady = false;
|
|
69
75
|
constructor(options) {
|
|
70
|
-
this.schemaReady = false;
|
|
71
76
|
this.database = options.database;
|
|
72
77
|
this.scope = options.scope;
|
|
73
78
|
this.walletStore = options.walletStore;
|
|
@@ -6,6 +6,8 @@ import { D1_BATCH_CAS_GUARD_SQL } from "../../../../storage/d1Sql.js";
|
|
|
6
6
|
* visible, and never changes.
|
|
7
7
|
*/
|
|
8
8
|
var CloudflareD1Ed25519YaoLifecycleDecisionStoreV1 = class {
|
|
9
|
+
database;
|
|
10
|
+
scope;
|
|
9
11
|
constructor(input) {
|
|
10
12
|
this.database = input.database;
|
|
11
13
|
this.scope = {
|
|
@@ -7,10 +7,10 @@ function createRouterAbEd25519YaoProductRegistrationPartitionedStateStoreFromD1V
|
|
|
7
7
|
return createRouterAbEd25519YaoProductRegistrationPartitionedStateStoreV1(new D1LifecycleRecords(options, createD1Ed25519YaoLifecycleRecords(options)));
|
|
8
8
|
}
|
|
9
9
|
var D1LifecycleRecords = class {
|
|
10
|
+
observed = /* @__PURE__ */ new Map();
|
|
10
11
|
constructor(options, records) {
|
|
11
12
|
this.options = options;
|
|
12
13
|
this.records = records;
|
|
13
|
-
this.observed = /* @__PURE__ */ new Map();
|
|
14
14
|
}
|
|
15
15
|
async readMany(keys) {
|
|
16
16
|
const entries = await this.records.readMany(keys);
|
|
@@ -14,6 +14,11 @@ function emailOtpProviderIdentityMismatch() {
|
|
|
14
14
|
return failure("provider_identity_mismatch", "Email OTP enrollment does not match the requested provider user");
|
|
15
15
|
}
|
|
16
16
|
var CloudflareD1EmailOtpChallengeIssuer = class {
|
|
17
|
+
config;
|
|
18
|
+
emailOtpChallenges;
|
|
19
|
+
emailOtpDelivery;
|
|
20
|
+
emailOtpEnrollments;
|
|
21
|
+
emailOtpRateLimits;
|
|
17
22
|
constructor(input) {
|
|
18
23
|
this.config = input.config;
|
|
19
24
|
this.emailOtpChallenges = input.emailOtpChallenges;
|
|
@@ -8,6 +8,14 @@ function errorMessage(error) {
|
|
|
8
8
|
return error instanceof Error ? error.message : String(error || "");
|
|
9
9
|
}
|
|
10
10
|
var CloudflareD1EmailOtpChallengeService = class {
|
|
11
|
+
challenges;
|
|
12
|
+
devOutboxEnabled;
|
|
13
|
+
finalizer;
|
|
14
|
+
grantTtlMs;
|
|
15
|
+
grants;
|
|
16
|
+
issuer;
|
|
17
|
+
registrationAttempts;
|
|
18
|
+
verifier;
|
|
11
19
|
constructor(input) {
|
|
12
20
|
this.challenges = input.challenges;
|
|
13
21
|
this.devOutboxEnabled = input.devOutboxEnabled;
|
|
@@ -8,8 +8,12 @@ const REGISTRATION_CEREMONY_CAS_GUARD_SQL = `INSERT INTO registration_ceremony_c
|
|
|
8
8
|
SELECT 1
|
|
9
9
|
WHERE changes() = 0`;
|
|
10
10
|
var CloudflareD1EmailOtpChallengeStore = class {
|
|
11
|
+
database;
|
|
12
|
+
namespace;
|
|
13
|
+
orgId;
|
|
14
|
+
projectId;
|
|
15
|
+
envId;
|
|
11
16
|
constructor(input) {
|
|
12
|
-
this.prepare = (sql, values) => this.database.prepare(sql).bind(...this.scopeValues(values));
|
|
13
17
|
this.database = input.database;
|
|
14
18
|
this.namespace = input.namespace;
|
|
15
19
|
this.orgId = input.orgId;
|
|
@@ -277,6 +281,7 @@ var CloudflareD1EmailOtpChallengeStore = class {
|
|
|
277
281
|
)
|
|
278
282
|
RETURNING record_json, expires_at_ms`).bind(...this.scopeValues([]), ...this.scopeValues([...emailOtpChallengeContextValues(input), input.nowMs])).first());
|
|
279
283
|
}
|
|
284
|
+
prepare = (sql, values) => this.database.prepare(sql).bind(...this.scopeValues(values));
|
|
280
285
|
scopeValues(values) {
|
|
281
286
|
return [
|
|
282
287
|
this.namespace,
|
|
@@ -39,6 +39,10 @@ function emailOtpProviderIdentityMismatch() {
|
|
|
39
39
|
};
|
|
40
40
|
}
|
|
41
41
|
var CloudflareD1EmailOtpChallengeVerifier = class {
|
|
42
|
+
emailOtpChallenges;
|
|
43
|
+
emailOtpEnrollments;
|
|
44
|
+
emailOtpRateLimits;
|
|
45
|
+
lockoutTtlMs;
|
|
42
46
|
constructor(input) {
|
|
43
47
|
this.emailOtpChallenges = input.emailOtpChallenges;
|
|
44
48
|
this.emailOtpEnrollments = input.emailOtpEnrollments;
|