KazydubB commented on a change in pull request #1419: DRILL-6662: Access AWS
access key ID and secret access key using Cred…
URL: https://github.com/apache/drill/pull/1419#discussion_r207876730
##########
File path:
exec/java-exec/src/main/java/org/apache/drill/exec/store/dfs/FileSystemPlugin.java
##########
@@ -104,6 +108,31 @@ public FileSystemPlugin(FileSystemConfig config,
DrillbitContext context, String
}
}
+ private boolean isS3() {
+ java.net.URI uri = FileSystem.getDefaultUri(fsConf);
+ return uri.getScheme().equals("s3a");
+ }
+
+ /**
+ * Retrieve secret and access keys from configured (with
+ * {@link
org.apache.hadoop.security.alias.CredentialProviderFactory#CREDENTIAL_PROVIDER_PATH}
property)
+ * credential providers and set it into {@link #fsConf}. If provider path is
not configured or credential
+ * is absent in providers, it will conditionally fallback to configuration
setting. The fallback will occur unless
+ * {@link
org.apache.hadoop.security.alias.CredentialProvider#CLEAR_TEXT_FALLBACK} is set
to false.
+ * @throws IOException thrown if a credential cannot be retrieved from
provider
+ */
+ private void handleS3Credentials() throws IOException {
+ final String[] credentialKeys = {"fs.s3a.secret.key", "fs.s3a.access.key"};
+ for (String key : credentialKeys) {
+ char[] credentialChars = fsConf.getPassword(key);
+ if (credentialChars != null) {
+ fsConf.set(key, String.valueOf(credentialChars));
Review comment:
Hm, what do you call an "inline declaration"? In s3 storage plugin and with
hadoop credential CLI's -value (though this option is for testing because it's
unsecure) the value should be wrapped with quotes if it is designed to contain
spaces. If set in core-site.xml, the value is wrapped with tags, so any space
is considered to be intentional.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services