UI for API Key Pair Management#13225
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #13225 +/- ##
============================================
+ Coverage 18.08% 18.10% +0.02%
- Complexity 16718 16759 +41
============================================
Files 6037 6041 +4
Lines 542609 542959 +350
Branches 66432 66478 +46
============================================
+ Hits 98136 98323 +187
- Misses 433446 433590 +144
- Partials 11027 11046 +19
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
@winterhazel a Jenkins job has been kicked to build UI QA env. I'll keep you posted as I make progress. |
|
UI build: ✔️ |
There was a problem hiding this comment.
Pull request overview
This PR adds a CloudStack UI surface for the “multiple API key pairs per user” backend introduced in PR #9504, including listing key pairs, viewing key pair details/rules, and registering new key pairs with optional validity windows and rule-based permissions. It also includes a few backend/schema adjustments (description length increase, role permissions update, and parameter validation).
Changes:
- Added a new User tab and Keypair (API key pair) resource view to list and navigate API key pairs, including rule display.
- Added UI components to register API key pairs and to view/edit a key pair’s permission rules.
- Updated schema/entity/API command metadata related to API key pair descriptions and rule-description validation.
Reviewed changes
Copilot reviewed 15 out of 15 changed files in this pull request and generated 13 comments.
Show a summary per file
| File | Description |
|---|---|
| ui/src/views/iam/GenerateApiKeyPair.vue | Modal/form to register an API key pair (name/description/dates/rules). |
| ui/src/views/iam/ApiKeyPairPermissionTable.vue | UI for building/viewing rule-permissions; supports drag ordering and read-only table view. |
| ui/src/views/AutogenView.vue | Adjusts param mapping for listUserKeys and resource selection behavior. |
| ui/src/config/section/user.js | Adds apikeypairs tab to the User view. |
| ui/src/config/section/keypair.js | Introduces a hidden “keypair” section for viewing API key pair details and rules. |
| ui/src/config/router.js | Registers the new keypair section routes. |
| ui/src/components/view/ListView.vue | Treats startdate/enddate as date fields for rendering. |
| ui/src/components/view/InfoCard.vue | Displays API/secret key fields for keypair resources; adjusts status/apikeyaccess display logic. |
| ui/src/components/view/DetailsTab.vue | Adds startdate/enddate date rendering and guards for empty values. |
| ui/src/components/view/ApiKeyPairsTab.vue | New User tab listing key pairs with bulk delete and link to keypair detail view. |
| ui/public/locales/pt_BR.json | Adds new UI strings (includes a typo). |
| ui/public/locales/en.json | Adds new UI strings for API key pair management. |
| engine/schema/src/main/resources/META-INF/db/schema-42210to42300.sql | Expands api_keypair.description size and grants role permissions for key APIs. |
| engine/schema/src/main/java/org/apache/cloudstack/acl/ApiKeyPairVO.java | Aligns entity field length with DB schema change. |
| api/src/main/java/org/apache/cloudstack/api/command/admin/user/RegisterUserKeysCmd.java | Adds parameter length metadata and introduces rule-description length validation (currently buggy). |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
@blueorangutan package |
|
@DaanHoogland a [SL] Jenkins job has been kicked to build packages. It will be bundled with no SystemVM templates. I'll keep you posted as I make progress. |
|
Packaging result [SF]: ✔️ el8 ✔️ el9 ✔️ el10 ✔️ debian ✔️ suse15. SL-JID 18045 |
Description
PR #9504 restructured and extended the implementation of API key pairs to improve flexibility and security. It is now possible to create multiple key pairs per user, define a specific permission scope for each key pair and specify a validation period during which they remain active.
This PR exposes these new features in the ACS graphical interface. Among the new functionalities, users can now list all key pairs associated with a user, view their details and permissions, and register new key pairs with validity periods and permission sets.
Additionally, some minor fixes and enhancements were introduced to the API key pair backend workflows, including:
Domain Admin,Resource AdminandUserwere granted access to thelistUserKeyRulesAPI;descriptioncolumn of thecloud.api_keypairtable was changed fromVARCHAR(100)toVARCHAR(1024); and,descriptioncolumn of thecloud.api_keypair_permissionstable isVARCHAR(255). However, theregisterUserKeysAPI currently do not validate the size of the corresponding API parameter. This validation has been introduced.Types of changes
Feature/Enhancement Scale or Bug Severity
Feature/Enhancement Scale
Screenshots (if appropriate):
2026-05-22.16-06-12.mp4
How Has This Been Tested?
The new UI sections were manually tested and their behavior was verified accordingly.
To test this patch, the backend must include PR #9504.