{"action":"closed","number":19560,"pull_request":{"url":"https://api.github.com/repos/elastic/elasticsearch/pulls/19560","id":78552916,"html_url":"https://github.com/elastic/elasticsearch/pull/19560","diff_url":"https://github.com/elastic/elasticsearch/pull/19560.diff","patch_url":"https://github.com/elastic/elasticsearch/pull/19560.patch","issue_url":"https://api.github.com/repos/elastic/elasticsearch/issues/19560","number":19560,"state":"closed","locked":false,"title":"Extract AWS Key from KeyChain instead of using potential null value","user":{"login":"dadoonet","id":274222,"avatar_url":"https://avatars.githubusercontent.com/u/274222?v=3","gravatar_id":"","url":"https://api.github.com/users/dadoonet","html_url":"https://github.com/dadoonet","followers_url":"https://api.github.com/users/dadoonet/followers","following_url":"https://api.github.com/users/dadoonet/following{/other_user}","gists_url":"https://api.github.com/users/dadoonet/gists{/gist_id}","starred_url":"https://api.github.com/users/dadoonet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dadoonet/subscriptions","organizations_url":"https://api.github.com/users/dadoonet/orgs","repos_url":"https://api.github.com/users/dadoonet/repos","events_url":"https://api.github.com/users/dadoonet/events{/privacy}","received_events_url":"https://api.github.com/users/dadoonet/received_events","type":"User","site_admin":false},"body":"While I was working on #18703, I discovered a bad behavior when people don't provide AWS key/secret as part as their `elasticsearch.yml` but rely on SysProps or env. variables...\r\n\r\nIn [`InternalAwsS3Service#getClient(...)`](https://github.com/elastic/elasticsearch/blob/d4366f8493ac8d2f7091404ffd346e4f3c0f9af9/plugins/repository-s3/src/main/java/org/elasticsearch/cloud/aws/InternalAwsS3Service.java#L76-L141), we have:\r\n\r\n```java\r\n        Tuple<String, String> clientDescriptor = new Tuple<>(endpoint, account);\r\n        AmazonS3Client client = clients.get(clientDescriptor);\r\n```\r\n\r\nBut if people don't provide credentials, `account` is `null`.\r\n\r\nEven if it actually could work, I think that we should use the `AWSCredentialsProvider` we create later on and extract from it the `AWS key` and then use it as the second value of the tuple.\r\n\r\nCloses #19557.","created_at":"2016-07-22T23:18:16Z","updated_at":"2016-08-04T15:58:42Z","closed_at":"2016-08-04T15:58:42Z","merged_at":"2016-08-04T15:58:42Z","merge_commit_sha":"f8e0557be5e8177382c9d1e36bf8dffa979e5446","assignee":{"login":"dadoonet","id":274222,"avatar_url":"https://avatars.githubusercontent.com/u/274222?v=3","gravatar_id":"","url":"https://api.github.com/users/dadoonet","html_url":"https://github.com/dadoonet","followers_url":"https://api.github.com/users/dadoonet/followers","following_url":"https://api.github.com/users/dadoonet/following{/other_user}","gists_url":"https://api.github.com/users/dadoonet/gists{/gist_id}","starred_url":"https://api.github.com/users/dadoonet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dadoonet/subscriptions","organizations_url":"https://api.github.com/users/dadoonet/orgs","repos_url":"https://api.github.com/users/dadoonet/repos","events_url":"https://api.github.com/users/dadoonet/events{/privacy}","received_events_url":"https://api.github.com/users/dadoonet/received_events","type":"User","site_admin":false},"assignees":[{"login":"dadoonet","id":274222,"avatar_url":"https://avatars.githubusercontent.com/u/274222?v=3","gravatar_id":"","url":"https://api.github.com/users/dadoonet","html_url":"https://github.com/dadoonet","followers_url":"https://api.github.com/users/dadoonet/followers","following_url":"https://api.github.com/users/dadoonet/following{/other_user}","gists_url":"https://api.github.com/users/dadoonet/gists{/gist_id}","starred_url":"https://api.github.com/users/dadoonet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dadoonet/subscriptions","organizations_url":"https://api.github.com/users/dadoonet/orgs","repos_url":"https://api.github.com/users/dadoonet/repos","events_url":"https://api.github.com/users/dadoonet/events{/privacy}","received_events_url":"https://api.github.com/users/dadoonet/received_events","type":"User","site_admin":false}],"milestone":null,"commits_url":"https://api.github.com/repos/elastic/elasticsearch/pulls/19560/commits","review_comments_url":"https://api.github.com/repos/elastic/elasticsearch/pulls/19560/comments","review_comment_url":"https://api.github.com/repos/elastic/elasticsearch/pulls/comments{/number}","comments_url":"https://api.github.com/repos/elastic/elasticsearch/issues/19560/comments","statuses_url":"https://api.github.com/repos/elastic/elasticsearch/statuses/f8e0557be5e8177382c9d1e36bf8dffa979e5446","head":{"label":"dadoonet:pr/19557-extract-aws-key","ref":"pr/19557-extract-aws-key","sha":"f8e0557be5e8177382c9d1e36bf8dffa979e5446","user":{"login":"dadoonet","id":274222,"avatar_url":"https://avatars.githubusercontent.com/u/274222?v=3","gravatar_id":"","url":"https://api.github.com/users/dadoonet","html_url":"https://github.com/dadoonet","followers_url":"https://api.github.com/users/dadoonet/followers","following_url":"https://api.github.com/users/dadoonet/following{/other_user}","gists_url":"https://api.github.com/users/dadoonet/gists{/gist_id}","starred_url":"https://api.github.com/users/dadoonet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dadoonet/subscriptions","organizations_url":"https://api.github.com/users/dadoonet/orgs","repos_url":"https://api.github.com/users/dadoonet/repos","events_url":"https://api.github.com/users/dadoonet/events{/privacy}","received_events_url":"https://api.github.com/users/dadoonet/received_events","type":"User","site_admin":false},"repo":{"id":2521491,"name":"elasticsearch","full_name":"dadoonet/elasticsearch","owner":{"login":"dadoonet","id":274222,"avatar_url":"https://avatars.githubusercontent.com/u/274222?v=3","gravatar_id":"","url":"https://api.github.com/users/dadoonet","html_url":"https://github.com/dadoonet","followers_url":"https://api.github.com/users/dadoonet/followers","following_url":"https://api.github.com/users/dadoonet/following{/other_user}","gists_url":"https://api.github.com/users/dadoonet/gists{/gist_id}","starred_url":"https://api.github.com/users/dadoonet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dadoonet/subscriptions","organizations_url":"https://api.github.com/users/dadoonet/orgs","repos_url":"https://api.github.com/users/dadoonet/repos","events_url":"https://api.github.com/users/dadoonet/events{/privacy}","received_events_url":"https://api.github.com/users/dadoonet/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/dadoonet/elasticsearch","description":"Open Source, Distributed, RESTful Search Engine","fork":true,"url":"https://api.github.com/repos/dadoonet/elasticsearch","forks_url":"https://api.github.com/repos/dadoonet/elasticsearch/forks","keys_url":"https://api.github.com/repos/dadoonet/elasticsearch/keys{/key_id}","collaborators_url":"https://api.github.com/repos/dadoonet/elasticsearch/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/dadoonet/elasticsearch/teams","hooks_url":"https://api.github.com/repos/dadoonet/elasticsearch/hooks","issue_events_url":"https://api.github.com/repos/dadoonet/elasticsearch/issues/events{/number}","events_url":"https://api.github.com/repos/dadoonet/elasticsearch/events","assignees_url":"https://api.github.com/repos/dadoonet/elasticsearch/assignees{/user}","branches_url":"https://api.github.com/repos/dadoonet/elasticsearch/branches{/branch}","tags_url":"https://api.github.com/repos/dadoonet/elasticsearch/tags","blobs_url":"https://api.github.com/repos/dadoonet/elasticsearch/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/dadoonet/elasticsearch/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/dadoonet/elasticsearch/git/refs{/sha}","trees_url":"https://api.github.com/repos/dadoonet/elasticsearch/git/trees{/sha}","statuses_url":"https://api.github.com/repos/dadoonet/elasticsearch/statuses/{sha}","languages_url":"https://api.github.com/repos/dadoonet/elasticsearch/languages","stargazers_url":"https://api.github.com/repos/dadoonet/elasticsearch/stargazers","contributors_url":"https://api.github.com/repos/dadoonet/elasticsearch/contributors","subscribers_url":"https://api.github.com/repos/dadoonet/elasticsearch/subscribers","subscription_url":"https://api.github.com/repos/dadoonet/elasticsearch/subscription","commits_url":"https://api.github.com/repos/dadoonet/elasticsearch/commits{/sha}","git_commits_url":"https://api.github.com/repos/dadoonet/elasticsearch/git/commits{/sha}","comments_url":"https://api.github.com/repos/dadoonet/elasticsearch/comments{/number}","issue_comment_url":"https://api.github.com/repos/dadoonet/elasticsearch/issues/comments{/number}","contents_url":"https://api.github.com/repos/dadoonet/elasticsearch/contents/{+path}","compare_url":"https://api.github.com/repos/dadoonet/elasticsearch/compare/{base}...{head}","merges_url":"https://api.github.com/repos/dadoonet/elasticsearch/merges","archive_url":"https://api.github.com/repos/dadoonet/elasticsearch/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/dadoonet/elasticsearch/downloads","issues_url":"https://api.github.com/repos/dadoonet/elasticsearch/issues{/number}","pulls_url":"https://api.github.com/repos/dadoonet/elasticsearch/pulls{/number}","milestones_url":"https://api.github.com/repos/dadoonet/elasticsearch/milestones{/number}","notifications_url":"https://api.github.com/repos/dadoonet/elasticsearch/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/dadoonet/elasticsearch/labels{/name}","releases_url":"https://api.github.com/repos/dadoonet/elasticsearch/releases{/id}","deployments_url":"https://api.github.com/repos/dadoonet/elasticsearch/deployments","created_at":"2011-10-05T19:24:28Z","updated_at":"2015-11-04T19:16:33Z","pushed_at":"2016-08-04T00:02:58Z","git_url":"git://github.com/dadoonet/elasticsearch.git","ssh_url":"git@github.com:dadoonet/elasticsearch.git","clone_url":"https://github.com/dadoonet/elasticsearch.git","svn_url":"https://github.com/dadoonet/elasticsearch","homepage":"http://elasticsearch.org","size":212482,"stargazers_count":3,"watchers_count":3,"language":"Java","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":1,"forks":1,"open_issues":1,"watchers":3,"default_branch":"master"}},"base":{"label":"elastic:master","ref":"master","sha":"fef0ffc49e52ea36e2c412a3237fcfebe2d31a55","user":{"login":"elastic","id":6764390,"avatar_url":"https://avatars.githubusercontent.com/u/6764390?v=3","gravatar_id":"","url":"https://api.github.com/users/elastic","html_url":"https://github.com/elastic","followers_url":"https://api.github.com/users/elastic/followers","following_url":"https://api.github.com/users/elastic/following{/other_user}","gists_url":"https://api.github.com/users/elastic/gists{/gist_id}","starred_url":"https://api.github.com/users/elastic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/elastic/subscriptions","organizations_url":"https://api.github.com/users/elastic/orgs","repos_url":"https://api.github.com/users/elastic/repos","events_url":"https://api.github.com/users/elastic/events{/privacy}","received_events_url":"https://api.github.com/users/elastic/received_events","type":"Organization","site_admin":false},"repo":{"id":507775,"name":"elasticsearch","full_name":"elastic/elasticsearch","owner":{"login":"elastic","id":6764390,"avatar_url":"https://avatars.githubusercontent.com/u/6764390?v=3","gravatar_id":"","url":"https://api.github.com/users/elastic","html_url":"https://github.com/elastic","followers_url":"https://api.github.com/users/elastic/followers","following_url":"https://api.github.com/users/elastic/following{/other_user}","gists_url":"https://api.github.com/users/elastic/gists{/gist_id}","starred_url":"https://api.github.com/users/elastic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/elastic/subscriptions","organizations_url":"https://api.github.com/users/elastic/orgs","repos_url":"https://api.github.com/users/elastic/repos","events_url":"https://api.github.com/users/elastic/events{/privacy}","received_events_url":"https://api.github.com/users/elastic/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/elastic/elasticsearch","description":"Open Source, Distributed, RESTful Search Engine","fork":false,"url":"https://api.github.com/repos/elastic/elasticsearch","forks_url":"https://api.github.com/repos/elastic/elasticsearch/forks","keys_url":"https://api.github.com/repos/elastic/elasticsearch/keys{/key_id}","collaborators_url":"https://api.github.com/repos/elastic/elasticsearch/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/elastic/elasticsearch/teams","hooks_url":"https://api.github.com/repos/elastic/elasticsearch/hooks","issue_events_url":"https://api.github.com/repos/elastic/elasticsearch/issues/events{/number}","events_url":"https://api.github.com/repos/elastic/elasticsearch/events","assignees_url":"https://api.github.com/repos/elastic/elasticsearch/assignees{/user}","branches_url":"https://api.github.com/repos/elastic/elasticsearch/branches{/branch}","tags_url":"https://api.github.com/repos/elastic/elasticsearch/tags","blobs_url":"https://api.github.com/repos/elastic/elasticsearch/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/elastic/elasticsearch/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/elastic/elasticsearch/git/refs{/sha}","trees_url":"https://api.github.com/repos/elastic/elasticsearch/git/trees{/sha}","statuses_url":"https://api.github.com/repos/elastic/elasticsearch/statuses/{sha}","languages_url":"https://api.github.com/repos/elastic/elasticsearch/languages","stargazers_url":"https://api.github.com/repos/elastic/elasticsearch/stargazers","contributors_url":"https://api.github.com/repos/elastic/elasticsearch/contributors","subscribers_url":"https://api.github.com/repos/elastic/elasticsearch/subscribers","subscription_url":"https://api.github.com/repos/elastic/elasticsearch/subscription","commits_url":"https://api.github.com/repos/elastic/elasticsearch/commits{/sha}","git_commits_url":"https://api.github.com/repos/elastic/elasticsearch/git/commits{/sha}","comments_url":"https://api.github.com/repos/elastic/elasticsearch/comments{/number}","issue_comment_url":"https://api.github.com/repos/elastic/elasticsearch/issues/comments{/number}","contents_url":"https://api.github.com/repos/elastic/elasticsearch/contents/{+path}","compare_url":"https://api.github.com/repos/elastic/elasticsearch/compare/{base}...{head}","merges_url":"https://api.github.com/repos/elastic/elasticsearch/merges","archive_url":"https://api.github.com/repos/elastic/elasticsearch/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/elastic/elasticsearch/downloads","issues_url":"https://api.github.com/repos/elastic/elasticsearch/issues{/number}","pulls_url":"https://api.github.com/repos/elastic/elasticsearch/pulls{/number}","milestones_url":"https://api.github.com/repos/elastic/elasticsearch/milestones{/number}","notifications_url":"https://api.github.com/repos/elastic/elasticsearch/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/elastic/elasticsearch/labels{/name}","releases_url":"https://api.github.com/repos/elastic/elasticsearch/releases{/id}","deployments_url":"https://api.github.com/repos/elastic/elasticsearch/deployments","created_at":"2010-02-08T13:20:56Z","updated_at":"2016-08-04T15:23:57Z","pushed_at":"2016-08-04T15:58:34Z","git_url":"git://github.com/elastic/elasticsearch.git","ssh_url":"git@github.com:elastic/elasticsearch.git","clone_url":"https://github.com/elastic/elasticsearch.git","svn_url":"https://github.com/elastic/elasticsearch","homepage":"https://www.elastic.co/products/elasticsearch","size":340425,"stargazers_count":17719,"watchers_count":17719,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":5997,"mirror_url":null,"open_issues_count":1100,"forks":5997,"open_issues":1100,"watchers":17719,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/elastic/elasticsearch/pulls/19560"},"html":{"href":"https://github.com/elastic/elasticsearch/pull/19560"},"issue":{"href":"https://api.github.com/repos/elastic/elasticsearch/issues/19560"},"comments":{"href":"https://api.github.com/repos/elastic/elasticsearch/issues/19560/comments"},"review_comments":{"href":"https://api.github.com/repos/elastic/elasticsearch/pulls/19560/comments"},"review_comment":{"href":"https://api.github.com/repos/elastic/elasticsearch/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/elastic/elasticsearch/pulls/19560/commits"},"statuses":{"href":"https://api.github.com/repos/elastic/elasticsearch/statuses/f8e0557be5e8177382c9d1e36bf8dffa979e5446"}},"merged":true,"mergeable":null,"mergeable_state":"unknown","merged_by":{"login":"dadoonet","id":274222,"avatar_url":"https://avatars.githubusercontent.com/u/274222?v=3","gravatar_id":"","url":"https://api.github.com/users/dadoonet","html_url":"https://github.com/dadoonet","followers_url":"https://api.github.com/users/dadoonet/followers","following_url":"https://api.github.com/users/dadoonet/following{/other_user}","gists_url":"https://api.github.com/users/dadoonet/gists{/gist_id}","starred_url":"https://api.github.com/users/dadoonet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dadoonet/subscriptions","organizations_url":"https://api.github.com/users/dadoonet/orgs","repos_url":"https://api.github.com/users/dadoonet/repos","events_url":"https://api.github.com/users/dadoonet/events{/privacy}","received_events_url":"https://api.github.com/users/dadoonet/received_events","type":"User","site_admin":false},"comments":3,"review_comments":0,"commits":1,"additions":34,"deletions":32,"changed_files":7}}
{"actor":{"display_login":"dadoonet"}}