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
1 changed files with 564 additions and 3570 deletions
|
|
@ -19,13 +19,9 @@ final class _MemoryStorage() implements ClientAuthSuccessStorage {
|
|||
Future<void> set(AuthSuccess? data) async => _session = data;
|
||||
}
|
||||
|
||||
/// An instance's halkyon_base as the network shows it: its basics offer
|
||||
/// GitHub while it has [gitHubClientId], and a sign-up makes Ben, signed
|
||||
/// in with `ben-token`.
|
||||
/// An instance's halkyon_base as the network shows it: a sign-up makes
|
||||
/// Ben, signed in with `ben-token`.
|
||||
final class _Instance() {
|
||||
/// The client ID of its GitHub OAuth app; none without.
|
||||
String? gitHubClientId = 'github-client';
|
||||
|
||||
static final anonymous = UuidValue.withValidation(
|
||||
'0191f0c4-1111-7000-8000-000000000001',
|
||||
);
|
||||
|
|
@ -41,20 +37,6 @@ final class _Instance() {
|
|||
calls.add((call: call, session: request.headers['authorization']));
|
||||
String sent(Object? body) => jsonEncode(body);
|
||||
return switch (call) {
|
||||
'halkyon_base.instance/basics' => http.Response(
|
||||
sent(
|
||||
InstanceBasics(
|
||||
app: 'learn',
|
||||
gitHubClientId: gitHubClientId,
|
||||
emailSignIn: true,
|
||||
sourceCodeUrl: 'https://code.example.org/learn',
|
||||
minimumAppBuild: 1,
|
||||
passwordSignIn: true,
|
||||
simpleLogin: true,
|
||||
).toJson(),
|
||||
),
|
||||
200,
|
||||
),
|
||||
'halkyon_base.passwordSignIn/signUp' => http.Response(
|
||||
sent(_session(ben, 'ben-token', identified: true)),
|
||||
200,
|
||||
|
|
@ -91,13 +73,7 @@ void main() {
|
|||
storage: _MemoryStorage(),
|
||||
);
|
||||
await app.auth.initialize();
|
||||
gateway = ServerpodAuthGateway(
|
||||
app,
|
||||
base: app.modules,
|
||||
callbackScheme: 'app.halkyon.test',
|
||||
appName: 'Halkyon Test',
|
||||
httpClient: instance.client,
|
||||
);
|
||||
gateway = ServerpodAuthGateway(app, base: app.modules);
|
||||
addTearDown(() async {
|
||||
await gateway.dispose();
|
||||
app.close();
|
||||
|
|
@ -134,33 +110,6 @@ void main() {
|
|||
);
|
||||
});
|
||||
|
||||
test('tells from the basics whether the instance signs in with GitHub '
|
||||
'those who have it', () async {
|
||||
expect(await gateway.gitHubSignInOffered(), isTrue);
|
||||
|
||||
instance.gitHubClientId = null;
|
||||
expect(await gateway.gitHubSignInOffered(), isFalse);
|
||||
});
|
||||
|
||||
test("puts the instance's refusals of GitHub as the app's problems", () {
|
||||
expect(
|
||||
{
|
||||
for (final reason in GitHubSignInRefusal.values)
|
||||
reason: gitHubSignInProblemOf(reason),
|
||||
},
|
||||
{
|
||||
GitHubSignInRefusal.unavailable: GitHubSignInProblem.refused,
|
||||
GitHubSignInRefusal.takenByAnotherPerson: GitHubSignInProblem.refused,
|
||||
GitHubSignInRefusal.otherGitHubAccountLinked:
|
||||
GitHubSignInProblem.refused,
|
||||
GitHubSignInRefusal.unknownAccount: GitHubSignInProblem.unknownAccount,
|
||||
GitHubSignInRefusal.usePassword: GitHubSignInProblem.usePassword,
|
||||
GitHubSignInRefusal.deprecated: GitHubSignInProblem.deprecated,
|
||||
GitHubSignInRefusal.ended: GitHubSignInProblem.ended,
|
||||
},
|
||||
);
|
||||
});
|
||||
|
||||
test('a session granted elsewhere (a sign-up with a password, signed '
|
||||
'out) takes its place', () async {
|
||||
final passwords = ServerpodPasswordGateway(
|
||||
|
|
|
|||
Loading…
Reference in a new issue