Uh oh!
There was an error while loading. Please reload this page.
API key pair restructure - #9504
Conversation
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@## main #9504 +/- ##
==========================================
Coverage 17.92% 17.92% - Complexity 16156 16176 +20
==========================================
Files 5939 5949 +10 Lines 533192 534058 +866 Branches 65239 65301 +62 ==========================================
+ Hits 95591 95748 +157 - Misses 426859 427553 +694 - Partials 10742 10757 +15
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:
|
DaanHoogland
commented
Aug 13, 2024
nice feature @KlausDornsbach , some suggestions,
|
KlausDornsbach
commented
Aug 14, 2024
Hey @DaanHoogland, thanks for taking a look! It would make sense to be able to delete a keypair by name, we would just need to block users from creating multiple API keypairs with the same name. At the moment an admin is allowed to delete keypairs from users it has access, for example, a root admin user could delete any keypair in the platform, domain admin users can delete any keypair in the domain, normal users can only delete their own keys. These permissions are also true for visualization and creation APIs. |
DaanHoogland
commented
Aug 16, 2024
Well, I think a unique constraint on UserId/KeyPairName makes sense also from a usability sense.
👍 |
rajujith
commented
Aug 19, 2024
@blueorangutan package |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
This pull request has merge conflicts. Dear author, please fix the conflicts and sync your branch with the base branch. |
DaanHoogland
commented
Aug 20, 2024
@blueorangutan package |
blueorangutan
commented
Aug 20, 2024
@DaanHoogland a [SL] Jenkins job has been kicked to build packages. It will be bundled with KVM, XenServer and VMware SystemVM templates. I'll keep you posted as I make progress. |
blueorangutan
commented
Aug 20, 2024
Packaging result [SF]: ✖️ el8 ✖️ el9 ✖️ debian ✖️ suse15. SL-JID 10714 |
rajujith
commented
Aug 21, 2024
@blueorangutan package |
blueorangutan
commented
Aug 21, 2024
@rajujith a [SL] Jenkins job has been kicked to build packages. It will be bundled with KVM, XenServer and VMware SystemVM templates. I'll keep you posted as I make progress. |
blueorangutan
commented
Aug 21, 2024
Packaging result [SF]: ✖️ el8 ✖️ el9 ✖️ debian ✖️ suse15. SL-JID 10720 |
rajujith
commented
Aug 22, 2024
@blueorangutan package |
blueorangutan
commented
Aug 22, 2024
@rajujith a [SL] Jenkins job has been kicked to build packages. It will be bundled with KVM, XenServer and VMware SystemVM templates. I'll keep you posted as I make progress. |
blueorangutan
commented
Aug 22, 2024
Packaging result [SF]: ✔️ el8 ✔️ el9 ✔️ debian ✔️ suse15. SL-JID 10736 |
DaanHoogland
commented
Aug 22, 2024
@blueorangutan test |
GutoVeronezi
commented
Jan 15, 2026
I totally agree with you; LTS are supposed to be as stable as possible. We should also apply the same criteria to every other PR with extensive or critical changes as well 😃 |
DaanHoogland
commented
Jan 15, 2026
I was kind of inviting this to 23, but yes, if it is a cross-cutting concern it should go in the non-LTS release first. Extensive or critical are gliding scales (and maybe cross-cutting as well, but certainly less so) |
GutoVeronezi
commented
Jan 15, 2026
I was under impression that 4.23 would be a regular release (the wiki states so); ![]() Thus, it would make sense to address this PR on release 4.23. 5 months seems enough time to review, test, and mature the PR. I also plan to test it in a few weeks. |
DaanHoogland
commented
Jan 16, 2026
As our ex-colleague always says @GutoVeronezi , “we are in violent agreement”! |
Uh oh!
There was an error while loading. Please reload this page.
This pull request has merge conflicts. Dear author, please fix the conflicts and sync your branch with the base branch. |
bernardodemarco
commented
Mar 2, 2026
@blueorangutan package |
blueorangutan
commented
Mar 2, 2026
@bernardodemarco 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. |
blueorangutan
commented
Mar 2, 2026
Packaging result [SF]: ✔️ el8 ✔️ el9 ✔️ el10 ✔️ debian ✔️ suse15. SL-JID 16988 |
sureshanaparti
commented
Mar 4, 2026
@blueorangutan package |
blueorangutan
commented
Mar 4, 2026
@sureshanaparti 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. |
This pull request has merge conflicts. Dear author, please fix the conflicts and sync your branch with the base branch. |
blueorangutan
commented
Mar 4, 2026
Packaging result [SF]: ✔️ el8 ✔️ el9 ✔️ el10 ✔️ debian ✔️ suse15. SL-JID 17001 |
bernardodemarco
commented
Mar 4, 2026
@blueorangutan package |
blueorangutan
commented
Mar 4, 2026
@bernardodemarco 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. |
blueorangutan
commented
Mar 4, 2026
Packaging result [SF]: ✔️ el8 ✔️ el9 ✔️ el10 ✔️ debian ✔️ suse15. SL-JID 17004 |
bernardodemarco
commented
Mar 5, 2026
@blueorangutan package |
blueorangutan
commented
Mar 5, 2026
@bernardodemarco 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. |
bernardodemarco
commented
Mar 5, 2026
@shwstppr@sureshanaparti@DaanHoogland@weizhouapache@GutoVeronezi@winterhazel@JoaoJandre@hsato03@erikbocks, guys, this one is finally ready for review and testing. Below are the test descriptions that I have performed:
|
bernardodemarco
commented
Mar 5, 2026
@shwstppr@sureshanaparti@DaanHoogland@weizhouapache can we run the integration tests for the PR, please? btw, the simulator tests are failing across multiple PRs (see #12683 and #12680, for instance). Thus, they do not seem to be related with the current PR. |
blueorangutan
commented
Mar 5, 2026
Packaging result [SF]: ✔️ el8 ✔️ el9 ✔️ el10 ✔️ debian ✔️ suse15. SL-JID 17010 |
DaanHoogland
commented
Mar 5, 2026
@blueorangutan package |
blueorangutan
commented
Mar 5, 2026
@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. |
blueorangutan
commented
Mar 5, 2026
Packaging result [SF]: ✔️ el8 ✔️ el9 ✔️ el10 ✔️ debian ✔️ suse15. SL-JID 17014 |
DaanHoogland
commented
Mar 6, 2026
@blueorangutan test |
blueorangutan
commented
Mar 6, 2026
@DaanHoogland a [SL] Trillian-Jenkins test job (ol8 mgmt + kvm-ol8) has been kicked to run smoke tests |
blueorangutan
commented
Mar 6, 2026
[SF] Trillian test result (tid-15573)
|

Description
API access keypairs are primarily used to support interactions between systems, without the need to create sessions (through user and password authentication). Currently, CloudStack's implementation of API keypairs does not allow you to specify permissions for each keypair, simply using the account's default permissions. Additionally, the number of keypairs is limited to one per user and they have no start and end dates.
An extension of the API keypairs functionality was implemented, adding several new features that increase flexibility and security. It is now possible to specify a subset of permissions (from the base account) for each keypair, as well as create more than one key per user. It is also possible to define start and end dates for the validity of a keypair. A key created without an expiration date will always be valid up until it is deleted. It should be noted that creating API keypairs without specifying permissions just creates an API keypair with all account's base permissions. Also, API keypairs older than this patch will always be viewed as keypairs with full account permissions.
The following endpoints were created:
A new
listUserKeysAPI was added. Through this API the user will be able to specify a singlekeypairidto fetch its specific properties, orapikeyfilterto return a specific keypair based on anapikey. The user can inform anuseridto fetch an user's api keypair list. If nokeypairid,apikeyfilteroruseridis provided, the API defaults to fetching information on the calling user. Thelistallproperty allows for fetching all keypairs in the structure that are visible based on the calling user/keypair permissions, if not specified, it defaults to false, fetching only the apikeys on the level of the calling user/keypair. Also, it is possible to informshowpermissionsto list all permissions associated with each returnedapikey.The API
getUserKeyswas modified preserving backwards compatibility. It now fetches the last keypair created for the informed user.The api
registerUserKeyswas modified so the new API keypair parameters could be specified on creation:A new keypair deletion API was added (
deleteUserKeys). It will accept only one required argument, the keypairid.I also added a
listUserKeyRulesapi, allowing the user to list the rules associated with an API keypair.Types of changes
Feature/Enhancement Scale or Bug Severity
Feature/Enhancement Scale
Bug Severity
How Has This Been Tested?
API Key Creation and Basic Testing
Single Key (via UI):
Multiple Keys (via Cloud Monkey):
Permissions Validation
Tested the permissions of keyrules listing, keypair listing, keypair deletion and keypair cretion with the following user/account/domain setup:
/ROOTaccount
root adminroot adminuser1domain
subdomaindomain admindomain adminuserAccountuser2user3The following table describes the results obtained when the user on the first column attempted to operate on the keypairs of users on the first row (V: operation was possible, F: operation was not possible).
Migration to
api_keypairTable4.19to4.20api_keypairtable, with the corresponding columns in the user table deleted.General validations