dify/web/app/components/datasets
yungle246 be6612f454 feat: allow knowledge base API keys to be scoped to a single dataset
Reintroduce the nullable api_tokens.dataset_id column (dropped in 2e9819ca5b28)
so dataset API keys can opt into per-knowledge-base scoping:

- NULL dataset_id keeps today's workspace-wide behavior, so every existing key
  and the existing /datasets/api-keys create route are unchanged.
- validate_dataset_token rejects a bound key for any other dataset, and for
  endpoints that carry no dataset id (e.g. list-all), with 403.
- CachedApiToken carries dataset_id with a None default so cache entries
  written before deploy keep deserializing.
- The per-dataset console routes in apikey.py (previously dead code that 500ed
  on a missing ApiToken.dataset_id) now create bound keys; their list returns
  bound keys plus workspace keys so the dataset page shows the full access
  picture.
- Frontend: the knowledge base API access popover gains an API keys entry; the
  secret key modal accepts datasetId, shows a scope column, and offers a
  workspace / this-knowledge-base scope choice on create. New strings are
  localized for all 23 locales.
2026-06-11 11:41:47 +09:00
..
__tests__ test: add comprehensive unit and integration tests for dataset module (#32187) 2026-02-12 10:00:32 +08:00
api test: add comprehensive unit and integration tests for dataset module (#32187) 2026-02-12 10:00:32 +08:00
common refactor(web): replace useContext with use() in remaining components (#25193) (#37254) 2026-06-10 06:52:41 +00:00
create chore: seprate vector space quota query (#36514) 2026-05-22 09:26:17 +00:00
create-from-pipeline feat(web): create system-features vertical (#36894) 2026-06-01 10:15:25 +00:00
documents feat(ui): add kbd primitive (#36729) 2026-05-27 11:58:13 +00:00
external-api refactor: migrate to tailwind v4 style (#36417) 2026-05-20 03:39:44 +00:00
external-knowledge-base fix(dify-ui): align form label guidance (#36510) 2026-05-22 07:29:57 +00:00
extra-info feat: allow knowledge base API keys to be scoped to a single dataset 2026-06-11 11:41:47 +09:00
formatted-text refactor: migrate to tailwind v4 style (#36417) 2026-05-20 03:39:44 +00:00
hit-testing refactor(web): mark Props of datasets/hit-testing components as read-only (#37118) 2026-06-06 00:30:26 +00:00
list feat(web): create system-features vertical (#36894) 2026-06-01 10:15:25 +00:00
metadata fix(web): use generated account-profile contracts (#36927) 2026-06-02 07:28:05 +00:00
preview chore: enable noUncheckedIndexedAccess (#35178) 2026-04-16 13:01:35 +00:00
rename-modal feat(dify-ui): add textarea primitive (#36547) 2026-05-26 02:33:32 +00:00
settings fix(web): use generated current workspace query (#36843) 2026-05-31 13:04:18 +00:00
chunk.tsx chore: auto fix for tailwind rules (#35332) 2026-04-16 17:11:06 +00:00
loading.tsx fix oxlint warnings (#26634) 2025-10-09 09:23:34 +08:00
no-linked-apps-panel.tsx fix: check and update doc links (#30849) 2026-01-21 16:31:48 +08:00