dify/api/tests/unit_tests/controllers/console/datasets
yungle246 a79bc7d074 feat(api): mask secret tokens in api-key list responses (reveal-once)
Previously the console api-key list returned every key's full plaintext
token, so anyone with console access could retrieve the secret of an
already-created key (via the copy button or the raw API response). This
is contrary to the reveal-once norm.

- List endpoints (app keys, workspace dataset keys, per-dataset keys) now
  return a masked token (prefix + last 4); the full secret is only ever
  returned by the create endpoint, at creation time.
- Frontend secret-key modal displays the masked token as-is and drops the
  copy affordance for existing keys (copying a masked value is pointless).

Applies to both app and dataset keys since they share the modal and the
ApiKeyItem response model.
2026-06-25 14:21:38 +09:00
..
rag_pipeline chore: add Type to test (#37191) 2026-06-19 16:44:20 +00:00
__init__.py fix: increase name length limit in ExternalDatasetCreatePayload (#31000) 2026-01-14 22:13:53 +09:00
test_data_source.py refactor(api): migrate tenant/user via DI for several endpoints (#37026) 2026-06-04 05:52:59 +00:00
test_datasets_document_download.py refactor(api): migrate tenant/user via DI for several endpoints (#37026) 2026-06-04 05:52:59 +00:00
test_datasets_document.py refactor(api): migrate tenant/user via DI for several endpoints (#37026) 2026-06-04 05:52:59 +00:00
test_datasets_segments.py refactor(api): migrate tenant/user via DI for several endpoints (#37026) 2026-06-04 05:52:59 +00:00
test_datasets.py feat(api): mask secret tokens in api-key list responses (reveal-once) 2026-06-25 14:21:38 +09:00
test_external_dataset_payload.py fix: increase name length limit in ExternalDatasetCreatePayload (#31000) 2026-01-14 22:13:53 +09:00
test_external.py feat: RBAC (#37107) 2026-06-18 16:35:29 +00:00
test_hit_testing_base.py refactor(api): migrate remaining console APIs to use injected user/tenant (#37288) 2026-06-11 01:30:31 +00:00
test_hit_testing.py refactor(api): migrate remaining console APIs to use injected user/tenant (#37288) 2026-06-11 01:30:31 +00:00
test_metadata.py refactor(api): migrate remaining console APIs to use injected user/tenant (#37288) 2026-06-11 01:30:31 +00:00
test_website.py chore: add type to test (#36324) 2026-05-18 08:47:47 +00:00
test_wraps.py chore: add Type to test (#35942) 2026-05-09 03:16:22 +00:00