{"action":"created","comment":{"url":"https://api.github.com/repos/elastic/elasticsearch/pulls/comments/201657737","pull_request_review_id":136200090,"id":201657737,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIwMTY1NzczNw==","diff_hunk":"@@ -312,6 +350,43 @@ public static void main(final String[] args) throws Exception {\n             return newInternalError(request.getId(), \"Something is wrong with this POST multiple deletes request\");\n         });\n \n+        // non-authorized requests\n+\n+        TriFunction<String, String, String, Response> credentialResponseFunction = (prefix, key, token) -> {\n+            final Date expiration = new Date(new Date().getTime() + TimeUnit.DAYS.toMillis(1));\n+            final String response = \"{\"\n+                 + \"\\\"AccessKeyId\\\": \\\"\" + key + \"\\\",\"\n+                 + \"\\\"Expiration\\\": \\\"\" + DateUtils.formatISO8601Date(expiration) + \"\\\",\"\n+                 + \"\\\"RoleArn\\\": \\\"\" + prefix + \"_ROLE\" + \"\\\",\"\n+                 + \"\\\"SecretAccessKey\\\": \\\"\" + prefix + \"_SCR_KEY\" + \"\\\",\"\n+                 + \"\\\"Token\\\": \\\"\" + token + \"\\\"\"\n+                 + \"}\";\n+\n+            final Map<String, String> headers = new HashMap<>(contentType(\"application/json\"));\n+            return new Response(RestStatus.OK.getStatus(), headers, response.getBytes(UTF_8));\n+        };\n+\n+        // GET\n+        //\n+        // http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/iam-roles-for-amazon-ec2.html\n+        handlers.insert(NON_AUTH + \" GET /latest/meta-data/iam/security-credentials/\", (request) -> {\n+            final String response = ec2Key;\n+\n+            final Map<String, String> headers = new HashMap<>(contentType(\"text/plain\"));\n+            return new Response(RestStatus.OK.getStatus(), headers, response.getBytes(UTF_8));\n+        });\n+\n+        // GET\n+        //\n+        // http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/iam-roles-for-amazon-ec2.html\n+        handlers.insert(NON_AUTH + \" GET /latest/meta-data/iam/security-credentials/{credentials}\", (request) -> {","path":"plugins/repository-s3/src/test/java/org/elasticsearch/repositories/s3/AmazonS3Fixture.java","position":227,"original_position":227,"commit_id":"46dded931764911ab1dc9445c89eb84c17db39b0","original_commit_id":"46dded931764911ab1dc9445c89eb84c17db39b0","user":{"login":"DaveCTurner","id":5058284,"node_id":"MDQ6VXNlcjUwNTgyODQ=","avatar_url":"https://avatars3.githubusercontent.com/u/5058284?v=4","gravatar_id":"","url":"https://api.github.com/users/DaveCTurner","html_url":"https://github.com/DaveCTurner","followers_url":"https://api.github.com/users/DaveCTurner/followers","following_url":"https://api.github.com/users/DaveCTurner/following{/other_user}","gists_url":"https://api.github.com/users/DaveCTurner/gists{/gist_id}","starred_url":"https://api.github.com/users/DaveCTurner/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DaveCTurner/subscriptions","organizations_url":"https://api.github.com/users/DaveCTurner/orgs","repos_url":"https://api.github.com/users/DaveCTurner/repos","events_url":"https://api.github.com/users/DaveCTurner/events{/privacy}","received_events_url":"https://api.github.com/users/DaveCTurner/received_events","type":"User","site_admin":false},"body":"... so that this doesn't need the `{credentials}` parameter in the URL ...","created_at":"2018-07-11T11:39:02Z","updated_at":"2018-07-11T11:45:14Z","html_url":"https://github.com/elastic/elasticsearch/pull/31918#discussion_r201657737","pull_request_url":"https://api.github.com/repos/elastic/elasticsearch/pulls/31918","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/elastic/elasticsearch/pulls/comments/201657737"},"html":{"href":"https://github.com/elastic/elasticsearch/pull/31918#discussion_r201657737"},"pull_request":{"href":"https://api.github.com/repos/elastic/elasticsearch/pulls/31918"}}},"pull_request":{"url":"https://api.github.com/repos/elastic/elasticsearch/pulls/31918","id":200365019,"node_id":"MDExOlB1bGxSZXF1ZXN0MjAwMzY1MDE5","html_url":"https://github.com/elastic/elasticsearch/pull/31918","diff_url":"https://github.com/elastic/elasticsearch/pull/31918.diff","patch_url":"https://github.com/elastic/elasticsearch/pull/31918.patch","issue_url":"https://api.github.com/repos/elastic/elasticsearch/issues/31918","number":31918,"state":"open","locked":false,"title":"Add EC2 credential test for repository-s3","user":{"login":"vladimirdolzhenko","id":209440,"node_id":"MDQ6VXNlcjIwOTQ0MA==","avatar_url":"https://avatars0.githubusercontent.com/u/209440?v=4","gravatar_id":"","url":"https://api.github.com/users/vladimirdolzhenko","html_url":"https://github.com/vladimirdolzhenko","followers_url":"https://api.github.com/users/vladimirdolzhenko/followers","following_url":"https://api.github.com/users/vladimirdolzhenko/following{/other_user}","gists_url":"https://api.github.com/users/vladimirdolzhenko/gists{/gist_id}","starred_url":"https://api.github.com/users/vladimirdolzhenko/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vladimirdolzhenko/subscriptions","organizations_url":"https://api.github.com/users/vladimirdolzhenko/orgs","repos_url":"https://api.github.com/users/vladimirdolzhenko/repos","events_url":"https://api.github.com/users/vladimirdolzhenko/events{/privacy}","received_events_url":"https://api.github.com/users/vladimirdolzhenko/received_events","type":"User","site_admin":false},"body":"Add EC2 credential test for repository-s3\r\n\r\nRelates to #26913 ","created_at":"2018-07-10T11:29:27Z","updated_at":"2018-07-11T11:45:14Z","closed_at":null,"merged_at":null,"merge_commit_sha":"46b6f260f22b93ea938b9b690b753b183cd73037","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[{"id":143077482,"node_id":"MDU6TGFiZWwxNDMwNzc0ODI=","url":"https://api.github.com/repos/elastic/elasticsearch/labels/:Distributed/Snapshot/Restore","name":":Distributed/Snapshot/Restore","color":"0e8a16","default":false},{"id":60445228,"node_id":"MDU6TGFiZWw2MDQ0NTIyOA==","url":"https://api.github.com/repos/elastic/elasticsearch/labels/%3Etest","name":">test","color":"5319e7","default":false},{"id":912911731,"node_id":"MDU6TGFiZWw5MTI5MTE3MzE=","url":"https://api.github.com/repos/elastic/elasticsearch/labels/v6.4.0","name":"v6.4.0","color":"DDDDDD","default":false},{"id":484855464,"node_id":"MDU6TGFiZWw0ODQ4NTU0NjQ=","url":"https://api.github.com/repos/elastic/elasticsearch/labels/v7.0.0","name":"v7.0.0","color":"dddddd","default":false}],"milestone":null,"commits_url":"https://api.github.com/repos/elastic/elasticsearch/pulls/31918/commits","review_comments_url":"https://api.github.com/repos/elastic/elasticsearch/pulls/31918/comments","review_comment_url":"https://api.github.com/repos/elastic/elasticsearch/pulls/comments{/number}","comments_url":"https://api.github.com/repos/elastic/elasticsearch/issues/31918/comments","statuses_url":"https://api.github.com/repos/elastic/elasticsearch/statuses/46dded931764911ab1dc9445c89eb84c17db39b0","head":{"label":"vladimirdolzhenko:26913_ec2_credentials_test","ref":"26913_ec2_credentials_test","sha":"46dded931764911ab1dc9445c89eb84c17db39b0","user":{"login":"vladimirdolzhenko","id":209440,"node_id":"MDQ6VXNlcjIwOTQ0MA==","avatar_url":"https://avatars0.githubusercontent.com/u/209440?v=4","gravatar_id":"","url":"https://api.github.com/users/vladimirdolzhenko","html_url":"https://github.com/vladimirdolzhenko","followers_url":"https://api.github.com/users/vladimirdolzhenko/followers","following_url":"https://api.github.com/users/vladimirdolzhenko/following{/other_user}","gists_url":"https://api.github.com/users/vladimirdolzhenko/gists{/gist_id}","starred_url":"https://api.github.com/users/vladimirdolzhenko/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vladimirdolzhenko/subscriptions","organizations_url":"https://api.github.com/users/vladimirdolzhenko/orgs","repos_url":"https://api.github.com/users/vladimirdolzhenko/repos","events_url":"https://api.github.com/users/vladimirdolzhenko/events{/privacy}","received_events_url":"https://api.github.com/users/vladimirdolzhenko/received_events","type":"User","site_admin":false},"repo":{"id":128040633,"node_id":"MDEwOlJlcG9zaXRvcnkxMjgwNDA2MzM=","name":"elasticsearch","full_name":"vladimirdolzhenko/elasticsearch","owner":{"login":"vladimirdolzhenko","id":209440,"node_id":"MDQ6VXNlcjIwOTQ0MA==","avatar_url":"https://avatars0.githubusercontent.com/u/209440?v=4","gravatar_id":"","url":"https://api.github.com/users/vladimirdolzhenko","html_url":"https://github.com/vladimirdolzhenko","followers_url":"https://api.github.com/users/vladimirdolzhenko/followers","following_url":"https://api.github.com/users/vladimirdolzhenko/following{/other_user}","gists_url":"https://api.github.com/users/vladimirdolzhenko/gists{/gist_id}","starred_url":"https://api.github.com/users/vladimirdolzhenko/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vladimirdolzhenko/subscriptions","organizations_url":"https://api.github.com/users/vladimirdolzhenko/orgs","repos_url":"https://api.github.com/users/vladimirdolzhenko/repos","events_url":"https://api.github.com/users/vladimirdolzhenko/events{/privacy}","received_events_url":"https://api.github.com/users/vladimirdolzhenko/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/vladimirdolzhenko/elasticsearch","description":"Open Source, Distributed, RESTful Search Engine","fork":true,"url":"https://api.github.com/repos/vladimirdolzhenko/elasticsearch","forks_url":"https://api.github.com/repos/vladimirdolzhenko/elasticsearch/forks","keys_url":"https://api.github.com/repos/vladimirdolzhenko/elasticsearch/keys{/key_id}","collaborators_url":"https://api.github.com/repos/vladimirdolzhenko/elasticsearch/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/vladimirdolzhenko/elasticsearch/teams","hooks_url":"https://api.github.com/repos/vladimirdolzhenko/elasticsearch/hooks","issue_events_url":"https://api.github.com/repos/vladimirdolzhenko/elasticsearch/issues/events{/number}","events_url":"https://api.github.com/repos/vladimirdolzhenko/elasticsearch/events","assignees_url":"https://api.github.com/repos/vladimirdolzhenko/elasticsearch/assignees{/user}","branches_url":"https://api.github.com/repos/vladimirdolzhenko/elasticsearch/branches{/branch}","tags_url":"https://api.github.com/repos/vladimirdolzhenko/elasticsearch/tags","blobs_url":"https://api.github.com/repos/vladimirdolzhenko/elasticsearch/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/vladimirdolzhenko/elasticsearch/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/vladimirdolzhenko/elasticsearch/git/refs{/sha}","trees_url":"https://api.github.com/repos/vladimirdolzhenko/elasticsearch/git/trees{/sha}","statuses_url":"https://api.github.com/repos/vladimirdolzhenko/elasticsearch/statuses/{sha}","languages_url":"https://api.github.com/repos/vladimirdolzhenko/elasticsearch/languages","stargazers_url":"https://api.github.com/repos/vladimirdolzhenko/elasticsearch/stargazers","contributors_url":"https://api.github.com/repos/vladimirdolzhenko/elasticsearch/contributors","subscribers_url":"https://api.github.com/repos/vladimirdolzhenko/elasticsearch/subscribers","subscription_url":"https://api.github.com/repos/vladimirdolzhenko/elasticsearch/subscription","commits_url":"https://api.github.com/repos/vladimirdolzhenko/elasticsearch/commits{/sha}","git_commits_url":"https://api.github.com/repos/vladimirdolzhenko/elasticsearch/git/commits{/sha}","comments_url":"https://api.github.com/repos/vladimirdolzhenko/elasticsearch/comments{/number}","issue_comment_url":"https://api.github.com/repos/vladimirdolzhenko/elasticsearch/issues/comments{/number}","contents_url":"https://api.github.com/repos/vladimirdolzhenko/elasticsearch/contents/{+path}","compare_url":"https://api.github.com/repos/vladimirdolzhenko/elasticsearch/compare/{base}...{head}","merges_url":"https://api.github.com/repos/vladimirdolzhenko/elasticsearch/merges","archive_url":"https://api.github.com/repos/vladimirdolzhenko/elasticsearch/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/vladimirdolzhenko/elasticsearch/downloads","issues_url":"https://api.github.com/repos/vladimirdolzhenko/elasticsearch/issues{/number}","pulls_url":"https://api.github.com/repos/vladimirdolzhenko/elasticsearch/pulls{/number}","milestones_url":"https://api.github.com/repos/vladimirdolzhenko/elasticsearch/milestones{/number}","notifications_url":"https://api.github.com/repos/vladimirdolzhenko/elasticsearch/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/vladimirdolzhenko/elasticsearch/labels{/name}","releases_url":"https://api.github.com/repos/vladimirdolzhenko/elasticsearch/releases{/id}","deployments_url":"https://api.github.com/repos/vladimirdolzhenko/elasticsearch/deployments","created_at":"2018-04-04T09:35:32Z","updated_at":"2018-06-20T15:37:06Z","pushed_at":"2018-07-11T11:31:07Z","git_url":"git://github.com/vladimirdolzhenko/elasticsearch.git","ssh_url":"git@github.com:vladimirdolzhenko/elasticsearch.git","clone_url":"https://github.com/vladimirdolzhenko/elasticsearch.git","svn_url":"https://github.com/vladimirdolzhenko/elasticsearch","homepage":"https://www.elastic.co/products/elasticsearch","size":461720,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"other","name":"Other","spdx_id":null,"url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"elastic:master","ref":"master","sha":"2ac7e49924df7632c96ea434563b7628b7509e50","user":{"login":"elastic","id":6764390,"node_id":"MDEyOk9yZ2FuaXphdGlvbjY3NjQzOTA=","avatar_url":"https://avatars0.githubusercontent.com/u/6764390?v=4","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,"node_id":"MDEwOlJlcG9zaXRvcnk1MDc3NzU=","name":"elasticsearch","full_name":"elastic/elasticsearch","owner":{"login":"elastic","id":6764390,"node_id":"MDEyOk9yZ2FuaXphdGlvbjY3NjQzOTA=","avatar_url":"https://avatars0.githubusercontent.com/u/6764390?v=4","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":"2018-07-11T11:42:08Z","pushed_at":"2018-07-11T11:31:10Z","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":495753,"stargazers_count":32438,"watchers_count":32438,"language":"Java","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":11117,"mirror_url":null,"archived":false,"open_issues_count":1541,"license":{"key":"other","name":"Other","spdx_id":null,"url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":11117,"open_issues":1541,"watchers":32438,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/elastic/elasticsearch/pulls/31918"},"html":{"href":"https://github.com/elastic/elasticsearch/pull/31918"},"issue":{"href":"https://api.github.com/repos/elastic/elasticsearch/issues/31918"},"comments":{"href":"https://api.github.com/repos/elastic/elasticsearch/issues/31918/comments"},"review_comments":{"href":"https://api.github.com/repos/elastic/elasticsearch/pulls/31918/comments"},"review_comment":{"href":"https://api.github.com/repos/elastic/elasticsearch/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/elastic/elasticsearch/pulls/31918/commits"},"statuses":{"href":"https://api.github.com/repos/elastic/elasticsearch/statuses/46dded931764911ab1dc9445c89eb84c17db39b0"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"DaveCTurner"}}