dify/web/service
Jyong 79116d8c4b feat(knowledge-fs): scope dataset API keys by knowledge base type
Legacy knowledge bases (`datasets`) and KnowledgeFS spaces
(`knowledge_fs_control_spaces`) live in different tables, so a dataset API
key binding could only ever name a legacy dataset and the KnowledgeFS service
API never consulted bindings at all: a key scoped to specific knowledge bases
still reached every KnowledgeFS space in the workspace.

- Bindings carry a `resource_type` (`dataset` | `knowledge_fs_space`) and a
  nullable `control_space_id` (migration 9a4e7d1c2b60, existing rows stay
  `dataset`), with a CHECK that exactly one id column matches the type.
- `dataset_api_key_service` exposes the key scope by kind, validates and
  binds KnowledgeFS spaces (tenant-owned, not deleting/deleted), and cleans up
  keys scoped only to a space when its deletion is requested. The orphan-key
  cleanup is now NULL-safe so a space binding keeps a key alive.
- Legacy dataset routes only honour `dataset` bindings; the KnowledgeFS
  authorization service only honours `knowledge_fs_space` bindings and raises
  a scope error that the service API maps to 403 (unknown keys stay 401).
- Console key creation accepts `knowledge_space_ids`; list/create responses
  return them next to `dataset_ids`.
- The web scope picker lists KnowledgeFS spaces alongside legacy datasets
  when KnowledgeFS is enabled and submits the ids by kind; the scope column
  counts both.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015zw5G5SX3HmVfnZof6YWAc
