Add code resolver, sync conflict handling, and user isolation

Introduce a CodeResolverService to classify user login codes, complete with detailed resolution logic and usability checks. Extend the sync system to handle conflicts via last-write-wins arbitration, with detailed conflict tracking for review. Update file permissions and runtime isolation in Docker to enhance security.
This commit is contained in:
2026-09-12 15:40:42 +02:00
parent 9278c7fc34
commit 0e3b5003f6
6 changed files with 2401 additions and 710 deletions
+9 -4
View File
@@ -172,14 +172,19 @@ class _KonfiOrLeitungsteamSectionState extends State<_KonfiOrLeitungsteamSection
bool get _isLeitungsteamCode {
final c = _code.text.trim();
return c.length > 2 && c.toUpperCase().endsWith('LT');
final upper = c.toUpperCase();
final lower = c.toLowerCase();
return upper == 'LT' || (c.length > 2 && upper.endsWith('LT')) || lower == 'login' || lower == 'sso';
}
/// The KC-Code with a trailing "LT" trigger stripped back off, so
/// "ABC123LT" still resolves to the real invite code "ABC123".
String get _plainCode {
final c = _code.text.trim();
return _isLeitungsteamCode ? c.substring(0, c.length - 2) : c;
if (c.toUpperCase() == 'LT' || c.toLowerCase() == 'login' || c.toLowerCase() == 'sso') return '';
return (c.length > 2 && c.toUpperCase().endsWith('LT'))
? c.substring(0, c.length - 2)
: c;
}
@override
@@ -196,8 +201,8 @@ class _KonfiOrLeitungsteamSectionState extends State<_KonfiOrLeitungsteamSection
),
const SizedBox(height: 4),
Text(
'Konfi: gib deinen KC-Code ein. Leitungsteam: hänge "LT" an den '
'Code an (z. B. "ABC123LT").',
'Konfi: gib deinen KC-Code ein. Leitungsteam: gib "LT" ein oder hänge "LT" an den '
'Code an (z. B. "LT" oder "ABC123LT").',
style: Theme.of(context).textTheme.bodySmall,
),
const SizedBox(height: 16),