-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hide CloudStack version from XML response when unauthenticated #10575
base: main
Are you sure you want to change the base?
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #10575 +/- ##
=========================================
Coverage 16.26% 16.26%
+ Complexity 13388 13387 -1
=========================================
Files 5674 5674
Lines 498929 498938 +9
Branches 60338 60341 +3
=========================================
+ Hits 81154 81157 +3
- Misses 408736 408741 +5
- Partials 9039 9040 +1
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:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
code looks good @gpordeus , but can I ask you to remove all the log.append()
calls and only append sb
to log
, just before returning at line 211?
Not your doing for sure, but the code looks a bit silly like this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested manually:
- Verified that XML responses do not contain the version when the user is not authenticated, independently of
expose.cloudstack.version.api.xml.response
- Verified that XML responses contain the version when user is authenticated and
expose.cloudstack.version.api.xml.response
is set to true - Verified that XML responses do not contain the version when user is authenticated and
expose.cloudstack.version.api.xml.response
is set to false - Verified that
listCapabilities
returns the version whenexpose.cloudstack.version.api.list.capabilities
is set to true - Verified that
listCapabilities
does not return the version whenexpose.cloudstack.version.api.list.capabilities
is set to false
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 thelistCapabilities
API call andexpose.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
Types of changes
Feature/Enhancement Scale or Bug Severity
Feature/Enhancement Scale
Bug Severity
Screenshots (if appropriate):
How Has This Been Tested?
Unauthenticated:
Authenticated and configs:
expose.cloudstack.version.api.list.capabilities
= true;expose.cloudstack.version.api.xml.response
= true;expose.cloudstack.version.api.list.capabilities
= false;expose.cloudstack.version.api.xml.response
= false;How did you try to break this feature and the system with this change?