feat: add authentik jwt verification and me endpoints
This commit is contained in:
@@ -49,6 +49,10 @@
|
||||
## 5. API 設計(MVP)
|
||||
- 健康檢查
|
||||
- `GET /healthz`
|
||||
- 使用者路由(Bearer token)
|
||||
- `GET /me`
|
||||
- `GET /me/permissions/snapshot`
|
||||
- Bearer token 由 Authentik JWT + JWKS 驗證,並以 `sub` 自動 upsert user
|
||||
- 內部路由(系統對系統)
|
||||
- `POST /internal/users/upsert-by-sub`
|
||||
- `GET /internal/permissions/{authentik_sub}/snapshot`
|
||||
@@ -65,6 +69,9 @@
|
||||
- `api_key_hash` 驗證(支援 `sha256:<hex>` 與 bcrypt/argon2)
|
||||
- allowlist 驗證(origin/ip/path)
|
||||
- `internal` 路由使用 `X-Internal-Secret` 做服務間驗證
|
||||
- `me` 路由使用 Authentik Access Token 驗證:
|
||||
- 使用 `AUTHENTIK_JWKS_URL` 或 `AUTHENTIK_ISSUER` 推導 JWKS
|
||||
- 可選 `AUTHENTIK_AUDIENCE` 驗證 aud claim
|
||||
- 建議上線前:
|
||||
- 將 `.env` 範本中的明文密碼改為部署平台 secret
|
||||
- API key 全部改為 argon2/bcrypt hash
|
||||
|
||||
Reference in New Issue
Block a user