2026-09-03 05:59:39 -04:00
..
__tests__ fix(web): make registration tracking consent-safe and retryable (#41365) 2026-08-31 03:39:37 +00:00
access-control fix: protect workspace owners in resource access (#41423) 2026-08-28 03:03:40 +00:00
knowledge refactor(web): modernize Studio app list data flow (#40109) 2026-08-07 02:23:38 +00:00
knowledge-fs refactor(knowledge-fs): organize new rag feature boundaries 2026-08-31 18:45:40 +08:00
_tools_util.spec.ts chore(web): new lint setup (#30020) 2025-12-23 16:58:55 +08:00
_tools_util.ts fix: properly escape collectionName in query string parameters (#14476) 2025-02-27 18:59:07 +08:00
annotation.spec.ts style: format with vp fmt (#38803) 2026-07-12 15:57:46 +00:00
annotation.ts style: format with vp fmt (#38803) 2026-07-12 15:57:46 +00:00
app-deletion.ts fix(web): prevent workflow errors after app deletion (#40977) 2026-08-19 12:24:40 +00:00
apps.ts refactor(web): migrate access point mutations (#41614) 2026-09-02 03:17:03 +00:00
base.spec.ts feat: support agent skill (#39675) 2026-08-24 05:29:14 +00:00
base.ts fix(web): make registration tracking consent-safe and retryable (#41365) 2026-08-31 03:39:37 +00:00
client.spec.ts feat(knowledge-fs): scope dataset API keys by knowledge base type 2026-09-03 05:59:39 -04:00
client.ts Merge remote-tracking branch 'origin/main' into deploy/konwledge 2026-09-02 21:56:53 +08:00
common.spec.ts fix(web): make registration tracking consent-safe and retryable (#41365) 2026-08-31 03:39:37 +00:00
common.ts fix(auth): harden email code login verification (#40960) 2026-08-19 06:57:47 +00:00
console-link.ts style: format with vp fmt (#38803) 2026-07-12 15:57:46 +00:00
console-openapi-url.ts Merge remote-tracking branch 'origin/main' into deploy/konwledge 2026-08-27 10:06:48 +08:00
console-router-loader.ts Merge remote-tracking branch 'origin/main' into deploy/konwledge 2026-08-12 10:33:29 +08:00
datasets.ts Update application components and supporting logic 2026-08-11 05:52:22 -04:00
debug.ts fix: offset legacy app error toasts below model controls (#40040) 2026-08-06 04:14:12 +00:00
device-flow.ts style: format with vp fmt (#38803) 2026-07-12 15:57:46 +00:00
explore.spec.ts chore: upgrade Vite+ to 0.2.9 (#40762) 2026-08-14 04:42:28 +00:00
explore.ts refactor(api): extract recommended app query service (#40207) 2026-08-20 08:45:47 +00:00
fetch.spec.ts Merge remote-tracking branch 'origin/main' into deploy/konwledge 2026-08-20 10:11:26 +08:00
fetch.ts Merge remote-tracking branch 'origin/main' into deploy/konwledge 2026-08-20 10:11:26 +08:00
log.ts style: format with vp fmt (#38803) 2026-07-12 15:57:46 +00:00
marketplace-templates.ts style: format with vp fmt (#38803) 2026-07-12 15:57:46 +00:00
plugins.spec.ts chore: upgrade Vite+ to 0.2.9 (#40762) 2026-08-14 04:42:28 +00:00
plugins.ts fix(plugin): preserve credentials during local replacement (#39764) 2026-07-29 12:39:06 +00:00
refresh-token.ts style: format with vp fmt (#38803) 2026-07-12 15:57:46 +00:00
server.ts style: format with vp fmt (#38803) 2026-07-12 15:57:46 +00:00
share.ts fix(tts): propagate and validate actual audio MIME (#41043) 2026-08-24 03:38:09 +00:00
sso.ts style: format with vp fmt (#38803) 2026-07-12 15:57:46 +00:00
strategy.ts Introduce Plugins (#13836) 2025-02-17 17:05:13 +08:00
tools.ts style: format with vp fmt (#38803) 2026-07-12 15:57:46 +00:00
try-app.ts style: format with vp fmt (#38803) 2026-07-12 15:57:46 +00:00
use-base.ts feat: app deployment v2 (#39829) 2026-08-12 01:55:36 +00:00
use-common.ts fix(web): make registration tracking consent-safe and retryable (#41365) 2026-08-31 03:39:37 +00:00
use-datasource.ts style: format with vp fmt (#38803) 2026-07-12 15:57:46 +00:00
use-endpoints.ts style: format with vp fmt (#38803) 2026-07-12 15:57:46 +00:00
use-explore.ts chore: paginate installed apps (#39739) 2026-07-29 09:51:34 +00:00
use-flow.ts style: format with vp fmt (#38803) 2026-07-12 15:57:46 +00:00
use-log.ts style: format with vp fmt (#38803) 2026-07-12 15:57:46 +00:00
use-models.ts style: format with vp fmt (#38803) 2026-07-12 15:57:46 +00:00
use-pipeline.ts style: format with vp fmt (#38803) 2026-07-12 15:57:46 +00:00
use-plugins-auth.ts feat(plugin-auth): visibility picker for OAuth credentials (#39840) 2026-08-17 02:41:26 +00:00
use-plugins.ts refactor(web): clarify model selector trigger ownership (#40732) 2026-08-14 01:03:50 +00:00
use-share.spec.tsx feat: app deployment v2 (#39829) 2026-08-12 01:55:36 +00:00
use-share.ts feat: app deployment v2 (#39829) 2026-08-12 01:55:36 +00:00
use-snippet-workflows.ts style: format with vp fmt (#38803) 2026-07-12 15:57:46 +00:00
use-snippets.ts fix(snippet): support snippet history version export (#41012) 2026-08-20 08:52:45 +00:00
use-strategy.ts style: format with vp fmt (#38803) 2026-07-12 15:57:46 +00:00
use-tools.ts fix(web): use management provider list for MCP integrations (#41360) 2026-08-27 06:49:47 +00:00
use-triggers.ts fix: allow OAuth trigger builder verification without credentials (#39199) 2026-08-25 05:32:27 +00:00
use-try-app.ts style: format with vp fmt (#38803) 2026-07-12 15:57:46 +00:00
use-workflow.ts fix: handle published workflow request failures in access points (#41572) 2026-09-01 06:37:25 +00:00
use-workspace.ts chore: improve current workspace summary (#40121) 2026-08-07 03:08:55 +00:00
utils.ts test(web): remove low-value unit tests (#39193) 2026-07-17 08:59:26 +00:00
webapp-address.spec.ts chore: upgrade Vite+ to 0.2.9 (#40762) 2026-08-14 04:42:28 +00:00
webapp-address.ts feat: app deployment v2 (#39829) 2026-08-12 01:55:36 +00:00
webapp-auth.spec.ts chore: upgrade Vite+ to 0.2.9 (#40762) 2026-08-14 04:42:28 +00:00
webapp-auth.ts feat: app deployment v2 (#39829) 2026-08-12 01:55:36 +00:00
workflow-generator.ts chore: Improve workflow generator accessibility and API contracts (#38838) 2026-07-13 09:15:54 +00:00
workflow-queries.ts feat: app deployment v2 (#39829) 2026-08-12 01:55:36 +00:00
workflow.spec.ts chore: upgrade Vite+ to 0.2.9 (#40762) 2026-08-14 04:42:28 +00:00
workflow.ts feat: app deployment v2 (#39829) 2026-08-12 01:55:36 +00:00