Skip to content

Add support for User Managed Identity (UMI) auth in AI endpoint security#1352

Open
chira99 wants to merge 2 commits into
wso2:mainfrom
chira99:main
Open

Add support for User Managed Identity (UMI) auth in AI endpoint security#1352
chira99 wants to merge 2 commits into
wso2:mainfrom
chira99:main

Conversation

@chira99
Copy link
Copy Markdown
Contributor

@chira99 chira99 commented May 17, 2026

Description

Adds UI support for Azure User Managed Identity (UMI) as an authentication type across the
Admin and Publisher portals, complementing the gateway-side UMI implementation.

Related Issue

What's changed

Admin portal — AI Service Provider form

  • Added umi as a selectable authentication type alongside none, apikey, and aws
  • When UMI is selected, displays an informational message explaining that no credentials need
    to be stored and that the gateway pod must have the AKS Workload Identity webhook configured

Publisher portal — AI Endpoint configuration

  • Added IS_UMI_AUTH_ENABLED helper to detect when the LLM provider is configured for UMI
  • Auto-configures endpoint security to type=umi, enabled=true when the provider's auth type
    is UMI — no manual credential input required from the API publisher
  • Displays an informational message confirming that the gateway will automatically acquire and
    inject a Bearer token using the pod's AKS Workload Identity

Backward compatibility

No changes to existing none, apikey, or aws authentication flows.

Admin Portal:

image

Publisher Portal

image

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 17, 2026

Review Change Stack

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

Adds Azure User Managed Identity (UMI) support: admin UI lets providers select UMI with explanatory text and translations; publisher endpoint editor auto-applies UMI endpoint security when the LLM provider uses UMI and shows gateway Bearer-token behavior with a new locale string.

Changes

Azure User Managed Identity Authentication Integration

Layer / File(s) Summary
Admin Portal UMI Authentication UI and Translations
portals/admin/.../AddEditAiServiceProvider.jsx, portals/admin/.../locales/en.json, portals/admin/.../locales/fr.json
UMI added as a selectable auth source in the AI service provider editor; new conditional render displays explanatory information about Azure UMI and required AKS Workload Identity webhook environment variables. English and French locale entries added for the UMI info message.
Publisher Portal UMI Endpoint Security Auto-Configuration
portals/publisher/.../AddEditAIEndpoint.jsx, portals/publisher/.../locales/en.json
A useEffect detects when the LLM provider's authentication is enabled as umi and auto-applies endpoint security { type: 'umi', enabled: true } if not already set. Introduces IS_UMI_AUTH_ENABLED predicate and conditionally renders UMI-specific informational UI about the gateway acquiring/injecting a Bearer token. English locale entry added.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately summarizes the primary change: adding User Managed Identity (UMI) authentication support to AI endpoint security across the portals.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
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.
Description check ✅ Passed The PR description clearly explains the changes: adding UMI as an authentication type to both Admin and Publisher portals, with specific details about what UMI selection does in each portal.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ 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 and usage tips.

