Repository: incubator-atlas
Updated Branches:
  refs/heads/0.8-incubating 34c3f8d5b -> dc5ad76f6


ATLAS-1727: Mask userdetails in quick Start utility

(cherry picked from commit 81d3184dbceb1e10042e2bbf3cd2130282508b36)


Project: http://git-wip-us.apache.org/repos/asf/incubator-atlas/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-atlas/commit/e4bddff8
Tree: http://git-wip-us.apache.org/repos/asf/incubator-atlas/tree/e4bddff8
Diff: http://git-wip-us.apache.org/repos/asf/incubator-atlas/diff/e4bddff8

Branch: refs/heads/0.8-incubating
Commit: e4bddff82d4bd565f1851081a8ad936e44abad52
Parents: 34c3f8d
Author: nixonrodrigues <[email protected]>
Authored: Tue Apr 11 16:17:54 2017 +0530
Committer: Madhan Neethiraj <[email protected]>
Committed: Wed Apr 12 11:43:51 2017 -0700

----------------------------------------------------------------------
 .../java/org/apache/atlas/utils/AuthenticationUtil.java | 12 ++++--------
 1 file changed, 4 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-atlas/blob/e4bddff8/common/src/main/java/org/apache/atlas/utils/AuthenticationUtil.java
----------------------------------------------------------------------
diff --git 
a/common/src/main/java/org/apache/atlas/utils/AuthenticationUtil.java 
b/common/src/main/java/org/apache/atlas/utils/AuthenticationUtil.java
index 6430fb1..b5b0026 100644
--- a/common/src/main/java/org/apache/atlas/utils/AuthenticationUtil.java
+++ b/common/src/main/java/org/apache/atlas/utils/AuthenticationUtil.java
@@ -22,9 +22,7 @@ import org.apache.atlas.AtlasException;
 import org.apache.commons.configuration.Configuration;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
-
-import java.io.BufferedReader;
-import java.io.InputStreamReader;
+import java.io.Console;
 
 /**
  * Util class for Authentication.
@@ -54,11 +52,9 @@ public final class AuthenticationUtil {
         String password = null;
 
         try {
-            BufferedReader bufferRead = new BufferedReader(new 
InputStreamReader(System.in));
-            System.out.println("Enter username for atlas :-");
-            username = bufferRead.readLine();
-            System.out.println("Enter password for atlas :-");
-            password = bufferRead.readLine();
+            Console console = System.console();
+            username = console.readLine("Enter username for atlas :- ");
+            password = new String(console.readPassword("Enter password for 
atlas :- "));
         } catch (Exception e) {
             System.out.print("Error while reading ");
             System.exit(1);

Reply via email to