feat: add authentik admin user sync endpoint
This commit is contained in:
@@ -21,4 +21,4 @@
|
||||
- 核心 API:已建立(health/internal/admin)
|
||||
- API key 驗證:已建立(`X-Client-Key` + `X-API-Key`)
|
||||
- Authentik JWT 驗證:已建立(`/me` 路由 + JWKS 驗簽)
|
||||
- Authentik Admin API(建立/停用使用者):待補
|
||||
- Authentik Admin API(建立/更新使用者):已建立(`/internal/authentik/users/ensure`)
|
||||
|
||||
@@ -56,6 +56,7 @@
|
||||
- 內部路由(系統對系統)
|
||||
- `POST /internal/users/upsert-by-sub`
|
||||
- `GET /internal/permissions/{authentik_sub}/snapshot`
|
||||
- `POST /internal/authentik/users/ensure`
|
||||
- header: `X-Internal-Secret`
|
||||
- 管理路由(後台/API client)
|
||||
- `POST /admin/permissions/grant`
|
||||
@@ -72,6 +73,9 @@
|
||||
- `me` 路由使用 Authentik Access Token 驗證:
|
||||
- 使用 `AUTHENTIK_JWKS_URL` 或 `AUTHENTIK_ISSUER` 推導 JWKS
|
||||
- 可選 `AUTHENTIK_AUDIENCE` 驗證 aud claim
|
||||
- Authentik Admin 整合:
|
||||
- 使用 `AUTHENTIK_BASE_URL + AUTHENTIK_ADMIN_TOKEN`
|
||||
- 可透過 `/internal/authentik/users/ensure` 建立或更新 Authentik user
|
||||
- 建議上線前:
|
||||
- 將 `.env` 範本中的明文密碼改為部署平台 secret
|
||||
- API key 全部改為 argon2/bcrypt hash
|
||||
|
||||
@@ -12,6 +12,7 @@ cp .env.example .env
|
||||
## 2. 建立資料表
|
||||
1. 先執行 `member.ose.tw/docs/API_CLIENTS_SQL.sql`
|
||||
2. 再執行 `member.ose.tw/backend/scripts/init_schema.sql`
|
||||
3. 若是舊資料庫,補跑 `member.ose.tw/backend/scripts/migrate_add_authentik_user_id.sql`
|
||||
|
||||
## 3. 啟動服務
|
||||
```bash
|
||||
|
||||
Reference in New Issue
Block a user