Skip to content

Implement key manager config UI#2493

Merged
lasanthaS merged 3 commits into
wso2:mainfrom
Piumal1999:km-admin-ui
Jul 13, 2026
Merged

Implement key manager config UI#2493
lasanthaS merged 3 commits into
wso2:mainfrom
Piumal1999:km-admin-ui

Conversation

@Piumal1999

@Piumal1999 Piumal1999 commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

Purpose

Fix #2527

Approach

Implemented the key manager config UI

Samples

image

Related PRs

N/A

@coderabbitai

coderabbitai Bot commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

Key manager type handling is standardized to server-fixed GENERIC_OIDC. Type inputs are removed from portal forms and manifests, API responses and documentation are updated, integration tests verify the behavior, and application views no longer display or propagate provider types.

Changes

Key manager type standardization

Layer / File(s) Summary
Service enforcement and API validation
portals/developer-portal/src/services/keyManagerService.js, portals/developer-portal/it/rest-api/key-managers/key-managers.spec.js
Key managers are persisted as GENERIC_OIDC; input validation no longer requires or changes type, and tests cover omitted and invalid client-supplied types.
API schemas and key manager documentation
docs/rest-apis/devportal/*, portals/developer-portal/docs/administer/*, portals/developer-portal/docs/devportal-openapi-spec-v0.9.yaml
Request examples omit type, while response schemas and examples define GENERIC_OIDC as read-only.
Admin key manager UI changes
portals/developer-portal/src/pages/settings/page.hbs, portals/developer-portal/src/controllers/viewConfigureController.js
The type table column, form selector, client payload field, and hardcoded type list are removed.
Application key manager rendering cleanup
portals/developer-portal/src/controllers/applicationsContentController.js, portals/developer-portal/src/pages/application/partials/*, portals/developer-portal/src/styles/manage-keys.css
Application metadata and key manager cards no longer pass or render type values, and the related style is removed.

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

Suggested reviewers: VirajSalaka, RakhithaRR, Tharsanan1, renuka-fernando, tharindu1st, AnuGayan, Arshardh, dushaniw, tgtshanika

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 50.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
Description check ⚠️ Warning The description includes purpose, approach, samples, and related PRs, but omits several required sections like goals, tests, security, docs, and test environment. Add the missing template sections: Goals, User stories, Documentation, Automation tests, Security checks, and Test environment.
✅ Passed checks (3 passed)
Check name Status Explanation
Linked Issues check ✅ Passed The PR appears to implement the requested Developer Portal UI for key manager configuration and the related supporting changes.
Out of Scope Changes check ✅ Passed The changes are focused on the key manager UI and supporting API/docs updates, with no clear unrelated additions.
Title check ✅ Passed The title matches the main change: implementing the key manager configuration UI.
✨ 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.

@Piumal1999

Copy link
Copy Markdown
Contributor Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Jul 9, 2026

Copy link
Copy Markdown
Contributor
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

logger.warn('Failed to load key managers for settings page', { error: err.message });
}
templateContent.keyManagers = keyManagers;
templateContent.keyManagerTypes = ['ASGARDEO', 'WSO2IS', 'KEYCLOAK', 'GENERIC_OIDC'];

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.

Do we need to special case Asgardeo and WSO2IS over GENERIC_OIDC?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Currently we don't have any vendor-specific key manager configurations in the devportal. So we can use GENERIC_OIDC as the default and remove other types.

@Piumal1999 Piumal1999 Jul 11, 2026

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

updated with fb716e1

@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

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
portals/developer-portal/docs/administer/key-manager-integration.md (1)

24-45: 🎯 Functional Correctness | 🟠 Major | ⚡ Quick win

Example needs spec.displayName; metadata.name only sets the handle.
This manifest will fail with Missing required fields: displayName unless spec.displayName: Asgardeo is added. Also update the metadata.name row — it describes the handle, not the developer-facing display name.

🤖 Prompt for 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.

In `@portals/developer-portal/docs/administer/key-manager-integration.md` around
lines 24 - 45, Update the key manager manifest example to include the required
spec.displayName field, using Asgardeo as its value. Revise the metadata.name
table description to identify it as the unique handle, and document
spec.displayName as the developer-facing display name.
🧹 Nitpick comments (1)
portals/developer-portal/it/rest-api/key-managers/key-managers.spec.js (1)

59-61: 🎯 Functional Correctness | 🔵 Trivial | ⚡ Quick win

Consider adding an update-path counterpart to the "ignores client-supplied type" test.

The new test at lines 91-99 covers POST forcing GENERIC_OIDC, but updateKeyManager's delete payload.type (keyManagerService.js lines 184-185) has no dedicated test asserting a PUT with a client-supplied type still returns GENERIC_OIDC unchanged.

🤖 Prompt for 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.

In `@portals/developer-portal/it/rest-api/key-managers/key-managers.spec.js`
around lines 59 - 61, Extend the key-manager test suite with a PUT/update
counterpart to the existing POST test that supplies a client-provided type and
asserts the response remains GENERIC_OIDC. Target the updateKeyManager path and
verify its delete payload.type behavior without changing the existing creation
test.
🤖 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/developer-portal/src/services/keyManagerService.js`:
- Around line 144-151: Update the handle validation in the create flow around
hadExplicitHandle, resolvedHandle, and kmDao.create to validate resolvedHandle
unconditionally after trimming or generating it. Reject empty or
HANDLE_PATTERN-invalid generated handles with the existing 400 response before
calling kmDao.create, while preserving the current behavior for valid explicit
and generated handles.

---

Outside diff comments:
In `@portals/developer-portal/docs/administer/key-manager-integration.md`:
- Around line 24-45: Update the key manager manifest example to include the
required spec.displayName field, using Asgardeo as its value. Revise the
metadata.name table description to identify it as the unique handle, and
document spec.displayName as the developer-facing display name.

---

Nitpick comments:
In `@portals/developer-portal/it/rest-api/key-managers/key-managers.spec.js`:
- Around line 59-61: Extend the key-manager test suite with a PUT/update
counterpart to the existing POST test that supplies a client-provided type and
asserts the response remains GENERIC_OIDC. Target the updateKeyManager path and
verify its delete payload.type behavior without changing the existing creation
test.
🪄 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: 04f4ffbc-6e1e-4257-a8cb-687c5f47f90a

📥 Commits

Reviewing files that changed from the base of the PR and between e653383 and fb716e1.

📒 Files selected for processing (12)
  • docs/rest-apis/devportal/key-managers.md
  • docs/rest-apis/devportal/schemas.md
  • portals/developer-portal/docs/administer/key-manager-integration.md
  • portals/developer-portal/docs/devportal-openapi-spec-v0.9.yaml
  • portals/developer-portal/it/rest-api/key-managers/key-managers.spec.js
  • portals/developer-portal/src/controllers/applicationsContentController.js
  • portals/developer-portal/src/controllers/viewConfigureController.js
  • portals/developer-portal/src/pages/application/partials/manage-keys-km-card.hbs
  • portals/developer-portal/src/pages/application/partials/manage-keys.hbs
  • portals/developer-portal/src/pages/settings/page.hbs
  • portals/developer-portal/src/services/keyManagerService.js
  • portals/developer-portal/src/styles/manage-keys.css
💤 Files with no reviewable changes (5)
  • portals/developer-portal/src/styles/manage-keys.css
  • portals/developer-portal/src/pages/application/partials/manage-keys-km-card.hbs
  • portals/developer-portal/src/pages/application/partials/manage-keys.hbs
  • portals/developer-portal/src/controllers/applicationsContentController.js
  • portals/developer-portal/src/controllers/viewConfigureController.js

Comment thread portals/developer-portal/src/services/keyManagerService.js
@lasanthaS
lasanthaS merged commit 0970939 into wso2:main Jul 13, 2026
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.

[Improvement][Devportal] Add UI for key manager configuration

2 participants