dify/api/controllers
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
..
common feat: guard openapi with rbac (#37752) 2026-06-22 09:35:33 +00:00
console feat: add visibility control for plugin datasource credentials 2026-06-25 00:00:40 +09:00
files feat(dify-agent): sync shell and back proxy updates (#37159) 2026-06-10 03:04:32 +00:00
inner_api chore: make AccountService.load_user use passed session (#37764) 2026-06-24 07:29:12 +00:00
mcp refactor(api): type end user records with enum (#36945) 2026-06-19 01:02:01 +00:00
openapi chore: make AccountService.load_user use passed session (#37764) 2026-06-24 07:29:12 +00:00
service_api chore: make AccountService.load_user use passed session (#37764) 2026-06-24 07:29:12 +00:00
trigger refactor(api): type webhook data extraction with RawWebhookDataDict TypedDict (#34486) 2026-04-03 02:24:17 +00:00
web fix: resolve DetachedInstanceError via session management refactoring (#37847) 2026-06-24 05:33:12 +00:00
__init__.py chore(api/controllers): Apply Ruff Formatter. (#7645) 2024-08-26 15:29:10 +08:00
API_SCHEMA_GUIDE.md refactor(api): migrate console.app.workflow to BaseModel (#36216) 2026-05-18 07:31:37 +00:00
fastopenapi.py chore(api): Fix several typing errors (#37119) 2026-06-06 01:44:32 +00:00