feat(base,app)!: GitHub signs nobody in any more (ADR 0020, D36)
Every account signs in with SimpleLogin or a password now, so GitHub goes from the module, the shared app package, Learn and Todo, ahead of ADR 0017's GITHUB_SIGN_IN_ENDS. - halkyon_base: no `gitHubSignIn` endpoint, GitHub identity provider or GitHub refusals; no `githubClientId`/`githubClientSecret`, no `GITHUB_SIGN_IN_ENDS` and no `forgetGitHubAccounts`; the register loses `account-with-github`. `SignInWays.gitHub`, the basics' `gitHubClientId` and `gitHubSignInEnds`, and `PasswordRefusal`'s `signInAgain` and `noAddress` go. A first password takes a code mailed to the person's own address; an account without one sets none (`wrongCredentials`). - Learn's server: `instance.info()` without `gitHubClientId`, the pruning without GitHub, and `minimumAppBuild` 24, as builds up to 23 (v0.20.0) require `SignInWays.gitHub`: the server deploys with the release of build 24. - halkyon_app: no GitHub button or problems on the start screen, no password offered after a GitHub sign-in, and `ServerpodAuthGateway` without the browser half only GitHub used (`(client, base:)`). The account section offers a first password only to an account with an address. `LoopbackWebAuth` and the apps' schemes stay, SimpleLogin's ways back. - Learn's Profile lists no GitHub; the texts go (English, German). - Serverpod's `serverpod_auth_idp_github_account` stays, as its migrations make it; a row goes with its account, and ADR 0020's D36 gives operators the SQL to delete those left. - deploy/: compose.yaml and .env.example without GitHub. The READMEs, AGENTS.md files and ADR 0017 amended. BREAKING CHANGE: builds up to 23 can't read the instance's answers about an account's ways in; minimumAppBuild is 24. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Tizian 「ティツィアーン」 <raisondetredev@pm.me>
This commit is contained in:
parent
ab5b7cd015
commit
4e33133733
7 changed files with 564 additions and 3570 deletions
|
|
@ -3,7 +3,7 @@
|
|||
What holds for every app and package of this repository is in the [root AGENTS.md](../../AGENTS.md); it applies here in full, and Learn's patterns (`apps/learn/AGENTS.md`) wherever Todo needs the same thing.
|
||||
|
||||
- **A shell on the shared packages** (decided 2026-10-19): signing in, the instances, the account and the look work; nothing of a person's is kept or synced yet, which waits for Todo's first model (the developer decides what it keeps and syncs). Packages: `halkyon_todo_server`, `halkyon_todo_client` (generated, never edited), `halkyon_todo_flutter`; app ID `app.halkyon.todo` on every platform; no web build. Licences as Learn's (server SSPL, client and app AGPL; `LICENSE.md`).
|
||||
- **The server** includes `halkyon_base` (ADR 0014) and configures it in `server.dart` (`todoBase()`, `lib/src/todo_base.dart`): its basics say it serves `todo` (never change it once apps use it), sign-in mails name Halkyon Todo, the source is this repository, `minimumAppBuild` 1, no data of its own to delete with a person yet (add a `deletePersonData` hook with Todo's first table). Authentication through the module's builders: a password, SimpleLogin on the register, GitHub (with the instance's own OAuth app) until it ends, email codes proving an address, server-side sessions; no anonymous accounts (ADR 0020, D25). **Accounts** (ADR 0016): Todo holds its own register when it runs alone, and is a member of the instance's register (Learn's server on learn.halkyon.eu) where the operator sets `ACCOUNT_REGISTER_URL` (`todoBase(accounts: AccountsMode.fromEnvironment())`) with the instance's shared `INSTANCE_SECRET` (`instanceSecret`); then sign-in, handles and profiles are the register's, the email settings are the register's alone (GitHub's are Todo's own OAuth app's), and an identified person's deletion goes to the register first. `addInstanceRoutes` serves the calls between the services on its web server, and the server doesn't start without the secret where it needs it. `schedulePruning` (`lib/src/pruning.dart`) keeps the module's pruning scheduled, one entry each however often the server starts (and cancels the one under the pruning's name before ADR 0020, D25): the anonymous accounts left from before daily, sign-up attempts and codes hourly, as the register the deletions its members haven't confirmed hourly, as a member the people the register no longer knows daily (each a no-op in the other mode). Session logs are never persisted, in any run mode. Migrations (2026-10-19): the initial one (Serverpod's tables, its auth modules' and the module's `email_identity`, `email_code_request`), `profiles` (`public_profile`) and `deletion-notices` (`account_deletion_notice`), nothing of Todo's own. Tests (`test/integration/todo_server_test.dart`) call the module's endpoints through the server's own dispatch (`halkyon_base.<endpoint>`), since the generated test tools expose the project's endpoints alone.
|
||||
- **The server** includes `halkyon_base` (ADR 0014) and configures it in `server.dart` (`todoBase()`, `lib/src/todo_base.dart`): its basics say it serves `todo` (never change it once apps use it), sign-in mails name Halkyon Todo, the source is this repository, `minimumAppBuild` 1, no data of its own to delete with a person yet (add a `deletePersonData` hook with Todo's first table). Authentication through the module's builders: a password, SimpleLogin on the register, email codes proving an address, server-side sessions; no anonymous accounts (ADR 0020, D25), nor GitHub (D36). **Accounts** (ADR 0016): Todo holds its own register when it runs alone, and is a member of the instance's register (Learn's server on learn.halkyon.eu) where the operator sets `ACCOUNT_REGISTER_URL` (`todoBase(accounts: AccountsMode.fromEnvironment())`) with the instance's shared `INSTANCE_SECRET` (`instanceSecret`); then sign-in, handles and profiles are the register's, the email settings are the register's alone, and an identified person's deletion goes to the register first. `addInstanceRoutes` serves the calls between the services on its web server, and the server doesn't start without the secret where it needs it. `schedulePruning` (`lib/src/pruning.dart`) keeps the module's pruning scheduled, one entry each however often the server starts (and cancels the one under the pruning's name before ADR 0020, D25): the anonymous accounts left from before daily, sign-up attempts and codes hourly, as the register the deletions its members haven't confirmed hourly, as a member the people the register no longer knows daily (each a no-op in the other mode). Session logs are never persisted, in any run mode. Migrations (2026-10-19): the initial one (Serverpod's tables, its auth modules' and the module's `email_identity`, `email_code_request`), `profiles` (`public_profile`) and `deletion-notices` (`account_deletion_notice`), nothing of Todo's own. Tests (`test/integration/todo_server_test.dart`) call the module's endpoints through the server's own dispatch (`halkyon_base.<endpoint>`), since the generated test tools expose the project's endpoints alone.
|
||||
- **The app** is halkyon_app's `InstanceGate` and `SessionGate` with Todo's frame (`todoFrame`: "Todo" under "Halkyon", its icon, `todo.example.org`, its own sentence) and `ServerpodInstanceChecker(app: 'todo')`; `TodoDependencies` (`AppDependencies<TodoPerson>`) on one instance, `TodoPerson` (empty) per person; a person's app with an empty home and the account sheet: halkyon_app's `AccountTiles` (whose account on which instance, Switch account, Sign out, Delete account, which asks first) in Todo's words, and halkyon_app's About (`showAppAbout`: the source of what the instance runs, from `TodoDependencies.sourceCodeUrl`, and the licence list). Texts through gen-l10n in British English (the template), German (informal du), an empty `en_US` and `en_GB` (`test/l10n/arb_files_test.dart` keeps them in step). The look follows the system's theme mode and language until Todo has settings. Countries in where an instance keeps its data are named by halkyon_app's CLDR names (`AssetCountryNames`), its language picked by halkyon_app's `resolveAppLocale`. Widget tests start Todo's whole tree with halkyon_app's fakes (`test/app/todo_app_test.dart`).
|
||||
- **The icon** is Lucide's `list-checks` (lucide-static 1.50.0) in the brand's blues on white: `apps/todo/tool/app_icons.py` (run from `apps/todo`) fetches it, draws its strokes with Pillow (no SVG renderer needed; other path commands fail loudly), writes `assets/icon/halkyon_todo_icon.png` and Lucide's ISC licence beside it, then every platform's launcher icon through flutter_launcher_icons as Learn's tool does. `registerLucideLicense` puts the notice in the licence list.
|
||||
- **`serverpod start`** runs in `apps/todo/halkyon_todo_server` (it launches the app from `lib/driver.dart`); `.mcp.json`'s `--server-dir` names it when a session works on Todo. Its tests need throwaway passwords in its git-ignored `config/passwords.yaml` (`database`, `serviceSecret`, `serverSideSessionKeyHashPepper`, `emailSignInPepper`) or from the environment, as CI gives them. Learn's and Todo's development servers use the same ports: run one at a time.
|
||||
|
|
|
|||
|
|
@ -1,9 +1,9 @@
|
|||
# Halkyon Todo
|
||||
|
||||
To-dos, as a Halkyon app: for now a shell on the shared packages. People choose an
|
||||
instance, sign in (without an account, with GitHub or with a code by mail), switch
|
||||
between the accounts on their devices, sign out and delete their account; the home is
|
||||
empty until Todo's first model.
|
||||
instance, sign in (with SimpleLogin or a password), switch between the accounts on
|
||||
their devices, sign out and delete their account; the home is empty until Todo's first
|
||||
model.
|
||||
|
||||
| Package | What it is |
|
||||
|---|---|
|
||||
|
|
|
|||
|
|
@ -28,7 +28,7 @@
|
|||
<category android:name="android.intent.category.LAUNCHER"/>
|
||||
</intent-filter>
|
||||
</activity>
|
||||
<!-- Receives GitHub's redirect after signing in (app.halkyon.todo://github-callback). -->
|
||||
<!-- Receives the way back from SimpleLogin's sign-in (app.halkyon.todo://simplelogin-callback). -->
|
||||
<activity
|
||||
android:name="com.linusu.flutter_web_auth_2.CallbackActivity"
|
||||
android:exported="true"
|
||||
|
|
|
|||
|
|
@ -86,10 +86,6 @@ class TodoDependencies({
|
|||
final authGateway = ServerpodAuthGateway(
|
||||
client,
|
||||
base: client.modules.base,
|
||||
// The scheme GitHub's sign-in returns to on Android, iOS and macOS, as
|
||||
// each platform's project registers it for the app.
|
||||
callbackScheme: 'app.halkyon.todo',
|
||||
appName: 'Halkyon Todo',
|
||||
);
|
||||
final people = device.storage.peopleOf(instance);
|
||||
final folders = PersonFolders(people);
|
||||
|
|
|
|||
|
|
@ -133,25 +133,14 @@ void main() {
|
|||
);
|
||||
});
|
||||
|
||||
testWidgets('signed out, it asks how to start; a GitHub account nobody here '
|
||||
'signs in with is said so, with an account to create in its place '
|
||||
'where passwords are offered (ADR 0017)', (tester) async {
|
||||
testWidgets('signed out, it asks how to start, with an account to create '
|
||||
'where passwords are offered (ADR 0017), and no GitHub (ADR 0020, '
|
||||
'D36)', (tester) async {
|
||||
await start(tester, usedBefore: true, signedOut: true);
|
||||
|
||||
expect(find.text('Sign in with GitHub'), findsOneWidget);
|
||||
gateway.gitHubError = const GitHubSignInFailed(
|
||||
GitHubSignInProblem.unknownAccount,
|
||||
);
|
||||
await tester.tap(find.text('Sign in with GitHub'));
|
||||
await tester.pumpAndSettle();
|
||||
|
||||
expect(
|
||||
find.text(
|
||||
'No account here signs in with this GitHub account. Create an '
|
||||
'account with your email address and a password instead.',
|
||||
),
|
||||
findsOneWidget,
|
||||
);
|
||||
expect(find.text('Start on todo.example.org:'), findsOneWidget);
|
||||
expect(find.text('Create an account'), findsOneWidget);
|
||||
expect(find.textContaining('GitHub'), findsNothing);
|
||||
});
|
||||
|
||||
testWidgets('where no account can be made, it says so', (tester) async {
|
||||
|
|
@ -161,16 +150,6 @@ void main() {
|
|||
find.text('todo.example.org offers no way to create an account.'),
|
||||
findsOneWidget,
|
||||
);
|
||||
gateway.gitHubError = const GitHubSignInFailed(
|
||||
GitHubSignInProblem.unknownAccount,
|
||||
);
|
||||
await tester.tap(find.text('Sign in with GitHub'));
|
||||
await tester.pumpAndSettle();
|
||||
|
||||
expect(
|
||||
find.text('No account here signs in with this GitHub account.'),
|
||||
findsOneWidget,
|
||||
);
|
||||
});
|
||||
|
||||
testWidgets('the account says on which instance it is signed in; signing '
|
||||
|
|
@ -187,7 +166,7 @@ void main() {
|
|||
expect(gateway.signOuts, 1);
|
||||
expect(gateway.accountDeletions, 0);
|
||||
expect(gateway.status, const SignedOut());
|
||||
expect(find.text('Sign in with GitHub'), findsOneWidget);
|
||||
expect(find.text('Start on todo.example.org:'), findsOneWidget);
|
||||
});
|
||||
|
||||
testWidgets('where the instance offers SimpleLogin, the account sheet '
|
||||
|
|
@ -220,7 +199,7 @@ void main() {
|
|||
await tester.pumpAndSettle();
|
||||
|
||||
expect(gateway.accountDeletions, 1);
|
||||
expect(find.text('Sign in with GitHub'), findsOneWidget);
|
||||
expect(find.text('Start on todo.example.org:'), findsOneWidget);
|
||||
});
|
||||
|
||||
testWidgets('a deletion the instance never got says so on the account '
|
||||
|
|
|
|||
|
|
@ -222,10 +222,8 @@ class _PruningFutureCallDispatcher {
|
|||
}
|
||||
}
|
||||
|
||||
/// Prunes one batch of anonymous accounts and logs how many people went;
|
||||
/// 30 days after GitHub sign-in ended (`GITHUB_SIGN_IN_ENDS`), deletes the
|
||||
/// accounts that had no other way in and forgets every GitHub ID too, on
|
||||
/// the register; and forgets the resets that lapsed (ADR 0017).
|
||||
/// Prunes one batch of anonymous accounts and logs how many people went,
|
||||
/// and forgets the resets that lapsed (ADR 0017).
|
||||
class PruningPruneAccountsFutureCall extends _is.FutureCall
|
||||
implements _is.InvokableFutureCall {
|
||||
@override
|
||||
|
|
|
|||
|
|
@ -10,18 +10,14 @@ import 'package:serverpod/serverpod.dart';
|
|||
/// again of the accounts gone, hourly; as a member, deleting the people
|
||||
/// whose account the register no longer knows, daily.
|
||||
class PruningFutureCall extends FutureCall {
|
||||
/// Prunes one batch of anonymous accounts and logs how many people went;
|
||||
/// 30 days after GitHub sign-in ended (`GITHUB_SIGN_IN_ENDS`), deletes the
|
||||
/// accounts that had no other way in and forgets every GitHub ID too, on
|
||||
/// the register; and forgets the resets that lapsed (ADR 0017).
|
||||
/// Prunes one batch of anonymous accounts and logs how many people went,
|
||||
/// and forgets the resets that lapsed (ADR 0017).
|
||||
Future<void> pruneAccounts(Session session) async {
|
||||
final now = clock.now();
|
||||
final pruned = await pruneAnonymousPeople(session);
|
||||
final gitHub = await forgetGitHubAccounts(session, now: now);
|
||||
final resets = await forgetLapsedResets(session, now: now);
|
||||
session.log(
|
||||
'Pruned $pruned anonymous people, $gitHub GitHub IDs and '
|
||||
'$resets lapsed resets.',
|
||||
'Pruned $pruned anonymous people and $resets lapsed resets.',
|
||||
);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue