dify/api/tests/test_containers_integration_tests
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
..
commands feat(api): introduce model-type migration script (#36520) 2026-05-27 02:12:11 +00:00
controllers feat: allow knowledge base API keys to be scoped to a single dataset 2026-06-11 11:41:47 +09:00
core chore: DI current_user && use inspect (#37084) 2026-06-09 05:06:28 +00:00
factories refactor(tests): use db_session_with_containers in test_storage_key_loader (#35766) 2026-05-02 17:49:20 +00:00
helpers feat(api): introduce select, file and file list form input types to Human Input node (#36322) 2026-06-04 01:54:28 +00:00
libs test(api): manage backend pytest services natively (#36235) 2026-05-19 07:52:15 +00:00
models chore: reorg imports (#35308) 2026-04-16 08:50:02 +00:00
repositories feat(api): introduce select, file and file list form input types to Human Input node (#36322) 2026-06-04 01:54:28 +00:00
services feat: support import / export dsl in CLI (#37232) 2026-06-10 09:51:40 +00:00
tasks test: satisfy strict pyrefly for migrated container tests (#36791) 2026-06-01 11:09:40 +00:00
trigger refactor: quota v3 integration (#35436) 2026-04-27 01:49:40 +00:00
workflow refactor: add type to test (#30873) 2026-05-07 03:46:23 +00:00
__init__.py Feat add testcontainers test (#23269) 2025-08-04 19:27:36 +08:00
.ruff.toml test: migrate credit pool service tests to Testcontainers (#37252) 2026-06-10 01:55:50 +00:00
conftest.py test: migrate credit pool service tests to Testcontainers (#37252) 2026-06-10 01:55:50 +00:00
pyrefly.toml test: migrate credit pool service tests to Testcontainers (#37252) 2026-06-10 01:55:50 +00:00
test_container_state_isolation.py test: satisfy strict pyrefly for migrated container tests (#36791) 2026-06-01 11:09:40 +00:00
test_opendal_fs_default_root.py refactor: add type to test (#30873) 2026-05-07 03:46:23 +00:00
test_workflow_pause_integration.py refactor: add type to test (#30873) 2026-05-07 03:46:23 +00:00