dify/api/tests/unit_tests/controllers
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
..
common refactor(api): migrate console/service_api.dataset.segment to BaseModel (#36522) 2026-05-30 13:54:01 +00:00
console feat: allow knowledge base API keys to be scoped to a single dataset 2026-06-11 11:41:47 +09:00
files feat(dify-agent): sync shell and back proxy updates (#37159) 2026-06-10 03:04:32 +00:00
inner_api feat(dify-agent): sync shell and back proxy updates (#37159) 2026-06-10 03:04:32 +00:00
openapi refactor(openapi): unify request validation behind @accepts/@returns decorators (#37216) 2026-06-10 03:02:24 +00:00
service_api feat: allow knowledge base API keys to be scoped to a single dataset 2026-06-11 11:41:47 +09:00
trigger fix: clarify webhook debug endpoint behavior (#33597) 2026-03-18 14:28:33 +08:00
web fix: validate conversation variable description length to prevent varchar(255) truncation error (#33038) 2026-06-10 07:28:12 +00:00
__init__.py feat: return data_source_info and data_source_detail_dict (#29912) 2026-01-05 11:04:03 +08:00
test_compare_versions.py refactor(version): simplify version comparison logic (#10109) 2024-10-31 15:15:32 +08:00
test_conversation_rename_payload.py fix: conversation rename payload validation (#29510) 2025-12-11 18:05:41 +09:00
test_swagger.py fix(web): use generated account-profile contracts (#36927) 2026-06-02 07:28:05 +00:00