CLOUDSTACK-9983: Hide credentials in listClusters response

This removes username and passwords details from the listClusters
response. The details are usually seen in VMware environments only.
With dynamic roles features, the listClusters API may be provided
to a read-only root-admin user role/type which should not be able to get
the credentials.

Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
This commit is contained in:
Rohit Yadav 2017-07-05 00:18:51 +05:30 committed by Rohit Yadav
parent 5342cc8aea
commit 07fda3b395
1 changed files with 7 additions and 1 deletions

View File

@ -208,6 +208,12 @@ public class ClusterResponse extends BaseResponse {
if (details == null) {
return;
}
this.resourceDetails = new HashMap<>(details);
resourceDetails = new HashMap<>(details);
if (resourceDetails.containsKey("username")) {
resourceDetails.remove("username");
}
if (resourceDetails.containsKey("password")) {
resourceDetails.remove("password");
}
}
}