dify/api/tests
kota-maeda0708 c232375fd2 feat: add visibility control for plugin datasource credentials
Plugin-based datasource credentials (Notion, Jina, Firecrawl, etc.) were
implicitly shared with every workspace member. PR #35468 added the
visibility column, creator tracking and read-side filtering for datasource
providers, but left no way to actually set or change a credential's scope,
so every datasource credential stayed effectively all_team_members.

This completes the datasource side:

Backend:
- add_datasource_api_key_provider / add_datasource_oauth_provider accept
  user_id and visibility; API keys default to all_team_members, OAuth
  defaults to only_me (matching the plugin-credential philosophy)
- new update_datasource_credential_visibility (+ console endpoint) so the
  creator can switch between only_me / all_team_members / partial_members;
  only the creator (or legacy NULL-owner rows) may change the scope
- replace_partial_member_list / clear_partial_member_list helpers on
  CredentialPermissionService (caller owns the transaction)
- list_datasource_credentials returns visibility, user_id, is_editable and
  partial_member_list

Frontend:
- VisibilityModal reusing PermissionSelector, with an empty-partial-members
  guard (the backend rejects an empty list)
- "Who can use" action in the credential operator, gated on is_editable
- scope badges (only me / partial team members) on the credential item

Existing credentials keep working: the visibility column defaults to
all_team_members and legacy rows with a NULL owner are always visible.
2026-06-25 00:00:40 +09:00
..
fixtures/workflow chore(api): Upgrade graphon to v0.5.1 (#37168) 2026-06-11 07:37:27 +00:00
helpers chore: port isinstance to match case (#37271) 2026-06-18 00:18:03 +00:00
integration_tests chore: make AccountService.load_user use passed session (#37764) 2026-06-24 07:29:12 +00:00
test_containers_integration_tests fix: add is_cloud_only for templates (#37846) 2026-06-24 08:29:54 +00:00
unit_tests feat: add visibility control for plugin datasource credentials 2026-06-25 00:00:40 +09:00
__init__.py refactor: move vdb implementations to workspaces (#34900) 2026-04-13 08:56:43 +00:00
conftest.py refactor(workflow-file): move core.file to core.workflow.file (#32252) 2026-02-16 22:38:19 +08:00
pytest_dify.py test(api): manage backend pytest services natively (#36235) 2026-05-19 07:52:15 +00:00
seed_legacy_model_type_dirty_data.py feat(api): introduce model-type migration script (#36520) 2026-05-27 02:12:11 +00:00
workflow_test_utils.py chore: reorg imports (#35308) 2026-04-16 08:50:02 +00:00