{"action":"created","comment":{"url":"https://api.github.com/repos/koding/koding/pulls/comments/82816072","pull_request_review_id":3696685,"id":82816072,"diff_hunk":"@@ -106,3 +108,470 @@ func (db *mongoStore) Put(_ string, creds map[string]interface{}) error {\n \n \treturn err\n }\n+\n+type MongoPerm struct {\n+\tAcc  *models.Account\n+\tUser *models.User\n+\tTeam *models.Group\n+\tCred *models.Credential\n+\n+\tRoles  []string\n+\tMember bool\n+}\n+\n+var _ Perm = (*MongoPerm)(nil)\n+\n+func (p *MongoPerm) PermUser() string    { return p.User.Name }\n+func (p *MongoPerm) PermTeam() string    { return p.Team.Slug }\n+func (p *MongoPerm) PermRoles() []string { return p.Roles }\n+\n+type mongoDatabase struct {\n+\t*Options\n+}\n+\n+var _ Database = (*mongoDatabase)(nil)\n+\n+func (db *mongoDatabase) Validate(f *Filter, c *Cred) (Perm, error) {","path":"go/src/koding/kites/kloud/credential/mongo.go","position":63,"original_position":62,"commit_id":"0b9958ec96b6507a1273d328f4ee05bf416bb833","original_commit_id":"56b2601c69422b4e9790ba42bfcf0a01226b33f2","user":{"login":"rjeczalik","id":1162017,"avatar_url":"https://avatars.githubusercontent.com/u/1162017?v=3","gravatar_id":"","url":"https://api.github.com/users/rjeczalik","html_url":"https://github.com/rjeczalik","followers_url":"https://api.github.com/users/rjeczalik/followers","following_url":"https://api.github.com/users/rjeczalik/following{/other_user}","gists_url":"https://api.github.com/users/rjeczalik/gists{/gist_id}","starred_url":"https://api.github.com/users/rjeczalik/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rjeczalik/subscriptions","organizations_url":"https://api.github.com/users/rjeczalik/orgs","repos_url":"https://api.github.com/users/rjeczalik/repos","events_url":"https://api.github.com/users/rjeczalik/events{/privacy}","received_events_url":"https://api.github.com/users/rjeczalik/received_events","type":"User","site_admin":false},"body":"Partially done, refactored, but no tests yet.","created_at":"2016-10-11T15:13:41Z","updated_at":"2016-10-11T15:13:41Z","html_url":"https://github.com/koding/koding/pull/9182#discussion_r82816072","pull_request_url":"https://api.github.com/repos/koding/koding/pulls/9182","_links":{"self":{"href":"https://api.github.com/repos/koding/koding/pulls/comments/82816072"},"html":{"href":"https://github.com/koding/koding/pull/9182#discussion_r82816072"},"pull_request":{"href":"https://api.github.com/repos/koding/koding/pulls/9182"}}},"pull_request":{"url":"https://api.github.com/repos/koding/koding/pulls/9182","id":87710103,"html_url":"https://github.com/koding/koding/pull/9182","diff_url":"https://github.com/koding/koding/pull/9182.diff","patch_url":"https://github.com/koding/koding/pull/9182.patch","issue_url":"https://api.github.com/repos/koding/koding/issues/9182","number":9182,"state":"open","locked":false,"title":"kloud: support importing stacks from a template file","user":{"login":"rjeczalik","id":1162017,"avatar_url":"https://avatars.githubusercontent.com/u/1162017?v=3","gravatar_id":"","url":"https://api.github.com/users/rjeczalik","html_url":"https://github.com/rjeczalik","followers_url":"https://api.github.com/users/rjeczalik/followers","following_url":"https://api.github.com/users/rjeczalik/following{/other_user}","gists_url":"https://api.github.com/users/rjeczalik/gists{/gist_id}","starred_url":"https://api.github.com/users/rjeczalik/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rjeczalik/subscriptions","organizations_url":"https://api.github.com/users/rjeczalik/orgs","repos_url":"https://api.github.com/users/rjeczalik/repos","events_url":"https://api.github.com/users/rjeczalik/events{/privacy}","received_events_url":"https://api.github.com/users/rjeczalik/received_events","type":"User","site_admin":false},"body":"- adds `credential.*`, `import` and `machine.list` methods to kloud\r\n- adds experimental commands `kd build -f`, `kd cred list`, `kd cred add` and `kd cred use`\r\n\r\n## Description \r\n\r\nThe purpose of this PR is to add new API to the kloud to support importing stacks from a template file.\r\n\r\nLast missing piece after merging https://github.com/koding/koding/pull/9052 and open-sourcing https://github.com/koding/kloud-provider-example is to allow for integration testing stack builds, in order to allow assessing contribution with new kloud providers.\r\n\r\nThe idea for integration tests is to extend kd with build subcommand, that would allow for directly building stack templates from command line.\r\n\r\nThe `kd build` is going to be used for integration tests to test building stack in non-interactive mode. \r\n\r\n## Motivation and Context\r\n\r\nMotivation is to to allow for testing kloud providers. And indirectly support stack workflow in KD.\r\nContext is continuation of https://github.com/koding/koding/pull/9052 and https://github.com/koding/koding/pull/9139 and a prerequisite for  [kloud provider issues](https://github.com/koding/koding/issues?q=is%3Aissue+is%3Aopen+support+label%3A%22Category-Stack+Support%22).\r\n\r\nRelated: https://github.com/koding/koding/issues/9024 (this PR partially implements autogenrated schema API)\r\n\r\nDeps: https://github.com/koding/koding/pull/9166\r\n\r\n## How Has This Been Tested?\r\n\r\nIncludes tests plus manual QA.\r\n\r\n## Types of changes\r\n\r\n- [ ] Bug fix (non-breaking change which fixes an issue)\r\n- [x] New feature (non-breaking change which adds functionality)\r\n- [ ] Breaking change (fix or feature that would cause existing functionality to change)\r\n\r\n## Checklist:\r\n\r\n- [ ] My change requires a change to the documentation.\r\n- [ ] I have updated the documentation accordingly.\r\n- [ ] I have added tests to cover my changes.\r\n- [x] All new and existing tests passed.\r\n","created_at":"2016-10-03T12:46:19Z","updated_at":"2016-10-11T15:13:41Z","closed_at":null,"merged_at":null,"merge_commit_sha":"72b32384f7baafab06c5e5d93be1b2710e8de76f","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/koding/koding/pulls/9182/commits","review_comments_url":"https://api.github.com/repos/koding/koding/pulls/9182/comments","review_comment_url":"https://api.github.com/repos/koding/koding/pulls/comments{/number}","comments_url":"https://api.github.com/repos/koding/koding/issues/9182/comments","statuses_url":"https://api.github.com/repos/koding/koding/statuses/0b9958ec96b6507a1273d328f4ee05bf416bb833","head":{"label":"koding:kloud-import","ref":"kloud-import","sha":"0b9958ec96b6507a1273d328f4ee05bf416bb833","user":{"login":"koding","id":1066754,"avatar_url":"https://avatars.githubusercontent.com/u/1066754?v=3","gravatar_id":"","url":"https://api.github.com/users/koding","html_url":"https://github.com/koding","followers_url":"https://api.github.com/users/koding/followers","following_url":"https://api.github.com/users/koding/following{/other_user}","gists_url":"https://api.github.com/users/koding/gists{/gist_id}","starred_url":"https://api.github.com/users/koding/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/koding/subscriptions","organizations_url":"https://api.github.com/users/koding/orgs","repos_url":"https://api.github.com/users/koding/repos","events_url":"https://api.github.com/users/koding/events{/privacy}","received_events_url":"https://api.github.com/users/koding/received_events","type":"Organization","site_admin":false},"repo":{"id":21317360,"name":"koding","full_name":"koding/koding","owner":{"login":"koding","id":1066754,"avatar_url":"https://avatars.githubusercontent.com/u/1066754?v=3","gravatar_id":"","url":"https://api.github.com/users/koding","html_url":"https://github.com/koding","followers_url":"https://api.github.com/users/koding/followers","following_url":"https://api.github.com/users/koding/following{/other_user}","gists_url":"https://api.github.com/users/koding/gists{/gist_id}","starred_url":"https://api.github.com/users/koding/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/koding/subscriptions","organizations_url":"https://api.github.com/users/koding/orgs","repos_url":"https://api.github.com/users/koding/repos","events_url":"https://api.github.com/users/koding/events{/privacy}","received_events_url":"https://api.github.com/users/koding/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/koding/koding","description":"The Simplest Way to Manage Your Entire Dev Infrastructure!","fork":false,"url":"https://api.github.com/repos/koding/koding","forks_url":"https://api.github.com/repos/koding/koding/forks","keys_url":"https://api.github.com/repos/koding/koding/keys{/key_id}","collaborators_url":"https://api.github.com/repos/koding/koding/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/koding/koding/teams","hooks_url":"https://api.github.com/repos/koding/koding/hooks","issue_events_url":"https://api.github.com/repos/koding/koding/issues/events{/number}","events_url":"https://api.github.com/repos/koding/koding/events","assignees_url":"https://api.github.com/repos/koding/koding/assignees{/user}","branches_url":"https://api.github.com/repos/koding/koding/branches{/branch}","tags_url":"https://api.github.com/repos/koding/koding/tags","blobs_url":"https://api.github.com/repos/koding/koding/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/koding/koding/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/koding/koding/git/refs{/sha}","trees_url":"https://api.github.com/repos/koding/koding/git/trees{/sha}","statuses_url":"https://api.github.com/repos/koding/koding/statuses/{sha}","languages_url":"https://api.github.com/repos/koding/koding/languages","stargazers_url":"https://api.github.com/repos/koding/koding/stargazers","contributors_url":"https://api.github.com/repos/koding/koding/contributors","subscribers_url":"https://api.github.com/repos/koding/koding/subscribers","subscription_url":"https://api.github.com/repos/koding/koding/subscription","commits_url":"https://api.github.com/repos/koding/koding/commits{/sha}","git_commits_url":"https://api.github.com/repos/koding/koding/git/commits{/sha}","comments_url":"https://api.github.com/repos/koding/koding/comments{/number}","issue_comment_url":"https://api.github.com/repos/koding/koding/issues/comments{/number}","contents_url":"https://api.github.com/repos/koding/koding/contents/{+path}","compare_url":"https://api.github.com/repos/koding/koding/compare/{base}...{head}","merges_url":"https://api.github.com/repos/koding/koding/merges","archive_url":"https://api.github.com/repos/koding/koding/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/koding/koding/downloads","issues_url":"https://api.github.com/repos/koding/koding/issues{/number}","pulls_url":"https://api.github.com/repos/koding/koding/pulls{/number}","milestones_url":"https://api.github.com/repos/koding/koding/milestones{/number}","notifications_url":"https://api.github.com/repos/koding/koding/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/koding/koding/labels{/name}","releases_url":"https://api.github.com/repos/koding/koding/releases{/id}","deployments_url":"https://api.github.com/repos/koding/koding/deployments","created_at":"2014-06-29T05:46:24Z","updated_at":"2016-10-10T19:59:34Z","pushed_at":"2016-10-11T15:11:22Z","git_url":"git://github.com/koding/koding.git","ssh_url":"git@github.com:koding/koding.git","clone_url":"https://github.com/koding/koding.git","svn_url":"https://github.com/koding/koding","homepage":"https://www.koding.com","size":790991,"stargazers_count":434,"watchers_count":434,"language":"CoffeeScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":45,"mirror_url":null,"open_issues_count":169,"forks":45,"open_issues":169,"watchers":434,"default_branch":"master"}},"base":{"label":"koding:master","ref":"master","sha":"8029494425412fb9fccf4e64ee5b9131d1841f14","user":{"login":"koding","id":1066754,"avatar_url":"https://avatars.githubusercontent.com/u/1066754?v=3","gravatar_id":"","url":"https://api.github.com/users/koding","html_url":"https://github.com/koding","followers_url":"https://api.github.com/users/koding/followers","following_url":"https://api.github.com/users/koding/following{/other_user}","gists_url":"https://api.github.com/users/koding/gists{/gist_id}","starred_url":"https://api.github.com/users/koding/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/koding/subscriptions","organizations_url":"https://api.github.com/users/koding/orgs","repos_url":"https://api.github.com/users/koding/repos","events_url":"https://api.github.com/users/koding/events{/privacy}","received_events_url":"https://api.github.com/users/koding/received_events","type":"Organization","site_admin":false},"repo":{"id":21317360,"name":"koding","full_name":"koding/koding","owner":{"login":"koding","id":1066754,"avatar_url":"https://avatars.githubusercontent.com/u/1066754?v=3","gravatar_id":"","url":"https://api.github.com/users/koding","html_url":"https://github.com/koding","followers_url":"https://api.github.com/users/koding/followers","following_url":"https://api.github.com/users/koding/following{/other_user}","gists_url":"https://api.github.com/users/koding/gists{/gist_id}","starred_url":"https://api.github.com/users/koding/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/koding/subscriptions","organizations_url":"https://api.github.com/users/koding/orgs","repos_url":"https://api.github.com/users/koding/repos","events_url":"https://api.github.com/users/koding/events{/privacy}","received_events_url":"https://api.github.com/users/koding/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/koding/koding","description":"The Simplest Way to Manage Your Entire Dev Infrastructure!","fork":false,"url":"https://api.github.com/repos/koding/koding","forks_url":"https://api.github.com/repos/koding/koding/forks","keys_url":"https://api.github.com/repos/koding/koding/keys{/key_id}","collaborators_url":"https://api.github.com/repos/koding/koding/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/koding/koding/teams","hooks_url":"https://api.github.com/repos/koding/koding/hooks","issue_events_url":"https://api.github.com/repos/koding/koding/issues/events{/number}","events_url":"https://api.github.com/repos/koding/koding/events","assignees_url":"https://api.github.com/repos/koding/koding/assignees{/user}","branches_url":"https://api.github.com/repos/koding/koding/branches{/branch}","tags_url":"https://api.github.com/repos/koding/koding/tags","blobs_url":"https://api.github.com/repos/koding/koding/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/koding/koding/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/koding/koding/git/refs{/sha}","trees_url":"https://api.github.com/repos/koding/koding/git/trees{/sha}","statuses_url":"https://api.github.com/repos/koding/koding/statuses/{sha}","languages_url":"https://api.github.com/repos/koding/koding/languages","stargazers_url":"https://api.github.com/repos/koding/koding/stargazers","contributors_url":"https://api.github.com/repos/koding/koding/contributors","subscribers_url":"https://api.github.com/repos/koding/koding/subscribers","subscription_url":"https://api.github.com/repos/koding/koding/subscription","commits_url":"https://api.github.com/repos/koding/koding/commits{/sha}","git_commits_url":"https://api.github.com/repos/koding/koding/git/commits{/sha}","comments_url":"https://api.github.com/repos/koding/koding/comments{/number}","issue_comment_url":"https://api.github.com/repos/koding/koding/issues/comments{/number}","contents_url":"https://api.github.com/repos/koding/koding/contents/{+path}","compare_url":"https://api.github.com/repos/koding/koding/compare/{base}...{head}","merges_url":"https://api.github.com/repos/koding/koding/merges","archive_url":"https://api.github.com/repos/koding/koding/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/koding/koding/downloads","issues_url":"https://api.github.com/repos/koding/koding/issues{/number}","pulls_url":"https://api.github.com/repos/koding/koding/pulls{/number}","milestones_url":"https://api.github.com/repos/koding/koding/milestones{/number}","notifications_url":"https://api.github.com/repos/koding/koding/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/koding/koding/labels{/name}","releases_url":"https://api.github.com/repos/koding/koding/releases{/id}","deployments_url":"https://api.github.com/repos/koding/koding/deployments","created_at":"2014-06-29T05:46:24Z","updated_at":"2016-10-10T19:59:34Z","pushed_at":"2016-10-11T15:11:22Z","git_url":"git://github.com/koding/koding.git","ssh_url":"git@github.com:koding/koding.git","clone_url":"https://github.com/koding/koding.git","svn_url":"https://github.com/koding/koding","homepage":"https://www.koding.com","size":790991,"stargazers_count":434,"watchers_count":434,"language":"CoffeeScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":45,"mirror_url":null,"open_issues_count":169,"forks":45,"open_issues":169,"watchers":434,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/koding/koding/pulls/9182"},"html":{"href":"https://github.com/koding/koding/pull/9182"},"issue":{"href":"https://api.github.com/repos/koding/koding/issues/9182"},"comments":{"href":"https://api.github.com/repos/koding/koding/issues/9182/comments"},"review_comments":{"href":"https://api.github.com/repos/koding/koding/pulls/9182/comments"},"review_comment":{"href":"https://api.github.com/repos/koding/koding/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/koding/koding/pulls/9182/commits"},"statuses":{"href":"https://api.github.com/repos/koding/koding/statuses/0b9958ec96b6507a1273d328f4ee05bf416bb833"}}}}
{"actor":{"display_login":"rjeczalik"}}