{"action":"created","comment":{"url":"https://api.github.com/repos/fugue/credstash/pulls/comments/83032790","pull_request_review_id":3899447,"id":83032790,"diff_hunk":"@@ -220,15 +220,48 @@ def putSecret(name, secret, version=\"\", kms_key=\"alias/credstash\",\n     put a secret called `name` into the secret-store,\n     protected by the key kms_key\n     '''\n+    session = get_session(**kwargs)\n+\n+    key, contents, hmac = encrypt(","path":"credstash.py","position":6,"original_position":6,"commit_id":"49ef642b08d6f46b1451e19d146bcbbc3dd73850","original_commit_id":"49ef642b08d6f46b1451e19d146bcbbc3dd73850","user":{"login":"jessemyers","id":477722,"avatar_url":"https://avatars.githubusercontent.com/u/477722?v=3","gravatar_id":"","url":"https://api.github.com/users/jessemyers","html_url":"https://github.com/jessemyers","followers_url":"https://api.github.com/users/jessemyers/followers","following_url":"https://api.github.com/users/jessemyers/following{/other_user}","gists_url":"https://api.github.com/users/jessemyers/gists{/gist_id}","starred_url":"https://api.github.com/users/jessemyers/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jessemyers/subscriptions","organizations_url":"https://api.github.com/users/jessemyers/orgs","repos_url":"https://api.github.com/users/jessemyers/repos","events_url":"https://api.github.com/users/jessemyers/events{/privacy}","received_events_url":"https://api.github.com/users/jessemyers/received_events","type":"User","site_admin":false},"body":"The main change in this function is that we call `encrypt` in the middle and use its results rather than performing encryption inline.","created_at":"2016-10-12T15:33:44Z","updated_at":"2016-10-12T15:33:44Z","html_url":"https://github.com/fugue/credstash/pull/107#discussion_r83032790","pull_request_url":"https://api.github.com/repos/fugue/credstash/pulls/107","_links":{"self":{"href":"https://api.github.com/repos/fugue/credstash/pulls/comments/83032790"},"html":{"href":"https://github.com/fugue/credstash/pull/107#discussion_r83032790"},"pull_request":{"href":"https://api.github.com/repos/fugue/credstash/pulls/107"}}},"pull_request":{"url":"https://api.github.com/repos/fugue/credstash/pulls/107","id":89038851,"html_url":"https://github.com/fugue/credstash/pull/107","diff_url":"https://github.com/fugue/credstash/pull/107.diff","patch_url":"https://github.com/fugue/credstash/pull/107.patch","issue_url":"https://api.github.com/repos/fugue/credstash/issues/107","number":107,"state":"open","locked":false,"title":"Factor out encrypt and decrypt functions.","user":{"login":"jessemyers","id":477722,"avatar_url":"https://avatars.githubusercontent.com/u/477722?v=3","gravatar_id":"","url":"https://api.github.com/users/jessemyers","html_url":"https://github.com/jessemyers","followers_url":"https://api.github.com/users/jessemyers/followers","following_url":"https://api.github.com/users/jessemyers/following{/other_user}","gists_url":"https://api.github.com/users/jessemyers/gists{/gist_id}","starred_url":"https://api.github.com/users/jessemyers/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jessemyers/subscriptions","organizations_url":"https://api.github.com/users/jessemyers/orgs","repos_url":"https://api.github.com/users/jessemyers/repos","events_url":"https://api.github.com/users/jessemyers/events{/privacy}","received_events_url":"https://api.github.com/users/jessemyers/received_events","type":"User","site_admin":false},"body":"We are integrating credstash logic into our application stack so we can load runtime\r\nconfiguration from encrypted DynamoDB storage. Since the credstash tool is designed\r\nprimarily as a CLI, we've had to duplicate credstash logic in our application code.\r\n\r\nIn this PR, I'm attempting to factor out the `encrypt` and `decrypt` operations so\r\nwe can use them directly with credstash as a library.","created_at":"2016-10-12T15:32:45Z","updated_at":"2016-10-12T15:33:44Z","closed_at":null,"merged_at":null,"merge_commit_sha":"c570719a0cfe97cbe29bf958b522af407667f408","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/fugue/credstash/pulls/107/commits","review_comments_url":"https://api.github.com/repos/fugue/credstash/pulls/107/comments","review_comment_url":"https://api.github.com/repos/fugue/credstash/pulls/comments{/number}","comments_url":"https://api.github.com/repos/fugue/credstash/issues/107/comments","statuses_url":"https://api.github.com/repos/fugue/credstash/statuses/49ef642b08d6f46b1451e19d146bcbbc3dd73850","head":{"label":"jessemyers:programmatic-api","ref":"programmatic-api","sha":"49ef642b08d6f46b1451e19d146bcbbc3dd73850","user":{"login":"jessemyers","id":477722,"avatar_url":"https://avatars.githubusercontent.com/u/477722?v=3","gravatar_id":"","url":"https://api.github.com/users/jessemyers","html_url":"https://github.com/jessemyers","followers_url":"https://api.github.com/users/jessemyers/followers","following_url":"https://api.github.com/users/jessemyers/following{/other_user}","gists_url":"https://api.github.com/users/jessemyers/gists{/gist_id}","starred_url":"https://api.github.com/users/jessemyers/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jessemyers/subscriptions","organizations_url":"https://api.github.com/users/jessemyers/orgs","repos_url":"https://api.github.com/users/jessemyers/repos","events_url":"https://api.github.com/users/jessemyers/events{/privacy}","received_events_url":"https://api.github.com/users/jessemyers/received_events","type":"User","site_admin":false},"repo":{"id":66680998,"name":"credstash","full_name":"jessemyers/credstash","owner":{"login":"jessemyers","id":477722,"avatar_url":"https://avatars.githubusercontent.com/u/477722?v=3","gravatar_id":"","url":"https://api.github.com/users/jessemyers","html_url":"https://github.com/jessemyers","followers_url":"https://api.github.com/users/jessemyers/followers","following_url":"https://api.github.com/users/jessemyers/following{/other_user}","gists_url":"https://api.github.com/users/jessemyers/gists{/gist_id}","starred_url":"https://api.github.com/users/jessemyers/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jessemyers/subscriptions","organizations_url":"https://api.github.com/users/jessemyers/orgs","repos_url":"https://api.github.com/users/jessemyers/repos","events_url":"https://api.github.com/users/jessemyers/events{/privacy}","received_events_url":"https://api.github.com/users/jessemyers/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/jessemyers/credstash","description":"A little utility for managing credentials in the cloud","fork":true,"url":"https://api.github.com/repos/jessemyers/credstash","forks_url":"https://api.github.com/repos/jessemyers/credstash/forks","keys_url":"https://api.github.com/repos/jessemyers/credstash/keys{/key_id}","collaborators_url":"https://api.github.com/repos/jessemyers/credstash/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/jessemyers/credstash/teams","hooks_url":"https://api.github.com/repos/jessemyers/credstash/hooks","issue_events_url":"https://api.github.com/repos/jessemyers/credstash/issues/events{/number}","events_url":"https://api.github.com/repos/jessemyers/credstash/events","assignees_url":"https://api.github.com/repos/jessemyers/credstash/assignees{/user}","branches_url":"https://api.github.com/repos/jessemyers/credstash/branches{/branch}","tags_url":"https://api.github.com/repos/jessemyers/credstash/tags","blobs_url":"https://api.github.com/repos/jessemyers/credstash/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/jessemyers/credstash/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/jessemyers/credstash/git/refs{/sha}","trees_url":"https://api.github.com/repos/jessemyers/credstash/git/trees{/sha}","statuses_url":"https://api.github.com/repos/jessemyers/credstash/statuses/{sha}","languages_url":"https://api.github.com/repos/jessemyers/credstash/languages","stargazers_url":"https://api.github.com/repos/jessemyers/credstash/stargazers","contributors_url":"https://api.github.com/repos/jessemyers/credstash/contributors","subscribers_url":"https://api.github.com/repos/jessemyers/credstash/subscribers","subscription_url":"https://api.github.com/repos/jessemyers/credstash/subscription","commits_url":"https://api.github.com/repos/jessemyers/credstash/commits{/sha}","git_commits_url":"https://api.github.com/repos/jessemyers/credstash/git/commits{/sha}","comments_url":"https://api.github.com/repos/jessemyers/credstash/comments{/number}","issue_comment_url":"https://api.github.com/repos/jessemyers/credstash/issues/comments{/number}","contents_url":"https://api.github.com/repos/jessemyers/credstash/contents/{+path}","compare_url":"https://api.github.com/repos/jessemyers/credstash/compare/{base}...{head}","merges_url":"https://api.github.com/repos/jessemyers/credstash/merges","archive_url":"https://api.github.com/repos/jessemyers/credstash/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/jessemyers/credstash/downloads","issues_url":"https://api.github.com/repos/jessemyers/credstash/issues{/number}","pulls_url":"https://api.github.com/repos/jessemyers/credstash/pulls{/number}","milestones_url":"https://api.github.com/repos/jessemyers/credstash/milestones{/number}","notifications_url":"https://api.github.com/repos/jessemyers/credstash/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/jessemyers/credstash/labels{/name}","releases_url":"https://api.github.com/repos/jessemyers/credstash/releases{/id}","deployments_url":"https://api.github.com/repos/jessemyers/credstash/deployments","created_at":"2016-08-26T21:38:17Z","updated_at":"2016-08-26T21:38:18Z","pushed_at":"2016-10-12T15:32:35Z","git_url":"git://github.com/jessemyers/credstash.git","ssh_url":"git@github.com:jessemyers/credstash.git","clone_url":"https://github.com/jessemyers/credstash.git","svn_url":"https://github.com/jessemyers/credstash","homepage":"","size":162,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_downloads":true,"has_wiki":true,"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":"fugue:master","ref":"master","sha":"8ded48aa25f9ed80930bcbaba96bb5301bc31ae4","user":{"login":"fugue","id":13857002,"avatar_url":"https://avatars.githubusercontent.com/u/13857002?v=3","gravatar_id":"","url":"https://api.github.com/users/fugue","html_url":"https://github.com/fugue","followers_url":"https://api.github.com/users/fugue/followers","following_url":"https://api.github.com/users/fugue/following{/other_user}","gists_url":"https://api.github.com/users/fugue/gists{/gist_id}","starred_url":"https://api.github.com/users/fugue/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fugue/subscriptions","organizations_url":"https://api.github.com/users/fugue/orgs","repos_url":"https://api.github.com/users/fugue/repos","events_url":"https://api.github.com/users/fugue/events{/privacy}","received_events_url":"https://api.github.com/users/fugue/received_events","type":"Organization","site_admin":false},"repo":{"id":34271922,"name":"credstash","full_name":"fugue/credstash","owner":{"login":"fugue","id":13857002,"avatar_url":"https://avatars.githubusercontent.com/u/13857002?v=3","gravatar_id":"","url":"https://api.github.com/users/fugue","html_url":"https://github.com/fugue","followers_url":"https://api.github.com/users/fugue/followers","following_url":"https://api.github.com/users/fugue/following{/other_user}","gists_url":"https://api.github.com/users/fugue/gists{/gist_id}","starred_url":"https://api.github.com/users/fugue/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fugue/subscriptions","organizations_url":"https://api.github.com/users/fugue/orgs","repos_url":"https://api.github.com/users/fugue/repos","events_url":"https://api.github.com/users/fugue/events{/privacy}","received_events_url":"https://api.github.com/users/fugue/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/fugue/credstash","description":"A little utility for managing credentials in the cloud","fork":false,"url":"https://api.github.com/repos/fugue/credstash","forks_url":"https://api.github.com/repos/fugue/credstash/forks","keys_url":"https://api.github.com/repos/fugue/credstash/keys{/key_id}","collaborators_url":"https://api.github.com/repos/fugue/credstash/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/fugue/credstash/teams","hooks_url":"https://api.github.com/repos/fugue/credstash/hooks","issue_events_url":"https://api.github.com/repos/fugue/credstash/issues/events{/number}","events_url":"https://api.github.com/repos/fugue/credstash/events","assignees_url":"https://api.github.com/repos/fugue/credstash/assignees{/user}","branches_url":"https://api.github.com/repos/fugue/credstash/branches{/branch}","tags_url":"https://api.github.com/repos/fugue/credstash/tags","blobs_url":"https://api.github.com/repos/fugue/credstash/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/fugue/credstash/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/fugue/credstash/git/refs{/sha}","trees_url":"https://api.github.com/repos/fugue/credstash/git/trees{/sha}","statuses_url":"https://api.github.com/repos/fugue/credstash/statuses/{sha}","languages_url":"https://api.github.com/repos/fugue/credstash/languages","stargazers_url":"https://api.github.com/repos/fugue/credstash/stargazers","contributors_url":"https://api.github.com/repos/fugue/credstash/contributors","subscribers_url":"https://api.github.com/repos/fugue/credstash/subscribers","subscription_url":"https://api.github.com/repos/fugue/credstash/subscription","commits_url":"https://api.github.com/repos/fugue/credstash/commits{/sha}","git_commits_url":"https://api.github.com/repos/fugue/credstash/git/commits{/sha}","comments_url":"https://api.github.com/repos/fugue/credstash/comments{/number}","issue_comment_url":"https://api.github.com/repos/fugue/credstash/issues/comments{/number}","contents_url":"https://api.github.com/repos/fugue/credstash/contents/{+path}","compare_url":"https://api.github.com/repos/fugue/credstash/compare/{base}...{head}","merges_url":"https://api.github.com/repos/fugue/credstash/merges","archive_url":"https://api.github.com/repos/fugue/credstash/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/fugue/credstash/downloads","issues_url":"https://api.github.com/repos/fugue/credstash/issues{/number}","pulls_url":"https://api.github.com/repos/fugue/credstash/pulls{/number}","milestones_url":"https://api.github.com/repos/fugue/credstash/milestones{/number}","notifications_url":"https://api.github.com/repos/fugue/credstash/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/fugue/credstash/labels{/name}","releases_url":"https://api.github.com/repos/fugue/credstash/releases{/id}","deployments_url":"https://api.github.com/repos/fugue/credstash/deployments","created_at":"2015-04-20T16:20:15Z","updated_at":"2016-10-12T03:35:06Z","pushed_at":"2016-10-12T15:32:45Z","git_url":"git://github.com/fugue/credstash.git","ssh_url":"git@github.com:fugue/credstash.git","clone_url":"https://github.com/fugue/credstash.git","svn_url":"https://github.com/fugue/credstash","homepage":"","size":194,"stargazers_count":772,"watchers_count":772,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":76,"mirror_url":null,"open_issues_count":12,"forks":76,"open_issues":12,"watchers":772,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/fugue/credstash/pulls/107"},"html":{"href":"https://github.com/fugue/credstash/pull/107"},"issue":{"href":"https://api.github.com/repos/fugue/credstash/issues/107"},"comments":{"href":"https://api.github.com/repos/fugue/credstash/issues/107/comments"},"review_comments":{"href":"https://api.github.com/repos/fugue/credstash/pulls/107/comments"},"review_comment":{"href":"https://api.github.com/repos/fugue/credstash/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/fugue/credstash/pulls/107/commits"},"statuses":{"href":"https://api.github.com/repos/fugue/credstash/statuses/49ef642b08d6f46b1451e19d146bcbbc3dd73850"}}}}
{"actor":{"display_login":"jessemyers"}}