ashera96
ashera96 previously approved these changes May 19, 2026
Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🤖 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/admin/src/main/webapp/site/public/locales/fr.json`:
- Line 34: The French locale contains an English string for the key
"Admin.AiVendor.form.llm.auth.umi.info"; replace its value with a proper French
translation so French UI users see localized text (suggested translation:
"L'authentification Azure User Managed Identity (UMI) sera utilisée. Le pod de
la passerelle doit avoir le webhook AKS Workload Identity configuré avec les
variables d'environnement AZURE_TENANT_ID, AZURE_CLIENT_ID et
AZURE_FEDERATED_TOKEN_FILE appropriées. Aucune information d'identification n'a
besoin d'être stockée.").

In
`@portals/publisher/src/main/webapp/source/src/app/components/Apis/Details/Endpoints/AIEndpoints/AddEditAIEndpoint.jsx`:
- Around line 482-497: The effect that sets UMI security uses useEffect and
currently depends only on llmProviderEndpointConfiguration and
state.deploymentStage, so when API.getApiEndpoint dispatches the full body and
replaces state.endpointConfig.endpoint_security the effect may not re-run;
update the dependency array of that useEffect to include the current security
and environment values (e.g., derive currentSecurityType =
state.endpointConfig.endpoint_security?.[envType]?.type and currentEnvType =
envType or state.deploymentStage) so the effect will rerun when the backend
payload replaces the saved security config and then call
saveEndpointSecurityConfig(...) as before to re-apply the UMI bootstrap.
🪄 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

Run ID: 549c3f38-e00a-4266-8107-9c7a6f95f789

📥 Commits

Reviewing files that changed from the base of the PR and between d0c236e and d97a658.

📒 Files selected for processing (5)
  • portals/admin/src/main/webapp/site/public/locales/en.json
  • portals/admin/src/main/webapp/site/public/locales/fr.json
  • portals/admin/src/main/webapp/source/src/app/components/AiServiceProviders/AddEditAiServiceProvider.jsx
  • portals/publisher/src/main/webapp/site/public/locales/en.json
  • portals/publisher/src/main/webapp/source/src/app/components/Apis/Details/Endpoints/AIEndpoints/AddEditAIEndpoint.jsx

Comment thread portals/admin/src/main/webapp/site/public/locales/fr.json Outdated
coderabbitai[bot]
coderabbitai Bot previously approved these changes May 19, 2026
Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

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/publisher/src/main/webapp/source/src/app/components/Apis/Details/Endpoints/AIEndpoints/AddEditAIEndpoint.jsx`:
- Around line 487-500: Move the IS_UMI_AUTH_ENABLED constant declaration so it's
defined before the useEffect that references it: locate the useEffect that
checks IS_UMI_AUTH_ENABLED (the effect that calls saveEndpointSecurityConfig
with CONSTS.DEFAULT_ENDPOINT_SECURITY, type: 'umi', enabled: true) and cut/paste
the IS_UMI_AUTH_ENABLED const so it appears above that useEffect; ensure the
same identifier is used and imports/exports (if any) remain valid and that
currentEnvType and currentSecurityType are still in scope for the effect.
🪄 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

Run ID: 1f2a2cae-1476-4c41-acda-4d5287d44bca

📥 Commits

Reviewing files that changed from the base of the PR and between e3a8b67 and 23a611b.

📒 Files selected for processing (1)
  • portals/publisher/src/main/webapp/source/src/app/components/Apis/Details/Endpoints/AIEndpoints/AddEditAIEndpoint.jsx

coderabbitai[bot]
coderabbitai Bot previously approved these changes May 19, 2026
Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

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/publisher/src/main/webapp/source/src/app/components/Apis/Details/Endpoints/AIEndpoints/AddEditAIEndpoint.jsx`:
- Around line 493-510: The useEffect currently only checks currentSecurityType
and can skip re-applying UMI when a persisted config has type 'umi' but enabled:
false; update the effect to also check the persisted enabled flag (e.g., read
state.endpointConfig.endpoint_security?.[currentEnvType]?.enabled into a
variable like persistedSecurityEnabled) and change the guard to reapply UMI
unless currentSecurityType === 'umi' AND persistedSecurityEnabled === true; call
saveEndpointSecurityConfig(...) when IS_UMI_AUTH_ENABLED(...) is true and the
persisted config is not both type 'umi' and enabled, and add the persisted
enabled variable to the effect dependencies so the effect runs when that flag
changes.
🪄 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

Run ID: fe5c9aff-70a9-4877-a1fd-91041b287c5f

📥 Commits

Reviewing files that changed from the base of the PR and between c5a5dc6 and 30969e1.

📒 Files selected for processing (5)
  • portals/admin/src/main/webapp/site/public/locales/en.json
  • portals/admin/src/main/webapp/site/public/locales/fr.json
  • portals/admin/src/main/webapp/source/src/app/components/AiServiceProviders/AddEditAiServiceProvider.jsx
  • portals/publisher/src/main/webapp/site/public/locales/en.json
  • portals/publisher/src/main/webapp/source/src/app/components/Apis/Details/Endpoints/AIEndpoints/AddEditAIEndpoint.jsx
✅ Files skipped from review due to trivial changes (1)
  • portals/publisher/src/main/webapp/site/public/locales/en.json

@chira99 chira99 force-pushed the main branch 2 times, most recently from 30969e1 to f6bbebb Compare May 20, 2026 10:02
@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.

2 participants