apache / cloudstack

Apache CloudStack is an opensource Infrastructure as a Service (IaaS) cloud computing platform
https://cloudstack.apache.org/
Apache License 2.0
2.11k stars 1.11k forks source link

Ownership selection in VPC tiers and VPC public IPs #9692

Open gpordeus opened 2 months ago

gpordeus commented 2 months ago

Description

This PR adds the "ownership selection" UI fields to VPC tiers and VPC public IPs.

The "vpcAccess" response attribute was added so the UI can know if the caller has access to the VPC without needing to make a whole new request. This is needed to avoid 404 links (since router.resolve is assembled through API permissions) and so the UI can present the correct public IPs to their possible network tiers (e.g. if the User has tiers of two different VPCs, they can't use one's public IP in the other).

Types of changes

Feature/Enhancement Scale or Bug Severity

Feature/Enhancement Scale

Bug Severity

Screenshots (if appropriate):

New tier possible owners' listing ![image](https://github.com/user-attachments/assets/5aab77e1-2105-423b-b976-f937c5cd732e)
Tier listing ![image](https://github.com/user-attachments/assets/d952e39d-76e1-403d-b143-762488896a73)
User accessing their tier of the Admin's VPC ![image](https://github.com/user-attachments/assets/d952e39d-76e1-403d-b143-762488896a73)
Possible owners for new IP ![image](https://github.com/user-attachments/assets/daae5363-358e-4ff9-a3a0-02e23f69cce3)

How Has This Been Tested?

Environment with domains Root (with accounts Root Admin and User), Root/1 (with a Domain Admin), Root/A (with a Domain Admin) and Root/A/B (with a Domain Admin and a User). There is a Project in each domain, owned by the respective admins.

Situation Test
As Root Admin with VPC owned by self. Every account and project listed as possible owners in Tier creation
As Root Admin with VPC owned by self and one tier for each account and project. Every account and project listed as possible owners in acquiring public IP.
Same as previous, but remove some of the tiers. The deleted tiers' owners also disappeared from IP possible owners' list, except Root Admin itself.
As Root Admin with VPC owned by self, create one tier with a private ACL for the User. User's access to network page did not present the 'ACL' attribute.
As Root Admin with VPC owned by self, create one tier with a global ACL for the User. User's access to network page showed 'ACL' attribute.

How did you try to break this feature and the system with this change?

codecov[bot] commented 2 months ago

Codecov Report

Attention: Patch coverage is 11.42857% with 31 lines in your changes missing coverage. Please review.

Project coverage is 15.82%. Comparing base (5ff0b99) to head (147a534). Report is 69 commits behind head on main.

Files with missing lines Patch % Lines
...src/main/java/com/cloud/api/ApiResponseHelper.java 16.00% 21 Missing :warning:
...pache/cloudstack/api/response/NetworkResponse.java 0.00% 6 Missing :warning:
...che/cloudstack/api/response/IPAddressResponse.java 0.00% 3 Missing :warning:
...tack/api/command/user/network/ListNetworksCmd.java 0.00% 1 Missing :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #9692 +/- ## ============================================ + Coverage 15.57% 15.82% +0.24% - Complexity 12052 12564 +512 ============================================ Files 5505 5629 +124 Lines 482738 492078 +9340 Branches 58961 62315 +3354 ============================================ + Hits 75203 77879 +2676 - Misses 399226 405877 +6651 - Partials 8309 8322 +13 ``` | [Flag](https://app.codecov.io/gh/apache/cloudstack/pull/9692/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | Coverage Δ | | |---|---|---| | [uitests](https://app.codecov.io/gh/apache/cloudstack/pull/9692/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `4.47% <ø> (+0.30%)` | :arrow_up: | | [unittests](https://app.codecov.io/gh/apache/cloudstack/pull/9692/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `16.62% <11.42%> (+0.26%)` | :arrow_up: | Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#carryforward-flags-in-the-pull-request-comment) to find out more.

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

sureshanaparti commented 2 months ago

@blueorangutan package

blueorangutan commented 2 months ago

@sureshanaparti 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 2 months ago

Packaging result [SF]: ✔️ el8 ✔️ el9 ✔️ debian ✔️ suse15. SL-JID 11164