{"action":"created","comment":{"url":"https://api.github.com/repos/uswitch/kiam/pulls/comments/201285839","pull_request_review_id":135754783,"id":201285839,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIwMTI4NTgzOQ==","diff_hunk":"@@ -0,0 +1,88 @@\n+package metadata\n+\n+import (\n+\t\"context\"\n+\t\"fmt\"\n+\t\"github.com/gorilla/mux\"\n+\t\"github.com/uswitch/kiam/pkg/server\"\n+\tst \"github.com/uswitch/kiam/pkg/testutil/server\"\n+\t\"net/http\"\n+\t\"net/http/httptest\"\n+\t\"testing\"\n+\t\"time\"\n+)\n+\n+func TestReturnRoleWhenClientResponds(t *testing.T) {\n+\tr, _ := http.NewRequest(\"GET\", \"/latest/meta-data/iam/security-credentials/\", nil)","path":"pkg/aws/metadata/handler_role_name_test.go","position":16,"original_position":16,"commit_id":"d6bb82d80c9124634baa91beaf44e239c525dd0e","original_commit_id":"d6bb82d80c9124634baa91beaf44e239c525dd0e","user":{"login":"pingles","id":1150,"node_id":"MDQ6VXNlcjExNTA=","avatar_url":"https://avatars0.githubusercontent.com/u/1150?v=4","gravatar_id":"","url":"https://api.github.com/users/pingles","html_url":"https://github.com/pingles","followers_url":"https://api.github.com/users/pingles/followers","following_url":"https://api.github.com/users/pingles/following{/other_user}","gists_url":"https://api.github.com/users/pingles/gists{/gist_id}","starred_url":"https://api.github.com/users/pingles/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pingles/subscriptions","organizations_url":"https://api.github.com/users/pingles/orgs","repos_url":"https://api.github.com/users/pingles/repos","events_url":"https://api.github.com/users/pingles/events{/privacy}","received_events_url":"https://api.github.com/users/pingles/received_events","type":"User","site_admin":false},"body":"Yeah I think @moofish32 was pointing out that the metadata server they tested on 301'ed, rather than returning credentials. Kiam currently supports either form and serves 200s on both.\r\n\r\n@moofish32 I seem to remember others mentioning this stuff varied between instance generations (so it changed between m4 and m5 for example).\r\n\r\nDo you remember the instance type you tested this on?\r\n\r\nEither way I suspect we should probably add an issue to change it so that it behaves the same way- 301'ing rather than successfully working on both?","created_at":"2018-07-10T10:02:42Z","updated_at":"2018-07-10T10:02:43Z","html_url":"https://github.com/uswitch/kiam/pull/109#discussion_r201285839","pull_request_url":"https://api.github.com/repos/uswitch/kiam/pulls/109","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/uswitch/kiam/pulls/comments/201285839"},"html":{"href":"https://github.com/uswitch/kiam/pull/109#discussion_r201285839"},"pull_request":{"href":"https://api.github.com/repos/uswitch/kiam/pulls/109"}},"in_reply_to_id":201149722},"pull_request":{"url":"https://api.github.com/repos/uswitch/kiam/pulls/109","id":199273530,"node_id":"MDExOlB1bGxSZXF1ZXN0MTk5MjczNTMw","html_url":"https://github.com/uswitch/kiam/pull/109","diff_url":"https://github.com/uswitch/kiam/pull/109.diff","patch_url":"https://github.com/uswitch/kiam/pull/109.patch","issue_url":"https://api.github.com/repos/uswitch/kiam/issues/109","number":109,"state":"open","locked":false,"title":"v3 API and refactorings","user":{"login":"pingles","id":1150,"node_id":"MDQ6VXNlcjExNTA=","avatar_url":"https://avatars0.githubusercontent.com/u/1150?v=4","gravatar_id":"","url":"https://api.github.com/users/pingles","html_url":"https://github.com/pingles","followers_url":"https://api.github.com/users/pingles/followers","following_url":"https://api.github.com/users/pingles/following{/other_user}","gists_url":"https://api.github.com/users/pingles/gists{/gist_id}","starred_url":"https://api.github.com/users/pingles/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pingles/subscriptions","organizations_url":"https://api.github.com/users/pingles/orgs","repos_url":"https://api.github.com/users/pingles/repos","events_url":"https://api.github.com/users/pingles/events{/privacy}","received_events_url":"https://api.github.com/users/pingles/received_events","type":"User","site_admin":false},"body":"This change was focused on changes to move to a new Agent/Server interaction ahead of v3. As part of doing this I also refactored/changed a few other interfaces to streamline stuff a little.\r\n\r\n## API Changes\r\nThis adds a new Server API call: `GetPodCredentials` that allows credentials to be obtained by the server given an IP address. Previously the agent would make three separate calls:\r\n\r\n1. Find the Pod (and it's role)\r\n2. Check the Pod can assume the role\r\n3. Get credentials for the role\r\n\r\nThis collapses calls together inside the server. This makes it easier to deliver #14, as well as potentially moving to other mechanisms for agents to request credentials (like the service account token introduced in #104.\r\n\r\n## Testing\r\nI've also broken apart the metadata server tests and moved all tests into the package directories, the Drone build also now runs with coverage stats to make it easier to figure out what parts of the system need tests added.\r\n\r\n## End to End Testing\r\nAlthough the tests are in better shape there's still things that aren't covered and would be nice to have some end-to-end tests to prove the whole- for now I've parked that and created #108 to track separately.\r\n\r\n## Review and Request for Comments\r\nI'd like some review/thoughts on the protos in particular. For now I've added new API calls and left the existing, so that the same server could support both new (3.x) and old (2.x) agents. However, given Kubernetes makes it easy to run servers side-by-side (only the agents have a hard requirement on running one per node) another option is to remove the API calls and have agents talk to different server services.","created_at":"2018-07-04T14:57:30Z","updated_at":"2018-07-10T10:02:43Z","closed_at":null,"merged_at":null,"merge_commit_sha":"d54ec61d14a30e9cfac62c58b7dd67fd6f145267","assignee":null,"assignees":[],"requested_reviewers":[{"login":"tombooth","id":108382,"node_id":"MDQ6VXNlcjEwODM4Mg==","avatar_url":"https://avatars0.githubusercontent.com/u/108382?v=4","gravatar_id":"","url":"https://api.github.com/users/tombooth","html_url":"https://github.com/tombooth","followers_url":"https://api.github.com/users/tombooth/followers","following_url":"https://api.github.com/users/tombooth/following{/other_user}","gists_url":"https://api.github.com/users/tombooth/gists{/gist_id}","starred_url":"https://api.github.com/users/tombooth/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tombooth/subscriptions","organizations_url":"https://api.github.com/users/tombooth/orgs","repos_url":"https://api.github.com/users/tombooth/repos","events_url":"https://api.github.com/users/tombooth/events{/privacy}","received_events_url":"https://api.github.com/users/tombooth/received_events","type":"User","site_admin":false},{"login":"DewaldV","id":1655931,"node_id":"MDQ6VXNlcjE2NTU5MzE=","avatar_url":"https://avatars2.githubusercontent.com/u/1655931?v=4","gravatar_id":"","url":"https://api.github.com/users/DewaldV","html_url":"https://github.com/DewaldV","followers_url":"https://api.github.com/users/DewaldV/followers","following_url":"https://api.github.com/users/DewaldV/following{/other_user}","gists_url":"https://api.github.com/users/DewaldV/gists{/gist_id}","starred_url":"https://api.github.com/users/DewaldV/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DewaldV/subscriptions","organizations_url":"https://api.github.com/users/DewaldV/orgs","repos_url":"https://api.github.com/users/DewaldV/repos","events_url":"https://api.github.com/users/DewaldV/events{/privacy}","received_events_url":"https://api.github.com/users/DewaldV/received_events","type":"User","site_admin":false},{"login":"Joseph-Irving","id":15195889,"node_id":"MDQ6VXNlcjE1MTk1ODg5","avatar_url":"https://avatars3.githubusercontent.com/u/15195889?v=4","gravatar_id":"","url":"https://api.github.com/users/Joseph-Irving","html_url":"https://github.com/Joseph-Irving","followers_url":"https://api.github.com/users/Joseph-Irving/followers","following_url":"https://api.github.com/users/Joseph-Irving/following{/other_user}","gists_url":"https://api.github.com/users/Joseph-Irving/gists{/gist_id}","starred_url":"https://api.github.com/users/Joseph-Irving/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Joseph-Irving/subscriptions","organizations_url":"https://api.github.com/users/Joseph-Irving/orgs","repos_url":"https://api.github.com/users/Joseph-Irving/repos","events_url":"https://api.github.com/users/Joseph-Irving/events{/privacy}","received_events_url":"https://api.github.com/users/Joseph-Irving/received_events","type":"User","site_admin":false}],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/uswitch/kiam/pulls/109/commits","review_comments_url":"https://api.github.com/repos/uswitch/kiam/pulls/109/comments","review_comment_url":"https://api.github.com/repos/uswitch/kiam/pulls/comments{/number}","comments_url":"https://api.github.com/repos/uswitch/kiam/issues/109/comments","statuses_url":"https://api.github.com/repos/uswitch/kiam/statuses/d6bb82d80c9124634baa91beaf44e239c525dd0e","head":{"label":"uswitch:api-v3","ref":"api-v3","sha":"d6bb82d80c9124634baa91beaf44e239c525dd0e","user":{"login":"uswitch","id":4021549,"node_id":"MDEyOk9yZ2FuaXphdGlvbjQwMjE1NDk=","avatar_url":"https://avatars1.githubusercontent.com/u/4021549?v=4","gravatar_id":"","url":"https://api.github.com/users/uswitch","html_url":"https://github.com/uswitch","followers_url":"https://api.github.com/users/uswitch/followers","following_url":"https://api.github.com/users/uswitch/following{/other_user}","gists_url":"https://api.github.com/users/uswitch/gists{/gist_id}","starred_url":"https://api.github.com/users/uswitch/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/uswitch/subscriptions","organizations_url":"https://api.github.com/users/uswitch/orgs","repos_url":"https://api.github.com/users/uswitch/repos","events_url":"https://api.github.com/users/uswitch/events{/privacy}","received_events_url":"https://api.github.com/users/uswitch/received_events","type":"Organization","site_admin":false},"repo":{"id":92945094,"node_id":"MDEwOlJlcG9zaXRvcnk5Mjk0NTA5NA==","name":"kiam","full_name":"uswitch/kiam","owner":{"login":"uswitch","id":4021549,"node_id":"MDEyOk9yZ2FuaXphdGlvbjQwMjE1NDk=","avatar_url":"https://avatars1.githubusercontent.com/u/4021549?v=4","gravatar_id":"","url":"https://api.github.com/users/uswitch","html_url":"https://github.com/uswitch","followers_url":"https://api.github.com/users/uswitch/followers","following_url":"https://api.github.com/users/uswitch/following{/other_user}","gists_url":"https://api.github.com/users/uswitch/gists{/gist_id}","starred_url":"https://api.github.com/users/uswitch/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/uswitch/subscriptions","organizations_url":"https://api.github.com/users/uswitch/orgs","repos_url":"https://api.github.com/users/uswitch/repos","events_url":"https://api.github.com/users/uswitch/events{/privacy}","received_events_url":"https://api.github.com/users/uswitch/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/uswitch/kiam","description":"Integrate AWS IAM with Kubernetes","fork":false,"url":"https://api.github.com/repos/uswitch/kiam","forks_url":"https://api.github.com/repos/uswitch/kiam/forks","keys_url":"https://api.github.com/repos/uswitch/kiam/keys{/key_id}","collaborators_url":"https://api.github.com/repos/uswitch/kiam/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/uswitch/kiam/teams","hooks_url":"https://api.github.com/repos/uswitch/kiam/hooks","issue_events_url":"https://api.github.com/repos/uswitch/kiam/issues/events{/number}","events_url":"https://api.github.com/repos/uswitch/kiam/events","assignees_url":"https://api.github.com/repos/uswitch/kiam/assignees{/user}","branches_url":"https://api.github.com/repos/uswitch/kiam/branches{/branch}","tags_url":"https://api.github.com/repos/uswitch/kiam/tags","blobs_url":"https://api.github.com/repos/uswitch/kiam/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/uswitch/kiam/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/uswitch/kiam/git/refs{/sha}","trees_url":"https://api.github.com/repos/uswitch/kiam/git/trees{/sha}","statuses_url":"https://api.github.com/repos/uswitch/kiam/statuses/{sha}","languages_url":"https://api.github.com/repos/uswitch/kiam/languages","stargazers_url":"https://api.github.com/repos/uswitch/kiam/stargazers","contributors_url":"https://api.github.com/repos/uswitch/kiam/contributors","subscribers_url":"https://api.github.com/repos/uswitch/kiam/subscribers","subscription_url":"https://api.github.com/repos/uswitch/kiam/subscription","commits_url":"https://api.github.com/repos/uswitch/kiam/commits{/sha}","git_commits_url":"https://api.github.com/repos/uswitch/kiam/git/commits{/sha}","comments_url":"https://api.github.com/repos/uswitch/kiam/comments{/number}","issue_comment_url":"https://api.github.com/repos/uswitch/kiam/issues/comments{/number}","contents_url":"https://api.github.com/repos/uswitch/kiam/contents/{+path}","compare_url":"https://api.github.com/repos/uswitch/kiam/compare/{base}...{head}","merges_url":"https://api.github.com/repos/uswitch/kiam/merges","archive_url":"https://api.github.com/repos/uswitch/kiam/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/uswitch/kiam/downloads","issues_url":"https://api.github.com/repos/uswitch/kiam/issues{/number}","pulls_url":"https://api.github.com/repos/uswitch/kiam/pulls{/number}","milestones_url":"https://api.github.com/repos/uswitch/kiam/milestones{/number}","notifications_url":"https://api.github.com/repos/uswitch/kiam/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/uswitch/kiam/labels{/name}","releases_url":"https://api.github.com/repos/uswitch/kiam/releases{/id}","deployments_url":"https://api.github.com/repos/uswitch/kiam/deployments","created_at":"2017-05-31T12:55:09Z","updated_at":"2018-07-09T15:06:48Z","pushed_at":"2018-07-09T15:43:40Z","git_url":"git://github.com/uswitch/kiam.git","ssh_url":"git@github.com:uswitch/kiam.git","clone_url":"https://github.com/uswitch/kiam.git","svn_url":"https://github.com/uswitch/kiam","homepage":"","size":7818,"stargazers_count":173,"watchers_count":173,"language":"Go","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":27,"mirror_url":null,"archived":false,"open_issues_count":38,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0","node_id":"MDc6TGljZW5zZTI="},"forks":27,"open_issues":38,"watchers":173,"default_branch":"master"}},"base":{"label":"uswitch:master","ref":"master","sha":"60c82f61c129f46b702b2e18147fc1adbecac334","user":{"login":"uswitch","id":4021549,"node_id":"MDEyOk9yZ2FuaXphdGlvbjQwMjE1NDk=","avatar_url":"https://avatars1.githubusercontent.com/u/4021549?v=4","gravatar_id":"","url":"https://api.github.com/users/uswitch","html_url":"https://github.com/uswitch","followers_url":"https://api.github.com/users/uswitch/followers","following_url":"https://api.github.com/users/uswitch/following{/other_user}","gists_url":"https://api.github.com/users/uswitch/gists{/gist_id}","starred_url":"https://api.github.com/users/uswitch/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/uswitch/subscriptions","organizations_url":"https://api.github.com/users/uswitch/orgs","repos_url":"https://api.github.com/users/uswitch/repos","events_url":"https://api.github.com/users/uswitch/events{/privacy}","received_events_url":"https://api.github.com/users/uswitch/received_events","type":"Organization","site_admin":false},"repo":{"id":92945094,"node_id":"MDEwOlJlcG9zaXRvcnk5Mjk0NTA5NA==","name":"kiam","full_name":"uswitch/kiam","owner":{"login":"uswitch","id":4021549,"node_id":"MDEyOk9yZ2FuaXphdGlvbjQwMjE1NDk=","avatar_url":"https://avatars1.githubusercontent.com/u/4021549?v=4","gravatar_id":"","url":"https://api.github.com/users/uswitch","html_url":"https://github.com/uswitch","followers_url":"https://api.github.com/users/uswitch/followers","following_url":"https://api.github.com/users/uswitch/following{/other_user}","gists_url":"https://api.github.com/users/uswitch/gists{/gist_id}","starred_url":"https://api.github.com/users/uswitch/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/uswitch/subscriptions","organizations_url":"https://api.github.com/users/uswitch/orgs","repos_url":"https://api.github.com/users/uswitch/repos","events_url":"https://api.github.com/users/uswitch/events{/privacy}","received_events_url":"https://api.github.com/users/uswitch/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/uswitch/kiam","description":"Integrate AWS IAM with Kubernetes","fork":false,"url":"https://api.github.com/repos/uswitch/kiam","forks_url":"https://api.github.com/repos/uswitch/kiam/forks","keys_url":"https://api.github.com/repos/uswitch/kiam/keys{/key_id}","collaborators_url":"https://api.github.com/repos/uswitch/kiam/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/uswitch/kiam/teams","hooks_url":"https://api.github.com/repos/uswitch/kiam/hooks","issue_events_url":"https://api.github.com/repos/uswitch/kiam/issues/events{/number}","events_url":"https://api.github.com/repos/uswitch/kiam/events","assignees_url":"https://api.github.com/repos/uswitch/kiam/assignees{/user}","branches_url":"https://api.github.com/repos/uswitch/kiam/branches{/branch}","tags_url":"https://api.github.com/repos/uswitch/kiam/tags","blobs_url":"https://api.github.com/repos/uswitch/kiam/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/uswitch/kiam/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/uswitch/kiam/git/refs{/sha}","trees_url":"https://api.github.com/repos/uswitch/kiam/git/trees{/sha}","statuses_url":"https://api.github.com/repos/uswitch/kiam/statuses/{sha}","languages_url":"https://api.github.com/repos/uswitch/kiam/languages","stargazers_url":"https://api.github.com/repos/uswitch/kiam/stargazers","contributors_url":"https://api.github.com/repos/uswitch/kiam/contributors","subscribers_url":"https://api.github.com/repos/uswitch/kiam/subscribers","subscription_url":"https://api.github.com/repos/uswitch/kiam/subscription","commits_url":"https://api.github.com/repos/uswitch/kiam/commits{/sha}","git_commits_url":"https://api.github.com/repos/uswitch/kiam/git/commits{/sha}","comments_url":"https://api.github.com/repos/uswitch/kiam/comments{/number}","issue_comment_url":"https://api.github.com/repos/uswitch/kiam/issues/comments{/number}","contents_url":"https://api.github.com/repos/uswitch/kiam/contents/{+path}","compare_url":"https://api.github.com/repos/uswitch/kiam/compare/{base}...{head}","merges_url":"https://api.github.com/repos/uswitch/kiam/merges","archive_url":"https://api.github.com/repos/uswitch/kiam/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/uswitch/kiam/downloads","issues_url":"https://api.github.com/repos/uswitch/kiam/issues{/number}","pulls_url":"https://api.github.com/repos/uswitch/kiam/pulls{/number}","milestones_url":"https://api.github.com/repos/uswitch/kiam/milestones{/number}","notifications_url":"https://api.github.com/repos/uswitch/kiam/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/uswitch/kiam/labels{/name}","releases_url":"https://api.github.com/repos/uswitch/kiam/releases{/id}","deployments_url":"https://api.github.com/repos/uswitch/kiam/deployments","created_at":"2017-05-31T12:55:09Z","updated_at":"2018-07-09T15:06:48Z","pushed_at":"2018-07-09T15:43:40Z","git_url":"git://github.com/uswitch/kiam.git","ssh_url":"git@github.com:uswitch/kiam.git","clone_url":"https://github.com/uswitch/kiam.git","svn_url":"https://github.com/uswitch/kiam","homepage":"","size":7818,"stargazers_count":173,"watchers_count":173,"language":"Go","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":27,"mirror_url":null,"archived":false,"open_issues_count":38,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0","node_id":"MDc6TGljZW5zZTI="},"forks":27,"open_issues":38,"watchers":173,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/uswitch/kiam/pulls/109"},"html":{"href":"https://github.com/uswitch/kiam/pull/109"},"issue":{"href":"https://api.github.com/repos/uswitch/kiam/issues/109"},"comments":{"href":"https://api.github.com/repos/uswitch/kiam/issues/109/comments"},"review_comments":{"href":"https://api.github.com/repos/uswitch/kiam/pulls/109/comments"},"review_comment":{"href":"https://api.github.com/repos/uswitch/kiam/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/uswitch/kiam/pulls/109/commits"},"statuses":{"href":"https://api.github.com/repos/uswitch/kiam/statuses/d6bb82d80c9124634baa91beaf44e239c525dd0e"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"pingles"}}