perf: disable read-time sync and keep provider sync manual

This commit is contained in:
Chris
2026-04-03 01:23:42 +08:00
parent f351fe6454
commit 21167659f8
5 changed files with 104 additions and 6 deletions

View File

@@ -26,7 +26,8 @@
- 群組階層:`Company Group -> Site SubGroup`
- 系統角色:以 Keycloak client role 表示,對應 DB `roles`
- `site_roles` 代表某 Site 擁有的 Keycloak role 集合。
- 補齊策略:若 Keycloak 有、DB 沒有,後台同步流程會自動 upsert 到 DB
- 同步策略改為手動觸發:不在列表讀取 (`R`) 時自動同步
- 補齊策略:僅在手動同步按鈕(`POST /admin/sync/from-provider`)或 CUD 流程時同步。
- 使用者加入 Site 時,透過同步邏輯使其在 IdP 端取得對應角色能力。
## 後台安全線

View File

@@ -18,6 +18,7 @@
- 欄位:`system_key`, `name`, `provider_client_id`, `status`
- 系統詳情需顯示底下 `roles` 列表
- 建立/修改/刪除在 Keycloak 處理member 後台提供「同步 Keycloak」按鈕
- 所有資料列表頁不自動同步;需由使用者按下「同步」按鈕才觸發。
4. 角色管理DB 關聯為主)
- 欄位:`role_key`, `system_key`, `name`, `description`, `provider_role_name`, `status`

View File

@@ -59,6 +59,7 @@ npm run dev
3. `GET /me` 登入後應有資料。
4. 非 admin 群組帳號打 `/admin/*` 應為 403。
5. `POST /admin/sync/from-provider?force=true` 可手動觸發全量補齊同步。
6. 列表 API 不會自動同步 IdP避免高負載需手動按同步按鈕或呼叫同步 API。
## 6) 新模型驗收路徑
1. 新增 Company、Site。