@seams/wallet-server 0.27.0 → 0.29.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 +19 -4
- package/artifact-manifest.json +28 -13
- package/cloudflare-router-ab/build/deriver-a/build-stamp.json +1 -1
- package/cloudflare-router-ab/build/deriver-b/build-stamp.json +1 -1
- package/cloudflare-router-ab/build/router/build-stamp.json +1 -1
- package/cloudflare-router-ab/build/signing-worker/build-stamp.json +1 -1
- package/cloudflare-router-ab/build/tenant-root-control-plane/build-stamp.json +1 -1
- package/dist/esm/application-auth.js +2 -0
- package/dist/esm/auth/applicationAuth.js +85 -0
- package/dist/esm/auth/externalAuthService.js +149 -0
- package/dist/esm/auth/externalAuthStore.js +353 -0
- package/dist/esm/auth/externalOwnerOperations.js +82 -0
- package/dist/esm/authorization/domain.js +2 -2
- package/dist/esm/authorization/factorEvidence.js +1 -1
- package/dist/esm/authorization/service.js +2 -2
- package/dist/esm/authorization/vaultProxyUse.js +1 -1
- package/dist/esm/cloud-host.js +12 -11
- package/dist/esm/core/ThresholdService/validation.js +1 -1
- package/dist/esm/core/WebAuthnCredentialBindingStore.js +1 -1
- package/dist/esm/core/authService/webauthn.js +1 -1
- package/dist/esm/core/d1EcdsaSignerRead.js +1 -1
- package/dist/esm/core/d1WalletAuthMethodStore.js +2 -2
- package/dist/esm/core/d1WalletStore.js +1 -1
- package/dist/esm/core/deviceLinking/linkedDeviceEmailOtpGrant.js +1 -1
- package/dist/esm/core/deviceLinking/linkedDeviceManagement.js +1 -1
- package/dist/esm/core/deviceLinking/linkedDeviceSessionRecord.js +2 -2
- package/dist/esm/core/nearRelayerAccountProvisioning.js +2 -2
- package/dist/esm/hosted-wallet-gateway.js +3 -3
- package/dist/esm/index.js +1 -1
- package/dist/esm/router/auth/webAuthnCredentialCodecs.js +1 -1
- package/dist/esm/router/cloudflare/d1/auth/d1AuthorizedOperationRouteService.js +2 -0
- package/dist/esm/router/cloudflare/d1/auth/d1RecordedOwnerOperation.js +43 -0
- package/dist/esm/router/cloudflare/d1/auth/d1RouterApiAuthService.js +27 -3
- package/dist/esm/router/cloudflare/d1/authorization/d1AuthorizationStore.js +2 -2
- package/dist/esm/router/cloudflare/d1/authorization/d1VaultProxyStore.js +2 -2
- package/dist/esm/router/cloudflare/d1/deviceLinking/d1LinkedDeviceAuthorityInstallService.js +3 -3
- package/dist/esm/router/cloudflare/d1/deviceLinking/d1LinkedDeviceEd25519ExportRootStore.js +1 -1
- package/dist/esm/router/cloudflare/d1/deviceLinking/d1LinkedDeviceOwnerAuthorizationProvider.js +2 -2
- package/dist/esm/router/cloudflare/d1/deviceLinking/d1LinkedDeviceSessionStore.js +1 -1
- package/dist/esm/router/cloudflare/d1/deviceLinking/d1LinkedDeviceSourceContributionPreparationPlanner.js +1 -1
- package/dist/esm/router/cloudflare/d1/deviceLinking/d1LinkedDeviceTargetAuthenticatorStore.js +1 -1
- package/dist/esm/router/cloudflare/d1/deviceLinking/d1LinkedDeviceTargetCredentialProvider.js +1 -1
- package/dist/esm/router/cloudflare/d1/deviceLinking/d1LinkedDeviceTargetPlanner.js +1 -1
- package/dist/esm/router/cloudflare/d1/deviceLinking/d1LinkedDeviceVerifiedLinkBuilder.js +2 -2
- package/dist/esm/router/cloudflare/d1/deviceLinking/d1LinkedDeviceVerifiedLinkSourceReader.js +1 -1
- package/dist/esm/router/cloudflare/d1/ed25519Yao/d1Ed25519YaoCapabilityPersistence.js +1 -1
- package/dist/esm/router/cloudflare/d1/emailOtp/d1EmailOtpChallengeIssuer.js +1 -1
- package/dist/esm/router/cloudflare/d1/emailOtp/d1EmailOtpChallengeService.js +1 -1
- package/dist/esm/router/cloudflare/d1/emailOtp/d1EmailOtpChallengeStore.js +1 -1
- package/dist/esm/router/cloudflare/d1/emailOtp/d1EmailOtpRecords.js +2 -2
- package/dist/esm/router/cloudflare/d1/emailOtp/d1EmailOtpRecoveryService.js +3 -3
- package/dist/esm/router/cloudflare/d1/emailOtp/d1EmailOtpRegistrationEnrollmentFinalizer.js +1 -1
- package/dist/esm/router/cloudflare/d1/emailOtp/d1GoogleEmailOtpRegistrationAttemptStore.js +1 -1
- package/dist/esm/router/cloudflare/d1/emailOtp/d1GoogleEmailOtpSessionResolver.js +3 -3
- package/dist/esm/router/cloudflare/d1/oidc/d1OidcBoundary.js +7 -1
- package/dist/esm/router/cloudflare/d1/oidc/d1OidcVerificationService.js +1 -1
- package/dist/esm/router/cloudflare/d1/passkeyCustody/d1PasskeyCustodyRouteService.js +4 -4
- package/dist/esm/router/cloudflare/d1/passkeyCustody/d1WalletCustodyCommitStore.js +4 -4
- package/dist/esm/router/cloudflare/d1/passkeyCustody/d1WalletRecoveryGoogleEmailOtpRecords.js +1 -1
- package/dist/esm/router/cloudflare/d1/passkeyCustody/d1WalletRecoveryGoogleEmailOtpService.js +3 -3
- package/dist/esm/router/cloudflare/d1/registration/d1EvmFamilyEcdsaRegistrationBranch.js +1 -1
- package/dist/esm/router/cloudflare/d1/registration/d1RegistrationCeremonyRecords.js +11 -2
- package/dist/esm/router/cloudflare/d1/registration/d1RegistrationIntentService.js +1 -1
- package/dist/esm/router/cloudflare/d1/registration/d1WalletExecutionAuthority.js +9 -16
- package/dist/esm/router/cloudflare/d1/registration/d1WalletRegistrationCommitStore.js +1 -1
- package/dist/esm/router/cloudflare/d1/registration/d1WalletRegistrationService.js +46 -4
- package/dist/esm/router/cloudflare/d1/registration/d1WalletRegistrationSetup.js +12 -0
- package/dist/esm/router/cloudflare/d1/registration/d1WalletRegistrationSetupExecution.js +1 -0
- package/dist/esm/router/cloudflare/d1/registration/registrationCompletionWrite.js +1 -0
- package/dist/esm/router/cloudflare/d1/registration/walletRegistrationEstablishedSessionIssuer.js +1 -1
- package/dist/esm/router/cloudflare/d1/registration/walletRegistrationSessionCommitReceipt.js +36 -1
- package/dist/esm/router/cloudflare/d1/signingAdmission/d1RouterAbNormalSigningAdmissionStore.js +1 -1
- package/dist/esm/router/cloudflare/d1/wallet/authorizationSnapshotLayout.js +1 -0
- package/dist/esm/router/cloudflare/d1/wallet/d1VoiceIdWalletSessionChallenges.js +2 -2
- package/dist/esm/router/cloudflare/d1/wallet/d1WalletAuthMethodBoundary.js +1 -1
- package/dist/esm/router/cloudflare/d1/wallet/d1WalletAuthMethodRevocationReplayStore.js +1 -1
- package/dist/esm/router/cloudflare/d1/wallet/d1WalletAuthMethodService.js +6 -5
- package/dist/esm/router/cloudflare/d1/wallet/d1WalletAuthorityStore.js +2 -2
- package/dist/esm/router/cloudflare/d1/wallet/d1WalletAuthorizationCleanup.js +2 -1
- package/dist/esm/router/cloudflare/d1/wallet/d1WalletAuthorizationIntake.js +1 -1
- package/dist/esm/router/cloudflare/d1/wallet/d1WalletAuthorizationSnapshot.js +1 -1
- package/dist/esm/router/cloudflare/d1/wallet/d1WalletRelocationChallenges.js +1 -1
- package/dist/esm/router/cloudflare/d1/wallet/d1WalletRelocationOwnerRequest.js +2 -2
- package/dist/esm/router/cloudflare/d1/webauthn/d1WebAuthnAuthService.js +2 -2
- package/dist/esm/router/cloudflare/d1/webauthn/d1WebAuthnRecords.js +2 -2
- package/dist/esm/router/cloudflare/runtime/staticWalletConsoleBinding.js +9 -0
- package/dist/esm/router/cloudflare/runtime/walletConsoleOpsClient.js +6 -0
- package/dist/esm/router/cloudflare-adaptor.js +1 -1
- package/dist/esm/router/cloudflare.js +6139 -5567
- package/dist/esm/router/domains/ecdsa/routerAbEcdsaStrictRegistration.js +1 -1
- package/dist/esm/router/domains/ed25519Yao/export/routerAbEd25519YaoExport.js +5 -5
- package/dist/esm/router/domains/ed25519Yao/recovery/routerAbEd25519YaoRecovery.js +2 -2
- package/dist/esm/router/domains/ed25519Yao/recovery/routerAbEd25519YaoRecoveryWalletSessionAuthorization.js +1 -1
- package/dist/esm/router/domains/ed25519Yao/registration/routerAbEd25519YaoHttpRegistrationBackend.js +1 -1
- package/dist/esm/router/domains/ed25519Yao/registration/routerAbEd25519YaoRegistration.js +1 -1
- package/dist/esm/router/domains/ed25519Yao/registration/routerAbEd25519YaoRegistrationIntentAuthorization.js +1 -1
- package/dist/esm/router/domains/emailOtp/emailOtpRouteHandlers.js +2 -2
- package/dist/esm/router/domains/passkeyCustody/walletCustodyRegistrationCommit.js +1 -1
- package/dist/esm/router/domains/signingOperations/routerAbEcdsaDerivationNormalSigningRoute.js +2 -2
- package/dist/esm/router/domains/signingOperations/routerAbEd25519NormalSigningRoute.js +37 -3
- package/dist/esm/router/domains/signingOperations/routerAbOperationStepUp.js +1 -1
- package/dist/esm/router/domains/tenantRoot/tenantRootIdentityResolution.js +1 -1
- package/dist/esm/router/domains/walletRegistration/walletRegistrationReservation.js +18 -3
- package/dist/esm/router/domains/walletRegistration/walletRegistrationRoutes.js +12 -4
- package/dist/esm/router/domains/walletUnlock/walletUnlockRouteHandlers.js +3 -3
- package/dist/esm/router/framework/http.js +1 -1
- package/dist/esm/router/framework/routeDefinitions.js +2 -1
- package/dist/esm/router/transport/fetch/createFetchRouter.js +5 -3
- package/dist/esm/router/transport/fetch/routes/auth.js +1 -1
- package/dist/esm/router/transport/fetch/routes/deviceLinking.js +3 -3
- package/dist/esm/router/transport/fetch/routes/deviceLinkingOwnerAuthorization.js +1 -1
- package/dist/esm/router/transport/fetch/routes/ecdsaOperationStepUpFactor.js +3 -3
- package/dist/esm/router/transport/fetch/routes/externalAuth.js +351 -0
- package/dist/esm/router/transport/fetch/routes/normalSigningRouterProxy.js +1 -1
- package/dist/esm/router/transport/fetch/routes/passkeyCustody.js +46 -306
- package/dist/esm/router/transport/fetch/routes/sessions.js +4 -4
- package/dist/esm/router/transport/fetch/routes/syncAccount.js +2 -2
- package/dist/esm/router/transport/fetch/routes/syncAccountBootstrap.js +1 -1
- package/dist/esm/router/transport/fetch/routes/thresholdEcdsa.js +4 -4
- package/dist/esm/router/transport/fetch/routes/thresholdEd25519.js +6 -6
- package/dist/esm/router/transport/fetch/routes/walletExecutionLanePreflight.js +2 -2
- package/dist/esm/router/transport/fetch/routes/walletRegistration.js +4 -4
- package/dist/esm/router/transport/fetch/walletOwnerOperationAuthorization.js +306 -0
- package/dist/esm/shared-ts/src/auth/externalAuth.js +118 -0
- package/dist/esm/shared-ts/src/authorization/index.js +1 -1
- package/dist/esm/shared-ts/src/authorization/voiceIdDeviceAssertion.js +1 -1
- package/dist/esm/shared-ts/src/authorization/walletAuthority.js +2 -2
- package/dist/esm/shared-ts/src/authorization/{walletCustodyOperation.js → walletOwnerOperation.js} +4 -4
- package/dist/esm/shared-ts/src/device-linking/delegatedActivationPlan.js +1 -1
- package/dist/esm/shared-ts/src/device-linking/digests.js +1 -1
- package/dist/esm/shared-ts/src/device-linking/ed25519ExportRoot.js +1 -1
- package/dist/esm/shared-ts/src/device-linking/parsers.js +2 -2
- package/dist/esm/shared-ts/src/device-linking/sourceContribution.js +1 -1
- package/dist/esm/shared-ts/src/device-linking/walletSessionCredentialDelivery.js +1 -1
- package/dist/esm/shared-ts/src/device-linking/wireFields.js +2 -2
- package/dist/esm/shared-ts/src/passkey-custody/custodyEnvelope.js +1 -1
- package/dist/esm/shared-ts/src/passkey-custody/custodySecretBinding.js +1 -1
- package/dist/esm/shared-ts/src/signing-lanes/ownerContinuity.js +1 -1
- package/dist/esm/shared-ts/src/utils/routerAbEcdsaDerivation.js +1 -1
- package/dist/esm/shared-ts/src/utils/walletAuthAuthority.js +1 -1
- package/dist/esm/shared-ts/src/wallet-recovery/index.js +3 -3
- package/dist/esm/shared-ts/src/wallet-recovery/walletRecoveryCommittedProjection.js +1 -1
- package/dist/esm/shared-ts/src/wallet-recovery/walletRecoveryEnvelopeSet.js +1 -1
- package/dist/esm/threshold/session/signingSessionSeal/crypto/cipher.js +1 -1
- package/dist/esm/threshold/session/signingSessionSeal/service.js +1 -1
- package/dist/esm/threshold/session/signingSessionSeal/transport/fetch.js +1 -1
- package/dist/esm/threshold/session/signingSessionSeal/transport/shared.js +1 -1
- package/dist/types/shared-ts/src/auth/externalAuth.d.ts +127 -0
- package/dist/types/shared-ts/src/authorization/index.d.ts +1 -1
- package/dist/types/shared-ts/src/authorization/walletOwnerOperation.d.ts +10 -0
- package/dist/types/shared-ts/src/utils/registrationEstablishedSession.d.ts +4 -0
- package/dist/types/shared-ts/src/utils/registrationIntent.d.ts +2 -0
- package/dist/types/shared-ts/src/utils/walletManagementProtocol.d.ts +1 -1
- package/dist/types/wallet-server/src/application-auth.d.ts +3 -0
- package/dist/types/wallet-server/src/auth/applicationAuth.d.ts +29 -0
- package/dist/types/wallet-server/src/auth/externalAuthService.d.ts +55 -0
- package/dist/types/wallet-server/src/auth/externalAuthStore.d.ts +115 -0
- package/dist/types/wallet-server/src/auth/externalOwnerOperations.d.ts +18 -0
- package/dist/types/wallet-server/src/cloud-host.d.ts +2 -1
- package/dist/types/wallet-server/src/core/threeRouteRegistrationContracts.d.ts +12 -0
- package/dist/types/wallet-server/src/router/cloudflare/d1/auth/d1AuthorizedOperationRouteService.d.ts +5 -1
- package/dist/types/wallet-server/src/router/cloudflare/d1/auth/d1RecordedOwnerOperation.d.ts +16 -0
- package/dist/types/wallet-server/src/router/cloudflare/d1/oidc/d1OidcBoundary.d.ts +5 -0
- package/dist/types/wallet-server/src/router/cloudflare/d1/registration/d1RegistrationCeremonyRecords.d.ts +1 -0
- package/dist/types/wallet-server/src/router/cloudflare/d1/registration/d1WalletRegistrationSetup.d.ts +2 -0
- package/dist/types/wallet-server/src/router/cloudflare/d1/registration/walletRegistrationSessionCommitReceipt.d.ts +7 -1
- 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/d1WalletAuthMethodService.d.ts +1 -0
- package/dist/types/wallet-server/src/router/cloudflare/runtime/staticWalletConsoleBinding.d.ts +2 -0
- package/dist/types/wallet-server/src/router/domains/signingOperations/routerAbEd25519NormalSigningRoute.d.ts +2 -2
- package/dist/types/wallet-server/src/router/domains/signingOperations/routerAbOperationStepUp.d.ts +1 -1
- package/dist/types/wallet-server/src/router/domains/walletRegistration/walletRegistrationInputs.d.ts +1 -0
- package/dist/types/wallet-server/src/router/domains/walletRegistration/walletRegistrationReservation.d.ts +11 -6
- package/dist/types/wallet-server/src/router/framework/apiCredentialPorts.d.ts +1 -0
- package/dist/types/wallet-server/src/router/framework/authServicePort.d.ts +12 -0
- package/dist/types/wallet-server/src/router/transport/fetch/routes/externalAuth.d.ts +5 -0
- package/dist/types/wallet-server/src/router/transport/fetch/walletOwnerOperationAuthorization.d.ts +23 -0
- package/migrations/d1-signer/0085_external_wallet_auth.sql +158 -0
- package/migrations/d1-signer/0086_application_auth.sql +67 -0
- package/migrations/d1-signer/0087_registration_without_session.sql +43 -0
- package/package.json +7 -2
- package/dist/types/shared-ts/src/authorization/walletCustodyOperation.d.ts +0 -10
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { parseLaneShareEpoch, parseLinkDeviceSessionId, parseLinkedDeviceEnrollmentId, parseLinkedDeviceId, parseSigningLaneId, parseThresholdEcdsaSessionId, parseWalletKeyId } from "../utils/domainIds.js";
|
|
2
2
|
import { requireRecord } from "../utils/validation.js";
|
|
3
|
-
import { rejectUnknownFields } from "../utils/exactRecord.js";
|
|
4
3
|
import { parseDigestField, parseEd25519PublicKeyB64u, parseSecp256k1CompressedPublicKeyB64u } from "./primitives.js";
|
|
4
|
+
import { rejectUnknownFields } from "../utils/exactRecord.js";
|
|
5
5
|
import { requireEvmFamilySigningKeySlotId } from "../signing-lanes/evmFamilySigningKeySlotId.js";
|
|
6
6
|
import { parseNearEd25519SigningKeyId } from "../utils/registrationIds.js";
|
|
7
7
|
//#region ../shared-ts/src/passkey-custody/custodySecretBinding.ts
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { hasWhitespaceOrControlCharacters, parseMpcSigningWorkerRef } from "../utils/domainIds.js";
|
|
2
2
|
import { requireRecord } from "../utils/validation.js";
|
|
3
|
-
import { rejectUnknownFields } from "../utils/exactRecord.js";
|
|
4
3
|
import { base64UrlEncode } from "../utils/base64.js";
|
|
5
4
|
import { sha256Bytes } from "../utils/digests.js";
|
|
6
5
|
import { parseDigestField, requireParsed } from "../passkey-custody/primitives.js";
|
|
6
|
+
import { rejectUnknownFields } from "../utils/exactRecord.js";
|
|
7
7
|
import { concat } from "../utils/digestEncoding.js";
|
|
8
8
|
import { parseLaneParticipantBindingDigestB64u } from "./participants.js";
|
|
9
9
|
import { encodeLaneCanonicalDigestV1, encodeLaneCanonicalTextV1, encodeLaneCanonicalU64V1 } from "./participantDigest.js";
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { parseEcdsaActiveStateId, parseRootShareEpoch, parseThresholdEcdsaSessionId } from "./domainIds.js";
|
|
2
|
-
import { EVM_ECDSA_MPC_OPERATION_KINDS, parseEcdsaAuthorizationSessionId, parseMpcWalletSigningQuotaId, parseWalletSessionAuthorizationId, parseWalletSessionId, parseWalletSessionMintId } from "../authorization/capabilityKinds.js";
|
|
3
2
|
import { requireRecord } from "./validation.js";
|
|
4
3
|
import { base64UrlDecode, base64UrlEncode } from "./base64.js";
|
|
5
4
|
import { alphabetizeStringify, sha256BytesUtf8 } from "./digests.js";
|
|
6
5
|
import { parseCorrelationId } from "./canonicalPrimitives.js";
|
|
6
|
+
import { EVM_ECDSA_MPC_OPERATION_KINDS, parseEcdsaAuthorizationSessionId, parseMpcWalletSigningQuotaId, parseWalletSessionAuthorizationId, parseWalletSessionId, parseWalletSessionMintId } from "../authorization/capabilityKinds.js";
|
|
7
7
|
import { parseActiveWalletSessionV1, parseWalletSessionOperationCredentialV1 } from "../device-linking/activeWalletSession.js";
|
|
8
8
|
import { requireRouterAbX25519PublicKey } from "./routerAbPublicKeyset.js";
|
|
9
9
|
import { canonicalRouterAbMpcMaterialActivationRefBytes, canonicalRouterAbNormalSigningAuthorizationBytes, parseRouterAbMpcMaterialActivationRef, parseRouterAbNormalSigningAuthorization, routerAbMpcMaterialActivationRefToWire, sameRouterAbMpcMaterialActivationRef } from "./routerAbNormalSigningIdentity.js";
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { parseEmailOtpProviderUserId, parseWalletAuthMethodId, parseWalletAuthorityBindingDigest, parseWalletId, parseWebAuthnCredentialIdB64u, parseWebAuthnRpId } from "./domainIds.js";
|
|
2
2
|
import { requireRecord } from "./validation.js";
|
|
3
|
-
import { rejectUnknownFields } from "./exactRecord.js";
|
|
4
3
|
import { base64UrlEncode } from "./base64.js";
|
|
5
4
|
import { alphabetizeStringify, sha256BytesUtf8 } from "./digests.js";
|
|
6
5
|
import { parseDigestB64u } from "./canonicalPrimitives.js";
|
|
6
|
+
import { rejectUnknownFields } from "./exactRecord.js";
|
|
7
7
|
//#region ../shared-ts/src/utils/walletAuthAuthority.ts
|
|
8
8
|
const WALLET_AUTHORITY_BINDING_DIGEST_DOMAIN = "seams:wallet-authority-binding:v1|";
|
|
9
9
|
function buildVoiceIdWalletAuthAuthority(input) {
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import "./recoveryCodeReservation.js";
|
|
2
1
|
import "../utils/emailOtpRecoveryKey.js";
|
|
2
|
+
import "./recoveryCodeLocator.js";
|
|
3
|
+
import "./recoveryCodeReservation.js";
|
|
3
4
|
import "./recoveryKeyId.js";
|
|
5
|
+
import "./walletRecoveryEcdsaPossession.js";
|
|
4
6
|
import "./backupAcknowledgement.js";
|
|
5
7
|
import "./recoveryCodes.js";
|
|
6
8
|
import "./walletRecoveryEnvelopeSet.js";
|
|
7
|
-
import "./recoveryCodeLocator.js";
|
|
8
|
-
import "./walletRecoveryEcdsaPossession.js";
|
|
9
9
|
import "./walletRecoveryRotation.js";
|
|
10
10
|
import "./walletRecoveryCommittedProjection.js";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import "../authorization/capabilityKinds.js";
|
|
2
1
|
import { requireTrimmedString } from "../utils/validation.js";
|
|
2
|
+
import "../authorization/capabilityKinds.js";
|
|
3
3
|
import "../utils/walletAuthMethodRecord.js";
|
|
4
4
|
import "../authorization/walletAuthority.js";
|
|
5
5
|
//#region ../shared-ts/src/wallet-recovery/walletRecoveryCommittedProjection.ts
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { parseWalletId } from "../utils/domainIds.js";
|
|
2
2
|
import { requireRecord } from "../utils/validation.js";
|
|
3
|
-
import { rejectUnknownFields } from "../utils/exactRecord.js";
|
|
4
3
|
import { parseDigestField, parseEnvelopeCiphertextB64u, parseEnvelopeNonceB64u, parseUnixMs } from "../passkey-custody/primitives.js";
|
|
4
|
+
import { rejectUnknownFields } from "../utils/exactRecord.js";
|
|
5
5
|
import "../passkey-custody/index.js";
|
|
6
6
|
import { parseRecoveryCodeReservationId } from "./recoveryCodeReservation.js";
|
|
7
7
|
import { parseDerivedWalletRecoveryKeyId } from "./recoveryKeyId.js";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { normalizeOptionalTrimmedString } from "../../../../shared-ts/src/utils/normalize.js";
|
|
2
|
-
import { SIGNING_SESSION_SEAL_ALG, SIGNING_SESSION_SEAL_GROUP_ID, encodeSigningSessionHkdfTuple } from "../../../../shared-ts/src/utils/signingSessionSeal.js";
|
|
3
2
|
import { failure } from "../../../../shared-ts/src/utils/failure.js";
|
|
3
|
+
import { SIGNING_SESSION_SEAL_ALG, SIGNING_SESSION_SEAL_GROUP_ID, encodeSigningSessionHkdfTuple } from "../../../../shared-ts/src/utils/signingSessionSeal.js";
|
|
4
4
|
import { parseSigningSessionSealKeyVersion } from "../../../../shared-ts/src/threshold/keyMaterialBrands.js";
|
|
5
5
|
import { addSigningSessionSealLock, deriveSigningSessionSealLockKeyHandle, destroySigningSessionSealLockKeyHandle, removeSigningSessionSealLock } from "./shamir3PassWasm.js";
|
|
6
6
|
//#region src/threshold/session/signingSessionSeal/crypto/cipher.ts
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { base64UrlEncode } from "../../../shared-ts/src/utils/base64.js";
|
|
2
2
|
import { sha256BytesUtf8 } from "../../../shared-ts/src/utils/digests.js";
|
|
3
|
-
import "../../../shared-ts/src/utils/encoders.js";
|
|
4
3
|
import { failure } from "../../../shared-ts/src/utils/failure.js";
|
|
4
|
+
import "../../../shared-ts/src/utils/encoders.js";
|
|
5
5
|
//#region src/threshold/session/signingSessionSeal/service.ts
|
|
6
6
|
const SIGNING_SESSION_SEAL_LOG_LABEL = "[threshold-signing-session-seal]";
|
|
7
7
|
const SIGNING_SESSION_SEAL_IDEMPOTENCY_TTL_MS_DEFAULT = 9e4;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { failure } from "../../../../shared-ts/src/utils/failure.js";
|
|
2
|
-
import { authorizeSigningSessionSealRequest, buildSigningSessionSealApplyPath, buildSigningSessionSealRemovePath, parseSigningSessionSealApplyBody, parseSigningSessionSealRemoveBody, resolveSigningSessionSealBasePath, signingSessionSealAuthorizeStatusCode, signingSessionSealStatusCode } from "./shared.js";
|
|
3
2
|
import { headersToRecord, readJson } from "../../../../router/framework/http.js";
|
|
3
|
+
import { authorizeSigningSessionSealRequest, buildSigningSessionSealApplyPath, buildSigningSessionSealRemovePath, parseSigningSessionSealApplyBody, parseSigningSessionSealRemoveBody, resolveSigningSessionSealBasePath, signingSessionSealAuthorizeStatusCode, signingSessionSealStatusCode } from "./shared.js";
|
|
4
4
|
//#region src/threshold/session/signingSessionSeal/transport/fetch.ts
|
|
5
5
|
function json(body, status = 200) {
|
|
6
6
|
return new Response(JSON.stringify(body), {
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { parseThresholdSessionId } from "../../../../shared-ts/src/utils/domainIds.js";
|
|
2
2
|
import { ensureLeadingSlash } from "../../../../shared-ts/src/utils/normalize.js";
|
|
3
3
|
import { asRecord } from "../../../../shared-ts/src/utils/validation.js";
|
|
4
|
-
import { WALLET_SESSION_SEAL_BASE_PATH } from "../../../../shared-ts/src/utils/signingSessionSeal.js";
|
|
5
4
|
import { failure } from "../../../../shared-ts/src/utils/failure.js";
|
|
5
|
+
import { WALLET_SESSION_SEAL_BASE_PATH } from "../../../../shared-ts/src/utils/signingSessionSeal.js";
|
|
6
6
|
//#region src/threshold/session/signingSessionSeal/transport/shared.ts
|
|
7
7
|
const DEFAULT_BASE_PATH = WALLET_SESSION_SEAL_BASE_PATH;
|
|
8
8
|
function readRequiredString(obj, key) {
|
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
import { type WalletId } from '../utils/domainIds';
|
|
2
|
+
import { type Ed25519PublicKeyB64u } from '../passkey-custody/primitives';
|
|
3
|
+
import type { ReadonlyExclusiveUnion } from '../utils/variant';
|
|
4
|
+
import { type DigestB64u } from '../utils/canonicalPrimitives';
|
|
5
|
+
export declare const EXTERNAL_AUTH_PATH = "/wallet/external-auth";
|
|
6
|
+
export type ExternalAuthProvider = ReadonlyExclusiveUnion<{
|
|
7
|
+
kind: 'disabled';
|
|
8
|
+
} | {
|
|
9
|
+
kind: 'google';
|
|
10
|
+
clientId: string;
|
|
11
|
+
} | {
|
|
12
|
+
kind: 'application';
|
|
13
|
+
issuer: string;
|
|
14
|
+
publicKeyB64u: Ed25519PublicKeyB64u;
|
|
15
|
+
}>;
|
|
16
|
+
export type ExternalAuthConfiguration = ExternalAuthProvider & Readonly<{
|
|
17
|
+
revision: number;
|
|
18
|
+
}>;
|
|
19
|
+
export type ExternalIdentity = ReadonlyExclusiveUnion<{
|
|
20
|
+
provider: 'google';
|
|
21
|
+
issuer: 'https://accounts.google.com';
|
|
22
|
+
subject: string;
|
|
23
|
+
} | {
|
|
24
|
+
provider: 'application';
|
|
25
|
+
issuer: string;
|
|
26
|
+
subject: string;
|
|
27
|
+
}>;
|
|
28
|
+
export type ExternalIdentityProof = ReadonlyExclusiveUnion<{
|
|
29
|
+
kind: 'google';
|
|
30
|
+
idToken: string;
|
|
31
|
+
} | {
|
|
32
|
+
kind: 'application';
|
|
33
|
+
assertion: string;
|
|
34
|
+
}>;
|
|
35
|
+
export declare function parseExternalAuthProvider(raw: unknown): ExternalAuthProvider;
|
|
36
|
+
export declare function parseExternalAuthConfiguration(raw: unknown): ExternalAuthConfiguration;
|
|
37
|
+
export declare function serializeExternalIdentity(identity: ExternalIdentity): string;
|
|
38
|
+
export declare function parseStoredExternalIdentity(serialized: string): ExternalIdentity;
|
|
39
|
+
export type ExternalOwnerChallenge = Readonly<{
|
|
40
|
+
walletId: WalletId;
|
|
41
|
+
attemptId: string;
|
|
42
|
+
identity: ExternalIdentity;
|
|
43
|
+
challengeB64u: DigestB64u;
|
|
44
|
+
expiresAtMs: number;
|
|
45
|
+
}> & ReadonlyExclusiveUnion<{
|
|
46
|
+
kind: 'associate';
|
|
47
|
+
} | {
|
|
48
|
+
kind: 'unlink';
|
|
49
|
+
associationId: string;
|
|
50
|
+
}>;
|
|
51
|
+
export declare function parseExternalOwnerChallenge(raw: unknown): ExternalOwnerChallenge;
|
|
52
|
+
type ExternalAuthFailureCode = 'invalid_request' | 'invalid_credential' | 'access_denied' | 'expired' | 'superseded' | 'unavailable' | 'rate_limited' | 'cancelled';
|
|
53
|
+
export type ExternalAuthResult<T> = ReadonlyExclusiveUnion<{
|
|
54
|
+
ok: true;
|
|
55
|
+
value: T;
|
|
56
|
+
} | {
|
|
57
|
+
ok: false;
|
|
58
|
+
code: ExternalAuthFailureCode;
|
|
59
|
+
message: string;
|
|
60
|
+
}>;
|
|
61
|
+
export type ExternalAuthenticateInput = ReadonlyExclusiveUnion<{
|
|
62
|
+
method: 'google';
|
|
63
|
+
walletId: string;
|
|
64
|
+
idToken: string;
|
|
65
|
+
} | {
|
|
66
|
+
method: 'handoff';
|
|
67
|
+
walletId: string;
|
|
68
|
+
attemptId: string;
|
|
69
|
+
code: string;
|
|
70
|
+
}>;
|
|
71
|
+
export type ExternalAuthPurpose = 'authenticate' | 'associate';
|
|
72
|
+
export type ExternalAuthAttempt<Purpose extends ExternalAuthPurpose = 'authenticate'> = Readonly<{
|
|
73
|
+
purpose: Purpose;
|
|
74
|
+
attemptId: string;
|
|
75
|
+
walletId: WalletId;
|
|
76
|
+
expiresAtMs: number;
|
|
77
|
+
}>;
|
|
78
|
+
export type ExternalAuthCommand = ReadonlyExclusiveUnion<{
|
|
79
|
+
action: 'authenticate';
|
|
80
|
+
input: ExternalAuthenticateInput;
|
|
81
|
+
} | {
|
|
82
|
+
action: 'prepare';
|
|
83
|
+
walletId: string;
|
|
84
|
+
} | {
|
|
85
|
+
action: 'prepare_association';
|
|
86
|
+
walletId: string;
|
|
87
|
+
} | {
|
|
88
|
+
action: 'associate';
|
|
89
|
+
input: ExternalAuthenticateInput;
|
|
90
|
+
} | {
|
|
91
|
+
action: 'unlink';
|
|
92
|
+
walletId: string;
|
|
93
|
+
associationId: string;
|
|
94
|
+
}>;
|
|
95
|
+
export declare function parseExternalAuthCommand(raw: unknown): ExternalAuthCommand;
|
|
96
|
+
export type ExternalWalletAuthentication = Readonly<{
|
|
97
|
+
kind: 'external_authenticated';
|
|
98
|
+
walletId: WalletId;
|
|
99
|
+
sessionId: string;
|
|
100
|
+
associationId: string;
|
|
101
|
+
environmentId: string;
|
|
102
|
+
provider: ExternalIdentity['provider'];
|
|
103
|
+
permission: 'wallet_settings_read';
|
|
104
|
+
expiresAtMs: number;
|
|
105
|
+
authMethod?: never;
|
|
106
|
+
}>;
|
|
107
|
+
export type ExternalWalletSettings = Readonly<{
|
|
108
|
+
authentication: ExternalWalletAuthentication;
|
|
109
|
+
accounts: readonly Readonly<{
|
|
110
|
+
family: 'ed25519' | 'ecdsa';
|
|
111
|
+
address: string;
|
|
112
|
+
publicKey: string;
|
|
113
|
+
}>[];
|
|
114
|
+
methods: readonly Readonly<{
|
|
115
|
+
id: string;
|
|
116
|
+
kind: 'passkey' | 'email_otp' | 'voiceid';
|
|
117
|
+
}>[];
|
|
118
|
+
devices: readonly Readonly<{
|
|
119
|
+
id: string;
|
|
120
|
+
}>[];
|
|
121
|
+
}>;
|
|
122
|
+
export declare function parseExternalWalletAuthentication(value: unknown): ExternalWalletAuthentication;
|
|
123
|
+
export declare function externalAuthFailure(code: ExternalAuthFailureCode): ExternalAuthResult<never>;
|
|
124
|
+
export declare function parseExternalAuthFailure(value: unknown): ExternalAuthResult<never>;
|
|
125
|
+
export declare function parseExternalWalletSettings(value: unknown): ExternalWalletSettings;
|
|
126
|
+
export {};
|
|
127
|
+
//# sourceMappingURL=externalAuth.d.ts.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export * from './capabilityKinds';
|
|
2
2
|
export * from './delegatedAuthority';
|
|
3
3
|
export * from './operationFingerprint';
|
|
4
|
-
export * from './
|
|
4
|
+
export * from './walletOwnerOperation';
|
|
5
5
|
export * from './walletAuthority';
|
|
6
6
|
export * from './walletSessionIssuance';
|
|
7
7
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { type DigestB64u } from '../utils/canonicalPrimitives';
|
|
2
|
+
export type WalletOwnerAdminOperation = 'external_identity_associate' | 'external_identity_unlink' | 'credentials_list' | 'credential_label' | 'recovery_rotate' | 'recovery_read' | 'recovery_status' | 'recovery_backup_acknowledge';
|
|
3
|
+
/** Public challenge digest for a single wallet-administration factor proof. */
|
|
4
|
+
export declare function computeWalletOwnerAdminChallengeDigest(input: {
|
|
5
|
+
readonly walletId: string;
|
|
6
|
+
readonly operation: WalletOwnerAdminOperation;
|
|
7
|
+
readonly payload: Record<string, unknown>;
|
|
8
|
+
readonly requestOrigin: string;
|
|
9
|
+
}): Promise<DigestB64u>;
|
|
10
|
+
//# sourceMappingURL=walletOwnerOperation.d.ts.map
|
|
@@ -72,6 +72,10 @@ export type RegistrationEstablishedSessionV2 = {
|
|
|
72
72
|
readonly tokens: RegistrationEstablishedSessionProjectionTokensV2;
|
|
73
73
|
};
|
|
74
74
|
export type RegistrationEstablishedSessionResultV2 = {
|
|
75
|
+
readonly kind: 'owner_operations';
|
|
76
|
+
readonly walletId: WalletId;
|
|
77
|
+
readonly session?: never;
|
|
78
|
+
} | {
|
|
75
79
|
readonly kind: 'issued';
|
|
76
80
|
readonly session: RegistrationEstablishedSessionV2;
|
|
77
81
|
} | {
|
|
@@ -18,7 +18,9 @@ export type RuntimePolicyScopeLike = {
|
|
|
18
18
|
envId: string;
|
|
19
19
|
signingRootVersion?: string;
|
|
20
20
|
};
|
|
21
|
+
export type RegistrationCompletion = 'wallet_session' | 'owner_operations';
|
|
21
22
|
export type RegistrationIntentV1 = {
|
|
23
|
+
completion: RegistrationCompletion;
|
|
22
24
|
version: 'registration_intent_v1';
|
|
23
25
|
walletId: WalletId;
|
|
24
26
|
authMethod: RegistrationAuthMethodInput;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import type { ExternalAuthConfiguration, ExternalAuthPurpose, ExternalAuthResult, ExternalIdentity } from '../../../shared-ts/src/auth/externalAuth';
|
|
2
|
+
import type { Variant } from '../../../shared-ts/src/utils/variant';
|
|
3
|
+
type ApplicationTrust = Variant<ExternalAuthConfiguration, 'kind', 'application'>;
|
|
4
|
+
/** Called only by the application's authenticated backend with its enrolled issuer key. */
|
|
5
|
+
export declare function createApplicationAuthAssertion(input: {
|
|
6
|
+
readonly privateKey: CryptoKey;
|
|
7
|
+
readonly issuer: string;
|
|
8
|
+
readonly subject: string;
|
|
9
|
+
readonly environmentId: string;
|
|
10
|
+
readonly walletId: string;
|
|
11
|
+
readonly attemptId: string;
|
|
12
|
+
readonly nowMs: number;
|
|
13
|
+
readonly sessionExpiresAtMs: number;
|
|
14
|
+
readonly purpose: ExternalAuthPurpose;
|
|
15
|
+
}): Promise<string>;
|
|
16
|
+
export declare function verifyApplicationAuthAssertion(input: {
|
|
17
|
+
readonly trust: ApplicationTrust;
|
|
18
|
+
readonly assertion: string;
|
|
19
|
+
readonly environmentId: string;
|
|
20
|
+
readonly walletId: string;
|
|
21
|
+
readonly attemptId: string;
|
|
22
|
+
readonly nowMs: number;
|
|
23
|
+
readonly purpose: ExternalAuthPurpose;
|
|
24
|
+
}): Promise<ExternalAuthResult<{
|
|
25
|
+
identity: Variant<ExternalIdentity, 'provider', 'application'>;
|
|
26
|
+
expiresAtMs: number;
|
|
27
|
+
}>>;
|
|
28
|
+
export {};
|
|
29
|
+
//# sourceMappingURL=applicationAuth.d.ts.map
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import type { ExternalAuthResult, ExternalWalletAuthentication, ExternalWalletSettings, ExternalIdentity, ExternalIdentityProof, ExternalAuthPurpose, ExternalAuthAttempt } from '../../../shared-ts/src/auth/externalAuth';
|
|
2
|
+
import type { WalletId } from '../../../shared-ts/src/utils/domainIds';
|
|
3
|
+
import type { D1WalletStore } from '../core/d1WalletStore';
|
|
4
|
+
import type { WalletAuthMethodV2Store } from '../core/d1WalletAuthMethodStore';
|
|
5
|
+
import { ExternalAuthStore, type ExternalAuthTrust } from './externalAuthStore';
|
|
6
|
+
import type { Variant } from '../../../shared-ts/src/utils/variant';
|
|
7
|
+
export declare class ExternalAuthService {
|
|
8
|
+
readonly store: ExternalAuthStore;
|
|
9
|
+
private readonly wallets;
|
|
10
|
+
private readonly methods;
|
|
11
|
+
constructor(store: ExternalAuthStore, wallets: D1WalletStore, methods: WalletAuthMethodV2Store);
|
|
12
|
+
verifyGoogle(trust: Variant<ExternalAuthTrust, 'kind', 'google'>, idToken: string): Promise<ExternalAuthResult<{
|
|
13
|
+
identity: ExternalIdentity;
|
|
14
|
+
expiresAtMs: number;
|
|
15
|
+
}>>;
|
|
16
|
+
prepare(input: {
|
|
17
|
+
purpose: ExternalAuthPurpose;
|
|
18
|
+
walletId: WalletId;
|
|
19
|
+
originBinding: string;
|
|
20
|
+
binding: string;
|
|
21
|
+
sessionToken: string;
|
|
22
|
+
}): Promise<ExternalAuthResult<ExternalAuthAttempt<ExternalAuthPurpose>>>;
|
|
23
|
+
exchange(input: {
|
|
24
|
+
walletId: WalletId;
|
|
25
|
+
attemptId: string;
|
|
26
|
+
proof: ExternalIdentityProof;
|
|
27
|
+
trust: ExternalAuthTrust;
|
|
28
|
+
}): Promise<ExternalAuthResult<{
|
|
29
|
+
code: string;
|
|
30
|
+
}>>;
|
|
31
|
+
prepareUnlink(input: {
|
|
32
|
+
walletId: WalletId;
|
|
33
|
+
associationId: string;
|
|
34
|
+
originBinding: string;
|
|
35
|
+
binding: string;
|
|
36
|
+
sessionToken: string;
|
|
37
|
+
trustRevision: number;
|
|
38
|
+
}): Promise<ExternalAuthResult<{
|
|
39
|
+
attemptId: string;
|
|
40
|
+
code: string;
|
|
41
|
+
expiresAtMs: number;
|
|
42
|
+
}>>;
|
|
43
|
+
verifyIdentity(input: {
|
|
44
|
+
readonly trust: ExternalAuthTrust;
|
|
45
|
+
readonly proof: ExternalIdentityProof;
|
|
46
|
+
readonly walletId: WalletId;
|
|
47
|
+
readonly attemptId: string;
|
|
48
|
+
readonly purpose: ExternalAuthPurpose;
|
|
49
|
+
}): Promise<ExternalAuthResult<{
|
|
50
|
+
identity: ExternalIdentity;
|
|
51
|
+
expiresAtMs: number;
|
|
52
|
+
}>>;
|
|
53
|
+
settings(authentication: ExternalWalletAuthentication): Promise<ExternalWalletSettings>;
|
|
54
|
+
}
|
|
55
|
+
//# sourceMappingURL=externalAuthService.d.ts.map
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
import type { ExternalWalletAuthentication, ExternalAuthConfiguration, ExternalIdentity, ExternalAuthPurpose } from '../../../shared-ts/src/auth/externalAuth';
|
|
2
|
+
import type { WalletId, WalletAuthorityId } from '../../../shared-ts/src/utils/domainIds';
|
|
3
|
+
import { type D1TenantScope } from '../core/d1TenantStore';
|
|
4
|
+
import type { D1DatabaseLike } from '../storage/tenantRoute';
|
|
5
|
+
import type { ReadonlyExclusiveUnion } from '../../../shared-ts/src/utils/variant';
|
|
6
|
+
import type { ActiveWalletAuthorityV1 } from '../../../shared-ts/src/authorization/walletAuthority';
|
|
7
|
+
export type ExternalAuthTrust = Exclude<ExternalAuthConfiguration, {
|
|
8
|
+
kind: 'disabled';
|
|
9
|
+
}>;
|
|
10
|
+
type ExternalAuthPreparedAttempt = Readonly<{
|
|
11
|
+
purpose: ExternalAuthPurpose;
|
|
12
|
+
attemptId: string;
|
|
13
|
+
walletId: WalletId;
|
|
14
|
+
originBinding: string;
|
|
15
|
+
bindingHash: string;
|
|
16
|
+
sessionTokenHash: string;
|
|
17
|
+
expiresAtMs: number;
|
|
18
|
+
}>;
|
|
19
|
+
export type ExternalOwnerAttemptBinding = Readonly<{
|
|
20
|
+
walletId: WalletId;
|
|
21
|
+
attemptId: string;
|
|
22
|
+
originBinding: string;
|
|
23
|
+
bindingHash: string;
|
|
24
|
+
sessionTokenHash: string;
|
|
25
|
+
codeHash: string;
|
|
26
|
+
trustRevision: number;
|
|
27
|
+
nowMs: number;
|
|
28
|
+
}>;
|
|
29
|
+
export type ExternalOwnerAttempt = Readonly<{
|
|
30
|
+
walletId: WalletId;
|
|
31
|
+
attemptId: string;
|
|
32
|
+
identity: ExternalIdentity;
|
|
33
|
+
originBinding: string;
|
|
34
|
+
trustRevision: number;
|
|
35
|
+
expiresAtMs: number;
|
|
36
|
+
status: 'verified' | 'consumed';
|
|
37
|
+
challenge: {
|
|
38
|
+
kind: 'unprepared';
|
|
39
|
+
} | {
|
|
40
|
+
kind: 'ready';
|
|
41
|
+
expiresAtMs: number;
|
|
42
|
+
};
|
|
43
|
+
}> & ReadonlyExclusiveUnion<{
|
|
44
|
+
purpose: 'associate';
|
|
45
|
+
} | {
|
|
46
|
+
purpose: 'unlink';
|
|
47
|
+
associationId: string;
|
|
48
|
+
}>;
|
|
49
|
+
export declare class ExternalAuthStore {
|
|
50
|
+
private readonly database;
|
|
51
|
+
readonly scope: D1TenantScope;
|
|
52
|
+
constructor(database: D1DatabaseLike, scope: D1TenantScope);
|
|
53
|
+
private prepare;
|
|
54
|
+
consumeAuthenticationAllowance(rateKey: string, nowMs: number): Promise<boolean>;
|
|
55
|
+
associate(input: {
|
|
56
|
+
walletId: WalletId;
|
|
57
|
+
identity: ExternalIdentity;
|
|
58
|
+
authorityId: WalletAuthorityId;
|
|
59
|
+
authorityEpoch: number;
|
|
60
|
+
}): Promise<boolean>;
|
|
61
|
+
revokeAssociation(input: {
|
|
62
|
+
walletId: WalletId;
|
|
63
|
+
associationId: string;
|
|
64
|
+
owner: ActiveWalletAuthorityV1;
|
|
65
|
+
}): Promise<void>;
|
|
66
|
+
prepareUnlink(input: {
|
|
67
|
+
walletId: WalletId;
|
|
68
|
+
associationId: string;
|
|
69
|
+
attemptId: string;
|
|
70
|
+
originBinding: string;
|
|
71
|
+
bindingHash: string;
|
|
72
|
+
sessionTokenHash: string;
|
|
73
|
+
codeHash: string;
|
|
74
|
+
expiresAtMs: number;
|
|
75
|
+
trustRevision: number;
|
|
76
|
+
}): Promise<boolean>;
|
|
77
|
+
readOwnerAttempt(input: ExternalOwnerAttemptBinding): Promise<ExternalOwnerAttempt | null>;
|
|
78
|
+
prepareOwnerChallenge(input: ExternalOwnerAttemptBinding): Promise<ExternalOwnerAttempt | null>;
|
|
79
|
+
consumeOwnerAttempt(input: ExternalOwnerAttemptBinding, owner: ActiveWalletAuthorityV1): Promise<boolean>;
|
|
80
|
+
prepareAttempt(input: ExternalAuthPreparedAttempt): Promise<void>;
|
|
81
|
+
readPreparedPurpose(walletId: WalletId, attemptId: string, nowMs: number): Promise<ExternalAuthPurpose | null>;
|
|
82
|
+
verifyAttempt(input: {
|
|
83
|
+
attemptId: string;
|
|
84
|
+
walletId: WalletId;
|
|
85
|
+
identity: ExternalIdentity;
|
|
86
|
+
trust: ExternalAuthTrust;
|
|
87
|
+
codeHash: string;
|
|
88
|
+
nowMs: number;
|
|
89
|
+
sessionExpiresAtMs: number;
|
|
90
|
+
purpose: ExternalAuthPurpose;
|
|
91
|
+
}): Promise<boolean>;
|
|
92
|
+
redeem(input: {
|
|
93
|
+
attemptId: string;
|
|
94
|
+
walletId: WalletId;
|
|
95
|
+
originBinding: string;
|
|
96
|
+
bindingHash: string;
|
|
97
|
+
sessionTokenHash: string;
|
|
98
|
+
codeHash: string;
|
|
99
|
+
nowMs: number;
|
|
100
|
+
trustRevision: number;
|
|
101
|
+
}): Promise<ExternalWalletAuthentication | null>;
|
|
102
|
+
readSession(input: {
|
|
103
|
+
tokenHash: string;
|
|
104
|
+
originBinding: string;
|
|
105
|
+
nowMs: number;
|
|
106
|
+
trustRevision: number;
|
|
107
|
+
}): Promise<ExternalWalletAuthentication | null>;
|
|
108
|
+
revokeSession(tokenHash: string, originBinding: string): Promise<void>;
|
|
109
|
+
devices(walletId: WalletId): Promise<readonly {
|
|
110
|
+
id: string;
|
|
111
|
+
}[]>;
|
|
112
|
+
private authentication;
|
|
113
|
+
}
|
|
114
|
+
export {};
|
|
115
|
+
//# sourceMappingURL=externalAuthStore.d.ts.map
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { type ExternalAuthResult, type ExternalOwnerChallenge } from '../../../shared-ts/src/auth/externalAuth';
|
|
2
|
+
import { type WalletOwnerAdminOperation } from '../../../shared-ts/src/authorization/walletOwnerOperation';
|
|
3
|
+
import type { DigestB64u } from '../../../shared-ts/src/utils/canonicalPrimitives';
|
|
4
|
+
import { ExternalAuthStore, type ExternalOwnerAttempt, type ExternalOwnerAttemptBinding } from './externalAuthStore';
|
|
5
|
+
export type ExternalOwnerOperation = Readonly<{
|
|
6
|
+
attempt: ExternalOwnerAttempt;
|
|
7
|
+
operation: Extract<WalletOwnerAdminOperation, 'external_identity_associate' | 'external_identity_unlink'>;
|
|
8
|
+
payload: Readonly<Record<string, unknown>>;
|
|
9
|
+
challengeB64u: DigestB64u;
|
|
10
|
+
}>;
|
|
11
|
+
export declare function readExternalOwnerOperation(input: {
|
|
12
|
+
readonly store: ExternalAuthStore;
|
|
13
|
+
readonly binding: ExternalOwnerAttemptBinding;
|
|
14
|
+
readonly requestOrigin: string;
|
|
15
|
+
readonly phase: 'prepare' | 'complete';
|
|
16
|
+
}): Promise<ExternalAuthResult<ExternalOwnerOperation>>;
|
|
17
|
+
export declare function externalOwnerChallenge(operation: ExternalOwnerOperation): ExternalOwnerChallenge;
|
|
18
|
+
//# sourceMappingURL=externalOwnerOperations.d.ts.map
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
export { parseExternalAuthConfiguration, parseExternalAuthProvider, type ExternalAuthConfiguration, type ExternalAuthProvider, } from '../../shared-ts/src/auth/externalAuth';
|
|
1
2
|
export * from './core/SessionService';
|
|
2
3
|
export * from './core/ThresholdService/evmCryptoWasm';
|
|
3
4
|
export * from './core/d1WalletStore';
|
|
@@ -121,5 +122,5 @@ export type { LinkedDeviceSessionRecordV1 } from './core/deviceLinking/linkedDev
|
|
|
121
122
|
export { computeLinkedDeviceSessionClaimDigestV1 } from '../../shared-ts/src/device-linking/digests';
|
|
122
123
|
export { admitD1EstablishedWalletHome, resumeRegistrationDirectoryPublicationsV1, type RegistrationDirectoryPublicationDelivery, } from './router/cloudflare/d1/registration/d1WalletExecutionAuthority';
|
|
123
124
|
export { D1WalletObjectAddresses } from './router/cloudflare/d1/walletObjectAddresses';
|
|
124
|
-
export { walletObjectIdentity, WalletObjectAddressSnapshot, type WalletObjectIdentity } from './router/cloudflare/runtime/walletObjectAddresses';
|
|
125
|
+
export { walletObjectIdentity, WalletObjectAddressSnapshot, type WalletObjectIdentity, } from './router/cloudflare/runtime/walletObjectAddresses';
|
|
125
126
|
//# sourceMappingURL=cloud-host.d.ts.map
|
|
@@ -94,6 +94,18 @@ type WalletRegistrationSessionCommitReadyBaseV2 = WalletRegistrationSessionCommi
|
|
|
94
94
|
readonly walletCustody?: WalletCustodyRegistrationOutcome;
|
|
95
95
|
};
|
|
96
96
|
export type WalletRegistrationSessionCommitReceiptV2 = {
|
|
97
|
+
readonly kind: 'wallet_registration_session_commit_receipt_v2';
|
|
98
|
+
readonly operation: 'near_provisioning';
|
|
99
|
+
readonly operationFingerprint: string;
|
|
100
|
+
readonly registrationCeremonyId: string;
|
|
101
|
+
readonly committed: {
|
|
102
|
+
readonly kind: 'near_owner_ready';
|
|
103
|
+
readonly expectedOrigin: string;
|
|
104
|
+
readonly response: Extract<WalletRegistrationFinalizeSuccess, {
|
|
105
|
+
kind: 'near_ed25519';
|
|
106
|
+
}>;
|
|
107
|
+
};
|
|
108
|
+
} | {
|
|
97
109
|
readonly kind: 'wallet_registration_session_commit_receipt_v2';
|
|
98
110
|
readonly operation: 'registration_activate' | 'near_provisioning';
|
|
99
111
|
readonly operationFingerprint: string;
|
|
@@ -1,11 +1,15 @@
|
|
|
1
1
|
import type { AuthorizationService } from '../../../../authorization/service';
|
|
2
|
+
import type { D1WalletAuthMethodStore } from '../../../../core/d1WalletAuthMethodStore';
|
|
2
3
|
import type { RouterApiServiceBag } from '../../../framework/authServicePort';
|
|
3
4
|
import type { CloudflareD1AuthorizationStore } from '../authorization/d1AuthorizationStore';
|
|
5
|
+
import type { CloudflareD1WalletAuthMethodService } from '../wallet/d1WalletAuthMethodService';
|
|
4
6
|
import type { NormalizedCloudflareD1RouterApiAuthServiceOptions } from './d1RouterApiAuthConfig';
|
|
5
7
|
type D1AuthorizedOperationRouteServiceAssembly = {
|
|
6
8
|
readonly authorizationService: AuthorizationService;
|
|
7
9
|
readonly authorizationStore: CloudflareD1AuthorizationStore;
|
|
8
|
-
readonly options: Pick<NormalizedCloudflareD1RouterApiAuthServiceOptions, 'orgId'>;
|
|
10
|
+
readonly options: Pick<NormalizedCloudflareD1RouterApiAuthServiceOptions, 'database' | 'namespace' | 'orgId' | 'projectId' | 'envId'>;
|
|
11
|
+
readonly walletAuthMethodStore: D1WalletAuthMethodStore;
|
|
12
|
+
readonly walletAuthMethods: CloudflareD1WalletAuthMethodService;
|
|
9
13
|
};
|
|
10
14
|
export declare function createD1AuthorizedOperationRouteService(assembly: D1AuthorizedOperationRouteServiceAssembly): RouterApiServiceBag['authorizedOperations'];
|
|
11
15
|
export {};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { type TenantId } from '../../../../../../shared-ts/src/authorization/capabilityKinds';
|
|
2
|
+
import type { AuthorizationService } from '../../../../authorization/service';
|
|
3
|
+
import type { D1WalletAuthMethodStore } from '../../../../core/d1WalletAuthMethodStore';
|
|
4
|
+
import type { RouterApiAuthorizedOperationService } from '../../../framework/authServicePort';
|
|
5
|
+
import type { CloudflareD1WalletAuthMethodService } from '../wallet/d1WalletAuthMethodService';
|
|
6
|
+
import type { NormalizedCloudflareD1RouterApiAuthServiceOptions } from './d1RouterApiAuthConfig';
|
|
7
|
+
type RecordedOwnerOperationSource = {
|
|
8
|
+
readonly options: Pick<NormalizedCloudflareD1RouterApiAuthServiceOptions, 'database' | 'namespace' | 'orgId' | 'projectId' | 'envId'>;
|
|
9
|
+
readonly authorizationService: AuthorizationService;
|
|
10
|
+
readonly walletAuthMethodStore: D1WalletAuthMethodStore;
|
|
11
|
+
readonly walletAuthMethods: CloudflareD1WalletAuthMethodService;
|
|
12
|
+
};
|
|
13
|
+
/** A continuation uses only the factor digest and exact operation recorded after owner verification. */
|
|
14
|
+
export declare function resolveRecordedPasskeyOwnerOperation(source: RecordedOwnerOperationSource, tenantId: TenantId, input: Parameters<RouterApiAuthorizedOperationService['resolveRecordedPasskeyOwnerOperation']>[0]): ReturnType<RouterApiAuthorizedOperationService['resolveRecordedPasskeyOwnerOperation']>;
|
|
15
|
+
export {};
|
|
16
|
+
//# sourceMappingURL=d1RecordedOwnerOperation.d.ts.map
|
|
@@ -22,6 +22,11 @@ export type ParsedRs256JwtResult = {
|
|
|
22
22
|
export type GoogleIdTokenClaims = {
|
|
23
23
|
readonly ok: true;
|
|
24
24
|
readonly sub: string;
|
|
25
|
+
readonly issuer: 'https://accounts.google.com';
|
|
26
|
+
readonly audience: string;
|
|
27
|
+
readonly expiresAtMs: number;
|
|
28
|
+
readonly authorizedParty: string | null;
|
|
29
|
+
readonly audienceCount: number;
|
|
25
30
|
readonly email?: string;
|
|
26
31
|
readonly name?: string;
|
|
27
32
|
readonly givenName?: string;
|
|
@@ -20,6 +20,7 @@ export declare function inferRuntimePolicyScopeFromSigningRoot(input: {
|
|
|
20
20
|
readonly signingRootVersion?: string;
|
|
21
21
|
}): RuntimePolicyScope | undefined;
|
|
22
22
|
export declare function buildRegistrationIntent(input: {
|
|
23
|
+
readonly completion: RegistrationIntentV1['completion'];
|
|
23
24
|
readonly nonceB64u: string;
|
|
24
25
|
readonly walletId: WalletId;
|
|
25
26
|
readonly authMethod: RegistrationAuthMethodInput;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { RegistrationIntentV1 } from '../../../../../../shared-ts/src/utils/registrationIntent';
|
|
1
2
|
/**
|
|
2
3
|
* `/wallets/register/setup` — one request replacing the bootstrap grant, the
|
|
3
4
|
* registration intent, and registration start.
|
|
@@ -39,6 +40,7 @@ import type { WalletRegistrationSetupRequest } from '../../../domains/walletRegi
|
|
|
39
40
|
import { mintSignedWalletRegistrationSetup, type WalletRegistrationSetupMinter } from '../../../domains/walletRegistration/walletRegistrationSetupPayload';
|
|
40
41
|
export declare function normalizeWalletRegistrationSetupRequest(request: WalletRegistrationSetupRequest): {
|
|
41
42
|
readonly ok: true;
|
|
43
|
+
readonly completion: RegistrationIntentV1['completion'];
|
|
42
44
|
readonly signerSelection: RegistrationSignerSetSelection;
|
|
43
45
|
readonly authMethod: RegistrationAuthMethodInput;
|
|
44
46
|
} | {
|