feat(auth): Learn's and Todo's servers take password sign-in

Their migrations add halkyon_base's five tables for passwords,
authenticators, recovery codes, resets and sign-ins begun (nothing
else), and their pruning forgets sign-ins never finished and
authenticators never confirmed, hourly, and every GitHub ID once
GitHub sign-in has ended, daily.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Tizian 「ティツィアーン」 <raisondetredev@pm.me>
This commit is contained in:
Tizian 「ティツィアーン」 2026-10-20 13:32:21 +02:00
commit aedd03661a
Signed by: raisondetredev
GPG key ID: 07F6FCF405488B64
2 changed files with 35545 additions and 22 deletions

View file

@ -11,13 +11,15 @@ import 'package:serverpod/serverpod.dart';
/// All but the last are halkyon_base's (ADR 0014, ADR 0016), and people go
/// through its `deletePerson`, so Learn's own data of theirs goes too.
class PruningFutureCall extends FutureCall {
/// Prunes one batch and logs how many people went.
/// Prunes one batch and logs how many people went; once GitHub sign-in
/// has ended (`GITHUB_SIGN_IN_ENDS`), forgets every GitHub ID too.
Future<void> pruneAnonymousPeople(Session session) async {
final pruned = await pruneAbandonedAnonymousPeople(
session,
now: clock.now(),
final now = clock.now();
final pruned = await pruneAbandonedAnonymousPeople(session, now: now);
final gitHub = await forgetGitHubAccounts(session, now: now);
session.log(
'Pruned $pruned abandoned anonymous people and $gitHub GitHub IDs.',
);
session.log('Pruned $pruned abandoned anonymous people.');
}
/// Forgets the assistant connector's codes and tokens past their time, and
@ -31,13 +33,21 @@ class PruningFutureCall extends FutureCall {
}
/// Forgets the sign-up attempts the rate limit is done with, with their IP
/// addresses, and the email sign-in codes past their time, and logs how
/// many.
/// addresses, the email sign-in codes past their time, and the password
/// sign-ins never finished and authenticators never confirmed (ADR 0017),
/// and logs how many.
Future<void> forgetSignUpAttempts(Session session) async {
final now = clock.now();
final forgotten = await forgetOldSignUpAttempts(session, now: now);
final codes = await forgetExpiredEmailCodes(session, now: now);
session.log('Forgot $forgotten sign-up attempts and $codes email codes.');
final unfinished = await forgetUnconfirmedAuthenticators(
session,
now: now,
);
session.log(
'Forgot $forgotten sign-up attempts, $codes email codes and '
'$unfinished unfinished sign-ins and authenticators.',
);
}
/// Tells the instance's members again of the accounts gone that they

View file

@ -292,7 +292,8 @@ class FilePruningPruneFilesFutureCall extends _is.FutureCall
}
}
/// Prunes one batch and logs how many people went.
/// Prunes one batch and logs how many people went; once GitHub sign-in
/// has ended (`GITHUB_SIGN_IN_ENDS`), forgets every GitHub ID too.
class PruningPruneAnonymousPeopleFutureCall extends _is.FutureCall
implements _is.InvokableFutureCall {
@override
@ -318,8 +319,9 @@ class PruningForgetConnectorSecretsFutureCall extends _is.FutureCall
}
/// Forgets the sign-up attempts the rate limit is done with, with their IP
/// addresses, and the email sign-in codes past their time, and logs how
/// many.
/// addresses, the email sign-in codes past their time, and the password
/// sign-ins never finished and authenticators never confirmed (ADR 0017),
/// and logs how many.
class PruningForgetSignUpAttemptsFutureCall extends _is.FutureCall
implements _is.InvokableFutureCall {
@override