[ 
https://issues.apache.org/jira/browse/HADOOP-12548?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15097010#comment-15097010
 ] 

Matthew Paduano commented on HADOOP-12548:
------------------------------------------

I was thinking of something more like this:
{{
  AWSAccessKeys getAWSAccessKeys(URI name, Configuration conf) {
    String accessKey = null;
    String secretKey = null;
    String userInfo = name.getUserInfo();
    if (userInfo != null) {
      int index = userInfo.indexOf(':');
      if (index != -1) {
        accessKey = userInfo.substring(0, index);
        secretKey = userInfo.substring(index + 1);
      } else {
        accessKey = userInfo;
      }
    }
    if (accessKey == null) {
      final char[] key = conf.getPassword(ACCESS_KEY);
      if (key != null) {
        accessKey = (new String(key)).trim()
      }
    }
    if (secretKey == null) {
      final char[] pass = conf.getPassword(SECRET_KEY);
      if (pass != null) {
        secretKey = (new String(pass)).trim();
      }
    }
    if (accessKey == null || secretKey == null) {
      throw new IOException("cannot find AWS access or secret key.  required!");
    }
    return new AWSAccessKeys(accessKey, secretKey);
  }
}}

> read s3 creds from a Credential Provider
> ----------------------------------------
>
>                 Key: HADOOP-12548
>                 URL: https://issues.apache.org/jira/browse/HADOOP-12548
>             Project: Hadoop Common
>          Issue Type: New Feature
>          Components: fs/s3
>            Reporter: Allen Wittenauer
>            Assignee: Larry McCay
>         Attachments: CredentialProviderAPIforS3FS-002.pdf, 
> HADOOP-12548-01.patch, HADOOP-12548-02.patch, HADOOP-12548-03.patch, 
> HADOOP-12548-04.patch
>
>
> It would be good if we could read s3 creds from a source other than via a 
> java property/Hadoop configuration option



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to