{ "task_id": "AUTH-MICROSOFT-REMEMBER-001", "status": "completed", "executed_at": "2026-03-10T00:00:00Z", "steps": [ { "id": "S1", "title": "Datenmodell und Settings-Keys festlegen", "status": "completed", "changes": [ "lib/Service/Settings/SettingKeys.php — added MICROSOFT_AUTO_REMEMBER_DEFAULT_KEY and REMEMBER_TOKEN_LIFETIME_DAYS_KEY", "db/init/init.sql — added auto_remember_mode column to tenant_auth_microsoft, added 2 settings seed rows", "db/updates/2026-03-10-microsoft-auto-remember.sql — NEW idempotent update script" ] }, { "id": "S2", "title": "Settings-Gateway fuer Login-Persistenz implementieren", "status": "completed", "changes": [ "lib/Service/Settings/SettingsLoginPersistenceGateway.php — NEW gateway (bool+int with validation, fallbacks)", "lib/Service/Settings/SettingServicesFactory.php — added createSettingsLoginPersistenceGateway()", "lib/App/Container/Registrars/SettingsRegistrar.php — registered gateway + injected into AdminSettingsService" ] }, { "id": "S3", "title": "Tenant-Sso-Service auf Override-Policy erweitern", "status": "completed", "changes": [ "lib/Service/Auth/AuthSettingsGateway.php — added SettingsLoginPersistenceGateway dep + 2 delegate methods", "lib/Service/Auth/AuthGatewayFactory.php — added createSettingsLoginPersistenceGateway() + wired to AuthSettingsGateway", "lib/Repository/Tenant/TenantMicrosoftAuthRepository.php — added auto_remember_mode to SELECT/UPSERT", "lib/Service/Auth/TenantSsoService.php — added auto_remember_mode to get/save, normalizeAutoRememberMode(), shouldAutoRememberOnMicrosoftLogin()" ] }, { "id": "S4", "title": "Admin-Settings-Flow erweitern", "status": "completed", "changes": [ "lib/Service/Settings/AdminSettingsService.php — added SettingsLoginPersistenceGateway to constructor, buildPageData, updateFromAdmin, audit arrays" ] }, { "id": "S5", "title": "Tenant-SSO-UI und AuthZ-Feldschutz erweitern", "status": "completed", "changes": [ "pages/admin/tenants/_form.phtml — added tri-state select for microsoft_auto_remember_mode in SSO tab", "lib/Service/Access/TenantAuthorizationPolicy.php — added microsoft_auto_remember_mode to containsSsoFields()" ] }, { "id": "S6", "title": "RememberMeService auf dynamische TTL umstellen", "status": "completed", "changes": [ "lib/Service/Auth/RememberMeService.php — added nullable AuthSettingsGateway param, modified lifetimeSeconds()", "lib/Service/Auth/AuthServicesFactory.php — passes AuthSettingsGateway to RememberMeService" ] }, { "id": "S7", "title": "Microsoft-Callback um Policy-gesteuertes Remember erweitern", "status": "completed", "changes": [ "pages/auth/microsoft/callback().php — added shouldAutoRememberOnMicrosoftLogin + rememberUser call after successful login" ] }, { "id": "S8", "title": "Tests erweitern und Gates absichern", "status": "completed", "changes": [ "tests/Service/Settings/SettingsLoginPersistenceGatewayTest.php — NEW (16 tests: bool/int getter/setter, validation, fallback, seconds computation)", "tests/Service/Settings/AdminSettingsServiceSessionPolicyTest.php — extended with 3 login persistence tests", "tests/Service/Auth/TenantSsoServiceTest.php — extended with 6 shouldAutoRemember + saveTenantMicrosoftAuth tests", "tests/Service/Access/TenantAuthorizationPolicyTest.php — extended with 1 auto_remember_mode SSO field test", "tests/Service/Auth/RememberMeServiceTest.php — extended with 2 dynamic TTL tests + updated helper", "i18n/default_de.json — added 12 translation keys", "i18n/default_en.json — added 12 translation keys", "pages/admin/settings/index(default).phtml — added Login persistence card in Security tab" ] }, { "id": "S9", "title": "Review-Guard-Findings beheben (Re-Run)", "status": "completed", "changes": [ "lib/App/Container/Registrars/SettingsRegistrar.php — fixed import order (ordered_imports)", "lib/Service/Auth/AuthGatewayFactory.php — fixed import order (ordered_imports)", "tests/Service/Settings/AdminSettingsServiceSessionPolicyTest.php — fixed import order (ordered_imports)", "pages/admin/tenants/create().php — added auto_remember_mode to POST repopulation for SSO fields", "pages/admin/tenants/edit($id).php — added auto_remember_mode to POST repopulation for SSO fields" ] } ], "quality_gates": [ { "id": "QG-001", "description": "PHPUnit", "status": "PASS", "evidence": "555 tests, 13476 assertions, 0 failures" }, { "id": "QG-002", "description": "PHPStan level 5", "status": "PASS", "evidence": "No errors" }, { "id": "QG-003", "description": "CoreStarterkitContractTest", "status": "PASS", "evidence": "11 tests, 6253 assertions, 0 failures" }, { "id": "QG-005", "description": "Browser smoke", "status": "PASS", "evidence": "Manually tested: Admin Settings Security tab, Tenant SSO form, and Microsoft login callback verified in browser" }, { "id": "QG-006", "description": "PHP CS Fixer", "status": "PASS", "evidence": "530 files checked, 0 fixable issues, exit code 0" } ], "success_criteria": [ { "id": "SC-001", "status": "PASS", "evidence": "SettingsLoginPersistenceGateway implements isMicrosoftAutoRememberDefault() (fallback false) and getRememberTokenLifetimeDays() (fallback 30, range 1-365). Both included in buildPageData(). 16 unit tests cover all paths." }, { "id": "SC-002", "status": "PASS", "evidence": "tenant_auth_microsoft.auto_remember_mode column (NULL/0/1) added. TenantSsoService get/save include the field. Tenant form has tri-state select. 6 tests cover policy resolution." }, { "id": "SC-003", "status": "PASS", "evidence": "Microsoft callback calls shouldAutoRememberOnMicrosoftLogin() after loginUserById success only. force_off and global-off+inherit correctly prevent token creation." }, { "id": "SC-004", "status": "PASS", "evidence": "RememberMeService.lifetimeSeconds() reads from AuthSettingsGateway when available, falls back to 30-day constant. Token creation and rotation both use lifetimeSeconds(). 2 tests verify dynamic TTL." }, { "id": "SC-005", "status": "PASS", "evidence": "All visible text uses t(). 12 keys added to de/en. CSRF/PRG/AuthZ unchanged. containsSsoFields() includes microsoft_auto_remember_mode." }, { "id": "SC-006", "status": "PASS", "evidence": "QG-001 (555 tests PASS), QG-002 (0 errors), QG-003 (11 contract tests PASS), QG-006 (CS Fixer PASS, 0 fixable issues, exit 0). New test file + 4 extended test files." } ], "resolved_findings": [ { "id": "RG-001", "resolution": "Ran composer cs:check (QG-006). Fixed 3 ordered_imports violations in SettingsRegistrar.php, AuthGatewayFactory.php, AdminSettingsServiceSessionPolicyTest.php. Fixed pre-existing blank_line_after_opening_tag in config/settings.php. CS check now exits 0 with 0 fixable issues." }, { "id": "RG-002", "resolution": "Added 'auto_remember_mode' => $post['microsoft_auto_remember_mode'] ?? null to the SSO field repopulation array in pages/admin/tenants/create().php. Selection now survives validation errors." }, { "id": "RG-003", "resolution": "Added 'auto_remember_mode' => $post['microsoft_auto_remember_mode'] ?? null to the SSO field repopulation array in pages/admin/tenants/edit($id).php. Selection now survives validation errors." } ], "open_items": [] }