{"action":"created","issue":{"url":"https://api.github.com/repos/hashicorp/consul-template/issues/1083","repository_url":"https://api.github.com/repos/hashicorp/consul-template","labels_url":"https://api.github.com/repos/hashicorp/consul-template/issues/1083/labels{/name}","comments_url":"https://api.github.com/repos/hashicorp/consul-template/issues/1083/comments","events_url":"https://api.github.com/repos/hashicorp/consul-template/issues/1083/events","html_url":"https://github.com/hashicorp/consul-template/issues/1083","id":303260397,"number":1083,"title":"Update DOC: examples vault-pki","user":{"login":"mgriffin13","id":5270404,"avatar_url":"https://avatars2.githubusercontent.com/u/5270404?v=4","gravatar_id":"","url":"https://api.github.com/users/mgriffin13","html_url":"https://github.com/mgriffin13","followers_url":"https://api.github.com/users/mgriffin13/followers","following_url":"https://api.github.com/users/mgriffin13/following{/other_user}","gists_url":"https://api.github.com/users/mgriffin13/gists{/gist_id}","starred_url":"https://api.github.com/users/mgriffin13/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mgriffin13/subscriptions","organizations_url":"https://api.github.com/users/mgriffin13/orgs","repos_url":"https://api.github.com/users/mgriffin13/repos","events_url":"https://api.github.com/users/mgriffin13/events{/privacy}","received_events_url":"https://api.github.com/users/mgriffin13/received_events","type":"User","site_admin":false},"labels":[{"id":137505430,"url":"https://api.github.com/repos/hashicorp/consul-template/labels/documentation","name":"documentation","color":"fef2c0","default":false}],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":5,"created_at":"2018-03-07T21:10:19Z","updated_at":"2018-03-27T22:00:07Z","closed_at":"2018-03-27T22:00:07Z","author_association":"NONE","body":"I would like to propose an update to the ``examples: vault-pki`` documentation.\r\n\r\nThe existing example states that the following is valid to use when writing a ca.crt file.\r\n\r\n```liquid\r\n{{- /* /tmp/ca.tpl */ -}}\r\n{{ with secret \"pki/issue/my-domain-dot-com\" \"common_name=foo.example.com\" }}\r\n{{ .Data.ca_chain }}{{ end }}\r\n```\r\n\r\nIn reality, the ``ca_chain`` field returns an array of all issuing CAs, thus using the example as-is produces an invalid ``ca.crt`` file that begins with the ``[``, like this:\r\n```\r\n[-----BEGIN CERTIFICATE-----\r\nMIIFTTCCAzWgAwIBAgIUbhGwmRe6mky4rd6fBL36pTaUv1cwDQYJK\r\n```\r\n\r\nI would propose changing the example to be ``{{ .Data.issuing_ca }}{{ end }}``, or for a more complete example, you could iterate through the ``ca_chain`` array and write all the CAs:\r\n\r\n```liquid\r\n{{- /* /tmp/ca.tpl */ -}}\r\n{{ with secret \"pki/issue/my-domain-dot-com\" \"common_name=foo.example.com\" }}\r\n{{ range $cert := .Data.ca_chain }}\r\n{{ $cert }}\r\n{{ end }}\r\n{{ end }}\r\n```"},"comment":{"url":"https://api.github.com/repos/hashicorp/consul-template/issues/comments/376689948","html_url":"https://github.com/hashicorp/consul-template/issues/1083#issuecomment-376689948","issue_url":"https://api.github.com/repos/hashicorp/consul-template/issues/1083","id":376689948,"user":{"login":"pearkes","id":846194,"avatar_url":"https://avatars0.githubusercontent.com/u/846194?v=4","gravatar_id":"","url":"https://api.github.com/users/pearkes","html_url":"https://github.com/pearkes","followers_url":"https://api.github.com/users/pearkes/followers","following_url":"https://api.github.com/users/pearkes/following{/other_user}","gists_url":"https://api.github.com/users/pearkes/gists{/gist_id}","starred_url":"https://api.github.com/users/pearkes/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pearkes/subscriptions","organizations_url":"https://api.github.com/users/pearkes/orgs","repos_url":"https://api.github.com/users/pearkes/repos","events_url":"https://api.github.com/users/pearkes/events{/privacy}","received_events_url":"https://api.github.com/users/pearkes/received_events","type":"User","site_admin":false},"created_at":"2018-03-27T22:00:07Z","updated_at":"2018-03-27T22:00:07Z","author_association":"OWNER","body":"Fixed in #1090"}}
{"actor":{"display_login":"pearkes"}}