Skip to content

fix(api): add missing admin and RBAC permission decorators to model credentials GET endpoints - #40962

Merged
asukaminato0721 merged 1 commit into
langgenius:mainfrom
FasihUrRahman:fix/model-credentials-auth-decorators
Aug 20, 2026
Merged

fix(api): add missing admin and RBAC permission decorators to model credentials GET endpoints#40962
asukaminato0721 merged 1 commit into
langgenius:mainfrom
FasihUrRahman:fix/model-credentials-auth-decorators

Conversation

@FasihUrRahman

Copy link
Copy Markdown
Contributor

Summary

Closes #40899

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

  • ModelProviderCredentialApi.get in api/controllers/console/workspace/model_providers.py
  • ModelProviderModelCredentialApi.get in api/controllers/console/workspace/models.py

Motivation & Impact

The corresponding post, put, and delete endpoints for model and provider credentials enforce that only workspace admins/owners or members with the CREDENTIAL_MANAGE RBAC permission can manage credentials. However, the get endpoints were missing these decorators, allowing non-admin members to retrieve configured credentials.

Adding these decorators aligns the read endpoints with their write counterparts and prevents unauthorized access to model credentials.

…redentials GET endpoints

Add @is_admin_or_owner_required and @rbac_permission_required decorators to:
- ModelProviderCredentialApi.get (api/controllers/console/workspace/model_providers.py)
- ModelProviderModelCredentialApi.get (api/controllers/console/workspace/models.py)

This matches sibling POST/PUT/DELETE endpoints and ensures normal members without
CREDENTIAL_MANAGE permissions cannot view raw workspace model provider credentials.

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

Copy link
Copy Markdown
Contributor

Pyrefly Type Coverage

Metric Base PR Delta
Type coverage 59.70% 59.69% -0.00%
Strict coverage 59.28% 59.28% -0.00%
Typed symbols 39,918 39,917 -1
Untyped symbols 27,141 27,142 +1
Modules 3181 3181 0

@wylswz
wylswz requested a review from fatelei August 19, 2026 08:27
@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 a7a30b2 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 /model-providers/{provider}/credentials and /models/credentials missing admin and RBAC permission decorators

2 participants