{"action":"created","comment":{"url":"https://api.github.com/repos/hashicorp/vault/pulls/comments/96532922","pull_request_review_id":17117293,"id":96532922,"diff_hunk":"@@ -0,0 +1,107 @@\n+package chefNode\n+\n+import (\n+\t\"strings\"\n+\n+\t\"github.com/hashicorp/vault/helper/policyutil\"\n+\t\"github.com/hashicorp/vault/logical\"\n+\t\"github.com/hashicorp/vault/logical/framework\"\n+)\n+\n+func pathEnvironmentsList(b *backend) *framework.Path {\n+\treturn &framework.Path{\n+\t\tPattern: \"environments/?$\",\n+\t\tCallbacks: map[logical.Operation]framework.OperationFunc{\n+\t\t\tlogical.ListOperation: b.pathEnvironmentList,\n+\t\t},\n+\t}\n+}\n+\n+func pathEnvironments(b *backend) *framework.Path {\n+\treturn &framework.Path{\n+\t\tPattern: `environment/(?P<name>.+)`,","path":"builtin/credential/chef-node/path_environment.go","position":22,"original_position":22,"commit_id":"98144a133ec42567ce70d2a819ddb606d897254f","original_commit_id":"98144a133ec42567ce70d2a819ddb606d897254f","user":{"login":"nhuff","id":348102,"avatar_url":"https://avatars.githubusercontent.com/u/348102?v=3","gravatar_id":"","url":"https://api.github.com/users/nhuff","html_url":"https://github.com/nhuff","followers_url":"https://api.github.com/users/nhuff/followers","following_url":"https://api.github.com/users/nhuff/following{/other_user}","gists_url":"https://api.github.com/users/nhuff/gists{/gist_id}","starred_url":"https://api.github.com/users/nhuff/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nhuff/subscriptions","organizations_url":"https://api.github.com/users/nhuff/orgs","repos_url":"https://api.github.com/users/nhuff/repos","events_url":"https://api.github.com/users/nhuff/events{/privacy}","received_events_url":"https://api.github.com/users/nhuff/received_events","type":"User","site_admin":false},"body":"Yes you will get the union of the roles.  There didn't really seem to be any standard in the existing backends for how these should be named.  I don't have a strong preference either way.","created_at":"2017-01-17T23:05:12Z","updated_at":"2017-01-17T23:05:12Z","html_url":"https://github.com/hashicorp/vault/pull/2226#discussion_r96532922","pull_request_url":"https://api.github.com/repos/hashicorp/vault/pulls/2226","_links":{"self":{"href":"https://api.github.com/repos/hashicorp/vault/pulls/comments/96532922"},"html":{"href":"https://github.com/hashicorp/vault/pull/2226#discussion_r96532922"},"pull_request":{"href":"https://api.github.com/repos/hashicorp/vault/pulls/2226"}}},"pull_request":{"url":"https://api.github.com/repos/hashicorp/vault/pulls/2226","id":100010538,"html_url":"https://github.com/hashicorp/vault/pull/2226","diff_url":"https://github.com/hashicorp/vault/pull/2226.diff","patch_url":"https://github.com/hashicorp/vault/pull/2226.patch","issue_url":"https://api.github.com/repos/hashicorp/vault/issues/2226","number":2226,"state":"open","locked":false,"title":"Authentication backend for authenticating chef node against chef server","user":{"login":"nhuff","id":348102,"avatar_url":"https://avatars.githubusercontent.com/u/348102?v=3","gravatar_id":"","url":"https://api.github.com/users/nhuff","html_url":"https://github.com/nhuff","followers_url":"https://api.github.com/users/nhuff/followers","following_url":"https://api.github.com/users/nhuff/following{/other_user}","gists_url":"https://api.github.com/users/nhuff/gists{/gist_id}","starred_url":"https://api.github.com/users/nhuff/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nhuff/subscriptions","organizations_url":"https://api.github.com/users/nhuff/orgs","repos_url":"https://api.github.com/users/nhuff/repos","events_url":"https://api.github.com/users/nhuff/events{/privacy}","received_events_url":"https://api.github.com/users/nhuff/received_events","type":"User","site_admin":false},"body":"First off this isn't ready to merge yet, but it is far enough along that I would like to get some feedback.\r\n\r\nThis backend allows a chef node to authenticate itself using its client key.  The basic flow is\r\n1. Client creates a request to login endpoint with mixlib-authentication headers.\r\n2. Vault gets the user id from the request headers and requests the public key from the chef server\r\n3. Vault authenticates the header signature from the request\r\n4. Vault looks up the node information for the client\r\n5. Policies are calculated based on the chef environment, roles, and tags of the client \r\n\r\nThe required configuration for the backend is\r\n* base_url: The URL to the chef server's API endpoint\r\n* client_name: The name of the client set up in the chef server for vault to connect with\r\n* client_key: The private key for the client set up in the chef server for vault to connect with\r\n\r\nThe main issue that I ran into was that HTTP headers aren't really maintained in any of the internal structures.  I had to extend the logical.Connection struct to include the HTTP headers so that I could access them from a logical backend.  This also shows up in the cli implementation that I added.  I have to drop down to using a raw http.Request and http.Client because none of the api.client methods have a way to set request headers. \r\n\r\nI still need to create documentation and tests for the backend, but I wanted get some feedback on whether people thought the general direction was a good one.","created_at":"2017-01-03T19:51:47Z","updated_at":"2017-01-17T23:05:12Z","closed_at":null,"merged_at":null,"merge_commit_sha":"0df0f5f2be4e4fb413802b2fd28df2e5815fd78f","assignee":null,"assignees":[],"milestone":{"url":"https://api.github.com/repos/hashicorp/vault/milestones/15","html_url":"https://github.com/hashicorp/vault/milestone/15","labels_url":"https://api.github.com/repos/hashicorp/vault/milestones/15/labels","id":2201587,"number":15,"title":"0.6.5","description":"","creator":{"login":"jefferai","id":28627,"avatar_url":"https://avatars.githubusercontent.com/u/28627?v=3","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},"open_issues":29,"closed_issues":24,"state":"open","created_at":"2016-12-16T20:48:32Z","updated_at":"2017-01-17T21:45:36Z","due_on":null,"closed_at":null},"commits_url":"https://api.github.com/repos/hashicorp/vault/pulls/2226/commits","review_comments_url":"https://api.github.com/repos/hashicorp/vault/pulls/2226/comments","review_comment_url":"https://api.github.com/repos/hashicorp/vault/pulls/comments{/number}","comments_url":"https://api.github.com/repos/hashicorp/vault/issues/2226/comments","statuses_url":"https://api.github.com/repos/hashicorp/vault/statuses/98144a133ec42567ce70d2a819ddb606d897254f","head":{"label":"nhuff:chef-node","ref":"chef-node","sha":"98144a133ec42567ce70d2a819ddb606d897254f","user":{"login":"nhuff","id":348102,"avatar_url":"https://avatars.githubusercontent.com/u/348102?v=3","gravatar_id":"","url":"https://api.github.com/users/nhuff","html_url":"https://github.com/nhuff","followers_url":"https://api.github.com/users/nhuff/followers","following_url":"https://api.github.com/users/nhuff/following{/other_user}","gists_url":"https://api.github.com/users/nhuff/gists{/gist_id}","starred_url":"https://api.github.com/users/nhuff/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nhuff/subscriptions","organizations_url":"https://api.github.com/users/nhuff/orgs","repos_url":"https://api.github.com/users/nhuff/repos","events_url":"https://api.github.com/users/nhuff/events{/privacy}","received_events_url":"https://api.github.com/users/nhuff/received_events","type":"User","site_admin":false},"repo":{"id":76066052,"name":"vault","full_name":"nhuff/vault","owner":{"login":"nhuff","id":348102,"avatar_url":"https://avatars.githubusercontent.com/u/348102?v=3","gravatar_id":"","url":"https://api.github.com/users/nhuff","html_url":"https://github.com/nhuff","followers_url":"https://api.github.com/users/nhuff/followers","following_url":"https://api.github.com/users/nhuff/following{/other_user}","gists_url":"https://api.github.com/users/nhuff/gists{/gist_id}","starred_url":"https://api.github.com/users/nhuff/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nhuff/subscriptions","organizations_url":"https://api.github.com/users/nhuff/orgs","repos_url":"https://api.github.com/users/nhuff/repos","events_url":"https://api.github.com/users/nhuff/events{/privacy}","received_events_url":"https://api.github.com/users/nhuff/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/nhuff/vault","description":"A tool for managing secrets.","fork":true,"url":"https://api.github.com/repos/nhuff/vault","forks_url":"https://api.github.com/repos/nhuff/vault/forks","keys_url":"https://api.github.com/repos/nhuff/vault/keys{/key_id}","collaborators_url":"https://api.github.com/repos/nhuff/vault/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/nhuff/vault/teams","hooks_url":"https://api.github.com/repos/nhuff/vault/hooks","issue_events_url":"https://api.github.com/repos/nhuff/vault/issues/events{/number}","events_url":"https://api.github.com/repos/nhuff/vault/events","assignees_url":"https://api.github.com/repos/nhuff/vault/assignees{/user}","branches_url":"https://api.github.com/repos/nhuff/vault/branches{/branch}","tags_url":"https://api.github.com/repos/nhuff/vault/tags","blobs_url":"https://api.github.com/repos/nhuff/vault/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/nhuff/vault/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/nhuff/vault/git/refs{/sha}","trees_url":"https://api.github.com/repos/nhuff/vault/git/trees{/sha}","statuses_url":"https://api.github.com/repos/nhuff/vault/statuses/{sha}","languages_url":"https://api.github.com/repos/nhuff/vault/languages","stargazers_url":"https://api.github.com/repos/nhuff/vault/stargazers","contributors_url":"https://api.github.com/repos/nhuff/vault/contributors","subscribers_url":"https://api.github.com/repos/nhuff/vault/subscribers","subscription_url":"https://api.github.com/repos/nhuff/vault/subscription","commits_url":"https://api.github.com/repos/nhuff/vault/commits{/sha}","git_commits_url":"https://api.github.com/repos/nhuff/vault/git/commits{/sha}","comments_url":"https://api.github.com/repos/nhuff/vault/comments{/number}","issue_comment_url":"https://api.github.com/repos/nhuff/vault/issues/comments{/number}","contents_url":"https://api.github.com/repos/nhuff/vault/contents/{+path}","compare_url":"https://api.github.com/repos/nhuff/vault/compare/{base}...{head}","merges_url":"https://api.github.com/repos/nhuff/vault/merges","archive_url":"https://api.github.com/repos/nhuff/vault/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/nhuff/vault/downloads","issues_url":"https://api.github.com/repos/nhuff/vault/issues{/number}","pulls_url":"https://api.github.com/repos/nhuff/vault/pulls{/number}","milestones_url":"https://api.github.com/repos/nhuff/vault/milestones{/number}","notifications_url":"https://api.github.com/repos/nhuff/vault/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/nhuff/vault/labels{/name}","releases_url":"https://api.github.com/repos/nhuff/vault/releases{/id}","deployments_url":"https://api.github.com/repos/nhuff/vault/deployments","created_at":"2016-12-09T19:58:53Z","updated_at":"2016-12-09T19:58:55Z","pushed_at":"2017-01-12T19:12:05Z","git_url":"git://github.com/nhuff/vault.git","ssh_url":"git@github.com:nhuff/vault.git","clone_url":"https://github.com/nhuff/vault.git","svn_url":"https://github.com/nhuff/vault","homepage":"https://www.vaultproject.io/","size":20033,"stargazers_count":0,"watchers_count":0,"language":"Go","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"hashicorp:master","ref":"master","sha":"e086a81353e0c19c872f2b90031be42bb35486dd","user":{"login":"hashicorp","id":761456,"avatar_url":"https://avatars.githubusercontent.com/u/761456?v=3","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://avatars.githubusercontent.com/u/761456?v=3","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 managing secrets.","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":"2017-01-17T17:29:58Z","pushed_at":"2017-01-17T21:45:36Z","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":21159,"stargazers_count":6008,"watchers_count":6008,"language":"Go","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":726,"mirror_url":null,"open_issues_count":231,"forks":726,"open_issues":231,"watchers":6008,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/hashicorp/vault/pulls/2226"},"html":{"href":"https://github.com/hashicorp/vault/pull/2226"},"issue":{"href":"https://api.github.com/repos/hashicorp/vault/issues/2226"},"comments":{"href":"https://api.github.com/repos/hashicorp/vault/issues/2226/comments"},"review_comments":{"href":"https://api.github.com/repos/hashicorp/vault/pulls/2226/comments"},"review_comment":{"href":"https://api.github.com/repos/hashicorp/vault/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/hashicorp/vault/pulls/2226/commits"},"statuses":{"href":"https://api.github.com/repos/hashicorp/vault/statuses/98144a133ec42567ce70d2a819ddb606d897254f"}}}}
{"actor":{"display_login":"nhuff"}}