feat(instance): the basics say when GitHub sign-in ends

ADR 0017, D2: GitHub sign-in is deprecated. Where the operator set
`GITHUB_SIGN_IN_ENDS`, `instance.basics()` names the day until it has
come, so apps can tell people who sign in with GitHub to add an
address, a password and an authenticator before then.

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 14:55:13 +02:00
commit 1daa1b649a
Signed by: raisondetredev
GPG key ID: 07F6FCF405488B64
2 changed files with 85 additions and 6 deletions

View file

@ -229,9 +229,8 @@ class EndpointInstance extends _isc.EndpointRef {
/// operator's OAuth app and until it ends (ADR 0017), email sign-in only
/// where the register can mail codes (this server, or on a member the
/// register, ADR 0016), password sign-in where the register holds its
/// keys, where its
/// source is, the oldest app build it works with, and where it keeps
/// people's data and its backups.
/// keys, when GitHub sign-in ends, where its source is, the oldest app
/// build it works with, and where it keeps people's data and its backups.
_ida.Future<_isnyur2i.InstanceBasics> basics() =>
caller.callServerEndpoint<_isnyur2i.InstanceBasics>(
'halkyon_base.instance',

View file

@ -27,6 +27,7 @@ abstract class InstanceBasics
this.dataLocation,
this.backupLocation,
bool? passwordSignIn,
this.gitHubSignInEnds,
}) : passwordSignIn = passwordSignIn ?? false;
factory InstanceBasics({
@ -38,6 +39,7 @@ abstract class InstanceBasics
String? dataLocation,
String? backupLocation,
bool? passwordSignIn,
DateTime? gitHubSignInEnds,
}) = _InstanceBasicsImpl;
factory InstanceBasics.fromJson(Map<String, dynamic> jsonSerialization) {
@ -56,6 +58,11 @@ abstract class InstanceBasics
: _isc.BoolJsonExtension.fromJson(
jsonSerialization['passwordSignIn'],
),
gitHubSignInEnds: jsonSerialization['gitHubSignInEnds'] == null
? null
: _isc.DateTimeJsonExtension.fromJson(
jsonSerialization['gitHubSignInEnds'],
),
);
}
@ -93,6 +100,12 @@ abstract class InstanceBasics
/// operator set the keys it needs.
bool passwordSignIn;
/// When GitHub sign-in ends here (ADR 0017: it is deprecated), as its
/// operator set it (GITHUB_SIGN_IN_ENDS), in UTC; null while no end is set,
/// or once it has ended. People who sign in with GitHub add an address, a
/// password and an authenticator before then.
DateTime? gitHubSignInEnds;
/// Returns a shallow copy of this [InstanceBasics]
/// with some or all fields replaced by the given arguments.
@_isc.useResult
@ -105,6 +118,7 @@ abstract class InstanceBasics
String? dataLocation,
String? backupLocation,
bool? passwordSignIn,
DateTime? gitHubSignInEnds,
});
@override
Map<String, dynamic> toJson() {
@ -118,6 +132,8 @@ abstract class InstanceBasics
if (dataLocation != null) 'dataLocation': dataLocation,
if (backupLocation != null) 'backupLocation': backupLocation,
'passwordSignIn': passwordSignIn,
if (gitHubSignInEnds != null)
'gitHubSignInEnds': gitHubSignInEnds?.toJson(),
};
}
@ -133,6 +149,8 @@ abstract class InstanceBasics
if (dataLocation != null) 'dataLocation': dataLocation,
if (backupLocation != null) 'backupLocation': backupLocation,
'passwordSignIn': passwordSignIn,
if (gitHubSignInEnds != null)
'gitHubSignInEnds': gitHubSignInEnds?.toJson(),
};
}
@ -154,6 +172,7 @@ class _InstanceBasicsImpl extends InstanceBasics {
String? dataLocation,
String? backupLocation,
bool? passwordSignIn,
DateTime? gitHubSignInEnds,
}) : super._(
app: app,
gitHubClientId: gitHubClientId,
@ -163,6 +182,7 @@ class _InstanceBasicsImpl extends InstanceBasics {
dataLocation: dataLocation,
backupLocation: backupLocation,
passwordSignIn: passwordSignIn,
gitHubSignInEnds: gitHubSignInEnds,
);
/// Returns a shallow copy of this [InstanceBasics]
@ -178,6 +198,7 @@ class _InstanceBasicsImpl extends InstanceBasics {
Object? dataLocation = _Undefined,
Object? backupLocation = _Undefined,
bool? passwordSignIn,
Object? gitHubSignInEnds = _Undefined,
}) {
return InstanceBasics(
app: app ?? this.app,
@ -192,6 +213,9 @@ class _InstanceBasicsImpl extends InstanceBasics {
? backupLocation
: this.backupLocation,
passwordSignIn: passwordSignIn ?? this.passwordSignIn,
gitHubSignInEnds: gitHubSignInEnds is DateTime?
? gitHubSignInEnds
: this.gitHubSignInEnds,
);
}
}