dify/api/controllers/console
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
..
agent feat: agent slash menu backend (#37268) 2026-06-10 10:40:03 +00:00
app fix: validate conversation variable description length to prevent varchar(255) truncation error (#33038) 2026-06-10 07:28:12 +00:00
auth fix: block frozen deleted accounts during invite activation (#37281) 2026-06-10 10:21:05 +00:00
billing refactor(api): migrate tenant/user via DI for several endpoints (#36971) 2026-06-03 04:24:17 +00:00
datasets fix: validate conversation variable description length to prevent varchar(255) truncation error (#33038) 2026-06-10 07:28:12 +00:00
explore chore: filter unavailable apps from the installed apps list API (#37206) 2026-06-09 05:12:29 +00:00
snippets fix: validate conversation variable description length to prevent varchar(255) truncation error (#33038) 2026-06-10 07:28:12 +00:00
socketio feat: collaboration (#30781) 2026-04-16 02:21:04 +00:00
tag feat: snippet (#37046) 2026-06-05 09:38:42 +00:00
workspace fix(plugin): align plugin list endpoint counts with live endpoint state (#37179) 2026-06-10 08:11:11 +00:00
__init__.py feat: snippet (#37046) 2026-06-05 09:38:42 +00:00
admin.py chore: remove obsolete admin console routes (#35637) 2026-05-13 08:08:50 +00:00
apikey.py feat: allow knowledge base API keys to be scoped to a single dataset 2026-06-11 11:41:47 +09:00
error.py Restructure the File errors in controller (#23801) 2025-08-13 17:06:07 +08:00
extension.py chore: inject tenant id in extension handlers (#36656) 2026-05-26 05:45:03 +00:00
feature.py chore: split trial models to a single API (#36796) 2026-05-31 13:09:13 +00:00
files.py refactor(api): migrate console tags to tenant/user via DI and improve tests (#36658) 2026-05-26 08:20:10 +00:00
human_input_form.py fix: validate conversation variable description length to prevent varchar(255) truncation error (#33038) 2026-06-10 07:28:12 +00:00
init_validate.py refactor: init_validate.py to v3 (#31457) 2026-01-30 22:39:02 +09:00
notification.py chore: inject current user in console handlers (#36628) 2026-05-25 13:14:08 +00:00
ping.py feat: init fastopenapi (#30453) 2026-01-23 21:07:52 +09:00
remote_files.py fix(api): centralize remote file retrieval (#36399) 2026-06-01 09:25:08 +00:00
setup.py refactor: select in console auth, setup and apikey (#33790) 2026-03-21 11:29:29 +09:00
spec.py refactor(router): apply ns.route style (#26339) 2025-09-28 13:37:06 +08:00
version.py refactor: api/controllers/console/version.py to v3 (#31463) 2026-01-26 15:04:25 +08:00
wraps.py refactor(api): migrate tenant/user via DI for several endpoints (#37026) 2026-06-04 05:52:59 +00:00