You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@atlas.apache.org by ni...@apache.org on 2019/11/03 17:41:25 UTC

[atlas] branch master updated: ATLAS-3488 : Update Simple Authentication(file-based) password with ShaPasswordEncoder with Salt (Addendum patch #1).

This is an automated email from the ASF dual-hosted git repository.

nixon pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/atlas.git


The following commit(s) were added to refs/heads/master by this push:
     new 5ae7fbe  ATLAS-3488 : Update Simple Authentication(file-based) password with ShaPasswordEncoder with Salt (Addendum patch #1).
5ae7fbe is described below

commit 5ae7fbecb3b02abe9aaa07e25e3b06073fd0c306
Author: Vishal Suvagia <vi...@apache.org>
AuthorDate: Thu Oct 31 22:13:33 2019 +0530

    ATLAS-3488 : Update Simple Authentication(file-based) password with ShaPasswordEncoder with Salt (Addendum patch #1).
    
    Signed-off-by: nixonrodrigues <ni...@apache.org>
---
 .../org/apache/atlas/util/CredentialProviderUtility.java   | 14 +++++++++-----
 1 file changed, 9 insertions(+), 5 deletions(-)

diff --git a/webapp/src/main/java/org/apache/atlas/util/CredentialProviderUtility.java b/webapp/src/main/java/org/apache/atlas/util/CredentialProviderUtility.java
index 7875fb2..5005f79 100755
--- a/webapp/src/main/java/org/apache/atlas/util/CredentialProviderUtility.java
+++ b/webapp/src/main/java/org/apache/atlas/util/CredentialProviderUtility.java
@@ -90,12 +90,15 @@ public class CredentialProviderUtility {
 
                 if (userName != null && password != null) {
                     String encryptedPassword = UserDao.encrypt(password, userName);
-                    textDevice.printf("Your encrypted password is  : " + encryptedPassword, null);
-                    textDevice.printf("\n", null);
-
+                    boolean silentOption = cmd.hasOption("s");
+                    if (silentOption) {
+                        System.out.println(encryptedPassword);
+                    } else {
+                        System.out.println("Your encrypted password is  : " + encryptedPassword);
+                    }
                 } else {
-                    textDevice.printf("Please provide username and password as input. Usage:" +
-                            " cputil.py -g -u <username> -p <password>", null);
+                    System.out.println("Please provide username and password as input. Usage:" +
+                            " cputil.py -g -u <username> -p <password>");
                 }
                 return;
             }
@@ -136,6 +139,7 @@ public class CredentialProviderUtility {
 
     private static void createOptions(Options options) {
         options.addOption("g", "generatePassword", false, "Generate Password");
+        options.addOption("s", "silent", false, "Silent");
         options.addOption("u", "username", true, "UserName");
         options.addOption("p", "password", true, "Password");
     }