yumoqing 622b0558b9 fix(rbac): fix high-concurrency race conditions in login and cache
1. Login lockout race condition:
   - Replace SELECT-then-UPDATE with atomic database operations
   - Lockout check now in SQL WHERE clause (DATE_SUB comparison)
   - Fail count increment: UPDATE ... SET count = count + 1 (atomic)
   - Applied to checkUserPassword, basic_auth, up_login.dspy, phone_login.dspy

2. Cache threading.Lock -> asyncio.Lock:
   - LRUCache now uses lazy-init asyncio.Lock
   - Prevents blocking the event loop in async environment
   - UserPermissions._rp_lock also uses asyncio.Lock
   - Double-check pattern in load_roleperms prevents duplicate DB loads

3. Use database NOW() instead of Python curDateString for concurrent updates
2026-04-26 10:58:13 +08:00
2026-03-25 14:14:47 +08:00
2025-07-16 14:19:12 +08:00
2025-07-16 14:19:12 +08:00
2025-07-16 14:19:12 +08:00
2025-07-16 14:19:12 +08:00
2025-07-16 14:19:12 +08:00
2026-04-16 14:36:29 +08:00

rbac

Description
No description provided
Readme 703 KiB
Languages
Python 98.3%
Shell 1.7%