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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to