{"action":"created","comment":{"url":"https://api.github.com/repos/rapid7/tokend/pulls/comments/81562480","pull_request_review_id":2533183,"id":81562480,"diff_hunk":"@@ -0,0 +1,83 @@\n+'use strict';\n+\n+const Vaulted = require('vaulted');\n+const preconditions = require('conditional');\n+const checkNotEmpty = preconditions.checkNotEmpty;\n+\n+// Default Vault connection options\n+const VAULT_CONFIG = {\n+  vault_host: Config.get('vault:host'),\n+  vault_port: Config.get('vault:port'),\n+  vault_ssl: Config.get('vault:tls')\n+};\n+\n+/**\n+ * The TransitProvider is responsible for retrieving secrets from Vault's transit secret backend.\n+ * https://www.vaultproject.io/docs/secrets/transit/index.html\n+ */\n+class TransitProvider {\n+  /**\n+   * Create a new instance of a TransitProvider.\n+   *\n+   * @param {String} key - Key in Vault to use for decryption\n+   * @param {String} token - Token to pass to Vault's API\n+   * @param {Object} parameters - Arguments to pass to Vault's /transit/decrypt/ API\n+   * @param {Object} parameters.ciphertext - Ciphertext to decrypt\n+   */\n+  constructor(key, token, parameters) {\n+    checkNotEmpty(key, 'key is required');\n+    checkNotEmpty(token, 'token is required');\n+    checkNotEmpty(parameters, 'parameters is required');\n+    checkNotEmpty(parameters.ciphertext, 'parameters.ciphertext is required');\n+\n+    this._key = key;\n+    this._token = token;\n+    this._parameters = parameters;\n+\n+    this._client = new Vaulted(VAULT_CONFIG);\n+    this._client.api.mountEndpoints(this._client.config, 'transit', 'transit');","path":"lib/providers/transit.js","position":38,"original_position":38,"commit_id":"cc95c92ae72758ebc10b50e5e5babccc1e10a421","original_commit_id":"cc95c92ae72758ebc10b50e5e5babccc1e10a421","user":{"login":"dgreene-r7","id":15327249,"avatar_url":"https://avatars.githubusercontent.com/u/15327249?v=3","gravatar_id":"","url":"https://api.github.com/users/dgreene-r7","html_url":"https://github.com/dgreene-r7","followers_url":"https://api.github.com/users/dgreene-r7/followers","following_url":"https://api.github.com/users/dgreene-r7/following{/other_user}","gists_url":"https://api.github.com/users/dgreene-r7/gists{/gist_id}","starred_url":"https://api.github.com/users/dgreene-r7/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dgreene-r7/subscriptions","organizations_url":"https://api.github.com/users/dgreene-r7/orgs","repos_url":"https://api.github.com/users/dgreene-r7/repos","events_url":"https://api.github.com/users/dgreene-r7/events{/privacy}","received_events_url":"https://api.github.com/users/dgreene-r7/received_events","type":"User","site_admin":false},"body":"This is resolved here: https://github.com/chiefy/vaulted/pull/96\r\n\r\nOnce it's merged to master you should update the dependency in `package.json`.","created_at":"2016-10-03T14:34:39Z","updated_at":"2016-10-03T14:34:39Z","html_url":"https://github.com/rapid7/tokend/pull/58#discussion_r81562480","pull_request_url":"https://api.github.com/repos/rapid7/tokend/pulls/58","_links":{"self":{"href":"https://api.github.com/repos/rapid7/tokend/pulls/comments/81562480"},"html":{"href":"https://github.com/rapid7/tokend/pull/58#discussion_r81562480"},"pull_request":{"href":"https://api.github.com/repos/rapid7/tokend/pulls/58"}}},"pull_request":{"url":"https://api.github.com/repos/rapid7/tokend/pulls/58","id":87505300,"html_url":"https://github.com/rapid7/tokend/pull/58","diff_url":"https://github.com/rapid7/tokend/pull/58.diff","patch_url":"https://github.com/rapid7/tokend/pull/58.patch","issue_url":"https://api.github.com/repos/rapid7/tokend/issues/58","number":58,"state":"open","locked":false,"title":"Feature: Transit secret provider","user":{"login":"fmitchell-r7","id":14876658,"avatar_url":"https://avatars.githubusercontent.com/u/14876658?v=3","gravatar_id":"","url":"https://api.github.com/users/fmitchell-r7","html_url":"https://github.com/fmitchell-r7","followers_url":"https://api.github.com/users/fmitchell-r7/followers","following_url":"https://api.github.com/users/fmitchell-r7/following{/other_user}","gists_url":"https://api.github.com/users/fmitchell-r7/gists{/gist_id}","starred_url":"https://api.github.com/users/fmitchell-r7/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fmitchell-r7/subscriptions","organizations_url":"https://api.github.com/users/fmitchell-r7/orgs","repos_url":"https://api.github.com/users/fmitchell-r7/repos","events_url":"https://api.github.com/users/fmitchell-r7/events{/privacy}","received_events_url":"https://api.github.com/users/fmitchell-r7/received_events","type":"User","site_admin":false},"body":"This fixes #57. There's now a `TransitProvider` class that can handle decrypting secrets from Vault. Note that this does not wire the provider into the `/v1/transit/default` API. That will happen in a separate pull request.","created_at":"2016-09-30T14:35:37Z","updated_at":"2016-10-03T14:34:39Z","closed_at":null,"merged_at":null,"merge_commit_sha":"5b1ea0f891d286c2452e65a4c7cdd866ffd04f27","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/rapid7/tokend/pulls/58/commits","review_comments_url":"https://api.github.com/repos/rapid7/tokend/pulls/58/comments","review_comment_url":"https://api.github.com/repos/rapid7/tokend/pulls/comments{/number}","comments_url":"https://api.github.com/repos/rapid7/tokend/issues/58/comments","statuses_url":"https://api.github.com/repos/rapid7/tokend/statuses/cc95c92ae72758ebc10b50e5e5babccc1e10a421","head":{"label":"rapid7:feature-transit-secret-provider","ref":"feature-transit-secret-provider","sha":"cc95c92ae72758ebc10b50e5e5babccc1e10a421","user":{"login":"rapid7","id":1013671,"avatar_url":"https://avatars.githubusercontent.com/u/1013671?v=3","gravatar_id":"","url":"https://api.github.com/users/rapid7","html_url":"https://github.com/rapid7","followers_url":"https://api.github.com/users/rapid7/followers","following_url":"https://api.github.com/users/rapid7/following{/other_user}","gists_url":"https://api.github.com/users/rapid7/gists{/gist_id}","starred_url":"https://api.github.com/users/rapid7/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rapid7/subscriptions","organizations_url":"https://api.github.com/users/rapid7/orgs","repos_url":"https://api.github.com/users/rapid7/repos","events_url":"https://api.github.com/users/rapid7/events{/privacy}","received_events_url":"https://api.github.com/users/rapid7/received_events","type":"Organization","site_admin":false},"repo":{"id":55086935,"name":"tokend","full_name":"rapid7/tokend","owner":{"login":"rapid7","id":1013671,"avatar_url":"https://avatars.githubusercontent.com/u/1013671?v=3","gravatar_id":"","url":"https://api.github.com/users/rapid7","html_url":"https://github.com/rapid7","followers_url":"https://api.github.com/users/rapid7/followers","following_url":"https://api.github.com/users/rapid7/following{/other_user}","gists_url":"https://api.github.com/users/rapid7/gists{/gist_id}","starred_url":"https://api.github.com/users/rapid7/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rapid7/subscriptions","organizations_url":"https://api.github.com/users/rapid7/orgs","repos_url":"https://api.github.com/users/rapid7/repos","events_url":"https://api.github.com/users/rapid7/events{/privacy}","received_events_url":"https://api.github.com/users/rapid7/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/rapid7/tokend","description":null,"fork":false,"url":"https://api.github.com/repos/rapid7/tokend","forks_url":"https://api.github.com/repos/rapid7/tokend/forks","keys_url":"https://api.github.com/repos/rapid7/tokend/keys{/key_id}","collaborators_url":"https://api.github.com/repos/rapid7/tokend/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/rapid7/tokend/teams","hooks_url":"https://api.github.com/repos/rapid7/tokend/hooks","issue_events_url":"https://api.github.com/repos/rapid7/tokend/issues/events{/number}","events_url":"https://api.github.com/repos/rapid7/tokend/events","assignees_url":"https://api.github.com/repos/rapid7/tokend/assignees{/user}","branches_url":"https://api.github.com/repos/rapid7/tokend/branches{/branch}","tags_url":"https://api.github.com/repos/rapid7/tokend/tags","blobs_url":"https://api.github.com/repos/rapid7/tokend/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/rapid7/tokend/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/rapid7/tokend/git/refs{/sha}","trees_url":"https://api.github.com/repos/rapid7/tokend/git/trees{/sha}","statuses_url":"https://api.github.com/repos/rapid7/tokend/statuses/{sha}","languages_url":"https://api.github.com/repos/rapid7/tokend/languages","stargazers_url":"https://api.github.com/repos/rapid7/tokend/stargazers","contributors_url":"https://api.github.com/repos/rapid7/tokend/contributors","subscribers_url":"https://api.github.com/repos/rapid7/tokend/subscribers","subscription_url":"https://api.github.com/repos/rapid7/tokend/subscription","commits_url":"https://api.github.com/repos/rapid7/tokend/commits{/sha}","git_commits_url":"https://api.github.com/repos/rapid7/tokend/git/commits{/sha}","comments_url":"https://api.github.com/repos/rapid7/tokend/comments{/number}","issue_comment_url":"https://api.github.com/repos/rapid7/tokend/issues/comments{/number}","contents_url":"https://api.github.com/repos/rapid7/tokend/contents/{+path}","compare_url":"https://api.github.com/repos/rapid7/tokend/compare/{base}...{head}","merges_url":"https://api.github.com/repos/rapid7/tokend/merges","archive_url":"https://api.github.com/repos/rapid7/tokend/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/rapid7/tokend/downloads","issues_url":"https://api.github.com/repos/rapid7/tokend/issues{/number}","pulls_url":"https://api.github.com/repos/rapid7/tokend/pulls{/number}","milestones_url":"https://api.github.com/repos/rapid7/tokend/milestones{/number}","notifications_url":"https://api.github.com/repos/rapid7/tokend/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/rapid7/tokend/labels{/name}","releases_url":"https://api.github.com/repos/rapid7/tokend/releases{/id}","deployments_url":"https://api.github.com/repos/rapid7/tokend/deployments","created_at":"2016-03-30T18:26:03Z","updated_at":"2016-08-05T20:02:07Z","pushed_at":"2016-09-30T20:22:11Z","git_url":"git://github.com/rapid7/tokend.git","ssh_url":"git@github.com:rapid7/tokend.git","clone_url":"https://github.com/rapid7/tokend.git","svn_url":"https://github.com/rapid7/tokend","homepage":"","size":327,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":10,"forks":0,"open_issues":10,"watchers":0,"default_branch":"master"}},"base":{"label":"rapid7:master","ref":"master","sha":"3a53f050029de703d6dfafab8c980ae2e6b8fef1","user":{"login":"rapid7","id":1013671,"avatar_url":"https://avatars.githubusercontent.com/u/1013671?v=3","gravatar_id":"","url":"https://api.github.com/users/rapid7","html_url":"https://github.com/rapid7","followers_url":"https://api.github.com/users/rapid7/followers","following_url":"https://api.github.com/users/rapid7/following{/other_user}","gists_url":"https://api.github.com/users/rapid7/gists{/gist_id}","starred_url":"https://api.github.com/users/rapid7/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rapid7/subscriptions","organizations_url":"https://api.github.com/users/rapid7/orgs","repos_url":"https://api.github.com/users/rapid7/repos","events_url":"https://api.github.com/users/rapid7/events{/privacy}","received_events_url":"https://api.github.com/users/rapid7/received_events","type":"Organization","site_admin":false},"repo":{"id":55086935,"name":"tokend","full_name":"rapid7/tokend","owner":{"login":"rapid7","id":1013671,"avatar_url":"https://avatars.githubusercontent.com/u/1013671?v=3","gravatar_id":"","url":"https://api.github.com/users/rapid7","html_url":"https://github.com/rapid7","followers_url":"https://api.github.com/users/rapid7/followers","following_url":"https://api.github.com/users/rapid7/following{/other_user}","gists_url":"https://api.github.com/users/rapid7/gists{/gist_id}","starred_url":"https://api.github.com/users/rapid7/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rapid7/subscriptions","organizations_url":"https://api.github.com/users/rapid7/orgs","repos_url":"https://api.github.com/users/rapid7/repos","events_url":"https://api.github.com/users/rapid7/events{/privacy}","received_events_url":"https://api.github.com/users/rapid7/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/rapid7/tokend","description":null,"fork":false,"url":"https://api.github.com/repos/rapid7/tokend","forks_url":"https://api.github.com/repos/rapid7/tokend/forks","keys_url":"https://api.github.com/repos/rapid7/tokend/keys{/key_id}","collaborators_url":"https://api.github.com/repos/rapid7/tokend/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/rapid7/tokend/teams","hooks_url":"https://api.github.com/repos/rapid7/tokend/hooks","issue_events_url":"https://api.github.com/repos/rapid7/tokend/issues/events{/number}","events_url":"https://api.github.com/repos/rapid7/tokend/events","assignees_url":"https://api.github.com/repos/rapid7/tokend/assignees{/user}","branches_url":"https://api.github.com/repos/rapid7/tokend/branches{/branch}","tags_url":"https://api.github.com/repos/rapid7/tokend/tags","blobs_url":"https://api.github.com/repos/rapid7/tokend/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/rapid7/tokend/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/rapid7/tokend/git/refs{/sha}","trees_url":"https://api.github.com/repos/rapid7/tokend/git/trees{/sha}","statuses_url":"https://api.github.com/repos/rapid7/tokend/statuses/{sha}","languages_url":"https://api.github.com/repos/rapid7/tokend/languages","stargazers_url":"https://api.github.com/repos/rapid7/tokend/stargazers","contributors_url":"https://api.github.com/repos/rapid7/tokend/contributors","subscribers_url":"https://api.github.com/repos/rapid7/tokend/subscribers","subscription_url":"https://api.github.com/repos/rapid7/tokend/subscription","commits_url":"https://api.github.com/repos/rapid7/tokend/commits{/sha}","git_commits_url":"https://api.github.com/repos/rapid7/tokend/git/commits{/sha}","comments_url":"https://api.github.com/repos/rapid7/tokend/comments{/number}","issue_comment_url":"https://api.github.com/repos/rapid7/tokend/issues/comments{/number}","contents_url":"https://api.github.com/repos/rapid7/tokend/contents/{+path}","compare_url":"https://api.github.com/repos/rapid7/tokend/compare/{base}...{head}","merges_url":"https://api.github.com/repos/rapid7/tokend/merges","archive_url":"https://api.github.com/repos/rapid7/tokend/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/rapid7/tokend/downloads","issues_url":"https://api.github.com/repos/rapid7/tokend/issues{/number}","pulls_url":"https://api.github.com/repos/rapid7/tokend/pulls{/number}","milestones_url":"https://api.github.com/repos/rapid7/tokend/milestones{/number}","notifications_url":"https://api.github.com/repos/rapid7/tokend/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/rapid7/tokend/labels{/name}","releases_url":"https://api.github.com/repos/rapid7/tokend/releases{/id}","deployments_url":"https://api.github.com/repos/rapid7/tokend/deployments","created_at":"2016-03-30T18:26:03Z","updated_at":"2016-08-05T20:02:07Z","pushed_at":"2016-09-30T20:22:11Z","git_url":"git://github.com/rapid7/tokend.git","ssh_url":"git@github.com:rapid7/tokend.git","clone_url":"https://github.com/rapid7/tokend.git","svn_url":"https://github.com/rapid7/tokend","homepage":"","size":327,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":10,"forks":0,"open_issues":10,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/rapid7/tokend/pulls/58"},"html":{"href":"https://github.com/rapid7/tokend/pull/58"},"issue":{"href":"https://api.github.com/repos/rapid7/tokend/issues/58"},"comments":{"href":"https://api.github.com/repos/rapid7/tokend/issues/58/comments"},"review_comments":{"href":"https://api.github.com/repos/rapid7/tokend/pulls/58/comments"},"review_comment":{"href":"https://api.github.com/repos/rapid7/tokend/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/rapid7/tokend/pulls/58/commits"},"statuses":{"href":"https://api.github.com/repos/rapid7/tokend/statuses/cc95c92ae72758ebc10b50e5e5babccc1e10a421"}}}}
{"actor":{"display_login":"dgreene-r7"}}