Skip to content

Refactor LLM provider authentication handling to default to 'none' fo… - #3051

Merged
Thushani-Jayasekera merged 2 commits into
wso2:mainfrom
Thushani-Jayasekera:final-test
Jul 30, 2026
Merged

Refactor LLM provider authentication handling to default to 'none' fo…#3051
Thushani-Jayasekera merged 2 commits into
wso2:mainfrom
Thushani-Jayasekera:final-test

Conversation

@Thushani-Jayasekera

Copy link
Copy Markdown
Contributor

$subject

…r missing credentials. Update related components to ensure consistent behavior across provider configurations.
@coderabbitai

coderabbitai Bot commented Jul 30, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Warning

Review limit reached

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

Next review available in: 49 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: 8fc81bd6-7fd1-43f3-9094-eca2d3c5c605

📥 Commits

Reviewing files that changed from the base of the PR and between 473f8b6 and e67afe3.

📒 Files selected for processing (3)
  • portals/ai-workspace/src/contexts/llmProvider/LLMProvidersContext.tsx
  • portals/ai-workspace/src/pages/appShell/appShellPages/proxies/LLMProxyNew.tsx
  • portals/ai-workspace/src/pages/appShell/appShellPages/proxies/LLMProxyProviderTab.tsx
📝 Walkthrough

Walkthrough

LLM provider creation and updates now normalize credentials and preserve upstream authentication types. Proxy creation and provider switching default missing authentication types to none.

Changes

LLM authentication normalization

Layer / File(s) Summary
Provider credential normalization
portals/ai-workspace/src/contexts/llmProvider/LLMProvidersContext.tsx
Provider creation and updates trim credentials, handle credential-less auth modes, conditionally create secrets, and propagate the upstream auth type into secret placeholders.
Proxy authentication defaults
portals/ai-workspace/src/pages/appShell/appShellPages/proxies/LLMProxyNew.tsx, portals/ai-workspace/src/pages/appShell/appShellPages/proxies/LLMProxyProviderTab.tsx
Proxy creation and provider switching now default missing upstream auth types to none.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Possibly related PRs

Suggested reviewers: rakhitharr, renuka-fernando, virajsalaka

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 inconclusive)

Check name Status Explanation Resolution
Description check ❓ Inconclusive The description is a placeholder ($subject) and does not meaningfully describe the changeset. Replace the placeholder with a brief summary of the auth-handling changes and affected components.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed It clearly summarizes the main change: LLM provider auth handling now defaults missing credentials to 'none'.
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 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: 4

🤖 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/ai-workspace/src/contexts/llmProvider/LLMProvidersContext.tsx`:
- Around line 198-201: Update the auth object construction in the affected
provider mappings to remove the spread of provider.upstream.main.auth and
explicitly include only header, type, and value. Preserve the existing type
fallback and secret placeholder assignment, and apply the same whitelist to the
additional occurrence identified in the diff.
- Around line 278-279: Update the credential handling in the update path to trim
the incoming auth value and derive the existing credential/hasCredential state
before rotating or persisting the secret. Use that normalized state to send auth
type “none” and avoid creating or retaining a credential when the value is
empty, including whitespace-only input; do not rely on the later type fallback
after buildSecretPlaceholder.
- Around line 154-183: Update the provider normalization around hasCredential,
authType, and isNoCredentialsAuthType so any missing credential, including when
auth.type is empty, produces explicit none auth with blank header and value.
Before createSecret, explicitly reject or handle credentials whose auth type is
empty, other, or none, preventing secret creation and the later contradictory
none-with-secret state. Preserve secret creation only for credential-bearing
auth types.

In
`@portals/ai-workspace/src/pages/appShell/appShellPages/proxies/LLMProxyNew.tsx`:
- Around line 356-358: Normalize proxy authentication atomically in
LLMProxyNew.tsx lines 356-358 and LLMProxyProviderTab.tsx lines 160-164: when
the auth type is none or absent, clear both header and value; when credentials
are populated, retain them only with a matching non-none auth type. Update the
related providerAuthType, providerAuthHeader, and providerAuthValue assignments
together in both sites.
🪄 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: 1cd84eb6-3508-48fb-9fa3-272555d77ae9

📥 Commits

Reviewing files that changed from the base of the PR and between ddd01b2 and 473f8b6.

📒 Files selected for processing (3)
  • portals/ai-workspace/src/contexts/llmProvider/LLMProvidersContext.tsx
  • portals/ai-workspace/src/pages/appShell/appShellPages/proxies/LLMProxyNew.tsx
  • portals/ai-workspace/src/pages/appShell/appShellPages/proxies/LLMProxyProviderTab.tsx

Comment thread portals/ai-workspace/src/contexts/llmProvider/LLMProvidersContext.tsx Outdated
Comment thread portals/ai-workspace/src/contexts/llmProvider/LLMProvidersContext.tsx Outdated
Comment thread portals/ai-workspace/src/pages/appShell/appShellPages/proxies/LLMProxyNew.tsx Outdated
…eatment of credentials across components. Update logic to clear header and value when auth type is 'none', and adjust related components for improved clarity and functionality.
@Thushani-Jayasekera
Thushani-Jayasekera merged commit 266ae2b into wso2:main Jul 30, 2026
7 of 9 checks passed
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.

2 participants