Skip to content

fix(api): add missing admin and RBAC permission decorators to OAuth custom-client GET endpoint - #40979

Closed
FasihUrRahman wants to merge 1 commit into
langgenius:mainfrom
FasihUrRahman:fix/tool-oauth-custom-client-auth-decorators
Closed

fix(api): add missing admin and RBAC permission decorators to OAuth custom-client GET endpoint#40979
FasihUrRahman wants to merge 1 commit into
langgenius:mainfrom
FasihUrRahman:fix/tool-oauth-custom-client-auth-decorators

Conversation

@FasihUrRahman

Copy link
Copy Markdown
Contributor

Summary

Closes #40944

Add missing @is_admin_or_owner_required and @rbac_permission_required(RBACResourceScope.WORKSPACE, RBACPermission.CREDENTIAL_MANAGE, resource_required=False) decorators to the GET endpoint:

  • ToolOAuthCustomClient.get in api/controllers/console/workspace/tool_providers.py

Motivation & Impact

The POST and DELETE handlers of ToolOAuthCustomClient already enforce that only workspace admins/owners or members with the CREDENTIAL_MANAGE RBAC permission can manage OAuth custom clients. However, the GET endpoint was missing these decorators, allowing normal workspace members to retrieve sensitive OAuth client secrets.

Adding these decorators protects the endpoint and aligns the read handler with the write and delete operations.

…ustom-client GET endpoint

Add @is_admin_or_owner_required and @rbac_permission_required decorators to
ToolOAuthCustomClient.get in api/controllers/console/workspace/tool_providers.py.

This aligns the GET method with the POST and DELETE handlers on the same route,
ensuring normal workspace members without CREDENTIAL_MANAGE permissions cannot
retrieve sensitive OAuth client credentials.

Closes langgenius#40944
@dosubot dosubot Bot added the size:XS This PR changes 0-9 lines, ignoring generated files. label Aug 19, 2026
@crazywoola

Copy link
Copy Markdown
Member

Duplicated

@crazywoola crazywoola closed this Aug 20, 2026
@github-actions

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,770 39,770 0
Untyped symbols 27,011 27,011 0
Modules 3175 3175 0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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

2 participants