cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bhais...@apache.org
Subject [cloudstack] branch 4.9 updated: CLOUDSTACK-9983: Hide credentials in listClusters response
Date Sat, 22 Jul 2017 08:50:38 GMT
This is an automated email from the ASF dual-hosted git repository.

bhaisaab pushed a commit to branch 4.9
in repository https://gitbox.apache.org/repos/asf/cloudstack.git


The following commit(s) were added to refs/heads/4.9 by this push:
     new 07fda3b  CLOUDSTACK-9983: Hide credentials in listClusters response
07fda3b is described below

commit 07fda3b39548d0199e762586bb1bd0174dc538f0
Author: Rohit Yadav <rohit.yadav@shapeblue.com>
AuthorDate: Wed Jul 5 00:18:51 2017 +0530

    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>
---
 api/src/org/apache/cloudstack/api/response/ClusterResponse.java | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/api/src/org/apache/cloudstack/api/response/ClusterResponse.java b/api/src/org/apache/cloudstack/api/response/ClusterResponse.java
index 754baa2..d6ae70f 100644
--- a/api/src/org/apache/cloudstack/api/response/ClusterResponse.java
+++ b/api/src/org/apache/cloudstack/api/response/ClusterResponse.java
@@ -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");
+        }
     }
 }

-- 
To stop receiving notification emails like this one, please contact
['"commits@cloudstack.apache.org" <commits@cloudstack.apache.org>'].

Mime
View raw message