gpordeus opened a new pull request, #10575:
URL: https://github.com/apache/cloudstack/pull/10575

   This PR hides the cloudstack version field of XML responses when the caller 
is unauthenticated (checks if it is SYSTEM account).
   
   It also adds the `expose.cloudstack.version.api.list.capabilities` to allow 
hiding the field from the `listCapabilities` API call and 
`expose.cloudstack.version.api.xml.response` to allow hiding the field from XML 
responses, both are true by default as to not change compatibility. 
   
   It does not change the version information in system VMs and VRs.
   
   Fixes: #10072
   
   
   <!-- For new features, provide link to FS, dev ML discussion etc. -->
   <!-- In case of bug fix, the expected and actual behaviours, steps to 
reproduce. -->
   
   <!-- When "Fixes: #<id>" is specified, the issue/PR will automatically be 
closed when this PR gets merged -->
   <!-- For addressing multiple issues/PRs, use multiple "Fixes: #<id>" -->
   <!-- Fixes: # -->
   
   <!--- 
******************************************************************************* 
-->
   <!--- NOTE: AUTOMATION USES THE DESCRIPTIONS TO SET LABELS AND PRODUCE 
DOCUMENTATION. -->
   <!--- PLEASE PUT AN 'X' in only **ONE** box -->
   <!--- 
******************************************************************************* 
-->
   
   ### Types of changes
   
   - [ ] Breaking change (fix or feature that would cause existing 
functionality to change)
   - [ ] New feature (non-breaking change which adds functionality)
   - [ ] Bug fix (non-breaking change which fixes an issue)
   - [X] Enhancement (improves an existing feature and functionality)
   - [ ] Cleanup (Code refactoring and cleanup, that may add test cases)
   - [ ] build/CI
   - [ ] test (unit or integration test code)
   
   ### Feature/Enhancement Scale or Bug Severity
   
   #### Feature/Enhancement Scale
   
   - [ ] Major
   - [X] Minor
   
   #### Bug Severity
   
   - [ ] BLOCKER
   - [ ] Critical
   - [ ] Major
   - [ ] Minor
   - [ ] Trivial
   
   ### Screenshots (if appropriate):
   
   ### How Has This Been Tested?
   
   Unauthenticated:
   ```
   <loginresponse>
   <errorcode>531</errorcode>
   <errortext>
   Your authenticated user is not authorized for SAML Single Sign-On, please 
contact your administrator
   </errortext>
   </loginresponse>
   ```
   
   Authenticated and configs:
   
   - `expose.cloudstack.version.api.list.capabilities` = true;  
     `expose.cloudstack.version.api.xml.response` = true;
   ```
   <listcapabilitiesresponse cloud-stack-version="4.21.0.0-SNAPSHOT">
   <capability>
   <securitygroupsenabled>false</securitygroupsenabled>
   <dynamicrolesenabled>true</dynamicrolesenabled>
   <cloudstackversion>4.21.0.0-SNAPSHOT</cloudstackversion>
   <userpublictemplateenabled>true</userpublictemplateenabled>
   <supportELB>false</supportELB>
   <projectinviterequired>false</projectinviterequired>
   <allowusercreateprojects>true</allowusercreateprojects>
   <customdiskofferingminsize>1</customdiskofferingminsize>
   <customdiskofferingmaxsize>1024</customdiskofferingmaxsize>
   <regionsecondaryenabled>false</regionsecondaryenabled>
   <kvmsnapshotenabled>false</kvmsnapshotenabled>
   <allowuserviewdestroyedvm>true</allowuserviewdestroyedvm>
   <allowuserexpungerecovervm>true</allowuserexpungerecovervm>
   <allowuserexpungerecovervolume>true</allowuserexpungerecovervolume>
   <allowuserviewalldomainaccounts>false</allowuserviewalldomainaccounts>
   <allowuserforcestopvm>true</allowuserforcestopvm>
   <kubernetesserviceenabled>true</kubernetesserviceenabled>
   
<kubernetesclusterexperimentalfeaturesenabled>false</kubernetesclusterexperimentalfeaturesenabled>
   <customhypervisordisplayname>Custom</customhypervisordisplayname>
   <defaultuipagesize>20</defaultuipagesize>
   <instancesstatsretentiontime>720</instancesstatsretentiontime>
   <instancesstatsuseronly>false</instancesstatsuseronly>
   
<instancesdisksstatsretentionenabled>false</instancesdisksstatsretentionenabled>
   <instancesdisksstatsretentiontime>720</instancesdisksstatsretentiontime>
   <sharedfsvmmincpucount>2</sharedfsvmmincpucount>
   <sharedfsvmminramsize>1024</sharedfsvmminramsize>
   </capability>
   </listcapabilitiesresponse>
   ```
   
   - `expose.cloudstack.version.api.list.capabilities` = false;  
     `expose.cloudstack.version.api.xml.response` = false;
   ```
   <listcapabilitiesresponse>
   <capability>
   <securitygroupsenabled>false</securitygroupsenabled>
   <dynamicrolesenabled>true</dynamicrolesenabled>
   <userpublictemplateenabled>true</userpublictemplateenabled>
   <supportELB>false</supportELB>
   <projectinviterequired>false</projectinviterequired>
   <allowusercreateprojects>true</allowusercreateprojects>
   <customdiskofferingminsize>1</customdiskofferingminsize>
   <customdiskofferingmaxsize>1024</customdiskofferingmaxsize>
   <regionsecondaryenabled>false</regionsecondaryenabled>
   <kvmsnapshotenabled>false</kvmsnapshotenabled>
   <allowuserviewdestroyedvm>true</allowuserviewdestroyedvm>
   <allowuserexpungerecovervm>true</allowuserexpungerecovervm>
   <allowuserexpungerecovervolume>true</allowuserexpungerecovervolume>
   <allowuserviewalldomainaccounts>false</allowuserviewalldomainaccounts>
   <allowuserforcestopvm>true</allowuserforcestopvm>
   <kubernetesserviceenabled>true</kubernetesserviceenabled>
   
<kubernetesclusterexperimentalfeaturesenabled>false</kubernetesclusterexperimentalfeaturesenabled>
   <customhypervisordisplayname>Custom</customhypervisordisplayname>
   <defaultuipagesize>20</defaultuipagesize>
   <instancesstatsretentiontime>720</instancesstatsretentiontime>
   <instancesstatsuseronly>false</instancesstatsuseronly>
   
<instancesdisksstatsretentionenabled>false</instancesdisksstatsretentionenabled>
   <instancesdisksstatsretentiontime>720</instancesdisksstatsretentiontime>
   <sharedfsvmmincpucount>2</sharedfsvmmincpucount>
   <sharedfsvmminramsize>1024</sharedfsvmminramsize>
   </capability>
   </listcapabilitiesresponse>
   ```
   
   
   #### How did you try to break this feature and the system with this change?
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to