Phase 3: Fix medium-priority issues (M1-M4, M6)

M1: Password complexity validation (min 8 chars, uppercase, lowercase, digit)
M2: Remove is_system_admin from login response (prevent role leaking)
M3: Permission cache invalidates on DB error instead of using stale data
M4: .env.docker.example already fixed in B9 (SECRET_KEY, FRONTEND_URL, SMTP)
M6: Frontend test setup auto-wraps with QueryClientProvider (fixes ~29 test failures)

Remaining: M5 (frontend component integration — WelcomeDialog, SavedFilterBar, etc.)
This commit is contained in:
Agent Zero
2026-07-26 20:51:40 +02:00
parent 604a2b7648
commit 825d638130
5 changed files with 68 additions and 5 deletions
+4 -2
View File
@@ -337,11 +337,13 @@ async def get_cached_permissions(
except Exception:
logger.warning(
"Failed to query current permission_version for cache validation "
"(user=%s, tenant=%s) — using cached data",
"(user=%s, tenant=%s) — invalidating cache and re-resolving",
user_id, tenant_id,
exc_info=True,
)
current_version = cached_version # assume cache is valid if we can't check
# Invalidate stale cache — do NOT trust cached permissions on DB error
await redis.delete(cache_key)
return None # Fall through to re-resolution from DB
if cached_version == current_version:
return data