You are viewing a plain text version of this content. The canonical link for it is here.
Posted to gitbox@hive.apache.org by "VenuReddy2103 (via GitHub)" <gi...@apache.org> on 2023/05/12 14:08:32 UTC

[GitHub] [hive] VenuReddy2103 commented on a diff in pull request #4282: HIVE-27308: Avoid exposing client keystore and truststore passwords in the JDBC URL

VenuReddy2103 commented on code in PR #4282:
URL: https://github.com/apache/hive/pull/4282#discussion_r1192428789


##########
jdbc/src/java/org/apache/hive/jdbc/Utils.java:
##########
@@ -803,4 +807,26 @@ public static String getCanonicalHostName(String hostName) {
     }
   }
 
+  /**
+   * Method to get the password from the credential provider
+   * @param providerPath provider path
+   * @param key alias name
+   * @return password
+   */
+  public static String getPasswordFromCredentialProvider(String providerPath, String key) {
+    try {
+      if (providerPath != null) {
+        Configuration conf = new Configuration();

Review Comment:
   Used org.apache.hadoop.conf.Configuration object because [Configuration.getPassword](https://hadoop.apache.org/docs/stable/api/org/apache/hadoop/conf/Configuration.html#getPassword-java.lang.String-) resolve the key as an alias through the CredentialProvider API internally. So we can avoid using the CredentialProvider APIs to fetch password explicitly in our code.



-- 
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.

To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For additional commands, e-mail: gitbox-help@hive.apache.org