refactor(base): SimpleLogin's forwarding page on the OpenID Connect module (ADR 0023)

halkyon_base depends on halkyon_oidc_server, and its forwarding page
is now the module's (`addOidcCallbackForwarding`) with Halkyon's table
of apps and its page in English or German; its tests keep what is
Halkyon's own, the rest is tested in the module.

Every host now includes the module: migrations `…-oidc-module` in
halkyon_base, Learn and Todo create its two tables (no data touched)
and record its version; Learn's devices get them empty, as they have
halkyon_base's server-only tables. halkyon_base_client depends on
halkyon_oidc_client, whose models its generated code uses, and Learn's
server image copies both packages into its narrowed workspace.

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-23 20:28:37 +02:00
commit 620ad270db
Signed by: raisondetredev
GPG key ID: 07F6FCF405488B64
7 changed files with 43572 additions and 408 deletions

View file

@ -0,0 +1,229 @@
{
"__className__": "serverpod.DatabaseMigration",
"actions": [
{
"__className__": "serverpod.DatabaseMigrationAction",
"type": "createTable",
"createTable": {
"__className__": "serverpod.TableDefinition",
"name": "halkyon_oidc_attempt",
"dartName": "OidcAttempt",
"module": "halkyon_oidc",
"schema": "public",
"columns": [
{
"__className__": "serverpod.ColumnDefinition",
"name": "id",
"fieldName": "id",
"columnType": 7,
"isNullable": false,
"columnDefault": "random",
"dartType": "UuidValue?"
},
{
"__className__": "serverpod.ColumnDefinition",
"name": "provider",
"fieldName": "provider",
"columnType": 0,
"isNullable": false,
"dartType": "String"
},
{
"__className__": "serverpod.ColumnDefinition",
"name": "state",
"fieldName": "state",
"columnType": 0,
"isNullable": false,
"dartType": "String"
},
{
"__className__": "serverpod.ColumnDefinition",
"name": "nonce",
"fieldName": "nonce",
"columnType": 0,
"isNullable": false,
"dartType": "String"
},
{
"__className__": "serverpod.ColumnDefinition",
"name": "codeVerifier",
"fieldName": "codeVerifier",
"columnType": 0,
"isNullable": true,
"dartType": "String?"
},
{
"__className__": "serverpod.ColumnDefinition",
"name": "callerId",
"fieldName": "callerId",
"columnType": 7,
"isNullable": true,
"dartType": "UuidValue?"
},
{
"__className__": "serverpod.ColumnDefinition",
"name": "subject",
"fieldName": "subject",
"columnType": 0,
"isNullable": true,
"dartType": "String?"
},
{
"__className__": "serverpod.ColumnDefinition",
"name": "expiresAt",
"fieldName": "expiresAt",
"columnType": 4,
"isNullable": false,
"dartType": "DateTime"
}
],
"foreignKeys": [
{
"__className__": "serverpod.ForeignKeyDefinition",
"constraintName": "halkyon_oidc_attempt_fk_0",
"columns": [
"callerId"
],
"referenceTable": "serverpod_auth_core_user",
"referenceTableSchema": "public",
"referenceColumns": [
"id"
],
"onUpdate": 3,
"onDelete": 4
}
],
"indexes": [
{
"__className__": "serverpod.IndexDefinition",
"indexName": "halkyon_oidc_attempt_expires_idx",
"elements": [
{
"__className__": "serverpod.IndexElementDefinition",
"type": 0,
"definition": "expiresAt"
}
],
"type": "btree",
"isUnique": false,
"isPrimary": false
}
],
"managed": true
}
},
{
"__className__": "serverpod.DatabaseMigrationAction",
"type": "createTable",
"createTable": {
"__className__": "serverpod.TableDefinition",
"name": "halkyon_oidc_identity",
"dartName": "OidcIdentity",
"module": "halkyon_oidc",
"schema": "public",
"columns": [
{
"__className__": "serverpod.ColumnDefinition",
"name": "id",
"fieldName": "id",
"columnType": 7,
"isNullable": false,
"columnDefault": "random_v7",
"dartType": "UuidValue?"
},
{
"__className__": "serverpod.ColumnDefinition",
"name": "authUserId",
"fieldName": "authUserId",
"columnType": 7,
"isNullable": false,
"dartType": "UuidValue"
},
{
"__className__": "serverpod.ColumnDefinition",
"name": "provider",
"fieldName": "provider",
"columnType": 0,
"isNullable": false,
"dartType": "String"
},
{
"__className__": "serverpod.ColumnDefinition",
"name": "subject",
"fieldName": "subject",
"columnType": 0,
"isNullable": false,
"dartType": "String"
},
{
"__className__": "serverpod.ColumnDefinition",
"name": "createdAt",
"fieldName": "createdAt",
"columnType": 4,
"isNullable": false,
"dartType": "DateTime"
}
],
"foreignKeys": [
{
"__className__": "serverpod.ForeignKeyDefinition",
"constraintName": "halkyon_oidc_identity_fk_0",
"columns": [
"authUserId"
],
"referenceTable": "serverpod_auth_core_user",
"referenceTableSchema": "public",
"referenceColumns": [
"id"
],
"onUpdate": 3,
"onDelete": 4
}
],
"indexes": [
{
"__className__": "serverpod.IndexDefinition",
"indexName": "halkyon_oidc_identity_subject_idx",
"elements": [
{
"__className__": "serverpod.IndexElementDefinition",
"type": 0,
"definition": "provider"
},
{
"__className__": "serverpod.IndexElementDefinition",
"type": 0,
"definition": "subject"
}
],
"type": "btree",
"isUnique": true,
"isPrimary": false
},
{
"__className__": "serverpod.IndexDefinition",
"indexName": "halkyon_oidc_identity_person_idx",
"elements": [
{
"__className__": "serverpod.IndexElementDefinition",
"type": 0,
"definition": "authUserId"
},
{
"__className__": "serverpod.IndexElementDefinition",
"type": 0,
"definition": "provider"
}
],
"type": "btree",
"isUnique": true,
"isPrimary": false
}
],
"managed": true
}
}
],
"warnings": [],
"migrationApiVersion": 1
}

