{"action":"created","comment":{"url":"https://api.github.com/repos/projectcalico/confd/pulls/comments/231467015","pull_request_review_id":172442069,"id":231467015,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIzMTQ2NzAxNQ==","diff_hunk":"@@ -17,10 +20,11 @@ type fileInfo struct {\n \tMd5  string\n }\n \n-func appendPrefix(prefix string, keys []string) []string {\n+func expandKeys(prefix string, keys []string) []string {\n \ts := make([]string, len(keys))\n \tfor i, k := range keys {\n-\t\ts[i] = path.Join(prefix, k)\n+\t\t// Prepend the prefix and replace \"NODENAME\" in the key by the actual node name.\n+\t\ts[i] = path.Join(prefix, strings.Replace(k, \"NODENAME\", NodeName, 1))","path":"pkg/resource/template/util.go","position":24,"original_position":24,"commit_id":"40ba44407d589f84d88042bd55136296224b3fa0","original_commit_id":"40ba44407d589f84d88042bd55136296224b3fa0","user":{"login":"neiljerram","id":2089263,"node_id":"MDQ6VXNlcjIwODkyNjM=","avatar_url":"https://avatars1.githubusercontent.com/u/2089263?v=4","gravatar_id":"","url":"https://api.github.com/users/neiljerram","html_url":"https://github.com/neiljerram","followers_url":"https://api.github.com/users/neiljerram/followers","following_url":"https://api.github.com/users/neiljerram/following{/other_user}","gists_url":"https://api.github.com/users/neiljerram/gists{/gist_id}","starred_url":"https://api.github.com/users/neiljerram/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/neiljerram/subscriptions","organizations_url":"https://api.github.com/users/neiljerram/orgs","repos_url":"https://api.github.com/users/neiljerram/repos","events_url":"https://api.github.com/users/neiljerram/events{/privacy}","received_events_url":"https://api.github.com/users/neiljerram/received_events","type":"User","site_admin":false},"body":"I believe it's watertight as is.  The substitution is only performed on the \"prefix\" and \"keys\" settings from confd TOML config files, and I don't believe there's any reasonable use case for those to name a specific resource whose path includes NODENAME.\r\n\r\nThat said, I could add an extra layer of defence by:\r\n- changing the uses from (for example) \"/bgp/v1/host/NODENAME\" to \"/bgp/v1/host//NODENAME\" - i.e. doubling the slash before \"NODENAME\"\r\n- `strings.Replace(k, \"//NODENAME\", \"/\"+NodeName, 1)`.\r\n\r\nWDYT?","created_at":"2018-11-07T11:17:24Z","updated_at":"2018-11-07T11:17:24Z","html_url":"https://github.com/projectcalico/confd/pull/172#discussion_r231467015","pull_request_url":"https://api.github.com/repos/projectcalico/confd/pulls/172","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/projectcalico/confd/pulls/comments/231467015"},"html":{"href":"https://github.com/projectcalico/confd/pull/172#discussion_r231467015"},"pull_request":{"href":"https://api.github.com/repos/projectcalico/confd/pulls/172"}},"in_reply_to_id":231286368},"pull_request":{"url":"https://api.github.com/repos/projectcalico/confd/pulls/172","id":228773388,"node_id":"MDExOlB1bGxSZXF1ZXN0MjI4NzczMzg4","html_url":"https://github.com/projectcalico/confd/pull/172","diff_url":"https://github.com/projectcalico/confd/pull/172.diff","patch_url":"https://github.com/projectcalico/confd/pull/172.patch","issue_url":"https://api.github.com/repos/projectcalico/confd/issues/172","number":172,"state":"open","locked":false,"title":"Static route advertisement","user":{"login":"neiljerram","id":2089263,"node_id":"MDQ6VXNlcjIwODkyNjM=","avatar_url":"https://avatars1.githubusercontent.com/u/2089263?v=4","gravatar_id":"","url":"https://api.github.com/users/neiljerram","html_url":"https://github.com/neiljerram","followers_url":"https://api.github.com/users/neiljerram/followers","following_url":"https://api.github.com/users/neiljerram/following{/other_user}","gists_url":"https://api.github.com/users/neiljerram/gists{/gist_id}","starred_url":"https://api.github.com/users/neiljerram/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/neiljerram/subscriptions","organizations_url":"https://api.github.com/users/neiljerram/orgs","repos_url":"https://api.github.com/users/neiljerram/repos","events_url":"https://api.github.com/users/neiljerram/events{/privacy}","received_events_url":"https://api.github.com/users/neiljerram/received_events","type":"User","site_admin":false},"body":"","created_at":"2018-11-06T17:26:54Z","updated_at":"2018-11-07T11:17:24Z","closed_at":null,"merged_at":null,"merge_commit_sha":"b412cf7124198a07d4ff676ccaa14f15b8a8cecf","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/projectcalico/confd/pulls/172/commits","review_comments_url":"https://api.github.com/repos/projectcalico/confd/pulls/172/comments","review_comment_url":"https://api.github.com/repos/projectcalico/confd/pulls/comments{/number}","comments_url":"https://api.github.com/repos/projectcalico/confd/issues/172/comments","statuses_url":"https://api.github.com/repos/projectcalico/confd/statuses/40ba44407d589f84d88042bd55136296224b3fa0","head":{"label":"neiljerram:service-ip-advertisement-mvp","ref":"service-ip-advertisement-mvp","sha":"40ba44407d589f84d88042bd55136296224b3fa0","user":{"login":"neiljerram","id":2089263,"node_id":"MDQ6VXNlcjIwODkyNjM=","avatar_url":"https://avatars1.githubusercontent.com/u/2089263?v=4","gravatar_id":"","url":"https://api.github.com/users/neiljerram","html_url":"https://github.com/neiljerram","followers_url":"https://api.github.com/users/neiljerram/followers","following_url":"https://api.github.com/users/neiljerram/following{/other_user}","gists_url":"https://api.github.com/users/neiljerram/gists{/gist_id}","starred_url":"https://api.github.com/users/neiljerram/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/neiljerram/subscriptions","organizations_url":"https://api.github.com/users/neiljerram/orgs","repos_url":"https://api.github.com/users/neiljerram/repos","events_url":"https://api.github.com/users/neiljerram/events{/privacy}","received_events_url":"https://api.github.com/users/neiljerram/received_events","type":"User","site_admin":false},"repo":{"id":112494676,"node_id":"MDEwOlJlcG9zaXRvcnkxMTI0OTQ2NzY=","name":"confd","full_name":"neiljerram/confd","private":false,"owner":{"login":"neiljerram","id":2089263,"node_id":"MDQ6VXNlcjIwODkyNjM=","avatar_url":"https://avatars1.githubusercontent.com/u/2089263?v=4","gravatar_id":"","url":"https://api.github.com/users/neiljerram","html_url":"https://github.com/neiljerram","followers_url":"https://api.github.com/users/neiljerram/followers","following_url":"https://api.github.com/users/neiljerram/following{/other_user}","gists_url":"https://api.github.com/users/neiljerram/gists{/gist_id}","starred_url":"https://api.github.com/users/neiljerram/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/neiljerram/subscriptions","organizations_url":"https://api.github.com/users/neiljerram/orgs","repos_url":"https://api.github.com/users/neiljerram/repos","events_url":"https://api.github.com/users/neiljerram/events{/privacy}","received_events_url":"https://api.github.com/users/neiljerram/received_events","type":"User","site_admin":false},"html_url":"https://github.com/neiljerram/confd","description":"Manage Calico BGP configuration files using templates and data from the Calico datastore","fork":true,"url":"https://api.github.com/repos/neiljerram/confd","forks_url":"https://api.github.com/repos/neiljerram/confd/forks","keys_url":"https://api.github.com/repos/neiljerram/confd/keys{/key_id}","collaborators_url":"https://api.github.com/repos/neiljerram/confd/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/neiljerram/confd/teams","hooks_url":"https://api.github.com/repos/neiljerram/confd/hooks","issue_events_url":"https://api.github.com/repos/neiljerram/confd/issues/events{/number}","events_url":"https://api.github.com/repos/neiljerram/confd/events","assignees_url":"https://api.github.com/repos/neiljerram/confd/assignees{/user}","branches_url":"https://api.github.com/repos/neiljerram/confd/branches{/branch}","tags_url":"https://api.github.com/repos/neiljerram/confd/tags","blobs_url":"https://api.github.com/repos/neiljerram/confd/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/neiljerram/confd/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/neiljerram/confd/git/refs{/sha}","trees_url":"https://api.github.com/repos/neiljerram/confd/git/trees{/sha}","statuses_url":"https://api.github.com/repos/neiljerram/confd/statuses/{sha}","languages_url":"https://api.github.com/repos/neiljerram/confd/languages","stargazers_url":"https://api.github.com/repos/neiljerram/confd/stargazers","contributors_url":"https://api.github.com/repos/neiljerram/confd/contributors","subscribers_url":"https://api.github.com/repos/neiljerram/confd/subscribers","subscription_url":"https://api.github.com/repos/neiljerram/confd/subscription","commits_url":"https://api.github.com/repos/neiljerram/confd/commits{/sha}","git_commits_url":"https://api.github.com/repos/neiljerram/confd/git/commits{/sha}","comments_url":"https://api.github.com/repos/neiljerram/confd/comments{/number}","issue_comment_url":"https://api.github.com/repos/neiljerram/confd/issues/comments{/number}","contents_url":"https://api.github.com/repos/neiljerram/confd/contents/{+path}","compare_url":"https://api.github.com/repos/neiljerram/confd/compare/{base}...{head}","merges_url":"https://api.github.com/repos/neiljerram/confd/merges","archive_url":"https://api.github.com/repos/neiljerram/confd/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/neiljerram/confd/downloads","issues_url":"https://api.github.com/repos/neiljerram/confd/issues{/number}","pulls_url":"https://api.github.com/repos/neiljerram/confd/pulls{/number}","milestones_url":"https://api.github.com/repos/neiljerram/confd/milestones{/number}","notifications_url":"https://api.github.com/repos/neiljerram/confd/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/neiljerram/confd/labels{/name}","releases_url":"https://api.github.com/repos/neiljerram/confd/releases{/id}","deployments_url":"https://api.github.com/repos/neiljerram/confd/deployments","created_at":"2017-11-29T15:46:17Z","updated_at":"2018-11-06T13:40:14Z","pushed_at":"2018-11-06T17:25:56Z","git_url":"git://github.com/neiljerram/confd.git","ssh_url":"git@github.com:neiljerram/confd.git","clone_url":"https://github.com/neiljerram/confd.git","svn_url":"https://github.com/neiljerram/confd","homepage":"","size":6690,"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":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"projectcalico:master","ref":"master","sha":"cd613ca2be3d5de2160d749debb44b7ab9b2045f","user":{"login":"projectcalico","id":12304728,"node_id":"MDEyOk9yZ2FuaXphdGlvbjEyMzA0NzI4","avatar_url":"https://avatars3.githubusercontent.com/u/12304728?v=4","gravatar_id":"","url":"https://api.github.com/users/projectcalico","html_url":"https://github.com/projectcalico","followers_url":"https://api.github.com/users/projectcalico/followers","following_url":"https://api.github.com/users/projectcalico/following{/other_user}","gists_url":"https://api.github.com/users/projectcalico/gists{/gist_id}","starred_url":"https://api.github.com/users/projectcalico/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/projectcalico/subscriptions","organizations_url":"https://api.github.com/users/projectcalico/orgs","repos_url":"https://api.github.com/users/projectcalico/repos","events_url":"https://api.github.com/users/projectcalico/events{/privacy}","received_events_url":"https://api.github.com/users/projectcalico/received_events","type":"Organization","site_admin":false},"repo":{"id":40964918,"node_id":"MDEwOlJlcG9zaXRvcnk0MDk2NDkxOA==","name":"confd","full_name":"projectcalico/confd","private":false,"owner":{"login":"projectcalico","id":12304728,"node_id":"MDEyOk9yZ2FuaXphdGlvbjEyMzA0NzI4","avatar_url":"https://avatars3.githubusercontent.com/u/12304728?v=4","gravatar_id":"","url":"https://api.github.com/users/projectcalico","html_url":"https://github.com/projectcalico","followers_url":"https://api.github.com/users/projectcalico/followers","following_url":"https://api.github.com/users/projectcalico/following{/other_user}","gists_url":"https://api.github.com/users/projectcalico/gists{/gist_id}","starred_url":"https://api.github.com/users/projectcalico/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/projectcalico/subscriptions","organizations_url":"https://api.github.com/users/projectcalico/orgs","repos_url":"https://api.github.com/users/projectcalico/repos","events_url":"https://api.github.com/users/projectcalico/events{/privacy}","received_events_url":"https://api.github.com/users/projectcalico/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/projectcalico/confd","description":"Manage Calico BGP configuration files using templates and data from the Calico datastore","fork":true,"url":"https://api.github.com/repos/projectcalico/confd","forks_url":"https://api.github.com/repos/projectcalico/confd/forks","keys_url":"https://api.github.com/repos/projectcalico/confd/keys{/key_id}","collaborators_url":"https://api.github.com/repos/projectcalico/confd/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/projectcalico/confd/teams","hooks_url":"https://api.github.com/repos/projectcalico/confd/hooks","issue_events_url":"https://api.github.com/repos/projectcalico/confd/issues/events{/number}","events_url":"https://api.github.com/repos/projectcalico/confd/events","assignees_url":"https://api.github.com/repos/projectcalico/confd/assignees{/user}","branches_url":"https://api.github.com/repos/projectcalico/confd/branches{/branch}","tags_url":"https://api.github.com/repos/projectcalico/confd/tags","blobs_url":"https://api.github.com/repos/projectcalico/confd/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/projectcalico/confd/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/projectcalico/confd/git/refs{/sha}","trees_url":"https://api.github.com/repos/projectcalico/confd/git/trees{/sha}","statuses_url":"https://api.github.com/repos/projectcalico/confd/statuses/{sha}","languages_url":"https://api.github.com/repos/projectcalico/confd/languages","stargazers_url":"https://api.github.com/repos/projectcalico/confd/stargazers","contributors_url":"https://api.github.com/repos/projectcalico/confd/contributors","subscribers_url":"https://api.github.com/repos/projectcalico/confd/subscribers","subscription_url":"https://api.github.com/repos/projectcalico/confd/subscription","commits_url":"https://api.github.com/repos/projectcalico/confd/commits{/sha}","git_commits_url":"https://api.github.com/repos/projectcalico/confd/git/commits{/sha}","comments_url":"https://api.github.com/repos/projectcalico/confd/comments{/number}","issue_comment_url":"https://api.github.com/repos/projectcalico/confd/issues/comments{/number}","contents_url":"https://api.github.com/repos/projectcalico/confd/contents/{+path}","compare_url":"https://api.github.com/repos/projectcalico/confd/compare/{base}...{head}","merges_url":"https://api.github.com/repos/projectcalico/confd/merges","archive_url":"https://api.github.com/repos/projectcalico/confd/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/projectcalico/confd/downloads","issues_url":"https://api.github.com/repos/projectcalico/confd/issues{/number}","pulls_url":"https://api.github.com/repos/projectcalico/confd/pulls{/number}","milestones_url":"https://api.github.com/repos/projectcalico/confd/milestones{/number}","notifications_url":"https://api.github.com/repos/projectcalico/confd/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/projectcalico/confd/labels{/name}","releases_url":"https://api.github.com/repos/projectcalico/confd/releases{/id}","deployments_url":"https://api.github.com/repos/projectcalico/confd/deployments","created_at":"2015-08-18T10:07:52Z","updated_at":"2018-11-06T04:19:24Z","pushed_at":"2018-11-06T17:26:55Z","git_url":"git://github.com/projectcalico/confd.git","ssh_url":"git@github.com:projectcalico/confd.git","clone_url":"https://github.com/projectcalico/confd.git","svn_url":"https://github.com/projectcalico/confd","homepage":"","size":6698,"stargazers_count":10,"watchers_count":10,"language":"Go","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":23,"mirror_url":null,"archived":false,"open_issues_count":2,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":23,"open_issues":2,"watchers":10,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/projectcalico/confd/pulls/172"},"html":{"href":"https://github.com/projectcalico/confd/pull/172"},"issue":{"href":"https://api.github.com/repos/projectcalico/confd/issues/172"},"comments":{"href":"https://api.github.com/repos/projectcalico/confd/issues/172/comments"},"review_comments":{"href":"https://api.github.com/repos/projectcalico/confd/pulls/172/comments"},"review_comment":{"href":"https://api.github.com/repos/projectcalico/confd/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/projectcalico/confd/pulls/172/commits"},"statuses":{"href":"https://api.github.com/repos/projectcalico/confd/statuses/40ba44407d589f84d88042bd55136296224b3fa0"}},"author_association":"MEMBER"}}
{"actor":{"display_login":"neiljerram"}}