dify/web/models
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
..
access-control.ts chore(web): new lint setup (#30020) 2025-12-23 16:58:55 +08:00
app.ts feat: allow knowledge base API keys to be scoped to a single dataset 2026-06-11 11:41:47 +09:00
common.ts fix(web): use generated account-profile contracts (#36927) 2026-06-02 07:28:05 +00:00
datasets.ts feat: per-credential visibility control for plugin credentials (#35468) 2026-06-01 05:56:18 +00:00
debug.ts chore: add query generator before lauch webapp (#35416) 2026-05-08 09:49:43 +00:00
explore.ts feat: support configurable explore app categories (#35723) 2026-05-08 06:04:07 +00:00
log.ts refactor: add console client migration demo (#36300) 2026-05-18 07:41:23 +00:00
permission.ts feat: per-credential visibility control for plugin credentials (#35468) 2026-06-01 05:56:18 +00:00
pipeline.ts refactor(web): drop headless-ui, migrate overlay to dify-ui (#35963) 2026-05-09 10:33:25 +00:00
share.ts chore: knip fix (#34481) 2026-04-02 15:03:42 +00:00
snippet.ts feat: snippet (#37046) 2026-06-05 09:38:42 +00:00
try-app.ts feat: frontend part of support try apps (#31287) 2026-01-22 18:16:37 +08:00