{"action":"created","comment":{"url":"https://api.github.com/repos/hashicorp/vault/pulls/comments/177420937","pull_request_review_id":107286572,"id":177420937,"diff_hunk":"@@ -1223,6 +1275,57 @@ func (c *ServerCommand) enableThreeNodeDevCluster(base *vault.CoreConfig, info m\n \treturn 0\n }\n \n+// addPlugin adds any plugins to the catalog\n+func (c *ServerCommand) addPlugin(token string, core *vault.Core) error {\n+\t// Get the sha256 of the file at the given path.\n+\tpluginSum := func(p string) (string, error) {\n+\t\thasher := sha256.New()\n+\t\tf, err := os.Open(p)\n+\t\tif err != nil {\n+\t\t\treturn \"\", err\n+\t\t}\n+\t\tdefer f.Close()\n+\t\tif _, err := io.Copy(hasher, f); err != nil {\n+\t\t\treturn \"\", err\n+\t\t}\n+\t\treturn hex.EncodeToString(hasher.Sum(nil)), nil\n+\t}\n+\n+\t// Mount any test plugins. We do this explicitly before we inform tests of\n+\t// a completely booted server intentionally.\n+\tsha256sum, err := pluginSum(c.flagDevPluginPath)\n+\tif err != nil {\n+\t\treturn err\n+\t}\n+\n+\t// Default the name to the basename of the binary","path":"command/server.go","position":131,"original_position":131,"commit_id":"3da6d06777673010d0c264931dd7c5e0411a18da","original_commit_id":"3da6d06777673010d0c264931dd7c5e0411a18da","user":{"login":"jefferai","id":28627,"avatar_url":"https://avatars0.githubusercontent.com/u/28627?v=4","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":"I think that's fine. Also many (most?) plugins can/should be able to use env vars in addition to args, so that seems like a relatively easy way to test without having to add more flags, if args are even needed.","created_at":"2018-03-27T13:22:07Z","updated_at":"2018-03-27T13:22:07Z","html_url":"https://github.com/hashicorp/vault/pull/4188#discussion_r177420937","pull_request_url":"https://api.github.com/repos/hashicorp/vault/pulls/4188","author_association":"OWNER","_links":{"self":{"href":"https://api.github.com/repos/hashicorp/vault/pulls/comments/177420937"},"html":{"href":"https://github.com/hashicorp/vault/pull/4188#discussion_r177420937"},"pull_request":{"href":"https://api.github.com/repos/hashicorp/vault/pulls/4188"}},"in_reply_to_id":177098795},"pull_request":{"url":"https://api.github.com/repos/hashicorp/vault/pulls/4188","id":177007201,"html_url":"https://github.com/hashicorp/vault/pull/4188","diff_url":"https://github.com/hashicorp/vault/pull/4188.diff","patch_url":"https://github.com/hashicorp/vault/pull/4188.patch","issue_url":"https://api.github.com/repos/hashicorp/vault/issues/4188","number":4188,"state":"open","locked":false,"title":"Add dev flags for local plugin testing","user":{"login":"sethvargo","id":408570,"avatar_url":"https://avatars3.githubusercontent.com/u/408570?v=4","gravatar_id":"","url":"https://api.github.com/users/sethvargo","html_url":"https://github.com/sethvargo","followers_url":"https://api.github.com/users/sethvargo/followers","following_url":"https://api.github.com/users/sethvargo/following{/other_user}","gists_url":"https://api.github.com/users/sethvargo/gists{/gist_id}","starred_url":"https://api.github.com/users/sethvargo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sethvargo/subscriptions","organizations_url":"https://api.github.com/users/sethvargo/orgs","repos_url":"https://api.github.com/users/sethvargo/repos","events_url":"https://api.github.com/users/sethvargo/events{/privacy}","received_events_url":"https://api.github.com/users/sethvargo/received_events","type":"User","site_admin":false},"body":"This adds the `-dev-plugin-path` flag, which points to the binary of a compiled plugin on disk, calculates the checksum, and registers the plugin in the catalog for later mounting.\r\n\r\nThis is primarily used for integration and acceptance testing of third-party plugins, which can be tedious and error-prone.","created_at":"2018-03-23T09:00:47Z","updated_at":"2018-03-27T13:22:07Z","closed_at":null,"merged_at":null,"merge_commit_sha":"8cb3f2aedea1974076e73ac0999549f6b99b713b","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/hashicorp/vault/pulls/4188/commits","review_comments_url":"https://api.github.com/repos/hashicorp/vault/pulls/4188/comments","review_comment_url":"https://api.github.com/repos/hashicorp/vault/pulls/comments{/number}","comments_url":"https://api.github.com/repos/hashicorp/vault/issues/4188/comments","statuses_url":"https://api.github.com/repos/hashicorp/vault/statuses/3da6d06777673010d0c264931dd7c5e0411a18da","head":{"label":"sethvargo:sethvargo/dev-plugin","ref":"sethvargo/dev-plugin","sha":"3da6d06777673010d0c264931dd7c5e0411a18da","user":{"login":"sethvargo","id":408570,"avatar_url":"https://avatars3.githubusercontent.com/u/408570?v=4","gravatar_id":"","url":"https://api.github.com/users/sethvargo","html_url":"https://github.com/sethvargo","followers_url":"https://api.github.com/users/sethvargo/followers","following_url":"https://api.github.com/users/sethvargo/following{/other_user}","gists_url":"https://api.github.com/users/sethvargo/gists{/gist_id}","starred_url":"https://api.github.com/users/sethvargo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sethvargo/subscriptions","organizations_url":"https://api.github.com/users/sethvargo/orgs","repos_url":"https://api.github.com/users/sethvargo/repos","events_url":"https://api.github.com/users/sethvargo/events{/privacy}","received_events_url":"https://api.github.com/users/sethvargo/received_events","type":"User","site_admin":false},"repo":{"id":121463353,"name":"vault","full_name":"sethvargo/vault","owner":{"login":"sethvargo","id":408570,"avatar_url":"https://avatars3.githubusercontent.com/u/408570?v=4","gravatar_id":"","url":"https://api.github.com/users/sethvargo","html_url":"https://github.com/sethvargo","followers_url":"https://api.github.com/users/sethvargo/followers","following_url":"https://api.github.com/users/sethvargo/following{/other_user}","gists_url":"https://api.github.com/users/sethvargo/gists{/gist_id}","starred_url":"https://api.github.com/users/sethvargo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sethvargo/subscriptions","organizations_url":"https://api.github.com/users/sethvargo/orgs","repos_url":"https://api.github.com/users/sethvargo/repos","events_url":"https://api.github.com/users/sethvargo/events{/privacy}","received_events_url":"https://api.github.com/users/sethvargo/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/sethvargo/vault","description":"A tool for secrets management, encryption as a service, and privileged access management","fork":true,"url":"https://api.github.com/repos/sethvargo/vault","forks_url":"https://api.github.com/repos/sethvargo/vault/forks","keys_url":"https://api.github.com/repos/sethvargo/vault/keys{/key_id}","collaborators_url":"https://api.github.com/repos/sethvargo/vault/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/sethvargo/vault/teams","hooks_url":"https://api.github.com/repos/sethvargo/vault/hooks","issue_events_url":"https://api.github.com/repos/sethvargo/vault/issues/events{/number}","events_url":"https://api.github.com/repos/sethvargo/vault/events","assignees_url":"https://api.github.com/repos/sethvargo/vault/assignees{/user}","branches_url":"https://api.github.com/repos/sethvargo/vault/branches{/branch}","tags_url":"https://api.github.com/repos/sethvargo/vault/tags","blobs_url":"https://api.github.com/repos/sethvargo/vault/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/sethvargo/vault/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/sethvargo/vault/git/refs{/sha}","trees_url":"https://api.github.com/repos/sethvargo/vault/git/trees{/sha}","statuses_url":"https://api.github.com/repos/sethvargo/vault/statuses/{sha}","languages_url":"https://api.github.com/repos/sethvargo/vault/languages","stargazers_url":"https://api.github.com/repos/sethvargo/vault/stargazers","contributors_url":"https://api.github.com/repos/sethvargo/vault/contributors","subscribers_url":"https://api.github.com/repos/sethvargo/vault/subscribers","subscription_url":"https://api.github.com/repos/sethvargo/vault/subscription","commits_url":"https://api.github.com/repos/sethvargo/vault/commits{/sha}","git_commits_url":"https://api.github.com/repos/sethvargo/vault/git/commits{/sha}","comments_url":"https://api.github.com/repos/sethvargo/vault/comments{/number}","issue_comment_url":"https://api.github.com/repos/sethvargo/vault/issues/comments{/number}","contents_url":"https://api.github.com/repos/sethvargo/vault/contents/{+path}","compare_url":"https://api.github.com/repos/sethvargo/vault/compare/{base}...{head}","merges_url":"https://api.github.com/repos/sethvargo/vault/merges","archive_url":"https://api.github.com/repos/sethvargo/vault/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/sethvargo/vault/downloads","issues_url":"https://api.github.com/repos/sethvargo/vault/issues{/number}","pulls_url":"https://api.github.com/repos/sethvargo/vault/pulls{/number}","milestones_url":"https://api.github.com/repos/sethvargo/vault/milestones{/number}","notifications_url":"https://api.github.com/repos/sethvargo/vault/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/sethvargo/vault/labels{/name}","releases_url":"https://api.github.com/repos/sethvargo/vault/releases{/id}","deployments_url":"https://api.github.com/repos/sethvargo/vault/deployments","created_at":"2018-02-14T02:46:30Z","updated_at":"2018-02-14T02:46:35Z","pushed_at":"2018-03-26T22:49:51Z","git_url":"git://github.com/sethvargo/vault.git","ssh_url":"git@github.com:sethvargo/vault.git","clone_url":"https://github.com/sethvargo/vault.git","svn_url":"https://github.com/sethvargo/vault","homepage":"https://www.vaultproject.io/","size":44234,"stargazers_count":0,"watchers_count":0,"language":"Go","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":null,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"hashicorp:master","ref":"master","sha":"6c0b238459756032c35d1dc95707eb419142e6c2","user":{"login":"hashicorp","id":761456,"avatar_url":"https://avatars2.githubusercontent.com/u/761456?v=4","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://avatars2.githubusercontent.com/u/761456?v=4","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 secrets management, encryption as a service, and privileged access management","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":"2018-03-27T11:57:09Z","pushed_at":"2018-03-27T03:11:12Z","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":45779,"stargazers_count":8793,"watchers_count":8793,"language":"Go","has_issues":true,"has_projects":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":1281,"mirror_url":null,"archived":false,"open_issues_count":228,"license":{"key":"mpl-2.0","name":"Mozilla Public License 2.0","spdx_id":"MPL-2.0","url":"https://api.github.com/licenses/mpl-2.0"},"forks":1281,"open_issues":228,"watchers":8793,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/hashicorp/vault/pulls/4188"},"html":{"href":"https://github.com/hashicorp/vault/pull/4188"},"issue":{"href":"https://api.github.com/repos/hashicorp/vault/issues/4188"},"comments":{"href":"https://api.github.com/repos/hashicorp/vault/issues/4188/comments"},"review_comments":{"href":"https://api.github.com/repos/hashicorp/vault/pulls/4188/comments"},"review_comment":{"href":"https://api.github.com/repos/hashicorp/vault/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/hashicorp/vault/pulls/4188/commits"},"statuses":{"href":"https://api.github.com/repos/hashicorp/vault/statuses/3da6d06777673010d0c264931dd7c5e0411a18da"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"jefferai"}}