accumulo-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From GitBox <...@apache.org>
Subject [GitHub] [accumulo] keith-turner commented on a change in pull request #1322: ACCUMULO-3455: ShellOptionsJC should extend ClientOpts
Date Mon, 12 Aug 2019 13:44:51 GMT
keith-turner commented on a change in pull request #1322: ACCUMULO-3455: ShellOptionsJC should
extend ClientOpts
URL: https://github.com/apache/accumulo/pull/1322#discussion_r312931419
 
 

 ##########
 File path: core/src/main/java/org/apache/accumulo/core/cli/ClientOpts.java
 ##########
 @@ -82,6 +68,78 @@ public ColumnVisibility convert(String value) {
     }
   }
 
+  public static class PasswordConverter implements IStringConverter<String> {
+    public static final String STDIN = "stdin";
+
+    private enum KeyType {
+      PASS("pass:"), ENV("env:") {
+        @Override
+        String process(String value) {
+          return System.getenv(value);
+        }
+      },
+      FILE("file:") {
+        @SuppressFBWarnings(value = "PATH_TRAVERSAL_IN",
+            justification = "app is run in same security context as user providing the filename")
+        @Override
+        String process(String value) {
+          Scanner scanner = null;
+          try {
+            scanner = new Scanner(new File(value), UTF_8);
+            return scanner.nextLine();
+          } catch (IOException e) {
+            throw new ParameterException(e);
+          } finally {
+            if (scanner != null) {
+              scanner.close();
+            }
+          }
+        }
+      },
+      STDIN(PasswordConverter.STDIN) {
+        @Override
+        public boolean matches(String value) {
+          return prefix.equals(value);
+        }
+
+        @Override
+        public String convert(String value) {
+          // Will check for this later
 
 Review comment:
   Would you happen to know where this processed?  I didn't see it.  If you are not sure I
can look further.

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

Mime
View raw message