Skip to content

Fix Dev Portal showing both Password and Client Credentials cURL snippets regardless of enabled grant types - #1402

Open
Irash-Perera wants to merge 5 commits into
wso2:mainfrom
Irash-Perera:curl-grant
Open

Fix Dev Portal showing both Password and Client Credentials cURL snippets regardless of enabled grant types#1402
Irash-Perera wants to merge 5 commits into
wso2:mainfrom
Irash-Perera:curl-grant

Conversation

@Irash-Perera

@Irash-Perera Irash-Perera commented Jul 23, 2026

Copy link
Copy Markdown
Contributor

Purpose

Fix : CURL to Generate Access Token is not working when disabled "Client Credential" grant type

In the Dev Portal's "CURL to Generate Access Token" popup, both the Password grant and Client Credentials grant cURL commands were always shown, even when only one of those grant types was enabled on the application.

Fixes:

  • Only password enabled → only the Password grant cURL is shown.
Screenshot 2026-07-23 at 13 54 09
  • Only client_credentials enabled → only the Client Credentials cURL is shown.
Screenshot 2026-07-23 at 14 17 59
  • Both enabled → both are shown (unchanged behavior).
Screenshot 2026-07-23 at 13 59 22
  • When both disabled → button is not shown
Screenshot 2026-07-23 at 14 39 53

@coderabbitai

coderabbitai Bot commented Jul 23, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Warning

Review limit reached

@Irash-Perera, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 35 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 574cff81-3d14-480a-8d6d-46d28703105a

📥 Commits

Reviewing files that changed from the base of the PR and between ed219c1 and c4dc653.

📒 Files selected for processing (1)
  • portals/devportal/src/main/webapp/source/src/app/components/Shared/AppsAndKeys/ViewKeys.jsx
📝 Walkthrough

Walkthrough

ViewCurl conditionally renders grant-specific cURL sections based on supportedGrantTypes. ViewKeys passes the available grants and conditionally displays the access-token cURL button. Client Credentials help text is added to English localization.

Changes

Grant cURL filtering

Layer / File(s) Summary
Grant filtering contract
portals/devportal/.../ViewCurl.jsx, portals/devportal/.../en.json
ViewCurl accepts and declares supportedGrantTypes, and English localization adds Client Credentials cURL help text.
Conditional grant rendering
portals/devportal/.../ViewCurl.jsx, portals/devportal/.../ViewKeys.jsx
Password Grant and Client Credentials sections render conditionally, while ViewKeys passes supportedGrantTypesUnchanged and conditionally shows the access-token cURL button.

Estimated code review effort: 2 (Simple) | ~10 minutes

Suggested reviewers: heshansudarshana, krishanx92, lasanthas, pasant9

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately summarizes the main Dev Portal cURL grant-type filtering change.
Description check ✅ Passed The description is directly related and matches the implemented grant-type-specific cURL behavior.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

coderabbitai[bot]
coderabbitai Bot previously approved these changes Jul 23, 2026
tharikaGitHub
tharikaGitHub previously approved these changes Jul 23, 2026

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In
`@portals/devportal/src/main/webapp/source/src/app/components/Shared/AppsAndKeys/ViewKeys.jsx`:
- Around line 744-746: Normalize missing supported grant lists in ViewKeys
before rendering grant-specific controls, ensuring both
keys.get(selectedTab).supportedGrantTypes and supportedGrantTypesUnchanged use a
safe empty array when absent. Preserve the existing includes checks so ViewCurl
and access-token/cURL actions remain consistent without treating missing grants
as Password or Client Credentials support.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 11e5d635-0424-4d9d-a0aa-954cb553e572

📥 Commits

Reviewing files that changed from the base of the PR and between 78c7abd and ed219c1.

📒 Files selected for processing (3)
  • portals/devportal/src/main/webapp/site/public/locales/en.json
  • portals/devportal/src/main/webapp/source/src/app/components/Shared/AppsAndKeys/ViewCurl.jsx
  • portals/devportal/src/main/webapp/source/src/app/components/Shared/AppsAndKeys/ViewKeys.jsx
🚧 Files skipped from review as they are similar to previous changes (1)
  • portals/devportal/src/main/webapp/source/src/app/components/Shared/AppsAndKeys/ViewCurl.jsx

@sonarqubecloud

Copy link
Copy Markdown

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

CURL to Generate Access Token is not working when disabled "Client Credential" grant type

2 participants