WeKnora/internal
wizardchen d2ffc1b973 refactor(api-keys): simplify authorization to a single-role gate
Redesign tenant API key authorization around one dimension (role) plus a
central default-deny gate, replacing the previous role + KB-scoped flag model.

- Add APIKeyGate as the single authority for API-key authorization: routes
  declare one policy (MinRole) via apiKeyGroup/apiKeyRoute helpers; undeclared
  routes are denied by default. JWT principals short-circuit the gate and the
  JWT-centric RBAC guards short-circuit for API-key principals.
- Roles: viewer/contributor/admin are knowledge-base data-plane only (KB scope
  is a pure downstream data filter); owner is a full-access tenant tier that
  unlocks tenant-level infrastructure routes and is required for every method.
- Drop the KBScoped policy flag and the KB-restricted-vs-tenant branching.
- Security hardening: never disclose HMAC secret (return presence only), abort
  writes on API-key encryption failure, deny KB-restricted keys on /files, and
  backfill legacy key hashes at startup instead of O(N) plaintext scans.
- Frontend: two-level create dialog (access type -> permission level), rename
  role labels to reflect actual scope, sync en/zh/ko/ru locales.
- Fix startup self-check false-positive on trailing-slash routes and normalize
  gin paths before comparison; add regression tests.
2026-07-07 12:00:13 +08:00
..
agent fix(agent): treat end_turn as natural stop 2026-07-06 23:16:18 +08:00
application refactor(api-keys): simplify authorization to a single-role gate 2026-07-07 12:00:13 +08:00
assets feat(assets): add ASR test audio file and embed it in the application 2026-04-02 21:27:27 +08:00
common fix(redis): harden TLS tests and surface TLS config at startup 2026-07-06 23:04:52 +08:00
config test: add document process task options tests 2026-05-28 20:27:53 +08:00
container feat: add scoped tenant api keys 2026-07-07 12:00:13 +08:00
database feat(system-info): surface DB migration errors with troubleshooting links 2026-05-14 16:34:50 +08:00
datasource fix(security): close remaining GHSA gaps from security triage 2026-07-02 15:03:53 +08:00
errors feat(knowledge): track per-stage parsing progress with /stages API 2026-05-28 15:14:45 +08:00
event feat(mcp): prompt and resume OAuth authorization mid-conversation 2026-06-29 23:22:28 +08:00
handler refactor(api-keys): simplify authorization to a single-role gate 2026-07-07 12:00:13 +08:00
im fix(search): apply tag filters to knowledge search 2026-07-06 23:30:33 +08:00
infrastructure fix(security): redact IM list credentials and harden MinerU SSRF 2026-07-02 17:58:20 +08:00
logger refactor(api-keys): use role field and route-level API key guards 2026-07-07 12:00:13 +08:00
mcp feat(im): include per-service MCP OAuth URLs in IM auth notices 2026-07-01 17:53:54 +08:00
middleware refactor(api-keys): simplify authorization to a single-role gate 2026-07-07 12:00:13 +08:00
models fix(security): harden model client redirects 2026-07-02 19:15:46 +08:00
ratelimit feat(embed): add backend embed channels with auth and rate limiting (#1657) 2026-06-12 23:10:39 +08:00
router refactor(api-keys): simplify authorization to a single-role gate 2026-07-07 12:00:13 +08:00
runtime fix(redis): harden TLS tests and surface TLS config at startup 2026-07-06 23:04:52 +08:00
sandbox perf(sandbox): compile command-substitution regexps once 2026-06-16 19:51:32 +08:00
searchutil feat(backend): improve parent-child chunk merge and imageinfo matching 2026-06-16 01:09:07 +08:00
stream feat(redis): support TLS for Redis connections (#1930) 2026-07-06 23:02:02 +08:00
tracing/langfuse feat(observability): enhance Langfuse retrieve and rerank tracing 2026-06-16 01:09:23 +08:00
types refactor(api-keys): simplify authorization to a single-role gate 2026-07-07 12:00:13 +08:00
utils fix(security): harden outbound requests and file previews 2026-07-02 19:15:46 +08:00