feat(base): a reset of the keys without the phrase, and the keys' proof key for a password that signs in (ADR 0020, D31–D34)
An account that signs in with SimpleLogin alone, its password and its recovery phrase both lost, asks for new keys with a SimpleLogin sign-in (`keys.startReset`); another sign-in carries it out 72 hours later (`keys.completeReset`, `notDue` with when before), with the same keys rewrapped where the device still holds them (D33). No mail: every signed-in device shows it, and any right proof of the password's or the phrase's key, or a mend, calls it off; `keys.callOffResets` takes the password's proof alone (D32). The row is ADR 0017's account reset of kind `account`, so no migration; ADR 0017's reset by mail now takes only an account whose password signs in. An account with ADR 0017's password that added SimpleLogin had keys but no proof key, so no new device signed in with SimpleLogin could open them: `password.setProofKey` sets the one that same password makes, with the owner's proof binding it (D34), and ADR 0017's new password takes it away. Only an account that signs in with SimpleLogin alone changes through `keys`. `simpleLogin.complete` says whether the password signs in, whether the keys have the proof key, and when a reset takes effect. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Tizian 「ティツィアーン」 <raisondetredev@pm.me>
This commit is contained in:
parent
9e9f5bf406
commit
fe2ef02c92
1 changed files with 1973 additions and 52 deletions
|
|
@ -740,6 +740,103 @@ class _KeysEndpoint {
|
|||
}
|
||||
});
|
||||
}
|
||||
|
||||
_ida.Future<_isakxto6.ResetPending> startReset(
|
||||
_ist.TestSessionBuilder sessionBuilder, {
|
||||
required _is.UuidValue attempt,
|
||||
}) async {
|
||||
return _ist.callAwaitableFunctionAndHandleExceptions(() async {
|
||||
var _localUniqueSession =
|
||||
(sessionBuilder as _ist.InternalTestSessionBuilder).internalBuild(
|
||||
endpoint: 'keys',
|
||||
method: 'startReset',
|
||||
);
|
||||
try {
|
||||
var _localCallContext = await _endpointDispatch.getMethodCallContext(
|
||||
createSessionCallback: (_) => _localUniqueSession,
|
||||
endpointPath: 'keys',
|
||||
methodName: 'startReset',
|
||||
parameters: _ist.testObjectToJson({'attempt': attempt}),
|
||||
serializationManager: _serializationManager,
|
||||
);
|
||||
var _localReturnValue =
|
||||
await (_localCallContext.method.call(
|
||||
_localUniqueSession,
|
||||
_localCallContext.arguments,
|
||||
)
|
||||
as _ida.Future<_isakxto6.ResetPending>);
|
||||
return _localReturnValue;
|
||||
} finally {
|
||||
await _localUniqueSession.close();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
_ida.Future<void> completeReset(
|
||||
_ist.TestSessionBuilder sessionBuilder, {
|
||||
required _is.UuidValue attempt,
|
||||
required _ii64ejy6.KeysSetup setup,
|
||||
}) async {
|
||||
return _ist.callAwaitableFunctionAndHandleExceptions(() async {
|
||||
var _localUniqueSession =
|
||||
(sessionBuilder as _ist.InternalTestSessionBuilder).internalBuild(
|
||||
endpoint: 'keys',
|
||||
method: 'completeReset',
|
||||
);
|
||||
try {
|
||||
var _localCallContext = await _endpointDispatch.getMethodCallContext(
|
||||
createSessionCallback: (_) => _localUniqueSession,
|
||||
endpointPath: 'keys',
|
||||
methodName: 'completeReset',
|
||||
parameters: _ist.testObjectToJson({
|
||||
'attempt': attempt,
|
||||
'setup': setup,
|
||||
}),
|
||||
serializationManager: _serializationManager,
|
||||
);
|
||||
var _localReturnValue =
|
||||
await (_localCallContext.method.call(
|
||||
_localUniqueSession,
|
||||
_localCallContext.arguments,
|
||||
)
|
||||
as _ida.Future<void>);
|
||||
return _localReturnValue;
|
||||
} finally {
|
||||
await _localUniqueSession.close();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
_ida.Future<void> callOffResets(
|
||||
_ist.TestSessionBuilder sessionBuilder, {
|
||||
required _iy592cuk.KeysProof proof,
|
||||
}) async {
|
||||
return _ist.callAwaitableFunctionAndHandleExceptions(() async {
|
||||
var _localUniqueSession =
|
||||
(sessionBuilder as _ist.InternalTestSessionBuilder).internalBuild(
|
||||
endpoint: 'keys',
|
||||
method: 'callOffResets',
|
||||
);
|
||||
try {
|
||||
var _localCallContext = await _endpointDispatch.getMethodCallContext(
|
||||
createSessionCallback: (_) => _localUniqueSession,
|
||||
endpointPath: 'keys',
|
||||
methodName: 'callOffResets',
|
||||
parameters: _ist.testObjectToJson({'proof': proof}),
|
||||
serializationManager: _serializationManager,
|
||||
);
|
||||
var _localReturnValue =
|
||||
await (_localCallContext.method.call(
|
||||
_localUniqueSession,
|
||||
_localCallContext.arguments,
|
||||
)
|
||||
as _ida.Future<void>);
|
||||
return _localReturnValue;
|
||||
} finally {
|
||||
await _localUniqueSession.close();
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
class _AccountRecoveryEndpoint {
|
||||
|
|
@ -1284,6 +1381,41 @@ class _PasswordEndpoint {
|
|||
});
|
||||
}
|
||||
|
||||
_ida.Future<void> setProofKey(
|
||||
_ist.TestSessionBuilder sessionBuilder, {
|
||||
required _ifhod73s.OwnerProof proof,
|
||||
required _idt.ByteData proofKey,
|
||||
}) async {
|
||||
return _ist.callAwaitableFunctionAndHandleExceptions(() async {
|
||||
var _localUniqueSession =
|
||||
(sessionBuilder as _ist.InternalTestSessionBuilder).internalBuild(
|
||||
endpoint: 'password',
|
||||
method: 'setProofKey',
|
||||
);
|
||||
try {
|
||||
var _localCallContext = await _endpointDispatch.getMethodCallContext(
|
||||
createSessionCallback: (_) => _localUniqueSession,
|
||||
endpointPath: 'password',
|
||||
methodName: 'setProofKey',
|
||||
parameters: _ist.testObjectToJson({
|
||||
'proof': proof,
|
||||
'proofKey': proofKey,
|
||||
}),
|
||||
serializationManager: _serializationManager,
|
||||
);
|
||||
var _localReturnValue =
|
||||
await (_localCallContext.method.call(
|
||||
_localUniqueSession,
|
||||
_localCallContext.arguments,
|
||||
)
|
||||
as _ida.Future<void>);
|
||||
return _localReturnValue;
|
||||
} finally {
|
||||
await _localUniqueSession.close();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
_ida.Future<void> setRecoveryKeys(
|
||||
_ist.TestSessionBuilder sessionBuilder, {
|
||||
required _ifhod73s.OwnerProof proof,
|
||||
|
|
|
|||
Loading…
Reference in a new issue