{"action":"created","comment":{"url":"https://api.github.com/repos/hashicorp/vault/pulls/comments/50443648","id":50443648,"diff_hunk":"@@ -123,6 +173,16 @@ func (b *backend) secretAccessKeysRenew(\n func secretAccessKeysRevoke(\n \treq *logical.Request, d *framework.FieldData) (*logical.Response, error) {\n \t// Get the username from the internal data\n+\tisSTS, ok := req.Secret.InternalData[\"is_sts\"]\n+\tif !ok {\n+\t\treturn nil, fmt.Errorf(\"secret is missing is_sts internal data\")\n+\t}\n+\n+\t// STS cleans up after itself\n+\tif isSTS.(bool) {","path":"builtin/logical/aws/secret_access_keys.go","position":95,"original_position":95,"commit_id":"06f42e6f621adb9d8da1ac7012a6824be98bb9a4","original_commit_id":"06f42e6f621adb9d8da1ac7012a6824be98bb9a4","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":"This can panic if, for some reason, it's not a bool. I think the best thing to do would be instantiate a bool var (with it defaulting to nil), then use the `isSTS, ok := req.Secret.InternalData[\"is_sts\"]` call to drop into this check if `ok` is true. Use the dual-value version here. So something like (not tested/checked):\r\n```\r\nstsInt, ok := req.Secret.InternalData[\"is_sts\"]\r\nif ok {\r\n  isSTS, ok = stsInt.(bool)\r\n  if ok {\r\n    if isSTS {\r\n      return nil, nil\r\n    } // else, it was set, but not to true, so treat it as IAM by falling through\r\n  } else {\r\n    return nil, fmt.Errorf(\"secret has is_sts but value could not be understood\")\r\n  }\r\n}","created_at":"2016-01-21T18:45:07Z","updated_at":"2016-01-21T18:45:07Z","html_url":"https://github.com/hashicorp/vault/pull/927#discussion_r50443648","pull_request_url":"https://api.github.com/repos/hashicorp/vault/pulls/927","_links":{"self":{"href":"https://api.github.com/repos/hashicorp/vault/pulls/comments/50443648"},"html":{"href":"https://github.com/hashicorp/vault/pull/927#discussion_r50443648"},"pull_request":{"href":"https://api.github.com/repos/hashicorp/vault/pulls/927"}}},"pull_request":{"url":"https://api.github.com/repos/hashicorp/vault/pulls/927","id":55933740,"html_url":"https://github.com/hashicorp/vault/pull/927","diff_url":"https://github.com/hashicorp/vault/pull/927.diff","patch_url":"https://github.com/hashicorp/vault/pull/927.patch","issue_url":"https://api.github.com/repos/hashicorp/vault/issues/927","number":927,"state":"open","locked":false,"title":"Adding STS to the aws backend ","user":{"login":"dgromov","id":2321490,"avatar_url":"https://avatars.githubusercontent.com/u/2321490?v=3","gravatar_id":"","url":"https://api.github.com/users/dgromov","html_url":"https://github.com/dgromov","followers_url":"https://api.github.com/users/dgromov/followers","following_url":"https://api.github.com/users/dgromov/following{/other_user}","gists_url":"https://api.github.com/users/dgromov/gists{/gist_id}","starred_url":"https://api.github.com/users/dgromov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dgromov/subscriptions","organizations_url":"https://api.github.com/users/dgromov/orgs","repos_url":"https://api.github.com/users/dgromov/repos","events_url":"https://api.github.com/users/dgromov/events{/privacy}","received_events_url":"https://api.github.com/users/dgromov/received_events","type":"User","site_admin":false},"body":"Added an /sts endpoint to the aws backend that can pull down sts credentials. The logic is very similar to the existing iam credentials logic but the keys provided are ready to use immediately. \r\n\r\nRelated: \r\nhttps://github.com/hashicorp/vault/issues/687\r\nhttps://github.com/hashicorp/vault/issues/295","created_at":"2016-01-13T18:07:06Z","updated_at":"2016-01-21T18:45:07Z","closed_at":null,"merged_at":null,"merge_commit_sha":"2d61f1942fd45d9093bfe59f773ee46207000a7f","assignee":null,"milestone":{"url":"https://api.github.com/repos/hashicorp/vault/milestones/5","html_url":"https://github.com/hashicorp/vault/milestones/0.5.0","labels_url":"https://api.github.com/repos/hashicorp/vault/milestones/5/labels","id":1381611,"number":5,"title":"0.5.0","description":null,"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":8,"closed_issues":10,"state":"open","created_at":"2015-10-28T15:09:50Z","updated_at":"2016-01-21T16:46:25Z","due_on":null,"closed_at":null},"commits_url":"https://api.github.com/repos/hashicorp/vault/pulls/927/commits","review_comments_url":"https://api.github.com/repos/hashicorp/vault/pulls/927/comments","review_comment_url":"https://api.github.com/repos/hashicorp/vault/pulls/comments{/number}","comments_url":"https://api.github.com/repos/hashicorp/vault/issues/927/comments","statuses_url":"https://api.github.com/repos/hashicorp/vault/statuses/06f42e6f621adb9d8da1ac7012a6824be98bb9a4","head":{"label":"urq:feature-sts","ref":"feature-sts","sha":"06f42e6f621adb9d8da1ac7012a6824be98bb9a4","user":{"login":"urq","id":6525683,"avatar_url":"https://avatars.githubusercontent.com/u/6525683?v=3","gravatar_id":"","url":"https://api.github.com/users/urq","html_url":"https://github.com/urq","followers_url":"https://api.github.com/users/urq/followers","following_url":"https://api.github.com/users/urq/following{/other_user}","gists_url":"https://api.github.com/users/urq/gists{/gist_id}","starred_url":"https://api.github.com/users/urq/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/urq/subscriptions","organizations_url":"https://api.github.com/users/urq/orgs","repos_url":"https://api.github.com/users/urq/repos","events_url":"https://api.github.com/users/urq/events{/privacy}","received_events_url":"https://api.github.com/users/urq/received_events","type":"User","site_admin":false},"repo":{"id":47598857,"name":"vault","full_name":"urq/vault","owner":{"login":"urq","id":6525683,"avatar_url":"https://avatars.githubusercontent.com/u/6525683?v=3","gravatar_id":"","url":"https://api.github.com/users/urq","html_url":"https://github.com/urq","followers_url":"https://api.github.com/users/urq/followers","following_url":"https://api.github.com/users/urq/following{/other_user}","gists_url":"https://api.github.com/users/urq/gists{/gist_id}","starred_url":"https://api.github.com/users/urq/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/urq/subscriptions","organizations_url":"https://api.github.com/users/urq/orgs","repos_url":"https://api.github.com/users/urq/repos","events_url":"https://api.github.com/users/urq/events{/privacy}","received_events_url":"https://api.github.com/users/urq/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/urq/vault","description":"A tool for managing secrets.","fork":true,"url":"https://api.github.com/repos/urq/vault","forks_url":"https://api.github.com/repos/urq/vault/forks","keys_url":"https://api.github.com/repos/urq/vault/keys{/key_id}","collaborators_url":"https://api.github.com/repos/urq/vault/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/urq/vault/teams","hooks_url":"https://api.github.com/repos/urq/vault/hooks","issue_events_url":"https://api.github.com/repos/urq/vault/issues/events{/number}","events_url":"https://api.github.com/repos/urq/vault/events","assignees_url":"https://api.github.com/repos/urq/vault/assignees{/user}","branches_url":"https://api.github.com/repos/urq/vault/branches{/branch}","tags_url":"https://api.github.com/repos/urq/vault/tags","blobs_url":"https://api.github.com/repos/urq/vault/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/urq/vault/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/urq/vault/git/refs{/sha}","trees_url":"https://api.github.com/repos/urq/vault/git/trees{/sha}","statuses_url":"https://api.github.com/repos/urq/vault/statuses/{sha}","languages_url":"https://api.github.com/repos/urq/vault/languages","stargazers_url":"https://api.github.com/repos/urq/vault/stargazers","contributors_url":"https://api.github.com/repos/urq/vault/contributors","subscribers_url":"https://api.github.com/repos/urq/vault/subscribers","subscription_url":"https://api.github.com/repos/urq/vault/subscription","commits_url":"https://api.github.com/repos/urq/vault/commits{/sha}","git_commits_url":"https://api.github.com/repos/urq/vault/git/commits{/sha}","comments_url":"https://api.github.com/repos/urq/vault/comments{/number}","issue_comment_url":"https://api.github.com/repos/urq/vault/issues/comments{/number}","contents_url":"https://api.github.com/repos/urq/vault/contents/{+path}","compare_url":"https://api.github.com/repos/urq/vault/compare/{base}...{head}","merges_url":"https://api.github.com/repos/urq/vault/merges","archive_url":"https://api.github.com/repos/urq/vault/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/urq/vault/downloads","issues_url":"https://api.github.com/repos/urq/vault/issues{/number}","pulls_url":"https://api.github.com/repos/urq/vault/pulls{/number}","milestones_url":"https://api.github.com/repos/urq/vault/milestones{/number}","notifications_url":"https://api.github.com/repos/urq/vault/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/urq/vault/labels{/name}","releases_url":"https://api.github.com/repos/urq/vault/releases{/id}","created_at":"2015-12-08T04:37:18Z","updated_at":"2015-12-08T04:37:19Z","pushed_at":"2016-01-19T13:25:06Z","git_url":"git://github.com/urq/vault.git","ssh_url":"git@github.com:urq/vault.git","clone_url":"https://github.com/urq/vault.git","svn_url":"https://github.com/urq/vault","homepage":"http://vaultproject.io","size":9243,"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":"3d7947b05bc391e6d6ccd012800e84d289baaa6f","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}","created_at":"2015-02-25T00:15:59Z","updated_at":"2016-01-21T15:48:56Z","pushed_at":"2016-01-21T18:23:38Z","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":"http://vaultproject.io","size":10542,"stargazers_count":3944,"watchers_count":3944,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":318,"mirror_url":null,"open_issues_count":151,"forks":318,"open_issues":151,"watchers":3944,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/hashicorp/vault/pulls/927"},"html":{"href":"https://github.com/hashicorp/vault/pull/927"},"issue":{"href":"https://api.github.com/repos/hashicorp/vault/issues/927"},"comments":{"href":"https://api.github.com/repos/hashicorp/vault/issues/927/comments"},"review_comments":{"href":"https://api.github.com/repos/hashicorp/vault/pulls/927/comments"},"review_comment":{"href":"https://api.github.com/repos/hashicorp/vault/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/hashicorp/vault/pulls/927/commits"},"statuses":{"href":"https://api.github.com/repos/hashicorp/vault/statuses/06f42e6f621adb9d8da1ac7012a6824be98bb9a4"}}}}