Skip to content

fix(api): enforce admin and RBAC permissions on tool OAuth custom client GET endpoint (#40944) - #40945

Merged
asukaminato0721 merged 1 commit into
langgenius:mainfrom
agarwalpranav0711:fix/tool-oauth-custom-client-permission-check
Aug 20, 2026
Merged

fix(api): enforce admin and RBAC permissions on tool OAuth custom client GET endpoint (#40944)#40945
asukaminato0721 merged 1 commit into
langgenius:mainfrom
agarwalpranav0711:fix/tool-oauth-custom-client-permission-check

Conversation

@agarwalpranav0711

Copy link
Copy Markdown
Contributor

Summary

Fixes #40944

The GET /console/api/workspaces/current/tool-provider/builtin/<provider>/oauth/custom-client endpoint in ToolOAuthCustomClient was missing authorization decorators:

  • @is_admin_or_owner_required
  • @rbac_permission_required(RBACResourceScope.WORKSPACE, RBACPermission.CREDENTIAL_MANAGE, resource_required=False)

This allowed workspace members without admin/owner roles or credential management RBAC permissions to fetch custom OAuth client configuration details.

Added missing permission decorators to match sibling post and delete methods and added corresponding unit test assertion.

Screenshots

N/A (Backend API permission enforcement)

Checklist

  • This change requires a documentation update, included: Dify Document
  • I understand that this PR may be closed in case there was no previous discussion or issues. (This doesn't apply to typos!)
  • I've added a test for each change that was introduced, and I tried as much as possible to make a single atomic change.
  • I've updated the documentation accordingly.
  • I ran make lint && make type-check (backend) and vp staged (frontend) to appease the lint gods

@dosubot dosubot Bot added the size:XS This PR changes 0-9 lines, ignoring generated files. label Aug 18, 2026
@github-actions

github-actions Bot commented Aug 18, 2026

Copy link
Copy Markdown
Contributor

Pyrefly Type Coverage

Metric Base PR Delta
Type coverage 59.72% 59.72% -0.00%
Strict coverage 59.30% 59.30% -0.00%
Typed symbols 39,771 39,771 0
Untyped symbols 27,010 27,011 +1
Modules 3175 3175 0

@agarwalpranav0711
agarwalpranav0711 force-pushed the fix/tool-oauth-custom-client-permission-check branch from 17a7a0c to e7a95cc Compare August 19, 2026 17:26
@crazywoola

Copy link
Copy Markdown
Member

Please update to the latest origin/main and fix the CI errors.

@asukaminato0721
asukaminato0721 added this pull request to the merge queue Aug 20, 2026
@dosubot dosubot Bot added the lgtm This PR has been approved by a maintainer label Aug 20, 2026
Merged via the queue into langgenius:main with commit 43b6d8e Aug 20, 2026
32 of 34 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

lgtm This PR has been approved by a maintainer size:XS This PR changes 0-9 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

security(api): GET /tool-provider/builtin/{provider}/oauth/custom-client missing admin and RBAC permission decorators

3 participants