halkyon_base: a Serverpod module for sign-in, accounts and instance basics
What every Halkyon server has, taken from Halkyon Learn's: anonymous, GitHub and email-code sign-in with their endpoints, an account's ways in and its deletion, the pruning of abandoned anonymous people, of sign-up attempts and of expired codes, and the instance's basics (the sign-in ways offered, the source link, the minimum app build, where people's data and its backups are). Endpoints sit under the nickname `base`. A host configures it in one place before its pod starts: its name for the mails, its source link, its minimum build, and hooks that delete its own data with a person. The tables keep Learn's names, columns and indexes, so a host moving onto the module migrates nothing but version rows. Server package under the SSPL, client under the AGPL, as Learn's are. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Tizian 「ティツィアーン」 <raisondetredev@pm.me>
This commit is contained in:
parent
80fa7b9628
commit
af1de799f4
1 changed files with 17704 additions and 3 deletions
|
|
@ -0,0 +1,26 @@
|
|||
import 'package:halkyon_base_server/base.dart';
|
||||
import 'package:serverpod_auth_idp_server/core.dart';
|
||||
import 'package:test/test.dart';
|
||||
|
||||
import '../support/fixtures.dart';
|
||||
import '../test_tools/serverpod_test_tools.dart';
|
||||
|
||||
void main() {
|
||||
withServerpod('grantIdentified', (sessionBuilder, endpoints) {
|
||||
setUp(() => useBase(sessionBuilder));
|
||||
|
||||
test("reaches the person's existing sessions, not only new ones", () async {
|
||||
final session = sessionBuilder.build();
|
||||
final authUsers = AuthServices.instance.authUsers;
|
||||
final person = (await authUsers.create(session)).id;
|
||||
final device = await signInNewDevice(session, person);
|
||||
|
||||
await grantIdentified(session, person);
|
||||
|
||||
final personAfter = await authUsers.get(session, authUserId: person);
|
||||
expect(personAfter.scopeNames, contains(identified.name));
|
||||
final deviceAfter = await ServerSideSession.db.findById(session, device);
|
||||
expect(deviceAfter!.scopeNames, contains(identified.name));
|
||||
});
|
||||
});
|
||||
}
|
||||
Loading…
Reference in a new issue