{"action":"created","comment":{"url":"https://api.github.com/repos/terraform-providers/terraform-provider-vault/pulls/comments/218970723","pull_request_review_id":157030687,"id":218970723,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIxODk3MDcyMw==","diff_hunk":"@@ -104,13 +118,48 @@ func genericSecretResourceWrite(d *schema.ResourceData, meta interface{}) error\n \t}\n \n \tlog.Printf(\"[DEBUG] Writing generic Vault secret to %s\", path)\n-\t_, err = client.Logical().Write(path, data)\n+\tsecret, err := client.Logical().Write(path, data)\n \tif err != nil {\n \t\treturn fmt.Errorf(\"error writing to Vault: %s\", err)\n \t}\n \n \td.SetId(path)\n \n+\tcaptureResponse := d.Get(\"capture_response\").(bool)\n+\tif captureResponse {\n+\t\tlog.Printf(\"[DEBUG] Capture response is set.\")\n+\t\tif secret == nil {\n+\t\t\tlog.Printf(\"[WARN] write to (%s) returned empty response\", path)\n+\t\t\treturn nil\n+\t\t}\n+\t\tjsonDataBytes, err := json.Marshal(secret.Data)\n+\t\tif err != nil {\n+\t\t\treturn fmt.Errorf(\"Error marshaling JSON for %q: %s\", path, err)","path":"vault/resource_generic_secret.go","position":49,"original_position":49,"commit_id":"e89ca6413330d5c76092c876ec5df51c717dd547","original_commit_id":"e89ca6413330d5c76092c876ec5df51c717dd547","user":{"login":"tyrannosaurus-becks","id":1152361,"node_id":"MDQ6VXNlcjExNTIzNjE=","avatar_url":"https://avatars3.githubusercontent.com/u/1152361?v=4","gravatar_id":"","url":"https://api.github.com/users/tyrannosaurus-becks","html_url":"https://github.com/tyrannosaurus-becks","followers_url":"https://api.github.com/users/tyrannosaurus-becks/followers","following_url":"https://api.github.com/users/tyrannosaurus-becks/following{/other_user}","gists_url":"https://api.github.com/users/tyrannosaurus-becks/gists{/gist_id}","starred_url":"https://api.github.com/users/tyrannosaurus-becks/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tyrannosaurus-becks/subscriptions","organizations_url":"https://api.github.com/users/tyrannosaurus-becks/orgs","repos_url":"https://api.github.com/users/tyrannosaurus-becks/repos","events_url":"https://api.github.com/users/tyrannosaurus-becks/events{/privacy}","received_events_url":"https://api.github.com/users/tyrannosaurus-becks/received_events","type":"User","site_admin":false},"body":"Could this error start with a lower-case character instead?","created_at":"2018-09-19T21:30:27Z","updated_at":"2018-09-19T21:32:24Z","html_url":"https://github.com/terraform-providers/terraform-provider-vault/pull/120#discussion_r218970723","pull_request_url":"https://api.github.com/repos/terraform-providers/terraform-provider-vault/pulls/120","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/terraform-providers/terraform-provider-vault/pulls/comments/218970723"},"html":{"href":"https://github.com/terraform-providers/terraform-provider-vault/pull/120#discussion_r218970723"},"pull_request":{"href":"https://api.github.com/repos/terraform-providers/terraform-provider-vault/pulls/120"}}},"pull_request":{"url":"https://api.github.com/repos/terraform-providers/terraform-provider-vault/pulls/120","id":187355176,"node_id":"MDExOlB1bGxSZXF1ZXN0MTg3MzU1MTc2","html_url":"https://github.com/terraform-providers/terraform-provider-vault/pull/120","diff_url":"https://github.com/terraform-providers/terraform-provider-vault/pull/120.diff","patch_url":"https://github.com/terraform-providers/terraform-provider-vault/pull/120.patch","issue_url":"https://api.github.com/repos/terraform-providers/terraform-provider-vault/issues/120","number":120,"state":"open","locked":false,"title":"Added functionality to capture response from vault generic secret resources.","user":{"login":"jcfergus","id":10349414,"node_id":"MDQ6VXNlcjEwMzQ5NDE0","avatar_url":"https://avatars1.githubusercontent.com/u/10349414?v=4","gravatar_id":"","url":"https://api.github.com/users/jcfergus","html_url":"https://github.com/jcfergus","followers_url":"https://api.github.com/users/jcfergus/followers","following_url":"https://api.github.com/users/jcfergus/following{/other_user}","gists_url":"https://api.github.com/users/jcfergus/gists{/gist_id}","starred_url":"https://api.github.com/users/jcfergus/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jcfergus/subscriptions","organizations_url":"https://api.github.com/users/jcfergus/orgs","repos_url":"https://api.github.com/users/jcfergus/repos","events_url":"https://api.github.com/users/jcfergus/events{/privacy}","received_events_url":"https://api.github.com/users/jcfergus/received_events","type":"User","site_admin":false},"body":"This adds a \"capture_response\" setting to vault_generic_secret resources, which allows data that is only returned in a response to a Create/Write call to be accessed in the resultant data_json and data attributes.  (i.e. CSRs returned from pki endpoints and certificates returned from signing requests). This should provide a workable solution for #67 and #111  .  \r\n\r\n[Note that this is my first foray into Go programming and has only been lightly tested.]. ","created_at":"2018-05-11T02:54:20Z","updated_at":"2018-09-19T21:32:24Z","closed_at":null,"merged_at":null,"merge_commit_sha":"798db7d67ce3b4d8adee58831bc10ebfc5c143a4","assignee":{"login":"tyrannosaurus-becks","id":1152361,"node_id":"MDQ6VXNlcjExNTIzNjE=","avatar_url":"https://avatars3.githubusercontent.com/u/1152361?v=4","gravatar_id":"","url":"https://api.github.com/users/tyrannosaurus-becks","html_url":"https://github.com/tyrannosaurus-becks","followers_url":"https://api.github.com/users/tyrannosaurus-becks/followers","following_url":"https://api.github.com/users/tyrannosaurus-becks/following{/other_user}","gists_url":"https://api.github.com/users/tyrannosaurus-becks/gists{/gist_id}","starred_url":"https://api.github.com/users/tyrannosaurus-becks/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tyrannosaurus-becks/subscriptions","organizations_url":"https://api.github.com/users/tyrannosaurus-becks/orgs","repos_url":"https://api.github.com/users/tyrannosaurus-becks/repos","events_url":"https://api.github.com/users/tyrannosaurus-becks/events{/privacy}","received_events_url":"https://api.github.com/users/tyrannosaurus-becks/received_events","type":"User","site_admin":false},"assignees":[{"login":"tyrannosaurus-becks","id":1152361,"node_id":"MDQ6VXNlcjExNTIzNjE=","avatar_url":"https://avatars3.githubusercontent.com/u/1152361?v=4","gravatar_id":"","url":"https://api.github.com/users/tyrannosaurus-becks","html_url":"https://github.com/tyrannosaurus-becks","followers_url":"https://api.github.com/users/tyrannosaurus-becks/followers","following_url":"https://api.github.com/users/tyrannosaurus-becks/following{/other_user}","gists_url":"https://api.github.com/users/tyrannosaurus-becks/gists{/gist_id}","starred_url":"https://api.github.com/users/tyrannosaurus-becks/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tyrannosaurus-becks/subscriptions","organizations_url":"https://api.github.com/users/tyrannosaurus-becks/orgs","repos_url":"https://api.github.com/users/tyrannosaurus-becks/repos","events_url":"https://api.github.com/users/tyrannosaurus-becks/events{/privacy}","received_events_url":"https://api.github.com/users/tyrannosaurus-becks/received_events","type":"User","site_admin":false}],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/terraform-providers/terraform-provider-vault/pulls/120/commits","review_comments_url":"https://api.github.com/repos/terraform-providers/terraform-provider-vault/pulls/120/comments","review_comment_url":"https://api.github.com/repos/terraform-providers/terraform-provider-vault/pulls/comments{/number}","comments_url":"https://api.github.com/repos/terraform-providers/terraform-provider-vault/issues/120/comments","statuses_url":"https://api.github.com/repos/terraform-providers/terraform-provider-vault/statuses/e89ca6413330d5c76092c876ec5df51c717dd547","head":{"label":"newcontext-oss:capture_response","ref":"capture_response","sha":"e89ca6413330d5c76092c876ec5df51c717dd547","user":{"login":"newcontext-oss","id":21958632,"node_id":"MDEyOk9yZ2FuaXphdGlvbjIxOTU4NjMy","avatar_url":"https://avatars3.githubusercontent.com/u/21958632?v=4","gravatar_id":"","url":"https://api.github.com/users/newcontext-oss","html_url":"https://github.com/newcontext-oss","followers_url":"https://api.github.com/users/newcontext-oss/followers","following_url":"https://api.github.com/users/newcontext-oss/following{/other_user}","gists_url":"https://api.github.com/users/newcontext-oss/gists{/gist_id}","starred_url":"https://api.github.com/users/newcontext-oss/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/newcontext-oss/subscriptions","organizations_url":"https://api.github.com/users/newcontext-oss/orgs","repos_url":"https://api.github.com/users/newcontext-oss/repos","events_url":"https://api.github.com/users/newcontext-oss/events{/privacy}","received_events_url":"https://api.github.com/users/newcontext-oss/received_events","type":"Organization","site_admin":false},"repo":{"id":132957195,"node_id":"MDEwOlJlcG9zaXRvcnkxMzI5NTcxOTU=","name":"terraform-provider-vault","full_name":"newcontext-oss/terraform-provider-vault","private":false,"owner":{"login":"newcontext-oss","id":21958632,"node_id":"MDEyOk9yZ2FuaXphdGlvbjIxOTU4NjMy","avatar_url":"https://avatars3.githubusercontent.com/u/21958632?v=4","gravatar_id":"","url":"https://api.github.com/users/newcontext-oss","html_url":"https://github.com/newcontext-oss","followers_url":"https://api.github.com/users/newcontext-oss/followers","following_url":"https://api.github.com/users/newcontext-oss/following{/other_user}","gists_url":"https://api.github.com/users/newcontext-oss/gists{/gist_id}","starred_url":"https://api.github.com/users/newcontext-oss/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/newcontext-oss/subscriptions","organizations_url":"https://api.github.com/users/newcontext-oss/orgs","repos_url":"https://api.github.com/users/newcontext-oss/repos","events_url":"https://api.github.com/users/newcontext-oss/events{/privacy}","received_events_url":"https://api.github.com/users/newcontext-oss/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/newcontext-oss/terraform-provider-vault","description":"Terraform Vault provider","fork":true,"url":"https://api.github.com/repos/newcontext-oss/terraform-provider-vault","forks_url":"https://api.github.com/repos/newcontext-oss/terraform-provider-vault/forks","keys_url":"https://api.github.com/repos/newcontext-oss/terraform-provider-vault/keys{/key_id}","collaborators_url":"https://api.github.com/repos/newcontext-oss/terraform-provider-vault/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/newcontext-oss/terraform-provider-vault/teams","hooks_url":"https://api.github.com/repos/newcontext-oss/terraform-provider-vault/hooks","issue_events_url":"https://api.github.com/repos/newcontext-oss/terraform-provider-vault/issues/events{/number}","events_url":"https://api.github.com/repos/newcontext-oss/terraform-provider-vault/events","assignees_url":"https://api.github.com/repos/newcontext-oss/terraform-provider-vault/assignees{/user}","branches_url":"https://api.github.com/repos/newcontext-oss/terraform-provider-vault/branches{/branch}","tags_url":"https://api.github.com/repos/newcontext-oss/terraform-provider-vault/tags","blobs_url":"https://api.github.com/repos/newcontext-oss/terraform-provider-vault/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/newcontext-oss/terraform-provider-vault/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/newcontext-oss/terraform-provider-vault/git/refs{/sha}","trees_url":"https://api.github.com/repos/newcontext-oss/terraform-provider-vault/git/trees{/sha}","statuses_url":"https://api.github.com/repos/newcontext-oss/terraform-provider-vault/statuses/{sha}","languages_url":"https://api.github.com/repos/newcontext-oss/terraform-provider-vault/languages","stargazers_url":"https://api.github.com/repos/newcontext-oss/terraform-provider-vault/stargazers","contributors_url":"https://api.github.com/repos/newcontext-oss/terraform-provider-vault/contributors","subscribers_url":"https://api.github.com/repos/newcontext-oss/terraform-provider-vault/subscribers","subscription_url":"https://api.github.com/repos/newcontext-oss/terraform-provider-vault/subscription","commits_url":"https://api.github.com/repos/newcontext-oss/terraform-provider-vault/commits{/sha}","git_commits_url":"https://api.github.com/repos/newcontext-oss/terraform-provider-vault/git/commits{/sha}","comments_url":"https://api.github.com/repos/newcontext-oss/terraform-provider-vault/comments{/number}","issue_comment_url":"https://api.github.com/repos/newcontext-oss/terraform-provider-vault/issues/comments{/number}","contents_url":"https://api.github.com/repos/newcontext-oss/terraform-provider-vault/contents/{+path}","compare_url":"https://api.github.com/repos/newcontext-oss/terraform-provider-vault/compare/{base}...{head}","merges_url":"https://api.github.com/repos/newcontext-oss/terraform-provider-vault/merges","archive_url":"https://api.github.com/repos/newcontext-oss/terraform-provider-vault/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/newcontext-oss/terraform-provider-vault/downloads","issues_url":"https://api.github.com/repos/newcontext-oss/terraform-provider-vault/issues{/number}","pulls_url":"https://api.github.com/repos/newcontext-oss/terraform-provider-vault/pulls{/number}","milestones_url":"https://api.github.com/repos/newcontext-oss/terraform-provider-vault/milestones{/number}","notifications_url":"https://api.github.com/repos/newcontext-oss/terraform-provider-vault/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/newcontext-oss/terraform-provider-vault/labels{/name}","releases_url":"https://api.github.com/repos/newcontext-oss/terraform-provider-vault/releases{/id}","deployments_url":"https://api.github.com/repos/newcontext-oss/terraform-provider-vault/deployments","created_at":"2018-05-10T21:40:38Z","updated_at":"2018-05-14T22:45:29Z","pushed_at":"2018-05-14T22:45:27Z","git_url":"git://github.com/newcontext-oss/terraform-provider-vault.git","ssh_url":"git@github.com:newcontext-oss/terraform-provider-vault.git","clone_url":"https://github.com/newcontext-oss/terraform-provider-vault.git","svn_url":"https://github.com/newcontext-oss/terraform-provider-vault","homepage":"https://www.terraform.io/docs/providers/vault/","size":2229,"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":{"key":"mpl-2.0","name":"Mozilla Public License 2.0","spdx_id":"MPL-2.0","url":"https://api.github.com/licenses/mpl-2.0","node_id":"MDc6TGljZW5zZTE0"},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"terraform-providers:master","ref":"master","sha":"93a146bf1e0cf065c8c1ce8061ecdcb25e168820","user":{"login":"terraform-providers","id":29154831,"node_id":"MDEyOk9yZ2FuaXphdGlvbjI5MTU0ODMx","avatar_url":"https://avatars0.githubusercontent.com/u/29154831?v=4","gravatar_id":"","url":"https://api.github.com/users/terraform-providers","html_url":"https://github.com/terraform-providers","followers_url":"https://api.github.com/users/terraform-providers/followers","following_url":"https://api.github.com/users/terraform-providers/following{/other_user}","gists_url":"https://api.github.com/users/terraform-providers/gists{/gist_id}","starred_url":"https://api.github.com/users/terraform-providers/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/terraform-providers/subscriptions","organizations_url":"https://api.github.com/users/terraform-providers/orgs","repos_url":"https://api.github.com/users/terraform-providers/repos","events_url":"https://api.github.com/users/terraform-providers/events{/privacy}","received_events_url":"https://api.github.com/users/terraform-providers/received_events","type":"Organization","site_admin":false},"repo":{"id":93446120,"node_id":"MDEwOlJlcG9zaXRvcnk5MzQ0NjEyMA==","name":"terraform-provider-vault","full_name":"terraform-providers/terraform-provider-vault","private":false,"owner":{"login":"terraform-providers","id":29154831,"node_id":"MDEyOk9yZ2FuaXphdGlvbjI5MTU0ODMx","avatar_url":"https://avatars0.githubusercontent.com/u/29154831?v=4","gravatar_id":"","url":"https://api.github.com/users/terraform-providers","html_url":"https://github.com/terraform-providers","followers_url":"https://api.github.com/users/terraform-providers/followers","following_url":"https://api.github.com/users/terraform-providers/following{/other_user}","gists_url":"https://api.github.com/users/terraform-providers/gists{/gist_id}","starred_url":"https://api.github.com/users/terraform-providers/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/terraform-providers/subscriptions","organizations_url":"https://api.github.com/users/terraform-providers/orgs","repos_url":"https://api.github.com/users/terraform-providers/repos","events_url":"https://api.github.com/users/terraform-providers/events{/privacy}","received_events_url":"https://api.github.com/users/terraform-providers/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/terraform-providers/terraform-provider-vault","description":"Terraform Vault provider","fork":false,"url":"https://api.github.com/repos/terraform-providers/terraform-provider-vault","forks_url":"https://api.github.com/repos/terraform-providers/terraform-provider-vault/forks","keys_url":"https://api.github.com/repos/terraform-providers/terraform-provider-vault/keys{/key_id}","collaborators_url":"https://api.github.com/repos/terraform-providers/terraform-provider-vault/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/terraform-providers/terraform-provider-vault/teams","hooks_url":"https://api.github.com/repos/terraform-providers/terraform-provider-vault/hooks","issue_events_url":"https://api.github.com/repos/terraform-providers/terraform-provider-vault/issues/events{/number}","events_url":"https://api.github.com/repos/terraform-providers/terraform-provider-vault/events","assignees_url":"https://api.github.com/repos/terraform-providers/terraform-provider-vault/assignees{/user}","branches_url":"https://api.github.com/repos/terraform-providers/terraform-provider-vault/branches{/branch}","tags_url":"https://api.github.com/repos/terraform-providers/terraform-provider-vault/tags","blobs_url":"https://api.github.com/repos/terraform-providers/terraform-provider-vault/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/terraform-providers/terraform-provider-vault/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/terraform-providers/terraform-provider-vault/git/refs{/sha}","trees_url":"https://api.github.com/repos/terraform-providers/terraform-provider-vault/git/trees{/sha}","statuses_url":"https://api.github.com/repos/terraform-providers/terraform-provider-vault/statuses/{sha}","languages_url":"https://api.github.com/repos/terraform-providers/terraform-provider-vault/languages","stargazers_url":"https://api.github.com/repos/terraform-providers/terraform-provider-vault/stargazers","contributors_url":"https://api.github.com/repos/terraform-providers/terraform-provider-vault/contributors","subscribers_url":"https://api.github.com/repos/terraform-providers/terraform-provider-vault/subscribers","subscription_url":"https://api.github.com/repos/terraform-providers/terraform-provider-vault/subscription","commits_url":"https://api.github.com/repos/terraform-providers/terraform-provider-vault/commits{/sha}","git_commits_url":"https://api.github.com/repos/terraform-providers/terraform-provider-vault/git/commits{/sha}","comments_url":"https://api.github.com/repos/terraform-providers/terraform-provider-vault/comments{/number}","issue_comment_url":"https://api.github.com/repos/terraform-providers/terraform-provider-vault/issues/comments{/number}","contents_url":"https://api.github.com/repos/terraform-providers/terraform-provider-vault/contents/{+path}","compare_url":"https://api.github.com/repos/terraform-providers/terraform-provider-vault/compare/{base}...{head}","merges_url":"https://api.github.com/repos/terraform-providers/terraform-provider-vault/merges","archive_url":"https://api.github.com/repos/terraform-providers/terraform-provider-vault/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/terraform-providers/terraform-provider-vault/downloads","issues_url":"https://api.github.com/repos/terraform-providers/terraform-provider-vault/issues{/number}","pulls_url":"https://api.github.com/repos/terraform-providers/terraform-provider-vault/pulls{/number}","milestones_url":"https://api.github.com/repos/terraform-providers/terraform-provider-vault/milestones{/number}","notifications_url":"https://api.github.com/repos/terraform-providers/terraform-provider-vault/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/terraform-providers/terraform-provider-vault/labels{/name}","releases_url":"https://api.github.com/repos/terraform-providers/terraform-provider-vault/releases{/id}","deployments_url":"https://api.github.com/repos/terraform-providers/terraform-provider-vault/deployments","created_at":"2017-06-05T20:54:13Z","updated_at":"2018-09-19T05:53:33Z","pushed_at":"2018-09-19T15:37:35Z","git_url":"git://github.com/terraform-providers/terraform-provider-vault.git","ssh_url":"git@github.com:terraform-providers/terraform-provider-vault.git","clone_url":"https://github.com/terraform-providers/terraform-provider-vault.git","svn_url":"https://github.com/terraform-providers/terraform-provider-vault","homepage":"https://www.terraform.io/docs/providers/vault/","size":4888,"stargazers_count":70,"watchers_count":70,"language":"Go","has_issues":true,"has_projects":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":86,"mirror_url":null,"archived":false,"open_issues_count":74,"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","node_id":"MDc6TGljZW5zZTE0"},"forks":86,"open_issues":74,"watchers":70,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/terraform-providers/terraform-provider-vault/pulls/120"},"html":{"href":"https://github.com/terraform-providers/terraform-provider-vault/pull/120"},"issue":{"href":"https://api.github.com/repos/terraform-providers/terraform-provider-vault/issues/120"},"comments":{"href":"https://api.github.com/repos/terraform-providers/terraform-provider-vault/issues/120/comments"},"review_comments":{"href":"https://api.github.com/repos/terraform-providers/terraform-provider-vault/pulls/120/comments"},"review_comment":{"href":"https://api.github.com/repos/terraform-providers/terraform-provider-vault/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/terraform-providers/terraform-provider-vault/pulls/120/commits"},"statuses":{"href":"https://api.github.com/repos/terraform-providers/terraform-provider-vault/statuses/e89ca6413330d5c76092c876ec5df51c717dd547"}},"author_association":"NONE"}}
{"actor":{"display_login":"tyrannosaurus-becks"}}