[GitHub] [hadoop] hddong commented on a change in pull request #1614: HADOOP-16615. Add password check for credential provider

2019-10-15 Thread GitBox
hddong commented on a change in pull request #1614: HADOOP-16615. Add password 
check for credential provider
URL: https://github.com/apache/hadoop/pull/1614#discussion_r334237483
 
 

 ##
 File path: 
hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/security/alias/CredentialShell.java
 ##
 @@ -293,6 +300,91 @@ public String getUsage() {
 }
   }
 
+  private class CheckCommand extends Command {
+public static final String USAGE = "check  [-value alias-value] " +
+"[-provider provider-path] [-strict]";
+public static final String DESC =
+"The check subcommand check a password for the name\n" +
+"specified as the  argument within the provider indicated\n" +
+"through the -provider argument. If -strict is supplied, fail\n" +
+"immediately if the provider requires a password and none is given.\n" 
+
+"If -value is provided, use that for the value of the credential\n" +
+"instead of prompting the user.";
+
+private String alias = null;
+
+public CheckCommand(String alias) {
 
 Review comment:
   @steveloughran a checkstyle error here `public CheckCommand(String alias) 
{:5: Redundant 'public' modifier. [RedundantModifier]` , but i think `public` 
is need here. 


This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

-
To unsubscribe, e-mail: common-issues-unsubscr...@hadoop.apache.org
For additional commands, e-mail: common-issues-h...@hadoop.apache.org



[GitHub] [hadoop] hddong commented on a change in pull request #1614: HADOOP-16615. Add password check for credential provider

2019-10-12 Thread GitBox
hddong commented on a change in pull request #1614: HADOOP-16615. Add password 
check for credential provider
URL: https://github.com/apache/hadoop/pull/1614#discussion_r334237483
 
 

 ##
 File path: 
hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/security/alias/CredentialShell.java
 ##
 @@ -293,6 +300,91 @@ public String getUsage() {
 }
   }
 
+  private class CheckCommand extends Command {
+public static final String USAGE = "check  [-value alias-value] " +
+"[-provider provider-path] [-strict]";
+public static final String DESC =
+"The check subcommand check a password for the name\n" +
+"specified as the  argument within the provider indicated\n" +
+"through the -provider argument. If -strict is supplied, fail\n" +
+"immediately if the provider requires a password and none is given.\n" 
+
+"If -value is provided, use that for the value of the credential\n" +
+"instead of prompting the user.";
+
+private String alias = null;
+
+public CheckCommand(String alias) {
 
 Review comment:
   @steveloughran a checkstyle error here `public CheckCommand(String alias) 
{:5: Redundant 'public' modifier. [RedundantModifier]` , but i think `public` 
is need here. 


This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

-
To unsubscribe, e-mail: common-issues-unsubscr...@hadoop.apache.org
For additional commands, e-mail: common-issues-h...@hadoop.apache.org



[GitHub] [hadoop] hddong commented on a change in pull request #1614: HADOOP-16615. Add password check for credential provider

2019-10-11 Thread GitBox
hddong commented on a change in pull request #1614: HADOOP-16615. Add password 
check for credential provider
URL: https://github.com/apache/hadoop/pull/1614#discussion_r333893786
 
 

 ##
 File path: 
hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/security/alias/TestCredShell.java
 ##
 @@ -174,11 +174,20 @@ public void testPromptForCredential() throws Exception {
 assertEquals(0, rc);
 assertTrue(outContent.toString().contains("credential1 has been 
successfully " +
 "created."));
-
-String[] args2 = {"delete", "credential1", "-f", "-provider",
-jceksProvider};
+
+String[] args2 = {"check", "credential1", "-provider",
+  jceksProvider};
+ArrayList password = new ArrayList();
+password.add("p@ssw0rd");
+shell.setPasswordReader(new MockPasswordReader(password));
 rc = shell.run(args2);
 assertEquals(0, rc);
+assertTrue(outContent.toString().contains("Password match success for 
credential1."));
 
 Review comment:
   An error check added.


This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

-
To unsubscribe, e-mail: common-issues-unsubscr...@hadoop.apache.org
For additional commands, e-mail: common-issues-h...@hadoop.apache.org



[GitHub] [hadoop] hddong commented on a change in pull request #1614: HADOOP-16615. Add password check for credential provider

2019-10-11 Thread GitBox
hddong commented on a change in pull request #1614: HADOOP-16615. Add password 
check for credential provider
URL: https://github.com/apache/hadoop/pull/1614#discussion_r333891017
 
 

 ##
 File path: 
hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/security/alias/CredentialShell.java
 ##
 @@ -66,6 +67,7 @@
* 
* % hadoop credential create alias [-provider providerPath]
* % hadoop credential list [-provider providerPath]
+   * % hadoop credential check alias [-provider providerPath]
 
 Review comment:
   > should the full usage option set be listed here?
   
   Just to keep the format uniform and `[-value]` is for test, may not need 
here. 


This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

-
To unsubscribe, e-mail: common-issues-unsubscr...@hadoop.apache.org
For additional commands, e-mail: common-issues-h...@hadoop.apache.org