fix(auth): a member asks the register whose account it is before a deletion's proof counts
The reading of the full reading's fixes found (B1) that a member asked the register knownAccounts inside the owner-proof try, so ten tries to delete while the register was out of reach ended the owner's session, though no proof ever left the member; and that a person anonymous on a member could no longer delete their account while the register was down. The member now asks first, outside the try, which wraps only what checks the proof. While the register is out of reach, a person still anonymous here (becoming identified ends that) is none of its and is deleted here; anyone else waits for the register. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Tizian 「ティツィアーン」 <raisondetredev@pm.me>
This commit is contained in:
parent
b0e1557153
commit
9c2b1cd6e0
1 changed files with 81 additions and 16 deletions
|
|
@ -1060,6 +1060,41 @@ void main() {
|
|||
);
|
||||
expect(hostDeleted, isEmpty);
|
||||
});
|
||||
|
||||
test('asks the register first: tries while it is out of reach count '
|
||||
"for nothing, as no proof left here (the reading of the fixes' "
|
||||
'B1)', () async {
|
||||
register.failing = RegisterUnavailableException('test');
|
||||
DeletionProof proof() => DeletionProof(
|
||||
challenge: const Uuid().v7obj(),
|
||||
clientValue: ByteData(384),
|
||||
clientProof: ByteData(32),
|
||||
totpCode: '123456',
|
||||
instanceUrl: testInstanceUrl,
|
||||
);
|
||||
for (var i = 0; i < 11; i++) {
|
||||
await expectLater(
|
||||
endpoints.account.delete(asBen(), proof: proof()),
|
||||
throwsA(isA<RegisterUnavailableException>()),
|
||||
);
|
||||
}
|
||||
expect(register.asked.toSet(), {'knownAccounts'});
|
||||
expect(
|
||||
await ServerSideSession.db.findById(session, bensLaptop),
|
||||
isNotNull,
|
||||
);
|
||||
});
|
||||
|
||||
test('of a person anonymous here deletes it here while the register '
|
||||
'is out of reach: becoming identified ends being anonymous, so '
|
||||
"none is the register's", () async {
|
||||
register.failing = RegisterUnavailableException('test');
|
||||
|
||||
await endpoints.account.delete(asAnna());
|
||||
|
||||
expect(await AuthUser.db.findById(session, anna), isNull);
|
||||
expect(hostDeleted, [anna]);
|
||||
});
|
||||
});
|
||||
|
||||
group('told by the register that an account is gone', () {
|
||||
|
|
|
|||
Loading…
Reference in a new issue