{"action":"created","comment":{"url":"https://api.github.com/repos/hashicorp/vault/pulls/comments/92087503","pull_request_review_id":12596568,"id":92087503,"diff_hunk":"@@ -0,0 +1,376 @@\n+package awsiam\n+\n+import (\n+\t\"encoding/base64\"\n+\t\"encoding/xml\"\n+\t\"fmt\"\n+\t\"io/ioutil\"\n+\t\"net/http\"\n+\t\"net/url\"\n+\t\"regexp\"\n+\t\"strings\"\n+\t\"time\"\n+\n+\t//\"github.com/hashicorp/vault/helper/policyutil\"\n+\t\"github.com/hashicorp/vault/helper/jsonutil\"\n+\t\"github.com/hashicorp/vault/logical\"\n+\t\"github.com/hashicorp/vault/logical/framework\"\n+)\n+\n+func pathLogin(b *backend) *framework.Path {\n+\treturn &framework.Path{\n+\t\tPattern: \"login$\",\n+\t\tFields: map[string]*framework.FieldSchema{\n+\t\t\t\"role\": &framework.FieldSchema{\n+\t\t\t\tType: framework.TypeString,\n+\t\t\t\tDescription: `Name of the role against which the login is being attempted.\n+If 'role' is not specified, then the login endpoint looks for a role\n+bearing the name of the IAM principal that is trying to login in.\n+If a matching role is not found, the login fails.`,\n+\t\t\t},\n+\t\t\t\"method\": &framework.FieldSchema{\n+\t\t\t\tType: framework.TypeString,\n+\t\t\t\tDescription: `HTTP method to use for the AWS request. This must match what\n+has been signed in the presigned request. Currently, POST is the only supported value`,\n+\t\t\t},\n+\t\t\t\"url\": &framework.FieldSchema{\n+\t\t\t\tType: framework.TypeString,\n+\t\t\t\tDescription: `Full URL against which to make the AWS request. If using a POST\n+request with the action specified in the body, this should just be\n+\"/\".`,\n+\t\t\t},\n+\t\t\t\"body\": &framework.FieldSchema{\n+\t\t\t\tType: framework.TypeString,\n+\t\t\t\tDescription: `Base64-encoded request body. This must match the request\n+body included in the signature.`,\n+\t\t\t},\n+\t\t\t\"headers\": &framework.FieldSchema{\n+\t\t\t\tType: framework.TypeString,\n+\t\t\t\tDescription: `Base64-encoded JSON representation of the request headers.\n+This must at a minimum include the headers over which AWS has included a\n+signature.`,\n+\t\t\t},\n+\t\t},\n+\n+\t\tCallbacks: map[logical.Operation]framework.OperationFunc{\n+\t\t\tlogical.UpdateOperation: b.pathLoginUpdate,\n+\t\t},\n+\n+\t\tHelpSynopsis:    pathLoginSyn,\n+\t\tHelpDescription: pathLoginDesc,\n+\t}\n+}\n+\n+func (b *backend) pathLoginUpdate(\n+\treq *logical.Request, data *framework.FieldData) (*logical.Response, error) {\n+\n+\t// BEGIN boring data parsing\n+\tmethod := data.Get(\"method\").(string)\n+\tif method == \"\" {\n+\t\treturn logical.ErrorResponse(\"missing method\"), nil\n+\t}\n+\n+\t// In the future, might consider supporting GET\n+\tif method != \"POST\" {\n+\t\treturn logical.ErrorResponse(\"Invalid method; currently only 'POST' is supported\"), nil\n+\t}\n+\n+\trawUrl := data.Get(\"url\").(string)\n+\tif rawUrl == \"\" {\n+\t\treturn logical.ErrorResponse(\"missing url\"), nil\n+\t}\n+\tparsedUrl, err := url.Parse(rawUrl)\n+\tif err != nil {\n+\t\treturn logical.ErrorResponse(\"error parsing url\"), nil\n+\t}\n+\n+\t// TODO: There are two potentially valid cases we're not yet supporting that would\n+\t// necessitate this check being changed. First, if we support GET requests.\n+\t// Second if we support presigned POST requests","path":"builtin/credential/aws-iam/path_login.go","position":89,"original_position":89,"commit_id":"57d1ceff7ef17d5e1998762b88afad0c5adbff0b","original_commit_id":"bb2fae0aad3d2dafd029eef571a0429b352b706e","user":{"login":"jefferai","id":28627,"avatar_url":"https://avatars.githubusercontent.com/u/28627?v=3","gravatar_id":"","url":"https://api.github.com/users/jefferai","html_url":"https://github.com/jefferai","followers_url":"https://api.github.com/users/jefferai/followers","following_url":"https://api.github.com/users/jefferai/following{/other_user}","gists_url":"https://api.github.com/users/jefferai/gists{/gist_id}","starred_url":"https://api.github.com/users/jefferai/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jefferai/subscriptions","organizations_url":"https://api.github.com/users/jefferai/orgs","repos_url":"https://api.github.com/users/jefferai/repos","events_url":"https://api.github.com/users/jefferai/events{/privacy}","received_events_url":"https://api.github.com/users/jefferai/received_events","type":"User","site_admin":false},"body":"OK. So, seems like this is good for now!","created_at":"2016-12-13T02:33:44Z","updated_at":"2016-12-13T02:33:44Z","html_url":"https://github.com/hashicorp/vault/pull/1962#discussion_r92087503","pull_request_url":"https://api.github.com/repos/hashicorp/vault/pulls/1962","_links":{"self":{"href":"https://api.github.com/repos/hashicorp/vault/pulls/comments/92087503"},"html":{"href":"https://github.com/hashicorp/vault/pull/1962#discussion_r92087503"},"pull_request":{"href":"https://api.github.com/repos/hashicorp/vault/pulls/1962"}}},"pull_request":{"url":"https://api.github.com/repos/hashicorp/vault/pulls/1962","id":87825405,"html_url":"https://github.com/hashicorp/vault/pull/1962","diff_url":"https://github.com/hashicorp/vault/pull/1962.diff","patch_url":"https://github.com/hashicorp/vault/pull/1962.patch","issue_url":"https://api.github.com/repos/hashicorp/vault/issues/1962","number":1962,"state":"open","locked":false,"title":"Add new aws-iam authentication backend","user":{"login":"joelthompson","id":1562980,"avatar_url":"https://avatars.githubusercontent.com/u/1562980?v=3","gravatar_id":"","url":"https://api.github.com/users/joelthompson","html_url":"https://github.com/joelthompson","followers_url":"https://api.github.com/users/joelthompson/followers","following_url":"https://api.github.com/users/joelthompson/following{/other_user}","gists_url":"https://api.github.com/users/joelthompson/gists{/gist_id}","starred_url":"https://api.github.com/users/joelthompson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/joelthompson/subscriptions","organizations_url":"https://api.github.com/users/joelthompson/orgs","repos_url":"https://api.github.com/users/joelthompson/repos","events_url":"https://api.github.com/users/joelthompson/events{/privacy}","received_events_url":"https://api.github.com/users/joelthompson/received_events","type":"User","site_admin":false},"body":"The aws-iam authentication backend is able to validate arbitrary\nAWS IAM principals against AWS. It does this by receiving a signed AWS\nSTS GetCallerIdentity request and forwarding that on to AWS. AWS will\nvalidate the request and return the principal, which allows Vault to\nthen map the caller to a set of policies.\n\nMany thanks to @copumpkin for his feedback in reviewing this thus far!\n","created_at":"2016-10-04T02:44:21Z","updated_at":"2016-12-13T02:33:44Z","closed_at":null,"merged_at":null,"merge_commit_sha":"7641a5458a07c6e0f1f7ff97ac2cb9db9b80bc86","assignee":null,"assignees":[],"milestone":{"url":"https://api.github.com/repos/hashicorp/vault/milestones/14","html_url":"https://github.com/hashicorp/vault/milestone/14","labels_url":"https://api.github.com/repos/hashicorp/vault/milestones/14/labels","id":2095787,"number":14,"title":"0.6.4","description":"","creator":{"login":"jefferai","id":28627,"avatar_url":"https://avatars.githubusercontent.com/u/28627?v=3","gravatar_id":"","url":"https://api.github.com/users/jefferai","html_url":"https://github.com/jefferai","followers_url":"https://api.github.com/users/jefferai/followers","following_url":"https://api.github.com/users/jefferai/following{/other_user}","gists_url":"https://api.github.com/users/jefferai/gists{/gist_id}","starred_url":"https://api.github.com/users/jefferai/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jefferai/subscriptions","organizations_url":"https://api.github.com/users/jefferai/orgs","repos_url":"https://api.github.com/users/jefferai/repos","events_url":"https://api.github.com/users/jefferai/events{/privacy}","received_events_url":"https://api.github.com/users/jefferai/received_events","type":"User","site_admin":false},"open_issues":18,"closed_issues":0,"state":"open","created_at":"2016-10-26T20:15:12Z","updated_at":"2016-12-09T22:06:56Z","due_on":null,"closed_at":null},"commits_url":"https://api.github.com/repos/hashicorp/vault/pulls/1962/commits","review_comments_url":"https://api.github.com/repos/hashicorp/vault/pulls/1962/comments","review_comment_url":"https://api.github.com/repos/hashicorp/vault/pulls/comments{/number}","comments_url":"https://api.github.com/repos/hashicorp/vault/issues/1962/comments","statuses_url":"https://api.github.com/repos/hashicorp/vault/statuses/57d1ceff7ef17d5e1998762b88afad0c5adbff0b","head":{"label":"joelthompson:feature/aws-iam","ref":"feature/aws-iam","sha":"57d1ceff7ef17d5e1998762b88afad0c5adbff0b","user":{"login":"joelthompson","id":1562980,"avatar_url":"https://avatars.githubusercontent.com/u/1562980?v=3","gravatar_id":"","url":"https://api.github.com/users/joelthompson","html_url":"https://github.com/joelthompson","followers_url":"https://api.github.com/users/joelthompson/followers","following_url":"https://api.github.com/users/joelthompson/following{/other_user}","gists_url":"https://api.github.com/users/joelthompson/gists{/gist_id}","starred_url":"https://api.github.com/users/joelthompson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/joelthompson/subscriptions","organizations_url":"https://api.github.com/users/joelthompson/orgs","repos_url":"https://api.github.com/users/joelthompson/repos","events_url":"https://api.github.com/users/joelthompson/events{/privacy}","received_events_url":"https://api.github.com/users/joelthompson/received_events","type":"User","site_admin":false},"repo":{"id":69929007,"name":"vault","full_name":"joelthompson/vault","owner":{"login":"joelthompson","id":1562980,"avatar_url":"https://avatars.githubusercontent.com/u/1562980?v=3","gravatar_id":"","url":"https://api.github.com/users/joelthompson","html_url":"https://github.com/joelthompson","followers_url":"https://api.github.com/users/joelthompson/followers","following_url":"https://api.github.com/users/joelthompson/following{/other_user}","gists_url":"https://api.github.com/users/joelthompson/gists{/gist_id}","starred_url":"https://api.github.com/users/joelthompson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/joelthompson/subscriptions","organizations_url":"https://api.github.com/users/joelthompson/orgs","repos_url":"https://api.github.com/users/joelthompson/repos","events_url":"https://api.github.com/users/joelthompson/events{/privacy}","received_events_url":"https://api.github.com/users/joelthompson/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/joelthompson/vault","description":"A tool for managing secrets.","fork":true,"url":"https://api.github.com/repos/joelthompson/vault","forks_url":"https://api.github.com/repos/joelthompson/vault/forks","keys_url":"https://api.github.com/repos/joelthompson/vault/keys{/key_id}","collaborators_url":"https://api.github.com/repos/joelthompson/vault/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/joelthompson/vault/teams","hooks_url":"https://api.github.com/repos/joelthompson/vault/hooks","issue_events_url":"https://api.github.com/repos/joelthompson/vault/issues/events{/number}","events_url":"https://api.github.com/repos/joelthompson/vault/events","assignees_url":"https://api.github.com/repos/joelthompson/vault/assignees{/user}","branches_url":"https://api.github.com/repos/joelthompson/vault/branches{/branch}","tags_url":"https://api.github.com/repos/joelthompson/vault/tags","blobs_url":"https://api.github.com/repos/joelthompson/vault/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/joelthompson/vault/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/joelthompson/vault/git/refs{/sha}","trees_url":"https://api.github.com/repos/joelthompson/vault/git/trees{/sha}","statuses_url":"https://api.github.com/repos/joelthompson/vault/statuses/{sha}","languages_url":"https://api.github.com/repos/joelthompson/vault/languages","stargazers_url":"https://api.github.com/repos/joelthompson/vault/stargazers","contributors_url":"https://api.github.com/repos/joelthompson/vault/contributors","subscribers_url":"https://api.github.com/repos/joelthompson/vault/subscribers","subscription_url":"https://api.github.com/repos/joelthompson/vault/subscription","commits_url":"https://api.github.com/repos/joelthompson/vault/commits{/sha}","git_commits_url":"https://api.github.com/repos/joelthompson/vault/git/commits{/sha}","comments_url":"https://api.github.com/repos/joelthompson/vault/comments{/number}","issue_comment_url":"https://api.github.com/repos/joelthompson/vault/issues/comments{/number}","contents_url":"https://api.github.com/repos/joelthompson/vault/contents/{+path}","compare_url":"https://api.github.com/repos/joelthompson/vault/compare/{base}...{head}","merges_url":"https://api.github.com/repos/joelthompson/vault/merges","archive_url":"https://api.github.com/repos/joelthompson/vault/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/joelthompson/vault/downloads","issues_url":"https://api.github.com/repos/joelthompson/vault/issues{/number}","pulls_url":"https://api.github.com/repos/joelthompson/vault/pulls{/number}","milestones_url":"https://api.github.com/repos/joelthompson/vault/milestones{/number}","notifications_url":"https://api.github.com/repos/joelthompson/vault/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/joelthompson/vault/labels{/name}","releases_url":"https://api.github.com/repos/joelthompson/vault/releases{/id}","deployments_url":"https://api.github.com/repos/joelthompson/vault/deployments","created_at":"2016-10-04T02:41:20Z","updated_at":"2016-10-04T02:41:22Z","pushed_at":"2016-12-08T03:29:29Z","git_url":"git://github.com/joelthompson/vault.git","ssh_url":"git@github.com:joelthompson/vault.git","clone_url":"https://github.com/joelthompson/vault.git","svn_url":"https://github.com/joelthompson/vault","homepage":"https://www.vaultproject.io/","size":18864,"stargazers_count":0,"watchers_count":0,"language":"Go","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"hashicorp:master","ref":"master","sha":"b8c492f8c608cc5e402803e8d9f6fb5794c09276","user":{"login":"hashicorp","id":761456,"avatar_url":"https://avatars.githubusercontent.com/u/761456?v=3","gravatar_id":"","url":"https://api.github.com/users/hashicorp","html_url":"https://github.com/hashicorp","followers_url":"https://api.github.com/users/hashicorp/followers","following_url":"https://api.github.com/users/hashicorp/following{/other_user}","gists_url":"https://api.github.com/users/hashicorp/gists{/gist_id}","starred_url":"https://api.github.com/users/hashicorp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hashicorp/subscriptions","organizations_url":"https://api.github.com/users/hashicorp/orgs","repos_url":"https://api.github.com/users/hashicorp/repos","events_url":"https://api.github.com/users/hashicorp/events{/privacy}","received_events_url":"https://api.github.com/users/hashicorp/received_events","type":"Organization","site_admin":false},"repo":{"id":31288958,"name":"vault","full_name":"hashicorp/vault","owner":{"login":"hashicorp","id":761456,"avatar_url":"https://avatars.githubusercontent.com/u/761456?v=3","gravatar_id":"","url":"https://api.github.com/users/hashicorp","html_url":"https://github.com/hashicorp","followers_url":"https://api.github.com/users/hashicorp/followers","following_url":"https://api.github.com/users/hashicorp/following{/other_user}","gists_url":"https://api.github.com/users/hashicorp/gists{/gist_id}","starred_url":"https://api.github.com/users/hashicorp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hashicorp/subscriptions","organizations_url":"https://api.github.com/users/hashicorp/orgs","repos_url":"https://api.github.com/users/hashicorp/repos","events_url":"https://api.github.com/users/hashicorp/events{/privacy}","received_events_url":"https://api.github.com/users/hashicorp/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/hashicorp/vault","description":"A tool for managing secrets.","fork":false,"url":"https://api.github.com/repos/hashicorp/vault","forks_url":"https://api.github.com/repos/hashicorp/vault/forks","keys_url":"https://api.github.com/repos/hashicorp/vault/keys{/key_id}","collaborators_url":"https://api.github.com/repos/hashicorp/vault/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/hashicorp/vault/teams","hooks_url":"https://api.github.com/repos/hashicorp/vault/hooks","issue_events_url":"https://api.github.com/repos/hashicorp/vault/issues/events{/number}","events_url":"https://api.github.com/repos/hashicorp/vault/events","assignees_url":"https://api.github.com/repos/hashicorp/vault/assignees{/user}","branches_url":"https://api.github.com/repos/hashicorp/vault/branches{/branch}","tags_url":"https://api.github.com/repos/hashicorp/vault/tags","blobs_url":"https://api.github.com/repos/hashicorp/vault/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/hashicorp/vault/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/hashicorp/vault/git/refs{/sha}","trees_url":"https://api.github.com/repos/hashicorp/vault/git/trees{/sha}","statuses_url":"https://api.github.com/repos/hashicorp/vault/statuses/{sha}","languages_url":"https://api.github.com/repos/hashicorp/vault/languages","stargazers_url":"https://api.github.com/repos/hashicorp/vault/stargazers","contributors_url":"https://api.github.com/repos/hashicorp/vault/contributors","subscribers_url":"https://api.github.com/repos/hashicorp/vault/subscribers","subscription_url":"https://api.github.com/repos/hashicorp/vault/subscription","commits_url":"https://api.github.com/repos/hashicorp/vault/commits{/sha}","git_commits_url":"https://api.github.com/repos/hashicorp/vault/git/commits{/sha}","comments_url":"https://api.github.com/repos/hashicorp/vault/comments{/number}","issue_comment_url":"https://api.github.com/repos/hashicorp/vault/issues/comments{/number}","contents_url":"https://api.github.com/repos/hashicorp/vault/contents/{+path}","compare_url":"https://api.github.com/repos/hashicorp/vault/compare/{base}...{head}","merges_url":"https://api.github.com/repos/hashicorp/vault/merges","archive_url":"https://api.github.com/repos/hashicorp/vault/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/hashicorp/vault/downloads","issues_url":"https://api.github.com/repos/hashicorp/vault/issues{/number}","pulls_url":"https://api.github.com/repos/hashicorp/vault/pulls{/number}","milestones_url":"https://api.github.com/repos/hashicorp/vault/milestones{/number}","notifications_url":"https://api.github.com/repos/hashicorp/vault/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/hashicorp/vault/labels{/name}","releases_url":"https://api.github.com/repos/hashicorp/vault/releases{/id}","deployments_url":"https://api.github.com/repos/hashicorp/vault/deployments","created_at":"2015-02-25T00:15:59Z","updated_at":"2016-12-12T22:58:50Z","pushed_at":"2016-12-12T19:44:45Z","git_url":"git://github.com/hashicorp/vault.git","ssh_url":"git@github.com:hashicorp/vault.git","clone_url":"https://github.com/hashicorp/vault.git","svn_url":"https://github.com/hashicorp/vault","homepage":"https://www.vaultproject.io/","size":22450,"stargazers_count":5844,"watchers_count":5844,"language":"Go","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":686,"mirror_url":null,"open_issues_count":209,"forks":686,"open_issues":209,"watchers":5844,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/hashicorp/vault/pulls/1962"},"html":{"href":"https://github.com/hashicorp/vault/pull/1962"},"issue":{"href":"https://api.github.com/repos/hashicorp/vault/issues/1962"},"comments":{"href":"https://api.github.com/repos/hashicorp/vault/issues/1962/comments"},"review_comments":{"href":"https://api.github.com/repos/hashicorp/vault/pulls/1962/comments"},"review_comment":{"href":"https://api.github.com/repos/hashicorp/vault/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/hashicorp/vault/pulls/1962/commits"},"statuses":{"href":"https://api.github.com/repos/hashicorp/vault/statuses/57d1ceff7ef17d5e1998762b88afad0c5adbff0b"}}}}
{"actor":{"display_login":"jefferai"}}