@learncard/sss-key-manager 0.2.5 → 0.2.6
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/index.d.ts +2 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/sss-key-manager.cjs.development.js +563 -134
- package/dist/sss-key-manager.cjs.development.js.map +3 -3
- package/dist/sss-key-manager.cjs.production.min.js +32 -32
- package/dist/sss-key-manager.cjs.production.min.js.map +3 -3
- package/dist/sss-key-manager.esm.js +563 -134
- package/dist/sss-key-manager.esm.js.map +3 -3
- package/dist/sss-strategy.d.ts.map +1 -1
- package/dist/types.d.ts +11 -1
- package/dist/types.d.ts.map +1 -1
- package/package.json +2 -2
- package/src/index.ts +2 -0
- package/src/sss-authority.test.ts +294 -1
- package/src/sss-strategy.test.ts +637 -8
- package/src/sss-strategy.ts +786 -159
- package/src/types.ts +20 -1
package/src/types.ts
CHANGED
|
@@ -16,6 +16,7 @@ export {
|
|
|
16
16
|
type AuthProvider,
|
|
17
17
|
type RecoveryMethodInfo,
|
|
18
18
|
type RecoveryResult,
|
|
19
|
+
type RevokeOtherDevicesResult,
|
|
19
20
|
type IdentityRecoverySession,
|
|
20
21
|
type ServerKeyStatus,
|
|
21
22
|
type SssActivationState,
|
|
@@ -156,6 +157,18 @@ export class EscrowPinLockedError extends Error {
|
|
|
156
157
|
}
|
|
157
158
|
}
|
|
158
159
|
|
|
160
|
+
/**
|
|
161
|
+
* A PIN sign-in released the key, but the released share version is no longer on the
|
|
162
|
+
* server (another device secured the account or recovered meanwhile). Nothing was
|
|
163
|
+
* stored; a revoke is never silently undone.
|
|
164
|
+
*/
|
|
165
|
+
export class PinSignInStaleError extends Error {
|
|
166
|
+
constructor() {
|
|
167
|
+
super('Your account changed while signing in. Try again.');
|
|
168
|
+
this.name = 'PinSignInStaleError';
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
|
|
159
172
|
export interface PasskeyRecoveryMethod {
|
|
160
173
|
type: 'passkey';
|
|
161
174
|
credentialId?: string;
|
|
@@ -180,7 +193,13 @@ export type RecoveryMethod =
|
|
|
180
193
|
* SSS-specific recovery input — what the user provides to recover their key.
|
|
181
194
|
*/
|
|
182
195
|
export type RecoveryInput =
|
|
183
|
-
| {
|
|
196
|
+
| {
|
|
197
|
+
method: 'escrow-pin';
|
|
198
|
+
pin: string;
|
|
199
|
+
expectedDid?: string;
|
|
200
|
+
/** Verified recovery-email session; set only when no login is bound yet. */
|
|
201
|
+
recoverySessionToken?: string;
|
|
202
|
+
}
|
|
184
203
|
| {
|
|
185
204
|
method: 'escrow';
|
|
186
205
|
holdId: string;
|