View file

@ -28,6 +28,7 @@ part '20261021100422048-session-ended-warning/migration.dart';
part '20261021110159867-second-factor-paths/migration.dart';
part '20261021134803749-reset-hold-outs/migration.dart';
part '20261021184601197-private-studysets/migration.dart';
part '20261023181810112-oidc-module/migration.dart';
/// Migration registry for the client-side database.
class MigrationRegistry {
@ -58,6 +59,7 @@ class MigrationRegistry {
_Migration20261021110159867_second_factor_paths(),
_Migration20261021134803749_reset_hold_outs(),
_Migration20261021184601197_private_studysets(),
_Migration20261023181810112_oidc_module(),
];
/// List of all client-side database migration versions.

View file

@ -49,6 +49,7 @@ import 'package:halkyon_learn_client/src/protocol/instance/instance_info.dart'
as _i26u8vl4;
import 'package:halkyon_learn_client/src/protocol/publish/publication.dart'
as _ij0cqo11;
import 'package:halkyon_oidc_client/halkyon_oidc_client.dart' as _ibkpwzgl;
import 'package:http/http.dart' as _i85jenna;
import 'package:serverpod_auth_core_client/serverpod_auth_core_client.dart'
as _iacc;
@ -865,6 +866,7 @@ class Modules {
base = _ihk4p5t7.Caller(client);
serverpod_auth_idp = _iaic.Caller(client);
offline_sync = _ipulbpi2.Caller(client);
oidc = _ibkpwzgl.Caller(client);
serverpod_auth_core = _iacc.Caller(client);
}
@ -874,6 +876,8 @@ class Modules {
late final _ipulbpi2.Caller offline_sync;
late final _ibkpwzgl.Caller oidc;
late final _iacc.Caller serverpod_auth_core;
}
@ -962,6 +966,7 @@ class Client extends _isc.ServerpodClientShared {
'base': modules.base,
'serverpod_auth_idp': modules.serverpod_auth_idp,
'offline_sync': modules.offline_sync,
'oidc': modules.oidc,
'serverpod_auth_core': modules.serverpod_auth_core,
};

View file

@ -30,6 +30,7 @@ import 'package:halkyon_learn_client/src/protocol/explore/explore_entry.dart'
as _iyigb6vc;
import 'package:halkyon_learn_client/src/protocol/feedback/feedback_view.dart'
as _idpwh21d;
import 'package:halkyon_oidc_client/halkyon_oidc_client.dart' as _ibkpwzgl;
import 'package:serverpod_auth_core_client/serverpod_auth_core_client.dart'
as _iacc;
import 'package:serverpod_auth_idp_client/serverpod_auth_idp_client.dart'
@ -2358,6 +2359,10 @@ class Protocol extends _isd.DatabaseSerializationManager {
? (_ipulbpi2.Protocol() as _isd.DatabaseSerializationManager)
.getTargetTableDefinitions()
: [],
..._ibkpwzgl.Protocol() is _isd.DatabaseSerializationManager
? (_ibkpwzgl.Protocol() as _isd.DatabaseSerializationManager)
.getTargetTableDefinitions()
: [],
..._iacc.Protocol() is _isd.DatabaseSerializationManager
? (_iacc.Protocol() as _isd.DatabaseSerializationManager)
.getTargetTableDefinitions()
@ -2887,6 +2892,9 @@ class Protocol extends _isd.DatabaseSerializationManager {
try {
return _ipulbpi2.Protocol().deserialize<T>(data, t);
} on _isc.DeserializationTypeNotFoundException catch (_) {}
try {
return _ibkpwzgl.Protocol().deserialize<T>(data, t);
} on _isc.DeserializationTypeNotFoundException catch (_) {}
try {
return _iacc.Protocol().deserialize<T>(data, t);
} on _isc.DeserializationTypeNotFoundException catch (_) {}
@ -3094,6 +3102,10 @@ class Protocol extends _isd.DatabaseSerializationManager {
? className
: 'serverpod_offline_sync.$className';
}
className = _ibkpwzgl.Protocol().getClassNameForObject(data);
if (className != null) {
return className.contains('.') ? className : 'halkyon_oidc.$className';
}
className = _iacc.Protocol().getClassNameForObject(data);
if (className != null) {
return className.contains('.')
@ -3286,6 +3298,10 @@ class Protocol extends _isd.DatabaseSerializationManager {
data['className'] = dataClassName.substring(23);
return _ipulbpi2.Protocol().deserializeByClassName(data);
}
if (dataClassName.startsWith('halkyon_oidc.')) {
data['className'] = dataClassName.substring(13);
return _ibkpwzgl.Protocol().deserializeByClassName(data);
}
if (dataClassName.startsWith('serverpod_auth_core.')) {
data['className'] = dataClassName.substring(20);
return _iacc.Protocol().deserializeByClassName(data);
@ -3297,6 +3313,7 @@ class Protocol extends _isd.DatabaseSerializationManager {
_ihk4p5t7.Protocol().registerHostProtocol('halkyon_learn', this);
_iaic.Protocol().registerHostProtocol('halkyon_learn', this);
_ipulbpi2.Protocol().registerHostProtocol('halkyon_learn', this);
_ibkpwzgl.Protocol().registerHostProtocol('halkyon_learn', this);
_iacc.Protocol().registerHostProtocol('halkyon_learn', this);
}
@ -3329,6 +3346,15 @@ class Protocol extends _isd.DatabaseSerializationManager {
return table;
}
}
{
var protocol = _ibkpwzgl.Protocol();
var table = protocol is _isd.DatabaseSerializationManager
? (protocol as _isd.DatabaseSerializationManager).getTableForType(t)
: null;
if (table != null) {
return table;
}
}
{
var protocol = _iacc.Protocol();
var table = protocol is _isd.DatabaseSerializationManager
@ -3412,6 +3438,9 @@ class Protocol extends _isd.DatabaseSerializationManager {
try {
return _ipulbpi2.Protocol().mapRecordToJson(record);
} catch (_) {}
try {
return _ibkpwzgl.Protocol().mapRecordToJson(record);
} catch (_) {}
try {
return _iacc.Protocol().mapRecordToJson(record);
} catch (_) {}