@learncard/sss-key-manager 0.2.1 → 0.2.3
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/dist/escrow-attestation.d.ts +2 -9
- package/dist/escrow-attestation.d.ts.map +1 -1
- package/dist/escrow-authority.d.ts +138 -0
- package/dist/escrow-authority.d.ts.map +1 -0
- package/dist/escrow-authority.types.d.ts +51 -0
- package/dist/escrow-authority.types.d.ts.map +1 -0
- package/dist/escrow-crypto.d.ts +9 -1
- package/dist/escrow-crypto.d.ts.map +1 -1
- package/dist/escrow-enrollment-intent.d.ts +13 -0
- package/dist/escrow-enrollment-intent.d.ts.map +1 -0
- package/dist/escrow-enrollment-intent.types.d.ts +28 -0
- package/dist/escrow-enrollment-intent.types.d.ts.map +1 -0
- package/dist/escrow-nitro-attestation.d.ts +2 -0
- package/dist/escrow-nitro-attestation.d.ts.map +1 -1
- package/dist/index.d.ts +8 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/sss-key-manager.cjs.development.js +1652 -214
- package/dist/sss-key-manager.cjs.development.js.map +4 -4
- package/dist/sss-key-manager.cjs.production.min.js +28 -23
- package/dist/sss-key-manager.cjs.production.min.js.map +4 -4
- package/dist/sss-key-manager.esm.js +1167 -164
- package/dist/sss-key-manager.esm.js.map +4 -4
- package/dist/sss-strategy.d.ts +2 -1
- package/dist/sss-strategy.d.ts.map +1 -1
- package/dist/types.d.ts +21 -1
- package/dist/types.d.ts.map +1 -1
- package/package.json +2 -2
- package/src/__fixtures__/escrow-authority-v1.json +96 -0
- package/src/__fixtures__/escrow-carry-contact-contract-v1.json +33 -0
- package/src/__fixtures__/escrow-enrollment-intent-v1.json +26 -0
- package/src/__fixtures__/nitro-attestation-real/staging-nsm-document.json +16 -0
- package/src/escrow-attestation.ts +10 -9
- package/src/escrow-authority.test.ts +757 -0
- package/src/escrow-authority.ts +671 -0
- package/src/escrow-authority.types.ts +56 -0
- package/src/escrow-crypto.ts +39 -1
- package/src/escrow-enrollment-intent.test.ts +224 -0
- package/src/escrow-enrollment-intent.ts +236 -0
- package/src/escrow-enrollment-intent.types.ts +28 -0
- package/src/escrow-nitro-attestation.test.ts +72 -0
- package/src/escrow-nitro-attestation.ts +34 -3
- package/src/index.ts +29 -0
- package/src/sss-authority.test.ts +889 -0
- package/src/sss-strategy.test.ts +32 -0
- package/src/sss-strategy.ts +503 -39
- package/src/types.ts +27 -3
package/src/types.ts
CHANGED
|
@@ -93,10 +93,24 @@ export interface EscrowHoldStatus {
|
|
|
93
93
|
releaseAfter: string;
|
|
94
94
|
cancelledAt?: string;
|
|
95
95
|
completedAt?: string;
|
|
96
|
+
/** Only present for an authority-mode hold-policy hold; `confirmed` only appears alongside it. */
|
|
97
|
+
requiresConfirmation?: boolean;
|
|
98
|
+
confirmed?: boolean;
|
|
99
|
+
/** Opaque enclave-signed `SignedHoldRecord`; present only in authority
|
|
100
|
+
* (nitro) mode. Callers must verify it with `verifyEscrowHoldRecord`
|
|
101
|
+
* before trusting any field inside it — see escrow-authority.ts. */
|
|
102
|
+
holdRecord?: import('./escrow-authority').EscrowHoldRecordLike;
|
|
96
103
|
}
|
|
97
104
|
|
|
98
105
|
/** Persist these secrets securely until completion; a null token means an existing hold. */
|
|
99
106
|
export type EscrowRecoveryStart = EscrowHoldStatus & {
|
|
107
|
+
codeSent?: boolean;
|
|
108
|
+
delivery?: {
|
|
109
|
+
codeSent: boolean;
|
|
110
|
+
proof: import('./escrow-authority.types').EscrowAuthorityRecord;
|
|
111
|
+
};
|
|
112
|
+
/** Persist with the secrets, never rebuild from server status. Required for Nitro resume. */
|
|
113
|
+
expectations?: import('@learncard/types').EscrowRecoveryExpectations;
|
|
100
114
|
resumeToken: string | null;
|
|
101
115
|
clientEphemeralPrivateKey: string;
|
|
102
116
|
pinSalt?: string;
|
|
@@ -166,8 +180,15 @@ export type RecoveryMethod =
|
|
|
166
180
|
* SSS-specific recovery input — what the user provides to recover their key.
|
|
167
181
|
*/
|
|
168
182
|
export type RecoveryInput =
|
|
169
|
-
| { method: 'escrow-pin'; pin: string }
|
|
170
|
-
| {
|
|
183
|
+
| { method: 'escrow-pin'; pin: string; expectedDid?: string }
|
|
184
|
+
| {
|
|
185
|
+
method: 'escrow';
|
|
186
|
+
holdId: string;
|
|
187
|
+
resumeToken: string;
|
|
188
|
+
clientEphemeralPrivateKey: string;
|
|
189
|
+
/** Original start bindings loaded with the private key, required for Nitro. */
|
|
190
|
+
expectations?: import('@learncard/types').EscrowRecoveryExpectations;
|
|
191
|
+
}
|
|
171
192
|
| { method: 'passkey'; credentialId: string }
|
|
172
193
|
| { method: 'phrase'; phrase: string }
|
|
173
194
|
| { method: 'backup'; fileContents: string; password: string }
|
|
@@ -285,7 +306,10 @@ export type SSSKeyDerivationStrategy = KeyDerivationStrategy<
|
|
|
285
306
|
RecoverySetupInput,
|
|
286
307
|
RecoverySetupResult,
|
|
287
308
|
RecoveryConfirmationInput
|
|
288
|
-
|
|
309
|
+
> & {
|
|
310
|
+
/** Last receipt/snapshot-verified ciphertext for this session, never a freshness oracle. */
|
|
311
|
+
getVerifiedEscrowEnvelope?(): import('./escrow-crypto').EscrowEnvelope | null;
|
|
312
|
+
};
|
|
289
313
|
|
|
290
314
|
// ---------------------------------------------------------------------------
|
|
291
315
|
// Legacy types (deprecated)
|