feat(app): adding SimpleLogin to an account (ADR 0020, D21, D23)
All checks were successful
CI / check (push) Successful in 32m34s
CI / deploy (push) Has been skipped

halkyon_app reads where the device's person stands with SimpleLogin
(nothing to show, linked, or missing) and shows it in SimpleLoginSection,
which each app places above the password part: Add SimpleLogin, once
added one more way in. GitHub is added to nobody where SimpleLogin is
offered, and Learn's Profile offers an anonymous person SimpleLogin
alone there (D23).

No cut-off day, reminder or banner (D24): with the developer the only
person on learn.halkyon.eu, the cut-off is the operator taking GitHub's
OAuth app out of the deploy's settings once that account has SimpleLogin.
ADR 0020 records it and drops step 5.

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-24 11:56:26 +02:00
commit fad12b4411
Signed by: raisondetredev
GPG key ID: 07F6FCF405488B64

View file

@ -21,10 +21,12 @@ final class _MemoryStorage() implements ClientAuthSuccessStorage {
/// An instance's halkyon_base as the network shows it: anonymous sign-ins
/// get `anonymous-token`, its basics offer GitHub (and passwords while
/// [passwords]), and a sign-up makes Ben, signed in with `ben-token`.
/// [passwords], SimpleLogin while [simpleLogin]), and a sign-up makes Ben,
/// signed in with `ben-token`.
final class _Instance() {
/// Whether its basics offer password sign-in.
/// Whether its basics offer password sign-in, and SimpleLogin.
bool passwords = false;
bool simpleLogin = false;
static final anonymous = UuidValue.withValidation(
'0191f0c4-1111-7000-8000-000000000001',
@ -54,6 +56,7 @@ final class _Instance() {
sourceCodeUrl: 'https://code.example.org/learn',
minimumAppBuild: 1,
passwordSignIn: passwords,
simpleLogin: simpleLogin,
).toJson(),
),
200,
@ -121,7 +124,8 @@ void main() {
);
test('tells what the instance offers from its basics: GitHub sign-in, '
'and linking GitHub to people only where passwords are not', () async {
'and linking GitHub to people only where neither passwords nor '
'SimpleLogin are (ADR 0020, D23)', () async {
expect(
await gateway.gitHubOffer(),
const GitHubOffer(signIn: true, linking: true),
@ -139,6 +143,14 @@ void main() {
hasLength(2),
reason: 'one read of the basics each',
);
instance
..passwords = false
..simpleLogin = true;
expect(
await gateway.gitHubOffer(),
const GitHubOffer(signIn: true, linking: false),
);
});
test("puts the instance's refusals of GitHub as the app's problems", () {